@deepseek-harness-tui/dsh-tui 0.18.0 → 0.19.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.
Files changed (209) hide show
  1. package/README.md +35 -10
  2. package/bin/dsh-tui.js +46 -3
  3. package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
  4. package/guide/dsh-tui-guide/codex-backend.md +2 -2
  5. package/guide/dsh-tui-guide/configuration.en.md +7 -2
  6. package/guide/dsh-tui-guide/configuration.md +7 -2
  7. package/guide/dsh-tui-guide/getting-started.en.md +168 -4
  8. package/guide/dsh-tui-guide/getting-started.md +121 -14
  9. package/guide/dsh-tui-guide/interaction.en.md +11 -10
  10. package/guide/dsh-tui-guide/interaction.md +5 -4
  11. package/guide/dsh-tui-guide/user-guide.en.md +6 -5
  12. package/guide/dsh-tui-guide/user-guide.md +6 -5
  13. package/lib/settings.json +1 -1
  14. package/lib/types/adapter/ports/channel-ui.d.ts +10 -7
  15. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  16. package/lib/types/adapter/ports/channel-view.d.ts +28 -5
  17. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  18. package/lib/types/agent/events.d.ts +12 -5
  19. package/lib/types/agent/events.d.ts.map +1 -1
  20. package/lib/types/agent/session.d.ts +5 -0
  21. package/lib/types/agent/session.d.ts.map +1 -1
  22. package/lib/types/backends/claude/translate/core.d.ts +2 -2
  23. package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
  24. package/lib/types/backends/claude/translate/core.js +10 -6
  25. package/lib/types/backends/codex/session/commands.d.ts +2 -0
  26. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  27. package/lib/types/backends/codex/session/commands.js +8 -4
  28. package/lib/types/backends/codex/session/input.d.ts +11 -7
  29. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  30. package/lib/types/backends/codex/session/input.js +68 -15
  31. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  32. package/lib/types/backends/codex/session/session.js +2 -3
  33. package/lib/types/channel/projection.d.ts.map +1 -1
  34. package/lib/types/channel/projection.js +78 -10
  35. package/lib/types/channel/questions.d.ts +19 -3
  36. package/lib/types/channel/questions.d.ts.map +1 -1
  37. package/lib/types/channel/sanitize.d.ts.map +1 -1
  38. package/lib/types/channel/sanitize.js +8 -4
  39. package/lib/types/channel/subagent-failure.d.ts +49 -0
  40. package/lib/types/channel/subagent-failure.d.ts.map +1 -0
  41. package/lib/types/channel/subagent-failure.js +59 -0
  42. package/lib/types/channel/transcript.d.ts +17 -0
  43. package/lib/types/channel/transcript.d.ts.map +1 -1
  44. package/lib/types/channel/transcript.js +35 -0
  45. package/lib/types/commands.js +1 -1
  46. package/lib/types/components/MessageList.d.ts.map +1 -1
  47. package/lib/types/components/MessageList.js +11 -7
  48. package/lib/types/components/PromptInput.d.ts.map +1 -1
  49. package/lib/types/components/PromptInput.js +61 -6
  50. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  51. package/lib/types/components/SubagentDashboard.js +7 -1
  52. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  53. package/lib/types/components/messages/AssistantToolUseMessage.js +5 -2
  54. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
  55. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  56. package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
  57. package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
  58. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  59. package/lib/types/components/revealScope.d.ts +15 -0
  60. package/lib/types/components/revealScope.d.ts.map +1 -0
  61. package/lib/types/components/revealScope.js +17 -0
  62. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +34 -1
  63. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  64. package/lib/types/components/sidePanel/btw/BtwComposer.js +108 -7
  65. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  66. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +1 -1
  67. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  68. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +1 -1
  69. package/lib/types/components/smoothReveal.d.ts +36 -6
  70. package/lib/types/components/smoothReveal.d.ts.map +1 -1
  71. package/lib/types/components/smoothReveal.js +92 -21
  72. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
  73. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  74. package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
  75. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  76. package/lib/types/dsh-adapter/backend/session.js +12 -0
  77. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  78. package/lib/types/dsh-adapter/backend/translate.js +6 -1
  79. package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
  80. package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
  81. package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
  82. package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
  83. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  84. package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
  85. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +2 -6
  86. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  87. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +7 -1
  88. package/lib/types/dsh-adapter/channel/core/compose.d.ts +2 -6
  89. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  90. package/lib/types/dsh-adapter/channel/core/compose.js +1 -1
  91. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  92. package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
  93. package/lib/types/dsh-adapter/channel/emitter.js +1 -1
  94. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  95. package/lib/types/dsh-adapter/channel/extensions.js +8 -0
  96. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  97. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  98. package/lib/types/dsh-adapter/channel/input-actions.js +34 -10
  99. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
  100. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  101. package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
  102. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  103. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  104. package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
  105. package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
  106. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  107. package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
  108. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
  109. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  111. package/lib/types/dsh-adapter/channel/session-rewind.js +6 -2
  112. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  113. package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -4
  114. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  115. package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
  116. package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
  117. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/channel/transcript.js +13 -4
  119. package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
  120. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/contract.d.ts +26 -3
  122. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  123. package/lib/types/dsh-adapter/contract.js +44 -5
  124. package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
  125. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  126. package/lib/types/dsh-adapter/fresh-agent.js +60 -11
  127. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  128. package/lib/types/dsh-adapter/host-access.js +60 -11
  129. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  130. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  131. package/lib/types/dsh-adapter/host-contract.js +4 -2
  132. package/lib/types/dsh-adapter/host-dsh.d.ts +0 -8
  133. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  134. package/lib/types/dsh-adapter/host-dsh.js +27 -6
  135. package/lib/types/dsh-adapter/host-entry.js +4 -0
  136. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  137. package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
  138. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  139. package/lib/types/dsh-adapter/plugin.js +143 -44
  140. package/lib/types/dsh-adapter/presets.d.ts +38 -11
  141. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  142. package/lib/types/dsh-adapter/presets.js +46 -17
  143. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  144. package/lib/types/dsh-adapter/process-exit.js +1 -1
  145. package/lib/types/dsh-adapter/questions.d.ts +3 -4
  146. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  147. package/lib/types/dsh-adapter/questions.js +1 -1
  148. package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
  149. package/lib/types/dsh-adapter/subagents.d.ts +5 -0
  150. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/subagents.js +22 -1
  152. package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
  153. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/team-mode.js +19 -12
  155. package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
  156. package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
  157. package/lib/types/dsh-adapter/tool-scope.js +127 -0
  158. package/lib/types/dsh-adapter/types.d.ts +2 -1
  159. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  160. package/lib/types/heldInputs.d.ts +55 -16
  161. package/lib/types/heldInputs.d.ts.map +1 -1
  162. package/lib/types/heldInputs.js +277 -41
  163. package/lib/types/i18n.d.ts +227 -11
  164. package/lib/types/i18n.d.ts.map +1 -1
  165. package/lib/types/i18n.js +60 -5
  166. package/lib/types/ink/components/App.d.ts +2 -0
  167. package/lib/types/ink/components/App.d.ts.map +1 -1
  168. package/lib/types/ink/components/App.js +8 -0
  169. package/lib/types/ink/events/input-event.d.ts.map +1 -1
  170. package/lib/types/ink/events/input-event.js +7 -6
  171. package/lib/types/ink/hit-test.d.ts +2 -0
  172. package/lib/types/ink/hit-test.d.ts.map +1 -1
  173. package/lib/types/ink/hit-test.js +10 -0
  174. package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
  175. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
  176. package/lib/types/ink/hooks/use-program-status.js +3 -2
  177. package/lib/types/ink/ink.d.ts +1 -0
  178. package/lib/types/ink/ink.d.ts.map +1 -1
  179. package/lib/types/ink/ink.js +5 -2
  180. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  181. package/lib/types/ink/parse-keypress.js +25 -0
  182. package/lib/types/ink/terminal.d.ts +13 -2
  183. package/lib/types/ink/terminal.d.ts.map +1 -1
  184. package/lib/types/ink/terminal.js +29 -5
  185. package/lib/types/screens/Chat.d.ts.map +1 -1
  186. package/lib/types/screens/Chat.js +43 -2
  187. package/lib/types/screens/SessionSupervisor.d.ts +3 -6
  188. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  189. package/lib/types/screens/SessionSupervisor.js +5 -8
  190. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
  191. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  192. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
  193. package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
  194. package/lib/types/screens/sessionSupervisor/model.js +1 -1
  195. package/lib/types/sessionMounts.d.ts +12 -5
  196. package/lib/types/sessionMounts.d.ts.map +1 -1
  197. package/lib/types/sessionMounts.js +33 -6
  198. package/lib/types/update.d.ts +412 -20
  199. package/lib/types/update.d.ts.map +1 -1
  200. package/lib/types/update.js +2094 -193
  201. package/lib/types/updateHost.d.ts +198 -0
  202. package/lib/types/updateHost.d.ts.map +1 -0
  203. package/lib/types/updateHost.js +608 -0
  204. package/lib/types/utils/processName.d.ts +16 -0
  205. package/lib/types/utils/processName.d.ts.map +1 -0
  206. package/lib/types/utils/processName.js +27 -0
  207. package/package.json +111 -108
  208. package/tui-profile/feed/README.md +1 -1
  209. package/tui-profile/feed/first-party.json +1 -1
