41 Commits

Author SHA1 Message Date
6f33ec7604 feat: 多通道消息支持与 Session 选择器
后端:
- list_channels 从 ChannelManager 动态查询通道列表(合并 websocket + 所有已注册通道)
- build_channel_list 移至 ChannelManager,网关层直接依赖领域层
- get_current_topic 自动创建默认话题(修复微信等通道无话题的问题)
- is_channel_writable: 仅 websocket 可写,其余通道只读

前端:
- 右上角通道选择器 + Session 选择器(Portal 渲染,固定宽度居中)
- 只读通道显示刷新按钮替代新建按钮
- 话题列表时间戳修复(秒→毫秒)
- 移除冗余的 SessionInfo、AI Ready、所属会话等 UI
- 修复 scheduler view 路由无条件拦截消息的 bug
2026-06-06 22:25:10 +08:00
oudecheng
1d4ebb27a7 feat: 更新 StopExecution 命令和 CancelManager,支持按话题取消 Agent 执行 2026-06-03 18:13:15 +08:00
oudecheng
1b571e943f feat: 添加停止当前执行的 Agent 功能,支持通过 /stop 命令取消执行 2026-06-03 16:49:29 +08:00
oudecheng
5f2bc950b1 feat: 添加定时任务和聊天消息加载功能,增强调度管理 2026-06-02 17:04:00 +08:00
oudecheng
d0051baa07 refactor: 消息持久化从批量改为实时逐条,通过装饰器模式实现
- 新增 PersistingEmittedMessageHandler 装饰器,在 emitter 广播前逐条落库
- processor 和 task/runtime 使用装饰器包裹 emitter,替代 post-loop 批量写入
- 移除 session_history 中的批量 DB 写入,仅保留内存历史更新
- execution 中跳过已由 live emitter 实时广播的工具消息,避免重复
- 前端支持运行中 task 工具卡片"查看实时进度"跳转子智能体视图

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 16:47:57 +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
598d425c28 feat: 话题添加描述字段,工具消息按 tool_call_id 合并展示
- TopicSummary 新增 description 字段,侧边栏优先显示描述
- ToolPanel 使用 toolCallId 将 tool_call 和 tool_result 配对合并展示
- 保存消息时同步更新 topics 表的 message_count 和 last_active_at
- ChatMessage 新增 toolCallId 字段

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:30:21 +08:00
oudecheng
44e82e8473 feat: 附件通过 base64 内容实现前端直接下载
- MediaItem/MediaSummary 新增 content_base64 和 file_name 字段
- 解析附件时读取文件内容并 base64 编码(限 50MB),前端 Blob 下载
- 创建 Session 后返回完整 topics 列表,前端侧边栏实时同步
- 简化话题历史加载逻辑,不再回退到 session 消息

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:01:37 +08:00
oudecheng
7898ca69e4 feat: 添加附件支持、自动选择话题及消息展示优化
- 消息协议新增 attachments 字段,支持图片/音频/视频/文件附件
- 文本和附件合并在一条消息中发送,不再拆分为多条
- Topics 加载后自动选中第一个话题并加载历史消息
- 用户消息现在通过 WebSocket 发送,可在前端展示
- 前端过滤 tool_result 消息,添加附件卡片展示组件

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 11:51:48 +08:00
oudecheng
542e11d0b3 refactor: 将 Session 命令重构为 Topic 命令
- 新增 LoadTopic 命令处理器,替代 LoadSession
- 新增 SwitchTopic 命令处理器,替代 SwitchSession
- 删除 LoadSession 和 SwitchSession 处理器
- 更新 Command 枚举:LoadSession -> LoadTopic, SwitchSession -> SwitchTopic
- 同步更新前端协议类型定义
- 调整适配器和网关代码以适应新命令

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 16:01:07 +08:00
oudecheng
e9e1439428 feat: 添加通道和话题管理功能
后端:
- 新增 ListChannels 命令,列出所有可用通道 (WebSocket/CLI)
- 新增 ListSessionsByChannel 命令,支持按通道筛选会话
- 新增 ListTopics 命令,列出 Session 的所有 Topics
- 添加 Channel 和 TopicSummary 数据结构
- 更新 WebSocket 协议,支持 channel_list 和 topic_list 消息

