InterruptEvent
Defined in: src/hooks/events.ts:753
Event emitted when an interrupt is raised during agent execution. The interrupt.source
field discriminates between tool-callback and hook-callback origins. One event fires
per unanswered interrupt at the moment the agent stops to wait for responses.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InterruptEvent(data): InterruptEvent;Defined in: src/hooks/events.ts:759
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | { agent: LocalAgent; interrupt: Interrupt; invocationState: InvocationState; } & HookableEventData |
Returns
Section titled “Returns”InterruptEvent
Overrides
Section titled “Overrides”Properties
Section titled “Properties”invocationContext?
Section titled “invocationContext?”readonly invocationContext?: InvocationContext;Defined in: src/hooks/events.ts:100
The request this event belongs to (undefined outside one); pass it to InvokeOptions.invocationContext to join it.
Inherited from
Section titled “Inherited from”HookableEvent.invocationContext
readonly type: "interruptEvent";Defined in: src/hooks/events.ts:754
readonly agent: LocalAgent;Defined in: src/hooks/events.ts:755
interrupt
Section titled “interrupt”readonly interrupt: Interrupt;Defined in: src/hooks/events.ts:756
invocationState
Section titled “invocationState”readonly invocationState: InvocationState;Defined in: src/hooks/events.ts:757
Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): Pick<InterruptEvent, "type"> & { interrupt: { id: string; name: string; reason?: JSONValue; response?: JSONValue; source: InterruptSource; };};Defined in: src/hooks/events.ts:767
Serializes for wire transport, excluding agent and invocationState.
Returns
Section titled “Returns”Pick<InterruptEvent, "type"> & {
interrupt: {
id: string;
name: string;
reason?: JSONValue;
response?: JSONValue;
source: InterruptSource;
};
}