InterruptParams
Defined in: src/types/interrupt.ts:14
Parameters for raising an interrupt.
Properties
Section titled “Properties”name: string;Defined in: src/types/interrupt.ts:19
User-defined name for the interrupt. Must be unique within a single hook callback or tool execution.
reason?
Section titled “reason?”optional reason?: JSONValue;Defined in: src/types/interrupt.ts:24
User-provided reason for the interrupt.
response?
Section titled “response?”optional response?: JSONValue;Defined in: src/types/interrupt.ts:42
Preemptive response to use if available. When provided, the interrupt returns this value immediately without halting agent execution. Useful for session-managed trust responses where a previous user response can be reused.
Example
Section titled “Example”// If user already approved in a previous session, skip the interruptconst approval = context.interrupt({ name: 'confirm_delete', reason: 'Confirm deletion?', response: agent.appState['savedApproval'],})