Skip to content

Function: createForkCapabilityBuilder() ​

ts
function createForkCapabilityBuilder<TParentIn, TChildIn, TChildOut, THandle>(toolName, childExecutable): ForkCapabilityBuilder<TParentIn, unknown, TChildIn, TChildOut, THandle>;

Defined in: builders/create-fork-capability-builder.ts:24

Creates a fluent ForkCapabilityBuilder for $cap.fork(toolName, childExecutable, $f => ...).

Validates that toolName is non-empty and initializes historyMode to 'shared-prefix-only'.

Type Parameters ​

Type ParameterDefault typeDescription
TParentInunknownParent actor input payload type.
TChildInunknownChild executable input payload type.
TChildOutunknownChild executable output payload type.
THandleunknownIsolation scope handle type.

Parameters ​

ParameterTypeDescription
toolNamestringTool name exposed to the parent agent.
childExecutableMaybeBuilder< | AgentNode<TChildIn, TChildOut, THandle> | LoopNode<TChildIn, TChildOut, THandle, string>>Child agent or loop.

Returns ​

ForkCapabilityBuilder<TParentIn, unknown, TChildIn, TChildOut, THandle>

Frozen fork capability builder.

Released under the MIT License.