dsh-ide-git 0.4.1

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) 2026 KannaKuron
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,154 @@
1
+ # dsh-ide-git
2
+
3
+ 简体中文 | [English](README_EN.md)
4
+
5
+ > 给 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 的侧边栏装一个 **IDE 级的 Git 工具窗口**——左边分支树、中间提交图谱、右边变更与提交详情,操作方式对齐 JetBrains 系 IDE 的 Git 面板;以 [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) 原生 Tab 的形式注册,右侧栏与底部面板都能用。
6
+
7
+ DSH 自带的 Git 面板覆盖「暂存 / 提交 / 还原 / 看历史」;`dsh-ide-git` 补齐 IDE 用户习惯的那一层:**分支树 + 右键分支操作 + 提交图谱 + 提交详情 + 变更列表 + 提交框**。
8
+
9
+ ## 它解决什么
10
+
11
+ - **分支管理没有树**:内置面板只有一个分支下拉。这里给出 `HEAD(当前分支) / 本地 / 远程 / 标签` 的分组树,每个分支带 ahead/behind 角标、上游、worktree 占用标记(`W`)。
12
+ - **历史只是列表**:这里画出提交图谱(lane 拓扑 + 分支/标签 ref 徽章),支持加载更多与过滤(文本 / 哈希 / 作者)。
13
+ - **想看某个提交改了什么**:点提交直接进详情——作者、日期、完整提交信息、变更文件(含 +/− 行数),点文件看逐行 diff(红绿 + 行号 + hunk 高亮)。
14
+ - **想比较分支**:分支右键即可与当前分支比较,结果按文件与提交数汇报。
15
+ - **操作要够全**:签出、从任意分支/提交新建分支、重命名、删除、合并到当前、变基当前到此、新建标签、cherry-pick、还原提交、重置(保留/丢弃)、fetch / pull --ff-only / push(确认后)。
16
+
17
+ ## 效果
18
+
19
+ > 下面这些图取自一个**只装了两个插件**(`dsh-better-sidebar` + 本插件)的干净 DSH,绑定在一个虚构的演示仓库上(见 `scripts/demo-repo.mjs`),画面里没有真实工作区、没有壁纸插件、也没有其它面板。
20
+
21
+ <table>
22
+ <tr>
23
+ <td align="center" width="58%"><img src="docs/screenshots/1-bottom-workbench.png" alt="底部工作台:分支树 / 提交图谱 / 变更与提交"/></td>
24
+ <td valign="top"><b>底部工作台(宽扁 → 三栏)</b><br/>左列是 IDEA 式动作条:按<b>自身高度</b>决定放几个按钮,放不下的收进 <code>⋯</code>,末尾 <code>⚙</code> 可调顺序与显隐;中列是提交列表——列序与 IDEA 一致(<b>日期 → 提交人 → 图谱 → 分支标签 → 提交信息</b>),上方一排筛选(文本/哈希、分支或标签、提交人、日期、路径)与排序方向;右列是变更分组与提交框。</td>
25
+ </tr>
26
+ </table>
27
+
28
+ <table>
29
+ <tr>
30
+ <td align="center" width="58%"><img src="docs/screenshots/2-commit-menu.png" alt="提交右键菜单"/></td>
31
+ <td valign="top"><b>提交右键</b><br/>详情、复制修订号、签出该修订、在此新建分支、新建标签、优选(Cherry-Pick)、还原提交、重置到此(保留/丢弃更改)——破坏性项标红,菜单在面板内定位,底部工作台里同样能弹出来。</td>
32
+ </tr>
33
+ <tr>
34
+ <td align="center" width="58%"><img src="docs/screenshots/3-branch-undo.png" alt="删除分支后的撤回浮窗"/></td>
35
+ <td valign="top"><b>删除可撤回</b><br/>删除分支/贮藏是<b>真删除</b>,但宿主在动手前记下了对象 id:右下角浮窗点「撤回」即可恢复(一次性、30 分钟内有效);错过浮窗还有顶栏的「最近可撤回的操作」入口。删除 <code>main</code>/<code>master</code> 需要输入分支名确认。</td>
36
+ </tr>
37
+ </table>
38
+
39
+ <table>
40
+ <tr>
41
+ <td align="center" width="58%"><img src="docs/screenshots/4-rail-settings.png" alt="动作条设置:排序与显隐"/></td>
42
+ <td valign="top"><b>动作条可配置</b><br/>拖动或用箭头调整顺序、眼睛图标逐项显隐,配置只存「排列 + 隐藏」并做过归一化,以后新增动作不会打坏旧配置。</td>
43
+ </tr>
44
+ <tr>
45
+ <td align="center" width="58%"><img src="docs/screenshots/5-commit-detail.png" alt="提交详情与逐行 diff"/></td>
46
+ <td valign="top"><b>提交详情</b><br/>完整提交信息、作者与日期、变更文件列表(带 +/− 行数),点文件看逐行 diff(行号 + hunk 高亮 + 红绿底)。</td>
47
+ </tr>
48
+ </table>
49
+
50
+ <table>
51
+ <tr>
52
+ <td align="center" width="58%"><img src="docs/screenshots/6-right-sidebar.png" alt="原生右侧栏里的同一面板"/></td>
53
+ <td valign="top"><b>同一个注册,两种布局</b><br/>窄而高的<b>原生右侧栏</b>改用堆叠布局:动作条铺成顶部一行、变更在先、提交列表随后——面板只量自己的尺寸,从不猜自己在哪个容器里。截图顺序、演示仓库与干净环境都由 <code>scripts/screenshots.mjs</code> 复现。</td>
54
+ </tr>
55
+ </table>
56
+
57
+ ## 挂在哪里:两个宿主,一个面板
58
+
59
+ 本插件只注册一次,落到哪个面上由**宿主**决定,两条通道互斥:
60
+
61
+ | 宿主 | 条件 | 你得到什么 |
62
+ |---|---|---|
63
+ | **dsh-better-sidebar**(底座,可选) | 装了它 | 它的 Tab 系统:右侧栏里的原生 Tab **加上底部工作台**;它的设置页 `侧边卡片` 里能看到本插件的卡片 |
64
+ | **DSH 原生右侧栏** | 没装底座时自动接管 | 右侧栏 Guide 页里的 **Git** 胶囊 → 点开就是同一个面板 |
65
+
66
+ 底座在场时以它为准(它还带底部工作台);底座**晚到**会顶掉原生注册再挂到它那边。所以**只装本插件也能用**,没有任何前置要求。
67
+
68
+ 同一个面板会出现在形态完全不同的面上,所以布局靠量而不是猜:
69
+
70
+ | 面 | 形态 | 本插件的布局 |
71
+ |---|---|---|
72
+ | 右侧栏(原生的,或底座桥接过来的) | 窄而高 | `stack`:变更区在提交历史之上,分支树可收起,详情/差异占满主区 |
73
+ | 底部工作台(底座自有) | 宽而扁 | `columns`:分支树 · 提交图谱 · 变更与提交框,三栏并排——就是 JetBrains Git 工具窗口的样子 |
74
+
75
+ 插件不猜自己在哪儿,而是用 `ResizeObserver` 量自己的容器:宽 ≥ 600px 且宽 ≥ 高 × 1.15 走三栏,否则走纵向堆叠(宽度说了算,高度没有否决权)。自由浮窗、移动端抽屉同样自适应。
76
+
77
+ ## 功能一览
78
+
79
+ | 区域 | 能力 |
80
+ |---|---|
81
+ | 动作条 | IDEA 式左侧竖排(底部工作台)/ 顶栏下一行横排(右侧栏):刷新、新建分支、签出、删除、比较、显示差异、贮藏、新建标签、收藏、抓取、拉取、推送。**按可用空间自动决定放几个**,放不下的收进 `⋯ 更多`;末尾 `⚙ 设置` 可拖动排序、逐项显隐(存 `dsh-ide-git.rail.v1`)。每个按钮按当前状态点亮/置灰(没有其他分支就不能删除/签出/比较,没有远程就不能抓取/推送,没有上游就不能拉取,没有变更就没有差异可看) |
82
+ | 状态行 | 当前分支、上游、`↑ahead ↓behind`、stash 数量、忙碌指示 |
83
+ | 分支树 | `HEAD / 本地 / 远程 / 标签` 分组(可折叠)、过滤框、星标当前分支、ahead/behind 角标、worktree 占用标记;本地蓝 / 远程紫 / 标签黄 / HEAD 绿 |
84
+ | 分支右键 | 签出、将当前分支变基到此、合并到当前分支、与当前分支比较、从该分支新建分支、重命名、删除(当前分支禁用)、更新(Fetch)、推送 |
85
+ | 历史筛选 | 文本或哈希、分支或标签、提交人、日期(今天 / 近 7 天 / 近 30 天 / 今年),外加排序方向(新→旧 / 旧→新)与一键清除;路径筛选回车后由 git 服务端过滤(`git log -- <path>`) |
86
+ | 提交列表 | 列序对齐 IDEA:**日期 → 提交人 → 图谱 → 分支标签 → 提交信息**;lane 拓扑图整格连线(相邻行像素对齐)、HEAD 空心点、refs 徽章(HEAD 绿 / 本地蓝 / 远程紫 / 标签黄,最多 3 个 + `+n`)、加载更多(每页 120) |
87
+ | 提交右键 | 提交详情、复制修订号、签出该修订(确认)、在此新建分支、新建标签、cherry-pick、还原提交、重置到此(保留 / 丢弃更改) |
88
+ | 提交详情 | 完整提交信息、作者/日期、变更文件列表(+/−),点文件看逐行 diff |
89
+ | 变更列表 | 冲突 / 已暂存 / 更改 / 未跟踪 四组,行内 暂存 / 取消暂存 / 丢弃,分组级「全部暂存 / 全部取消暂存」,点击行看 diff |
90
+ | 提交框 | 多行提交信息、`Ctrl+Enter`(macOS `Cmd+Enter`)提交、修补上次提交(`--amend`) |
91
+ | 文件右键 | 显示差异、暂存/取消暂存、丢弃更改、复制路径 |
92
+ | 安全与撤回 | 删除分支 / 删除贮藏后右下角弹提示条,点「撤回」即可恢复(真删除 + 按删除前记下的对象 id 重建,一次性、30 分钟内有效),顶栏的撤回图标里也能找到最近删除;`main`/`master`/`trunk` 的删除要求输入分支名确认,所有破坏性确认框焦点默认在「取消」;同一仓库的写操作在宿主串行执行;仓库里还有未结束的 merge / rebase / cherry-pick / revert / bisect 时,相关动作全部置灰并说明原因 |
93
+
94
+ ## 安装
95
+
96
+ ```sh
97
+ # 本插件可以单独使用:面板直接出现在 DSH 原生右侧栏
98
+ dsh plugin --profile web add "github:KannaKuron/dsh-ide-git"
99
+ # 可选底座:装了它才会多出底部工作台,并跟随它的侧栏布局
100
+ dsh plugin --profile web add dsh-better-sidebar
101
+ # 重启 dsh web
102
+ ```
103
+
104
+ 装好后打开任意会话:
105
+
106
+ - **只装本插件**:点会话头右侧的「打开右侧边栏」→ Guide 页里的 **Git** 胶囊 → 面板打开;
107
+ - **装了底座**:会话头右侧的面板开合按钮 → 面板 Tab 条右侧 `+` → 选 **Git**(底部工作台);原生右侧栏的 `+` → **Git**(同一注册,同一份状态);
108
+ - 底座在场时,它的设置页 **侧边卡片** 分区里也会出现本插件的卡片(标题 / id / 启用开关),随时停用。
109
+
110
+ ### 兼容性
111
+
112
+ - `engines.dsh` 声明为 **`>=0.1.2-0`** ——0.1.2 起的全部版本都算,包括 `0.1.5-rc` / `0.1.6-alpha` 这类**预发布**(纯 semver 下预发布默认不匹配任何范围,所以起点写成了 `-0`)。
113
+ - 只依赖三样长期契约:宿主半的 `webServer.register({ kind: 'prefix' })` 路由、客户端半的 `window.__ModuleLoader__.load({ id, factory })`、以及客户端的 `slots` 服务。**不引用 `ui-primitives` 图标集**(图标全是自带 SVG),所以宿主删改图标不会波及本插件。
114
+ - 底座是**可选** peer:没装、装坏了、或它自己要等上游修,都不影响本插件挂到原生右侧栏。
115
+
116
+ ## 工作原理
117
+
118
+ ```
119
+ 宿主半 src/index.js 客户端半 src/client.js
120
+ POST /dsh-ide-git/api/<method> ctx.betterSidebar.registerTab({ id: 'dsh-ide-git:panel' })
121
+ └─ spawn('git', argv, { cwd }) └─ Panel:ResizeObserver → columns / stack
122
+ └─ 会话工作区 = cwd(客户端 scope.cwd 传入)
123
+ ```
124
+
125
+ - **宿主半**:一个前缀路由 `/dsh-ide-git/api`,方法表 32 个(`summary` / `branches` / `log` / `commitDetail` / `diff` / `compare` / `stage` / … / `push` / `tagDelete` / `version`)。所有 git 调用都是 **argv 数组 + `spawn`**(没有 shell 字符串、没有 `exec`),参数先过校验(绝对路径、ref 不以 `-` 开头、无控制字符、路径不越出仓库)。
126
+ - **客户端半**:无构建、单文件、`window.__ModuleLoader__.load({ id, factory })` 包装,只 `require('react')`(DSH 客户端基线模块白名单内)。
127
+ - **信任围栏**:路由挂在 DSH 自己的 web server 上,天然同源;只有 Host 为 loopback,或浏览器标记 `Sec-Fetch-Site: same-origin/same-site` 的请求才会被服务。
128
+ - **破坏性操作**:`push` / 硬重置 / 强制删分支 / 丢弃未跟踪文件 / 删除 stash 都必须显式 `confirm: true`,UI 侧一律弹二次确认。
129
+
130
+ ## 限制与路线图
131
+
132
+ - **v0.1.0 只覆盖主路径**:分支树 + 图谱 + 变更 + 提交 + 详情 + 常用分支/提交操作。下面的还在路上:
133
+ - 变更/提交的**多选与批量操作**、按文件部分提交(类似 IDEA 的 Changelist);
134
+ - 交互式变基(`rebase -i`)、fixup/squash、补丁(format-patch/apply);
135
+ - 三方合并冲突编辑器、冲突解决动作(接受本地/远端);
136
+ - blame / 文件历史视图、行级注释;
137
+ - 设置页的插件自有开关(提交后自动刷新、diff 上下文行数等);
138
+ - worktree 视图(当前只在分支行标注占用)。
139
+ - **只面向 `web` profile**:`dsh.client.platform` 为 `web`;桌面客户端的 renderer 复用同一套 shell 资产,但尚未真机验证。
140
+ - **不写 `.git`**:所有操作都通过 `git` 命令走正常索引/引用,插件不直接改 `.git` 内部文件。
141
+ - **大仓库**:提交列表分页(120/页),diff 输出上限 400KB(超出截断并标记)。
142
+
143
+ ## 开发
144
+
145
+ ```sh
146
+ npm test # 两层:smoke(文件级:清单一致性、客户端包装、白名单、确认守卫、方法表)
147
+ # + api(临时真实仓库直驱宿主路由:解析、暂存/提交/分支/标签/stash、全部守卫与信任围栏)
148
+ ```
149
+
150
+ 本机联调:把仓库加到 web profile 后重启 `dsh web`;客户端半改动由 DSH 热加载,宿主半改动需要重启。
151
+
152
+ ## 许可
153
+
154
+ MIT © KannaKuron
package/README_EN.md ADDED
@@ -0,0 +1,123 @@
1
+ # dsh-ide-git
2
+
3
+ [简体中文](README.md) | English
4
+
5
+ > An **IDE-grade Git tool window** for the [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) sidebar — branch tree on the left, commit graph in the middle, changes and commit details on the right, with JetBrains-style actions. Registered as a native [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) tab, usable in both the native right sidebar and the bottom workbench.
6
+
7
+ DSH's built-in Git panel covers stage / commit / revert / history. `dsh-ide-git` adds the layer IDE users expect: a **branch tree with a full context menu**, a **commit graph**, **commit details with per-file diffs**, a **grouped changes list** and a commit box.
8
+
9
+ ## Screenshots
10
+
11
+ > Captured from a **clean DSH with only two plugins installed** (`dsh-better-sidebar` + this one), bound to a fictional demo repository (`scripts/demo-repo.mjs`). No real workspace, no wallpaper plugin and no other panel is in frame; the whole sequence is reproducible with `scripts/screenshots.mjs`.
12
+
13
+ <table>
14
+ <tr>
15
+ <td align="center" width="58%"><img src="docs/screenshots/1-bottom-workbench.png" alt="Bottom workbench: branch tree / commit graph / changes"/></td>
16
+ <td valign="top"><b>Bottom workbench (wide → three panes)</b><br/>A JetBrains-style action rail whose button count follows the rail's <b>own height</b> (overflow folds into <code>⋯</code>, and <code>⚙</code> at the end reorders or hides actions), a commit list in IDEA column order (<b>date → author → graph → refs → subject</b>) with the filter row above it (text/hash, branch or tag, author, date, path), and the changes pane with the commit box.</td>
17
+ </tr>
18
+ </table>
19
+
20
+ <table>
21
+ <tr>
22
+ <td align="center" width="58%"><img src="docs/screenshots/2-commit-menu.png" alt="Commit context menu"/></td>
23
+ <td valign="top"><b>Commit context menu</b><br/>Details, copy revision, checkout, new branch here, new tag, cherry-pick, revert, reset here (keep / discard) — destructive rows in red, positioned inside the panel so it opens in the bottom workbench too.</td>
24
+ </tr>
25
+ <tr>
26
+ <td align="center" width="58%"><img src="docs/screenshots/3-branch-undo.png" alt="Undo toast after deleting a branch"/></td>
27
+ <td valign="top"><b>Deletes are reversible</b><br/>Deleting a branch or a stash is a <b>real delete</b>, but the host records the object id first: the toast in the corner offers <b>Undo</b> (one-shot, valid 30 minutes), and the toolbar keeps a “recently deleted” menu for when the toast is gone. Deleting <code>main</code>/<code>master</code> asks you to type the branch name.</td>
28
+ </tr>
29
+ </table>
30
+
31
+ <table>
32
+ <tr>
33
+ <td align="center" width="58%"><img src="docs/screenshots/4-rail-settings.png" alt="Action rail settings: order and visibility"/></td>
34
+ <td valign="top"><b>Configurable action rail</b><br/>Drag or use the arrows to reorder, the eye to hide an action. Only the permutation and the hidden set are stored (normalised), so a later version that adds an action never breaks an existing config.</td>
35
+ </tr>
36
+ <tr>
37
+ <td align="center" width="58%"><img src="docs/screenshots/5-commit-detail.png" alt="Commit details with a per-file diff"/></td>
38
+ <td valign="top"><b>Commit details</b><br/>Full message, author and date, changed files with +/− counts, and a line-level diff with gutters, hunk highlighting and red/green backgrounds.</td>
39
+ </tr>
40
+ </table>
41
+
42
+ <table>
43
+ <tr>
44
+ <td align="center" width="58%"><img src="docs/screenshots/6-right-sidebar.png" alt="The same panel in the native right sidebar"/></td>
45
+ <td valign="top"><b>One registration, two layouts</b><br/>In the narrow, tall <b>native right sidebar</b> the same panel stacks: rail as a single row on top, changes first, history below. The panel only measures itself — it never guesses which container it is in.</td>
46
+ </tr>
47
+ </table>
48
+
49
+ ## Where it mounts: two hosts, one panel
50
+
51
+ The plugin registers once; which surface it lands on is the **host's** decision, and the two doors are exclusive:
52
+
53
+ | Host | When | What you get |
54
+ |---|---|---|
55
+ | **dsh-better-sidebar** (optional) | whenever it is installed | its tab system: the tab in the right sidebar **plus the bottom workbench**; the plugin also shows up as a card in its settings page |
56
+ | **DSH's own right sidebar** | automatically, when better-sidebar is absent | a **Git** capsule on the sidebar's guide page — the very same panel |
57
+
58
+ better-sidebar wins while it is there (it also carries the bottom workbench); a late-arriving better-sidebar takes the native registration down and hosts the tab itself. Installing this plugin alone is fully supported — no prerequisite.
59
+
60
+ The same panel shows up on surfaces of very different shapes, so the layout measures instead of guessing:
61
+
62
+ | Surface | Shape | Layout here |
63
+ |---|---|---|
64
+ | Right sidebar (native, or bridged by better-sidebar) | narrow + tall | `stack`: changes above the graph, collapsible branch pane |
65
+ | Bottom workbench (better-sidebar only) | wide + flat | `columns`: tree / graph / changes — the JetBrains Git tool window shape |
66
+
67
+ The panel never guesses: it measures itself with a `ResizeObserver` (width ≥ 600px and width ≥ 1.15 × height → columns, otherwise stack — width decides, height has no veto), so free-floating windows and the mobile drawer adapt too.
68
+
69
+ ## Features
70
+
71
+ - Action rail: the JetBrains-style vertical strip in the bottom workbench (and one horizontal row under the header in the right sidebar) with refresh, new branch, checkout, delete, compare, show diff, stash, new tag, favorite, fetch, pull and push. **It shows as many buttons as fit**, folds the rest into a `⋯ more` menu, and pins a `⚙ settings` button that lets you reorder actions and toggle each of them (stored in `dsh-ide-git.rail.v1`). Every action lights up or greys out with the current state (no other branch → delete / checkout / compare off, no remote → fetch / push off, no upstream → pull off, no changes → diff off).
72
+ - Status line: branch, upstream, ahead/behind, stash count, busy indicator.
73
+ - Branch tree: HEAD / Local / Remote / Tags groups, filter box, ahead/behind badges, worktree marker; local blue / remote violet / tag amber / HEAD green.
74
+ - Branch context menu: checkout, rebase current onto this, merge into current, compare with current, new branch from here, rename, delete, fetch, push.
75
+ - History filters: text or hash, branch or tag, author, date (today / 7 days / 30 days / this year), an order toggle (newest / oldest first) and one-click clear; the path filter runs server-side (`git log -- <path>`) on Enter.
76
+ - Commit list: IDEA column order — **date → author → graph → refs → subject**; a lane graph whose segments span whole rows (pixel-aligned across rows), a hollow dot for HEAD, refs badges (HEAD green / local blue / remote violet / tag amber, at most three plus `+n`), load more (120 per page).
77
+ - Commit context menu: details, copy revision, checkout revision, new branch here, new tag, cherry-pick, revert, reset here (keep / discard changes).
78
+ - Commit details: full message, author/date, changed files with +/− and per-file line diff.
79
+ - Changes: conflicts / staged / changes / untracked groups, inline stage / unstage / discard, group-level actions, click for diff.
80
+ - Commit box: multi-line message, Ctrl+Enter (Cmd+Enter) to commit, amend.
81
+ - **Safety and undo**: deleting a branch or a stash pops a toast in the corner with an **Undo** action — the delete is real, and undo recreates the ref from the object id recorded just before it (one-shot, valid for 30 minutes). Deleting `main` / `master` / `trunk` requires typing the branch name, destructive dialogs focus Cancel instead of the red button, writes are serialised per repository on the host, and while a merge / rebase / cherry-pick / revert / bisect is still open the affected actions are greyed out with the reason.
82
+
83
+ ## Install
84
+
85
+ ```sh
86
+ # works on its own: the panel lands in DSH's native right sidebar
87
+ dsh plugin --profile web add "github:KannaKuron/dsh-ide-git"
88
+ # optional: adds the bottom workbench and better-sidebar's sidebar chrome
89
+ dsh plugin --profile web add dsh-better-sidebar
90
+ ```
91
+
92
+ Restart `dsh web`, then:
93
+
94
+ - **plugin alone** — open the right sidebar from the session header and pick the **Git** capsule on the guide page;
95
+ - **with better-sidebar** — pick **Git** from the bottom panel's `+` menu, or from the native right sidebar's `+` menu (one registration, one state);
96
+ - with better-sidebar present the plugin also appears as a card in its settings page (side cards), where it can be disabled.
97
+
98
+ ### Compatibility
99
+
100
+ - `engines.dsh` is **`>=0.1.2-0`**: every DSH from 0.1.2 up, prereleases such as `0.1.5-rc` / `0.1.6-alpha` included (plain semver never matches a prerelease against a range, hence the `-0` floor).
101
+ - Three long-lived contracts, nothing else: the host's `webServer.register({ kind: 'prefix' })` route, the client's `window.__ModuleLoader__.load({ id, factory })`, and the client `slots` service. It does **not** import the `ui-primitives` icon set (every icon is an inline SVG), so host icon changes cannot reach it.
102
+ - better-sidebar is an **optional** peer: absent, broken, or waiting on its own upstream fix, the plugin still mounts in the native right sidebar.
103
+
104
+ ## How it works
105
+
106
+ - **Host half** (`src/index.js`): one prefix route `/dsh-ide-git/api` with a 32-method table. Every git call is an argv array through `spawn` — no shell string, no `exec` — with argument validation (absolute paths, refs never start with `-`, paths stay inside the repository).
107
+ - **Client half** (`src/client.js`): no build step, single file, `window.__ModuleLoader__.load({ id, factory })`, requiring only `react` (a DSH client baseline module).
108
+ - **Trust fence**: only loopback Hosts, or same-origin browser requests (`Sec-Fetch-Site`), are served.
109
+ - **Destructive actions** (push, hard reset, force delete, discarding untracked files, dropping a stash) require an explicit `confirm: true` and always ask in the UI first.
110
+
111
+ ## Tests
112
+
113
+ ```sh
114
+ npm test # smoke (file-level invariants) + api (a real throwaway repo driven through the host route)
115
+ ```
116
+
117
+ ## Limits / roadmap
118
+
119
+ v0.1.0 covers the main path. Still missing: multi-select and partial commits (changelists), interactive rebase / fixup / squash, patches, a merge-conflict editor, blame and file history, plugin-owned settings rows, a worktree view, and desktop-client verification. Large repositories: paginated log and a 400KB diff cap.
120
+
121
+ ## License
122
+
123
+ MIT © KannaKuron
@@ -0,0 +1,22 @@
1
+ # dsh-ide-git bundle patch.
2
+ #
3
+ # Installed through the official CLI —
4
+ #
5
+ # dsh plugin --profile <name> add dsh-ide-git
6
+ #
7
+ # — the command reconciles dsh.profile.bundles against installed packages and,
8
+ # seeing this declaration, merges THIS patch exactly like the manual mount line
9
+ # below. No profile file edits needed.
10
+ #
11
+ # Manual mount equivalent (profile cordis.patch.yml):
12
+ #
13
+ # - insert:
14
+ # - id: ide-git
15
+ # name: 'dsh-ide-git'
16
+ #
17
+ # Only the Node half loads through this row (the /dsh-ide-git/api git routes).
18
+ # The web client half is served through exports["./client"] and mounted by the
19
+ # browser boot graph; there it registers one dsh-better-sidebar tab.
20
+ - insert:
21
+ - id: ide-git
22
+ name: 'dsh-ide-git'
File without changes
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "dsh-external/dsh-ide-git",
3
+ "version": "0.4.1",
4
+ "main": "./src/index.js",
5
+ "description": "IDE 级 Git 操作面板:分支树 + 提交图谱 + 变更/暂存/提交 + 提交详情。装了 dsh-better-sidebar 时挂成它的原生 tab(右侧栏 + 底部工作台);没装时直接挂 DSH 原生右侧栏,单独安装即可用。JetBrains 风格 Git 工具窗口 for DeepSeek Harness.",
6
+ "engines": {
7
+ "dsh": ">=0.1.2-0"
8
+ },
9
+ "contributes": {
10
+ "tools": [],
11
+ "skills": []
12
+ }
13
+ }
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "dsh-ide-git",
3
+ "version": "0.4.1",
4
+ "description": "DSH plugin: an IDE-grade Git tool window as a native dsh-better-sidebar tab — branch tree, commit graph, changes, commit details, JetBrains-style actions, in the right sidebar and the bottom panel. | DSH 插件:IDE 级 Git 工具窗口,以 dsh-better-sidebar 原生 Tab 挂载——分支树 / 提交图谱 / 变更与提交详情 / JetBrains 风格操作,右侧栏与底部面板双布局自适应。",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/KannaKuron/dsh-ide-git.git"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "main": "src/index.js",
14
+ "exports": {
15
+ ".": "./src/index.js",
16
+ "./client": "./src/client.js"
17
+ },
18
+ "engines": {
19
+ "node": ">=18",
20
+ "dsh": ">=0.1.2-0"
21
+ },
22
+ "dsh": {
23
+ "bundle": {
24
+ "patch": "./cordis.patch.yml"
25
+ },
26
+ "client": {
27
+ "inject": [
28
+ "@deepseek-ai/dsh-client-runtime",
29
+ "@deepseek-ai/dsh-client-locale",
30
+ "@deepseek-ai/dsh-client-ui-slots",
31
+ "@deepseek-ai/dsh-client-modules"
32
+ ],
33
+ "platform": "web"
34
+ }
35
+ },
36
+ "files": [
37
+ "src/index.js",
38
+ "src/client.js",
39
+ "cordis.patch.yml",
40
+ "dsh.plugin.json",
41
+ "README.md",
42
+ "README_EN.md",
43
+ "docs/screenshots",
44
+ "LICENSE"
45
+ ],
46
+ "scripts": {
47
+ "test": "node --test tests/smoke.mjs tests/api.test.mjs tests/graph.test.mjs",
48
+ "version": "node -e \"const fs=require('fs');const m=JSON.parse(fs.readFileSync('dsh.plugin.json','utf8'));const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;m.version=v;fs.writeFileSync('dsh.plugin.json',JSON.stringify(m,null,2)+'\\n')\" && git add dsh.plugin.json"
49
+ },
50
+ "keywords": [
51
+ "dsh",
52
+ "deepseek-harness",
53
+ "dsh-plugin",
54
+ "dsh-better-sidebar",
55
+ "git",
56
+ "git-gui",
57
+ "source-control",
58
+ "sidebar",
59
+ "commit-graph"
60
+ ],
61
+ "license": "MIT",
62
+ "peerDependencies": {
63
+ "@deepseek-ai/cordis": "^4.0.1",
64
+ "dsh-better-sidebar": ">=0.12.0"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "dsh-better-sidebar": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "homepage": "https://github.com/KannaKuron/dsh-ide-git",
72
+ "bugs": {
73
+ "url": "https://github.com/KannaKuron/dsh-ide-git/issues"
74
+ }
75
+ }