Represents a single subagent stream.
Supports two usage patterns:
import type { agent } from "./agent";// Automatically infers state and tool call types from the agentconst subagent: SubagentStream<typeof agent> = ...; Copy
import type { agent } from "./agent";// Automatically infers state and tool call types from the agentconst subagent: SubagentStream<typeof agent> = ...;
type ResearcherState = { research_notes: string };const researcher: SubagentStream<ResearcherState, MyToolCall> = ...; Copy
type ResearcherState = { research_notes: string };const researcher: SubagentStream<ResearcherState, MyToolCall> = ...;
Either a DeepAgent/Agent type for automatic inference, or a state type (Record) for explicit typing. Defaults to Record<string, unknown>.
The type of tool calls in messages. Only used when T is a state type. Defaults to DefaultToolCall.
Represents a single subagent stream.
Supports two usage patterns: