Skip to content
providerkit
GitHub

DelegationContext

Defined in: agents/src/delegation.ts:142

readonly conversation: readonly AgentMessage[];

Defined in: agents/src/delegation.ts:180

The parent’s conversation before this tool call: no system prompt and no unfinished round. Frozen. A child sees none of it unless you forward it, for example { messages: [...context.conversation, { role: "user", content: task }] }.

ask<T>(question, validate): Promise<T>;

Defined in: agents/src/delegation.ts:160

Pure coordination replays from its start. The saved answer is matched by key and checked by this pure validator, not by a saved JavaScript stack. A rejected form is asked again.

Type Parameter
T
Parameter Type
question Omit<QuestionAsk, "type">
validate (answer) => T

Promise<T>


child<I, O>(
key,
workflow,
input
): ChildHandle<O, WorkflowOutcome<O>>;

Defined in: agents/src/delegation.ts:166

key becomes part of the child’s run id and of every operation id under it, which progress events carry and a display layer may send to a browser. Key by position or a fixed name (“topic-1”), never by the input. The input is checked like run’s, except that provider-owned fields are kept: coordinator code is trusted. A child never gets the parent’s session.

Type Parameter
I
O
Parameter Type
key string
workflow Workflow<I, O>
input I

ChildHandle<O, WorkflowOutcome<O>>

child<T>(
key,
agent,
input
): ChildHandle<T>;

Defined in: agents/src/delegation.ts:167

Type Parameter
T
Parameter Type
key string
agent Agent<T>
input AgentInput

ChildHandle<T>

child<T>(
key,
agent,
input
): ChildHandle<T, RemoteOutcome<T>>;

Defined in: agents/src/delegation.ts:168

Type Parameter
T
Parameter Type
key string
agent RemoteAgent<T>
input RemoteInput

ChildHandle<T, RemoteOutcome<T>>


join<H>(handles): Promise<Joined<H>>;

Defined in: agents/src/delegation.ts:174

Settles in caller order, not completion order. No child may outlive this barrier.

Type Parameter
H extends readonly ChildHandle<unknown, NodeOutcome<unknown>>[]
Parameter Type
handles H

Promise<Joined<H>>