前端:
- 新增 ChannelSelector 组件用于通道选择
- 新增 SessionSelector 组件用于会话选择
- 更新 TopicList 组件支持话题展示
- 更新 useChat hook 和协议类型定义

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 14:55:09 +08:00
0732b31e6b feat: 添加主题描述生成和更新功能,优化会话信息展示 2026-05-24 08:32:34 +08:00
b6f2de053d refactor: 移除会话重置逻辑中的 reset_cutoff_seq 字段,优化会话管理和历史压缩逻辑 2026-05-23 18:38:34 +08:00
oudecheng
da9cec6d35 feat: 添加参数提取工具函数,优化 JSON 参数处理,确保处理空值和类型转换 2026-05-21 16:30:09 +08:00
oudecheng
1c6ee160e5 feat: 添加父话题 ID 支持,优化子智能体任务管理和会话关联 2026-05-20 18:11:16 +08:00
oudecheng
49475783a2 feat: 添加子智能体支持到保存话题和会话功能,优化数据持久化 2026-05-20 17:52:46 +08:00
oudecheng
ecd945b309 feat: 优化消息内容格式化逻辑,增强对特殊字符和换行符的处理 2026-05-20 15:04:34 +08:00
oudecheng
90228a4d49 feat: 更新 GetCurrentSessionCommandHandler,添加系统提示词提供者支持并优化令牌估算逻辑 2026-05-19 18:29:32 +08:00
oudecheng
2d5b6168cc feat: 添加会话管理器支持到 GetCurrentSessionCommandHandler,并重构从会话获取消息的逻辑 2026-05-19 17:42:47 +08:00
oudecheng
cd97ac0f57 feat: 更新 save_topic 处理器以支持从会话获取历史消息,并在命令处理器中配置会话管理器 2026-05-19 17:11:23 +08:00
oudecheng
3c2650824c feat: 更新令牌估算逻辑,使用 JSON 序列化以匹配实际请求大小,并在当前话题处理器中添加令牌估算 2026-05-19 17:05:04 +08:00
4eb6193d0c feat: 添加获取话题消息数量的方法,优化话题列表和切换话题的反馈信息 2026-05-16 22:03:32 +08:00
831832664d feat: 重构会话管理逻辑,添加获取当前话题的方法,简化命令处理中的会话获取逻辑 2026-05-16 20:19:49 +08:00
3591822145 feat: add /help command to display all supported commands
- Implemented HelpCommandHandler to handle the /help command.
- Added CommandMetadata struct to store command metadata.
- Registered new command handlers for GetCurrentSession, ListSessions, LoadSession, and SwitchSession.
- Updated existing command handlers to provide metadata for help command.
- Removed deprecated SessionQueryCommandHandler.
- Added new command handlers for listing sessions and loading sessions.
2026-05-16 19:48:39 +08:00
20f32a3f96 feat: 添加保存话题功能,支持将当前话题内容保存为 Markdown 文件 2026-05-16 19:33:42 +08:00
oudecheng
34938f57b8 feat: 添加 SessionManager 支持到 SessionCommandHandler,优化会话管理 2026-05-15 16:51:06 +08:00
oudecheng
e709773464 feat: 添加话题管理功能,支持切换和持久化话题历史 2026-05-15 15:28:07 +08:00
oudecheng
2e13f6932c feat: Enhance session management with topic support
- Added topic management capabilities, allowing users to create, switch, and query topics within sessions.
- Updated command structure to include new commands: SwitchSession and GetCurrentSession.
- Introduced TopicRecord for managing topic data in the storage layer.
- Modified session handlers to accommodate topic operations, including listing and loading topics.
- Enhanced database schema to support topics, including new tables and relationships.
- Updated input adapters to recognize new commands and handle topic-related actions.
- Improved logging for session and topic operations to aid in debugging and monitoring.
2026-05-15 15:01:58 +08:00
oudecheng
0095ace411 feat: 添加按通道查询会话功能,优化会话列表处理 2026-05-15 08:43:33 +08:00
530bea518d feat: 优化会话列表消息格式,添加会话切换提示 2026-05-14 23:45:52 +08:00
e005d06a9b feat: 添加会话管理命令,支持列出和加载会话功能 2026-05-14 23:35:34 +08:00
5eb9a26843 feat: 添加会话查询命令处理器,支持列出和加载会话功能 2026-05-14 23:27:23 +08:00
b77fc93d71 Refactor command handling and input adapters
- Removed the `format_session_list` function and related session handling from the client module.
- Simplified command output in the client by removing session-related commands.
- Introduced `ChannelInputAdapter` for parsing channel commands like `/new` and `/save`.
- Updated WebSocket handling to process commands via the new command system.
- Removed deprecated in-chat command handling from the gateway.
- Adjusted tests to reflect changes in command serialization and session handling.
- Enhanced session cleanup and job scheduling in the configuration module.
2026-05-14 22:23:02 +08:00
oudecheng
23b7497b12 feat: 更新 save_session 处理器,使用组合系统提示词提供者;移除 LLMProviderConfig 依赖 2026-05-14 16:07:49 +08:00
oudecheng
4181253b17 feat: 更新文件路径解析逻辑,自动保存会话到用户主目录下的 .picobot/sessions/ 目录;修改 InboundProcessor 结构体字段命名 2026-05-14 10:42:35 +08:00
oudecheng
102a4a63c5 feat: 更新 /save 命令,支持保存全部消息到指定路径;修改命令处理逻辑以包含新参数 2026-05-14 10:07:58 +08:00
b17ddd7556 feat: 更新 InChatCommandHandler 接口,添加会话管理器参数;修改命令路由和保存会话逻辑以支持会话管理 2026-05-13 23:11:02 +08:00
08172dcf9c feat: 实现 InChat 命令处理器和路由器,支持聊天中直接输入的命令;添加保存会话功能 2026-05-13 22:40:41 +08:00
35b9c42d07 feat: 添加 /save 命令以保存会话内容到 Markdown 文件;实现 SaveSessionCommandHandler 处理逻辑 2026-05-13 21:46:29 +08:00
oudecheng
73faaa95e4 feat: 修改 SessionCommandHandler 的构造函数为公有可见性,优化代码可读性;更新 WebSocket 处理逻辑以简化模式匹配 2026-05-13 18:01:08 +08:00
oudecheng
aace4eaa14 feat: 实现命令适配器和处理器,支持 CLI 和 WebSocket 输入,优化会话管理 2026-05-13 17:48:33 +08:00