import type { ToolWithMetadata } from './types.js'; import { toolRegistry } from './registry.js'; // Shell 工具 import { bashTool } from './shell/index.js'; // 核心工具 import { toolSearchTool } from './tool-search.js'; import { todoReadTool, todoWriteTool } from './todo/index.js'; // Task 工具(Agent 子任务) import { taskTool } from './task/index.js'; // 文件系统工具 import { readFileTool, writeFileTool, editFileTool, listDirTool, createDirectoryTool, searchFilesTool, grepContentTool, getFileInfoTool, moveFileTool, copyFileTool, deleteFileTool, } from './filesystem/index.js'; // Web 工具 import { webSearchTool, webExtractTool } from './web/index.js'; // Git 工具 import { gitStatusTool, gitDiffTool, gitLogTool, gitBranchTool, gitAddTool, gitCommitTool, gitPushTool, gitPullTool, gitCheckoutTool, gitStashTool, } from './git/index.js'; // 所有工具列表(用于注册) const allToolsWithMetadata: ToolWithMetadata[] = [ // 核心工具 (deferLoading: false) toolSearchTool, bashTool, todoReadTool, todoWriteTool, taskTool, // 文件系统工具 (deferLoading: true) readFileTool, writeFileTool, editFileTool, listDirTool, createDirectoryTool, searchFilesTool, grepContentTool, getFileInfoTool, moveFileTool, copyFileTool, deleteFileTool, // Web 工具 (deferLoading: false) webSearchTool, webExtractTool, // Git 工具 (deferLoading: false) gitStatusTool, gitDiffTool, gitLogTool, gitBranchTool, gitAddTool, gitCommitTool, gitPushTool, gitPullTool, gitCheckoutTool, gitStashTool, ]; // 注册所有工具到 registry toolRegistry.registerAll(allToolsWithMetadata); // 导出 export { toolRegistry } from './registry.js'; export { toolSearchTool } from './tool-search.js'; export { todoManager } from './todo/index.js'; export { initTaskContext, updateTaskDescription } from './task/index.js'; export type { ToolWithMetadata, ToolMetadata, ToolCategory, ToolSearchResult } from './types.js'; // 兼容旧代码:导出所有工具数组(基础 Tool 类型) export const allTools = toolRegistry.getAllTools();