dsh-easygit-plugin 0.2.2 → 0.3.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 +66 -67
- package/README.zh-CN.md +66 -67
- package/assets/preview.png +0 -0
- package/lib/client.js +1892 -850
- package/lib/index.js +644 -44
- package/lib/types/client/commit-actions.d.ts +18 -0
- package/lib/types/client/conflict-model.d.ts +15 -0
- package/lib/types/client/conflict-tab.d.ts +14 -0
- package/lib/types/client/index.d.ts +30 -4
- package/lib/types/client/merge-tab.d.ts +16 -0
- package/lib/types/client/panel-controller.d.ts +9 -37
- package/lib/types/client/stash-tab.d.ts +15 -0
- package/lib/types/client/view-model.d.ts +1 -35
- package/lib/types/host/actions.d.ts +6 -3
- package/lib/types/host/conflict-worker.d.ts +1 -0
- package/lib/types/host/git-repository-service.d.ts +13 -2
- package/lib/types/host/stash-worker.d.ts +1 -0
- package/lib/types/shared/contracts.d.ts +197 -0
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# DSH Git Plugin
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**See your Git history and changes. Run everyday Git operations with a few clicks.**
|
|
6
|
+
|
|
7
|
+
A visual Git workbench inside DeepSeek Harness Web.
|
|
6
8
|
|
|
7
9
|

|
|
8
10
|

|
|
@@ -15,124 +17,121 @@ English · [简体中文](README.zh-CN.md)
|
|
|
15
17
|
|
|
16
18
|
</div>
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## Preview
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
<strong>👀 Inspect Git state → 🖱️ Run a quick action or ask the Agent → ✅ Review → 🚀 Execute</strong>
|
|
22
|
-
</p>
|
|
22
|
+

