DelegationContext
Defined in: agents/src/delegation.ts:142
Properties
Section titled “Properties”conversation
Section titled “conversation”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 }] }.
Methods
Section titled “Methods”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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
question |
Omit<QuestionAsk, "type"> |
validate |
(answer) => T |
Returns
Section titled “Returns”Promise<T>
child()
Section titled “child()”Call Signature
Section titled “Call Signature”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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
I |
O |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
workflow |
Workflow<I, O> |
input |
I |
Returns
Section titled “Returns”ChildHandle<O, WorkflowOutcome<O>>
Call Signature
Section titled “Call Signature”child<T>( key, agent, input): ChildHandle<T>;Defined in: agents/src/delegation.ts:167
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
agent |
Agent<T> |
input |
AgentInput |
Returns
Section titled “Returns”ChildHandle<T>
Call Signature
Section titled “Call Signature”child<T>( key, agent, input): ChildHandle<T, RemoteOutcome<T>>;Defined in: agents/src/delegation.ts:168
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
agent |
RemoteAgent<T> |
input |
RemoteInput |
Returns
Section titled “Returns”ChildHandle<T, RemoteOutcome<T>>
join()
Section titled “join()”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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
H extends readonly ChildHandle<unknown, NodeOutcome<unknown>>[] |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
handles |
H |
Returns
Section titled “Returns”Promise<Joined<H>>