package/README.md CHANGED
@@ -129,7 +129,7 @@ The `deepseek-official` API-key route needs `DEEPSEEK_API_KEY`. On DSH
129
129
  and select the separate account route through `/model`. Other supported
130
130
  accounts can sign in through `/provider` or `/auth` after startup.
131
131
 
132
- The primary compatibility target is DSH `0.2.1-rc.5`. This adapter supports its
132
+ The primary compatibility target is DSH `0.2.2-rc.1`. This adapter supports its
133
133
  Shell API, V4 session messages, declarative presets, and profile-backed settings;
134
134
  older supported hosts retain their compatibility paths. See [configuration](docs/configuration.en.md).
135
135
 
@@ -175,8 +175,16 @@ Afterwards `dsh-tui` and `dsh --profile dsh-tui` are equivalent.
175
175
  > [Getting started](docs/getting-started.en.md#pnpm-install-script-blocks-and-foreign-platform-natives).
176
176
 
177
177
  After startup the TUI checks for newer versions in the background. It never
178
- blocks the first frame. Type `/update` for a one-shot upgrade. It restarts
179
- automatically and resumes the current session. See
178
+ blocks the first frame. Type `/update` for a one-shot upgrade of the whole set
179
+ — TUI, dsh engine and global launcher. It restarts automatically and resumes
180
+ the current session, and refuses instead of leaving an incompatible or
181
+ unbootable TUI/engine combination. Launcher alignment is normally best effort,
182
+ but a failure after the engine advances blocks the restart and prints a repair
183
+ command. If the registry has a newer dsh release outside the TUI's
184
+ validated line, it says so and waits for a TUI update rather than installing an
185
+ unvalidated engine. Launcher alignment only touches proven global installs;
186
+ local npm/npx packages, ambiguous aliases and multi-member pnpm groups stay
187
+ unchanged. See
180
188
  [Getting started](docs/getting-started.en.md) for the profile lifecycle,
181
189
  source builds, and troubleshooting, including migration from the former
182
190
  `dsh-cc-tui` package.
@@ -193,7 +201,7 @@ and Node/Python/PowerShell integration examples.
193
201
  | Command | Purpose |
194
202
  | --- | --- |
195
203
  | `dsh-tui` / `dst` | Start the TUI; `dst` is a short alias for the same program |
196
- | `dsh-tui --resume [id]` · `dsh-tui update` · `dsh-tui doctor` | Resume a session · update the profile and align the launcher · pre-flight environment checks |
204
+ | `dsh-tui --resume [id]` · `dsh-tui update` · `dsh-tui doctor` | Resume a session · align the TUI, dsh engine and global launcher as one set · pre-flight environment checks |
197
205
  | `dsh-tui safe` | Read-only diagnostics, plugin inventory and repair guidance; `safe --rescue` builds a clean rescue profile |
198
206
  | `dsh-tui version` · `dsh-tui help` | Launcher and profile versions and usage; both work even without a `dsh` install |
199
207
 
@@ -366,8 +374,8 @@ team record stays in the session and comes back when the bundle is enabled
366
374
  again.
367
375
 
368
376
  If the running DSH does not ship the bundle (`/plugin list` stays silent),
369
- switch DSH to one of the supported lines first (`0.2.1-rc.5`, `0.2.1-rc.4`, `0.2.1-rc.3`, `0.2.1-rc.2`, `0.2.1-alpha.5`,
370
- `0.2.0-rc.1` or `0.2.0-rc.2`). To install it into the profile explicitly,
377
+ switch DSH to one of the supported lines first (`0.2.2-rc.1`, `0.2.1-rc.5`, `0.2.1-rc.4`, `0.2.1-rc.3`,
378
+ `0.2.1-rc.2`, `0.2.1-alpha.5`, `0.2.0-rc.1` or `0.2.0-rc.2`). To install it into the profile explicitly,
371
379
  run `dsh plugin --profile dsh-tui add @deepseek-ai/dsh-experimental-agent-team-profile@<your-dsh-version>`:
372
380
  the team packages ship in lockstep with DSH and pin their DSH peers exactly,
373
381
  so the version must match.
@@ -386,7 +394,11 @@ panel switch to a team view: each teammate under its member name with
386
394
  `running` / `idle` / `provisioning` / `failed` (a teammate whose turn ended
387
395
  is idle — a message wakes it — not done), the Lead line, the remaining
388
396
  subagents, a read-only task board (status, owner, `blocked`, write-scope
389
- warnings) and a banner when the team record was rejected.
397
+ warnings) and a banner when the team record was rejected. A delegation
398
+ provider whose settled runs fail at least twice and at least half the time
399
+ gets one degraded-channel line above the list; the built-in `subagent` route,
400
+ workflow members and per-type Claude children are excluded because there is
401
+ no provider to switch to.
390
402
 
