oudecheng
cda14360af
chore: 建立工程化基线(rustfmt + clippy + CI + eslint + prettier)
...
配置:
- rustfmt.toml: 固化 max_width=100 / 4 空格缩进,cargo fmt 全量格式化
- Cargo.toml: 配置 [lints.rust] 与 [lints.clippy] 渐进式规则
- .github/workflows/ci.yml: Rust(fmt+clippy+test) + 前端(eslint+tsc+test) 双平台 CI
- Makefile: 新增 check/fmt/fix 目标,clippy 对齐 --all-targets --all-features
- web: eslint flat config + prettier 配置 + package.json 脚本与依赖
- src/main.rs: loop→while 修复 clippy::never_loop
对抗性审查发现并修复:
- eslint 缺 caughtErrorsIgnorePattern 导致 catch(_) 误报为 error
- 前端 lint 未接入 CI,现已补上 Lint 步骤
- Makefile 与 CI 的 clippy flags 不一致,已对齐
2026-08-03 23:24:02 +08:00
oudecheng
58f461c953
fix: 修复 SSRF 重定向绕过 + 符号链接路径遍历 + TodoItemSummary 字段缺失
...
P0: src/tools/http_request.rs SSRF 重定向绕过
- reqwest::Client 默认跟随最多 10 次重定向,is_private_host 仅检查初始 URL
- 攻击者可用公网 URL 返回 302 → http://127.0.0.1/ 或
http://169.254.169.254/(云元数据端点)绕过防护访问内网
- 修复:.redirect(reqwest::redirect::Policy::none()) 完全禁用重定向
P1: src/tools/file_read/write/edit.rs 符号链接路径遍历
- resolve_path 用 starts_with 检查但未 canonicalize
- 攻击者可在 allowed_dir 内创建指向 /etc/passwd 的符号链接绕过限制
- 修复:对 resolved 和 allowed 均执行 canonicalize 后比较
- file_read: 文件必须存在,canonicalize 失败直接报错
- file_write/edit: 文件可能不存在,降级到父目录 canonicalize
P1: src/protocol/mod.rs + list_todos.rs TodoItemSummary 字段缺失
- 后端 TodoItemSummary 仅返回 4 字段,前端期望 7 字段
- 缺失 priority, created_at, updated_at,前端 TodoPanel 无法显示
优先级和时间戳
- 修复:struct 补齐 3 字段,list_todos 构造时传递完整字段
2026-07-08 16:23:09 +08:00
oudecheng
da9cec6d35
feat: 添加参数提取工具函数,优化 JSON 参数处理,确保处理空值和类型转换
2026-05-21 16:30:09 +08:00
oudecheng
8f82009c32
feat: 重命名工具名称,简化工具调用接口
2026-05-19 15:18:04 +08:00
73dab09bfe
Refactor code for improved readability and consistency
...
- Adjusted formatting and indentation in various files for better clarity.
- Consolidated multi-line statements into single lines where appropriate.
- Enhanced error handling messages for better debugging.
- Added a new InboundProcessor struct to handle inbound messages more effectively.
- Updated test cases to ensure they align with the new code structure.
2026-04-28 10:33:31 +08:00
f3187ceddd
feat(tools): add file_edit tool with fuzzy matching
...
- Edit file by replacing old_text with new_text
- Supports multiline edits
- Fuzzy line-based matching for minor differences
- replace_all option for batch replacement
- Includes 5 unit tests
2026-04-07 23:46:34 +08:00