refactor(P6): 更新文档 + 集成测试#29
Merged
Merged
Conversation
- 架构设计:Textual CLI + WebSocket Server + LangGraph Agent - 分支策略:7 个阶段分支合入 refactor/all-python - 任务编排:6.5 天工作量,P0-P6 分阶段实施 - 依赖关系:P0 → P1 → P3 → P2 → P4 → P5 → P6
- 更新描述为 Python CLI + LangGraph Core - 添加 textual/fastapi/uvicorn/websockets 依赖 - 添加 [project.scripts] jojo-code 入口 - 创建 cli/main.py 命令分发框架 - 创建 cli/__init__.py 模块初始化
基于 FastAPI + WebSocket 包装现有 JSON-RPC handlers - 新增 server/ws_server.py: WebSocket 端点 + JSON-RPC 协议 - 支持所有现有方法: chat/clear/get_model/get_stats/permission/audit - 流式响应: 通过 asyncio.Queue 线程安全传递 agent stream 事件 - 健康检查: GET /health - CORS 中间件: 支持跨域请求 - 环境变量配置: JOJO_CODE_HOST/PORT - 10 个单元测试全部通过 - 353 个现有测试无回归
- server start: 前台/后台(-d)启动,PID 文件管理 - server stop: 优雅停止服务 - server status: 查看运行状态 + 健康检查 - config set/show/get: 配置持久化到 ~/.jojo-code/config.json - 默认从配置读取 server URL - 支持 --host/--port 参数覆盖 - 25 个测试全部通过
- WSClient: 异步 WebSocket JSON-RPC 客户端 - 支持同步 request 和流式 stream 两种模式 - 自动重连、超时控制(300s) - 便捷方法: chat/clear/get_model/get_stats - 3 个单元测试通过
- app.py: 主应用,整合所有视图组件 - views/chat.py: 消息列表,用户/助手消息气泡,工具调用状态 - views/input_box.py: 多行输入框,Enter 发送 - views/status_bar.py: 状态栏,模型/模式/连接/统计 - 斜杠命令: /help, /clear, /mode, /quit - 流式响应实时渲染 - 11 个单元测试通过
- views/permission.py: ModalScreen 权限确认弹窗 - 显示工具名、操作、参数 - 支持允许/始终允许/拒绝 - 键盘快捷键: y/n/a/escape - 2 个单元测试通过 - 13 个 CLI 测试全部通过
- Dockerfile: Python 3.12-slim, 健康检查 - docker-compose.yml: 环境变量配置, Volume 挂载 - .dockerignore: 排除不必要文件 - docs/docker.md: 部署使用文档
- 重写 README.md 为全 Python 架构 - 366 个测试全部通过 - ruff check + format 通过
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
重写 README.md 为全 Python 架构,验证全量测试通过。
变更内容
修改
README.md— 重写为全 Python 架构文档测试