Skip to content

BeforeInvocationEvent

Defined in: src/hooks/events.ts:139

Event triggered at the beginning of a new agent request. Fired before any model inference or tool execution occurs.

new BeforeInvocationEvent(data): BeforeInvocationEvent;

Defined in: src/hooks/events.ts:151

ParameterType
data{ agent: LocalAgent; invocationState: InvocationState; }
data.agentLocalAgent
data.invocationStateInvocationState

BeforeInvocationEvent

HookableEvent.constructor

readonly type: "beforeInvocationEvent";

Defined in: src/hooks/events.ts:140


readonly agent: LocalAgent;

Defined in: src/hooks/events.ts:141


readonly invocationState: InvocationState;

Defined in: src/hooks/events.ts:142


cancel: string | boolean = false;

Defined in: src/hooks/events.ts:149

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.

toJSON(): Pick<BeforeInvocationEvent, "type">;

Defined in: src/hooks/events.ts:161

Serializes for wire transport, excluding the agent reference and invocationState. Called automatically by JSON.stringify().

Pick<BeforeInvocationEvent, "type">