dsh-git-ui 0.0.1 → 0.1.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 CHANGED
@@ -1,27 +1,54 @@
1
1
  # dsh-git-ui
2
2
 
3
- A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin that visualizes Git status in the Web UI: current branch, HEAD, dirty-state counts (staged / modified / untracked), ahead/behind, recent commits, and changed files — right in the session header, no terminal needed.
3
+ [![npm version](https://img.shields.io/npm/v/dsh-git-ui.svg)](https://www.npmjs.com/package/dsh-git-ui)
4
+ [![npm license](https://img.shields.io/npm/l/dsh-git-ui.svg)](https://www.npmjs.com/package/dsh-git-ui)
5
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-git-ui.svg)](https://www.npmjs.com/package/dsh-git-ui)
6
+
7
+ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin that visualizes Git status in the Web UI — the session-header pill shows the current branch (or detached HEAD) and dirty-state counts (staged / modified / untracked) with ahead/behind at a glance. Click for recent commits and changed files, or open the Git center for full management. No terminal needed.
4
8
 
5
9
  > Read this in [简体中文](README.zh.md).
6
10
 
11
+ - 📦 **npm**: <https://www.npmjs.com/package/dsh-git-ui>
12
+ - 🐙 **GitHub**: <https://github.com/Julyves/dsh-git-ui>
13
+ - 🐛 **Issues**: <https://github.com/Julyves/dsh-git-ui/issues>
14
+
7
15
  ## Features
8
16
 
9
- - **Branch pill** in the session header (right-aligned, per-session): shows the current branch at a glance, with dirty-state and ahead/behind indicators:
17
+ - **Branch pill** in the session header (right-aligned, per-session): a status dot (green when clean, orange when dirty) followed by the branch name and dirty / ahead-behind badges — click to open the detail popover:
18
+
19
+ <img src="docs/screenshots/01-pill面板内容展示.png" alt="Branch pill and the detail popover it opens" width="720">
10
20
 
11
21
  | State | Pill |
12
22
  |---|---|
13
- | Clean | `⎇ main` |
14
- | Dirty | `⎇ main · +2 −1 ?3` (staged / modified / untracked) |
15
- | Ahead / behind | `⎇ main ↑1 ↓2` |
16
- | Detached HEAD | `⎇ (detached) · a1b2c3d` |
17
- | Unborn (no commits) | `⎇ main · 无提交` |
23
+ | Clean | `● main` |
24
+ | Dirty | `● main · +2 −1 ?3` |
25
+ | Ahead / behind | `● main · ↑1 ↓2` |
26
+ | Detached HEAD | `● (detached HEAD) · a1b2c3d` |
27
+ | Unborn (no commits) | `● main · 无提交` |
18
28
  | Not a git repo | Dimmed `无 Git 仓库` |
19
29
  | Git unavailable / error | Dimmed `Git 不可用` (reason in tooltip) |
20
30
 
21
- - **Detail popover** (click the pill): repository root, count grid (staged / modified / untracked / ahead / behind), recent commits (hash · subject · author · relative time), changed-file list with status chips, manual refresh button, and last-checked time.
22
- - **Always-fresh data, zero interaction**: automatic fetch on session open, silent polling (host-configured interval, default 30s, no overlapping requests), **immediate refresh when an agent turn completes** (best-effort — the working tree most likely changed right then), resync after reconnect, and a manual refresh button.
31
+ `+N −N ?N` = staged / modified / untracked; `↑N ↓N` = ahead / behind. When both dirty and ahead/behind, the badges combine (e.g. `● main · +2 −1 ?3 · ↑1 ↓2`).
32
+
33
+ - **Detail popover** (click the pill): repository root, status counts (staged / modified / untracked) with dirty and ahead/behind badges, recent commits (hash · subject · author · relative time), a changed-file list with status chips and inline per-file actions (stage / unstage / discard), an inline branch switcher, a manual refresh button, and last-checked time:
34
+
35
+ <img src="docs/screenshots/02-面板选择切换分支.png" alt="Inline branch switching in the detail popover" width="720">
36
+
37
+ - **Git center** (management panel opened from the popover): two tabs — **Changes** and **History**.
38
+ - *Changes*: IDE-style grouped lists (staged / unstaged / untracked), per-file and bulk stage / unstage / discard (two-step confirm), a commit box (selected files or everything staged), and an inline side-by-side diff for the selected file with prev/next navigation.
39
+ - *History*: a paginated commit list with a rendered branch graph, per-commit details (subject · body · changed-file tree), and filters by branch / tag / author / date / text-or-hash, plus a fetch-remote button.
40
+
41
+ Every operation refreshes the status instantly:
42
+
43
+ <img src="docs/screenshots/03-Git中心统一阅览文件变更.png" alt="Git center — Changes tab (grouped file changes)" width="720">
44
+
45
+ <img src="docs/screenshots/04-Git中心查看分支历史.png" alt="Git center — History tab (commit list with branch graph)" width="720">
46
+
47
+ <img src="docs/screenshots/04-Git中心查看提交详情.png" alt="Git center — commit details and changed-file tree" width="720">
48
+
49
+ - **Always-fresh data, zero interaction**: automatic status snapshot on session open, silent polling (host-configured interval, default 30s, no overlapping requests), **immediate refresh when an agent turn completes** (best-effort — the working tree most likely changed right then), resync after reconnect, and a manual refresh button.
23
50
  - **Deterministic degradation**: non-git directories, missing cwd, missing git, timeouts, and oversized repositories show stable fallback states — never crashes, never spams.
24
- - **Pure read-only UI**: no new model tools, no session events, no impact on agent behavior.
51
+ - **Zero agent impact**: adds no model tools and writes no session events it never changes agent behavior. Git operations in the center (stage / commit / branch / fetch) are user-initiated from the UI, never agent-driven.
25
52
 
26
53
  ## Installation
27
54
 
@@ -58,7 +85,7 @@ dsh plugin --profile web remove dsh-git-ui
58
85
 
59
86
  1. Open a session whose working directory is inside a git repository.
60
87
  2. Read the branch pill in the header at any time — no action needed.
61
- 3. Click the pill to inspect repository root, counts, recent commits, and changed files; use `刷新` (refresh) for an immediate re-check.
88
+ 3. Click the pill to inspect repository root, counts, recent commits, and changed files; use `刷新` (refresh) for an immediate re-check, or open the Git center for full change management and history.
62
89
 
63
90
  Each session shows the Git status of **its own working directory**. Non-repository sessions show a dimmed placeholder instead of the pill.
64
91
 
@@ -83,10 +110,10 @@ All defaults work out of the box. Advanced users may override the plugin config
83
110
 
84
111
  ## Known Limitations
85
112
 
86
- - Shows the Git state of the session's working directory only (no remote URL / push-branch names yet).
113
+ - Shows the Git state of the session's working directory only. The History filter tree lists remote branches with ahead/behind and a manual fetch, but push / pull / merge are not exposed.
87
114
  - Polling-based refresh (default 30s); file-watcher event push is a planned extension.
88
- - Changed-file list is capped (`maxChanges`); when status output overflows the in-memory cap (default 4 MiB) it is recovered from a private spill file so counts stay exact — only if the spill cap (64 MiB) also overflows does the snapshot fall back to approximate (`truncated: true`).
89
- - Browser never sends paths — only a `sessionId`; the host resolves the authoritative cwd and runs read-only git commands.
115
+ - Changed-file list is capped (`maxChanges`); untracked-directory contents are enumerated individually. When status output overflows the in-memory cap (default 4 MiB) it is recovered from a private spill file so counts stay exact — only if the spill cap (64 MiB) also overflows does the snapshot fall back to approximate (`truncated: true`).
116
+ - Browser never sends paths — only a `sessionId`; the host resolves the authoritative cwd and runs git commands (write operations use `--` path separation and reject absolute / `..` escapes).
90
117
 
91
118
  ## Development
92
119
 
@@ -106,8 +133,6 @@ pnpm run build # host (esbuild ESM, never minified) + client (ModuleLoade
106
133
  dsh plugin --profile web add ./ # local install; restart dsh web to verify
107
134
  ```
108
135
 
109
- See [PLAN.md](PLAN.md) for the architecture research and engineering decisions.
110
-
111
136
  ## License
112
137
 
113
138
  [MIT](LICENSE)
package/README.zh.md CHANGED
@@ -1,27 +1,54 @@
1
1
  # dsh-git-ui
2
2
 
3
- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)Web UI 插件:在会话界面中可视化展示当前工程的 Git 状态——分支、HEAD、脏状态计数(已暂存/已修改/未跟踪)、领先/落后、最近提交与变更文件。无需切换终端,扫一眼即得。
3
+ [![npm version](https://img.shields.io/npm/v/dsh-git-ui.svg)](https://www.npmjs.com/package/dsh-git-ui)
4
+ [![npm license](https://img.shields.io/npm/l/dsh-git-ui.svg)](https://www.npmjs.com/package/dsh-git-ui)
5
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-git-ui.svg)](https://www.npmjs.com/package/dsh-git-ui)
6
+
7
+ [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)Web UI 插件:在会话界面中可视化展示 Git 状态——会话头部的 Pill 一眼呈现当前分支(或游离 HEAD)与脏状态计数(已暂存/已修改/未跟踪)及领先/落后。点击查看最近提交与变更文件,或打开 Git 中心进行完整管理。无需切换终端。
4
8
 
5
9
  > English version: [README.md](README.md)
6
10
 
11
+ - 📦 **npm**:<https://www.npmjs.com/package/dsh-git-ui>
12
+ - 🐙 **GitHub**:<https://github.com/Julyves/dsh-git-ui>
13
+ - 🐛 **Issues**:<https://github.com/Julyves/dsh-git-ui/issues>
14
+
7
15
  ## 功能特性
8
16
 
9
- - **会话头部分支 Pill**(右侧、每会话独立):常态只显示分支,脏状态与领先/落后以徽标呈现:
17
+ - **会话头部分支 Pill**(右侧、每会话独立):状态点(干净为绿、脏为橙)+ 分支名 + 脏/领先落后徽标——点击展开详情面板:
18
+
19
+ <img src="docs/screenshots/01-pill面板内容展示.png" alt="会话头部分支 Pill 与展开的详情面板" width="720">
10
20
 
11
21
  | 状态 | Pill 显示 |
12
22
  |---|---|
13
- | 干净 | `⎇ main` |
14
- | 脏状态 | `⎇ main · +2 −1 ?3`(已暂存/已修改/未跟踪) |
15
- | 领先/落后 | `⎇ main ↑1 ↓2` |
16
- | 游离 HEAD | `⎇ (detached) · a1b2c3d` |
17
- | unborn(无提交) | `⎇ main · 无提交` |
23
+ | 干净 | `● main` |
24
+ | 脏状态 | `● main · +2 −1 ?3` |
25
+ | 领先/落后 | `● main · ↑1 ↓2` |
26
+ | 游离 HEAD | `● (游离 HEAD) · a1b2c3d` |
27
+ | unborn(无提交) | `● main · 无提交` |
18
28
  | 非 git 仓库 | 弱化显示 `无 Git 仓库` |
19
29
  | git 不可用/出错 | 弱化显示 `Git 不可用`(tooltip 显示原因) |
20
30
 
21
- - **详情面板**(点击 pill 展开):仓库根目录、计数格(已暂存/已修改/未跟踪/领先/落后)、最近提交(哈希·主题·作者·相对时间)、变更文件列表(状态 chip)、手动刷新按钮、上次检查时间。
22
- - **数据自动保鲜,零操作**:进入会话自动拉取、静默轮询(间隔由主机下发,默认 30s,不重叠请求)、**agent 完成一个回合后立即刷新**(尽力而为——此时工作区最可能已变化)、断线重连 resync、面板内手动刷新。
31
+ `+N −N ?N` = 已暂存/已修改/未跟踪;`↑N ↓N` = 领先/落后。脏且领先落后时徽标合并(如 `● main · +2 −1 ?3 · ↑1 ↓2`)。
32
+
33
+ - **详情面板**(点击 pill 展开):仓库根目录、状态计数(已暂存/已修改/未跟踪)+ 脏与领先落后徽标、最近提交(哈希·主题·作者·相对时间)、变更文件列表(状态 chip + 行内暂存/取消/丢弃操作)、分支内联切换、手动刷新按钮、上次检查时间:
34
+
35
+ <img src="docs/screenshots/02-面板选择切换分支.png" alt="详情面板内的分支内联切换" width="720">
36
+
37
+ - **Git 中心**(从面板进入的管理面板):双标签——**变更**与**历史**。
38
+ - *变更*:IDE 式三段分组(已暂存/更改/未跟踪),单文件与全部暂存/取消暂存/丢弃(两步确认)、提交框(勾选文件或全部已暂存),以及选中文件的并排差异对照(前后导航)。
39
+ - *历史*:分页提交列表 + 分支图渲染,每条提交详情(主题·正文·变更文件树),按分支/标签/作者/日期/文本或哈希过滤,以及拉取远程按钮。
40
+
41
+ 每次操作即时刷新状态:
42
+
43
+ <img src="docs/screenshots/03-Git中心统一阅览文件变更.png" alt="Git 中心——变更标签(分组文件变更)" width="720">
44
+
45
+ <img src="docs/screenshots/04-Git中心查看分支历史.png" alt="Git 中心——历史标签(提交列表与分支图)" width="720">
46
+
47
+ <img src="docs/screenshots/04-Git中心查看提交详情.png" alt="Git 中心——提交详情与变更文件树" width="720">
48
+
49
+ - **数据自动保鲜,零操作**:进入会话自动加载状态快照、静默轮询(间隔由主机下发,默认 30s,不重叠请求)、**agent 完成一个回合后立即刷新**(尽力而为——此时工作区最可能已变化)、断线重连 resync、面板内手动刷新。
23
50
  - **确定性降级**:非 git 目录、无 cwd、git 缺失、超时、巨型仓库等边界显示稳定降级态——不崩溃、不刷屏。
24
- - **纯只读 UI**:不给模型新增工具、不写会话事件,不改变 agent 的任何行为。
51
+ - **零 agent 影响**:不给模型新增工具、不写会话事件,从不改变 agent 行为。Git 中心的写操作(暂存/提交/分支/拉取)均由用户从 UI 主动发起,绝非 agent 驱动。
25
52
 
26
53
  ## 安装
27
54
 
@@ -56,7 +83,7 @@ dsh plugin --profile web remove dsh-git-ui
56
83
 
57
84
  1. 打开一个工作目录位于 git 仓库内的会话。
58
85
  2. 随时扫一眼头部 Pill——无需任何操作。
59
- 3. 点击 Pill 查看仓库根目录、计数、最近提交与变更文件;点 `刷新` 立即重新检查。
86
+ 3. 点击 Pill 查看仓库根目录、计数、最近提交与变更文件;点 `刷新` 立即重新检查,或打开 Git 中心进行完整变更管理与历史浏览。
60
87
 
61
88
  每个会话显示**自己工作目录**的 Git 状态;非仓库会话显示弱化占位而非 Pill。
62
89
 
@@ -77,14 +104,14 @@ dsh plugin --profile web remove dsh-git-ui
77
104
 
78
105
  - Node.js `^22.19.0 || >=24.0.0`
79
106
  - dsh `>= 0.1.0-rc`(开发者预览版)
80
- - 主机可执行 `git`(插件通过子进程调用只读 git 命令)
107
+ - 主机可执行 `git`(插件通过子进程调用 git 命令)
81
108
 
82
109
  ## 已知限制
83
110
 
84
- - 仅展示会话工作目录的 Git 状态(远程 URL、push 分支名暂未支持)。
111
+ - 仅展示会话工作目录的 Git 状态。历史页的过滤树列出远程分支、领先/落后与手动拉取,但不暴露 push / pull / merge。
85
112
  - 轮询式刷新(默认 30s);基于文件监听的事件推送为规划中的扩展。
86
- - 变更文件列表有上限(`maxChanges`);status 输出超过内存上限(默认 4 MiB)时会从私有 spill 文件恢复完整输出,**计数保持精确**——仅当 spill 上限(64 MiB)也被突破时才回退为近似(`truncated: true`)。
87
- - 浏览器只传 `sessionId`,不传路径;主机解析权威 cwd 并仅执行只读 git 命令。
113
+ - 变更文件列表有上限(`maxChanges`);未跟踪目录内部文件逐个枚举。status 输出超过内存上限(默认 4 MiB)时会从私有 spill 文件恢复完整输出,**计数保持精确**——仅当 spill 上限(64 MiB)也被突破时才回退为近似(`truncated: true`)。
114
+ - 浏览器只传 `sessionId`,不传路径;主机解析权威 cwd 并执行 git 命令(写操作用 `--` 路径分隔、拒绝绝对路径与 `..` 逃逸)。
88
115
 
89
116
  ## 开发
90
117
 
@@ -103,8 +130,6 @@ pnpm run build # host(esbuild ESM,禁止压缩)+ client(ModuleLoa
103
130
  dsh plugin --profile web add ./ # 本地安装;重启 dsh web 验证
104
131
  ```
105
132
 
106
- 架构研究与工程决策见 [PLAN.md](PLAN.md)。
107
-
108
133
  ## 许可证
109
134
 
110
135
  [MIT](LICENSE)
package/cordis.patch.yml CHANGED
@@ -10,5 +10,5 @@
10
10
  config:
11
11
  timeoutMs: 5000
12
12
  maxStatusBytes: 4194304
13
- maxChanges: 100
13
+ maxChanges: 500
14
14
  defaultRefreshIntervalMs: 30000