Interface: CardAgentLike
Minimal structural shape of the Mastra Agent this module drives.
Declared structurally rather than importing @mastra/core’s Agent: this
package must not depend on the Mastra plugin (the plugin depends on nothing
here either), and a turn only ever needs generate. Any object with a
compatible generate satisfies it, which also makes the turn trivially
testable with a stub.
Methods
Section titled “Methods”generate()
Section titled “generate()”generate(
prompt,options):Promise<AgentResult>
Parameters
Section titled “Parameters”prompt
Section titled “prompt”string
options
Section titled “options”abortSignal?
Section titled “abortSignal?”AbortSignal
memory?
Section titled “memory?”{ resource: string; thread: string; }
memory.resource
Section titled “memory.resource”string
memory.thread
Section titled “memory.thread”string
requestContext?
Section titled “requestContext?”unknown
Mastra’s per-turn RequestContext. Opaque here - the object comes from
the agent plugin (see AgentProviderLike.exports) and is only
forwarded - but REQUIRED for parity with the chat endpoints: Mastra’s
user-scoped tools read the AppKit user off it, so a turn without one
answers “the data source is unreachable” where chat answers with data.
structuredOutput?
Section titled “structuredOutput?”{ jsonPromptInjection?: boolean | "system" | "inline"; schema: ZodObject<{ actions: ZodOptional<ZodArray<ZodObject<{ title: ZodString; url: ZodString; }, $strip>>>; facts: ZodOptional<ZodArray<ZodObject<{ title: ZodString; value: ZodString; }, $strip>>>; subtitle: ZodOptional<ZodString>; text: ZodOptional<ZodString>; title: ZodString; }, $strip>; }
structuredOutput.jsonPromptInjection?
Section titled “structuredOutput.jsonPromptInjection?”boolean | "system" | "inline"
structuredOutput.schema
Section titled “structuredOutput.schema”ZodObject<{ actions: ZodOptional<ZodArray<ZodObject<{ title: ZodString; url: ZodString; }, $strip>>>; facts: ZodOptional<ZodArray<ZodObject<{ title: ZodString; value: ZodString; }, $strip>>>; subtitle: ZodOptional<ZodString>; text: ZodOptional<ZodString>; title: ZodString; }, $strip>
Returns
Section titled “Returns”Promise<AgentResult>