Skip to content

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 ​

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownValidated interrupt payload type.
TDecisionunknownValidated human decision response type.

Methods ​

elevateLeaseWhen() ​

ts
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 ​

ParameterTypeDescription
predicate(decision) => booleanLease elevation condition over the human decision.
leaseMapper(decision) => LeaseDeltaLease delta factory over the human decision.

Returns ​

AskInterruptBuilder<TPayload, TDecision>

New immutable ask interrupt builder.


resumeWith() ​

ts
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 ​

ParameterTypeDescription
formatter(decision) => stringDecision-to-string resume formatter.

Returns ​

AskInterruptBuilder<TPayload, TDecision>

New immutable ask interrupt builder.


toAST() ​

ts
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 ​

AskInterruptHandlerNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Released under the MIT License.