AgentOptions
Defined in: agent/agent.ts:71
Configuration options for the Agent.
Properties
Section titled “Properties”baseDepth?
Section titled “baseDepth?”
optionalbaseDepth:number
Defined in: agent/agent.ts:178
Base depth for nodes created by this agent. Root agents use 0; subagents use (parentDepth + 1).
client
Section titled “client”client:
LLMist
Defined in: agent/agent.ts:73
The LLM client
compactionConfig?
Section titled “compactionConfig?”
optionalcompactionConfig:CompactionConfig
Defined in: agent/agent.ts:143
Context compaction configuration (enabled by default)
defaultGadgetTimeoutMs?
Section titled “defaultGadgetTimeoutMs?”
optionaldefaultGadgetTimeoutMs:number
Defined in: agent/agent.ts:131
Default gadget timeout
gadgetArgPrefix?
Section titled “gadgetArgPrefix?”
optionalgadgetArgPrefix:string
Defined in: agent/agent.ts:109
Custom gadget argument prefix for block format parameters
gadgetEndPrefix?
Section titled “gadgetEndPrefix?”
optionalgadgetEndPrefix:string
Defined in: agent/agent.ts:106
Custom gadget end prefix
gadgetOutputLimit?
Section titled “gadgetOutputLimit?”
optionalgadgetOutputLimit:boolean
Defined in: agent/agent.ts:137
Enable gadget output limiting (default: true)
gadgetOutputLimitPercent?
Section titled “gadgetOutputLimitPercent?”
optionalgadgetOutputLimitPercent:number
Defined in: agent/agent.ts:140
Max gadget output as % of model context window (default: 15)
gadgetStartPrefix?
Section titled “gadgetStartPrefix?”
optionalgadgetStartPrefix:string
Defined in: agent/agent.ts:103
Custom gadget start prefix
hooks?
Section titled “hooks?”
optionalhooks:AgentHooks
Defined in: agent/agent.ts:97
Clean hooks system
initialMessages?
Section titled “initialMessages?”
optionalinitialMessages:object[]
Defined in: agent/agent.ts:112
Initial messages. User messages support multimodal content.
content
Section titled “content”content:
MessageContent
role:
"system"|"user"|"assistant"
logger?
Section titled “logger?”
optionallogger:Logger<ILogObj>
Defined in: agent/agent.ts:94
Logger
maxIterations?
Section titled “maxIterations?”
optionalmaxIterations:number
Defined in: agent/agent.ts:85
Maximum iterations
model:
string
Defined in: agent/agent.ts:76
The model ID
onSubagentEvent()?
Section titled “onSubagentEvent()?”
optionalonSubagentEvent: (event) =>void
Defined in: agent/agent.ts:155
Callback for subagent gadgets to report subagent events to parent
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
parentNodeId?
Section titled “parentNodeId?”
optionalparentNodeId:string
Defined in: agent/agent.ts:172
Parent node ID in the tree (when this agent is a subagent). Used to set parentId on all nodes created by this agent.
parentTree?
Section titled “parentTree?”
optionalparentTree:ExecutionTree
Defined in: agent/agent.ts:166
Shared execution tree for tracking all LLM calls and gadget executions. If provided (by a parent subagent), nodes are added to this tree. If not provided, the Agent creates its own tree.
promptConfig?
Section titled “promptConfig?”
optionalpromptConfig:PromptTemplateConfig
Defined in: agent/agent.ts:134
Custom prompt configuration for gadget system prompts
registry
Section titled “registry”registry:
GadgetRegistry
Defined in: agent/agent.ts:91
Gadget registry
requestHumanInput()?
Section titled “requestHumanInput()?”
optionalrequestHumanInput: (question) =>Promise<string>
Defined in: agent/agent.ts:100
Callback for requesting human input during execution
Parameters
Section titled “Parameters”question
Section titled “question”string
Returns
Section titled “Returns”Promise<string>
retryConfig?
Section titled “retryConfig?”
optionalretryConfig:RetryConfig
Defined in: agent/agent.ts:146
Retry configuration for LLM API calls (enabled by default)
signal?
Section titled “signal?”
optionalsignal:AbortSignal
Defined in: agent/agent.ts:149
Optional abort signal for cancelling requests mid-flight
subagentConfig?
Section titled “subagentConfig?”
optionalsubagentConfig:SubagentConfigMap
Defined in: agent/agent.ts:152
Subagent-specific configuration overrides (from CLI config)
systemPrompt?
Section titled “systemPrompt?”
optionalsystemPrompt:string
Defined in: agent/agent.ts:79
System prompt
temperature?
Section titled “temperature?”
optionaltemperature:number
Defined in: agent/agent.ts:88
Temperature
textOnlyHandler?
Section titled “textOnlyHandler?”
optionaltextOnlyHandler:TextOnlyHandler
Defined in: agent/agent.ts:115
Text-only handler
textWithGadgetsHandler?
Section titled “textWithGadgetsHandler?”
optionaltextWithGadgetsHandler:object
Defined in: agent/agent.ts:121
Handler for text content that appears alongside gadget calls. When set, text accompanying gadgets will be wrapped as a synthetic gadget call.
gadgetName
Section titled “gadgetName”gadgetName:
string
Name of the gadget to use for wrapping text
parameterMapping()
Section titled “parameterMapping()”parameterMapping: (
text) =>Record<string,unknown>
Maps text content to gadget parameters
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Record<string, unknown>
resultMapping()?
Section titled “resultMapping()?”
optionalresultMapping: (text) =>string
Maps text content to the result string (optional, defaults to text)
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
userPrompt?
Section titled “userPrompt?”
optionaluserPrompt:string|ContentPart[]
Defined in: agent/agent.ts:82
Initial user prompt (optional if using build()). Can be text or multimodal content.