dsh-easygit-plugin 0.2.1 → 0.2.3
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 +13 -6
- package/README.zh-CN.md +13 -6
- package/assets/preview.png +0 -0
- package/lib/client.js +970 -59
- package/lib/index.js +355 -23
- package/lib/types/client/index.d.ts +9 -1
- package/lib/types/client/view-model.d.ts +12 -1
- package/lib/types/host/actions.d.ts +6 -4
- package/lib/types/host/git-repository-service.d.ts +11 -2
- package/lib/types/host/plugin.d.ts +22 -2
- package/lib/types/host/proposal-service.d.ts +2 -1
- package/lib/types/shared/contracts.d.ts +93 -6
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-easygit-plugin)
|
|
10
10
|
[](https://github.com/IT-coder-Yy/dsh-git-plugin)
|
|
11
11
|
[](LICENSE)
|
|
12
|
+
[](https://linux.do)
|
|
12
13
|
|
|
13
14
|
English · [简体中文](README.zh-CN.md)
|
|
14
15
|
|
|
@@ -29,9 +30,11 @@ English · [简体中文](README.zh-CN.md)
|
|
|
29
30
|
1. **Visual repository state**: See the current branch, staged and unstaged files, and each file's formatted review view or raw diff.
|
|
30
31
|
2. **Commit history and details**: Browse the current branch as a commit graph, then click a commit to inspect its message, author, timestamps, parents, changed files, statistics, and full diff.
|
|
31
32
|
3. **One-click Git actions**: Stage or unstage one file or all files, create commits, and create, search, switch, or safely delete local branches directly from the workbench.
|
|
32
|
-
4. **
|
|
33
|
-
5. **
|
|
34
|
-
6. **
|
|
33
|
+
4. **Remote sync and Rebase**: Inspect upstream, ahead/behind counts, and working-tree state; fetch, fast-forward pull, push, set an upstream for a new branch, or safely start, continue, and abort a Rebase.
|
|
34
|
+
5. **References at a glance**: Inspect local branches, remote branches, and tags without leaving DeepSeek Harness Web.
|
|
35
|
+
6. **Natural-language workflows**: Turn a request into a clear, step-by-step Git command proposal, then execute it directly or copy it for manual execution.
|
|
36
|
+
7. **Actionable failure handling**: Keep the failed command, output, and post-failure repository diagnostics together; offer a safe recovery proposal for recognized failures or let the Agent analyze a complex failure.
|
|
37
|
+
8. **Safety by default**: Validate commands against a conservative allowlist, require confirmation for high-risk operations and history rewrites, prevent proposal replay, and redact common credentials from diagnostics.
|
|
35
38
|
|
|
36
39
|
## Quick start
|
|
37
40
|
|
|
@@ -58,7 +61,7 @@ dsh web
|
|
|
58
61
|
|
|
59
62
|
### 3. Open the Git workbench
|
|
60
63
|
|
|
61
|
-
Use the Git button beside the composer to inspect changes, review commit history, stage files, commit changes,
|
|
64
|
+
Use the Git button beside the composer to inspect changes, review commit history, stage files, commit changes, manage branches, or synchronize with a remote. Rebase and forceful branch deletion require an explicit risk confirmation.
|
|
62
65
|
|
|
63
66
|
For a more involved workflow, ask the Agent for a Git operation. For example:
|
|
64
67
|
|
|
@@ -105,17 +108,21 @@ The plugin registers two model tools:
|
|
|
105
108
|
| `git_repo_state` | Reads the current repository state without modifying it. |
|
|
106
109
|
| `git_propose` | Validates and registers one or more Git steps. |
|
|
107
110
|
|
|
108
|
-
The Web profile adds a Git action beside the composer and opens the workbench in the native details area. Its tabs provide visual access to working-tree changes and diffs, branches and references, commit history and details, stashes, and Agent-generated proposals. Commands are validated both when a proposal is created and immediately before execution.
|
|
111
|
+
The Web profile adds a Git action beside the composer and opens the workbench in the native details area. Its tabs provide visual access to working-tree changes and diffs, branches and references, commit history and details, stashes, remote synchronization, and Agent-generated proposals. Commands are validated both when a proposal is created and immediately before execution. When an action fails, the workbench preserves structured error context and repository diagnostics; recognized failures can create a new recovery proposal, while complex failures can be handed back to the Agent for analysis.
|
|
109
112
|
|
|
110
113
|
## Security
|
|
111
114
|
|
|
112
115
|
- Each step must contain exactly one allowed `git <subcommand> ...` command.
|
|
113
116
|
- Shell control operators, command substitution, redirection, executable hooks, and unsafe Git options are rejected.
|
|
114
|
-
- High-risk operations require explicit confirmation and proposals can only be executed once.
|
|
117
|
+
- High-risk operations, including history rewrites, require explicit confirmation and proposals can only be executed once.
|
|
115
118
|
- The plugin follows the Shell and sandbox policies provided by DeepSeek Harness; use it only with trusted repositories and trusted Git configuration.
|
|
116
119
|
|
|
117
120
|
Please report vulnerabilities privately by following [SECURITY.md](SECURITY.md).
|
|
118
121
|
|
|
122
|
+
## Compatibility
|
|
123
|
+
|
|
124
|
+
Last verified on **2026-08-20** with DeepSeek Harness `0.1.0-rc.8` and dsh-easygit-plugin `0.2.3`. Verification covered `npm run check` (68 tests), 24 reproducible build artifacts, a dry-run npm package, a temporary DSH Web-profile composition, and end-to-end Git operations against a temporary local copy of the FastAPI repository. The end-to-end coverage includes repository inspection, diffs, commits, branches, stashes, fetch/pull/push, successful and conflicted Rebases, recovery behavior, and proposal safety checks.
|
|
125
|
+
|
|
119
126
|
## Development
|
|
120
127
|
|
|
121
128
|
Requires Node.js `^22.19.0 || >=24.0.0`, Git, and a DeepSeek Harness developer preview release that supports static Cordis plugins.
|
package/README.zh-CN.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-easygit-plugin)
|
|
10
10
|
[](https://github.com/IT-coder-Yy/dsh-git-plugin)
|
|
11
11
|
[](LICENSE)
|
|
12
|
+
[](https://linux.do)
|
|
12
13
|
|
|
13
14
|
[English](README.md) · 简体中文
|
|
14
15
|
|
|
@@ -29,9 +30,11 @@
|
|
|
29
30
|
1. **可视化仓库状态**:查看当前分支、已暂存和未暂存文件,并查看每个文件的格式化审阅视图或原始 Diff。
|
|
30
31
|
2. **提交记录与详情**:通过提交图浏览当前分支历史;点击提交即可查看提交说明、作者、时间、父提交、变更文件、增删统计和完整 Diff。
|
|
31
32
|
3. **点击执行 Git 操作**:直接暂存或取消暂存单个/全部文件、创建提交,以及新建、搜索、切换或安全删除本地分支。
|
|
32
|
-
4.
|
|
33
|
-
5.
|
|
34
|
-
6.
|
|
33
|
+
4. **远程同步与 Rebase**:查看上游、领先/落后提交数和工作区状态;执行 fetch、仅快进 pull、push、为新分支设置上游,以及安全地开始、继续或中止 Rebase。
|
|
34
|
+
5. **集中查看引用**:无需离开 DeepSeek Harness Web,即可查看本地分支、远程分支和标签。
|
|
35
|
+
6. **自然语言工作流**:将自然语言请求转换成清晰、分步骤的 Git 命令提议,然后直接执行或复制到终端手动执行。
|
|
36
|
+
7. **可追溯的失败处理**:保留失败命令、输出和失败后的仓库诊断;已识别的失败可给出安全修正提议,复杂失败可交由 Agent 分析。
|
|
37
|
+
8. **默认安全**:使用保守的命令白名单;高风险操作和历史重写必须确认;并提供防重复执行和诊断信息脱敏机制。
|
|
35
38
|
|
|
36
39
|
## 快速开始
|
|
37
40
|
|
|
@@ -58,7 +61,7 @@ dsh web
|
|
|
58
61
|
|
|
59
62
|
### 3. 打开 Git 工作台
|
|
60
63
|
|
|
61
|
-
点击输入框旁的 Git
|
|
64
|
+
点击输入框旁的 Git 按钮,即可查看变更和提交记录,也可以点击暂存文件、创建提交、管理分支或同步远程仓库。Rebase 和强制删除分支必须显式确认风险。
|
|
62
65
|
|
|
63
66
|
遇到更复杂的工作流时,可以用自然语言告诉 Agent。例如:
|
|
64
67
|
|
|
@@ -105,17 +108,21 @@ dsh plugin --profile web remove dsh-easygit-plugin
|
|
|
105
108
|
| `git_repo_state` | 只读获取当前仓库状态。 |
|
|
106
109
|
| `git_propose` | 校验并登记一个或多个 Git 操作步骤。 |
|
|
107
110
|
|
|
108
|
-
Web profile 会在输入框旁添加 Git 操作入口,并在原生详情区域打开工作台。工作台通过多个标签页集中展示工作区变更与 Diff
|
|
111
|
+
Web profile 会在输入框旁添加 Git 操作入口,并在原生详情区域打开工作台。工作台通过多个标签页集中展示工作区变更与 Diff、分支与引用、提交记录与详情、贮藏、远程同步,以及 Agent 生成的操作提议。命令会在创建提议时和实际执行前分别进行校验。操作失败时,工作台会保留结构化错误上下文和仓库诊断;可识别的失败会生成新的修正提议,复杂失败则可交由 Agent 分析。
|
|
109
112
|
|
|
110
113
|
## 安全说明
|
|
111
114
|
|
|
112
115
|
- 每个步骤只能包含一条允许的 `git <子命令> ...` 命令。
|
|
113
116
|
- 禁止 shell 控制符、命令替换、重定向、可执行 hook 和不安全的 Git 选项。
|
|
114
|
-
-
|
|
117
|
+
- 高风险操作(包括历史重写)必须显式确认,每个提议只能执行一次。
|
|
115
118
|
- 插件遵循 DeepSeek Harness 提供的 Shell 和沙箱策略;请仅在可信仓库和可信 Git 配置中使用。
|
|
116
119
|
|
|
117
120
|
如需报告安全漏洞,请按照 [SECURITY.md](SECURITY.md) 中的方式私下联系。
|
|
118
121
|
|
|
122
|
+
## 兼容性
|
|
123
|
+
|
|
124
|
+
最后于 **2026-08-20** 使用 DeepSeek Harness `0.1.0-rc.8` 和 dsh-easygit-plugin `0.2.3` 完成验证。验证范围包括 `npm run check`(68 项测试)、24 个可重复构建产物、npm 发布包 dry-run、临时 DSH Web profile 组合,以及基于 FastAPI 仓库临时本地副本的端到端 Git 操作。端到端范围包括仓库读取、Diff、提交、分支、贮藏、fetch/pull/push、成功与冲突 Rebase、修正建议和提议安全校验。
|
|
125
|
+
|
|
119
126
|
## 开发
|
|
120
127
|
|
|
121
128
|
需要 Node.js `^22.19.0 || >=24.0.0`、Git,以及支持静态 Cordis 插件的 DeepSeek Harness 开发者预览版本。
|
package/assets/preview.png
CHANGED
|
Binary file
|