Agent
Defined in: packages/core/src/agent/types.ts:248
Bound agent. TOutput is inferred from AgentDefinition.outputSchema and
defaults to string when the schema is omitted.
Heterogeneous registries (e.g. adl.config agents) should widen to AnyAgent
(Agent<any, any, any>) — any in every slot absorbs the variance mismatches a concretely-typed
Agent<Context, Tools, Output> would otherwise hit, so no cast is needed to put one in the array.
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = undefined
Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
Properties
Section titled “Properties”
readonlyid:string
Defined in: packages/core/src/agent/types.ts:253
memoryKind
Section titled “memoryKind”
readonlymemoryKind:string
Defined in: packages/core/src/agent/types.ts:259
Message-store backend this agent persists transcripts to.
Built-ins: "in-memory" | "sqlite". Custom stores: their MessageStore.kind,
or "custom" if omitted.
modelInfo
Section titled “modelInfo”
readonlymodelInfo:AgentModelInfo|null
Defined in: packages/core/src/agent/types.ts:265
Effective model for this agent’s episodes (definition.model, falling back to the
runtime’s defaults.model). null when no model is configured or the model object
reveals neither id nor provider — inspectors should omit the field in that case.
stopWhen
Section titled “stopWhen”
readonlystopWhen:AgentStopWhen
Defined in: packages/core/src/agent/types.ts:273
Resolved stopWhen (definition.stopWhen, or DEFAULT_AGENT_STOP_WHEN).
systemPrompt
Section titled “systemPrompt”
readonlysystemPrompt:Result<string,string>
Defined in: packages/core/src/agent/types.ts:283
Live resolved system prompt from the agent definition (inspectors).
{ isErr: true } when the template cannot render (for example required Zod
fields and no demo) — catalog loads still succeed.
New conversations pin the successful text as the first stored message; later
episodes from the same agent reuse that pin (hot-reload does not change
in-flight chats). A different agent on the same memoryScope keeps the
pin by default and warns; see AgentRunInput.systemPromptConflict.
systemPromptPath
Section titled “systemPromptPath”
readonlysystemPromptPath:string|null
Defined in: packages/core/src/agent/types.ts:288
Relative template path when AgentDefinition.systemPrompt is file-backed;
otherwise null.
titleWorkflowId
Section titled “titleWorkflowId”
readonlytitleWorkflowId:string|null
Defined in: packages/core/src/agent/types.ts:269
Id of AgentDefinition.titleWorkflow when this agent auto-titles conversations.
tools?
Section titled “tools?”
readonlyoptionaltools?:Tools|ToolProvider<Tools,ToolProviderContext>
Defined in: packages/core/src/agent/types.ts:297
definition.tools, verbatim — stays fully parameterized over this agent’s own
Tools/ToolProviderContext rather than erased, since widening a concretely-typed Agent
into AnyAgent (any in every slot) needs no cooperation from this field’s type to
work. Inspect for typeof agent.tools?.getTools === "function", then read .contextSchema
off it (e.g. to build a settings UI form) without needing to know which concrete agent
you’re looking at.
Methods
Section titled “Methods”run(
input):AgentRunHandle<Tools,TOutput>
Defined in: packages/core/src/agent/types.ts:298
Parameters
Section titled “Parameters”AgentRunInput<ToolProviderContext>
Returns
Section titled “Returns”AgentRunHandle<Tools, TOutput>
stream()
Section titled “stream()”stream(
input):AgentStreamHandle<Tools,TOutput>
Defined in: packages/core/src/agent/types.ts:299
Parameters
Section titled “Parameters”AgentStreamInput<ToolProviderContext>
Returns
Section titled “Returns”AgentStreamHandle<Tools, TOutput>