dsh-ssh-tui 0.3.8 → 0.3.10

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
@@ -110,13 +110,17 @@ approvals) and prints `tmux attach`. Locks live under `$DSH_HOME/tui-locks/`;
110
110
  a leftover file from a crash is stolen if the pid is dead.
111
111
  `DSH_TUI_NO_SESSION_LOCK=1` skips this.
112
112
 
113
+ New sessions inherit the directory you launched from. Resuming a session
114
+ `chdir`s into that session's recorded working directory. The footer shows
115
+ `目录:srv` (last path segment); click it to print the full path.
116
+
113
117
  On start the TUI checks npm for a newer `dsh-ssh-tui` and **notifies only**:
114
118
 
115
119
  ```text
116
120
  发现新版本 dsh-ssh-tui 0.3.5(当前 0.3.4)。更新:dsh plugin --profile tui add dsh-ssh-tui
117
121
  ```
118
122
 
119
- Set `DSH_TUI_NO_UPDATE_CHECK=1` to skip. `/status` also shows the plugin version.
123
+ Set `DSH_TUI_NO_UPDATE_CHECK=1` to skip. `/status` also shows the plugin version, the link chip, the quota window, and whether the subagent model is in the same family as the parent route.
120
124
 
121
125
  From git:
122
126
 
@@ -222,7 +226,7 @@ The plugin runs on Linux, macOS, and Windows (Node ≥ 22.19):
222
226
 
223
227
  | Key | Action |
224
228
  | --- | --- |
225
- | `Enter` | send; while running, steer; with empty input, toggle the selected card |
229
+ | `Enter` | send; while running, steer; with empty input, toggle the selected card. Oversized tool bodies open a dedicated inspect view; `Esc` returns |
226
230
  | `Tab` | complete the highlighted slash command |
227
231
  | `↑` / `↓` | empty input: move among cards; otherwise history. Same as `Ctrl+N` / `Ctrl+P` |
228
232
  | `Ctrl+R` | expand or collapse all cards |
@@ -231,18 +235,21 @@ The plugin runs on Linux, macOS, and Windows (Node ≥ 22.19):
231
235
  | `/find [kind] query` | search and jump to the full matching message (`thinking` `plan` `subagent` `reply`). `Ctrl+/` or `Alt+/` opens it |
232
236
  | `Ctrl+G` / `Alt+N` | next search hit; `Alt+P` previous |
233
237
  | `Esc` | drop selection → scroll to bottom → cancel the running turn |
234
- | `Ctrl+C` | cancel the running turn; exit when idle |
238
+ | `Ctrl+C` | cancel the running turn; press twice when idle to exit |
235
239
  | `Ctrl+D` | exit |
236
240
  | `Ctrl+L` | redraw |
237
241
  | `y` / `n` / `Esc` | answer an approval prompt |
238
242
  | `1..9` + `Enter` | answer an `ask_user_question` dialog |
239
243
 
240
244
  Type `/` to see slash-command suggestions — the panel merges the TUI's own
241
- commands (`/find`, `/model`, `/provider`, `/help`, ...) with every command the harness
245
+ commands (`/find`, `/model`, `/provider`, `/language`, `/help`, ...) with every command the harness
242
246
  registers (`/goal`, `/plan`, `/compact`, `/permission`, `/feedback`, ...).
243
247
  `/compact` shows a spinning 「压缩上下文」 card and footer until it
244
248
  finishes, then the tokens recovered. `Tab` completes, `Enter` runs.
245
- `/help` lists everything.
249
+ `/help` lists everything. `/language` (alias `/lang`) opens a picker, or
250
+ `/language zh` / `/language en` switches immediately. `DSH_TUI_LANG` wins,
251
+ then `ssh-tui.language` in `$DSH_HOME/settings.yaml`, then `LANG` /
252
+ `LC_MESSAGES`. Unknown and `C` locales stay Chinese.
246
253
 
247
254
  `/model` lists models for the **current** provider only. On SuperGrok that
248
255
  is `grok-4.6` / `grok-4.5` plus reasoning effort (`xhigh` on 4.6). `/provider`
@@ -300,10 +307,12 @@ labelled `(images ok)` in the command list and completion hints.
300
307
  - **OpenCode Zen** is metered — the TUI points at `https://opencode.ai/zen`.
301
308
 
302
309
  OpenCode Go / SuperGrok quota is fetched silently at start and on a
