@xia-sc/dsh-git 0.5.3 → 0.6.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/README.en.md CHANGED
@@ -15,13 +15,16 @@ new-branch-from-base.
15
15
  ## UI
16
16
 
17
17
  - **Floating block** (`shell.overlay`): collapsed = renders nothing (no
18
- floating element that could cover the input); expanded = the full Git
19
- workbench (status line, branch switcher with **dirty-tree pre-check** —
20
- selecting a branch while uncommitted changes exist shows a warning listing
21
- the affected files instead of switching, with a "switch anyway" escape
22
- hatch, fetch/pull actions, a **commit area** stage-all button, draft-basis
23
- picker, "✨ AI draft" button, message input and commit button collapsible
24
- changes and recent-commit lists). **Operation feedback is pinned to the very
18
+ floating element that could cover the input); expanded = one workflow read
19
+ top-down: status line (pending count, ahead/behind, upstream) the branch
20
+ switcher with its **dirty-tree pre-check** (selecting a branch while
21
+ uncommitted changes exist warns with the affected files instead of switching,
22
+ plus a "switch anyway" escape hatch) a **network toolbar** (Fetch / Pull /
23
+ Push, three equal columns, Push being the primary button) a **commit card**
24
+ (Stage all + draft basis + "✨ AI draft" in equal columns, the message input
25
+ below it and the commit button) → two list cards. Every button group is split
26
+ evenly instead of sizing itself to its label.
27
+ **Operation feedback is pinned to the very
25
28
  top of the panel and stays one line tall** — the busy label and the last
26
29
  operation's result are the first rows of the body. The result is a localized
27
30
  phrase ("Pushed", "Staged everything", "Switched to x"); git's own output (a
@@ -36,6 +39,18 @@ new-branch-from-base.
36
39
  new branch name + base-branch picker (local branches or full remote refs
37
40
  like `origin/feature/x`) — confirming creates the branch from the base and
38
41
  switches to it.
42
+ - **Changes and recent commits are two cards**: a change row is "monospace path
43
+ + status chip" (path first, so the paths line up in a column; modified=amber,
44
+ added/untracked=green, deleted/conflict=red, renamed=blue; the file the diff
45
+ pane is showing is highlighted), a commit row is "short sha + subject". Each
46
+ card's header (`▾ Changes 12`) collapses the whole section and starts
47
+ **expanded** — a Git panel must not hide the user's own changes; a list past
48
+ 8 / 5 rows offers "Show all N" at the bottom, which is a separate state, so the
49
+ chevron always points the right way.
50
+ - **Refreshing never flashes**: clicking ↻ or any post-action re-read keeps the
51
+ panel's content (a same-workspace re-read does not fall back to a "loading"
52
+ line and snap back); the header's refresh button greys out and reads
53
+ "Refreshing…".
39
54
  - **Click a change to see its diff**: clicking any row of the change list grows
40
55
  the panel from its 400px single column into two panes — the full workbench on
41
56
  the left, that file's unified diff on the right (see *The diff viewer* below).
@@ -62,6 +77,10 @@ the first selection expands the list to its full length.
62
77
  panel (the workbench keeps its width) and the diff takes the rest, 1:1 with the
63
78
  pointer because the panel anchors its left edge on grab. Double-clicking the
64
79
  edge resets the width, and the panel always stays inside the viewport.
80
+ - **A stable box while the diff is open**: selecting a file pins the panel's height
81
+ (both columns run to the bottom), so the diff arriving, switching files and
82
+ collapsing again only scroll inside the panes — the panel never resizes under
83
+ the pointer.
65
84
  - **Staged / unstaged**: by default the pane follows the data — unstaged when
66
85
  that side has anything, staged otherwise — with two chips to switch by hand
67
86
  (an empty side is dimmed). When a file has changes on both sides, one click
@@ -103,8 +122,13 @@ The commit area follows the real order of operations: **stage all → draft →
103
122
 
104
123
  The model route comes from the current session's `modelSelection` projection
105
124
  (pending pick first, then last used), falling back to the host's first
106
- registered route. Failures are reported in the last-operation output with a
107
- localized sentence (no changes / no model configured / draft failed, …).
125
+ registered route. The request carries the **current session id** (`sessionId`):
126
+ some gateways (the opencode-style routes on this machine, for one) require a
127
+ session-affinity header, and the host forwards a session id to its adapter only
128
+ when the request has one — without it the gateway answers `MissingSessionID`.
129
+ Failures are reported in the last-operation output with a localized sentence
130
+ (no changes / no model configured / draft failed, …); an unrecognized failure
131
+ code leads with the localized sentence and appends the host's own diagnosis.
108
132
 
109
133
  ## Architecture
110
134
 
