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
AstBuilder<AgentCapabilitiesNode<TParentIn,THandle>>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TParentIn | unknown | Parent actor input payload type. |
THandle | unknown | Runtime handle type of the active isolation scope. |
Methods
escalate()
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 Parameter | Description |
|---|---|
TPayload | Escalation brief payload type validated by interrupt.schema. |
Parameters
| Parameter | Type | Description |
|---|---|---|
interrupt | MaybeBuilder<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()
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 Parameter | Description |
|---|---|
TChildIn | Child executable input payload type. |
TChildOut | Child executable output payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
toolName | string | Tool name exposed to the parent agent. |
childExecutable | MaybeBuilder< | 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()
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
| Parameter | Type | Description |
|---|---|---|
configure | ($m) => AstBuilder<MutatePlanCapabilityNode<unknown>> | Plan mutation configurator callback. |
Returns
AgentCapabilitiesBuilder<TParentIn, THandle>
New immutable capabilities builder.
speculate()
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
| Parameter | Type | Description |
|---|---|---|
toolName | string | Tool 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()
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
Deeply frozen passive AST node.