391
403
  Limits: the switch covers the whole profile, not one session (a launch
392
404
  without the profile plugin service, or without hot reload, needs `dsh plugin`
@@ -409,15 +421,20 @@ In the launchpad input, `Shift+Enter` (or `Option+Enter`) opens chat and inserts
409
421
 
410
422
  In both the launchpad and chat, `Alt/Option+←/→` moves by whitespace-delimited words and `Alt/Option+Backspace` deletes the previous word, like `Ctrl+W`. On macOS, configure your terminal to send Option as Meta.
411
423
 
412
- Use `Alt+Up` / `Alt+Down` to page through question text and details, or approval previews on very short terminals, without moving the choice focus; these keys are remappable in `/settings` → `Shortcuts`. Fullscreen also supports the wheel over the preview. Complete OAuth links remain readable when browser and clipboard helpers are unavailable.
424
+ Use `Alt+Up` / `Alt+Down` to page through question text and details, or approval previews on very short terminals, without moving the choice focus; these keys are remappable in `/settings` → `Shortcuts`. Fullscreen also supports the wheel over the preview. Complete OAuth links remain readable when browser and clipboard helpers are unavailable. Fixed-action permission questions offer only the caller's choices; ordinary questionnaires still accept free text.
413
425
 
414
426
  Text, cursor position and staged image attachments on the launchpad or in chat while the backend starts are preserved when the session becomes ready. Press `Enter` after it is ready to send; an earlier `Enter` preserves the draft without queuing it. Opening a new session while startup is pending clears the previous draft and its images.
415
427
 
416
428
  The goal bar stays on one summary line: hovering truncated goal text in fullscreen or split shows the whole objective, and a bare `/goal` prints the full status — objective, phase, rounds or budget, available commands — as a transcript block in the `/plugins` shape. Inline mode sees no pointer events, so that block is how its users read a long objective.
417
429
 
418
430
  While the model is working: `Enter` steers, `Tab` queues a follow-up, `Ctrl+Enter` interrupts and sends. Input that names a command is still a command — with or without arguments — so `/model` or `/new` reach their own gate (and the `/` overlay sinks the commands that affect the running conversation) instead of silently becoming an interruption; only text that is not a command — and a direct skill gesture such as `/skill-name …` — steers.
431
+
432
+ When DSH ends a turn because its session was disposed, the transcript shows “Session stopped”; user interruption keeps its existing prompt for what to do next. This describes the reported stop reason and does not recover a stuck session or its queued inputs.
433
+
419
434
  Windows Neovim/Vim terminals identified by `NVIM` or `VIM_TERMINAL` retain VT input instead of enabling ConPTY mode 9001. For another incompatible embedded host, set `DSH_TUI_DISABLE_WIN32_INPUT_MODE=1` before launch (PowerShell: `$env:DSH_TUI_DISABLE_WIN32_INPUT_MODE="1"`). The same gate applies at startup and after resume. Native Windows Terminal, conhost and VS Code keep their existing mode unless disabled; the opt-out can remove modified-Enter reporting.
420
435
 
436
+ Extended key reporting (Kitty keyboard protocol and xterm `modifyOtherKeys`) is enabled for a fixed terminal list: iTerm2, kitty, WezTerm, Ghostty, rio, Orca, tmux, Warp and Windows Terminal. A terminal missing from that list can opt in with `DSH_TUI_FORCE_EXTENDED_KEYS=1`, and `DSH_TUI_DISABLE_EXTENDED_KEYS=1` opts an allowlisted terminal back out for SSH or nested xterm.js hosts (it wins when both are set). Outside native Windows, where win32-input-mode reports Enter's modifiers instead and is not touched by this switch, a terminal without extended keys cannot tell `Shift+Enter` from `Enter`, and `Ctrl+J` is the newline fallback.
437
+
421
438
 
422
439
  On native Windows, fragmented Win32 input records are reassembled across short input delays instead of appearing as numeric protocol text. The platform check only reports that this machine might run the private mode (win32-input-mode); a bare `ESC[` fragment is held only after one record has actually been decoded, while a fragment whose own shape is already record-specific holds on its own (which is how even the first record can survive a split). Windows terminals that never enter the mode (mintty, GitBash) therefore keep the classic VT path: a lone `Esc` keeps its normal response time, and a letter typed after a timed-out `ESC[` is not swallowed.
423
440
 
@@ -482,11 +499,19 @@ In `/provider`'s model list, focus a model and press `Tab` to edit its context w
482
499
  The session manager focuses the most recently used session in the current workspace; if there is no history, it focuses the new-session card. Moving between the workspace rail and session list preserves the selected session, including when the mouse enters the list. Switching to another workspace selects its latest session; switching back also starts from its latest session instead of restoring an earlier selection. Press `←` to move to the workspace rail. DST preloads the session list in the background after startup and updates the cache on success. The manager paints the last successful list immediately. Opening `/resume` while that read is pending shares the request and receives results that have already arrived. This first-paint snapshot survives restarts on DSH, Claude and Codex and is isolated by backend and storage directory. With or without a snapshot, all three backends prioritize the current workspace before filling in other workspaces. Fresh sessions and titles merge into the list immediately; cached rows from other workspaces remain until the full read finishes. Background updates preserve a session the user has selected manually. Claude and Codex first request up to 32 recent sessions within their native cwd scope: Claude's SDK includes Git worktrees in the same repository, while Codex matches the session cwd exactly. Codex listings reuse the running connection and read the first 32 regular results alongside the state DB shortcut, then fill in later pages. The browser groups sessions by their own cwd. DSH resolves the current workspace's metadata first and publishes it before reading other workspaces' logs, even when it has fewer than 32 sessions. Titles that require a deeper DSH log scan appear first with a fallback name and update in place when recovery finishes.
483
500
  The session manager shows the selected workspace's absolute path once, beneath the source tabs (wrapping when needed; hover reveals exceptionally long paths). Session rows show their title and essential status/time instead of repeating the directory; DSH size and model remain in the title tooltip.
484
501
  With DSH's current JSONL backend, startup and `/new` keep initial permission events in memory until further session activity saves the complete log. Flushing a session that holds only initialization leaves it unstored. Restarting an unstored empty session starts fresh.
502
+ The project rail uses one line per directory on every backend and source tab; the selected project’s path appears once above the panes.
503
+
485
504
  Removing a workspace registration keeps its sessions accessible under a "History only" directory in the rail.
486
505
  History-only directories offer edit and new-session actions; rename and remove are available for registered workspaces.
487
506
 
488
507
  If a `/resume` attempt fails or is cancelled before switching, it releases any session occupancy acquired by that attempt so the session can be retried.
489
508
 
509
+ On Linux, stale TUI occupancy and mount locks can be reclaimed when the old PID
510
+ has been reused by a non-leader thread. This requires readable `/proc` identity
511
+ data in the same PID namespace; uncertain identities remain occupied. Reuse by
512
+ another process can still retain a stale claim, so this is not a general fix for
513
+ PID reuse across platforms.
514
+
490
515
  **Background jobs**: card headers open the focused task panel. Click the card body or use `Ctrl+O` to toggle the command between its first statement and full script. Commands and output use separate colored edges with `❯` (`>` on Windows) and `≡` on their first rows; output always stays at the latest two visible rows. `/jobs` and the side panel keep the full output scrollable, while `e` toggles the focused command. Consecutive blank script lines collapse to one.
491
516
 
492
517
  **Background sessions**: On the DSH backend, `/bg` or `←` on an empty prompt backgrounds the current session and opens the session manager; `Esc` returns to it. Background sessions run in this process and stop when the TUI exits. Logs survive. On Claude/Codex, those entries open the session manager without backgrounding the session.
@@ -515,7 +540,7 @@ Runtime path, module boundaries, performance notes and persistence locations: [A
515
540
  ## Known Limitations
516
541
 
517
542
  - Injected plugin context has no standalone display; it counts into the context segments.
518
- - `/model` changes the next request’s route in the same session; history and session ID are preserved. The last used route is recorded when the next request starts. DSH versions before `0.1.2-alpha.3` refuse switching and prompt an upgrade because their subagents inherit the original route.
543
+ - `/model` changes the next request’s route in the same session; history and session ID are preserved. The last used route is recorded when the next request starts. On DSH 0.2.2, API/plugin selections also update the next-model readout; late events from a previously fixed step do not overwrite the selected model's capacity metadata. DSH versions before `0.1.2-alpha.3` refuse switching and prompt an upgrade because their subagents inherit the original route.
519
544
  - `Ctrl+V` needs platform clipboard tools; unsupported bitmap formats are rejected.
520
545
  - Windows Terminal/ConPTY sixel frames check the last transmitted raster’s cursor position before parking, using measured cell geometry and encoded band controls. Detected drift uses the same physical clear and redraw as `Ctrl+L`. Probes allow one pending reply (500 ms), skip resize/handoff, and pause for 60 seconds after an unanswered query or three repairs within 10 seconds. Set `DSH_TUI_SIXEL_CURSOR_HEAL=0` to disable; `DSH_TUI_DEBUG` records probe/recovery decisions. This bounded mitigation cannot detect every kind of pixel corruption or repair ConPTY itself.
521
546
 
@@ -729,7 +754,7 @@ after an intentional lockfile update, then review the cohort diff.
729
754
 
730
755
  ### Bounded update installation
731
756
 
732
- `/update` and `dsh-tui update` give each profile installer invocation a **30-minute
757
+ `/update` and `dsh-tui update` give each installer invocation (profile and engine) a **30-minute
733
758
  wall-clock limit**. Set `DSH_TUI_UPDATE_TIMEOUT_MS` to a positive integer in
734
759
  milliseconds to change it (invalid values use the default). Output activity does
735
760
  not reset this deadline; a quiet but healthy installation can use the full limit.
package/bin/dsh-tui.js CHANGED
@@ -28,11 +28,26 @@
28
28
  * `DSH_TUI_LANG` 显式指定时从其值,否则默认中文(同 src/i18n.ts 的缺省)。
29
29
  */
30
30
  import { spawn, spawnSync } from 'node:child_process'
31
- import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync } from 'node:fs'
31
+ import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, writeFileSync } from 'node:fs'
32
32
  import { homedir } from 'node:os'
