Create a map of subagent names to their state types. This is useful for type-safe getSubagentsByType calls.
getSubagentsByType
The DeepAgent to extract from
The tool call type for messages. Defaults to DefaultToolCall.
const agent = createDeepAgent({ subagents: [ { name: "researcher", middleware: [ResearchMiddleware] }, { name: "writer", middleware: [WriterMiddleware] } ] as const,});type StateMap = SubagentStateMap<typeof agent>;// StateMap = { researcher: ResearchState; writer: WriterState } Copy
const agent = createDeepAgent({ subagents: [ { name: "researcher", middleware: [ResearchMiddleware] }, { name: "writer", middleware: [WriterMiddleware] } ] as const,});type StateMap = SubagentStateMap<typeof agent>;// StateMap = { researcher: ResearchState; writer: WriterState }
Create a map of subagent names to their state types. This is useful for type-safe
getSubagentsByTypecalls.