mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-10 09:14:45 +08:00
13 lines
424 B
TypeScript
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;
|
|
} |