Interface: AskInterruptBuilder<TPayload, TDecision>
Defined in: builders/interrupt-edge-builder.ts:91
Fluent builder for a human-in-the-loop interrupt edge (.ask(human, responseSchema)).
Configures optional conditional .elevateLeaseWhen(...) sandbox lease grants and the mandatory .resumeWith(formatter) callback converting the human decision into a resume note.
Extends
AstBuilder<AskInterruptHandlerNode<TPayload,TDecision>>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Validated interrupt payload type. |
TDecision | unknown | Validated human decision response type. |
Methods
elevateLeaseWhen()
elevateLeaseWhen(predicate, leaseMapper): AskInterruptBuilder<TPayload, TDecision>;Defined in: builders/interrupt-edge-builder.ts:103
Conditionally elevates the paused actor's write lease when predicate(decision) returns true.
Applies the LeaseDelta returned by leaseMapper(decision) before resuming the actor.
Parameters
| Parameter | Type | Description |
|---|---|---|
predicate | (decision) => boolean | Lease elevation condition over the human decision. |
leaseMapper | (decision) => LeaseDelta | Lease delta factory over the human decision. |
Returns
AskInterruptBuilder<TPayload, TDecision>
New immutable ask interrupt builder.
resumeWith()
resumeWith(formatter): AskInterruptBuilder<TPayload, TDecision>;Defined in: builders/interrupt-edge-builder.ts:117
Binds the synchronous formatter converting the validated TDecision into an in-band resume note.
Required to complete an AskInterruptHandlerNode.
Parameters
| Parameter | Type | Description |
|---|---|---|
formatter | (decision) => string | Decision-to-string resume formatter. |
Returns
AskInterruptBuilder<TPayload, TDecision>
New immutable ask interrupt builder.
toAST()
toAST(): AskInterruptHandlerNode;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.