@@ -213,7 +237,7 @@ shell metacharacters, and leading dashes are all recorded verbatim.
213
237
  | `commit` | `{ cwd, message }` | `{ message }`; `missing-author` error when `user.name/email` unset |
214
238
  | `push` | `{ cwd }` | `{ message }` (120s timeout) |
215
239
  | `log` | `{ cwd, count? }` | `{ repo, commits: [{sha, author, subject, refs}] }` (clamped 1..50) |
216
- | `generateMessage` | `{ cwd, mode?, provider?, model? }` | `{ message, mode, provider, model }`. `mode` is `staged` (default) / `unstaged` / `all`; anything else is `invalid-mode`. Failure code in `error.details.code`: `no-changes`, `no-provider`, `no-model`, `llm-truncated` (the output cap ran out before any text was written), `llm-empty`, `cancelled`, `llm-failed`. |
240
+ | `generateMessage` | `{ cwd, mode?, provider?, model?, sessionId? }` | `{ message, mode, provider, model }`. `mode` is `staged` (default) / `unstaged` / `all`; anything else is `invalid-mode`. `sessionId` is an optional non-empty string (over 200 chars is `invalid-session`); the panel sends the current session id so session-affine gateways can route the call. Failure code in `error.details.code`: `no-changes`, `no-provider`, `no-model`, `llm-truncated` (the output cap ran out before any text was written), `llm-empty`, `cancelled`, `llm-failed`. |
217
241
 
218
242
  > A failed result carries `error.code === "internal"` on the wire (the Connection
219
243
  > envelope only requires a string), with the plugin's own diagnostic in
package/README.md CHANGED
@@ -13,12 +13,13 @@ DeepSeek Harness Web GUI 的完整 Git 管理插件,形态为一个**可折叠
13
13
  ## 界面
14
14
 
15
15
  - **悬浮面板**(`shell.overlay`):折叠时不渲染任何元素(不会遮挡输入框);
16
- 展开后是完整的 Git 工作台(状态行、带 **脏树预检** 的分支切换器——在有
17
- 未提交修改时选择分支,会先显示受影响文件列表警告而不是直接切换,并提供
18
- "仍要切换"按钮;fetch/pull 操作;**提交区**——"暂存全部"按钮、AI 生成依据
19
- 选择器、" AI 生成"按钮、提交信息输入框(多行文本框,回车换行、
20
- Ctrl/Cmd+Enter 提交)与提交按钮;可折叠的变更列表与
21
- 最近提交列表)。**操作反馈固定钉在面板最上边,而且只有一行**——"推送中…"和上次操作的结果都在
16
+ 展开后自上而下是一条工作流:状态行(未提交计数、领先/落后、上游)→
17
+ 带 **脏树预检** 的分支切换器(有未提交修改时选择分支,会先显示受影响文件列表
18
+ 警告而不是直接切换,并提供"仍要切换"按钮)→ **网络工具条**(拉取更新 / 拉取合并 /
19
+ 推送,三等宽,"推送"是主按钮)→ **提交卡片**("暂存全部" + AI 生成依据 +
20
+ "✨ AI 生成"三等宽,下面是提交信息输入框(多行文本框,回车换行、Ctrl/Cmd+Enter
21
+ 提交)与提交按钮)→ 两张列表卡片。按钮一律**等宽分栏**,不再是一排宽窄不一的按钮。
22
+ **操作反馈固定钉在面板最上边,而且只有一行**——"推送中…"和上次操作的结果都在
22
23
  body 的第一行;结果是一个中文短句("已推送"/"已暂存全部"/"已切换到 xxx"),git 自己的输出
23
24
  (push 的 sideband banner、`LF will be replaced by CRLF` 这类提示)收在右侧的"详情 ▾"里,点开才展开,
