Skip to content

Interface: AgentCapabilitiesBuilder<TParentIn, THandle> ​

Defined in: builders/agent-capabilities-builder.ts:25

Fluent builder for hierarchical orchestration capabilities mounted on an AgentNode (.capabilities($cap => ...)).

Registers downward child forks (.fork()), parallel speculative tournaments (.speculate()), dynamic lane/topology mutations (.mutatePlan()), and human escalations (.escalate()).

Extends ​

Type Parameters ​

Type ParameterDefault typeDescription
TParentInunknownParent actor input payload type.
THandleunknownRuntime handle type of the active isolation scope.

Methods ​

escalate() ​

ts
escalate<TPayload>(interrupt, configure): AgentCapabilitiesBuilder<TParentIn, THandle>;

Defined in: builders/agent-capabilities-builder.ts:108

Registers a voluntary exogenous human escalation capability tool ($cap.escalate(interrupt, $esc => ...)).

Exposes a synthetic tool allowing the agent to page a bidirectional human authority.

Type Parameters ​

Type ParameterDescription
TPayloadEscalation brief payload type validated by interrupt.schema.

Parameters ​

ParameterTypeDescription
interruptMaybeBuilder<InterruptNode<TPayload>>Target interrupt node or builder.
configure($esc) => AstBuilder<EscalateCapabilityNode<TPayload, unknown>>Escalation configurator callback.

Returns ​

AgentCapabilitiesBuilder<TParentIn, THandle>

New immutable capabilities builder.


fork() ​

ts
fork<TChildIn, TChildOut>(
   toolName, 
   childExecutable, 
   configure?
): AgentCapabilitiesBuilder<TParentIn, THandle>;

Defined in: builders/agent-capabilities-builder.ts:43

Registers a downward child fork capability tool ($cap.fork(toolName, childExecutable, configure?)).

Requires the enclosing flow's isolation scope to have capabilityTier: 'branchable'. Defaults requestSchema to childExecutable.inputSchema and mapInput to (_parentIn, req) => req when omitted.

Type Parameters ​

Type ParameterDescription
TChildInChild executable input payload type.
TChildOutChild executable output payload type.

Parameters ​

ParameterTypeDescription
toolNamestringTool name exposed to the parent agent.
childExecutableMaybeBuilder< | AgentNode<TChildIn, TChildOut, THandle> | LoopNode<TChildIn, TChildOut, THandle, string>>Child agent or loop.
configure?($f) => AstBuilder<ForkCapabilityNode<TParentIn, unknown, TChildIn, TChildOut, THandle>>Optional fork builder configurator callback.

Returns ​

AgentCapabilitiesBuilder<TParentIn, THandle>

New immutable capabilities builder.


mutatePlan() ​

ts
mutatePlan(configure): AgentCapabilitiesBuilder<TParentIn, THandle>;

Defined in: builders/agent-capabilities-builder.ts:90

Registers dynamic lane plan and topology contract mutation capabilities ($cap.mutatePlan($m => ...)).

Requires the enclosing flow's isolation scope to have capabilityTier: 'branchable'.

Parameters ​

ParameterTypeDescription
configure($m) => AstBuilder<MutatePlanCapabilityNode<unknown>>Plan mutation configurator callback.

Returns ​

AgentCapabilitiesBuilder<TParentIn, THandle>

New immutable capabilities builder.


speculate() ​

ts
speculate(toolName, configure): AgentCapabilitiesBuilder<TParentIn, THandle>;

Defined in: builders/agent-capabilities-builder.ts:63

Registers a parallel speculative tournament capability tool ($cap.speculate(toolName, $s => ...)).

Requires the enclosing flow's isolation scope to have capabilityTier: 'branchable'.

Parameters ​

ParameterTypeDescription
toolNamestringTool name exposed to the parent agent.
configure($s) => AstBuilder<SpeculateCapabilityNode<TParentIn, unknown, unknown, unknown, THandle, unknown, unknown>>Speculate builder configurator callback.

Returns ​

AgentCapabilitiesBuilder<TParentIn, THandle>

New immutable capabilities builder.


toAST() ​

ts
toAST(): AgentCapabilitiesNode;

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 ​

AgentCapabilitiesNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Released under the MIT License.