Skip to content

Interface: LaneBuilder<TIn, TStepIds> ​

Defined in: builders/lane-builder.ts:28

Fluent builder for a concurrent work execution lane (P.lane(id)).

Configures work-item schema validation, deduplication keys, external tracker polling, flow execution, concurrency and priority aging, prerequisites, cost ceilings, and signal rewinds.

Extends ​

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownValidated lane work item input type.
TStepIds extends stringstringUnion of literal step and branch IDs in the bound FlowNode.

Methods ​

agingMinutes() ​

ts
agingMinutes(minutes): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:143

Sets the priority aging interval in minutes to prevent starvation of lower-priority items.

Queued items waiting longer than multiples of minutes receive incremental priority boosts.

Parameters ​

ParameterTypeDescription
minutesnumberPositive priority aging interval in minutes.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


concurrency() ​

ts
concurrency(limit): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:121

Sets the maximum number of concurrent runs executing in parallel within this lane.

Throws immediately at builder call time if limit < 1 or is not an integer.

Parameters ​

ParameterTypeDescription
limitnumberPositive integer concurrency limit.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


flow() ​

ts
flow<TFlowStepIds>(flow): LaneBuilder<TIn, TFlowStepIds>;

Defined in: builders/lane-builder.ts:93

Binds the FlowNode executed for each work item in the lane.

Narrows TStepIds to TFlowStepIds so .onSignal(...).rewindTo(stepId) is statically checked.

Type Parameters ​

Type ParameterDescription
TFlowStepIds extends stringUnion of literal step and branch IDs in flow.

Parameters ​

ParameterTypeDescription
flowMaybeBuilder<FlowNode<TIn, unknown, TFlowStepIds>>Flow AST node or builder.

Returns ​

LaneBuilder<TIn, TFlowStepIds>

New immutable lane builder narrowed to TFlowStepIds.


input() ​

ts
input<TNewIn>(schema): LaneBuilder<TNewIn, TStepIds>;

Defined in: builders/lane-builder.ts:44

Binds the Zod validation schema for work items entering the lane.

Preserves all previously configured key, tracker, flow, waitFor, and onSignal bindings.

Type Parameters ​

Type ParameterDescription
TNewInValidated lane work item input type.

Parameters ​

ParameterTypeDescription
schemaZodType<TNewIn>Zod schema validating lane work items.

Returns ​

LaneBuilder<TNewIn, TStepIds>

New immutable lane builder.


key() ​

ts
key(mapper): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:57

Binds the synchronous extractor returning the unique deduplication key (itemKey) for each work item.

Used by the lane scheduler to deduplicate inbound items and correlate prerequisite edges.

Parameters ​

ParameterTypeDescription
mapper(input) => stringItem deduplication key extractor.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


maxCostUsd() ​

ts
maxCostUsd(limitUsd, approver): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:172

Configures a per-run USD cost limit and the scoped bidirectional human budget approver.

Validates at builder call time that approver wraps a 'bidirectional' human channel. Accepts either human.withName(alias).output(BudgetApprovalSchema) or a bidirectional HumanNode / HumanBuilder directly (defaulting alias to `${human.id}:budget-approver` and outputSchema to BudgetApprovalSchema).

Parameters ​

ParameterTypeDescription
limitUsdnumberInitial USD budget ceiling per run.
approver| MaybeBuilder<HumanNode<"bidirectional">> | MaybeBuilder<HumanNode<"notify-only">> | MaybeBuilder<HumanNode<"bidirectional" | "notify-only">> | MaybeBuilder<ScopedHumanTargetNode<{ approved: boolean; increaseLimitToUsd?: number; }>>Scoped or direct bidirectional human target.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


onSignal() ​

ts
onSignal<TPayload>(signal, configure): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:204

Registers a live signal steering and step rewind handler on the lane.

Validates that the handler's rewindToStepId exists in flow.nodes.

Type Parameters ​

Type ParameterDescription
TPayloadSignal payload type.

Parameters ​

ParameterTypeDescription
signalMaybeBuilder<SignalNode<TPayload>>Target SignalNode or builder.
configure($s) => LaneSignalHandlerBuilder<TIn, TStepIds, TPayload>Signal handler configurator callback.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


priority() ​

ts
priority(level): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:132

Sets the base scheduling priority level ('low' | 'normal' | 'high' | 'critical').

Defaults to 'normal' when not explicitly overridden.

Parameters ​

ParameterTypeDescription
level"low" | "high" | "normal" | "critical"Base priority level.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


retry() ​

ts
retry(configure): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:190

Configures step retry attempts and exponential backoff for the lane.

Invokes configure with a LaneRetryBuilder and attaches the compiled LaneRetryConfig.

Parameters ​

ParameterTypeDescription
configure($r) => LaneRetryConfigBuilderRetry configurator callback.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


runs() ​

ts
runs<TFlowStepIds>(flow): LaneBuilder<TIn, TFlowStepIds>;

Defined in: builders/lane-builder.ts:108

Alias for .flow(flow) binding the FlowNode executed for each work item in the lane.

Narrows TStepIds to TFlowStepIds identically to .flow(flow).

Type Parameters ​

Type ParameterDescription
TFlowStepIds extends stringUnion of literal step and branch IDs in flow.

Parameters ​

ParameterTypeDescription
flowMaybeBuilder<FlowNode<TIn, unknown, TFlowStepIds>>Flow AST node or builder.

Returns ​

LaneBuilder<TIn, TFlowStepIds>

New immutable lane builder narrowed to TFlowStepIds.


toAST() ​

ts
toAST(): LaneNode;

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 ​

LaneNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST


tracker() ​

ts
tracker<TAdapter>(adapter, configure): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:71

Configures external issue tracker polling and bidirectional state synchronization.

Infers ExtractTrackerExternal<TAdapter> and ExtractTrackerState<TAdapter> from adapter.

Type Parameters ​

Type ParameterDescription
TAdapter extends GithubIssuesTrackerNode<unknown, string>Tracker AST node type.

Parameters ​

ParameterTypeDescription
adapterMaybeBuilder<TAdapter>Tracker adapter AST node or builder.
configure($t) => LaneTrackerConfigBuilder<TIn, ExtractTrackerExternal<TAdapter>, ExtractTrackerState<TAdapter>>Tracker configurator callback.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.


waitFor() ​

ts
waitFor(depsMapper, onAbandonedState): LaneBuilder<TIn, TStepIds>;

Defined in: builders/lane-builder.ts:155

Configures prerequisite dependency extraction and the terminal fallback state when a dependency is abandoned.

Holds queued items in 'waiting' until all prerequisite keys returned by depsMapper exit 'done'.

Parameters ​

ParameterTypeDescription
depsMapper(input) => readonly string[]Prerequisite item key extractor.
onAbandonedStatestringTerminal state when a prerequisite exits non-done.

Returns ​

LaneBuilder<TIn, TStepIds>

New immutable lane builder.

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique identifier of the lane.builders/lane-builder.ts:31

Released under the MIT License.