Skip to content

Interface: InterruptBuilder<TPayload> ​

Defined in: ast/interrupt-builder.ts:13

Immutable fluent builder and property projection for InterruptNode.

Exposes id, type, and schema directly on the builder instance so adjudicator input schemas and union schemas can reference interrupt.schema directly.

Extends ​

Extended by ​

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownValidated output type of the interrupt payload schema.

Methods ​

payload() ​

ts
payload<TNext>(schema): InterruptBuilder<TNext>;

Defined in: ast/interrupt-builder.ts:33

Binds a new Zod payload schema to the interrupt definition, returning a strongly typed builder clone.

Preserves the interrupt id while replacing schema on a newly frozen copy-on-write InterruptBuilder<TNext> instance.

Type Parameters ​

Type ParameterDescription
TNextValidated output type of schema.

Parameters ​

ParameterTypeDescription
schemaZodType<TNext>Zod schema governing raised interrupt payloads.

Returns ​

InterruptBuilder<TNext>

New immutable InterruptBuilder typed to TNext.


toAST() ​

ts
toAST(): InterruptNode;

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 ​

InterruptNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique logical identifier of the interrupt.ast/interrupt-builder.ts:17
schemareadonlyZodType<TPayload>Zod schema used to validate payloads raised with this interrupt.ast/interrupt-builder.ts:19
typereadonly"harness:interrupt"Discriminant identifying a core interrupt definition node.ast/interrupt-builder.ts:15

Released under the MIT License.