Interface: InterruptEdgeBuilder<TIn, TPayload, THandle, TCustomMetrics, TAbortMeta>
Defined in: builders/interrupt-edge-builder.ts:132
Fluent builder for an .onInterrupt(interrupt, $intr => ...) resolution edge on a flow step or actor.
Supports three mutually exclusive resolution modes: automated adjudication (.adjudicateWith(...)), bidirectional human approval (.ask(...)), and abort-plus-replacement (.onAbort(...).replaceWith(...)).
Extends
AstBuilder<InterruptHandlerNode<TIn,TPayload,THandle>>
Type Parameters
Methods
adjudicateWith()
adjudicateWith<TAdjIn, TVerdict>(adjudicator, mapInput): AdjudicateInterruptBuilder<TIn, TPayload, THandle, TVerdict, TAdjIn>;Defined in: builders/interrupt-edge-builder.ts:152
Routes the interrupt to an automated adjudicator step (AgentNode, LoopNode, or CommandNode).
Parks the interrupted actor while running adjudicator with mapInput(input, payload).
Type Parameters
| Type Parameter | Description |
|---|---|
TAdjIn | Adjudicator input payload type. |
TVerdict | Adjudicator output verdict type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
adjudicator | MaybeBuilder<StepASTNode<TAdjIn, TVerdict, THandle>> | Adjudicator step AST node or builder. |
mapInput | (input, payload) => TAdjIn | Input mapper for the adjudicator. |
Returns
AdjudicateInterruptBuilder<TIn, TPayload, THandle, TVerdict, TAdjIn>
Fluent adjudicate interrupt builder.
ask()
ask<TDecision, TMode>(human, responseSchema): AskInterruptBuilder<TPayload, TDecision>;Defined in: builders/interrupt-edge-builder.ts:170
Routes the interrupt to a bidirectional human authority and validates the response with responseSchema.
Rejects 'notify-only' human channels at .ask() builder call time.
Type Parameters
Parameters
| Parameter | Type | Description |
|---|---|---|
human | MaybeBuilder<HumanNode<TMode>> | Bidirectional HumanNode or builder. |
responseSchema | ZodType<TDecision> | Zod schema validating the human decision. |
Returns
AskInterruptBuilder<TPayload, TDecision>
Fluent ask interrupt builder.
onAbort()
onAbort<THook>(abortHook): InterruptEdgeBuilder<TIn, TPayload, THandle, TCustomMetrics, ExtractAbortMeta<THook>>;Defined in: builders/interrupt-edge-builder.ts:186
Binds an explicit abort hook (git.snapshotAndReset()) executed before .replaceWith(...) starts the replacement step.
Narrows TAbortMeta to ExtractAbortMeta<THook> so telemetry.abortMeta is strongly typed in mapReplacementInput.
Type Parameters
| Type Parameter | Description |
|---|---|
THook extends GitSnapshotAndResetNode | Abort hook AST node type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
abortHook | MaybeBuilder<THook> | Abort hook AST node or builder. |
Returns
InterruptEdgeBuilder<TIn, TPayload, THandle, TCustomMetrics, ExtractAbortMeta<THook>>
New immutable interrupt edge builder.
replaceWith()
replaceWith<TRepIn, TRepOut>(replacementExecutable, mapReplacementInput): AstBuilder<ReplaceInterruptHandlerNode<TIn, TPayload, THandle>>;Defined in: builders/interrupt-edge-builder.ts:203
Aborts the interrupted actor and replaces it with replacementExecutable.
Passes (input, payload, telemetry) to mapReplacementInput to construct the replacement step's input.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TRepIn | - | Replacement executable input payload type. |
TRepOut | unknown | Replacement executable output payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
replacementExecutable | MaybeBuilder<StepASTNode<TRepIn, TRepOut, THandle>> | Replacement step AST node or builder. |
mapReplacementInput | (input, payload, telemetry) => TRepIn | Replacement input projector. |
Returns
AstBuilder<ReplaceInterruptHandlerNode<TIn, TPayload, THandle>>
Completed replace interrupt handler builder.
toAST()
toAST(): InterruptHandlerNode;Defined in: ast/ast-builder.ts:20
Compiles the current builder configuration into a deeply frozen passive AST node.
Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.
Returns
Deeply frozen passive AST node.