RunContext
Properties
Section titled “Properties”abortSignal?
Section titled “abortSignal?”optional abortSignal?: AbortSignal;agentTools?
Section titled “agentTools?”optional agentTools?: Record<string, AnyTool>;Agent-scoped tools (agent.tools) for toolScope: 'open' resolution in flow nodes.
autoRetrieve?
Section titled “autoRetrieve?”optional autoRetrieve?: AutoRetrieveProvider;bargeIn?
Section titled “bargeIn?”optional bargeIn?: AbortSignal;baseInstructions?
Section titled “baseInstructions?”optional baseInstructions?: Instructions;Agent base layer, set when entering a flow. baseInstructions
is composed as a prefix into every node turn’s system prompt (persona /
safety / grounding floor); globalTools are safe tools made model-visible
in every speaking turn.
controlModel
Section titled “controlModel”controlModel: LanguageModel;Control-path model (routing, decide, extraction) at temperature 0.
emit: (part) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”void
flowGateJudge?
Section titled “flowGateJudge?”optional flowGateJudge?: | LanguageModel | FlowGateJudgeProvider;Structured judge for flow gates of kind judge. Absent at evaluation
time is an execution error (always blocking).
optional fs?: FileSystem;Agent workspace filesystem (same instance as AgentConfig.workspace).
globalTools?
Section titled “globalTools?”optional globalTools?: Record<string, AnyTool>;inputProcessors
Section titled “inputProcessors”inputProcessors: InputProcessor[];lastRetrievalCitations?
Section titled “lastRetrievalCitations?”optional lastRetrievalCitations?: SourceRef[];Citations from the latest gather-phase retrieval on this turn.
limits?
Section titled “limits?”optional limits?: Limits;memoryService?
Section titled “memoryService?”optional memoryService?: MemoryService;model: LanguageModel;outOfBandControl
Section titled “outOfBandControl”outOfBandControl: boolean;When true, flow reply nodes use the out-of-band control evaluator.
outputProcessors
Section titled “outputProcessors”outputProcessors: OutputProcessor[];policy
Section titled “policy”policy: Policy;Decides allow / ask / deny per tool call. Reassigned on handoff.
refinementPolicies
Section titled “refinementPolicies”refinementPolicies: RefinementCapability[];retrievalCache?
Section titled “retrievalCache?”optional retrievalCache?: RetrievalCacheAdapter;Session retrieval cache (G6): created once per run by the KnowledgeProvider, persists across in-session agent handoffs (this RunContext survives the handoff branch). Keyed by query embedding; RAG-only, undefined without a configured knowledge provider + embedder.
runState
Section titled “runState”runState: RunState;runStore
Section titled “runStore”runStore: RunStore;session
Section titled “session”session: Session;skillActivations?
Section titled “skillActivations?”optional skillActivations?: SkillActivation[];Turn-scoped skills activated by successful load_skill with allowed-tools.
skillCatalog?
Section titled “skillCatalog?”optional skillCatalog?: LiveSkillCatalog;The live skill catalog load_skill resolves against for this run. The frozen roster
in skillPrompt is the baseline; this mutates freely and changes are announced in the
transcript (never by rewriting skillPrompt). Undefined when the agent has no skills.
skillPrompt?
Section titled “skillPrompt?”optional skillPrompt?: string;Level-1 skill metadata injected by SkillsCapability when AgentConfig.skills is set.
telemetry?
Section titled “telemetry?”optional telemetry?: TelemetryOptions;toolExecutor
Section titled “toolExecutor”toolExecutor: EffectToolExecutor;turnInputConsumed?
Section titled “turnInputConsumed?”optional turnInputConsumed?: boolean;Ephemeral, per-run-invocation flag: has the current turn’s user input been
consumed yet by an input-node (collect/decide)? Input-nodes extract/decide
from the turn’s fresh input; once it is consumed, later nodes in the same
turn pause (present prompt, await next turn) instead of acting on stale
context. Reset to false on every createRunContext (i.e. every turn).
validationPolicies
Section titled “validationPolicies”validationPolicies: ValidationCapability[];workingMemoryPrompt?
Section titled “workingMemoryPrompt?”optional workingMemoryPrompt?: string;Frozen persistent memory blocks loaded at session start (AgentMemory.workingMemory).
workingMemoryTools?
Section titled “workingMemoryTools?”optional workingMemoryTools?: Record<string, AnyTool>;Model-visible tools from working memory wiring (not in globalTools — mutating but scoped).
Methods
Section titled “Methods”addSkill()
Section titled “addSkill()”addSkill(skill): Promise<void>;Add a skill to the live catalog for the current session. Announces the change once in
the transcript and leaves skillPrompt byte-identical. No-op when the agent has no skills.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”Promise<void>
approve()
Section titled “approve()”approve(req): Promise<{ approved: boolean; by?: string;}>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
{ |
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<{
approved: boolean;
by?: string;
}>
getSkill()
Section titled “getSkill()”getSkill(name): SkillHandle;Read-only access to bundled skill resources for tool/action code.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”now(): Promise<number>;Returns
Section titled “Returns”Promise<number>
removeSkill()
Section titled “removeSkill()”removeSkill(name): Promise<void>;Withdraw a skill from the live catalog. Announces the withdrawal once. No-op when the agent has no skills or the skill was never available.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Promise<void>
reserveCallsites()
Section titled “reserveCallsites()”reserveCallsites(count): string[];Reserve N contiguous effect callsite ordinals for parallel-safe tool batches (G9).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”string[]
resetCallsites()
Section titled “resetCallsites()”resetCallsites(): void;Rebase durable effect callsites to 0. The runtime calls this at flow entry so a flow’s durable callsites are anchored to the flow — identical on fresh entry (after an answering turn) and on resume (where that turn does not re-run).
Returns
Section titled “Returns”void
signal()
Section titled “signal()”signal<T>(name, opts): Promise<T>;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<T>
tool()
Section titled “tool()”tool( name, args,options?): Promise<unknown>;Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
‐ |
|
|
|
‐ |
|
|
{ |
‐ |
|
|
|
Pre-reserved callsite ordinal for parallel-safe tool batches (G9). |
|
|
‐ |
|
|
|
|
Pre-reserved journal index for parallel-safe tool batches (G9). |
|
|
|
‐ |
|
|
‐ |
Returns
Section titled “Returns”Promise<unknown>
uuid()
Section titled “uuid()”uuid(): Promise<string>;Returns
Section titled “Returns”Promise<string>