33
33
  import { dirname, isAbsolute, join, resolve } from 'node:path'
34
34
  import { fileURLToPath, pathToFileURL } from 'node:url'
35
35
 
36
+ // 进程名(issue #1831):Linux 的 ps/top/桌面进程监视器显示的是主线程名
37
+ // (/proc/<pid>/stat 的 comm 字段),Node 启动时把它设成 "MainThread",启动器
38
+ // 这两层进程同样认不出来。写 /proc/self/comm 只改线程名、不动 argv——cmdline
39
+ // 保留入口路径,工具与回归(verify-installed-startup)靠它识别进程;只读 /proc
40
+ // 的环境里静默保持原名。本文件必须零 lib/ 依赖,所以这十行内联,语义与
41
+ // src/utils/processName.ts 一致(两边改动同步)。不带换行:内核原样存字节,
42
+ // comm 里混入换行会让 ps 显示成 dsh-tui? 并弄坏 /proc/<pid>/stat 的字段。
43
+ if (process.platform === 'linux') {
44
+ try {
45
+ writeFileSync('/proc/self/comm', 'dsh-tui')
46
+ } catch {
47
+ // 只读 /proc:保持 Node 的原名。
48
+ }
49
+ }
50
+
36
51
  if (process.platform === 'win32' && process.env.DSH_TUI_STANDALONE_BINARY && process.argv[2] !== 'safe') {
37
52
  try {
38
53
  const oldBinary = `${process.env.DSH_TUI_STANDALONE_BINARY}.old`
@@ -523,7 +538,7 @@ const MSG = {
523
538
  ` run / -p Run one non-interactive DSH task (dst cli --help)\n` +
524
539
  ` cli <command> Independent automation CLI and management commands\n` +
525
540
  ` dsh <argv...> Forward native DSH arguments unchanged\n` +
526
- ` update Update the ${PROFILE} profile to the latest release\n` +
541
+ ` update Align the TUI, dsh engine and global launcher as one set\n` +
527
542
  ` migrate [agent] Import conversations from claude-code/codex/omp/zcode/grok-build (--dry-run to preview)\n` +
528
543
  ` doctor Pre-flight environment checks (dsh/pnpm/profile/key)\n` +
529
544
  ` safe Safe mode: read-only diagnostics, inventory, repair guidance\n` +
@@ -545,7 +560,7 @@ const MSG = {
545
560
  ` run / -p 无界面运行单个 DSH 任务(dst cli --help)\n` +
546
561
  ` cli <命令> 独立自动化 CLI 与管理命令\n` +
547
562
  ` dsh <参数...> 原样转交官方 DSH CLI\n` +
548
- ` update 将 ${PROFILE} profile 升级到最新版本\n` +
563
+ ` update 一次对齐 TUI、dsh 引擎与全局启动器\n` +
549
564
  ` migrate [agent] 迁移 claude-code/codex/omp/zcode/grok-build 的对话(--dry-run 预览)\n` +
550
565
  ` doctor 启动前环境诊断(dsh/pnpm/profile/密钥)\n` +
551
566
  ` safe 安全模式:只读诊断、插件清单与修复指引\n` +
@@ -1498,6 +1513,20 @@ if (subcommand === 'update') {
1498
1513
  process.exit(1)
1499
1514
  }
1500
1515
  }
1516
+ // 本进程就是启动器自己,argv[1] 指向本副本(npm 符号链接经 realpath 落到
1517
+ // bin/dsh-tui.js):cliUpdate 里的对齐逻辑必须按本次 argv[1] 找目标。
1518
+ // 从另一个安装启动的 TUI 里运行本命令时,shell 会继承那个会话的
1519
+ // DSH_TUI_LAUNCHER_*;不覆盖的话 alignGlobalLauncher() 会改写另一个安装
1520
+ // (review R2)。委托分支才需要把本代际写进 env,见下方瘦壳分支。
1521
+ delete process.env.DSH_TUI_LAUNCHER_PATH
1522
+ delete process.env.DSH_TUI_LAUNCHER_VERSION
1523
+ const launcherSelf = process.argv[1]
1524
+ if (launcherSelf !== undefined && launcherSelf !== '') {
1525
+ process.env.DSH_TUI_LAUNCHER_PATH = resolve(launcherSelf)
1526
+ }
1527
+ if (ownVersion !== undefined) {
1528
+ process.env.DSH_TUI_LAUNCHER_VERSION = ownVersion
1529
+ }
1501
1530
  let cliUpdate
1502
1531
  try {
1503
1532
  ;({ cliUpdate } = await import(pathToFileURL(join(profilePkgDir, 'lib', 'types', 'update.js')).href))
@@ -1549,6 +1578,12 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1549
1578
  process.exit(1)
1550
1579
  }
1551
1580
  process.env.DSH_TUI_LAUNCHER_VERSION = ownVersion
1581
+ // 启动器自己的 bin 路径:TUI 进程里的 argv[1] 是 profile 副本,/update
1582
+ // 只能靠这个标记找到要覆写的全局安装(#1844)。与 VERSION 同一处交代。
1583
+ const launcherSelf = process.argv[1]
1584
+ if (launcherSelf !== undefined && launcherSelf !== '') {
1585
+ process.env.DSH_TUI_LAUNCHER_PATH = resolve(launcherSelf)
1586
+ }
1552
1587
  const child = spawn(process.execPath, [profileBin, ...process.argv.slice(2)], {
1553
1588
  stdio: 'inherit',
1554
1589
  env: process.env,
@@ -1708,6 +1743,14 @@ if (!runningInsideProfile && ownVersion !== undefined && process.env.DSH_TUI_NO_
1708
1743
  if (process.env.DSH_TUI_LAUNCHER_VERSION === undefined && ownVersion !== undefined) {
1709
1744
  process.env.DSH_TUI_LAUNCHER_VERSION = ownVersion
1710
1745
  }
1746
+ // 只有本副本是 PATH 上那一个(未被委托)时才交代 bin 路径:委托链里
1747
+ // argv[1] 指向 profile 副本,写进 env 会把 profile 自己当成全局安装。
1748
+ if (!runningInsideProfile && process.env.DSH_TUI_LAUNCHER_PATH === undefined) {
1749
+ const launcherSelf = process.argv[1]
1750
+ if (launcherSelf !== undefined && launcherSelf !== '') {
1751
+ process.env.DSH_TUI_LAUNCHER_PATH = resolve(launcherSelf)
1752
+ }
1753
+ }
1711
1754
 
1712
1755
  // DSH consumes its own --; only the app tail belongs behind it. Preserve
1713
1756
  // the app-level separator too, and replay this same argv on a safe retry.
@@ -200,11 +200,11 @@ changes during a turn apply to the next one, not to reasoning already in progres
200
200
  | `Esc` / `Ctrl+C` | Dismiss the focused panel or interrupt. Cancelling a blocking question interrupts its turn; dismissing an async question only closes that question |
201
201
  | `/review` | Review uncommitted changes inline; requires idle state and consumes model usage |
202
202
  | `/review base <branch>` / `/review commit <sha>` | Review against a branch or commit; other arguments are custom review instructions |
203
- | `/diff` | Latest turn’s aggregated diff; otherwise try Git diff against the remote, then show an empty-state notice |
203
+ | `/diff` | Latest turn’s aggregated diff; otherwise try Git diff against the remote, then show an empty-state notice. Output is shown line by line and truncated with a notice past 200 lines; tabs and trailing whitespace are normalized for display |
204
204
  | `/<skill-name> [arguments]` | Invoke a discovered, enabled Codex skill; completion updates as skills change. Local commands take precedence on name collisions |
205
205
  | `/init` | Submit Codex’s AGENTS.md initialization prompt, not the DSH template generator; a model turn with normal approvals/usage |
206
206
  | `/mcp` | Codex MCP status and tool counts, with reconnect but no runtime toggle |
207
- | `/usage` | Server-reported quota windows, utilization, reset times and credits; relays may not provide them |
207
+ | `/usage` | Server-reported quota windows, utilization, reset times and credits, one row per window; relays may not provide them |
208
208
  | `/status`, `/context`, `/compact` | Status, raw context readings, Codex compaction; unavailable category details are not invented |
209
209
  | `/new`, `/clear`, `/export` | New thread, clear the view only, export the current transcript. `/clear` **does not reset context** |
210
210
  | `!cmd` / `!!cmd` | dsh-TUI’s local shell / include output in a follow-up, not a verbatim copy of the official `!` persistence semantics |
@@ -162,11 +162,11 @@ Chat Completions 端点当作 Responses 使用。通过 `/channel` 选择/新建
162
162
  | `Esc` / `Ctrl+C` | 按当前焦点关闭面板或中断;取消阻塞提问会中断相应回合,取消异步提问只关闭该题 |
163
163
  | `/review` | 审查未提交改动,结果 inline 展示;需要空闲,消耗模型用量 |
164
164
  | `/review base <branch>` / `/review commit <sha>` | 按分支基线或提交审查;其他参数作为自定义审查说明 |
165
- | `/diff` | 最近回合的聚合 diff;没有时尝试相对远端的 Git diff,再无内容则提示 |
165
+ | `/diff` | 最近回合的聚合 diff;没有时尝试相对远端的 Git diff,再无内容则提示。输出逐行显示,超过 200 行时截断并标明;制表符与行尾空白按渲染需要归一 |
166
166
  | `/<skill-name> [参数]` | 使用 Codex 发现且启用的 skill;补全随 skills 变化刷新,本地同名命令优先 |
167
167
  | `/init` | 提交 Codex 的 AGENTS.md 初始化提示,不走 DSH 的模板生成器;这是模型回合,仍需审批/用量 |
168
168
  | `/mcp` | 查看 Codex MCP 服务器状态与工具数,支持 reconnect,不提供运行时 toggle |
169
- | `/usage` | 服务端额度窗口、使用百分比、重置时间与 credits;中转站可能不提供 |
169
+ | `/usage` | 服务端额度窗口、使用百分比、重置时间与 credits,每个窗口一行;中转站可能不提供 |
170
170
  | `/status`、`/context`、`/compact` | 状态、上下文原始读数、Codex 压缩;没有分类明细时不会编造 |
171
171
  | `/new`、`/clear`、`/export` | 新 thread、仅清视图、导出当前转录;`/clear` **不重置上下文** |
172
172
  | `!cmd` / `!!cmd` | dsh-TUI 的本地 shell / 把输出作为后续消息带入上下文;不是直接照搬官方 `!` 的持久化语义 |
@@ -407,13 +407,18 @@ for the complete field reference.
407
407
  | `DSH_TUI_DISABLE_MOUSE` | Temporarily disable mouse handling in fullscreen mode |
408
408
  | `DSH_TUI_PROGRAM_STATUS` | Set to `0` (or `false`/`no`/`off`) to stop reporting session state to the terminal with [OSC 7501](https://www.superlogical.com/rex/docs/build/program-status); on by default and a no-op on terminals that do not implement it |
409
409
  | `DSH_TUI_DISABLE_TERMINAL_IMAGES` | Set to `1` to force Kitty/Sixel probing, preview reads/decoding, and terminal image rendering off, overriding config and /settings; text metadata remains visible |
410
+ | `DSH_TUI_FORCE_EXTENDED_KEYS` | Set to `1` (or `true`/`yes`/`on`) to send the extended-key enable sequence (`CSI >1u` / `CSI >4;2m`) for a terminal missing from the built-in allowlist. Only useful for a terminal that actually implements the protocol: one that ignores the sequence is unchanged, while one that honors the enable but emits codepoints the parser does not handle turns keys into unbound forms — turn it back off if keys stop working |
411
+ | `DSH_TUI_DISABLE_EXTENDED_KEYS` | Set to `1` (or `true`/`yes`/`on`) to skip extended keys even for an allowlisted terminal, for SSH or nested xterm.js hosts that rewrite input; wins when both switches are set |
410
412
  | `DSH_TUI_IMAGE_PROTOCOL` | `auto` (default), `kitty`, `sixel`, or `none`; override protocol selection without bypassing the preview preference, disable switch, non-fullscreen, accessibility or multiplexer guards |
411
413
  | `DSH_TUI_RESUME_SESSION` | Resume a session at startup, normally set by a launcher |
412
414
  | `DSH_TUI_RESUME_BACKEND` | The backend `DSH_TUI_RESUME_SESSION` was read from; set only when the launcher **derived** the target (a bare `--resume` reading that backend's last session, or the safe-mode retry following the last-run record). When the boot lands on another backend — an uninstalled id falling back to `dsh`, or the remembered kernel when `DSH_TUI_BACKEND` is absent — that target **refuses with a non-zero exit**: never carried across, never a silent cold start, never a new session (the safe-mode retry is the one exception, degrading to a warning plus a cold start). An id the user passed explicitly carries no mark and is handed over as it is |
413
415
  | `DSH_TUI_RESUME_RETRY` | One-shot marker: this boot is safe mode's "retry normal startup". A retry derives its target from the last-run record, whose backend may no longer be registered, so a launch carrying this marker degrades a revoked resume target to a warning plus a cold start instead of failing. The boot deletes it from `process.env` as soon as it reads it |
414
- | `DSH_TUI_HELD_INPUTS` | The queued-message file a `/restart` hands its replacement (`~/.dsh-tui/held-inputs-<pid>-<random>.json`); the replacement removes the variable from `process.env` at boot and deletes the file once the texts are back as held messages (a replacement that exits before that leaves it). It appears in the printed resume command when a restart stalls or fails to start (on Windows in the PowerShell form `$env:DSH_TUI_HELD_INPUTS='…'; …`); a file nobody resumed within 7 days is removed at a later launch |
416
+ | `DSH_TUI_HELD_INPUTS` | The queued-message file a `/restart` hands its replacement (`~/.dsh-tui/held-inputs-<pid>-<random>.json`); the replacement removes the variable from `process.env` at boot and deletes the file once the texts and their images are back as held messages (a replacement that exits before that leaves it). It appears in the printed resume command when a restart stalls or fails to start (on Windows in the PowerShell form `$env:DSH_TUI_HELD_INPUTS='…'; …`); a file nobody resumed within 7 days is removed at a later launch |
415
417
  | `DSH_TUI_BACKEND` | Session backend (built-in `dsh` / `claude` / `codex`, or an installed plugin backend), normally set by `dsh-tui --backend`; an uninstalled or misspelled id starts on `dsh` with a warning (with a resume request in play it refuses instead, see above) |
416
418
  | `DSH_TUI_HOST_ENTRY` | Set to `0` to start both kernels through `dsh --profile` (by default both start from the package's own entry). When the entry cannot use the installed dsh (the `dsh` on `PATH` is not `@deepseek-ai/dsh`, its launcher script cannot be followed, or a module or export it needs is missing), a DSH launch falls back to `dsh --profile` by itself and says why in the terminal and on screen |
419
+ | `DSH_TUI_UPDATE_LAUNCHER` | Set to `0` to skip global-launcher alignment in `/update` and `dsh-tui update` (pinned launchers, or when diagnosing an alignment failure); enabled by default |
420
+ | `DSH_TUI_UPDATE_ENGINE` | Set to `0` to skip the automatic global dsh engine install/upgrade in `/update` and `dsh-tui update` (pinned engines). A TUI upgrade whose peer range does not support the current engine is still refused: a below-range engine with a proven install gets the upgrade-first command (an unavailable install gets repair guidance instead), while an above-range engine waits for a dsh-tui release that declares it (no downgrade, no install command) |
421
+ | `DSH_TUI_DSH_PM` | `npm` or `pnpm`, overriding how the global dsh install is classified (abnormal prefixes, diagnosis). A layout that is not recognized is still never written to by guesswork. A pnpm layout must also prove that its install group contains only `dsh`; otherwise it gets `pnpm list -g --depth 0` inspection guidance instead of a one-package command that would replace the whole group |
417
422
  | `DSH_TUI_CLAUDE_PERMISSION_MODE` | Start permission mode of the Claude backend (`default`/`acceptEdits`/`plan`/`dontAsk`/`bypassPermissions`); wins over the mode `/permission` remembered |
418
423
  | `DSH_TUI_WORKSPACE_TARGET` | Workspace path or URI resolved at startup, normally set by `dsh-tui <target>` |
419
424
  | `DSH_TUI_SESSION_ROOT` | Override the JSONL session root; profile default `$DSH_HOME/sessions`, bare `cordis.yml` default `~/.dsh-tui/sessions` |
@@ -477,7 +482,7 @@ The `/provider` add branch signs in to ChatGPT/Codex (`openai-codex`), Claude
477
482
  (`anthropic`), or Grok (`xai`) subscriptions. When the installed host's pi-ai
478
483
  catalog ships the corresponding flows, it also offers OpenAI direct ChatGPT sign-in
479
484
  (`openai`, using the OpenAI API rather than the legacy Codex backend) and Meta
480
- Muse (`meta`). The primary validated DSH `0.2.1-rc.5` development fixture resolves pi-ai
485
+ Muse (`meta`). The primary validated DSH `0.2.2-rc.1` development fixture resolves pi-ai
481
486
  `1.2.0`, which includes Meta Muse and OpenAI direct sign-in.
482
487
  `/auth status`, `/auth login [provider]`, and `/auth logout <provider>` use
483
488
  that credential store for these pi-ai routes. Browser authorization tries to open the page
@@ -358,13 +358,18 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
358
358
  | `DSH_TUI_DISABLE_MOUSE` | 在 fullscreen 模式临时关闭鼠标处理 |
359
359
  | `DSH_TUI_PROGRAM_STATUS` | 设为 `0`(或 `false`/`no`/`off`)可停止用 [OSC 7501](https://www.superlogical.com/rex/docs/build/program-status) 向终端报告会话状态;默认开启,未实现该协议的终端上无副作用 |
360
360
  | `DSH_TUI_DISABLE_TERMINAL_IMAGES` | 设为 `1` 时强制关闭 Kitty/Sixel 探测、预览读取/解码与终端图片渲染,优先于 config 和 /settings;保留文字信息 |
361
+ | `DSH_TUI_FORCE_EXTENDED_KEYS` | 设为 `1`(或 `true`/`yes`/`on`)时让不在内建白名单里的终端也发送扩展键开启序列(`CSI >1u` / `CSI >4;2m`)。只对确实实现了协议的终端有意义:忽略该序列的终端行为不变,而响应了开启序列却发出解析器不认识的码位的终端会让按键变成未绑定形式——试过不对就关掉 |
362
+ | `DSH_TUI_DISABLE_EXTENDED_KEYS` | 设为 `1`(或 `true`/`yes`/`on`)时对白名单内的终端也停用扩展键,用于 SSH、嵌套 xterm.js 等会重写输入的场合;与 `DSH_TUI_FORCE_EXTENDED_KEYS` 同时设置时以本项为准 |
361
363
  | `DSH_TUI_IMAGE_PROTOCOL` | `auto`(默认)、`kitty`、`sixel` 或 `none`;覆盖协议选择,但不绕过图片预览偏好、禁用开关、非全屏、无障碍和多路复用器限制 |
362
364
  | `DSH_TUI_RESUME_SESSION` | 启动时恢复指定会话,通常由启动器设置 |
363
365
  | `DSH_TUI_RESUME_BACKEND` | `DSH_TUI_RESUME_SESSION` 的来源后端,只在启动器**派生**恢复目标时(裸 `--resume` 读该后端的上次会话、安全模式重试按最后运行记录)设置;boot 若落在别的后端(未装的 id 回落 `dsh`、没给 `DSH_TUI_BACKEND` 时跟随记住的内核),该目标一律**明确报错并非零退出**——不跨后端恢复、不静默冷启动、不新建会话(安全模式重试是唯一例外,降级为告警 + 冷启动)。用户显式给出的 id 不带此标记、原样透传 |
364
366
  | `DSH_TUI_RESUME_RETRY` | 一次性标记:本次启动是安全模式的「重试正常启动」。重试的目标派生自最后运行记录,记录里的内核可能已经不在注册表里,所以带此标记的那次启动在恢复目标被撤销时降级为告警 + 冷启动,而不是报错退出。boot 读到即从 `process.env` 删除 |
365
- | `DSH_TUI_HELD_INPUTS` | `/restart` 交给替身进程的排队消息文件(`~/.dsh-tui/held-inputs-<pid>-<random>.json`),替身启动时把其中的文字作为暂存消息放回、启动时从 `process.env` 移除,放回为暂存消息后删除文件(就绪前退出则文件保留);重启卡住或启动失败时会出现在打印的恢复命令里(Windows 上是 PowerShell 形式 `$env:DSH_TUI_HELD_INPUTS='…'; …`),超过 7 天没人恢复的文件会在之后某次启动时清理 |
367
+ | `DSH_TUI_HELD_INPUTS` | `/restart` 交给替身进程的排队消息文件(`~/.dsh-tui/held-inputs-<pid>-<random>.json`),替身启动时把其中的文字和图片作为暂存消息放回、启动时从 `process.env` 移除,放回为暂存消息后删除文件(就绪前退出则文件保留);重启卡住或启动失败时会出现在打印的恢复命令里(Windows 上是 PowerShell 形式 `$env:DSH_TUI_HELD_INPUTS='…'; …`),超过 7 天没人恢复的文件会在之后某次启动时清理 |
366
368
  | `DSH_TUI_BACKEND` | 会话后端(内置 `dsh` / `claude` / `codex`,或已装的插件后端),通常由 `dsh-tui --backend` 设置;未安装或写错的 id 按 `dsh` 启动并告警(若同时带了 `--resume` 请求则改为报错退出,见上) |
367
369
  | `DSH_TUI_HOST_ENTRY` | 设为 `0` 时两个内核都经 `dsh --profile` 启动(默认两个内核都从本包入口启动)。入口用不了已安装的 dsh(`PATH` 上的 `dsh` 不是 `@deepseek-ai/dsh`、启动脚本跟不进去、所需模块或导出缺失)时,DSH 启动自动回退到 `dsh --profile`,并在终端与界面里说明原因 |
370
+ | `DSH_TUI_UPDATE_LAUNCHER` | 设为 `0` 时 `/update` 与 `dsh-tui update` 跳过全局启动器对齐(钉住启动器、或排查对齐失败时用);默认开启 |
371
+ | `DSH_TUI_UPDATE_ENGINE` | 设为 `0` 时 `/update` 与 `dsh-tui update` 跳过全局 dsh 引擎的自动安装与升级(钉住引擎时用);若新 TUI 的 peer 范围不支持当前引擎,升级仍会被拒绝:当前引擎**低于**范围且安装可自动执行时附引擎升级命令(安装不可自动执行时给修复指引),**高于**范围时只提示等声明支持该引擎的 dsh-tui 发布(不降级、不打印安装命令) |
372
+ | `DSH_TUI_DSH_PM` | `npm` 或 `pnpm`,覆盖 dsh 全局安装形态的判定(异常前缀、诊断时用);无法识别的布局仍不会被猜着写入。pnpm 布局还要求能证明所属安装组只含 `dsh`,否则只给 `pnpm list -g --depth 0` 检查指引,不用单包命令替换整组 |
368
373
  | `DSH_TUI_CLAUDE_PERMISSION_MODE` | Claude 后端的起始权限模式(`default`/`acceptEdits`/`plan`/`dontAsk`/`bypassPermissions`),优先于 `/permission` 记住的选择 |
369
374
  | `DSH_TUI_WORKSPACE_TARGET` | 启动时解析的工作区路径或 URI,通常由 `dsh-tui <目标>` 设置 |
370
375
  | `DSH_TUI_SESSION_ROOT` | 覆盖 JSONL 会话根目录;profile 默认 `$DSH_HOME/sessions`,裸 `cordis.yml` 默认 `~/.dsh-tui/sessions` |
@@ -416,7 +421,7 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
416
421
  `dsh-auth` 插件包**。`/provider` 的添加分支提供 ChatGPT/Codex(`openai-codex`)、
417
422
  Claude(`anthropic`)、Grok(`xai`)订阅账号登录。宿主 pi-ai catalog 提供相应流程
418
423
  时还可使用 OpenAI 直连 ChatGPT 登录(`openai`,使用 OpenAI API 而非旧版 Codex
419
- 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.1-rc.5` 的开发依赖解析到 pi-ai
424
+ 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.2-rc.1` 的开发依赖解析到 pi-ai
420
425
  `1.2.0`,包含 Meta Muse 与 OpenAI 直连登录。`/auth status`、`/auth login [provider]`、
421
426
  `/auth logout <provider>` 对这些 pi-ai 路由操作同一套凭据。浏览器授权会尝试自动打开页面,并在同一
422
427
  问卷中提供授权链接与手动粘贴回调 URL/代码的输入;设备码流程在轮询期间显示可复制的
@@ -142,7 +142,7 @@ the same commands:
142
142
 
143
143
  | Command | Purpose |
144
144
  | --- | --- |
145
- | `dsh-tui update` | Update the profile to the latest release and align the launcher (same install logic as the in-TUI `/update`, without restarting into the TUI) |
145
+ | `dsh-tui update` | Align the whole set (profile TUI, global dsh engine, global launcher) and verify it, without entering or restarting the TUI; same decision as the in-TUI `/update` |
146
146
  | `dsh-tui doctor` | Environment checks: dsh/pnpm, profile install and version alignment, whether the API key is set (state only, never the value), config file presence; complements the in-TUI `/doctor` session diagnostics |
147
147
  | `dsh-tui safe` | Safe mode: read-only diagnostics, inventory, repair guidance (`safe --rescue` also creates/verifies the clean rescue profile) |
148
148
  | `dsh-tui version` | Show the launcher and profile versions (`--version`/`-v` are equivalent) |
@@ -215,19 +215,162 @@ diagnostics, a profile plugin inventory, and repair guidance.
215
215
 
216
216
  ## Update to the latest version
217
217
 
218
- The project moves fast. Updating reuses the install command with an explicit
219
- `@latest`:
218
+ The project moves fast. One `/update` (or `dsh-tui update`) aligns **one
219
+ mutually compatible set** across three layers and verifies it; the in-TUI
220
+ `/update` then restarts and resumes the session, while `dsh-tui update` only
221
+ aligns — it neither enters nor restarts the TUI:
222
+
223
+ 1. **The TUI inside the profile**: `dsh plugin --profile dsh-tui update @deepseek-harness-tui/dsh-tui@<version>`.
224
+ 2. **The global `dsh` engine**: the highest version published on the registry
225
+ inside the target TUI's `dsh-app-boot` peer range, installed into the **same
226
+ global prefix** with the detected package manager (npm `--prefix` /
227
+ `pnpm add -g`). pnpm is auto-updated only when its owning install group is
228
+ proven to contain `dsh` alone: a one-package `pnpm add -g` replaces the whole
229
+ group and removes its other commands, so multi-member groups, shared-store
230
+ installs and unprovable homes are left untouched with `pnpm list -g --depth 0`
231
+ inspection guidance.
232
+ 3. **The global `dsh-tui` launcher**: file-by-file atomic replacement for npm
233
+ layouts (`bin/dsh-tui.js` and `package.json` are separate renames, so a
234
+ failure between them leaves only the first replaced); `pnpm add -g` for pnpm
235
+ layouts only when the group is proven to contain just the launcher, with
236
+ multi-member or unprovable groups left untouched (details below).
237
+
238
+ The order is fixed — TUI → engine → launcher. A failed TUI install leaves the
239
+ engine untouched, so the old pair normally still boots; a timeout or
240
+ cancellation can leave a half-installed profile, though (see "Bounded update
241
+ installation" below), and the failure notice prints the recovery command. A
242
+ failed engine install keeps the update restartable while the current pair is
243
+ still inside the new TUI's range, and prints the engine repair command. When the
244
+ engine step cannot be automated at all (unproven pnpm group, unwritable prefix,
245
+ unrecognised layout, unreachable registry), the update still continues while
246
+ the current engine is inside the range, but the reason (with a manual command
247
+ when one is available) is reported and `dsh-tui update` exits non-zero instead
248
+ of claiming a whole-set success. **Launcher alignment is normally best effort,
249
+ but a failure after the engine advances blocks the restart** and prints the
250
+ manual repair command: an old launcher in the same npm prefix may keep the new
251
+ engine from loading the updated profile. When the engine did not advance, a
252
+ launcher failure remains a warning and does not block the restart.
253
+ **Never downgrade**: an engine or launcher ahead of the target is left alone and
254
+ reported as drift at boot and by `/update`.
255
+ There are two refusals. When the preflight sees "the TUI must move, but the
256
+ current engine is outside the new TUI's peer range", nothing is torn down and
257
+ nothing restarts: the official plugin manager validates the new TUI against the
258
+ dsh that is RUNNING, and the engine step runs after the TUI. A **below-range**
259
+ engine that can be upgraded automatically must be aligned first and `/update`
260
+ rerun (the refusal prints that command); an engine **above** the range (newer
261
+ than this TUI validates) is never downgraded and never paired with an
262
+ unvalidated TUI — the refusal only asks to wait for a dsh-tui release that
263
+ declares it, with no install command. When the preflight passes but the engine
264
+ step fails only after the TUI moved (the version did not advance, or the old
265
+ engine is no longer loadable), the new TUI is kept and only the restart is
266
+ refused. "The old engine is still loadable"
267
+ needs positive proof — its `bin.dsh` entry starts in a fresh process and
268
+ `--version` exits 0, or `dsh --version` runs — an existing entry file or a
269
+ readable manifest is not enough. On POSIX, if pnpm keeps the old store tree
270
+ behind a shared runtime fallback link, that link is atomically refreshed only
271
+ when the new entry belongs to the same pnpm home, matches the target version
272
+ and passes the startup probe; both the profile link and PATH are then verified.
273
+ The profile's own dependencies, real directories and links to other installs
274
+ are left untouched. Windows does not attempt a non-atomic junction replacement:
275
+ the old link and unverified result remain, requiring manual inspection and
276
+ recreation of the shared fallback link. A preflight refusal writes the current
277
+ version, target range and next step (with the manual command when one can run)
278
+ into the transcript; when the engine step fails only after the TUI was torn
279
+ down, the same details go to the terminal's stderr (`dsh-tui update` writes
280
+ stderr too). The toast stays a short pointer. A preflight refusal also names its
281
+ next step: an engine below the required range but installable is upgraded first
282
+ (and `/update` rerun afterwards), an engine above the range waits for a TUI
283
+ release that declares it (no downgrade/install), an unreachable registry is a
284
+ retry (not a compatibility verdict), a
285
+ dsh release missing from the declared range is a wait (no impossible install
286
+ command is printed), `DSH_TUI_UPDATE_ENGINE=0` is a switch to drop, and an
287
+ unrecognised/unwritable/ambiguous global install is a repair. When the TUI is
288
+ already current and the registry has a newer dsh outside that TUI's declared
289
+ peer range, `/update` says it is waiting for a dsh-tui release instead of
290
+ silently stopping at the validated line or installing an unvalidated engine.
291
+ After pnpm rotates a global install group, a direct DSH launch re-resolves and
292
+ probes its actual JS entry while preserving host options such as `--profile`
293
+ and `--patch`. An unproven entry refuses the restart and prints the repair
294
+ command instead of executing a deleted path in the old group.
295
+
296
+ Manual fallbacks (the refusal names the matching layout command when one can
297
+ run; an above-range engine only asks you to wait for a TUI release and never to
298
+ downgrade; for an unpublished release it only asks you to wait):
220
299
 
221
300
  ```sh
301
+ # TUI only
222
302
  dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest
303
+ # engine
304
+ npm install -g @deepseek-ai/dsh@0.2.2-rc.1
305
+ # or, for a pnpm global layout (first confirm the global group holds dsh
306
+ # alone; a one-package install replaces the whole group and its other commands):
307
+ pnpm add -g @deepseek-ai/dsh@0.2.2-rc.1
308
+ # global launcher
309
+ npm install -g --legacy-peer-deps @deepseek-harness-tui/dsh-tui@latest
310
+ # or, only after confirming the pnpm global group contains this package alone:
311
+ pnpm add -g --config.auto-install-peers=false @deepseek-harness-tui/dsh-tui@latest
223
312
  ```
224
313
 
314
+ When you launch through the global `dsh-tui` command, the launcher is aligned
315
+ automatically after a successful `/update`, and only against a global install it
316
+ can prove: an npm global install is replaced file by file, each write atomic on
317
+ its own (`bin/dsh-tui.js` and `package.json` are separate renames, so a failure
318
+ between them leaves only the first replaced; the launcher step reports that
319
+ failure and blocks the restart if the engine advanced; otherwise it remains
320
+ restartable), and it needs a matching global bin link or shim — project-local
321
+ npm/npx installs are never overwritten. A pnpm global
322
+ install goes through `pnpm add -g` only when its group is proven to contain just
323
+ the launcher, never through the store's symlinks. pnpm 11+ isolates packages
324
+ installed together into a group; recreating a multi-member group can lose other
325
+ tools' required peers even when their direct versions stay unchanged, so such
326
+ groups, and groups that cannot be proven, are left untouched with guidance to
327
+ inspect and preserve their dependencies rather than reinstalled automatically.
328
+ An undetermined install shape is also left untouched, leaving only the boot-time
329
+ notice. For older launchers carrying only a version marker, `dsh-tui` and `dst`
330
+ must not resolve to different installations on PATH. A pnpm logical group or
331
+ owning shim takes precedence over an inherited `PNPM_HOME`; the location of a
332
+ shared store is not ownership evidence. A failed alignment step prints a manual
333
+ install command only when that command is known to be safe.
334
+
335
+ Escape hatches: `DSH_TUI_UPDATE_ENGINE=0` skips the automatic engine install
336
+ (with a pinned engine, a TUI upgrade that no longer supports it is still
337
+ refused); `DSH_TUI_UPDATE_LAUNCHER=0` skips launcher alignment;
338
+ `DSH_TUI_DSH_PM=npm|pnpm` overrides package-manager detection (for diagnosing
339
+ an abnormal prefix).
340
+
225
341
  - Without `@latest`, pnpm resolves within the version range already recorded
226
342
  in the profile's `package.json` (for example `^0.1.4`), so it may stay on an
227
343
  old line. That is the usual reason "re-running the install command" appears
228
344
  to change nothing.
345
+ - To repair a version mismatch, prefer the **exact-version** command from the
346
+ refusal/failure notice (for example
347
+ `npm install -g @deepseek-harness-tui/dsh-tui@0.8.3`); use `@latest` only for
348
+ routine upgrades — it may be newer than the profile and stay misaligned.
349
+ - pnpm 11+ global installs are grouped: a one-package `pnpm add -g` replaces the
350
+ whole group and removes its other tools. `/update` never recreates multi-member
351
+ groups; even re-adding every direct version can lose their auto-installed peers.
352
+ Run `pnpm list -g --depth 0` to inspect the group, and preserve every member and
353
+ its installed peers before a manual repair. Use a separate global prefix when
354
+ reinstalling the launcher alone. Do not apply the single-package command above
355
+ to a multi-member group or use `pnpm update -g --latest` (it upgrades every
356
+ member to latest).
357
+ - A pnpm global alignment has two preconditions. It works without an exported
358
+ `PNPM_HOME` — the home is derived from the shim's own directory (`<PNPM_HOME>`
359
+ or `<PNPM_HOME>/bin`) and only accepted when that group provably owns this
360
+ package. And the launcher-only group install resolves **no peers**: every
361
+ `@deepseek-ai/*` package is provided by the profile at runtime, while pnpm's
362
+ peer auto-install follows their peer ranges onto an **unpublished stable
363
+ line** and fails with `ERR_PNPM_NO_MATCHING_VERSION`, so both the alignment
364
+ and the manual command above pass `--config.auto-install-peers=false` — the
365
+ same intent as npm's `--legacy-peer-deps`.
366
+ - pnpm ≥11 refuses versions published within 24 hours (`minimumReleaseAge`).
367
+ `/update` and `dsh-tui update` waive that window for the engine and launcher
368
+ steps (`PNPM_CONFIG_MINIMUM_RELEASE_AGE=0`); add the same prefix when running
369
+ the `pnpm add -g` lines above by hand, or a just-published version will not
370
+ install.
229
371
  - To confirm: the startup banner shows the running version
230
- (`✦ dsh-TUI vX.Y.Z`).
372
+ (`✦ dsh-TUI vX.Y.Z`), and the post-restart `DSH_TUI_UPDATED_FROM` /
373
+ `DSH_TUI_UPDATED_DSH_FROM` checks verify each layer actually advanced.
231
374
  - Your `cordis.patch.yml` override layer survives updates untouched.
232
375
  - Session storage may move between versions (since 0.3.7, `/resume` uses the
233
376
  JSONL session store shared with dsh web), so older sessions missing from the
@@ -452,3 +595,24 @@ Run `/doctor`, record the terminal and mode, then consult
452
595
  [Architecture and limitations](architecture.en.md). `DSH_TUI_RENDER_LOG` can
453
596
  capture raw frames for rendering bugs, but those frames may contain visible
454
597
  conversation content and should be handled as sensitive data.
598
+
599
+ ### Git fails throughout a session under Orca (`unable to parse command-line config`)
600
+
601
+ Orca injects git's indexed-config protocol into the agent terminal —
602
+ `GIT_CONFIG_COUNT` plus `GIT_CONFIG_KEY_n` / `GIT_CONFIG_VALUE_n` — to turn off
603
+ credential-manager popups. The engine strips credential-shaped variables **by
604
+ name** (`/KEY|PASSWORD|SECRET|TOKEN/i`) when it spawns children, so every
605
+ `GIT_CONFIG_KEY_n` is dropped while `GIT_CONFIG_COUNT` and
606
+ `GIT_CONFIG_VALUE_n` survive; git receives a broken triple and every command
607
+ fails with `fatal: unable to parse command-line config` (exit 128).
608
+
609
+ The root cause is the engine package's `scrubbedParentEnv()`, not dsh-tui (issue
610
+ #1811). To work around it, drop `GIT_CONFIG_COUNT` before launching dsh-tui —
611
+ without it git ignores the orphaned `KEY`/`VALUE` entries:
612
+
613
+ ```sh
614
+ env -u GIT_CONFIG_COUNT dsh-tui
615
+ ```
616
+
617
+ The trade-off is losing Orca's credential-popup suppression; use
618
+ `GIT_TERMINAL_PROMPT=0` when you need non-interactive credentials instead.