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.
getSubagentsByType: (
type: TName
) => SubagentStreamInterface<SubagentStates[TName], ToolCall, TName>[]// With DeepAgent type inference
const stream = useStream<typeof agent>(...);
const researchers = stream.getSubagentsByType("researcher");
// researchers[0].values is typed with ResearcherMiddleware state