24
25
  不会被变更列表和最近提交顶到看不见的地方。面板**可通过顶栏拖动**(按住带 Git 标题的
@@ -27,6 +28,13 @@ DeepSeek Harness Web GUI 的完整 Git 管理插件,形态为一个**可折叠
27
28
  分支切换器旁边的"+ 新建分支"按钮会展开一个内联表单:新分支名 + 基分支
28
29
  选择器(本地分支或 `origin/feature/x` 这样的完整远端引用)——确认后从
29
30
  该基分支创建新分支并切换过去。
31
+ - **变更 / 最近提交两张卡片**:变更列表每行是「等宽路径 + 状态色标签」(路径在左,
32
+ 所以一列路径对得齐;修改=橙、新增·未跟踪=绿、删除·冲突=红、重命名=蓝,
33
+ 当前正在看的那一行整行高亮);最近提交每行是「短 sha + 主题」。两张卡片的标题行
34
+ (`▾ 变更 12`)点一下整段收起/展开,**默认展开**——面板不该把用户自己的改动藏起来;
35
+ 列表超过 8 / 5 行时底部出现「显示全部 N 项」,与折叠是两件事,所以箭头永远指对方向。
36
+ - **刷新不闪**:点 ↻ 或任何操作之后的重读都**保留面板内容**(同一个工作区不会退回
37
+ 一行 "读取中…" 再弹回来),只在标题栏把刷新按钮置灰并写着"刷新中…"。
30
38
  - **点击变更看差异**:点变更列表里的任意一行,面板会从 400px 的单栏展开成
31
39
  两栏——左边照旧是完整工作台,右边是该文件的 unified diff(见下文
32
40
  「差异查看」)。再点同一行、或点差异标题栏的 `×`,就收回单栏。
@@ -47,6 +55,8 @@ DeepSeek Harness Web GUI 的完整 Git 管理插件,形态为一个**可折叠
47
55
  - **可拖拽调宽**:拖动**面板最右侧那条边**即改差异栏宽度——左栏(工作台)宽度不变,
48
56
  面板整体变宽、差异栏跟着长;双击这条边复位。面板始终留在视口内,窗口变窄时
49
57
  会自动收回;拖动时面板会就地锚定左边缘,所以指针与这条边是 1:1 跟手的。
58
+ - **打开差异时尺寸是稳定的**:一选中文件,面板就定好了高度(两栏都铺到面板底部),
59
+ diff 读回来、切文件、来回点收起都只在栏内滚动,面板本身不会跟着内容跳一下。
50
60
  - **未暂存 / 已暂存**:默认自动跟随数据——未暂存有内容就显示未暂存,否则显示
51
61
  已暂存;顶部两个 chip 可手动切换,空的一侧置灰。同一个文件两边都有改动时,
52
62
  一次点击看到的是最关心的那一侧,另一侧一键可达。
@@ -75,8 +85,11 @@ DeepSeek Harness Web GUI 的完整 Git 管理插件,形态为一个**可折叠
75
85
  模型,生成的提交信息直接填入输入框;不满意可改,也可以直接手写。
76
86
 
77
87
  生成用的模型路由取当前会话的 `modelSelection` 投影(待生效的选择优先,
78
- 其次是上次实际使用),取不到时回落到宿主注册的第一条路由。失败会以
79
- 本地化文案显示在"上次操作输出"里(无可用改动 / 未配置模型 / 生成失败等)。
88
+ 其次是上次实际使用),取不到时回落到宿主注册的第一条路由。请求会带上**当前会话 id**
89
+ (`sessionId`),因为部分网关(例如本机配置的 opencode 系路由)要求会话亲和头,
90
+ 而宿主只在请求带 `sessionId` 时才把它转给适配器——不带就会被网关以
91
+ `MissingSessionID` 拒掉。失败会以本地化文案显示在"上次操作输出"里
92
+ (无可用改动 / 未配置模型 / 生成失败等;未知失败码先给本地化短句,再附宿主的原始诊断)。
80
93
 
81
94
  ## 架构
82
95
 
@@ -170,7 +183,7 @@ dsh plugin --profile web remove @xia-sc/dsh-git
170
183
  | `commit` | `{ cwd, message }` | `{ message }`;未配置 `user.name/email` 时报 `missing-author` 错误 |
171
184
  | `push` | `{ cwd }` | `{ message }`(120s 超时) |
172
185
  | `log` | `{ cwd, count? }` | `{ repo, commits: [{sha, author, subject, refs}] }`(钳制 1..50) |
173
- | `generateMessage` | `{ cwd, mode?, provider?, model? }` | `{ message, mode, provider, model }`。`mode` 为 `staged`(默认)/`unstaged`/`all`,非法值报 `invalid-mode`;失败码见 `error.details.code`:`no-changes`、`no-provider`、`no-model`、`llm-truncated`(输出上限用尽、一个字都没写出来)、`llm-empty`、`cancelled`、`llm-failed`。 |
186
+ | `generateMessage` | `{ cwd, mode?, provider?, model?, sessionId? }` | `{ message, mode, provider, model }`。`mode` 为 `staged`(默认)/`unstaged`/`all`,非法值报 `invalid-mode`;`sessionId` 为可选的非空字符串(超过 200 字符报 `invalid-session`),面板会带上当前会话 id 供需要会话亲和的网关路由。失败码见 `error.details.code`:`no-changes`、`no-provider`、`no-model`、`llm-truncated`(输出上限用尽、一个字都没写出来)、`llm-empty`、`cancelled`、`llm-failed`。 |
174
187
 
175
188
  > 失败结果的 `error.code` 在线路上固定为 `"internal"`(Connection 信封只要求它是字符串),
176
189
  > 插件自己的诊断码放在 `error.details.code`;客户端按该码做本地化文案。