Function: executeAgent()
ts
function executeAgent<TIn, TOut, THandle>(
node,
input,
ctx
): Promise<TOut>;Defined in: runtime/agent/execute-agent.ts:86
Executes a passive AgentNode across turns, tool batches, policy guards, skills, capabilities, and beforeStop gates (SPEC.md §3.7.1).
Sequences session initialization (initializeAgentTurnSession), turn-loop execution (runAgentTurnLoop), and deterministic finalization (finalizeAgentTurnSession) at one uniform level of abstraction (Rule 3.1).
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TIn | unknown | Validated agent input payload type. |
TOut | unknown | Validated agent output payload type. |
THandle | unknown | Runtime handle type of the active isolation scope. |
Parameters
| Parameter | Type | Description |
|---|---|---|
node | AgentNode<TIn, TOut, THandle> | Passive AgentNode AST definition. |
input | TIn | Raw or pre-mapped input payload for the agent. |
ctx | StepExecutionContext<THandle> | Active step execution context. |
Returns
Promise<TOut>
Schema-validated agent output payload.