MiddlewareInterruptible
Defined in: src/middleware/stages.ts:39
Interface for middleware contexts that support interrupts.
Unlike the hook/tool Interruptible, middleware interrupts return a wrapper
object to allow non-breaking additions in the future.
Extended by
Section titled “Extended by”Methods
Section titled “Methods”interrupt()
Section titled “interrupt()”interrupt<T>(params): MiddlewareInterruptResult<T>;Defined in: src/middleware/stages.ts:51
Request a human-in-the-loop interrupt.
On first execution (no prior response), throws InterruptError to halt the agent.
On resume (after the user provides a response), returns the response wrapped in
MiddlewareInterruptResult.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T | JSONValue |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
params | InterruptParams | Interrupt parameters (name, optional reason, optional preemptive response) |
Returns
Section titled “Returns”The user’s response wrapped in { response: T }
Throws
Section titled “Throws”InterruptError when no response has been provided yet