dsh-diff-approval 0.29.1 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +7 -4
  2. package/README.zh.md +7 -4
  3. package/assets/fonts/README.md +10 -8
  4. package/assets/fonts/manifest.json +1 -1
  5. package/lib/client.js +5161 -1972
  6. package/lib/index.js +4331 -442
  7. package/lib/types/annotate-skill.d.ts +34 -0
  8. package/lib/types/annotate-tool.d.ts +227 -0
  9. package/lib/types/annotate.d.ts +186 -0
  10. package/lib/types/atomic-write.d.ts +77 -0
  11. package/lib/types/client/PendingPanel.d.ts +92 -24
  12. package/lib/types/client/category-color.d.ts +62 -0
  13. package/lib/types/client/chords.d.ts +70 -17
  14. package/lib/types/client/discussion.d.ts +76 -16
  15. package/lib/types/client/dock.d.ts +8 -8
  16. package/lib/types/client/dsh-icons.d.ts +98 -0
  17. package/lib/types/client/header-entry.d.ts +27 -11
  18. package/lib/types/client/ids.d.ts +18 -0
  19. package/lib/types/client/locales.d.ts +88 -36
  20. package/lib/types/client/panel-memory.d.ts +118 -35
  21. package/lib/types/client/path-match.d.ts +50 -0
  22. package/lib/types/client/port.d.ts +77 -1
  23. package/lib/types/client/presentation-menu.d.ts +1 -1
  24. package/lib/types/client/produced-diff.d.ts +136 -22
  25. package/lib/types/client/reference.d.ts +0 -2
  26. package/lib/types/client/remap-sync.d.ts +18 -1
  27. package/lib/types/client/session-seat.d.ts +93 -0
  28. package/lib/types/client/settings.d.ts +40 -14
  29. package/lib/types/client/slots.d.ts +184 -12
  30. package/lib/types/client/store.d.ts +85 -2
  31. package/lib/types/comment-ask.d.ts +236 -0
  32. package/lib/types/comment-lines.d.ts +131 -0
  33. package/lib/types/comments.d.ts +465 -0
  34. package/lib/types/index.d.ts +7 -2
  35. package/lib/types/pending.d.ts +53 -4
  36. package/lib/types/types.d.ts +356 -4
  37. package/lib/types/vcs.d.ts +53 -26
  38. package/lib/types/version.d.ts +162 -0
  39. package/package.json +7 -2
  40. package/lib/types/client/chat-bridge.d.ts +0 -70
