dsh-diff-approval 0.6.0 → 0.8.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.
package/README.md CHANGED
@@ -5,16 +5,24 @@ English | [中文](README.zh.md)
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
7
 
8
- A DeepSeek Harness (DSH) plugin for pending-change review: it automatically tracks every successful `edit`, `write`, and editor (`str_replace_editor`) mutation, folds all unhandled changes into one entry per file, and shows each file's diff with Keep/Revert in the sidebar no git involved.
8
+ 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
9
 
10
10
  ![Pending changes panel](docs/images/pending-panel.png)
11
11
 
12
+ The numbered markers (① – ⑧) in the screenshot point to the matching details described below.
13
+
12
14
  ## ✨ Features
13
15
 
14
- - **Diff view**: syntax-highlighted diff with +/− counts and change-block jump (previous/next diff). Select text in the diff and the bottom status bar shows its `file:start-end` reference click it (or press `Ctrl+L`) to copy.
15
- - **Highlight language**: the diff's status bar picks the highlight languageauto-detected from the file extension (shown as "Auto: …"), or overridden manually from the dropdown.
16
- - **Keep / Revert**: one decision per file. Keep accepts the changes; Revert writes the file back to its earliest basis (a created file is removed, a deleted tracked file is restored).
17
- - **Open / Reveal**: open a file in its default app, or reveal it in the file manager, right from the diff header.
16
+ - **Diff view**: syntax-highlighted whole-file diff with +/− counts, an overview ruler on the scrollbar showing where changes sit, and an in-file search (`Ctrl+F`). Rows are virtualized, so huge files stay smooth.
17
+ - **Block navigation & decisions**: jump between change blocks with `Ctrl+↑/↓` (or the previous/next buttons)the focused block flashes. Hover a block to **Keep** or **Revert** just that block from a small actions frame ③ that also shows its position (e.g. "2/5").
18
+ - **Per-file and bulk decisions**: the files in the file list can be kept / reverted one at a time, or **Keep all** / **Revert all** from its footer.
19
+ - **Undo / Redo**: every keep, revert, and import is undoable with `Ctrl+Z` / `Ctrl+Y` (active while the panel is open; text inputs keep their own editing).
20
+ - **Line references**: select text in the diff — the status bar shows its `file:start-end` reference ⑦; click it (or press `Ctrl+L`) to copy, and with the setting on it auto-pastes into the composer ⑥ and focuses it.
21
+ - **Highlight language**: auto-detected from the file extension, or overridden from a dropdown ⑧.
22
+ - **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.
23
+ - **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.
24
+ - **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.
25
+ - **Settings**: a "Diff Approval" section in DeepSeek Harness settings with the preferences for auto-paste on copy and whether untracked files are included when importing.
18
26
  - **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.
19
27
 
20
28
  ## 📦 Install
@@ -47,14 +55,14 @@ Then restart `dsh web`.
47
55
 
48
56
  ## 🚀 Usage
49
57
 
50
- 1. Work with the agent as usual — successful `edit` / `write` calls are recorded automatically.
51
- 2. Click the **Pending changes** action at the sidebar footer (the badge shows the count).
52
- 3. Click a file row to expand its full diff; use **Previous diff** / **Next diff** to jump between change blocks. Select text and click the reference in the bottom status bar (or press `Ctrl+L`) to copy a line reference.
53
- 4. **Keep** accepts the file's changes; **Revert** restores its earliest basis. The row then leaves the list.
58
+ 1. Work with the agent as usual — successful `edit` / `write` / editor (`str_replace_editor`) calls are recorded automatically.
59
+ 2. Click the **Pending changes** action at the sidebar footer, review each file's diff, and **Keep** / **Revert**.
60
+ 3. When the list is empty, **Import workspace changes** pulls in the workspace's local Git/SVN/Perforce changes.
54
61
 
55
62
  ## 📝 Notes
56
63
 
57
- - Only tracked mutations (`edit`, `write`, and `str_replace_editor` editor calls) are recorded. 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.
64
+ - 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.
65
+ - 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.
58
66
  - Reverting a created file deletes it (the fs seam has no delete API).
59
67
  - Sessions with no workspace keep their entries memory-only; corrupt persistence files are rejected and can be deleted to reset.
60
68
 
package/README.zh.md CHANGED
@@ -5,16 +5,24 @@
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
7
 
8
- 一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` / 编辑器(`str_replace_editor`)改动,把一个文件的全部未处理改动合并为一条待处理条目,在侧边栏展示每个文件的完整差异,支持保留 / 回退——全程不依赖 git。
8
+ 一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` / 编辑器(`str_replace_editor`)改动,在侧边栏整合为一个待处理列表,可逐个文件查看完整差异并保留 / 回退,也可以把工作区里版本控制仓库的本地改动一键导入(Git / SVN / Perforce)。
9
9
 
10
10
  ![待处理改动面板](docs/images/pending-panel.zh.png)
11
11
 
12
+ 截图中的序号标记(① – ⑧)指向下方对应的描述。
13
+
12
14
  ## ✨ 功能
13
15
 
