import { RAGFlowNodeType } from '@/interfaces/database/flow'; import { HandleType, Position } from '@xyflow/react'; import { createContext } from 'react'; import { useAddNode } from './hooks/use-add-node'; import { useCacheChatLog } from './hooks/use-cache-chat-log'; import { useShowLogSheet } from './hooks/use-show-drawer'; export const AgentFormContext = createContext( undefined, ); type AgentInstanceContextType = Pick< ReturnType, 'addCanvasNode' >; export const AgentInstanceContext = createContext( {} as AgentInstanceContextType, ); type AgentChatContextType = Pick< ReturnType, 'showLogSheet' >; export const AgentChatContext = createContext( {} as AgentChatContextType, ); type AgentChatLogContextType = Pick< ReturnType, 'addEventList' | 'setCurrentMessageId' >; export const AgentChatLogContext = createContext( {} as AgentChatLogContextType, ); export type HandleContextType = { nodeId?: string; id?: string; type: HandleType; position: Position; }; export const HandleContext = createContext( {} as HandleContextType, );