|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Git you can see and use
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
**Understand your repository at a glance.** Browse the commit graph, inspect commit details and file diffs, compare staged and unstaged changes, and see branches, tags, stashes, and remote sync status in one workbench.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**Click through everyday Git work.** Stage files, commit, switch branches, merge, stash, fetch, pull, and push from the interface. Preview changes before merging and resolve conflicts in the built-in three-pane editor.
|
|
29
|
+
|
|
30
|
+
| Area | What you can do |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| Changes | Review formatted or raw diffs; stage or unstage individual files or all files; create commits. |
|
|
33
|
+
| Commit history | Browse the graph, inspect messages, parents, changed files and diffs; amend, undo, or revert commits. |
|
|
34
|
+
| Branches | Search, create, switch, and delete local branches; inspect remote branches and tags. |
|
|
35
|
+
| Merge branches | Preview incoming commits and changes; choose normal, fast-forward-only, or squash merge. |
|
|
36
|
+
| Conflict resolution | Compare current, incoming, and result panes; accept either side, keep both, or edit manually; save, resolve, and continue. |
|
|
37
|
+
| Stashes | Stash all or selected files, optionally including untracked files; review, apply, pop, drop, or create a branch from a stash. |
|
|
38
|
+
| Sync | Inspect upstream and ahead/behind counts; fetch, fast-forward pull, push, set upstream, and manage Rebase. |
|
|
29
39
|
|
|
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.
|
|
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.
|
|
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.
|
|
40
|
+
For more involved workflows, you can also ask the Agent in natural language. Review its proposed Git commands in **建议 (Proposals)**, then execute or copy them. Failed actions retain command output and repository diagnostics for recovery or Agent analysis.
|
|
38
41
|
|
|
39
42
|
## Quick start
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
Requires Git, Node.js `^22.19.0 || >=24.0.0`, and DeepSeek Harness Web. Plugin `0.3.0` targets DSH `0.1.7-rc.1`; see [compatibility](#compatibility).
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm install -g @deepseek-ai/dsh@0.1.7-rc.1
|
|
48
|
+
dsh plugin --profile web add dsh-easygit-plugin@0.3.0
|
|
49
|
+
dsh web
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Open a session for your Git repository, then click the **Git** button beside the composer. The workbench opens in a native right-sidebar tab.
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
A typical workflow: **Changes → review the diff → stage files → enter a message → commit → Sync → push**. New branches can set their upstream when pushing.
|
|
55
|
+
|
|
56
|
+
If pnpm blocks installation because the package was recently published, add the package to the existing configuration in `~/.dsh/profiles/web/pnpm-workspace.yaml`:
|
|
44
57
|
|
|
45
58
|
```yaml
|
|
46
59
|
minimumReleaseAgeExclude:
|
|
47
60
|
- dsh-easygit-plugin
|
|
48
61
|
```
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
## Common workflows
|
|
51
64
|
|
|
52
|
-
|
|
53
|
-
dsh plugin --profile web add dsh-easygit-plugin
|
|
54
|
-
```
|
|
65
|
+
### Amend, undo, or revert a commit
|
|
55
66
|
|
|
56
|
-
|
|
67
|
+
Open **变更 → 提交撤销与修正 (Changes → Commit edits)** for the latest commit, or click a commit in **提交记录 (Commit history)**.
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
- **Edit the latest message** changes only the message, preserving staged and working-tree changes.
|
|
70
|
+
- **Amend the latest commit** adds all staged changes while keeping its message.
|
|
71
|
+
- **Undo the latest commit, keep changes** uses `reset --soft` to return to its first parent; the initial commit cannot be undone this way.
|
|
72
|
+
- **Revert a commit** creates a reverse commit and requires a clean worktree and index. For merge commits, select the mainline parent. Conflicts can be continued, aborted, or skipped from Conflict resolution.
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
These actions require confirmation. Amend and undo rewrite local history and can affect published commits; the plugin never force-pushes automatically. If the branch, HEAD, or index changes after loading, refresh before confirming again.
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
### Preview and merge branches
|
|
65
77
|
|
|
66
|
-
|
|
78
|
+
Open **合并分支 (Merge branches)**, select a local or fetched remote branch, and preview its incoming commits and file changes. Choose normal merge, fast-forward only, or squash. Squash stages the combined changes for you to finish as one commit.
|
|
67
79
|
|
|
68
|
-
|
|
69
|
-
Commit the documentation update to the current branch with the message "docs: update guide"
|
|
70
|
-
```
|
|
80
|
+
Merging requires a clean worktree. Remote sources use locally fetched references, so fetch first for current data. The preview compares the source with the common ancestor; it does not predict conflicts or show the final merge result. A changed branch tip requires a new preview. You can abort an unfinished merge, including squash, but cannot abort a completed merge.
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
### Resolve conflicts visually
|
|
73
83
|
|
|
74
|
-
|
|
84
|
+
In **冲突解决 (Conflict resolution)**, compare the current side, incoming side, and editable result with line numbers and commit references. Choose either side or both per block, or edit the result; then **save → mark resolved → continue**. Merge, Rebase, Cherry-pick, and Revert use this workflow. Abort and supported skip actions require confirmation.
|
|
75
85
|
|
|
76
|
-
|
|
77
|
-
git clone https://github.com/IT-coder-Yy/dsh-git-plugin.git
|
|
78
|
-
cd dsh-git-plugin
|
|
79
|
-
npm install
|
|
80
|
-
npm run build
|
|
81
|
-
dsh plugin --profile web add ${PWD}
|
|
82
|
-
```
|
|
86
|
+
During Rebase, the current side is the target branch plus replayed commits; the incoming side is the commit being replayed. Unresolved markers block resolution, and changed files invalidate an old snapshot. Binary conflicts support whole-side selection; text editing supports up to 48 KiB per version. Use external tools for larger files, symlinks, or submodules. Unsaved drafts last only for the current page and do not survive a reload.
|
|
83
87
|
|
|
84
|
-
|
|
88
|
+
### Save work with Stash
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
dsh plugin --profile web add github:IT-coder-Yy/dsh-git-plugin
|
|
88
|
-
```
|
|
90
|
+
In **贮藏 (Stashes)**, select all or individual files and optionally include untracked files. Selected-file stashes preserve unrelated changes. Review a stash before applying it; **apply** retains it, while **pop** removes it only after successful restoration. Conflicts retain the stash and link to Conflict resolution. Creating a branch from a stash requires a clean worktree and starts at the stash's original base.
|
|
89
91
|
|
|
90
|
-
## Update
|
|
92
|
+
## Update, remove, or install from source
|
|
91
93
|
|
|
92
94
|
```sh
|
|
95
|
+
# Update / remove
|
|
93
96
|
dsh plugin --profile web update dsh-easygit-plugin
|
|
97
|
+
dsh plugin --profile web remove dsh-easygit-plugin
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-
|
|
100
|
+
After updating, restart the Harness backend and refresh the browser to load both Host and Client changes.
|
|
97
101
|
|
|
98
102
|
```sh
|
|
99
|
-
|
|
103
|
+
# Install from source
|
|
104
|
+
git clone https://github.com/IT-coder-Yy/dsh-git-plugin.git
|
|
105
|
+
cd dsh-git-plugin
|
|
106
|
+
npm install
|
|
107
|
+
npm run build
|
|
108
|
+
dsh plugin --profile web add "${PWD}"
|
|
100
109
|
```
|
|
101
110
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
The plugin registers two model tools:
|
|
105
|
-
|
|
106
|
-
| Tool | Description |
|
|
107
|
-
| --- | --- |
|
|
108
|
-
| `git_repo_state` | Reads the current repository state without modifying it. |
|
|
109
|
-
| `git_propose` | Validates and registers one or more Git steps. |
|
|
111
|
+
You can also install directly from the repository with `dsh plugin --profile web add github:IT-coder-Yy/dsh-git-plugin`.
|
|
110
112
|
|
|
111
|
-
|
|
113
|
+
## Compatibility
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
Version `0.3.0` integrates with DSH `0.1.7-rc.1` using native sidebar tabs and session APIs. Shell execution uses `execute(spec).result()` and retains the `run(spec)` fallback for DSH `0.1.6-alpha.2`. DSH `0.1.0-rc.8` is no longer supported.
|
|
114
116
|
|
|
115
|
-
-
|
|
116
|
-
- Shell control operators, command substitution, redirection, executable hooks, and unsafe Git options are rejected.
|
|
117
|
-
- High-risk operations, including history rewrites, require explicit confirmation and proposals can only be executed once.
|
|
118
|
-
- The plugin follows the Shell and sandbox policies provided by DeepSeek Harness; use it only with trusted repositories and trusted Git configuration.
|
|
117
|
+
Check other installed plugins when upgrading DSH. If you use `dsh-client-auto-continue`, upgrade it to `0.11.8` or later: `0.11.6` depends on the removed `settingsScope` service and can block Web startup on DSH `0.1.7-rc.1`.
|
|
119
118
|
|
|
120
|
-
|
|
119
|
+
## Safety and Agent tools
|
|
121
120
|
|
|
122
|
-
|
|
121
|
+
High-risk actions require explicit confirmation. Agent proposals are validated against a Git command allowlist when created and before execution; shell control operators, substitutions, redirection, and unsafe options are rejected. Proposals cannot be replayed. Commands follow Harness Shell and session sandbox policies; use trusted repositories and Git configuration.
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
The Agent uses `git_repo_state` for read-only repository inspection and `git_propose` to register command proposals. Report vulnerabilities privately through [SECURITY.md](SECURITY.md).
|
|
125
124
|
|
|
126
125
|
## Development
|
|
127
126
|
|
|
128
|
-
Requires Node.js `^22.19.0 || >=24.0.0`, Git, and a DeepSeek Harness developer preview release that supports static Cordis plugins.
|
|
129
|
-
|
|
130
127
|
```sh
|
|
131
128
|
npm install
|
|
132
129
|
npm run check
|
|
133
130
|
npm pack --dry-run --ignore-scripts
|
|
134
131
|
```
|
|
135
132
|
|
|
133
|
+
`npm run check` runs type checks, tests, and build reproducibility checks. Git integration tests create temporary repositories for repository operations and recovery scenarios.
|
|
134
|
+
|
|
136
135
|
## License
|
|
137
136
|
|
|
138
137
|
[MIT](LICENSE)
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# DSH Git Plugin
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**看得清 Git 历史与变更,点几下就能完成日常 Git 操作。**
|
|
6
|
+
|
|
7
|
+
集成在 DeepSeek Harness Web 中的可视化 Git 工作台。
|
|
6
8
|
|
|
7
9
|

|
|
8
10
|

|
|
@@ -15,124 +17,121 @@
|
|
|
15
17
|
|
|
16
18
|
</div>
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## 效果预览
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
<strong>👀 查看 Git 状态 → 🖱️ 点击快捷操作或询问 Agent → ✅ 检查确认 → 🚀 执行</strong>
|
|
22
|
-
</p>
|
|
22
|
+

|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Git 可视化,操作更简单
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
**仓库情况,一眼看清。** 用提交图浏览历史,点击查看提交详情与文件 Diff,对比已暂存和未暂存改动,在同一工作台掌握分支、标签、贮藏与远程同步状态。
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**日常操作,点击完成。** 暂存、提交、切换分支、合并、贮藏、拉取和推送都可直接在界面操作。合并前先预览改动,遇到冲突用内置三方编辑器处理。
|
|
29
|
+
|
|
30
|
+
| 功能区 | 可以做什么 |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| 变更 | 查看格式化审阅或原始 Diff;暂存、取消暂存单个或全部文件;创建提交。 |
|
|
33
|
+
| 提交记录 | 浏览提交图、说明、父提交、变更文件及 Diff;修改、撤销或 Revert 提交。 |
|
|
34
|
+
| 分支 | 搜索、新建、切换和删除本地分支;查看远程分支与标签。 |
|
|
35
|
+
| 合并分支 | 预览待引入提交与文件改动;选择普通合并、仅快进或压缩合并。 |
|
|
36
|
+
| 冲突解决 | 对照当前方、传入方与结果;逐块选择一方、保留双方或手动编辑;保存、标记解决并继续。 |
|
|
37
|
+
| 贮藏 | 贮藏全部或指定文件,按需包含未跟踪文件;审阅、应用、弹出、删除或从贮藏创建分支。 |
|
|
38
|
+
| 同步 | 查看上游和领先/落后数量;获取更新、仅快进拉取、推送、设置上游,以及管理 Rebase。 |
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
2. **提交记录与详情**:通过提交图浏览当前分支历史;点击提交即可查看提交说明、作者、时间、父提交、变更文件、增删统计和完整 Diff。
|
|
32
|
-
3. **点击执行 Git 操作**:直接暂存或取消暂存单个/全部文件、创建提交,以及新建、搜索、切换或安全删除本地分支。
|
|
33
|
-
4. **远程同步与 Rebase**:查看上游、领先/落后提交数和工作区状态;执行 fetch、仅快进 pull、push、为新分支设置上游,以及安全地开始、继续或中止 Rebase。
|
|
34
|
-
5. **集中查看引用**:无需离开 DeepSeek Harness Web,即可查看本地分支、远程分支和标签。
|
|
35
|
-
6. **自然语言工作流**:将自然语言请求转换成清晰、分步骤的 Git 命令提议,然后直接执行或复制到终端手动执行。
|
|
36
|
-
7. **可追溯的失败处理**:保留失败命令、输出和失败后的仓库诊断;已识别的失败可给出安全修正提议,复杂失败可交由 Agent 分析。
|
|
37
|
-
8. **默认安全**:使用保守的命令白名单;高风险操作和历史重写必须确认;并提供防重复执行和诊断信息脱敏机制。
|
|
40
|
+
复杂流程也可以用自然语言交给 Agent,在 **建议** 页检查生成的 Git 命令后执行或复制。操作失败时保留命令输出和仓库诊断,方便修正或交由 Agent 分析。
|
|
38
41
|
|
|
39
42
|
## 快速开始
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
需要 Git、Node.js `^22.19.0 || >=24.0.0` 和 DeepSeek Harness Web。插件 `0.3.0` 面向 DSH `0.1.7-rc.1`,详见[兼容性](#兼容性)。
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm install -g @deepseek-ai/dsh@0.1.7-rc.1
|
|
48
|
+
dsh plugin --profile web add dsh-easygit-plugin@0.3.0
|
|
49
|
+
dsh web
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
打开 Git 仓库对应的会话,点击输入框旁的 **Git** 按钮,即可在原生右侧标签页中打开工作台。
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
日常提交只需:**变更 → 审阅 Diff → 暂存文件 → 填写说明 → 提交 → 同步 → 推送**。新分支可以在推送时设置上游。
|
|
55
|
+
|
|
56
|
+
如果 pnpm 因包刚发布而暂缓安装,可在 `~/.dsh/profiles/web/pnpm-workspace.yaml` 的现有配置中加入:
|
|
44
57
|
|
|
45
58
|
```yaml
|
|
46
59
|
minimumReleaseAgeExclude:
|
|
47
60
|
- dsh-easygit-plugin
|
|
48
61
|
```
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
## 常用工作流
|
|
51
64
|
|
|
52
|
-
|
|
53
|
-
dsh plugin --profile web add dsh-easygit-plugin
|
|
54
|
-
```
|
|
65
|
+
### 修改、撤销与 Revert 提交
|
|
55
66
|
|
|
56
|
-
|
|
67
|
+
在 **变更 → 提交撤销与修正** 中操作最近提交,或在 **提交记录** 中点击具体提交。
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
- **修改最近提交说明**:只修改说明,保留暂存区与工作区改动。
|
|
70
|
+
- **补充最近提交**:将全部已暂存改动加入最近提交,保留原说明。
|
|
71
|
+
- **撤销最近提交但保留修改**:通过 `reset --soft` 退回第一父提交;根提交不支持此操作。
|
|
72
|
+
- **Revert 此提交**:创建反向提交,要求工作区与暂存区干净。合并提交需选择主线父提交;发生冲突后可在“冲突解决”中继续、中止或跳过。
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
这些操作均需确认。修改与撤销最近提交会改写本地历史,可能影响已推送提交;插件不会自动强制推送。分支、HEAD 或暂存区在读取后变化时,需刷新后重新确认。
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
### 预览并合并分支
|
|
65
77
|
|
|
66
|
-
|
|
78
|
+
打开 **合并分支**,选择本地或已获取的远程分支,先预览待引入提交与文件改动,再选择普通合并、仅快进或压缩合并。压缩合并先生成暂存结果,再由你完成为一个提交。
|
|
67
79
|
|
|
68
|
-
|
|
69
|
-
将文档更新提交到当前分支,提交信息为 "docs: update guide"
|
|
70
|
-
```
|
|
80
|
+
合并要求工作区干净。远程源使用本地已获取的引用,需要最新数据时先获取更新。预览展示源分支相对共同祖先的改动,不预判冲突,也不等于最终合并结果;分支变化后需重新预览。尚未完成的普通或压缩合并可以中止,已完成的合并不能通过中止撤销。
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
### 可视化解决冲突
|
|
73
83
|
|
|
74
|
-
|
|
84
|
+
在 **冲突解决** 中对照当前方、传入方与可编辑结果,结合行号和提交引用逐块选择一方、保留双方或手动修改,然后 **保存 → 标记解决 → 继续**。Merge、Rebase、Cherry-pick 与 Revert 共用这一流程;中止与支持的跳过操作需确认。
|
|
75
85
|
|
|
76
|
-
|
|
77
|
-
git clone https://github.com/IT-coder-Yy/dsh-git-plugin.git
|
|
78
|
-
cd dsh-git-plugin
|
|
79
|
-
npm install
|
|
80
|
-
npm run build
|
|
81
|
-
dsh plugin --profile web add ${PWD}
|
|
82
|
-
```
|
|
86
|
+
Rebase 中,当前方是目标分支及已重放提交,传入方是正在重放的提交。未清除的冲突标记会阻止解决,文件变化会使旧快照失效。二进制冲突支持整方选择;文本编辑每个版本最多支持 48 KiB。更大文件、符号链接与子模块请使用外部工具处理。未保存草稿仅在当前页面保留,刷新后不会恢复。
|
|
83
87
|
|
|
84
|
-
|
|
88
|
+
### 用 Stash 暂存手头工作
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
dsh plugin --profile web add github:IT-coder-Yy/dsh-git-plugin
|
|
88
|
-
```
|
|
90
|
+
在 **贮藏** 页选择全部或指定文件,按需包含未跟踪文件;按文件贮藏会保留其他文件的改动。恢复前可以先审阅内容:**应用** 保留贮藏,**弹出** 仅在恢复成功后删除贮藏。发生冲突时保留贮藏并提供冲突解决入口。从贮藏创建分支要求工作区干净,新分支从贮藏原始提交开始。
|
|
89
91
|
|
|
90
|
-
##
|
|
92
|
+
## 更新、卸载与源码安装
|
|
91
93
|
|
|
92
94
|
```sh
|
|
95
|
+
# 更新 / 卸载
|
|
93
96
|
dsh plugin --profile web update dsh-easygit-plugin
|
|
97
|
+
dsh plugin --profile web remove dsh-easygit-plugin
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-
|
|
100
|
+
更新后重启 Harness 后端并刷新浏览器,确保 Host 和 Client 均加载新版本。
|
|
97
101
|
|
|
98
102
|
```sh
|
|
99
|
-
|
|
103
|
+
# 从源码安装
|
|
104
|
+
git clone https://github.com/IT-coder-Yy/dsh-git-plugin.git
|
|
105
|
+
cd dsh-git-plugin
|
|
106
|
+
npm install
|
|
107
|
+
npm run build
|
|
108
|
+
dsh plugin --profile web add "${PWD}"
|
|
100
109
|
```
|
|
101
110
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
插件注册两个模型工具:
|
|
105
|
-
|
|
106
|
-
| 工具 | 说明 |
|
|
107
|
-
| --- | --- |
|
|
108
|
-
| `git_repo_state` | 只读获取当前仓库状态。 |
|
|
109
|
-
| `git_propose` | 校验并登记一个或多个 Git 操作步骤。 |
|
|
111
|
+
也可直接从仓库安装:`dsh plugin --profile web add github:IT-coder-Yy/dsh-git-plugin`。
|
|
110
112
|
|
|
111
|
-
|
|
113
|
+
## 兼容性
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
`0.3.0` 使用 DSH `0.1.7-rc.1` 的原生右侧标签页与会话接口。Shell 执行已适配 `execute(spec).result()`,并保留 `run(spec)` 作为 DSH `0.1.6-alpha.2` 的兼容路径。不再支持 DSH `0.1.0-rc.8`。
|
|
114
116
|
|
|
115
|
-
-
|
|
116
|
-
- 禁止 shell 控制符、命令替换、重定向、可执行 hook 和不安全的 Git 选项。
|
|
117
|
-
- 高风险操作(包括历史重写)必须显式确认,每个提议只能执行一次。
|
|
118
|
-
- 插件遵循 DeepSeek Harness 提供的 Shell 和沙箱策略;请仅在可信仓库和可信 Git 配置中使用。
|
|
117
|
+
升级 DSH 时请检查其他已安装插件的兼容性。若使用 `dsh-client-auto-continue`,请升级至 `0.11.8` 或更新版本:`0.11.6` 依赖已移除的 `settingsScope` 服务,可能阻止 DSH `0.1.7-rc.1` 的 Web 页面启动。
|
|
119
118
|
|
|
120
|
-
|
|
119
|
+
## 安全与 Agent 工具
|
|
121
120
|
|
|
122
|
-
|
|
121
|
+
高风险操作必须显式确认。Agent 提议在创建和执行前均经过 Git 命令白名单校验,禁止 shell 控制符、命令替换、重定向与不安全选项,且不可重复执行。命令遵循 Harness Shell 与会话沙箱策略;请在可信仓库与 Git 配置中使用。
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
Agent 通过 `git_repo_state` 只读查看仓库,通过 `git_propose` 登记命令提议。如需报告安全漏洞,请按照 [SECURITY.md](SECURITY.md) 私下联系。
|
|
125
124
|
|
|
126
125
|
## 开发
|
|
127
126
|
|
|
128
|
-
需要 Node.js `^22.19.0 || >=24.0.0`、Git,以及支持静态 Cordis 插件的 DeepSeek Harness 开发者预览版本。
|
|
129
|
-
|
|
130
127
|
```sh
|
|
131
128
|
npm install
|
|
132
129
|
npm run check
|
|
133
130
|
npm pack --dry-run --ignore-scripts
|
|
134
131
|
```
|
|
135
132
|
|
|
133
|
+
`npm run check` 执行类型检查、测试与构建一致性检查。Git 集成测试会创建临时仓库,验证仓库操作与失败恢复场景。
|
|
134
|
+
|
|
136
135
|
## 许可证
|
|
137
136
|
|
|
138
137
|
[MIT](LICENSE)
|
package/assets/preview.png
CHANGED
|
Binary file
|