16 Commits

Author SHA1 Message Date
f704900e07 统一工作目录管理 2026-04-27 17:23:52 +08:00
0c356e7ac4 重构: 添加斜杠命令解析和执行功能 2026-04-26 21:51:24 +08:00
bcee62713f 重构: 移除调试日志以简化消息处理流程 2026-04-26 21:26:27 +08:00
86dea0f874 Refactor session management to support dialog-based architecture
- Removed InputHandler and related input event handling code.
- Updated GatewayState to handle new session commands for dialogs.
- Introduced UnifiedSessionId for managing session identifiers across channels and chats.
- Refactored Session and SessionManager to manage dialogs instead of sessions.
- Added methods for creating, listing, switching, renaming, archiving, and deleting dialogs.
- Updated storage functions to accommodate dialog IDs in persistent session management.
- Enhanced tests to cover new dialog functionalities and ensure stability.
2026-04-26 20:59:54 +08:00
5ce5502c56 refactor: 抽取独立 session 模块
将 Session/SessionManager 从 gateway 抽取到独立的 session 模块:

- 新建 src/session/ 目录
  - mod.rs: 模块导出
  - error.rs: SessionError 类型
  - commands.rs: SessionCommand 枚举
  - events.rs: SessionEvent 枚举
  - session.rs: Session 和 SessionManager 实现

- 更新 src/gateway/mod.rs
  - 移除 pub mod session
  - 改用 crate::session::SessionManager

- 更新 src/lib.rs
  - 添加 pub mod session

- 删除 src/gateway/session.rs (内容已移动)

注意: ControlInbound/ControlOutbound/ControlMessage 保留在 bus/message.rs,
cli_chat 仍通过消息总线与 SessionManager 通信,待后续简化。
2026-04-26 17:48:23 +08:00
dfe0fad61e 重构: 统一消息总线与通道管理,消除重复引用
- OutboundDispatcher 改用 ChannelManager 获取通道,不再维护独立注册表
- CliChatChannel 通过控制消息通道操作 SessionStore,移除独立引用
- MessageBus 统一通过 ChannelManager 创建,避免重复实例
- GatewayState 移除冗余字段,统一通过 ChannelManager 访问
- 新增 ControlInbound/ControlOutbound/ControlMessage 类型支持会话管理操作
- 添加 ARCHITECTURE_REVIEW.md 记录架构问题与修复状态
2026-04-26 17:09:52 +08:00
6a3a1b5edf 重构: 将CLI通道统一为CliChatChannel
- 创建CliChatChannel实现Channel trait
- 简化ws.rs为纯粹的传输桥接
- CLI消息通过MessageBus走统一流程
- 重命名命令从agent改为chat
- 通道名称从cli改为cli_chat
2026-04-26 12:04:11 +08:00
8bb32fa066 feat: enhance WebSocket session management and storage
- Added SessionSummary struct for session metadata.
- Updated ws_handler to create and manage CLI sessions more robustly.
- Implemented session creation, loading, renaming, archiving, and deletion via WebSocket messages.
- Introduced SessionStore for persistent session storage using SQLite.
- Enhanced error handling and logging for session operations.
- Updated protocol definitions for new session-related WebSocket messages.
- Refactored tests to cover new session functionalities and ensure proper serialization.
2026-04-18 13:09:14 +08:00
21b4e60c44 feat(feishu): add reaction handling and metadata forwarding in messages 2026-04-08 10:24:15 +08:00
2dada36bc6 feat: introduce multimodal content handling with media support
- Added ContentBlock enum for multimodal content representation (text, image).
- Enhanced ChatMessage struct to include media references.
- Updated InboundMessage and OutboundMessage to use MediaItem for media handling.
- Implemented media download and upload functionality in FeishuChannel.
- Modified message processing in the gateway to handle media items.
- Improved logging for message processing and media handling in debug mode.
- Refactored message serialization for LLM providers to support content blocks.
2026-04-07 23:09:31 +08:00
a051f83050 Refactor AgentLoop to manage history externally via SessionManager
- Removed internal history management from AgentLoop.
- Updated process method to accept conversation history as a parameter.
- Adjusted continue_with_tool_results to work with external history.
- Added OutboundDispatcher for handling outbound messages from MessageBus.
- Introduced InboundMessage and OutboundMessage structs for message handling.
- Updated Channel trait to include message handling and publishing to MessageBus.
- Refactored Session to manage chat histories instead of AgentLoop instances.
- Enhanced GatewayState to start message processing loops for inbound and outbound messages.
2026-04-07 21:53:37 +08:00
4ed2f986a1 添加 tracing 日志支持,替换 println! 输出,增强错误处理和调试信息 2026-04-06 23:11:41 +08:00
09899ddb91 添加日志模块,初始化日志记录功能,设置日志目录为 ~/.picobot/logs,支持每日轮换 2026-04-06 22:51:50 +08:00
34ab439067 重构消息处理逻辑,添加 MessageHandler trait,支持多用户会话,更新 FeishuChannel 和 SessionManager,增强错误处理 2026-04-06 22:38:41 +08:00
04736f9f46 添加 Feishu 通道支持,重构配置以包含通道设置,更新依赖项,增强错误处理 2026-04-06 18:43:53 +08:00
35d201f206 重构项目结构,添加代理、网关和客户端模块,更新配置以支持默认网关设置,增强错误处理,添加 WebSocket 支持 2026-04-06 16:36:17 +08:00