Interface: ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>
Defined in: builders/fork-capability-builder.ts:18
Fluent sub-builder for a downward child fork capability ($cap.fork(toolName, childExecutable, $f => ...)).
Configures transcript sharing (historyMode), request validation (requestSchema), child input projection (mapInput), and conditional model routing (modelRouting).
Extends
AstBuilder<ForkCapabilityNode<TParentIn,TReq,TChildIn,TChildOut,THandle>>
Type Parameters
Methods
historyMode()
historyMode(mode): ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>;Defined in: builders/fork-capability-builder.ts:34
Configures the transcript history sharing mode ('shared-prefix-only' or 'clone-transcript').
Defaults to 'shared-prefix-only'; 'clone-transcript' requires toolsMode: 'union' when toolsets differ.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | "shared-prefix-only" | "clone-transcript" | Transcript sharing mode. |
Returns
ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>
New immutable fork builder.
mapInput()
mapInput(mapper): ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>;Defined in: builders/fork-capability-builder.ts:62
Binds the synchronous mapper projecting (parentInput, req) into the child executable's input TChildIn.
Invoked before branching the isolation scope and starting the child executable.
Parameters
| Parameter | Type | Description |
|---|---|---|
mapper | (parentInput, req) => TChildIn | Child input projection callback. |
Returns
ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>
New immutable fork builder.
modelRouting()
modelRouting(configure): ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>;Defined in: builders/fork-capability-builder.ts:75
Configures conditional model routing for the forked child session.
Invokes configure with a ForkModelRoutingBuilder and attaches the resulting routing config.
Parameters
| Parameter | Type | Description |
|---|---|---|
configure | ($m) => ForkModelRoutingBuilder<TParentIn, TReq> | Model routing configurator callback. |
Returns
ForkCapabilityBuilder<TParentIn, TReq, TChildIn, TChildOut, THandle>
New immutable fork builder.
requestSchema()
requestSchema<TNewReq>(schema): ForkCapabilityBuilder<TParentIn, TNewReq, TChildIn, TChildOut, THandle>;Defined in: builders/fork-capability-builder.ts:49
Binds the Zod validation schema for the parent agent's fork tool call arguments.
Resets any previously bound mapInput or modelRouting callbacks when the request type changes.
Type Parameters
| Type Parameter | Description |
|---|---|
TNewReq | Validated fork request payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNewReq> | Zod schema for the fork request. |
Returns
ForkCapabilityBuilder<TParentIn, TNewReq, TChildIn, TChildOut, THandle>
New immutable fork builder.
toAST()
toAST(): ForkCapabilityNode;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.