dsh-diff-approval 0.3.0 → 0.5.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
@@ -2,20 +2,35 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- A DeepSeek Harness (DSH) plugin for pending-change review: it automatically tracks every successful `edit` / `write` tool call, folds all unhandled changes into one entry per file, and shows each file's diff with Keep/Revert in the sidebar — no git involved.
5
+ [![npm version](https://img.shields.io/npm/v/dsh-diff-approval)](https://www.npmjs.com/package/dsh-diff-approval)
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
+
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.
9
+
10
+ ![Pending changes panel](docs/images/pending-panel.png)
6
11
 
7
12
  ## ✨ Features
8
13
 
9
- - **Diff view**: syntax-highlighted diff with +/− counts, change-block jump (previous/next diff), and drag-to-copy line references.
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 language — auto-detected from the file extension (shown as "Auto: …"), or overridden manually from the dropdown.
10
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).
11
- - **Persistence**: pending state is stored per workspace at `<dshHome>/diff-approval/workspaces/<workspaceId>.json` and survives restarts.
17
+ - **Open / Reveal**: open a file in its default app, or reveal it in the file manager, right from the diff header.
18
+ - **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.
12
19
 
13
20
  ## 📦 Install
14
21
 
22
+ If `dsh` is on your `PATH`:
23
+
15
24
  ```sh
16
25
  dsh plugin --profile web add dsh-diff-approval
17
26
  ```
18
27
 
28
+ Or, if you run the harness through npx (e.g. `npx @deepseek-ai/dsh web`):
29
+
30
+ ```sh
31
+ npx @deepseek-ai/dsh plugin --profile web add dsh-diff-approval
32
+ ```
33
+
19
34
  or manually: add the package to your profile's `package.json` dependencies and insert this row into the profile's `cordis.patch.yml`:
20
35
 
21
36
  ```yaml
@@ -34,12 +49,12 @@ Then restart `dsh web`.
34
49
 
35
50
  1. Work with the agent as usual — successful `edit` / `write` calls are recorded automatically.
36
51
  2. Click the **Pending changes** action at the sidebar footer (the badge shows the count).
37
- 3. Click a file row to expand its full diff; use **Previous diff** / **Next diff** to jump between change blocks.
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.
38
53
  4. **Keep** accepts the file's changes; **Revert** restores its earliest basis. The row then leaves the list.
39
54
 
40
55
  ## 📝 Notes
41
56
 
42
- - Only `edit` and `write` are tracked. 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.
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.
43
58
  - Reverting a created file deletes it (the fs seam has no delete API).
44
59
  - Sessions with no workspace keep their entries memory-only; corrupt persistence files are rejected and can be deleted to reset.
45
60
 
package/README.zh.md CHANGED
@@ -2,20 +2,35 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- 一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` 工具调用,把一个文件的全部未处理改动合并为一条待处理条目,在侧边栏展示每个文件的完整差异,支持保留 / 回退——全程不依赖 git。
5
+ [![npm 版本](https://img.shields.io/npm/v/dsh-diff-approval)](https://www.npmjs.com/package/dsh-diff-approval)
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
+
8
+ 一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` / 编辑器(`str_replace_editor`)改动,把一个文件的全部未处理改动合并为一条待处理条目,在侧边栏展示每个文件的完整差异,支持保留 / 回退——全程不依赖 git。
9
+
10
+ ![待处理改动面板](docs/images/pending-panel.zh.png)
6
11
 
7
12
  ## ✨ 功能
8
13
 
9
- - **差异视图**:语法高亮与 +/− 统计,按差异块跳转(上一处 / 下一处),拖选即可复制行引用。
14
+ - **差异视图**:语法高亮与 +/− 统计,按差异块跳转(上一处 / 下一处)。选中 diff 文本后,底部状态栏显示 `文件:起-止` 引用——点击(或按 `Ctrl+L`)即可复制。
15
+ - **高亮语言**:diff 底部状态栏可选高亮语言——默认按扩展名自动检测(显示为「自动:…」),也可手动从下拉切换。
10
16
  - **保留 / 回退**:每个文件一次决定。保留即接受;回退把文件写回最早基准(新建文件则删除,已被删除的跟踪文件则恢复)。
11
- - **持久化**:待处理状态按 workspace 落盘至 `<dshHome>/diff-approval/workspaces/<workspaceId>.json`,跨重启保留。
17
+ - **打开 / 定位**:从 diff 头部即可在默认应用中打开文件,或在文件管理器中定位它。
18
+ - **持久化**:待处理状态按 workspace 落盘至 `<dshHome>/diff-approval/workspaces/<workspaceId>.json`,跨重启保留——回来时未处理的改动仍在,即便换了新会话。
12
19
 
13
20
  ## 📦 安装
14
21
 
22
+ 若 `dsh` 已在 `PATH` 中:
23
+
15
24
  ```sh
16
25
  dsh plugin --profile web add dsh-diff-approval
17
26
  ```
18
27
 
28
+ 若通过 npx 启动 harness(如 `npx @deepseek-ai/dsh web`):
29
+
30
+ ```sh
31
+ npx @deepseek-ai/dsh plugin --profile web add dsh-diff-approval
32
+ ```
33
+
19
34
  或手动:把本包加入 profile 的 `package.json` 依赖,并在该 profile 的 `cordis.patch.yml` 中加入:
20
35
 
21
36
  ```yaml
@@ -34,12 +49,12 @@ dsh plugin --profile web add dsh-diff-approval
34
49
 
35
50
  1. 照常和 agent 对话——成功的 `edit` / `write` 调用会自动记录。
36
51
  2. 点击侧边栏底部的 **待处理改动** 入口(角标显示数量)。
37
- 3. 点击文件行展开该文件的完整差异,用 **上一处差异** / **下一处差异** 在差异块间跳转。
52
+ 3. 点击文件行展开该文件的完整差异,用 **上一处差异** / **下一处差异** 在差异块间跳转。选中文本后点击底部状态栏的引用(或按 `Ctrl+L`)即可复制行引用。
38
53
  4. **保留** 接受该文件的改动;**回退** 恢复其最早基准。处理后该行离开列表。
39
54
 
40
55
  ## 📝 注意事项
41
56
 
42
- - 只跟踪 `edit` `write`。通过这两个工具以外的删除(如 shell `rm`)只能对已跟踪的文件感知:条目显示"文件已不存在",回退即恢复。
57
+ - 只记录被跟踪的改动(`edit`、`write` 与编辑器 `str_replace_editor` 调用)。通过以上工具以外的删除(如 shell `rm`)只能对已跟踪的文件感知:条目显示"文件已不存在",回退即恢复。
43
58
  - 回退新建文件会删除该文件(文件系统接缝没有删除 API)。
44
59
  - 没有 workspace 的会话条目仅存内存;损坏的落盘文件会被拒绝,删除即可重置。
45
60
 
Binary file
Binary file