303
- window-based cadence; the footer shows remaining %. A transcript line
304
- appears only when remaining crosses 50% / 25% / 10% / 5%. `/usage` or
305
- `/balance` still prints the full snapshot. Cadence: every 10 turns for a
306
- 5-hour cap (every 4 when near), every 50 for weekly (every 10 when near),
310
+ window-based cadence; the footer shows plan name + remaining bar + percent,
311
+ and on a narrow row drops the plan name first so the bar and percent stay.
312
+ DeepSeek official balance stays on `/balance` and never occupies the footer.
313
+ A transcript line appears only when remaining crosses 50% / 25% / 10% / 5%.
314
+ `/usage` or `/balance` still prints the full snapshot. Cadence: every 10 turns
315
+ for a 5-hour cap (every 4 when near), every 50 for weekly (every 10 when near),
307
316
  every 80 for monthly (every 20 when near).
308
317
 
309
318
  The startup screen shows the official DeepSeek whale logo (rendered from the
@@ -313,6 +322,12 @@ down to a compact variant on narrow ones — so it never looks squeezed. A
313
322
  horizontal rule separates the workspace (transcript, reasoning, tool cards)
314
323
  from the input area.
315
324
 
325
+ While the model has not streamed thinking or a reply yet, a Codex-style
326
+ `⠋ Working (1s · Esc to interrupt)` card sits at the bottom of the
327
+ workspace. The detail line is the current user prompt, or the live tool
328
+ name once a tool is running. It yields as soon as thinking or a reply
329
+ starts.
330
+
316
331
  Model reasoning blocks are collapsed by default: while thinking a compact
317
332
  `▸ 思考中 ⠹ · N 字 · Ns` line with a spinner replaces the raw stream, and
318
333
  after the turn each block collapses to a `▸ 已思考 · N 行` summary without
@@ -321,7 +336,9 @@ the raw reasoning as it arrives. Assistant replies render in bold white with
321
336
  terminal markdown support: heading levels (H1 enlarged/underlined, H2
322
337
  underlined, H3 colored), bold, italic, inline code, fenced code blocks,
323
338
  lists, quotes, and links all get ANSI styling while remaining
324
- width-wrapped for the terminal. Reasoning, tool, subagent, plan, and question cards are
339
+ width-wrapped for the terminal. System-prompt / `<system-reminder>` / `AGENTS.md` injections collapse to a
340
+ `提示词注入:系统预设 AGENTS.MD` card (sources joined when several match).
341
+ Reasoning, tool, subagent, plan, question, and prompt cards are
325
342
  each expandable/collapsible independently. Empty input: `↑`/`↓` (same as
326
343
  `Ctrl+N`/`Ctrl+P`) move the highlight, `Enter` toggles, `Ctrl+R` toggles all,
327
344
  `Esc` drops the selection. Click a card header to toggle it. Subagent cards
@@ -338,19 +355,17 @@ animated spinner plus `运行中 · 工具 N` while working, `✓ 已完成` for
338
355
  seconds after completion, and `待命` when idle. A terminal bell rings on
339
356
  completion (`DSH_TUI_NO_BELL=1` disables it).
340
357
 
341
- Tool calls render as compact cards instead of raw argument JSON. The card
342
- header and result text follow the execution state yellow while running,
343
- green on success, red on failure (a shell command with a non-zero exit or
344
- signal also turns red, with a `[退出码 N]` / `[信号 X]` suffix). Shell tools
345
- show the command as dim-grey `$ command`, file mutations (`edit` / `write` /
346
- `str_replace_editor`) render the applied change git-style: a path header,
347
- `-` lines on a dark-red background, `+` lines on a dark-green background,
348
- and a `└ +N -M · K file(s)` footer. File-mutation diffs are shown in full
349
- (never collapsed to a `… more` line) and their cards start expanded. Other
350
- tools show a short argument summary and start collapsed to a single line
351
- (the command, truncated with
352
- `…` when long); expand to reveal output or the result body. Expanded generic
353
- calls convert their JSON arguments and JSON results into readable indented
358
+ Tool calls render as compact cards instead of raw argument JSON. The title
359
+ stays the default foreground; only the status dot and `[ok]` / `[error]` /
360
+ `[running…]` (plus `[退出码 N]` / `[信号 X]`) are yellow / green / red.
361
+ Shell tools show the command as dim-grey `$ command`. File mutations
362
+ (`edit` / `write` / `str_replace_editor`) render the applied change
363
+ git-style: a path header, `-` lines on a dark-red background, `+` lines on
364
+ a dark-green background, and a `└ +N -M · K file(s)` footer. Expanding a
365
+ card whose body fits the workspace shows it in place; if it would overflow,
366
+ a dedicated inspect view opens (`Esc` returns to the session). Other tools
367
+ show a short argument summary and start collapsed. Expanded generic calls
368
+ convert their JSON arguments and JSON results into readable indented
354
369
  content — key/value fields, bullet lists, and multiline blocks for
355
370
  code/content — instead of raw JSON text.
356
371
 
package/README.md CHANGED
@@ -51,12 +51,14 @@ dsh --profile tui
51
51
  `▸ 已思考 · N 行`,可单独展开;思考过程中也能实时展开/收起查看原文;
52
52
  - 工作区支持 markdown 渲染:多级标题(H1 放大/下划线、H2 下划线、H3 着色)、
53
53
  粗体、斜体、行内代码、代码块、列表、引用与链接;模型最终回复以粗体白色显示;
54
- - 工具调用卡片化:标题与结果文字跟随执行状态(运行黄 / 成功绿 / 失败红),
55
- shell 命令浅灰显示、状态点同色;编辑工具 git 风格 diff(`-` 暗红底 / `+` 暗绿底 /
56
- 文件统计,编辑卡片默认展开且 diff 内容不截断)、JSON 参数与结果自动转可读内容;
54
+ - 系统提示词 / `system-reminder` / `AGENTS.md` 等注入折叠为「提示词注入:系统预设 AGENTS.MD」卡片,默认收起,Enter 展开看全文;
55
+ - 工具调用卡片化:标题默认色,只把状态点与 `[ok]`/`[error]` 染成黄/绿/红;
56
+ shell 命令浅灰、路径 cyan;编辑工具 git 风格 diff(`-` 暗红底 / `+` 暗绿底 /
57
+ 文件统计)。正文超出窗口时单独全览(Esc 返回),放得下就在工作区展开;JSON 参数与结果自动转可读内容;
57
58
  - 转录区滚动回看(`PgUp`/`PgDn`、鼠标滚轮),点击思考/工具标题行直接展开收起;
58
59
  - 输入框下方两行底栏:第一行链路芯片 + 按宽度丢组的会话数字(轮次、入/出 token、速度);
59
- 第二行只留一个活动词(运行中 / 工具 N / 子代理 N / 压缩中…),身份收到右侧;
60
+ 第二行只留一个活动词(运行中 / 工具 N / 子代理 N / 压缩中…),身份收到右侧(含 `目录:srv`;点击打印完整工作目录);
61
+ - 恢复旧会话会切到该会话记录的工作目录;新建会话用启动时的当前目录;
60
62
  - 历史会话启动选择器:`dsh --profile tui --resume`(或 `resume`)先选会话再进入;
61
63
  - 终端窗口标题栏:运行中旋转图标 + `运行中 · 工具 N`,完成后 `✓ 已完成`,并响
62
64
  一声终端铃(`DSH_TUI_NO_BELL=1` 关闭);
@@ -64,6 +66,7 @@ dsh --profile tui
64
66
  `/resume` 会话切换等完整支持;
65
67
  - 每个子代理都是独立可折叠卡片,默认收起,运行中带旋转动画;多个子代理互不混排;
66
68
  - 进入计划模式、待审计划、提问用户都会显示对应卡片和底部提示,而不是只塞进系统消息。
69
+ - 模型尚未吐思考/回复时,工作区底部有 Codex 式「处理中」动画卡:当前用户提示或正在跑的工具名 + 计时 + Esc 中断。
67
70
 
68
71
  ## 环境要求
69
72
 
@@ -119,7 +122,7 @@ tmux attach -t dsh
119
122
  发现新版本 dsh-ssh-tui 0.3.5(当前 0.3.4)。更新:dsh plugin --profile tui add dsh-ssh-tui
120
123
  ```
121
124
 
122
- `DSH_TUI_NO_UPDATE_CHECK=1` 可关掉。`/status` 里也能看到当前插件版本。
125
+ `DSH_TUI_NO_UPDATE_CHECK=1` 可关掉。`/status` 里也能看到当前插件版本、链路芯片、额度窗口,以及子代理模型是否与父路由同族。
123
126
 
124
127
  仓库内也可:`bash scripts/smoke-headless.sh`(记录出口摘要,不打印 token)。
125
128
 
@@ -192,24 +195,25 @@ dsh --profile tui --no-color
192
195
 
193
196
  | 键 | 作用 |
194
197
  | --- | --- |
195
- | `Enter` | 发送;运行中则插入指示;空输入且已选卡片时展开/收起 |
198
+ | `Enter` | 发送;运行中则插入指示;空输入且已选卡片时展开/收起。工具正文超出窗口则单独全览,`Esc` 返回 |
196
199
  | `↑` / `↓` | 空输入:在卡片间移动;有输入:历史。与 `Ctrl+N` / `Ctrl+P` 相同 |
197
200
  | `Ctrl+R` | 全部展开或全部收起 |
198
201
  | `Ctrl+T` | 折叠输入框(只影响显示) |
199
202
  | `Alt+1` / `2` / `3` / `4` | 跳到最新思考 / 计划 / 子代理 / 回复 |
200
- | `/find [类] 关键字` | 搜索并跳到该条完整消息(反色高亮)。类:`思考` `计划` `子代理` `回复`。`Ctrl+/` 或 `Alt+/` 打开 |
203
+ | `/find [类] 关键字` | 搜索并跳到该条完整消息(反色高亮)。类:`思考` `计划` `子代理` `回复` `提示词`。`Ctrl+/` 或 `Alt+/` 打开 |
201
204
  | `Ctrl+G` / `Alt+N` | 下一条搜索结果;`Alt+P` 上一条 |
202
205
  | 鼠标左键 | 点击卡片标题展开/收起 |
203
206
  | `PgUp` / `PgDn`、滚轮 | 转录回看 |
204
207
  | `Esc` | 取消选择 → 回底部 → 取消当前轮次 |
205
- | `Ctrl+C` | 中断当前轮次;空闲退出 |
208
+ | `Ctrl+C` | 中断当前轮次;空闲连按两次退出 |
206
209
  | `Ctrl+D` | 退出 |
207
210
  | `Ctrl+L` | 重绘整个画面 |
208
211
 
209
212
  `/mode` 切换官方 preset:标准 (`standard`)、PTC (`ptc`;dsh 0.1.1 上仍是 `code`)、极简 (`minimal`)、创造 (`cordis`),以及本地安装的其它模式。
210
213
 
211
- 斜杠命令:`/help`、`/find`、`/model`、`/provider`、`/submodel`、`/subeffort`、`/mode`、`/resume`、
214
+ 斜杠命令:`/help`、`/find`、`/model`、`/provider`、`/language`(`/lang`)、`/submodel`、`/subeffort`、`/mode`、`/resume`、
212
215
  `/status`、`/subagents`、`/usage`(`/balance` 同义)、`/setup`、`/clear`,
216
+ 界面语言:`/language` 打开选择器,或 `/language zh` / `/language en` 直接切。优先 `DSH_TUI_LANG`,其次 `$DSH_HOME/settings.yaml` 的 `ssh-tui.language`,再跟 `LANG`/`LC_MESSAGES`。未知和 `C` locale 默认中文。
213
217
  以及 harness 自带命令(`/goal`、`/plan`、`/compact` 等)。`/compact` 进行中会显示
214
218
  「压缩上下文」卡片和底栏转圈,结束时写出回收的 token 数。模型请求失败会显示重试
215
219
  进度;会话标题由模型生成后写到窗口标题。harness 命令若声明
@@ -256,7 +260,7 @@ API Key 提供商,不会冲掉其它路由。SuperGrok / X Premium 走本机 O
256
260
  - **OpenCode Go**:官方 `/v1/usage`,滚动 5 小时 / 本周 / 本月剩余%;
257
261
  - **OpenCode Zen**:按量计费、没有固定额度,提示到 `https://opencode.ai/zen`。
258
262
 
259
- OpenCode Go / SuperGrok 启动和运行中都静默查询,底栏只显示剩余%;跨过 50% / 25% / 10% / 5% 才往工作区打 ⚠。`/usage` 或 `/balance` 仍打印完整结果。查询节奏按最紧窗口:5 小时额度每 10 轮(接近改 4 轮),周额度每 50 轮(接近改 10 轮),月额度每 80 轮(接近改 20 轮)。
263
+ OpenCode Go / SuperGrok 启动和运行中都静默查询,底栏显示套餐名 + 剩余条 + 百分比;窄屏先丢掉套餐名,只留条和百分比。DeepSeek 官方余额只出现在 `/balance`,不进底栏。跨过 50% / 25% / 10% / 5% 才往工作区打 ⚠。`/usage` 或 `/balance` 仍打印完整结果。查询节奏按最紧窗口:5 小时额度每 10 轮(接近改 4 轮),周额度每 50 轮(接近改 10 轮),月额度每 80 轮(接近改 20 轮)。
260
264
 
261
265
  ## 配置
262
266
 
@@ -273,6 +277,8 @@ ssh-tui-subagent:
273
277
  model: deepseek-v4-flash
274
278
  # provider 可省略:省略时子代理跟随父会话提供方
275
279
  # reasoningEffort 可省略:省略时跟随提供商/模型默认
280
+ ssh-tui:
281
+ language: zh # 或 en;/language 写入这里。DSH_TUI_LANG 优先
276
282
  ```
277
283
 
278
284
  `/model`、`/mode`、`/submodel` 与 `/subeffort` 的修改会写回这里,
@@ -335,6 +341,7 @@ src/session-list.ts 历史会话扫描与标签(共享给 /resume)
335
341
  src/session-lock.ts 同会话防双开
336
342
  src/update-check.ts npm 最新版提示(不自动升级)
337
343
  src/tui.ts 终端渲染、交互、统计、标题/铃声
344
+ src/i18n/ 中英界面字典(/language、DSH_TUI_LANG)
338
345
  cordis.patch.yml dsh bundle patch(挂载 TUI 与 agent-presets)
339
346
  scripts/ 安装 / 卸载 / 验证脚本
340
347
  ```