Skip to content

Interrupt

Defined in: src/interrupt.ts:28

Represents an interrupt that can pause agent execution for human-in-the-loop workflows.

readonly id: string;

Defined in: src/interrupt.ts:32

Unique identifier for this interrupt.


readonly name: string;

Defined in: src/interrupt.ts:37

User-defined name for the interrupt.


readonly optional reason?: JSONValue;

Defined in: src/interrupt.ts:42

User-provided reason for raising the interrupt.


optional response?: JSONValue;

Defined in: src/interrupt.ts:47

Human response provided when resuming the agent after an interrupt.


readonly source: InterruptSource;

Defined in: src/interrupt.ts:54

Where this interrupt was raised from — a tool callback, an agent-level hook, or a multi-agent orchestrator hook. Always populated. When deserializing a snapshot produced by an older SDK that did not record this field, defaults to 'hook'.

toJSON(): {
id: string;
name: string;
reason?: JSONValue;
response?: JSONValue;
source: InterruptSource;
};

Defined in: src/interrupt.ts:73

Serializes the interrupt to a JSON-compatible object.

{
id: string;
name: string;
reason?: JSONValue;
response?: JSONValue;
source: InterruptSource;
}
NameTypeDefined in
idstringsrc/interrupt.ts:73
namestringsrc/interrupt.ts:73
reason?JSONValuesrc/interrupt.ts:73
response?JSONValuesrc/interrupt.ts:73
sourceInterruptSourcesrc/interrupt.ts:73