dsh-diff-approval 0.7.0 → 0.9.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 +18 -10
- package/README.zh.md +18 -10
- package/docs/images/pending-panel.png +0 -0
- package/docs/images/pending-panel.zh.png +0 -0
- package/lib/client.js +815 -212
- package/lib/index.js +714 -34
- package/lib/types/client/PendingPanel.d.ts +11 -1
- package/lib/types/client/SettingsTab.d.ts +11 -0
- package/lib/types/client/locales.d.ts +38 -0
- package/lib/types/client/port.d.ts +7 -1
- package/lib/types/client/settings.d.ts +19 -0
- package/lib/types/client/slots.d.ts +17 -1
- package/lib/types/client/store.d.ts +9 -1
- package/lib/types/pending.d.ts +12 -0
- package/lib/types/types.d.ts +17 -2
- package/lib/types/vcs.d.ts +89 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -5,16 +5,24 @@ English | [中文](README.zh.md)
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-diff-approval)
|
|
6
6
|
[](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
|
|
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
|

|
|
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
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
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
|
|
52
|
-
3.
|
|
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
|
[](https://www.npmjs.com/package/dsh-diff-approval)
|
|
6
6
|
[](https://github.com/9087/dsh-diff-approval/actions)
|
|
7
7
|
|
|
8
|
-
一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` / 编辑器(`str_replace_editor
|
|
8
|
+
一个 DeepSeek Harness(DSH)待处理改动审核插件:自动跟踪每次成功的 `edit` / `write` / 编辑器(`str_replace_editor`)改动,在侧边栏整合为一个待处理列表,可逐个文件查看完整差异并保留 / 回退,也可以把工作区里版本控制仓库的本地改动一键导入(Git / SVN / Perforce)。
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|
|
|
12
|
+
截图中的序号标记(① – ⑧)指向下方对应的描述。
|
|
13
|
+
|
|
12
14
|
## ✨ 功能
|
|
13
15
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
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.
|
|
53
|
-
4. **保留** 接受该文件的改动;**回退** 恢复其最早基准。处理后该行离开列表。
|
|
58
|
+
1. 照常和 agent 对话——成功的 `edit` / `write` / 编辑器(`str_replace_editor`)调用会自动记录。
|
|
59
|
+
2. 点击侧边栏底部的 **待处理改动** 入口 ①,逐文件查看差异并 **保留 / 回退**。
|
|
60
|
+
3. 列表为空时,点 **导入工作区改动**,把工作区的 Git / SVN / Perforce 本地改动拉入。
|
|
54
61
|
|
|
55
62
|
## 📝 注意事项
|
|
56
63
|
|
|
57
|
-
-
|
|
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
|