# Tools 升级执行清单 本清单用于追踪 Tools 升级计划的执行进度。 --- ## 总进度 | Phase | 名称 | 状态 | 工作量 | |-------|------|------|--------| | T.0 | 现状与目标 | ✅ 完成 | - | | T.1 | Manifest 驱动系统 | ⬜ 待开始 | 3 天 | | T.2 | 工具注册中心 | ⬜ 待开始 | 2 天 | | T.3 | 核心工具实现 | ⬜ 待开始 | 5 天 | | T.4 | 高级特性 | ⬜ 待开始 | 4 天 | | **总计** | | | **14 天** | --- ## Phase T.1:Manifest 驱动系统 ### 目标 建立 Jarvis 的 Manifest 驱动工具系统,定义标准化工件声明。 ### 任务清单 #### Schema 定义 - [ ] 创建 `tools/schemas/manifest.py` - [ ] 定义 `ToolManifest` Schema - [ ] 定义 `ToolType` 枚举 - [ ] 定义 `RuntimeType` 枚举 - [ ] 定义 `InvocationCommand` Schema - [ ] 创建 `tools/schemas/tool_call.py` - [ ] 定义 `ToolCallRequest` Schema - [ ] 定义 `ToolCallResponse` Schema - [ ] 定义 `ToolExecutionLog` Schema #### 验证器 - [ ] 创建 `tools/schemas/validator.py` - [ ] 实现 `validate_manifest` 函数 - [ ] 实现 `validate_tool_call` 函数 - [ ] 实现错误类 #### 配置系统 - [ ] 创建 `tools/configs/loader.py` - [ ] 实现 `ConfigLoader` 类 - [ ] 实现配置缓存 - [ ] 实现配置重载 #### Manifest 文件 - [ ] 创建 `tools/manifests/file_operator.yaml` - [ ] 创建 `tools/manifests/web_search.yaml` - [ ] 创建其他工具 Manifest #### 测试 - [ ] 单元测试 ### 产出文件 - `tools/schemas/manifest.py` - `tools/schemas/tool_call.py` - `tools/schemas/validator.py` - `tools/configs/loader.py` - `tools/manifests/*.yaml` ### 验收 - [ ] Schema 验证正常工作 - [ ] 配置加载器正常工作 - [ ] Manifest 文件格式正确 - [ ] 单元测试通过 --- ## Phase T.2:工具注册中心 ### 目标 实现工具的动态注册、发现和管理。 ### 任务清单 #### 注册中心 - [ ] 创建 `tools/registry.py` - [ ] 实现 `ToolMetadata` dataclass - [ ] 实现 `ToolRegistry` 类 - [ ] 实现注册/注销方法 - [ ] 实现查询方法 - [ ] 实现统计方法 #### 工具发现 - [ ] 创建 `tools/discovery.py` - [ ] 实现 `ToolDiscovery` 类 - [ ] 实现自动发现 - [ ] 实现热重载 #### 描述生成 - [ ] 创建 `tools/description.py` - [ ] 实现 AI 友好描述生成 - [ ] 实现工具列表生成 #### 权限控制 - [ ] 创建 `tools/permissions.py` - [ ] 实现 `ToolPermission` 枚举 - [ ] 实现 `ToolPermissionChecker` 类 #### LangChain 集成 - [ ] 创建 `tools/langchain_adapter.py` - [ ] 实现适配器 - [ ] 集成到 Agent #### 测试 - [ ] 单元测试 ### 产出文件 - `tools/registry.py` - `tools/discovery.py` - `tools/description.py` - `tools/permissions.py` - `tools/langchain_adapter.py` ### 验收 - [ ] 注册中心正常工作 - [ ] 工具发现正常工作 - [ ] 权限检查正常工作 - [ ] LangChain 适配器正常工作 - [ ] 单元测试通过 --- ## Phase T.3:核心工具实现 ### 目标 实现文件操作、搜索、网页抓取等核心工具。 ### 任务清单 #### 文件操作工具 - [ ] 创建 `tools/implementations/file_operator.py` - [ ] 实现 `FileOperator` 类 - [ ] 实现 read_file - [ ] 实现 write_file - [ ] 实现 list_directory - [ ] 实现 search_files - [ ] 实现路径安全检查 - [ ] 实现多格式支持(PDF/DOCX/XLSX) #### 搜索工具 - [ ] 创建 `tools/implementations/web_search.py` - [ ] 实现 `WebSearch` 类 - [ ] 实现 search 方法 - [ ] 实现 deep_search 方法 #### 网页抓取工具 - [ ] 创建 `tools/implementations/web_fetch.py` - [ ] 实现 `WebFetch` 类 - [ ] 实现 fetch 方法 - [ ] 实现 screenshot 方法 #### 任务管理工具 - [ ] 创建 `tools/implementations/task_manager.py` - [ ] 实现 `TaskManager` 类 - [ ] 实现任务 CRUD #### Manifest 绑定 - [ ] 更新 Manifest 文件 - [ ] 注册到工具中心 #### 测试 - [ ] 单元测试 ### 产出文件 - `tools/implementations/file_operator.py` - `tools/implementations/web_search.py` - `tools/implementations/web_fetch.py` - `tools/implementations/task_manager.py` ### 验收 - [ ] 文件操作工具正常工作 - [ ] 搜索工具正常工作 - [ ] 网页抓取工具正常工作 - [ ] 任务管理工具正常工作 - [ ] 单元测试通过 --- ## Phase T.4:高级特性 ### 目标 实现多运行时支持、Agent 协作和定时任务。 ### 任务清单 #### 运行时系统 - [ ] 创建 `tools/runtime/base.py` - [ ] 定义 `BaseRuntime` 抽象基类 - [ ] 创建 `tools/runtime/python_runtime.py` - [ ] 创建 `tools/runtime/js_runtime.py` - [ ] 创建 `tools/runtime/native_runtime.py` - [ ] 创建 `tools/runtime/manager.py` #### Agent 协作 - [ ] 创建 `agents/tools/collaboration.py` - [ ] 定义 `CollaborationMessage` - [ ] 实现 `CollaborationProtocol` 类 - [ ] 实现请求/响应机制 #### 定时任务 - [ ] 创建 `tools/scheduler.py` - [ ] 实现 `ScheduledTask` - [ ] 实现 `ToolScheduler` 类 - [ ] 实现多种调度类型 #### 测试 - [ ] 单元测试 ### 产出文件 - `tools/runtime/*.py` - `agents/tools/collaboration.py` - `tools/scheduler.py` ### 验收 - [ ] 多运行时正常工作 - [ ] Agent 协作正常工作 - [ ] 定时任务正常工作 - [ ] 单元测试通过 --- ## 完成标准 - [ ] 所有 Phase T.1-T.4 任务完成 - [ ] 所有单元测试通过 - [ ] API 文档更新完成 - [ ] 部署验证通过 --- ## 风险与注意事项 | 风险 | 影响 | 缓解措施 | |------|------|----------| | 多运行时复杂性 | 开发成本增加 | 优先实现 Python 运行时 | | JS 运行时依赖 Node | 部署环境要求 | 提供降级方案 | | 定时任务精度 | 任务延迟 | 使用专业调度库 | | 安全漏洞 | 系统风险 | 严格权限控制 | --- ## 更新日志 | 日期 | Phase | 变更内容 | |------|-------|----------| | 2026-04-04 | T.0 | 创建文档 |