Skip to content

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.

ToolProviderContext = undefined

Tools extends ToolSet = ToolSet

TOutput = string

readonly id: string

Defined in: packages/core/src/agent/types.ts:253


readonly memoryKind: 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.


readonly modelInfo: 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.


readonly stopWhen: AgentStopWhen

Defined in: packages/core/src/agent/types.ts:273

Resolved stopWhen (definition.stopWhen, or DEFAULT_AGENT_STOP_WHEN).


readonly systemPrompt: 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.


readonly systemPromptPath: string | null

Defined in: packages/core/src/agent/types.ts:288

Relative template path when AgentDefinition.systemPrompt is file-backed; otherwise null.


readonly titleWorkflowId: string | null

Defined in: packages/core/src/agent/types.ts:269

Id of AgentDefinition.titleWorkflow when this agent auto-titles conversations.


readonly optional tools?: 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.

run(input): AgentRunHandle<Tools, TOutput>

Defined in: packages/core/src/agent/types.ts:298

AgentRunInput<ToolProviderContext>

AgentRunHandle<Tools, TOutput>


stream(input): AgentStreamHandle<Tools, TOutput>

Defined in: packages/core/src/agent/types.ts:299

AgentStreamInput<ToolProviderContext>

AgentStreamHandle<Tools, TOutput>