dsh-easygit-plugin 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 dsh-git-plugin contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,131 @@
1
+ <div align="center">
2
+
3
+ # DSH Git Plugin
4
+
5
+ **A visual Git workbench for inspecting repositories, running common actions, and safely executing AI-generated Git workflows in DeepSeek Harness Web.**
6
+
7
+ ![DeepSeek Harness](https://img.shields.io/badge/DeepSeek%20Harness-Developer%20Preview-4f46e5)
8
+ ![Web profile](https://img.shields.io/badge/profile-Web-0ea5e9)
9
+ [![npm version](https://img.shields.io/npm/v/dsh-easygit-plugin.svg)](https://www.npmjs.com/package/dsh-easygit-plugin)
10
+ [![GitHub repository](https://img.shields.io/badge/GitHub-Repository-181717?logo=github)](https://github.com/IT-coder-Yy/dsh-git-plugin)
11
+ [![MIT License](https://img.shields.io/badge/license-MIT-22c55e)](LICENSE)
12
+
13
+ English · [简体中文](README.zh-CN.md)
14
+
15
+ </div>
16
+
17
+ ## How to use
18
+
19
+ <p align="center">
20
+ <strong>👀 Inspect Git state &nbsp;→&nbsp; 🖱️ Run a quick action or ask the Agent &nbsp;→&nbsp; ✅ Review &nbsp;→&nbsp; 🚀 Execute</strong>
21
+ </p>
22
+
23
+ ## Preview
24
+
25
+ ![DSH Git Plugin visual workbench](./assets/preview.png)
26
+
27
+ ## Features
28
+
29
+ 1. **Visual repository state**: See the current branch, staged and unstaged files, and each file's formatted review view or raw diff.
30
+ 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
+ 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. **References at a glance**: Inspect local branches, remote branches, and tags without leaving DeepSeek Harness Web.
33
+ 5. **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.
34
+ 6. **Safety by default**: Validate commands against a conservative allowlist, require confirmation for high-risk operations, prevent proposal replay, and redact common credentials from diagnostics.
35
+
36
+ ## Quick start
37
+
38
+ ### 0. Allow immediate installation of the new package
39
+
40
+ Newer versions of `pnpm` may delay recently published packages. To install the latest release immediately, add `dsh-easygit-plugin` to `~/.dsh/profiles/web/pnpm-workspace.yaml`:
41
+
42
+ ```yaml
43
+ minimumReleaseAgeExclude:
44
+ - dsh-easygit-plugin
45
+ ```
46
+
47
+ ### 1. Install the plugin
48
+
49
+ ```sh
50
+ dsh plugin --profile web add dsh-easygit-plugin
51
+ ```
52
+
53
+ ### 2. Start DSH Web
54
+
55
+ ```sh
56
+ dsh web
57
+ ```
58
+
59
+ ### 3. Open the Git workbench
60
+
61
+ Use the Git button beside the composer to inspect changes, review commit history, stage files, commit changes, or manage branches with a click.
62
+
63
+ For a more involved workflow, ask the Agent for a Git operation. For example:
64
+
65
+ ```text
66
+ Commit the documentation update to the current branch with the message "docs: update guide"
67
+ ```
68
+
69
+ Review the generated steps in the Git workbench, then choose direct execution or manual execution.
70
+
71
+ ## Install from source
72
+
73
+ ```sh
74
+ git clone https://github.com/IT-coder-Yy/dsh-git-plugin.git
75
+ cd dsh-git-plugin
76
+ npm install
77
+ npm run build
78
+ dsh plugin --profile web add ${PWD}
79
+ ```
80
+
81
+ ## Install from GitHub repository
82
+
83
+ ```sh
84
+ dsh plugin --profile web add github:IT-coder-Yy/dsh-git-plugin
85
+ ```
86
+
87
+ ## Update the plugin
88
+
89
+ ```sh
90
+ dsh plugin --profile web update dsh-easygit-plugin
91
+ ```
92
+
93
+ ## Uninstall the plugin
94
+
95
+ ```sh
96
+ dsh plugin --profile web remove dsh-easygit-plugin
97
+ ```
98
+
99
+ ## How it works
100
+
101
+ The plugin registers two model tools:
102
+
103
+ | Tool | Description |
104
+ | --- | --- |
105
+ | `git_repo_state` | Reads the current repository state without modifying it. |
106
+ | `git_propose` | Validates and registers one or more Git steps. |
107
+
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.
109
+
110
+ ## Security
111
+
112
+ - Each step must contain exactly one allowed `git <subcommand> ...` command.
113
+ - 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.
115
+ - The plugin follows the Shell and sandbox policies provided by DeepSeek Harness; use it only with trusted repositories and trusted Git configuration.
116
+
117
+ Please report vulnerabilities privately by following [SECURITY.md](SECURITY.md).
118
+
119
+ ## Development
120
+
121
+ Requires Node.js `^22.19.0 || >=24.0.0`, Git, and a DeepSeek Harness developer preview release that supports static Cordis plugins.
122
+
123
+ ```sh
124
+ npm install
125
+ npm run check
126
+ npm pack --dry-run --ignore-scripts
127
+ ```
128
+
129
+ ## License
130
+
131
+ [MIT](LICENSE)
@@ -0,0 +1,131 @@
1
+ <div align="center">
2
+
3
+ # DSH Git Plugin
4
+
5
+ **面向 DeepSeek Harness Web 的可视化 Git 工作台:查看仓库、执行常用操作,并安全运行 AI 生成的 Git 工作流。**
6
+
7
+ ![DeepSeek Harness](https://img.shields.io/badge/DeepSeek%20Harness-Developer%20Preview-4f46e5)
8
+ ![Web profile](https://img.shields.io/badge/profile-Web-0ea5e9)
9
+ [![npm version](https://img.shields.io/npm/v/dsh-easygit-plugin.svg)](https://www.npmjs.com/package/dsh-easygit-plugin)
10
+ [![GitHub repository](https://img.shields.io/badge/GitHub-Repository-181717?logo=github)](https://github.com/IT-coder-Yy/dsh-git-plugin)
11
+ [![MIT License](https://img.shields.io/badge/license-MIT-22c55e)](LICENSE)
12
+
13
+ [English](README.md) · 简体中文
14
+
15
+ </div>
16
+
17
+ ## 怎么用
18
+
19
+ <p align="center">
20
+ <strong>👀 查看 Git 状态 &nbsp;→&nbsp; 🖱️ 点击快捷操作或询问 Agent &nbsp;→&nbsp; ✅ 检查确认 &nbsp;→&nbsp; 🚀 执行</strong>
21
+ </p>
22
+
23
+ ## 效果预览
24
+
25
+ ![DSH Git Plugin 可视化工作台](./assets/preview.png)
26
+
27
+ ## 功能
28
+
29
+ 1. **可视化仓库状态**:查看当前分支、已暂存和未暂存文件,并查看每个文件的格式化审阅视图或原始 Diff。
30
+ 2. **提交记录与详情**:通过提交图浏览当前分支历史;点击提交即可查看提交说明、作者、时间、父提交、变更文件、增删统计和完整 Diff。
31
+ 3. **点击执行 Git 操作**:直接暂存或取消暂存单个/全部文件、创建提交,以及新建、搜索、切换或安全删除本地分支。
32
+ 4. **集中查看引用**:无需离开 DeepSeek Harness Web,即可查看本地分支、远程分支和标签。
33
+ 5. **自然语言工作流**:将自然语言请求转换成清晰、分步骤的 Git 命令提议,然后直接执行或复制到终端手动执行。
34
+ 6. **默认安全**:使用保守的命令白名单、高风险操作确认、防重复执行和诊断信息脱敏机制。
35
+
36
+ ## 快速开始
37
+
38
+ ### 0. 允许立即安装新发布的包
39
+
40
+ 较新版本的 `pnpm` 可能延迟安装刚发布的包。若要立即安装最新版本,请在 `~/.dsh/profiles/web/pnpm-workspace.yaml` 中加入:
41
+
42
+ ```yaml
43
+ minimumReleaseAgeExclude:
44
+ - dsh-easygit-plugin
45
+ ```
46
+
47
+ ### 1. 安装插件
48
+
49
+ ```sh
50
+ dsh plugin --profile web add dsh-easygit-plugin
51
+ ```
52
+
53
+ ### 2. 启动 DSH Web
54
+
55
+ ```sh
56
+ dsh web
57
+ ```
58
+
59
+ ### 3. 打开 Git 工作台
60
+
61
+ 点击输入框旁的 Git 按钮,即可查看变更和提交记录,也可以点击暂存文件、创建提交或管理分支。
62
+
63
+ 遇到更复杂的工作流时,可以用自然语言告诉 Agent。例如:
64
+
65
+ ```text
66
+ 将文档更新提交到当前分支,提交信息为 "docs: update guide"
67
+ ```
68
+
69
+ 在 Git 工作台中检查生成的步骤,然后选择直接执行或手动执行。
70
+
71
+ ## 从源码安装
72
+
73
+ ```sh
74
+ git clone https://github.com/IT-coder-Yy/dsh-git-plugin.git
75
+ cd dsh-git-plugin
76
+ npm install
77
+ npm run build
78
+ dsh plugin --profile web add ${PWD}
79
+ ```
80
+
81
+ ## 从 GitHub 仓库安装
82
+
83
+ ```sh
84
+ dsh plugin --profile web add github:IT-coder-Yy/dsh-git-plugin
85
+ ```
86
+
87
+ ## 更新插件
88
+
89
+ ```sh
90
+ dsh plugin --profile web update dsh-easygit-plugin
91
+ ```
92
+
93
+ ## 卸载插件
94
+
95
+ ```sh
96
+ dsh plugin --profile web remove dsh-easygit-plugin
97
+ ```
98
+
99
+ ## 工作原理
100
+
101
+ 插件注册两个模型工具:
102
+
103
+ | 工具 | 说明 |
104
+ | --- | --- |
105
+ | `git_repo_state` | 只读获取当前仓库状态。 |
106
+ | `git_propose` | 校验并登记一个或多个 Git 操作步骤。 |
107
+
108
+ Web profile 会在输入框旁添加 Git 操作入口,并在原生详情区域打开工作台。工作台通过多个标签页集中展示工作区变更与 Diff、分支与引用、提交记录与详情、贮藏,以及 Agent 生成的操作提议。命令会在创建提议时和实际执行前分别进行校验。
109
+
110
+ ## 安全说明
111
+
112
+ - 每个步骤只能包含一条允许的 `git <子命令> ...` 命令。
113
+ - 禁止 shell 控制符、命令替换、重定向、可执行 hook 和不安全的 Git 选项。
114
+ - 高风险操作必须显式确认,每个提议只能执行一次。
115
+ - 插件遵循 DeepSeek Harness 提供的 Shell 和沙箱策略;请仅在可信仓库和可信 Git 配置中使用。
116
+
117
+ 如需报告安全漏洞,请按照 [SECURITY.md](SECURITY.md) 中的方式私下联系。
118
+
119
+ ## 开发
120
+
121
+ 需要 Node.js `^22.19.0 || >=24.0.0`、Git,以及支持静态 Cordis 插件的 DeepSeek Harness 开发者预览版本。
122
+
123
+ ```sh
124
+ npm install
125
+ npm run check
126
+ npm pack --dry-run --ignore-scripts
127
+ ```
128
+
129
+ ## 许可证
130
+
131
+ [MIT](LICENSE)
package/SECURITY.md ADDED
@@ -0,0 +1,23 @@
1
+ # 安全策略
2
+
3
+ ## 支持范围
4
+
5
+ 安全修复优先合入当前开发分支和最新发布版本。`0.x` 阶段接口可能变化,旧预览版本不保证单独回补。
6
+
7
+ ## 报告漏洞
8
+
9
+ 请使用 GitHub 仓库的 **Security → Report a vulnerability** 私下提交报告。不要在公开 Issue、Discussion 或 Pull Request 中披露可利用细节。
10
+
11
+ 报告中请尽量包含:
12
+
13
+ - 受影响版本和运行环境;
14
+ - 最小复现步骤或测试仓库;
15
+ - 实际影响和预期行为;
16
+ - 已知缓解措施;
17
+ - 是否允许在修复公告中致谢。
18
+
19
+ 维护者会先确认收到报告,再评估影响、修复和披露时间。请在修复发布前保密。
20
+
21
+ ## 安全边界
22
+
23
+ 本插件校验模型提交的命令、隔离会话提议并阻止重放,但执行仍依赖 Harness Shell、沙箱策略、操作系统权限、Git 配置和仓库内容。恶意仓库中的 hook、helper 或其他 Git 配置不属于本插件能够完全隔离的边界;请只在可信环境中运行。
Binary file
@@ -0,0 +1,14 @@
1
+ # dsh-easygit-plugin composition mount patch
2
+ #
3
+ # Temporary use: dsh web --patch ./git-guide.cordis.yml
4
+ # Persistent use: merge this patch into the profile's cordis.patch.yml, or into
5
+ # $DSH_HOME/cordis.patch.yml for all profiles. Install this package first with
6
+ # dsh plugin --profile <name> add dsh-easygit-plugin (or an equivalent command).
7
+ #
8
+ # package.json's dsh.bundle.patch only applies to packages listed in
9
+ # dsh.profile.bundles. A composition-row installation must use --patch or
10
+ # cordis.patch.yml. New top-level plugin rows must use insert; a direct
11
+ # `- id: git-guide / name: ...` entry only patches an existing id and is skipped.
12
+ - insert:
13
+ - id: git-guide
14
+ name: dsh-easygit-plugin