AgentRunEvents
type AgentRunEvents = { completed: (prompt) => void; error: (error) => void; interrupted: (args) => void; output:added: (args) => void; output:delta: (args) => void; output:updated: (args) => void;};Defined in: agent/src/agent/agent.run.ts:72
Events emitted by AgentRun as a run progresses: output:added when a
new output (text or tool call) appears, output:delta for streamed text
fragments, output:updated when an existing output changes, interrupted
when an action suspends the run, completed when it finishes, and error
on an unrecoverable failure.
Properties
Section titled “Properties”completed
Section titled “completed”completed: (prompt) => void;Defined in: agent/src/agent/agent.run.ts:77
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
prompt |
Prompt |
Returns
Section titled “Returns”void
error: (error) => void;Defined in: agent/src/agent/agent.run.ts:78
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error |
unknown |
Returns
Section titled “Returns”void
interrupted
Section titled “interrupted”interrupted: (args) => void;Defined in: agent/src/agent/agent.run.ts:76
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ data: unknown; message: string; prompt: Prompt; } |
args.data |
unknown |
args.message |
string |
args.prompt |
Prompt |
Returns
Section titled “Returns”void
output:added
Section titled “output:added”output:added: (args) => void;Defined in: agent/src/agent/agent.run.ts:73
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ output: PromptOutput; prompt: Prompt; } |
args.output |
PromptOutput |
args.prompt |
Prompt |
Returns
Section titled “Returns”void
output:delta
Section titled “output:delta”output:delta: (args) => void;Defined in: agent/src/agent/agent.run.ts:74
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ delta: string; outputId: string; prompt: Prompt; } |
args.delta |
string |
args.outputId |
string |
args.prompt |
Prompt |
Returns
Section titled “Returns”void
output:updated
Section titled “output:updated”output:updated: (args) => void;Defined in: agent/src/agent/agent.run.ts:75
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
{ output: PromptOutput; prompt: Prompt; } |
args.output |
PromptOutput |
args.prompt |
Prompt |
Returns
Section titled “Returns”void