From 056fbb069241036cbfc815f26ae1156d3bfed9ec Mon Sep 17 00:00:00 2001 From: t Date: Mon, 3 Aug 2026 14:02:52 +0800 Subject: [PATCH] =?UTF-8?q?chore(deps-dev):=20prettier=203.8.3=20=E2=86=92?= =?UTF-8?q?=203.9.6,=20with=20the=20reformat=20it=20wants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Supersedes #223, which failed CI: 3.9 changed how it lays out union types (short unions collapse onto one line), so format:check found 12 files it would rewrite. Dependabot can bump the dependency but cannot make the tree match it. Bump plus the mechanical reformat in one commit — 14 files, formatting only, no behaviour touched. Co-Authored-By: Claude Opus 5 --- apps/desktop/src/lib/repl-stream.ts | 9 +- apps/desktop/src/lib/slash-commands.ts | 7 +- apps/desktop/src/types/screens.ts | 9 +- apps/vscode/src/extension.ts | 3 +- docs/BEHAVIOR_PARITY.md | 96 ++++++++-------- docs/DEVELOPMENT_PLAN.md | 121 +++++++++++--------- docs/milestones/M2.md | 16 +-- docs/milestones/M3.md | 14 +-- docs/milestones/M5.md | 10 +- package.json | 2 +- packages/core/skills/pdf/SKILL.md | 12 +- packages/core/skills/update-config/SKILL.md | 16 +-- packages/core/src/providers/deepseek.ts | 3 +- pnpm-lock.yaml | 10 +- 14 files changed, 160 insertions(+), 168 deletions(-) diff --git a/apps/desktop/src/lib/repl-stream.ts b/apps/desktop/src/lib/repl-stream.ts index f082f04..b2021e1 100644 --- a/apps/desktop/src/lib/repl-stream.ts +++ b/apps/desktop/src/lib/repl-stream.ts @@ -164,11 +164,10 @@ function lastToolIndex( /** Clear the streaming flag on ALL assistant turns (not just the last one). */ export function finalizeStreaming(msgs: Msg[]): Msg[] { - return msgs.map( - (m): Msg => - m.role === 'assistant' && m.turn.streaming - ? { role: 'assistant', turn: { ...m.turn, streaming: false } } - : m, + return msgs.map((m): Msg => + m.role === 'assistant' && m.turn.streaming + ? { role: 'assistant', turn: { ...m.turn, streaming: false } } + : m, ); } diff --git a/apps/desktop/src/lib/slash-commands.ts b/apps/desktop/src/lib/slash-commands.ts index 1e7ec29..a5d0c79 100644 --- a/apps/desktop/src/lib/slash-commands.ts +++ b/apps/desktop/src/lib/slash-commands.ts @@ -14,12 +14,7 @@ import type { ScreenName } from '../types/screens.js'; export type Effort = 'low' | 'medium' | 'high' | 'xhigh' | 'max'; export type AgentMode = - | 'default' - | 'acceptEdits' - | 'plan' - | 'auto' - | 'dontAsk' - | 'bypassPermissions'; + 'default' | 'acceptEdits' | 'plan' | 'auto' | 'dontAsk' | 'bypassPermissions'; export interface SlashCommand { /** Including the leading slash. */ diff --git a/apps/desktop/src/types/screens.ts b/apps/desktop/src/types/screens.ts index c73e635..8b9c46d 100644 --- a/apps/desktop/src/types/screens.ts +++ b/apps/desktop/src/types/screens.ts @@ -3,11 +3,4 @@ // routing). Update both sites when adding a new screen. export type ScreenName = - | 'repl' - | 'sessions' - | 'plugins' - | 'skills' - | 'permissions' - | 'mcp' - | 'settings' - | 'about'; + 'repl' | 'sessions' | 'plugins' | 'skills' | 'permissions' | 'mcp' | 'settings' | 'about'; diff --git a/apps/vscode/src/extension.ts b/apps/vscode/src/extension.ts index ac5b883..ae0b046 100644 --- a/apps/vscode/src/extension.ts +++ b/apps/vscode/src/extension.ts @@ -295,8 +295,7 @@ function formatInput(input: Record): string { function turnError(turn: Extract['turn']) { return [...turn.items].reverse().find((item) => item.type === 'error')?.payload.message as - | string - | undefined; + string | undefined; } function truncate(value: string, length: number): string { diff --git a/docs/BEHAVIOR_PARITY.md b/docs/BEHAVIOR_PARITY.md index 05d2db0..bb6896e 100644 --- a/docs/BEHAVIOR_PARITY.md +++ b/docs/BEHAVIOR_PARITY.md @@ -23,55 +23,55 @@ Legend: `✅` matches · `🟡` matches with caveats · `🔄` deferred · `⚠ ## Slash commands (30+ in Claude Code, ~32 shipped in DeepCode) -| Command | Claude Code | DeepCode | Status | -| -------------------------- | ----------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `/help` | ✓ | ✓ | ✅ | -| `/clear` | ✓ | ✓ | ✅ | -| `/exit` / `/quit` | ✓ | ✓ | ✅ | -| `/status` / `/doctor` | ✓ | ✓ | ✅ | -| `/model` | ✓ | ✓ | ✅ DeepCode constrains to deepseek-\* (model picker doesn't show foreign providers) | -| `/mode` | ✓ | ✓ | ✅ | -| `/effort` | ✓ | ✓ | 🟡 — CLI prints the tier table (numbers from `EFFORT_PARAMS` SSOT); switch via `/effort `; arrow-key selector is GUI-only (M6) | -| `/cost` / `/usage` | ✓ | ✓ | ✅ | -| `/context` | ✓ | ✓ | ✅ | -| `/config` | ✓ | ✓ | 🟡 — dumps merged settings + `/config set ` (dotted keys, JSON values) writes user settings; no full arrow-key editor | -| `/resume` | ✓ | ✓ | ✅ — lists recent sessions; `/resume ` switches the live session in-REPL; `--resume ` / `-r` at launch | -| `/init` | ✓ | ✓ | ✅ — interactive 3-phase REPL flow (scan → draft → approve-write `AGENTS.md`) | -| `/mcp` | ✓ | ✓ | ✅ | -| `/add-dir` | ✓ | ✓ | ✅ — persists to `permissions.additionalDirectories`; folded into the sandbox's `filesystem.allowWrite` by every host (CLI REPL/headless + app-server, so desktop/VS Code/LSP too) | -| `/todos` | ✓ | ✓ | ✅ — reads `/todos.json` written by TodoWrite tool | -| `/plugins` | ✓ | ✓ | ✅ — lists wired plugins + contributed hook events + warnings (M5.2) | -| `/compact` | ✓ | ✓ | ✅ — manual `/compact` + automatic threshold trigger in the agent loop | -| `/diff` | ✓ | ✓ | ✅ — git diff + untracked files in the working tree (PR #150) | -| `/btw` | ✓ | ✓ | 🟡 — queues a "by the way" context note the agent sees with your next message (no turn fired); exact Claude Code behavior may differ | -| `/recap` | ✓ | ✓ | ✅ — provider-summarized recap of the session so far | -| `/rewind` | ✓ | ✓ | ✅ — 5 ops (code/conversation/both/summarize-from/up-to); `Esc Esc` bound | +| Command | Claude Code | DeepCode | Status | +| -------------------------- | ----------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `/help` | ✓ | ✓ | ✅ | +| `/clear` | ✓ | ✓ | ✅ | +| `/exit` / `/quit` | ✓ | ✓ | ✅ | +| `/status` / `/doctor` | ✓ | ✓ | ✅ | +| `/model` | ✓ | ✓ | ✅ DeepCode constrains to deepseek-\* (model picker doesn't show foreign providers) | +| `/mode` | ✓ | ✓ | ✅ | +| `/effort` | ✓ | ✓ | 🟡 — CLI prints the tier table (numbers from `EFFORT_PARAMS` SSOT); switch via `/effort `; arrow-key selector is GUI-only (M6) | +| `/cost` / `/usage` | ✓ | ✓ | ✅ | +| `/context` | ✓ | ✓ | ✅ | +| `/config` | ✓ | ✓ | 🟡 — dumps merged settings + `/config set ` (dotted keys, JSON values) writes user settings; no full arrow-key editor | +| `/resume` | ✓ | ✓ | ✅ — lists recent sessions; `/resume ` switches the live session in-REPL; `--resume ` / `-r` at launch | +| `/init` | ✓ | ✓ | ✅ — interactive 3-phase REPL flow (scan → draft → approve-write `AGENTS.md`) | +| `/mcp` | ✓ | ✓ | ✅ | +| `/add-dir` | ✓ | ✓ | ✅ — persists to `permissions.additionalDirectories`; folded into the sandbox's `filesystem.allowWrite` by every host (CLI REPL/headless + app-server, so desktop/VS Code/LSP too) | +| `/todos` | ✓ | ✓ | ✅ — reads `/todos.json` written by TodoWrite tool | +| `/plugins` | ✓ | ✓ | ✅ — lists wired plugins + contributed hook events + warnings (M5.2) | +| `/compact` | ✓ | ✓ | ✅ — manual `/compact` + automatic threshold trigger in the agent loop | +| `/diff` | ✓ | ✓ | ✅ — git diff + untracked files in the working tree (PR #150) | +| `/btw` | ✓ | ✓ | 🟡 — queues a "by the way" context note the agent sees with your next message (no turn fired); exact Claude Code behavior may differ | +| `/recap` | ✓ | ✓ | ✅ — provider-summarized recap of the session so far | +| `/rewind` | ✓ | ✓ | ✅ — 5 ops (code/conversation/both/summarize-from/up-to); `Esc Esc` bound | | `/voice` | ✓ | ✓ | 🟡 — local whisper.cpp dictation on CLI (`/voice`: ffmpeg/sox → transcribe → pre-fill) **and** desktop (🎙 composer button, ffmpeg). Fully on-device; real-mic round-trip needs local verification | -| `/teleport` | ✓ | ✗ | 🔄 M8 | -| `/desktop` | ✓ | ✗ | 🔄 M6 | -| `/background` | ✓ | ✓ | ✅ — runs a prompt as a background sub-agent via the session TaskManager (alias `/bg`); agent-started TaskCreate tasks appear too | -| `/batch` | ✓ | ✗ | 🔄 — batch-of-prompts not yet wired (use `/background` per prompt) | -| `/tasks` | ✓ | ✓ | ✅ — lists this session's background tasks; `/tasks ` shows one's status + output | -| `/plan` | ✓ | ✗ | 🔄 — set via `/mode plan` in DeepCode | -| `/login` / `/logout` | ✓ | ✓ | ✅ — /logout clears creds + exits; /login stores a new key (next launch) | -| `/export` | ✓ | ✓ | ✅ — writes the conversation to a markdown file | -| `/bug` (alias `/feedback`) | ✓ | ✓ | ✅ — prints a prefilled GitHub issue link (model/mode/effort in the body) | -| `/upgrade` | ✓ | ✓ | ✅ — prints version + `npm i -g deepcode-cli@latest` (also the `deepcode upgrade` subcommand) | -| `/pr_comments` | ✓ | ✓ | ✅ — `gh pr view` comments for the current branch's PR | -| `/review` | ✓ | ✗ (skill avail) | 🟡 — via Skill tool | -| `/security-review` | ✓ | ✗ (skill avail) | 🟡 — via Skill tool | -| `/schedule` | ✓ | ✗ (skill avail) | 🟡 | -| `/loop` | ✓ | ✗ (skill avail) | 🟡 | -| `/terminal-setup` | ✓ | ✗ | 🔄 | -| `/vim` | ✓ | ✓ | ✅ — toggles Vim mode (persists to `~/.deepcode/keybindings.json`) | -| `/keybindings` | ✓ | ✓ (read-only) | 🟡 — Claude Code opens/creates the keybindings config; ours lists bindings (edit `~/.deepcode/keybindings.json` manually) | -| `/agents` | ✓ | ✓ | ✅ — lists sub-agents from `.deepcode/agents/` | -| `/hooks` | ✓ | ✓ | ✅ — lists hooks configured in settings.json | -| `/skills` | ✓ | ✓ | ✅ — lists built-in + user + project skills | -| `/permissions` | ✓ | ✓ (read-only) | 🟡 — shows rules + default mode (interactive editor deferred) | -| `/privacy-settings` | ✓ | ✓ | ✅ — summarizes local data locations + what's sent to the DeepSeek API (read-only) | -| `/migrate-installer` | ✓ | ✗ | 🔄 | -| `/release-notes` | ✓ | ✓ | ✅ — prints the latest `CHANGELOG.md` entry | +| `/teleport` | ✓ | ✗ | 🔄 M8 | +| `/desktop` | ✓ | ✗ | 🔄 M6 | +| `/background` | ✓ | ✓ | ✅ — runs a prompt as a background sub-agent via the session TaskManager (alias `/bg`); agent-started TaskCreate tasks appear too | +| `/batch` | ✓ | ✗ | 🔄 — batch-of-prompts not yet wired (use `/background` per prompt) | +| `/tasks` | ✓ | ✓ | ✅ — lists this session's background tasks; `/tasks ` shows one's status + output | +| `/plan` | ✓ | ✗ | 🔄 — set via `/mode plan` in DeepCode | +| `/login` / `/logout` | ✓ | ✓ | ✅ — /logout clears creds + exits; /login stores a new key (next launch) | +| `/export` | ✓ | ✓ | ✅ — writes the conversation to a markdown file | +| `/bug` (alias `/feedback`) | ✓ | ✓ | ✅ — prints a prefilled GitHub issue link (model/mode/effort in the body) | +| `/upgrade` | ✓ | ✓ | ✅ — prints version + `npm i -g deepcode-cli@latest` (also the `deepcode upgrade` subcommand) | +| `/pr_comments` | ✓ | ✓ | ✅ — `gh pr view` comments for the current branch's PR | +| `/review` | ✓ | ✗ (skill avail) | 🟡 — via Skill tool | +| `/security-review` | ✓ | ✗ (skill avail) | 🟡 — via Skill tool | +| `/schedule` | ✓ | ✗ (skill avail) | 🟡 | +| `/loop` | ✓ | ✗ (skill avail) | 🟡 | +| `/terminal-setup` | ✓ | ✗ | 🔄 | +| `/vim` | ✓ | ✓ | ✅ — toggles Vim mode (persists to `~/.deepcode/keybindings.json`) | +| `/keybindings` | ✓ | ✓ (read-only) | 🟡 — Claude Code opens/creates the keybindings config; ours lists bindings (edit `~/.deepcode/keybindings.json` manually) | +| `/agents` | ✓ | ✓ | ✅ — lists sub-agents from `.deepcode/agents/` | +| `/hooks` | ✓ | ✓ | ✅ — lists hooks configured in settings.json | +| `/skills` | ✓ | ✓ | ✅ — lists built-in + user + project skills | +| `/permissions` | ✓ | ✓ (read-only) | 🟡 — shows rules + default mode (interactive editor deferred) | +| `/privacy-settings` | ✓ | ✓ | ✅ — summarizes local data locations + what's sent to the DeepSeek API (read-only) | +| `/migrate-installer` | ✓ | ✗ | 🔄 | +| `/release-notes` | ✓ | ✓ | ✅ — prints the latest `CHANGELOG.md` entry | --- diff --git a/docs/DEVELOPMENT_PLAN.md b/docs/DEVELOPMENT_PLAN.md index f1c1f2e..8dc44cb 100644 --- a/docs/DEVELOPMENT_PLAN.md +++ b/docs/DEVELOPMENT_PLAN.md @@ -709,13 +709,14 @@ Claude Code 的真沙箱:Linux 用 `bwrap`(bubblewrap)、macOS 用 `sandbo - 发送时图片自动转 base64 走 vision;> 100 KB 文本走"附件"通道 **`+` 附件菜单**(截图所示,全部实现): -| 项 | 快捷键 | 行为 | -|---|---|---| -| Add files or photos | ⌘U | 文件选择器;图片自动转 base64 走 vision;> 100KB 文本走"附件"通道(不进上下文,工具按需取) | -| Add folder | — | 把整个文件夹声明为"额外允许读"目录(写入当前会话的临时 permissions) | -| Slash commands | — | 等价输入 `/`,弹命令面板 | -| Connectors › | — | 子菜单:列出当前已配置的 MCP server,可点击"重连 / 查看工具 / 临时禁用" | -| Add plugins… | — | 打开插件市场(v1 用本地目录 `~/.deepcode/plugins/`,v1.1 上 registry) | + +| 项 | 快捷键 | 行为 | +| ------------------- | ------ | ------------------------------------------------------------------------------------------- | +| Add files or photos | ⌘U | 文件选择器;图片自动转 base64 走 vision;> 100KB 文本走"附件"通道(不进上下文,工具按需取) | +| Add folder | — | 把整个文件夹声明为"额外允许读"目录(写入当前会话的临时 permissions) | +| Slash commands | — | 等价输入 `/`,弹命令面板 | +| Connectors › | — | 子菜单:列出当前已配置的 MCP server,可点击"重连 / 查看工具 / 临时禁用" | +| Add plugins… | — | 打开插件市场(v1 用本地目录 `~/.deepcode/plugins/`,v1.1 上 registry) | **右侧控件**(从左到右): @@ -765,11 +766,12 @@ Claude Code 的真沙箱:Linux 用 `bwrap`(bubblewrap)、macOS 用 `sandbo - 顶部 tab 栏:可同时打开多个文件,关闭按钮、未保存黄点 **视图模式**(Tab 内顶部切换): -| 视图 | 用途 | -|---|---| -| **Source** | Monaco 编辑器只读视图;行号、语法高亮;可点 ✏ 切到编辑态 | -| **Diff** | 与最近一次 Edit/Write 工具调用产生的 diff 对照;左右 split 或 inline 切换 | -| **History** | 本会话内该文件的所有版本时间轴,可点击任一历史版本回到 Source/Diff | + +| 视图 | 用途 | +| ----------- | ------------------------------------------------------------------------- | +| **Source** | Monaco 编辑器只读视图;行号、语法高亮;可点 ✏ 切到编辑态 | +| **Diff** | 与最近一次 Edit/Write 工具调用产生的 diff 对照;左右 split 或 inline 切换 | +| **History** | 本会话内该文件的所有版本时间轴,可点击任一历史版本回到 Source/Diff | **键盘**:`⌘W` 关闭当前 tab;`⌘[` / `⌘]` 切换 tab;`⌘\` 切换 split / inline diff。 @@ -830,23 +832,24 @@ disabled: false # 用户可在 settings 关闭某 skill - 同一会话内同名 skill 不重复加载 **内置 skills(v1 出厂带)**: -| Skill | 触发场景 | -|---|---| -| `init` | 用户说"初始化 DEEPCODE.md / 让我开始",扫描代码库生成 `DEEPCODE.md` | -| `skill-creator` | 用户说"做个 skill / 优化这个 skill",引导创建新 skill | -| `code-review` | 评审 diff、PR、当前改动 | -| `security-review` | 安全审查当前分支 | -| `verify` | 跑应用确认改动真的工作(不只是测试通过) | -| `run` | 启动本项目并截图 | -| `keybindings-help` | 编辑 `~/.deepcode/keybindings.json` | -| `update-config` | 编辑 `settings.json` / hooks / permissions | -| `fewer-permission-prompts` | 扫描历史会话,自动给 `.deepcode/settings.json` 添加常用工具到 allow 列表 | -| `xlsx` / `docx` / `pdf` / `pptx` | 操作对应文件类型(如果该业务场景命中) | -| `consolidate-memory` | 整理 `~/.deepcode/memory/*` 去重、修正 | -| `claude-api` | (对应 deepseek-api)调 DeepSeek API 的脚手架/迁移 | -| `loop` | 按间隔重复跑某个命令(轮询 CI 等) | -| `schedule` | 创建定时远程 agent(见 §3.15 cron) | -| `review` | 评审 PR | + +| Skill | 触发场景 | +| -------------------------------- | ------------------------------------------------------------------------ | +| `init` | 用户说"初始化 DEEPCODE.md / 让我开始",扫描代码库生成 `DEEPCODE.md` | +| `skill-creator` | 用户说"做个 skill / 优化这个 skill",引导创建新 skill | +| `code-review` | 评审 diff、PR、当前改动 | +| `security-review` | 安全审查当前分支 | +| `verify` | 跑应用确认改动真的工作(不只是测试通过) | +| `run` | 启动本项目并截图 | +| `keybindings-help` | 编辑 `~/.deepcode/keybindings.json` | +| `update-config` | 编辑 `settings.json` / hooks / permissions | +| `fewer-permission-prompts` | 扫描历史会话,自动给 `.deepcode/settings.json` 添加常用工具到 allow 列表 | +| `xlsx` / `docx` / `pdf` / `pptx` | 操作对应文件类型(如果该业务场景命中) | +| `consolidate-memory` | 整理 `~/.deepcode/memory/*` 去重、修正 | +| `claude-api` | (对应 deepseek-api)调 DeepSeek API 的脚手架/迁移 | +| `loop` | 按间隔重复跑某个命令(轮询 CI 等) | +| `schedule` | 创建定时远程 agent(见 §3.15 cron) | +| `review` | 评审 PR | **Slash command 关联**:每个 skill 自动注册同名 slash command,用户可以 `/` 显式调用(绕过模型自主判断)。 @@ -888,12 +891,13 @@ maxTurns: 12 # 防止跑飞的硬上限 **位置**:`~/.deepcode/output-styles/.md`、`/.deepcode/output-styles/.md`、内置。 **内置 4 种**: -| Style | 用途 | -|---|---| -| `default` | 简洁、直接、最少废话 | -| `explanatory` | 解释为什么这样改,适合学习 | -| `learning` | 类教师模式 — 引导用户自己写关键代码,agent 只给出框架 | -| `proactive` | agent 主动建议下一步、提示风险点 | + +| Style | 用途 | +| ------------- | ----------------------------------------------------- | +| `default` | 简洁、直接、最少废话 | +| `explanatory` | 解释为什么这样改,适合学习 | +| `learning` | 类教师模式 — 引导用户自己写关键代码,agent 只给出框架 | +| `proactive` | agent 主动建议下一步、提示风险点 | **文件格式**: @@ -930,13 +934,14 @@ keep-coding-instructions: true # 是否保留 system prompt 中的"如何写代 5. 系统默认 `medium` **映射到 DeepSeek**: -| Effort | `deepseek-chat` `max_tokens` | `deepseek-reasoner` reasoning budget | UI 标签 | -|---|---|---|---| -| `low` | 4,000 | 1,500 token | Standard | -| `medium` | 8,000 | 4,000 token | Standard | -| `high` | 16,000 | 12,000 token | High | -| `xhigh` | 24,000 | 24,000 token | Extra High | -| `max` | 32,000 | unlimited | Max | + +| Effort | `deepseek-chat` `max_tokens` | `deepseek-reasoner` reasoning budget | UI 标签 | +| -------- | ---------------------------- | ------------------------------------ | ---------- | +| `low` | 4,000 | 1,500 token | Standard | +| `medium` | 8,000 | 4,000 token | Standard | +| `high` | 16,000 | 12,000 token | High | +| `xhigh` | 24,000 | 24,000 token | Extra High | +| `max` | 32,000 | unlimited | Max | **环境变量**:`CLAUDE_CODE_EFFORT_LEVEL` → DeepCode 等价 `DEEPCODE_EFFORT_LEVEL`,CI 场景可注入。 @@ -974,15 +979,16 @@ UI 上 effort 选择器嵌在模型选择器旁(参考视觉稿 #4 屏 compose ``` **贡献点说明**: -| contributes | 含义 | -|---|---| -| `skills` | 注册 skill,命名空间 `:` | -| `commands` | 注册 slash command;可链接到自家 skill 或直接 inline 一段 prompt | -| `hooks` | 注册 6 类事件的 hook,与用户 settings.json 中的 hooks 共存(plugin 的先于 user 执行)| -| `mcpServers` | 注册 MCP server,默认禁用,用户在 settings 里开启 | -| `agents` | 注册 subagent 类型(带独立 system prompt + tools 白名单),可作为 `Task({ subagent_type: ":" })` 的 type 值 | -| `statusLines` | 注册状态栏命令变体 | -| `modes` | 注册自定义 mode | + +| contributes | 含义 | +| ------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `skills` | 注册 skill,命名空间 `:` | +| `commands` | 注册 slash command;可链接到自家 skill 或直接 inline 一段 prompt | +| `hooks` | 注册 6 类事件的 hook,与用户 settings.json 中的 hooks 共存(plugin 的先于 user 执行) | +| `mcpServers` | 注册 MCP server,默认禁用,用户在 settings 里开启 | +| `agents` | 注册 subagent 类型(带独立 system prompt + tools 白名单),可作为 `Task({ subagent_type: ":" })` 的 type 值 | +| `statusLines` | 注册状态栏命令变体 | +| `modes` | 注册自定义 mode | **安装方式**: @@ -1194,12 +1200,13 @@ CLI 用 ANSI cursor save/restore;GUI 用 React 组件订阅 statusline stream - GUI:右侧文件面板 History tab 内每个快照都有 `↶` 按钮 **5 种回退操作**(弹层让用户选): -| 操作 | 含义 | -|---|---| -| Restore code | 文件回到该快照,对话不变 | -| Restore conversation | 对话回到该点,文件不变 | -| Restore both | 都回 | -| Summarize-from-here | 把这一点之后的所有对话压缩成一段总结接续 | + +| 操作 | 含义 | +| -------------------- | --------------------------------------------------------------------- | +| Restore code | 文件回到该快照,对话不变 | +| Restore conversation | 对话回到该点,文件不变 | +| Restore both | 都回 | +| Summarize-from-here | 把这一点之后的所有对话压缩成一段总结接续 | | Summarize-up-to-here | 把这一点之前的所有对话压缩成一段总结作为新会话起点(替代 `/compact`) | **存储管理**:sessions cleanup(`cleanupPeriodDays`)连带清理快照;单会话快照硬上限 200 份(超出 LRU 淘汰)。 diff --git a/docs/milestones/M2.md b/docs/milestones/M2.md index b9033e9..bd52569 100644 --- a/docs/milestones/M2.md +++ b/docs/milestones/M2.md @@ -24,15 +24,15 @@ ### CLI app -| Module | Lines | Tests | +| Module | Lines | Tests | | --------------- | ----------------------------------------------------------- | -------- | --------------- | -| `parse-args.ts` | dependency-free argv parser, 27 flags | 200 | 14 | -| `commands.ts` | 14 slash commands + registry | 220 | 13 | -| `repl.ts` | readline-based REPL, agent dispatch, event rendering | 165 | (smoke via bin) | -| `onboarding.ts` | hidden-input API key prompt, baseURL config, redact display | 110 | (smoke) | -| `trust.ts` | `~/.deepcode/trusted-dirs.json` persistence | 56 | 5 | -| `cli.ts` | bin entry: flag dispatch → onboarding/REPL/doctor | 88 | (smoke via bin) | -| **subtotal** | 6 modules | **~840** | **32** | +| `parse-args.ts` | dependency-free argv parser, 27 flags | 200 | 14 | +| `commands.ts` | 14 slash commands + registry | 220 | 13 | +| `repl.ts` | readline-based REPL, agent dispatch, event rendering | 165 | (smoke via bin) | +| `onboarding.ts` | hidden-input API key prompt, baseURL config, redact display | 110 | (smoke) | +| `trust.ts` | `~/.deepcode/trusted-dirs.json` persistence | 56 | 5 | +| `cli.ts` | bin entry: flag dispatch → onboarding/REPL/doctor | 88 | (smoke via bin) | +| **subtotal** | 6 modules | **~840** | **32** | ### Documentation diff --git a/docs/milestones/M3.md b/docs/milestones/M3.md index 441c3fd..cf952dd 100644 --- a/docs/milestones/M3.md +++ b/docs/milestones/M3.md @@ -10,14 +10,14 @@ ## What ships in THIS PR (M3a) -| Module | Lines | Tests | +| Module | Lines | Tests | | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ------ | --- | -| `modes/index.ts` — 5 mode policies, ModeRequest → ModeVerdict | 92 | 14 | -| `hooks/types.ts` — HookContext / HookHandlerOutput / HookResult | 55 | — | -| `hooks/dispatcher.ts` — 9 events × `command` handler + JSON output parsing + `disableAllHooks` + matcher with ` | ` OR + stdin payload + timeout | 178 | 14 | -| `memory/loader.ts` — DEEPCODE.md hierarchical walk + user-level + AGENTS.md + .deepcode/rules/ + @-import (4-hop max, cycle detection) + maxBytes budget | 170 | 14 | -| `index.ts` — re-export new modules | +30 | — | -| **subtotal** | **~525** | **42** | +| `modes/index.ts` — 5 mode policies, ModeRequest → ModeVerdict | 92 | 14 | +| `hooks/types.ts` — HookContext / HookHandlerOutput / HookResult | 55 | — | +| `hooks/dispatcher.ts` — 9 events × `command` handler + JSON output parsing + `disableAllHooks` + matcher with ` |` OR + stdin payload + timeout | 178 | 14 | +| `memory/loader.ts` — DEEPCODE.md hierarchical walk + user-level + AGENTS.md + .deepcode/rules/ + @-import (4-hop max, cycle detection) + maxBytes budget | 170 | 14 | +| `index.ts` — re-export new modules | +30 | — | +| **subtotal** | **~525** | **42** | ## What's deferred to M3b (next PR) diff --git a/docs/milestones/M5.md b/docs/milestones/M5.md index 6502fb8..caf36a3 100644 --- a/docs/milestones/M5.md +++ b/docs/milestones/M5.md @@ -5,12 +5,12 @@ ## Shipped -| Module | Lines | Tests | +| Module | Lines | Tests | | ---------------------- | -------------------------------------------------------------------------------------------------------------------- | ------ | ------- | -| `plugins/manifest.ts` | Manifest parser, SHA-256 hash pinning, trust state JSON, installLocal(), discoverPlugins() with hash drift detection | 175 | 12 | -| `skills/tool.ts` | `Skill` ToolHandler factory — agent invokes by qualified name, skill body returned as tool_result | 60 | 6 | -| `apps/cli/src/repl.ts` | Wires memory + skills + output styles + mode/permissions/hooks/approval into the REPL agent loop | +50 | (smoke) | -| **subtotal** | **~285** | **18** | +| `plugins/manifest.ts` | Manifest parser, SHA-256 hash pinning, trust state JSON, installLocal(), discoverPlugins() with hash drift detection | 175 | 12 | +| `skills/tool.ts` | `Skill` ToolHandler factory — agent invokes by qualified name, skill body returned as tool_result | 60 | 6 | +| `apps/cli/src/repl.ts` | Wires memory + skills + output styles + mode/permissions/hooks/approval into the REPL agent loop | +50 | (smoke) | +| **subtotal** | **~285** | **18** | Across whole project: 258 tests / 4 skipped / 0 failed (was 240). diff --git a/package.json b/package.json index 8207b5c..e8c005a 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@types/node": "^22.10.0", "eslint": "^10.8.0", "husky": "^9.1.0", - "prettier": "^3.3.0", + "prettier": "^3.9.6", "typescript": "^5.7.0", "typescript-eslint": "^8.61.1", "vitest": "^4.1.10" diff --git a/packages/core/skills/pdf/SKILL.md b/packages/core/skills/pdf/SKILL.md index 604e47a..af7e0e9 100644 --- a/packages/core/skills/pdf/SKILL.md +++ b/packages/core/skills/pdf/SKILL.md @@ -15,13 +15,13 @@ the OS-bundled tools (macOS) or `pdftk` (Linux) via Bash. ## Tools -| Op | macOS | Linux (pdftk) | +| Op | macOS | Linux (pdftk) | | ----------------- | ----------------------------------------- | ----------------------------------------------- | ---- | -| Extract pages 2-5 | `cpdf in.pdf 2-5 -o out.pdf` (needs cpdf) | `pdftk in.pdf cat 2-5 output out.pdf` | -| Merge a, b, c | (PDF Toolkit / cpdf) | `pdftk a.pdf b.pdf c.pdf cat output merged.pdf` | -| Split per page | `cpdf -split in.pdf -o page-%d.pdf` | `pdftk in.pdf burst output page-%02d.pdf` | -| Text dump | `pdftotext in.pdf -` (needs poppler) | same | -| Page count | `pdftk in.pdf dump_data | grep NumberOfPages` | same | +| Extract pages 2-5 | `cpdf in.pdf 2-5 -o out.pdf` (needs cpdf) | `pdftk in.pdf cat 2-5 output out.pdf` | +| Merge a, b, c | (PDF Toolkit / cpdf) | `pdftk a.pdf b.pdf c.pdf cat output merged.pdf` | +| Split per page | `cpdf -split in.pdf -o page-%d.pdf` | `pdftk in.pdf burst output page-%02d.pdf` | +| Text dump | `pdftotext in.pdf -` (needs poppler) | same | +| Page count | `pdftk in.pdf dump_data | grep NumberOfPages` | same | If neither `cpdf` nor `pdftk` is installed, use Python + `pypdf` (one dep, pure Python): diff --git a/packages/core/skills/update-config/SKILL.md b/packages/core/skills/update-config/SKILL.md index 0eb800a..d12d05d 100644 --- a/packages/core/skills/update-config/SKILL.md +++ b/packages/core/skills/update-config/SKILL.md @@ -38,15 +38,15 @@ overrides), local. ## Common requests -| User asks | Setting | +| User asks | Setting | | ---------------------------------- | ---------------------------------------- | ------------------------ | -| "Don't ask me about reads" | `permissions.allow: ["Read"]` | -| "Stop running tests for me" | `permissions.deny: ["Bash(npm test:*)"]` | -| "Use deepseek-reasoner by default" | `model: "deepseek-reasoner"` | -| "Lower the effort" | `effortLevel: "low"` | -| "Turn off the sandbox" | `sandbox.enabled: false` | -| "Disable plugin X" | `disabledPlugins: ["X"]` | -| "Add a hook to lint after edits" | `hooks.PostToolUse: [{ matcher: "Edit | Write", hooks: [...] }]` | +| "Don't ask me about reads" | `permissions.allow: ["Read"]` | +| "Stop running tests for me" | `permissions.deny: ["Bash(npm test:*)"]` | +| "Use deepseek-reasoner by default" | `model: "deepseek-reasoner"` | +| "Lower the effort" | `effortLevel: "low"` | +| "Turn off the sandbox" | `sandbox.enabled: false` | +| "Disable plugin X" | `disabledPlugins: ["X"]` | +| "Add a hook to lint after edits" | `hooks.PostToolUse: [{ matcher: "Edit | Write", hooks: [...] }]` | ## Refuse diff --git a/packages/core/src/providers/deepseek.ts b/packages/core/src/providers/deepseek.ts index 62526f8..14714d8 100644 --- a/packages/core/src/providers/deepseek.ts +++ b/packages/core/src/providers/deepseek.ts @@ -95,8 +95,7 @@ export class DeepSeekProvider implements Provider { for await (const chunk of stream) { const choice = chunk.choices?.[0]; const delta = choice?.delta as - | { content?: string; reasoning_content?: string; tool_calls?: unknown[] } - | undefined; + { content?: string; reasoning_content?: string; tool_calls?: unknown[] } | undefined; if (delta?.content) { text += delta.content; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 577f874..2687048 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^9.1.0 version: 9.1.7 prettier: - specifier: ^3.3.0 - version: 3.8.3 + specifier: ^3.9.6 + version: 3.9.6 typescript: specifier: ^5.7.0 version: 5.9.3 @@ -2069,8 +2069,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.8.3: - resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} + prettier@3.9.6: + resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} engines: {node: '>=14'} hasBin: true @@ -4443,7 +4443,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.8.3: {} + prettier@3.9.6: {} proxy-addr@2.0.7: dependencies: