Skip to content

Interface: HarnessBuilder ​

Defined in: builders/harness-builder.ts:22

Fluent builder for the root Paraharness application (P.harness(id)).

Binds the durable state ledger, capacity and runner pools, inbound event streams, execution lanes, signal notification rules, and exposed control-plane servers.

Extends ​

Methods ​

expose() ​

ts
expose(...controlPlanes): HarnessBuilder;

Defined in: builders/harness-builder.ts:120

Exposes inbound control-plane servers (MCP servers, HTTP control planes, Slack bots).

Appends controlPlanes in declaration order to exposedControlPlanes.

Parameters ​

ParameterTypeDescription
...controlPlanesreadonly MaybeBuilder<ControlPlaneASTNode>[]Control-plane AST nodes or builders.

Returns ​

HarnessBuilder

New immutable harness builder.


lanes() ​

ts
lanes(...items): HarnessBuilder;

Defined in: builders/harness-builder.ts:68

Registers concurrent work execution lanes.

Appends items in declaration order to the harness's lanes collection.

Parameters ​

ParameterTypeDescription
...itemsreadonly MaybeBuilder<LaneNode<unknown, string>>[]Lane AST nodes or builders.

Returns ​

HarnessBuilder

New immutable harness builder.


ledger() ​

ts
ledger(ledger): HarnessBuilder;

Defined in: builders/harness-builder.ts:35

Binds the durable state ledger store AST node (SqliteLedgerNode, PostgresLedgerNode, or custom ledger).

Required before .toAST() can compile a valid HarnessNode.

Parameters ​

ParameterTypeDescription
ledgerMaybeBuilder<LedgerStoreASTNode>Ledger store AST node or builder.

Returns ​

HarnessBuilder

New immutable harness builder.


onSignal() ​

Call Signature ​

ts
onSignal<TPayload>(signal, configure): HarnessBuilder;

Defined in: builders/harness-builder.ts:82

Registers a root-level signal notification rule routing signal to a human channel.

Invokes configure with a HarnessSignalNotificationBuilder and appends the compiled rule.

Type Parameters ​
Type ParameterDescription
TPayloadSignal payload type.
Parameters ​
ParameterTypeDescription
signalMaybeBuilder<SignalNode<TPayload>>Target SignalNode or builder.
configure($sig) => HarnessSignalNotificationBuilder<TPayload>Notification configurator callback.
Returns ​

HarnessBuilder

New immutable harness builder.

Call Signature ​

ts
onSignal<TPayload>(
   signal, 
   human, 
   messageMapper
): HarnessBuilder;

Defined in: builders/harness-builder.ts:102

Registers a root-level signal notification rule routing signal directly to human formatted by messageMapper.

Shorthand equivalent to .onSignal(signal, $sig => $sig.notify(human, messageMapper)).

Type Parameters ​
Type ParameterDescription
TPayloadSignal payload type.
Parameters ​
ParameterTypeDescription
signalMaybeBuilder<SignalNode<TPayload>>Target SignalNode or builder.
human| MaybeBuilder<HumanNode<"bidirectional">> | MaybeBuilder<HumanNode<"notify-only">> | MaybeBuilder<HumanNode<"bidirectional" | "notify-only">>Target HumanNode or builder.
messageMapper(payload) => stringNotification message formatter.
Returns ​

HarnessBuilder

New immutable harness builder.


pools() ​

ts
pools(...items): HarnessBuilder;

Defined in: builders/harness-builder.ts:46

Registers account seat pools, model pools, and OS runner pools.

Appends items in declaration order to the harness's pools collection.

Parameters ​

ParameterTypeDescription
...itemsreadonly MaybeBuilder< | NodeRunnerNode | PoolNode<unknown>>[]Pool and runner pool AST nodes or builders.

Returns ​

HarnessBuilder

New immutable harness builder.


streams() ​

ts
streams(...items): HarnessBuilder;

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

Registers inbound webhook or event streams.

Appends items in declaration order to the harness's streams collection.

Parameters ​

ParameterTypeDescription
...itemsreadonly MaybeBuilder<StreamNode<unknown, unknown>>[]Stream AST nodes or builders.

Returns ​

HarnessBuilder

New immutable harness builder.


toAST() ​

ts
toAST(): HarnessNode;

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 ​

HarnessNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique identifier of the harness application.builders/harness-builder.ts:24

Released under the MIT License.