The state type of the subagent. Defaults to Record<string, unknown>
since different subagents may have different state types. Can be narrowed using
DeepAgent type helpers like InferSubagentByName when the specific subagent is known.
The type of tool calls in messages.
The subagent name union type. When inferred from a DeepAgent,
enables typed toolCall.args.subagent_type.
Currently active subagents (where status === "running").
When the subagent completed
Nesting depth (0 = called by main agent, 1 = called by subagent, etc.)
Last seen error from the stream.
Get subagent stream by tool call ID.
The tool call ID that initiated the subagent.
The subagent stream, or undefined if not found.
Get all subagents triggered by a specific AI message.
Useful for rendering subagent activities grouped by the AI message (and therefore conversation turn) that spawned them.
The ID of the AI message that triggered the subagents.
Array of subagent streams triggered by that message.
Get all subagents of a specific type. When called with a literal type name that matches a key in SubagentStates, returns streams with properly inferred state types.
Get tool calls for a specific AI message.
Array of tool calls initiated by the message.
Unique identifier (the tool call ID)
Get the interrupt value for the stream if interrupted.
Convenience alias for interrupts[0].
All current interrupts from the stream. When using Send() fan-out with per-task interrupt() calls, multiple interrupts may be pending simultaneously.
Whether the stream is currently running.
Messages accumulated during the stream.
Namespace path for this subagent execution
Tool call ID of parent subagent (for nested subagents)
Final result content (when complete)
When the subagent started
Current execution status
All currently active and completed subagent streams. Keyed by tool call ID for easy lookup.
The tool call that invoked this subagent
Tool calls paired with their results. Useful for rendering tool invocations and their outputs together.
The current state values of the stream.
Base interface for a single subagent stream. Tracks the lifecycle of a subagent from invocation to completion.
Extends StreamBase to share common properties with UseStream, allowing subagents to be treated similarly to the main stream.
Prefer using SubagentStream which supports passing an agent type directly for automatic type inference.