feat: 添加 web_search 工具和权限管控

- 新增 web_search 工具,使用 Tavily SDK 进行网络搜索
- 支持搜索深度(basic/advanced)和主题(general/news/finance)配置
- 新增 WebPermissionChecker 权限检查器
- 搜索操作默认需要用户确认,支持会话级权限记忆
- 配置文件支持 tavilyApiKey 存储
This commit is contained in:
2025-12-11 01:32:32 +08:00
parent 924fd7b9c6
commit 3c922fe16c
12 changed files with 744 additions and 1 deletions
+6
View File
@@ -23,6 +23,9 @@ import {
deleteFileTool,
} from './filesystem/index.js';
// Web 工具
import { webSearchTool } from './web/index.js';
// 所有工具列表(用于注册)
const allToolsWithMetadata: ToolWithMetadata[] = [
// 核心工具 (deferLoading: false)
@@ -43,6 +46,9 @@ const allToolsWithMetadata: ToolWithMetadata[] = [
moveFileTool,
copyFileTool,
deleteFileTool,
// Web 工具 (deferLoading: true)
webSearchTool,
];
// 注册所有工具到 registry