|
| 1 | +# Deep Copilot v0.40.0 — UI 视觉统一 · Terminal Early-Exit · 打包清理 |
| 2 | + |
| 3 | +> 本版本聚焦三件事:聊天界面的设计语言统一、`run_shell_bg` 的早退捕获窗口、`.vscodeignore` 与发布产物清理。同时修复了 PR #130 的 CodeQL 安全告警。 |
| 4 | +
|
| 5 | +--- |
| 6 | + |
| 7 | +## 🇨🇳 中文说明 |
| 8 | + |
| 9 | +### 1. 聊天 UI 视觉重构 🎨 |
| 10 | +- 引入设计令牌:`--dc-indent` / `--dc-fg-*` / `--dc-accent` / `--dc-rule` |
| 11 | +- 8 大容器统一为「2px 左侧色条 + 16px 缩进」节奏:`.tool` 卡片头部、`.tl` 工具行、`.tl-detail` 详情区、`.tool .b` 主体全部对齐 |
| 12 | +- 工具类型色条:`k-read` / `k-write` / `k-search` / `k-shell` / `k-agent` / `k-plan` / `k-other`,一眼可分 |
| 13 | +- `.tl-group .tl-summary` 折叠摘要同步采用 2px 色条 |
| 14 | +- 工具名 chip 由 `<span>` 改为 `<code>`,与正文 monospace 一致 |
| 15 | + |
| 16 | +### 2. Thinking 块体验 🧠 |
| 17 | +模型开始正文输出后,思考块头部自动汇总为 `Thought for Ns` 并折叠,保留头部入口可随时展开复盘。 |
| 18 | + |
| 19 | +### 3. Output Style Contract 📝 |
| 20 | +系统提示词新增"输出风格契约"段,约束等宽规则、列表语义、段落控制、禁用装饰性 emoji,对话排版更稳定。 |
| 21 | + |
| 22 | +### 4. Terminal Early-Exit Window ⚡ |
| 23 | +- `run_shell_bg` 提交后增加 **2.5 秒早退捕获窗口**:若命令在窗口内崩溃/退出(缺依赖、错 cwd、语法错误),同步返回真实的 `exit_code` + 输出,模型立刻看见错误 |
| 24 | +- 窗口超时则按原 `running` 流程异步推进 |
| 25 | +- `terminal-monitor` 新增 `markSyncReturnedJob` / `wasSyncReturned`,避免延迟到达的 `bg-job-end` 事件被重复注入 |
| 26 | + |
| 27 | +### 5. `.vscodeignore` 清理 🧹 |
| 28 | +- 移除 14 条失效规则(已删除的 `test/` `data/` `models/` `runs/` 及一批 `.pt` 权重) |
| 29 | +- 新增 `.github/**` / `.eslintrc.json` / `.gitleaksignore` |
| 30 | +- 按用途分组并加注释,vsix 体积更精简 |
| 31 | + |
| 32 | +### 6. 安全修复 🔒 |
| 33 | +- `media/chat.js`:新增 `isUnsafeKey` 守卫,过滤 `__proto__` / `prototype` / `constructor`,消除 7 处 Remote Property Injection(High)与 2 处 Prototype-Polluting Assignment(Medium) |
| 34 | +- `src/chat/agent-loop.js`:移除 `lastSnapshotAt` 死赋值 |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## 🇬🇧 English |
| 39 | + |
| 40 | +### 1. Chat UI Visual Refresh 🎨 |
| 41 | +- New design tokens: `--dc-indent` / `--dc-fg-*` / `--dc-accent` / `--dc-rule` |
| 42 | +- Eight container types now share one **"2px left rule + 16px indent"** rhythm — `.tool` card headers, `.tl` tool rows, `.tl-detail` panels, and `.tool .b` body all align |
| 43 | +- Tool-type color rails: `k-read` / `k-write` / `k-search` / `k-shell` / `k-agent` / `k-plan` / `k-other` |
| 44 | +- `.tl-group .tl-summary` adopts the same 2px rail |
| 45 | +- Tool-name chip changed from `<span>` to `<code>` for monospace alignment |
| 46 | + |
| 47 | +### 2. Thinking-Block UX 🧠 |
| 48 | +As soon as the model starts streaming, the thought block auto-collapses with a `Thought for Ns` summary while keeping the header clickable for on-demand review. |
| 49 | + |
| 50 | +### 3. Output Style Contract 📝 |
| 51 | +System prompt gains an "Output style contract" section governing monospace usage, list semantics, paragraph control, and banning decorative emoji — markdown output is far more consistent. |
| 52 | + |
| 53 | +### 4. Terminal Early-Exit Window ⚡ |
| 54 | +- `run_shell_bg` now races the spawn against a **2.5 s capture window**: if the command crashes/exits inside the window (missing deps, bad cwd, syntax errors), the real `exit_code` + output are returned **synchronously**, so the model sees failures immediately instead of giving up after a fire-and-forget submission |
| 55 | +- On timeout, the original async `running` path takes over |
| 56 | +- `terminal-monitor` exposes `markSyncReturnedJob` / `wasSyncReturned` to deduplicate the late `bg-job-end` event so the agent loop never re-injects what was already returned |
| 57 | + |
| 58 | +### 5. `.vscodeignore` Cleanup 🧹 |
| 59 | +- Removed 14 stale rules (deleted `test/` `data/` `models/` `runs/` and a batch of `.pt` weights) |
| 60 | +- Added `.github/**` / `.eslintrc.json` / `.gitleaksignore` |
| 61 | +- Grouped and commented by purpose — leaner vsix payload |
| 62 | + |
| 63 | +### 6. Security Hardening 🔒 |
| 64 | +- `media/chat.js`: new `isUnsafeKey` guard filters `__proto__` / `prototype` / `constructor` before any dynamic key write — closes 7× Remote Property Injection (High) and 2× Prototype-Polluting Assignment (Medium) CodeQL findings |
| 65 | +- `src/chat/agent-loop.js`: removed dead `lastSnapshotAt` assignment |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## 🙏 致谢 / Acknowledgements |
| 70 | + |
| 71 | +特别感谢仓库管理员 **[@YSMsimon SY](https://github.com/YSMsimon)** 在本版本中的代码审查、安全告警跟进与发布把关工作。Deep Copilot 的稳定迭代离不开你的支持 💙 |
| 72 | + |
| 73 | +Special thanks to repository admin **[@YSMsimon SY](https://github.com/YSMsimon)** for code review, security-alert triage, and release gatekeeping on this version. Deep Copilot would not iterate this smoothly without your support 💙 |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## 📦 安装 / Install |
| 78 | + |
| 79 | +下载附件 `deep-copilot-0.40.0.vsix`,在 VS Code 中: |
| 80 | +- 命令面板 → `Extensions: Install from VSIX...` → 选择文件 |
| 81 | +- 或终端:`code --install-extension deep-copilot-0.40.0.vsix` |
| 82 | + |
| 83 | +Download the attached `deep-copilot-0.40.0.vsix` and install via: |
| 84 | +- Command Palette → `Extensions: Install from VSIX...` |
| 85 | +- Or CLI: `code --install-extension deep-copilot-0.40.0.vsix` |
0 commit comments