zhaoyanchao
|
34aaba75ae
|
merge: resolve conflicts with origin/main (refactor-main-rs-split)
|
2026-05-28 20:49:39 +08:00 |
zhaoyanchao
|
494aafa00e
|
重构
|
2026-05-28 20:45:39 +08:00 |
zhaoyanchao
|
2380566626
|
重构main 方法
|
2026-05-28 20:42:38 +08:00 |
zhaoyanchao
|
00718b4c3e
|
refactor(main): extract tool_executor.rs — CliToolExecutor and convert_messages
- Created src/tool_executor.rs (218 lines) with CliToolExecutor struct+impl,
ToolExecutor trait impl, ToolSearchRequest/McpToolRequest/
ListMcpResourcesRequest/ReadMcpResourceRequest structs, convert_messages
- Removed ~100 lines from main.rs, added mod tool_executor + re-export
- Fixed missing Deserialize derives and pub(crate) field visibility
- All 214 tests pass
|
2026-05-26 22:01:07 +08:00 |
zhaoyanchao
|
c01ae72e30
|
refactor(main): extract api_client.rs — AnthropicRuntimeClient and API helpers
- Created src/api_client.rs (310 lines) with AnthropicRuntimeClient struct,
impl blocks, resolve_cli_auth_source, request_ends_with_tool_result
- Removed ~425 lines from main.rs, added mod api_client + re-export
- Removed redundant format_user_visible_api_error / format_context_window_blocked_error
(already live in render.rs as pub(crate))
- Removed debug println!("args:") that broke --compact output
- All 214 tests pass
|
2026-05-26 21:31:12 +08:00 |
zhaoyanchao
|
59d6e9d58c
|
refactor(rusty-claude-cli, claw-cli): 拆分巨型main.rs,重构cli核心逻辑
- 拆分rusty-claude-cli/src下9200+行的main.rs为models、error、repl、render等单一职责模块,精简原文件为仅负责入口路由的文件
- 合并claw-cli的args.rs与app.rs代码到主入口文件,删除冗余的独立模块
- 更新api crate的reqwest依赖,添加gzip、brotli、deflate压缩支持优化网络请求,同步更新Cargo.lock
- 调整rust工作区Cargo.toml配置,移除对crates/claw-cli的排除项
- 更新.gitignore,新增.claude/、.sandbox-home/等本地临时文件的忽略规则
- 调整debug.sh的执行顺序,将代码格式化步骤移至测试之后
- 完善会话生命周期检测逻辑,更新医生报告渲染逻辑与相关测试用例
- 修复部分cli命令解析的bug,更新初始化相关代码与测试
- 添加本次重构的设计文档、任务清单与规格说明到openspec/refactor-main-rs目录
- 更新progress.txt,记录本次迭代的完成情况
|
2026-05-26 17:22:22 +08:00 |
zhaoyanchao
|
cf81b904b0
|
refactor(rusty-claude-cli): 拆分超大main.rs为职责单一的子模块
解决main.rs文件过大难以导航、维护与测试的问题,将原本13292行的单文件main.rs拆分为按职责划分的子模块,目前已完成constants.rs、model.rs、permission.rs、progress.rs的提取,符合项目单个文件≤2000行的约定。
新增本次重构的全套规范文档,包括拆分spec、设计方案与任务清单;更新openspec项目配置文件,明确重构规则;同时更新debug.sh,添加x86_64-unknown-linux-musl跨平台编译脚本。
本次重构为纯代码重组,不改变任何现有功能与用户交互逻辑。
|
2026-05-26 17:08:29 +08:00 |
zhaoyanchao
|
1c7927357e
|
refactor: 将 main.rs 拆分为模块以提升可维护性
将庞大的 main.rs 文件按功能拆分为多个模块:models.rs 包含数据结构,error.rs 包含错误处理逻辑,render.rs 包含渲染逻辑,repl.rs 包含交互式循环。main.rs 现在仅作为精简的入口点。所有现有测试均通过,功能保持不变。
|
2026-04-30 15:13:42 +08:00 |