14
- - **差异视图**:语法高亮与 +/− 统计,按差异块跳转(上一处 / 下一处)。选中 diff 文本后,底部状态栏显示 `文件:起-止` 引用——点击(或按 `Ctrl+L`)即可复制。
15
- - **高亮语言**:diff 底部状态栏可选高亮语言——默认按扩展名自动检测(显示为「自动:…」),也可手动从下拉切换。
16
- - **保留 / 回退**:每个文件一次决定。保留即接受;回退把文件写回最早基准(新建文件则删除,已被删除的跟踪文件则恢复)。
17
- - **打开 / 定位**:从 diff 头部即可在默认应用中打开文件,或在文件管理器中定位它。
16
+ - **差异视图**:语法高亮整文件差异 +/− 统计,滚动条上有概览标尺 标示改动位置,支持文件内搜索(`Ctrl+F`)。列表按视口虚拟化渲染,大文件也能保持流畅。
17
+ - **差异块导航与操作**:用 `Ctrl+↑/↓`(或上一处 / 下一处按钮)在差异块间跳转,当前块会高亮闪烁。悬停某一块可从小操作框 ③ 单独**保留 / 回退**该块,并显示其位置(如「2/5」)。
18
+ - **整文件与批量操作**:文件列表 ② 里的文件可逐个保留 / 回退,也可在列表底部**全部保留** / **全部回退**。
19
+ - **撤销 / 重做**:每次保留、回退、导入都可以用 `Ctrl+Z` / `Ctrl+Y` 撤销 / 重做(面板打开期间全局生效,输入框保留各自的编辑行为)。
20
+ - **行引用**:选中 diff 文本后,底部状态栏显示其 `文件:起-止` 引用 ⑦——点击(或按 `Ctrl+L`)即可复制,开启设置后还会自动粘贴到消息输入框 ⑥ 并获得焦点。
21
+ - **高亮语言**:默认按扩展名自动检测,也可通过下拉列表 ⑧ 手动切换。
22
+ - **外部改动**:已纳入列表的文件若之后被外部修改(其它工具 / 编辑器),面板会跟进最新内容并标记分歧。
23
+ - **打开 / 定位**:查看某个文件的差异时,可一键在默认应用中打开它,或在系统文件管理器中定位它。
24
+ - **导入工作区改动**:列表为空时,点击按钮即可导入工作区里 **Git / SVN / Perforce** 的本地改动——已修改、已删除,以及(可选开启的)未跟踪文件。通过从工作区目录逐级向上查找 VCS 根目录,工作区在子目录里也能识别。
25
+ - **设置**:在 DeepSeek Harness 设置里新增「改动审批」页,包含复制后自动粘贴、导入时是否包含未跟踪文件两个偏好。
18
26
  - **持久化**:待处理状态按 workspace 落盘至 `<dshHome>/diff-approval/workspaces/<workspaceId>.json`,跨重启保留——回来时未处理的改动仍在,即便换了新会话。
19
27
 
20
28
  ## 📦 安装
@@ -47,14 +55,14 @@ npx @deepseek-ai/dsh plugin --profile web add dsh-diff-approval
47
55
 
48
56
  ## 🚀 用法
49
57
 
50
- 1. 照常和 agent 对话——成功的 `edit` / `write` 调用会自动记录。
51
- 2. 点击侧边栏底部的 **待处理改动** 入口(角标显示数量)。
52
- 3. 点击文件行展开该文件的完整差异,用 **上一处差异** / **下一处差异** 在差异块间跳转。选中文本后点击底部状态栏的引用(或按 `Ctrl+L`)即可复制行引用。
53
- 4. **保留** 接受该文件的改动;**回退** 恢复其最早基准。处理后该行离开列表。
58
+ 1. 照常和 agent 对话——成功的 `edit` / `write` / 编辑器(`str_replace_editor`)调用会自动记录。
59
+ 2. 点击侧边栏底部的 **待处理改动** 入口 ①,逐文件查看差异并 **保留 / 回退**。
60
+ 3. 列表为空时,点 **导入工作区改动**,把工作区的 Git / SVN / Perforce 本地改动拉入。
54
61
 
55
62
  ## 📝 注意事项
56
63
 
57
- - 只记录被跟踪的改动(`edit`、`write` 与编辑器 `str_replace_editor` 调用)。通过以上工具以外的删除(如 shell `rm`)只能对已跟踪的文件感知:条目显示"文件已不存在",回退即恢复。
64
+ - 只自动记录被跟踪的改动(`edit`、`write` 与编辑器 `str_replace_editor` 调用)。通过以上工具以外的删除(如 shell `rm`)只能对已跟踪的文件感知:条目显示"文件已不存在",回退即恢复。
65
+ - VCS 导入通过部署环境的 shell 执行器运行只读的 Git / SVN / Perforce 命令,需要对应 CLI 在 `PATH` 中。导入未跟踪文件(默认关闭)会扫描整个工作区,目录很大时可能较慢。
58
66
  - 回退新建文件会删除该文件(文件系统接缝没有删除 API)。
59
67
  - 没有 workspace 的会话条目仅存内存;损坏的落盘文件会被拒绝,删除即可重置。
60
68
 
Binary file
Binary file