AfterInvocationEvent
Defined in: src/hooks/events.ts:168
Event triggered at the end of an agent request. Fired after all processing completes, regardless of success or error. Uses reverse callback ordering for proper cleanup semantics.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AfterInvocationEvent(data): AfterInvocationEvent;Defined in: src/hooks/events.ts:184
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | { agent: LocalAgent; invocationState: InvocationState; } |
data.agent | LocalAgent |
data.invocationState | InvocationState |
Returns
Section titled “Returns”AfterInvocationEvent
Overrides
Section titled “Overrides”Properties
Section titled “Properties”readonly type: "afterInvocationEvent";Defined in: src/hooks/events.ts:169
readonly agent: LocalAgent;Defined in: src/hooks/events.ts:170
invocationState
Section titled “invocationState”readonly invocationState: InvocationState;Defined in: src/hooks/events.ts:171
resume
Section titled “resume”resume: InvokeArgs = undefined;Defined in: src/hooks/events.ts:182
Set by hook callbacks to trigger a follow-up agent invocation with new input. When set, after this event’s callbacks complete the agent re-enters its loop with these args as new input, under the same invocation lock. A fresh BeforeInvocationEvent/AfterInvocationEvent pair fires for the resumed run. Ignored if the invocation ended with an error.
If multiple callbacks set resume, the last callback to run wins.
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): Pick<AfterInvocationEvent, "type">;Defined in: src/hooks/events.ts:199
Serializes for wire transport, excluding the agent reference, invocationState, and mutable resume field. Called automatically by JSON.stringify().
Returns
Section titled “Returns”Pick<AfterInvocationEvent, "type">