Skip to content

Interface: HumanBuilder<TMode> ​

Defined in: builders/human-builder.ts:15

Fluent builder for external human authorities and notification channels (P.human(id)).

Tracks the channel interaction mode ('bidirectional' | 'notify-only') at the type level so .ask(), .escalate(), and .maxCostUsd() reject notify-only channels.

Extends ​

Type Parameters ​

Type ParameterDefault typeDescription
TMode extends "bidirectional" | "notify-only""bidirectional" | "notify-only"Interaction mode of the bound channel ('bidirectional' | 'notify-only').

Methods ​

keepAliveSeconds() ​

ts
keepAliveSeconds(seconds): HumanBuilder<TMode>;

Defined in: builders/human-builder.ts:30

Sets the keep-alive duration in seconds before yielding a concurrency slot while awaiting a human decision.

When a human response takes longer than seconds, the runtime checkpoints and releases the active slot.

Parameters ​

ParameterTypeDescription
secondsnumberPositive keep-alive duration in seconds.

Returns ​

HumanBuilder<TMode>

New immutable human builder.


notify() ​

ts
notify<TNextMode>(channel): HumanBuilder<TNextMode>;

Defined in: builders/human-builder.ts:43

Binds the underlying HumanChannelASTNode (slack.bot(...) or slack.webhook(...)) used to reach the human.

Narrows the builder's TMode type parameter to the channel's interactionMode.

Type Parameters ​

Type ParameterDescription
TNextMode extends "bidirectional" | "notify-only"Interaction mode of channel ('bidirectional' | 'notify-only').

Parameters ​

ParameterTypeDescription
channelMaybeBuilder<HumanChannelASTNode<TNextMode>>Human channel AST node or builder.

Returns ​

HumanBuilder<TNextMode>

New immutable human builder narrowed to TNextMode.


toAST() ​

ts
toAST(): HumanNode;

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 ​

HumanNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST


withName() ​

ts
withName(alias): ScopedHumanNameBuilder;

Defined in: builders/human-builder.ts:56

Creates a role-aliased human target builder (human.withName(alias).output(schema)).

Used to bind a named decision role and response schema to a bidirectional human authority.

Parameters ​

ParameterTypeDescription
aliasstringRole alias for the decision target (e.g. 'budget-approver').

Returns ​

ScopedHumanNameBuilder

Intermediate builder requiring .output(schema).

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique identifier of the human authority role.builders/human-builder.ts:19

Released under the MIT License.