BeforeInvocationEvent
Defined in: src/hooks/events.ts:123
Event triggered at the beginning of a new agent request. Fired before any model inference or tool execution occurs.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BeforeInvocationEvent(data): BeforeInvocationEvent;Defined in: src/hooks/events.ts:135
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | { agent: LocalAgent; invocationState: InvocationState; } |
data.agent | LocalAgent |
data.invocationState | InvocationState |
Returns
Section titled “Returns”BeforeInvocationEvent
Overrides
Section titled “Overrides”Properties
Section titled “Properties”readonly type: "beforeInvocationEvent";Defined in: src/hooks/events.ts:124
readonly agent: LocalAgent;Defined in: src/hooks/events.ts:125
invocationState
Section titled “invocationState”readonly invocationState: InvocationState;Defined in: src/hooks/events.ts:126
cancel
Section titled “cancel”cancel: string | boolean = false;Defined in: src/hooks/events.ts:133
Set by hook callbacks to cancel this invocation.
When set to true, a default cancel message is used.
When set to a string, that string is used as the assistant response message.
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): Pick<BeforeInvocationEvent, "type">;Defined in: src/hooks/events.ts:145
Serializes for wire transport, excluding the agent reference and invocationState. Called automatically by JSON.stringify().
Returns
Section titled “Returns”Pick<BeforeInvocationEvent, "type">