ForcePilot/web/src/components/ToolCallingResult/toolRegistry.js

57 lines
1.3 KiB
JavaScript
Raw Normal View History

import {
BookOpen,
Bot,
Calculator,
CheckSquare,
Database,
FileEdit,
FilePen,
FileText,
Folder,
FolderOutput,
FolderSearch,
Globe,
HelpCircle,
Image,
Network,
SquareTerminal
} from 'lucide-vue-next'
export const TOOL_ICON_MAP = {
ask_user_question: HelpCircle,
bash: SquareTerminal,
calculator: Calculator,
cmd: SquareTerminal,
edit_file: FilePen,
execute: SquareTerminal,
find_kb_document: FolderSearch,
get_mindmap: Network,
glob: FolderSearch,
grep: FolderSearch,
list_directory: Folder,
list_kbs: BookOpen,
ls: Folder,
mysql_describe_table: Database,
mysql_list_tables: Database,
mysql_query: Database,
open_kb_document: FileText,
present_artifacts: FolderOutput,
query_kb: BookOpen,
read_file: FileText,
replace: FilePen,
run_shell_command: SquareTerminal,
search_file_content: FolderSearch,
task: Bot,
tavily_search: Globe,
text_to_img_qwen_image: Image,
write_file: FileEdit,
write_todos: CheckSquare
}
// Keep intentionally hidden tool calls centralized so group summaries and renderers stay consistent.
export const HIDDEN_TOOL_CALL_IDS = ['present_artifacts']
export const getToolCallId = (toolCall) => toolCall?.name || toolCall?.function?.name || ''
export const getToolIcon = (toolId) => TOOL_ICON_MAP[toolId] || null