Interface: CommandBuilder<TIn, TOut, THandle>
Defined in: builders/command-builder.ts:16
Fluent builder for a deterministic TypeScript step command (P.command(id)).
Configures input and output Zod validation schemas, optional active partition extraction, and the passive asynchronous step callback.
Extends
AstBuilder<CommandNode<TIn,TOut,THandle>>
Type Parameters
Methods
input()
input<TNewIn>(schema): CommandBuilder<TNewIn, TOut, THandle>;Defined in: builders/command-builder.ts:32
Binds the Zod input validation schema for the command step.
Resets any previously bound extractPartitions or run callbacks when the input type changes.
Type Parameters
| Type Parameter | Description |
|---|---|
TNewIn | Validated command input payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNewIn> | Zod schema validating step input. |
Returns
CommandBuilder<TNewIn, TOut, THandle>
New immutable command builder.
output()
output<TNewOut>(schema): CommandBuilder<TIn, TNewOut, THandle>;Defined in: builders/command-builder.ts:47
Binds the Zod output validation schema for the command step.
Resets any previously bound run callback when the output type changes.
Type Parameters
| Type Parameter | Description |
|---|---|
TNewOut | Validated command output payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNewOut> | Zod schema validating step output. |
Returns
CommandBuilder<TIn, TNewOut, THandle>
New immutable command builder.
partitions()
partitions(extractor): CommandBuilder<TIn, TOut, THandle>;Defined in: builders/command-builder.ts:60
Binds an optional synchronous partition extractor mapping validated TIn to active partition IDs.
Populates ResolutionContext.activePartitions when the command step executes.
Parameters
| Parameter | Type | Description |
|---|---|---|
extractor | (input) => readonly string[] | Partition ID extractor callback. |
Returns
CommandBuilder<TIn, TOut, THandle>
New immutable command builder.
run()
run<TNewHandle>(fn): CommandBuilder<TIn, TOut, TNewHandle>;Defined in: builders/command-builder.ts:73
Binds the passive asynchronous step callback executed by the runtime's executeCommand executor.
Narrows the builder's scope handle type parameter to TNewHandle.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TNewHandle | THandle | Runtime handle type of the active isolation scope. |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (input, ctx) => Promise<TOut> | Passive step callback. |
Returns
CommandBuilder<TIn, TOut, TNewHandle>
New immutable command builder.
toAST()
toAST(): CommandNode;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.
Inherited from
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique identifier of the command step. | builders/command-builder.ts:19 |