Skip to content

Interrupt

Defined in: src/interrupt.ts:29

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

readonly id: string;

Defined in: src/interrupt.ts:33

Unique identifier for this interrupt.


readonly name: string;

Defined in: src/interrupt.ts:38

User-defined name for the interrupt.


readonly reason?: JSONValue;

Defined in: src/interrupt.ts:43

User-provided reason for raising the interrupt.


response?: JSONValue;

Defined in: src/interrupt.ts:48

Human response provided when resuming the agent after an interrupt.


readonly source: InterruptSource;

Defined in: src/interrupt.ts:55

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:74

Serializes the interrupt to a JSON-compatible object.

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