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
AstBuilder<LaneNode<TIn,TStepIds>>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TIn | unknown | Validated lane work item input type. |
TStepIds extends string | string | Union of literal step and branch IDs in the bound FlowNode. |
Methods
agingMinutes()
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
| Parameter | Type | Description |
|---|---|---|
minutes | number | Positive priority aging interval in minutes. |
Returns
LaneBuilder<TIn, TStepIds>
New immutable lane builder.
concurrency()
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
| Parameter | Type | Description |
|---|---|---|
limit | number | Positive integer concurrency limit. |
Returns
LaneBuilder<TIn, TStepIds>
New immutable lane builder.
flow()
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 Parameter | Description |
|---|---|
TFlowStepIds extends string | Union of literal step and branch IDs in flow. |
Parameters
| Parameter | Type | Description |
|---|---|---|
flow | MaybeBuilder<FlowNode<TIn, unknown, TFlowStepIds>> | Flow AST node or builder. |
Returns
LaneBuilder<TIn, TFlowStepIds>
New immutable lane builder narrowed to TFlowStepIds.
input()
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 Parameter | Description |
|---|---|
TNewIn | Validated lane work item input type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNewIn> | Zod schema validating lane work items. |
Returns
LaneBuilder<TNewIn, TStepIds>
New immutable lane builder.
key()
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
| Parameter | Type | Description |
|---|---|---|
mapper | (input) => string | Item deduplication key extractor. |
Returns
LaneBuilder<TIn, TStepIds>
New immutable lane builder.
maxCostUsd()
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
| Parameter | Type | Description |
|---|---|---|
limitUsd | number | Initial 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()
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 Parameter | Description |
|---|---|
TPayload | Signal payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
signal | MaybeBuilder<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()
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
| Parameter | Type | Description |
|---|---|---|
level | "low" | "high" | "normal" | "critical" | Base priority level. |
Returns
LaneBuilder<TIn, TStepIds>
New immutable lane builder.
retry()
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
| Parameter | Type | Description |
|---|---|---|
configure | ($r) => LaneRetryConfigBuilder | Retry configurator callback. |
Returns
LaneBuilder<TIn, TStepIds>
New immutable lane builder.
runs()
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 Parameter | Description |
|---|---|
TFlowStepIds extends string | Union of literal step and branch IDs in flow. |
Parameters
| Parameter | Type | Description |
|---|---|---|
flow | MaybeBuilder<FlowNode<TIn, unknown, TFlowStepIds>> | Flow AST node or builder. |
Returns
LaneBuilder<TIn, TFlowStepIds>
New immutable lane builder narrowed to TFlowStepIds.
toAST()
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
Deeply frozen passive AST node.
Inherited from
tracker()
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 Parameter | Description |
|---|---|
TAdapter extends GithubIssuesTrackerNode<unknown, string> | Tracker AST node type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
adapter | MaybeBuilder<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()
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
| Parameter | Type | Description |
|---|---|---|
depsMapper | (input) => readonly string[] | Prerequisite item key extractor. |
onAbandonedState | string | Terminal state when a prerequisite exits non-done. |
Returns
LaneBuilder<TIn, TStepIds>
New immutable lane builder.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique identifier of the lane. | builders/lane-builder.ts:31 |