package/README.md CHANGED
@@ -4,6 +4,9 @@ English | [中文](README.zh.md)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/dsh-diff-approval)](https://www.npmjs.com/package/dsh-diff-approval)
6
6
  [![CI](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/ci.yml)](https://github.com/9087/dsh-diff-approval/actions)
7
+ [![Compat (supported releases)](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/compat.yml?label=compat%20(supported))](https://github.com/9087/dsh-diff-approval/actions/workflows/compat.yml)
8
+ [![Compat (newer published releases)](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/compat-newer.yml?label=compat%20(newer))](https://github.com/9087/dsh-diff-approval/actions/workflows/compat-newer.yml)
9
+ [![Release](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/release.yml?label=release)](https://github.com/9087/dsh-diff-approval/actions/workflows/release.yml)
7
10
 
8
11
  A DeepSeek Harness (DSH) plugin for pending-change review: it automatically tracks every successful `edit`, `write`, and editor (`str_replace_editor`) mutation, folds them into a single pending list in the sidebar where each file's diff can be reviewed and kept/reverted — and it can also import the workspace's version-control repository's local changes (Git / SVN / Perforce) in one click.
9
12
 
@@ -38,8 +41,8 @@ For Markdown files, the source-line diff can also be shown as a rendered before/
38
41
  - **Customizable appearance**: from the "Diff view" settings group, adjust the diff's code font size (%), line height (px), and the added / removed line colors, with a live preview.
39
42
  - **External changes**: files already in the pending list are monitored — if one is later modified outside the reviewed edits (another tool, an editor), the panel adopts the new content and flags the divergence.
40
43
  - **Open / Reveal**: while reviewing a file's diff, open it in its default app or reveal it in the system file manager with one click.
41
- - **Import workspace changes**: when the list is empty, click the button to import the workspace's local changes from **Git / SVN / Perforce** — modified, deleted, and (opt-in) untracked files. The VCS root is found by walking up from the workspace, so a workspace inside a subdirectory works too.
42
- - **Settings**: a "Diff Approval" section in DeepSeek Harness settings, grouped into **Diff view** (code font size, line height, added / removed colors), **Shortcuts** (rebind the panel's keyboard chords), and **Floating coverage** (the same four edge switches the panel's own popover offers) plus preferences for auto-paste on copy, whether untracked files are included when importing, the diff's tab width (2 / 4 / 8 spaces), the side-by-side split view, the block-jump lead rows, the Markdown preview default and width, and the quick-summon chord.
44
+ - **Import version-control changes**: when the list is empty, click the button to import the workspace's local changes from **Git / SVN / Perforce** — everything that is **not committed yet, staged or not** (Git is read against the last commit, the `git diff HEAD` view), plus deleted files and, opt-in, files the VCS has never seen (untracked / unversioned). The VCS root is found by walking up from the workspace, so a workspace inside a subdirectory works too.
45
+ - **Settings**: a "Diff Approval" section in DeepSeek Harness settings, grouped into **Diff view** (code font size, line height, added / removed colors), **Shortcuts** (rebind the panel's keyboard chords), and **Floating coverage** (the same four edge switches the panel's own popover offers) plus preferences for auto-paste on copy, whether to include files version control has not seen when importing, the diff's tab width (2 / 4 / 8 spaces), the side-by-side split view, the block-jump lead rows, the Markdown preview default and width, and the quick-summon chord.
43
46
  - **Persistence**: pending state is stored per workspace at `<dshHome>/diff-approval/workspaces/<workspaceId>.json` and survives restarts — unhandled changes are still there when you come back, even in a fresh session.
44
47
 
45
48
  ## 📦 Install
@@ -74,12 +77,12 @@ Then restart `dsh web`.
74
77
 
75
78
  1. Work with the agent as usual — successful `edit` / `write` / editor (`str_replace_editor`) calls are recorded automatically.
76
79
  2. Click the **Pending changes** action at the sidebar footer, review each file's diff, and **Keep** / **Revert**.
77
- 3. When the list is empty, **Import workspace changes** pulls in the workspace's local Git/SVN/Perforce changes.
80
+ 3. When the list is empty, **Import version-control changes** pulls in what the workspace has not committed yet.
78
81
 
79
82
  ## 📝 Notes
80
83
 
81
84
  - Only tracked mutations (`edit`, `write`, and `str_replace_editor` editor calls) are recorded automatically. Deletions made outside these tools (e.g. shell `rm`) are sensed only for tracked files: the entry turns "File is gone" and its Revert restores the file.
82
- - The VCS import runs read-only Git/SVN/Perforce commands through the deployment's shell executor, so the respective CLI must be on `PATH`. Importing untracked files (default off) scans the whole workspace, which can be slow on large trees.
85
+ - The VCS import runs read-only Git/SVN/Perforce commands through the deployment's shell executor, so the respective CLI must be on `PATH`. Including files version control has not seen (default off) scans the whole workspace, which can be slow on large trees.
83
86
  - For a newly-created file, the whole-file revert action reads **Delete** and removes the file.
84
87
  - Reverting a file writes it back with its current line endings (LF / CRLF) preserved.
85
88
  - Sessions with no workspace keep their entries memory-only; corrupt persistence files are rejected and can be deleted to reset.
package/README.zh.md CHANGED
@@ -4,6 +4,9 @@
4
4
 
5
5
  [![npm 版本](https://img.shields.io/npm/v/dsh-diff-approval)](https://www.npmjs.com/package/dsh-diff-approval)
6
6
  [![CI](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/ci.yml)](https://github.com/9087/dsh-diff-approval/actions)
7
+ [![兼容性(声明范围内的已发布版本)](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/compat.yml?label=compat%20(supported))](https://github.com/9087/dsh-diff-approval/actions/workflows/compat.yml)
8
+ [![兼容性(比 latest 更新的已发布版本)](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/compat-newer.yml?label=compat%20(newer))](https://github.com/9087/dsh-diff-approval/actions/workflows/compat-newer.yml)
9
+ [![发布](https://img.shields.io/github/actions/workflow/status/9087/dsh-diff-approval/release.yml?label=release)](https://github.com/9087/dsh-diff-approval/actions/workflows/release.yml)
7
10
 
8
11
  一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` / 编辑器(`str_replace_editor`)改动,在侧边栏整合为一个待处理列表,可逐个文件查看完整差异并保留 / 回退,也可以把工作区里版本控制仓库的本地改动一键导入(Git / SVN / Perforce)。
9
12
 
@@ -38,8 +41,8 @@
38
41
  - **外观自定义**:在「差异视图」设置组里可调整差异代码字号(%)、行高(px)以及新增 / 删除行颜色,并带实时预览。
39
42
  - **外部改动**:已纳入列表的文件若之后被外部修改(其它工具 / 编辑器),面板会跟进最新内容并标记分歧。
40
43
  - **打开 / 定位**:查看某个文件的差异时,可一键在默认应用中打开它,或在系统文件管理器中定位它。
41
- - **导入工作区改动**:列表为空时,点击按钮即可导入工作区里 **Git / SVN / Perforce** 的本地改动——已修改、已删除,以及(可选开启的)未跟踪文件。通过从工作区目录逐级向上查找 VCS 根目录,工作区在子目录里也能识别。
42
- - **设置**:在 DeepSeek Harness 设置里新增「改动审批」页,分为「差异视图」(代码字号、行高、新增 / 删除颜色)、「快捷键」(重绑面板各类按键组合)与「浮窗覆盖」(面板自身弹出菜单里的那四个边的开关)三组,另有复制后自动粘贴、导入时是否包含未跟踪文件、diff 的 Tab 宽度(2 / 4 / 8 空格)、双栏对比开关、差异跳转行距、Markdown 预览默认与宽度,以及快速呼出快捷键。
44
+ - **导入版本控制的改动**:列表为空时,点击按钮即可导入工作区里 **Git / SVN / Perforce** 的本地改动——**凡是没有提交的都算,add 过与否一样**(Git 以最后一次提交为基准,即 `git diff HEAD` 的口径),以及已删除文件,和(可选开启的)VCS 从未见过的文件(未跟踪 / 未版本化)。通过从工作区目录逐级向上查找 VCS 根目录,工作区在子目录里也能识别。
45
+ - **设置**:在 DeepSeek Harness 设置里新增「改动审批」页,分为「差异视图」(代码字号、行高、新增 / 删除颜色)、「快捷键」(重绑面板各类按键组合)与「浮窗覆盖」(面板自身弹出菜单里的那四个边的开关)三组,另有复制后自动粘贴、导入时是否包含版本控制未跟踪文件、diff 的 Tab 宽度(2 / 4 / 8 空格)、双栏对比开关、差异跳转行距、Markdown 预览默认与宽度,以及快速呼出快捷键。
43
46
  - **持久化**:待处理状态按 workspace 落盘至 `<dshHome>/diff-approval/workspaces/<workspaceId>.json`,跨重启保留——回来时未处理的改动仍在,即便换了新会话。
44
47
 
45
48
  ## 📦 安装
@@ -74,12 +77,12 @@ npx @deepseek-ai/dsh plugin --profile web add dsh-diff-approval
74
77
 
75
78
  1. 照常和智能体对话——成功的 `edit` / `write` / 编辑器(`str_replace_editor`)调用会自动记录。
76
79
  2. 点击侧边栏底部的 **待处理改动** 入口,逐文件查看差异并 **保留 / 回退**。
77
- 3. 列表为空时,点 **导入工作区改动**,把工作区的 Git / SVN / Perforce 本地改动拉入。
80
+ 3. 列表为空时,点 **导入版本控制的改动**,把尚未提交的 Git / SVN / Perforce 改动拉入。
78
81
 
79
82
  ## 📝 注意事项
80
83
 
81
84
  - 只自动记录被跟踪的改动(`edit`、`write` 与编辑器 `str_replace_editor` 调用)。通过以上工具以外的删除(如 shell `rm`)只能对已跟踪的文件感知:条目显示"文件已不存在",回退即恢复。
82
- - VCS 导入通过部署环境的 shell 执行器运行只读的 Git / SVN / Perforce 命令,需要对应 CLI 在 `PATH` 中。导入未跟踪文件(默认关闭)会扫描整个工作区,目录很大时可能较慢。
85
+ - VCS 导入通过部署环境的 shell 执行器运行只读的 Git / SVN / Perforce 命令,需要对应 CLI 在 `PATH` 中。包含版本控制未跟踪文件(默认关闭)会扫描整个工作区,目录很大时可能较慢。
83
86
  - 新建文件的整文件回退操作显示为**删除**并移除该文件。
84
87
  - 回退文件时会保留其当前换行符(LF / CRLF)。
85
88
  - 没有 workspace 的会话条目仅存内存;损坏的落盘文件会被拒绝,删除即可重置。
@@ -77,14 +77,16 @@ shell's stack>}`. `.lines` is the diff's code table, so the grid lands on the co
77
77
  and nothing else — comment bubbles, the file list and the panel's chrome keep the
78
78
  shell's font stack.
79
79
 
80
- **Off until asked for.** The switch is in the plugin's DSH Settings section
81
- (`等宽 CJK 字体` / "Monospaced CJK font"), stored as `diff-approval:code-font`, and
82
- it defaults to off because the slices are traffic the reader pays for: tens of
83
- kilobytes for ordinary Chinese, at most ~120 KB per slice for a rare character,
84
- 33 KB for pure ASCII. Off means nothing is fetched at all — no manifest request,
85
- no `@font-face` — so the default panel is exactly what it was before this
86
- existed. A browser fetches a `@font-face` only when a rule uses it, which is what
87
- keeps an enabled pure-ASCII file down to the one Latin slice.
80
+ **ON by default, and the switch still turns it off.** The switch is in the plugin's DSH Settings section
81
+ (`等宽 CJK 字体` / "Monospaced CJK font"), stored as `diff-approval:mono-font`, and it defaults to ON
82
+ (2026-10-06): the reader asked for existing profiles to be brought along rather than left off, and the cost
83
+ is traffic that arrives ON DEMAND rather than with the page — tens of kilobytes for ordinary Chinese, at
84
+ most ~120 KB per slice for a rare character, 33 KB for pure ASCII. Only an explicit `'0'` turns it off;
85
+ the older `diff-approval:code-font` key is not read at all, so a profile that had turned the font off before
86
+ that change comes back with it on (deliberate, recorded at the constant in `src/client/settings.ts`). Off
87
+ means nothing is fetched at
88
+ all — no manifest request, no `@font-face`. A browser fetches a `@font-face` only when a rule uses it, which
89
+ is what keeps an enabled pure-ASCII file down to the one Latin slice.
88
90
 
89
91
  `font-display: swap` rather than `block`: the code is readable in the system font
90
92
  immediately, and swapping when the slices land changes the column width, never
@@ -15,7 +15,7 @@
15
15
  "seedGlyphs": 300,
16
16
  "capBytes": 120000,
17
17
  "order": "ranked-hanzi.txt",
18
- "gatedBy": "settings switch: diff-approval:code-font (off by default)"
18
+ "gatedBy": "settings switch: diff-approval:mono-font (on by default; an explicit '0' turns it off)"
19
19
  },
20
20
  "slices": [
21
21
  {