Files
deer-flow/frontend/src/core/subagents/context.ts
2026-02-06 17:48:14 +08:00

13 lines
424 B
TypeScript

import { createContext, useContext } from "react";
import type { SubagentState } from "../threads/types";
export const SubagentContext = createContext<Map<string, SubagentState>>(new Map());
export function useSubagentContext() {
const context = useContext(SubagentContext);
if (context === undefined) {
throw new Error("useSubagentContext must be used within a SubagentContext.Provider");
}
return context;
}