27 Commits

Author SHA1 Message Date
oudecheng
7626ba2d2f feat(gateway): 添加待办事项读取功能
- 引入 TodoReadTool 工具支持读取当前对话的待办事项列表
- 实现从内存或SQLite数据库读取待办事项的功能
- 添加内存回填机制确保数据一致性
- 在ToolRegistryFactory中注册新的待办事项读取工具
- 更新会话初始化逻辑以传递待办事项存储依赖
- 添加完整的单元测试验证各种读取场景
2026-06-15 15:33:43 +08:00
oudecheng
24bbd5f8c9 feat: 子代理 todo 列表支持 — 进入子代理视图时显示子代理的待办
- SubAgentEmitter 添加 todo_write 持久化(照搬 BusToolCallEmitter 模式)
- DefaultSubAgentRuntime 加 store 字段,透传给 emitter
- Command::ListTodos 加 task_id 参数
- list_todos handler: 当 task_id 存在时,scope_key = sub:{parent}:{task_id}
- 前端: 子代理视图下自动带 task_id 请求子代理的 todo

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 18:01:57 +08:00
oudecheng
881fcace47 feat: 添加 todo_write 工具,支持全量替换和增量合并两种模式
- Tool: 纯内存实现 (Arc<RwLock<HashMap>>),零 DB 依赖,解耦持久化
- 状态机: pending → in_progress → completed/cancelled,单 in_progress 约束
- merge=false: 全量替换模式(默认)
- merge=true: 增量更新模式,只传变更的项,其余保留
- 隔离: scope_key = topic_id.unwrap_or(session_id),topic 和子代理隔离
- 持久化: TodoRepository trait + SessionStore SQLite 实现,在 Session 拦截器层完成
- 前端推送: WsOutbound::TodoList 事件
- Prompt: TodoPromptProvider 中文指令,子代理模板也包含
- 测试: 16 个单元测试,全部通过

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 14:19:07 +08:00
oudecheng
4cb26b5b67 feat: 子智能体任务消息查看,实时广播工具调用事件
- 新增 LoadTaskMessages 命令,加载子智能体任务的历史消息
- SubAgentEmitter 通过 MessageBus 实时广播子智能体工具调用
- 前端新增子智能体视图,支持导航进入/退出子智能体会话
- 外部渠道过滤子智能体事件,避免推送到飞书/微信
- ToolCall/ToolResult 新增 subagent_task_id 字段

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 11:15:38 +08:00
oudecheng
644f5f9132 feat: 子代理继承主代理的 MCP 工具
- 为 McpToolWrapper 添加 Clone trait,支持工具实例复用
- 修改 build_subagent_tools 方法,支持传入 MCP 工具列表
- 调整 runtime 构建顺序:先等待 MCP 连接,再将 MCP 工具传递给子代理

子代理现在可以自动使用主代理配置的 MCP 工具(如 filesystem、fetch 等)。
2026-05-26 11:53:40 +08:00
oudecheng
86d48a3ec0 feat: 实现自定义子代理加载功能
- 添加 SubagentCatalog::discover() 方法,支持从文件系统加载自定义子代理
- 支持 ~/.picobot/subagents/ 和 ./.picobot/subagents/ 两个目录
- 项目级定义可覆盖用户级定义
- 支持 YAML frontmatter + body 格式解析
- 修复 Windows 换行符兼容性问题
- 移除未使用的 read_only 字段
- 实现 TaskTool 动态 schema,子代理类型列表从运行时获取

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 11:56:44 +08:00
9ae2813c20 feat: 添加子代理配置,支持自定义子代理定义和运行时管理 2026-05-24 21:35:36 +08:00
4605c2dad3 feat: 重构 MCP 配置,支持 mcpServers 字段,优化工具注册和连接管理 2026-05-24 10:00:25 +08:00
ef7e899584 feat: 集成 MCP (Model Context Protocol),支持 Stdio 和 HTTP 传输方式,优化工具注册和连接管理 2026-05-23 23:22:36 +08:00
cbb384a4e6 feat: 添加 MCP (Model Context Protocol) 支持,包含客户端管理器和工具适配器 2026-05-23 22:52:36 +08:00
b6f2de053d refactor: 移除会话重置逻辑中的 reset_cutoff_seq 字段,优化会话管理和历史压缩逻辑 2026-05-23 18:38:34 +08:00
b4ef56803f feat: 添加内存维护配置,优化记忆整理逻辑和限制 2026-05-23 16:05:11 +08:00
oudecheng
49475783a2 feat: 添加子智能体支持到保存话题和会话功能,优化数据持久化 2026-05-20 17:52:46 +08:00
oudecheng
fc628239a4 feat: 添加技能索引支持到子代理系统提示词构建,优化提示词组合逻辑 2026-05-20 15:34:34 +08:00
831832664d feat: 重构会话管理逻辑,添加获取当前话题的方法,简化命令处理中的会话获取逻辑 2026-05-16 20:19:49 +08:00
6b5d45e3a5 feat: 添加探索类型最大执行时间配置,优化子代理任务执行逻辑 2026-05-16 17:05:03 +08:00
bee1a39a06 feat: add task management tool with subagent support
- Introduced `TaskConfig` struct to manage task-related configurations.
- Implemented `TaskTool` for creating and managing subagents for complex tasks.
- Added `TaskSession` and `TaskRepository` for handling task sessions and persistence.
- Created `DefaultSubAgentRuntime` to execute tasks with timeout and history support.
- Enhanced `ToolContext` to include `subagent_description` for better context tracking.
- Implemented error handling for task execution and session management.
- Updated `ToolRegistryFactory` to register task tools conditionally based on configuration.
- Added prompt builders for subagent tasks to improve interaction clarity.
2026-05-16 16:12:28 +08:00
9bf57c1132 feat: 移除任务管理相关功能,简化工具配置和依赖 2026-05-16 09:08:40 +08:00
020b7aa77a feat: 添加任务管理功能,支持创建和恢复子代理任务,优化任务执行和状态管理 2026-05-16 08:50:15 +08:00
oudecheng
e709773464 feat: 添加话题管理功能,支持切换和持久化话题历史 2026-05-15 15:28:07 +08:00
oudecheng
86ba3b447e feat: 添加会话管理功能,支持会话过期清理;引入 session_ttl_hours 配置项以控制会话存活时间 2026-05-14 15:29:37 +08:00
oudecheng
1c1efcabf4 feat: 移除冗余的 provider_config 字段,优化 AgentFactory 和 Session 的构造逻辑 2026-05-13 15:41:52 +08:00
oudecheng
a06fceaf0c feat: 添加系统提示词提供者,支持动态注入和组合多个提示词源 2026-05-13 14:55:50 +08:00
daec690f59 feat: 更新会话配置,重命名 session_ttl_hours 为 chat_history_ttl_hours,并调整相关逻辑以支持聊天历史过期管理 2026-05-10 19:29:55 +08:00
33e6b78267 feat: 添加工具配置示例,支持工具启用/禁用功能;更新调度器管理工具描述以支持标准 cron 语法 2026-05-10 13:57:47 +08:00
260266b90f feat: 添加会话消息发送工具,支持文本和附件的发送,优化消息发送逻辑 2026-05-02 09:15:36 +08:00
716d92a618 feat: 引入 AgentRuntimeConfig,重构相关模块以支持运行时配置
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 22:34:22 +08:00