@deepseek-harness-tui/dsh-tui 0.20.0 → 0.20.2

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 (180) hide show
  1. package/README.md +18 -3
  2. package/bin/dsh-tui.js +26 -8
  3. package/guide/dsh-tui-guide/claude-backend.en.md +6 -5
  4. package/guide/dsh-tui-guide/claude-backend.md +5 -5
  5. package/guide/dsh-tui-guide/configuration.en.md +26 -12
  6. package/guide/dsh-tui-guide/configuration.md +18 -9
  7. package/guide/dsh-tui-guide/getting-started.en.md +17 -9
  8. package/guide/dsh-tui-guide/getting-started.md +11 -7
  9. package/guide/dsh-tui-guide/interaction.en.md +1 -0
  10. package/guide/dsh-tui-guide/interaction.md +1 -0
  11. package/guide/dsh-tui-guide/migrate.en.md +5 -0
  12. package/guide/dsh-tui-guide/migrate.md +4 -0
  13. package/guide/dsh-tui-guide/plugins.en.md +17 -1
  14. package/guide/dsh-tui-guide/plugins.md +12 -1
  15. package/guide/dsh-tui-guide/themes.en.md +1 -1
  16. package/guide/dsh-tui-guide/themes.md +1 -1
  17. package/guide/dsh-tui-guide/user-guide.en.md +8 -2
  18. package/guide/dsh-tui-guide/user-guide.md +8 -2
  19. package/lib/settings.json +19 -3
  20. package/lib/types/adapter/kernel/host-facade.d.ts +3 -1
  21. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
  22. package/lib/types/adapter/kernel/host-facade.js +6 -0
  23. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
  24. package/lib/types/adapter/kernel/runtime.js +5 -0
  25. package/lib/types/adapter/kernel/slices/extensions.d.ts +1 -0
  26. package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -1
  27. package/lib/types/adapter/kernel/slices/extensions.js +6 -1
  28. package/lib/types/adapter/kernel/slices/index.d.ts +1 -1
  29. package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -1
  30. package/lib/types/adapter/kernel/slices/index.js +3 -2
  31. package/lib/types/adapter/ports/channel-catalog.d.ts +19 -0
  32. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
  33. package/lib/types/adapter/ports/channel-settings.d.ts +6 -0
  34. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  35. package/lib/types/adapter/ports/channel-view.d.ts +28 -2
  36. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  37. package/lib/types/adapter/ports/extensions.d.ts +9 -0
  38. package/lib/types/adapter/ports/extensions.d.ts.map +1 -1
  39. package/lib/types/adapter/ports/index.d.ts +1 -1
  40. package/lib/types/adapter/ports/index.d.ts.map +1 -1
  41. package/lib/types/adapter/upstream/extensions-driver.d.ts +4 -1
  42. package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -1
  43. package/lib/types/adapter/upstream/extensions-driver.js +111 -1
  44. package/lib/types/adapter/upstream/index.d.ts +1 -1
  45. package/lib/types/adapter/upstream/index.d.ts.map +1 -1
  46. package/lib/types/adapter/upstream/index.js +1 -1
  47. package/lib/types/api.d.ts +1 -1
  48. package/lib/types/api.d.ts.map +1 -1
  49. package/lib/types/backends/claude/backend.d.ts.map +1 -1
  50. package/lib/types/backends/claude/backend.js +7 -2
  51. package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -1
  52. package/lib/types/backends/claude/session/lifecycle.js +11 -9
  53. package/lib/types/backends/claude/side-query.d.ts +2 -0
  54. package/lib/types/backends/claude/side-query.d.ts.map +1 -1
  55. package/lib/types/backends/claude/side-query.js +30 -13
  56. package/lib/types/components/FileSuggestions.d.ts +2 -2
  57. package/lib/types/components/FileSuggestions.d.ts.map +1 -1
  58. package/lib/types/components/FileSuggestions.js +25 -5
  59. package/lib/types/components/PromptInput.d.ts +7 -1
  60. package/lib/types/components/PromptInput.d.ts.map +1 -1
  61. package/lib/types/components/PromptInput.js +81 -23
  62. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +1 -1
  63. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  64. package/lib/types/components/messages/AssistantToolUseMessage.js +228 -27
  65. package/lib/types/components/messages/presentCardBackground.d.ts +28 -0
  66. package/lib/types/components/messages/presentCardBackground.d.ts.map +1 -0
  67. package/lib/types/components/messages/presentCardBackground.js +23 -0
  68. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  69. package/lib/types/dsh-adapter/backend/translate.js +28 -1
  70. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  71. package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
  72. package/lib/types/dsh-adapter/channel/file-actions.d.ts +1 -1
  73. package/lib/types/dsh-adapter/channel/file-actions.d.ts.map +1 -1
  74. package/lib/types/dsh-adapter/channel/file-actions.js +11 -4
  75. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  76. package/lib/types/dsh-adapter/channel/settings-host.js +78 -12
  77. package/lib/types/dsh-adapter/channel/state.d.ts +4 -3
  78. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  79. package/lib/types/dsh-adapter/channel/state.js +4 -3
  80. package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
  81. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  82. package/lib/types/dsh-adapter/channel.d.ts +1 -1
  83. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  84. package/lib/types/dsh-adapter/childStderr.d.ts +1 -1
  85. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
  86. package/lib/types/dsh-adapter/childStderr.js +5 -0
  87. package/lib/types/dsh-adapter/contract.d.ts +23 -8
  88. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  89. package/lib/types/dsh-adapter/contract.js +27 -7
  90. package/lib/types/dsh-adapter/extensions.d.ts +3 -2
  91. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
  92. package/lib/types/dsh-adapter/extensions.js +5 -2
  93. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  94. package/lib/types/dsh-adapter/host-contract.js +1 -1
  95. package/lib/types/dsh-adapter/host-dsh.d.ts +4 -0
  96. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  97. package/lib/types/dsh-adapter/host-dsh.js +26 -0
  98. package/lib/types/dsh-adapter/host-entry.js +4 -2
  99. package/lib/types/dsh-adapter/host-service-diagnostics.d.ts +61 -0
  100. package/lib/types/dsh-adapter/host-service-diagnostics.d.ts.map +1 -0
  101. package/lib/types/dsh-adapter/host-service-diagnostics.js +103 -0
  102. package/lib/types/dsh-adapter/index.d.ts +5 -0
  103. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  104. package/lib/types/dsh-adapter/index.js +1 -0
  105. package/lib/types/dsh-adapter/mention-providers.d.ts +91 -0
  106. package/lib/types/dsh-adapter/mention-providers.d.ts.map +1 -0
  107. package/lib/types/dsh-adapter/mention-providers.js +214 -0
  108. package/lib/types/dsh-adapter/migrate/entry.d.ts +2 -0
  109. package/lib/types/dsh-adapter/migrate/entry.d.ts.map +1 -0
  110. package/lib/types/dsh-adapter/migrate/entry.js +46 -0
  111. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  112. package/lib/types/dsh-adapter/plugin.js +42 -2
  113. package/lib/types/dsh-adapter/present-tool.d.ts +20 -0
  114. package/lib/types/dsh-adapter/present-tool.d.ts.map +1 -0
  115. package/lib/types/dsh-adapter/present-tool.js +96 -0
  116. package/lib/types/extensions.d.ts +2 -0
  117. package/lib/types/extensions.d.ts.map +1 -1
  118. package/lib/types/extensions.js +4 -1
  119. package/lib/types/i18n.d.ts +21 -2
  120. package/lib/types/i18n.d.ts.map +1 -1
  121. package/lib/types/i18n.js +9 -1
  122. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  123. package/lib/types/ink/components/ScrollBox.js +13 -0
  124. package/lib/types/ink/dom.d.ts +3 -0
  125. package/lib/types/ink/dom.d.ts.map +1 -1
  126. package/lib/types/ink/ink.d.ts.map +1 -1
  127. package/lib/types/ink/ink.js +30 -34
  128. package/lib/types/ink/render-node-to-output.d.ts +3 -0
  129. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  130. package/lib/types/ink/render-node-to-output.js +54 -40
  131. package/lib/types/ink/selection.d.ts +38 -28
  132. package/lib/types/ink/selection.d.ts.map +1 -1
  133. package/lib/types/ink/selection.js +201 -130
  134. package/lib/types/kernelPrefs.d.ts +5 -2
  135. package/lib/types/kernelPrefs.d.ts.map +1 -1
  136. package/lib/types/kernelPrefs.js +5 -2
  137. package/lib/types/screens/Chat.d.ts +4 -1
  138. package/lib/types/screens/Chat.d.ts.map +1 -1
  139. package/lib/types/screens/Chat.js +2 -2
  140. package/lib/types/settings/definitions.d.ts +12 -0
  141. package/lib/types/settings/definitions.d.ts.map +1 -1
  142. package/lib/types/settings/definitions.js +10 -2
  143. package/lib/types/theme.d.ts +4 -0
  144. package/lib/types/theme.d.ts.map +1 -1
  145. package/lib/types/theme.js +20 -2
  146. package/lib/types/tuiDisplayPrefs.d.ts +3 -0
  147. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  148. package/lib/types/tuiDisplayPrefs.js +10 -0
  149. package/lib/types/update.d.ts +74 -5
  150. package/lib/types/update.d.ts.map +1 -1
  151. package/lib/types/update.js +297 -46
  152. package/lib/types/updateHost.d.ts.map +1 -1
  153. package/lib/types/updateHost.js +16 -5
  154. package/lib/types/usageStats.d.ts +6 -0
  155. package/lib/types/usageStats.d.ts.map +1 -1
  156. package/lib/types/usageStats.js +8 -0
  157. package/lib/types/utils/colorMix.d.ts +19 -0
  158. package/lib/types/utils/colorMix.d.ts.map +1 -0
  159. package/lib/types/utils/colorMix.js +51 -0
  160. package/lib/types/utils/commandLine.d.ts +8 -0
  161. package/lib/types/utils/commandLine.d.ts.map +1 -0
  162. package/lib/types/utils/commandLine.js +37 -0
  163. package/lib/types/utils/desktopEntry.d.ts +32 -0
  164. package/lib/types/utils/desktopEntry.d.ts.map +1 -0
  165. package/lib/types/utils/desktopEntry.js +302 -0
  166. package/lib/types/utils/externalEditor.d.ts +2 -5
  167. package/lib/types/utils/externalEditor.d.ts.map +1 -1
  168. package/lib/types/utils/externalEditor.js +4 -36
  169. package/lib/types/utils/fileSuggestions.d.ts +14 -3
  170. package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
  171. package/lib/types/utils/fileSuggestions.js +33 -0
  172. package/lib/types/utils/openExternal.d.ts +9 -0
  173. package/lib/types/utils/openExternal.d.ts.map +1 -1
  174. package/lib/types/utils/openExternal.js +87 -3
  175. package/lib/types/utils/terminalLaunch.d.ts +16 -0
  176. package/lib/types/utils/terminalLaunch.d.ts.map +1 -0
  177. package/lib/types/utils/terminalLaunch.js +121 -0
  178. package/package.json +116 -110
  179. package/tui-profile/feed/README.md +1 -1
  180. package/tui-profile/feed/first-party.json +1 -1
package/README.md CHANGED
@@ -44,7 +44,7 @@ Resuming a DSH session preserves its recorded reasoning effort (or its live sele
44
44
  - **Pixel whale pet** — three startup intros, click to wake; freezes after the first task.
45
45
  - **Launchpad and first-run guide** — every ordinary launch lands on a landing page with a **real input box** (big text + whale + quick actions, dropping whole blocks on short/narrow terminals; whale-girl images use a compact native-canvas footprint instead of leaving a large gap before the title; on by default — /settings `launchpad` off boots straight into chat); command completion matches chat: `Tab` fills the input, `Enter` runs the command and clears it. The first run walks a four-step wizard (accounts & models / language+theme / model+workspace / shortcuts), re-runnable with `/setup`; its first step signs in to a subscription and catches the models it brings in (none → no question, one → that one, several → you choose), or adds an API key through the `/provider` wizard, which asks which of the enabled models to switch to or keeps the current one.
46
46
  - **Terminal-native UI** — streaming Markdown, tool cards, `/` and `@` completion, `#L12-14` ranges, history search, zh/en UI.
47
- - **Notifications** — one switch covers four system notifications: task completion, a tool approval waiting for your decision, a question waiting for your answer, and a plan review waiting for your decision. Task completion: DSH, Claude and Codex notify after successful live work settles, with no queued follow-up or active goal. The title is “dsh-TUI · Task complete”; the body shows the latest settled reply as a single-line plain-text preview (Markdown formatting removed, up to 200 characters). OSC 777/9 apply an additional 2048-byte sequence budget, including title and protocol bytes, preserving whole graphemes. No reply shows only the title; BEL only rings. `/settings` → Conversation: `taskNotifications` = `unfocused` (default), `always`, or `off`; `notificationMethod` = `auto` (default), `osc9`, `bel`, or `windows`. Auto uses separate title/body fields on Ghostty/WezTerm (OSC 777) and Kitty (OSC 99); iTerm2/Warp and explicit `osc9` use a title prefix; other terminals ring the bell; delivery follows your terminal's notification/bell settings. On local Windows, `auto` resolves to `windows`, the system's native notifications: a task-completion toast. The first toast registers that user's AppUserModelID under HKCU, the toast appears about 3 seconds after the task ends (the PowerShell cold start that buys the no-extra-install route), and for DSH sessions an enabled, active external DSH notification plugin in the running profile makes dsh-TUI yield to it (no toast, no bell); an installed but disabled plugin does not suppress notifications; if that AppUserModelID cannot be written, the notification falls back to the bell instead of going silent. `jumpBack` (Windows, off by default) turns these toasts into a way back to the pane that raised them; it needs the native toast path (`notificationMethod` = `windows`, which `auto` picks on local Windows). With `/settings` → Conversation → `jumpBack` on, the pane title ends with `[dsh-tui:<16 hex>]`, one marker for the life of the process; switching it off removes the suffix at once. While it is on, this process refreshes a marker file at `~/.dsh-tui/notify/jumpback/<session>.json` (`schemaVersion: 1`, `marker`, `pid`, `startedAt`) when the setting is turned on and before each notification it sends, and the first toast that can promise a jump registers the per-user protocol handler (`URL Protocol` plus `shell\open\command`) under `HKCU\Software\Classes\dsh-tui`; a normal exit removes the file, and removes the key once no other live instance still needs it. Only a pre-send probe that finds exactly one target pane (or tab title) puts an activation URI on the toast; clicking it re-runs five checks — same pane, keyboard focus, marker still in the title, foreground window, not minimized — and refuses rather than jumping anywhere else when any of them fails. A click whose target has gone away changes nothing. Layouts that cannot be verified — a pane in an unselected tab that is not that tab's focused pane, profiles using `suppressApplicationTitle`, and terminals other than Windows Terminal (tested on Windows Terminal 1.24) — get a plain toast whose click changes nothing. The probe adds about half a second before each toast; the first one after enabling can also wait for the helper to compile (a few seconds, once), and a machine whose in-box compiler keeps failing retries it at most every five minutes. External notification senders can read the same marker file and point their own toast at `dsh-tui:activate?m=<marker>`; the URI and file format are a read-only contract, and this release ships no plugin-side implementation. SSH sessions keep the attached terminal's notification protocol in `auto` mode; explicit `windows` still selects the host's native transport. tmux requires `set -g allow-passthrough on` for OSC notifications and `set -g focus-events on` for focus reporting. Terminals without focus reporting need `always`. Replay, cancellation and failures do not notify. Works in inline and fullscreen modes. A tool approval adds its own notification: the title is “dsh-TUI · Approval needed”; the body carries the session name, the tool name and the asker's reason. The reason is host-provided text (the model's own justification can appear verbatim), so it is normalized to one plain line and length-capped, but the body makes no redaction promise; the tool call's arguments are never read for it. A native toast still being prepared is dropped if the switch turns off, the session is no longer the attached one, or the approval, question or plan review is no longer waiting. Every approval notifies, and only the current session’s does; background sessions and subagents stay quiet. The switch covers all four, so `off` silences approvals, questions and plan reviews along with completions. An enabled, active external DSH notification plugin still makes dsh-TUI yield for completions, approvals and questions; a plan review never yields, and outside local Windows (or in SSH) the existing terminal notification protocol or bell is used. An ordinary question adds its own notification: the title is “dsh-TUI · Waiting for your answer” and the body carries the first question's header and question; options and detail stay in the panel. Local wizard and sign-in questionnaires announce the same way; a subagent's question stays in the panel in this release; the 0.2.2 approval-intent asks are announced the same way as an ordinary question. A plan review is announced as “dsh-TUI · Plan review” and carries the question header and question, never the plan itself, and it is the one notice that does not yield: an external notifier maps approvals and ordinary questions to its own notification but not a plan review, so yielding would leave only its generic idle notice, which never says a plan review is waiting.
47
+ - **Notifications** — one switch covers four system notifications: task completion, a tool approval waiting for your decision, a question waiting for your answer, and a plan review waiting for your decision. Completion on DSH, Claude and Codex fires once live work settles, with no queued follow-up or active goal; its title is “dsh-TUI · Task complete” and the body previews the latest reply as one plain-text line (up to 200 characters). Approvals are titled “dsh-TUI · Approval needed” (session name, tool name, reason — never the command); questions “dsh-TUI · Waiting for your answer” (the first question's header and question); plan reviews “dsh-TUI · Plan review” (the question header and question, never the plan). `/settings` → Conversation: `taskNotifications` = `unfocused` (default), `always` or `off`; `notificationMethod` = `auto` (default), `osc9`, `bel` or `windows`. `auto` follows your terminal — OSC 777 on Ghostty/WezTerm, OSC 99 on Kitty, a title prefix on iTerm2/Warp, a bell elsewhere — and resolves to the native system toast on local Windows. On local Windows, an enabled, active external DSH notification plugin makes dsh-TUI yield completions, approvals and questions; a plan review is always sent by dsh-TUI itself. `off` silences all four; only the current session's approvals notify (background sessions and subagents stay quiet); replay, cancellation and failures do not notify. Delivery details, terminal requirements (tmux and the like) and jump-back (`jumpBack`): see the [User guide](docs/user-guide.en.md#53-the-settings-editor) and [terminal requirements](docs/user-guide.en.md#54-terminal-requirements).
48
48
  - **Native cursor** — focused text inputs inherit your terminal's cursor shape, color, blinking, and enabled animation or trail effects in both inline and fullscreen modes. The `/model` picker shows the same cursor during movement between provider tabs, model rows, and effort levels, then hides it after **0.5 seconds at rest**; clipped regions fall back to the model row. The session manager also moves this cursor between the workspace rail, session rows, and search box; typing claims the search caret, and navigation returns it to the focused row. Configure animation and trail effects in your terminal.
49
49
  - **Images** — Kitty/Sixel thumbnails, centered preview with zoom and pan, paste-time fitting, text fallback. Kitty images scale to the reserved cells' physical pixels, including on HiDPI terminals.
50
50
  - **Mermaid diagrams** — ````mermaid ```` fences drawn as Unicode diagrams.
@@ -130,7 +130,7 @@ The `deepseek-official` API-key route needs `DEEPSEEK_API_KEY`. On DSH
130
130
  and select the separate account route through `/model`. Other supported
131
131
  accounts can sign in through `/provider` or `/auth` after startup.
132
132
 
133
- The primary compatibility target is DSH `0.2.2-rc.2`. This adapter supports its
133
+ The primary compatibility target is DSH `0.2.2-rc.5`. This adapter supports its
134
134
  Shell API, V4 session messages, declarative presets, and profile-backed settings;
135
135
  older supported hosts retain their compatibility paths. See [configuration](docs/configuration.en.md).
136
136
 
@@ -198,6 +198,13 @@ unchanged. See
198
198
  source builds, and troubleshooting, including migration from the former
199
199
  `dsh-cc-tui` package.
200
200
 
201
+ `/restart` resumes the current session without installing anything. On
202
+ non-Windows runtimes with `process.execve`, it and `/update` replace the
203
+ current process, so repeated restarts do not accumulate waiting TUI processes.
204
+ Other runtimes and kernel switches retain the supervised child-process handoff.
205
+ A launch delegated to `dsh --profile` stays on that path until the next cold
206
+ launch or kernel switch.
207
+
201
208
  ### CLI
202
209
 
203
210
  Automation: `dst -p "task"`, `dst run --json`, `dst session list --json`.
@@ -240,6 +247,7 @@ dsh-tui migrate codex --dry-run # preview what would land, write nothing
240
247
  In-TUI browsing: the session screen (`/resume`) shows a tab per agent that has conversations; picking one imports just that conversation and opens it.
241
248
  In-TUI: `/migrate` (optionally `/migrate <agent> [--dry-run]`) runs the same import in a child process and reports through the notification flow.
242
249
  CLI alternative: `dsh-tui migrate ...` from any shell runs the same import.
250
+ With an installed `dsh` that supports host module resolution, both entries use its framework packages; a fresh profile does not need a separate copy. Dependency failures report their cause instead of asking for an update.
243
251
  Full guide: [Session migration](docs/migrate.en.md).
244
252
 
245
253
  - More agents (pi, opencode, …) extend the adapter registry as adapters land; grok-build reads `GROK_HOME` when set.
@@ -274,6 +282,9 @@ The easiest install: open the kernel picker (the launchpad "Kernel" entry or
274
282
  `/kernel`) and press Enter on the dim Claude row — the wizard locates the
275
283
  profile directory and installs the pinned SDK for you; the command above is
276
284
  its manual equivalent.
285
+ An existing Claude Code CLI, including a Homebrew installation, still needs
286
+ this SDK. If the SDK is unavailable, the row retains the detected CLI version
287
+ and says "SDK unavailable"; press Enter to install the SDK in the profile.
277
288
  The confirmation shows the exact package and version. Closing the wizard,
278
289
  including clicking outside it on the launchpad, cancels a pending installation.
279
290
 
@@ -466,11 +477,13 @@ Mouse (fullscreen): drag to select and copy, double/triple click to select a wor
466
477
 
467
478
  Automatic copies keep the text selected; press `Esc` to clear it or start a new selection to replace it. Selection highlighting skips trailing padding and blank rows while preserving spaces within text and code indentation. Inline mode uses the terminal's native selection.
468
479
 
480
+ While holding a fullscreen text drag, use `PgUp` / `PgDn` or the wheel to extend the selection across pages: its origin follows the text while the other endpoint stays at the pointer. After release, both endpoints follow scrolling. Fully off-screen selections keep their captured text without highlighting unrelated edge cells; scrolling back restores their position and column range.
481
+
469
482
  When a fullscreen selection starts in a code block's body, soft-wrapped rows join without adding frame padding or newlines, in both light and full frames. Hard line breaks and the existing hard-line inset remain part of screen copying.
470
483
 
471
484
  During a fullscreen text drag, the native cursor follows the selected text's edge using your terminal's enabled cursor animation or trail effects. Moving into trailing padding or blank rows keeps it at the nearest selected text edge. Releasing or cancelling the drag restores the focused input's caret.
472
485
 
473
- File paths in prose can open the file-action menu; automatic detection does not extract a path from inside a slash-delimited token such as `working/idle/needs-input` or a date such as `2024/01/15`.
486
+ File paths in prose can open the file-action menu; automatic detection does not extract a path from inside a slash-delimited token such as `working/idle/needs-input` or a date such as `2024/01/15`. On Linux a handler marked `Terminal=true` (for example `vim.desktop`) opens inside a terminal (for example `kitty -1 vim <file>`); other targets still go to the system default handler. This wrapper does not support non-empty `Path=`: those entries stay with `xdg-open`. Its generic path can still lack a TTY and ignore the working directory, so such terminal handlers may still fail to open.
474
487
 
475
488
  **Pasting**: the launchpad accepts clipboard images and pasted image paths as `[Image #N]` attachments; `Enter` sends them with the first message. Commands that do not accept images preserve the draft and its attachments. Image chips behave like chat: arrows step across them, Backspace at the end or Delete at the start removes the whole image, and Ctrl+W never splits a chip. Text pasted on the launchpad is folded to one line. In chat, native and bracketed paste keeps ordinary text and newlines, and never submits itself on arrival. On Windows terminals that deliver a paste as win32-input-mode key records, a record stream leaked into the payload is decoded back into the characters its `Uc` field encodes — newlines included — so the composer's line count matches what was pasted; only records with no character meaning are stripped (a multi-line paste no longer leaves stray `_`), and a complete record is always consumed before an ESC-less tail, so no payload character is deleted along with an orphan escape. Pasted CRLF collapses to a single newline; genuine underscores and bracketed-paste text are untouched.
476
489
 
@@ -545,6 +558,8 @@ Runtime path, module boundaries, performance notes and persistence locations: [A
545
558
 
546
559
  ## Known Limitations
547
560
 
561
+ - Fuzzy `@` completion refreshes on the next query after its 2-second cache expires; a menu left idle does not poll for changes. Path-shaped queries such as `@src/` read that directory directly. The existing 100-file/100-directory scan budgets still apply.
562
+
548
563
  - Injected plugin context has no standalone display; it counts into the context segments.
549
564
  - `/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.
550
565
  - `Ctrl+V` needs platform clipboard tools; unsupported bitmap formats are rejected.
package/bin/dsh-tui.js CHANGED
@@ -531,6 +531,10 @@ const MSG = {
531
531
  `[dsh-tui] \`migrate\` 需要 profile 的编译产物,但它缺失或版本过旧、不含 CLI 入口。\n` +
532
532
  `请先升级:\n dsh-tui update`,
533
533
  },
534
+ migrateFailed: {
535
+ en: reason => `[dsh-tui] \`migrate\` could not run: ${reason}`,
536
+ zh: reason => `[dsh-tui] \`migrate\` 无法运行:${reason}`,
537
+ },
534
538
  helpText: {
535
539
  en:
536
540
  `Usage: dsh-tui|dst [command] [options] [path|url]\n\n` +
@@ -1547,17 +1551,31 @@ if (subcommand === 'update') {
1547
1551
  // profile 未初始化时先自举;产物缺失或旧版无 cliMigrate 导出给升级指引。
1548
1552
  if (subcommand === 'migrate') {
1549
1553
  if (!profileReady()) bootstrapProfile()
1550
- let cliMigrate
1551
- try {
1552
- ;({ cliMigrate } = await import(pathToFileURL(join(profilePkgDir, 'lib', 'types', 'dsh-adapter', 'migrate', 'cli.js')).href))
1553
- } catch {
1554
- cliMigrate = undefined
1555
- }
1556
- if (typeof cliMigrate !== 'function') {
1554
+ const migrateDir = join(profilePkgDir, 'lib', 'types', 'dsh-adapter', 'migrate')
1555
+ const cli = join(migrateDir, 'cli.js')
1556
+ if (!existsSync(cli)) {
1557
1557
  console.error(msg('migrateUnavailable'))
1558
1558
  process.exit(1)
1559
1559
  }
1560
- process.exit(await cliMigrate(process.argv.slice(3)))
1560
+ // entry.js installs the host resolver for cold profiles; profiles built before
1561
+ // it existed only have cli.js and always ran it directly. Upgrading the
1562
+ // launcher must not make those profiles demand an update first.
1563
+ const entry = join(migrateDir, 'entry.js')
1564
+ const target = existsSync(entry) ? entry : cli
1565
+ try {
1566
+ const { cliMigrate } = await import(pathToFileURL(target).href)
1567
+ if (typeof cliMigrate !== 'function') {
1568
+ console.error(msg('migrateUnavailable'))
1569
+ process.exit(1)
1570
+ }
1571
+ process.exit(await cliMigrate(process.argv.slice(3), profileDir))
1572
+ } catch (error) {
1573
+ // A present module's dependency/load failure is not a missing artifact.
1574
+ const reason = (error instanceof Error ? error.message : String(error))
1575
+ .replace(/[\x00-\x1f\x7f-\x9f]/g, ' ').replace(/\s+/g, ' ').trim()
1576
+ console.error(msg('migrateFailed')(reason))
1577
+ process.exit(1)
1578
+ }
1561
1579
  }
1562
1580
 
1563
1581
  // ─── 全局副本:瘦壳角色 ───────────────────────────────────────────────────────
@@ -58,11 +58,12 @@ To pick the backend, use any of:
58
58
  `/kernel` inside a session, which open the kernel picker. Picking the other
59
59
  kernel remembers the choice (`~/.dsh-tui/kernel.json`) and restarts dsh-TUI
60
60
  into a new session on it; the old session stays in `/resume`. A running turn
61
- blocks the switch. Without the SDK the picker marks Claude as *Not installed*;
62
- an undetected credential does **not** block the pick — a key may perfectly well
63
- live where detection cannot see it (the Claude settings' `env`, an
64
- `apiKeyHelper`, a relay channel). The row stays selectable (the bottom-right
65
- plate never shows sign-in state; the picker's subtitle says *Not signed in*).
61
+ blocks the switch. Without the SDK the picker marks Claude as *SDK
62
+ unavailable* and keeps the detected CLI version; an undetected credential
63
+ does **not** block the pick — a key may perfectly well live where detection
64
+ cannot see it (the Claude settings' `env`, an `apiKeyHelper`, a relay
65
+ channel). The row stays selectable (the bottom-right plate never shows
66
+ sign-in state; the picker's subtitle says *Not signed in*).
66
67
  The CLI applies its own configuration after start; `/login` covers a
67
68
  subscription sign-in in-session, `/channel` the relay route.
68
69
  - `dsh-tui --backend claude` (this launch only).
@@ -12,7 +12,7 @@ dsh-TUI 可以把会话跑在 Claude Agent 后端上,而不是 DeepSeek Harnes
12
12
  需要:
13
13
 
14
14
  - Claude Agent SDK。它是可选依赖,默认不装。最省事的装法:打开内核选择器(启动页
15
- 「内核」或 `/kernel`),对未安装的 Claude 行按 Enter,按引导一键安装——dsh-TUI
15
+ 「内核」或 `/kernel`),对 SDK 未就绪的 Claude 行按 Enter,按引导一键安装——dsh-TUI
16
16
  自己定位 profile 目录,用 pnpm 装锁定版本的 SDK,装完该行即变亮可选(独立构建
17
17
  与无 profile 的启动给手动指引)。安装前会把 profile 的 pnpm store 钉到稳定路径
18
18
  (storeDir: ../../.pnpm-store,写入 pnpm-workspace.yaml),环境变量漂移
@@ -43,10 +43,10 @@ dsh-TUI 可以把会话跑在 Claude Agent 后端上,而不是 DeepSeek Harnes
43
43
  - 启动页的「内核」入口、右下角的内核区,或在会话里输入 `/kernel`,打开内核选择器。
44
44
  选中另一个内核后 dsh-TUI 记住选择(`~/.dsh-tui/kernel.json`)并重启,在新内核里开
45
45
  一个新会话;原来的会话仍可在 `/resume` 找到。回合进行中不能切换。SDK 没装时,选择器
46
- 会把 Claude 标为「未安装」;凭据检测不出**不会**拦住选择——key 完全可以放在检测看不到
47
- 的地方(Claude 设置的 `env`、`apiKeyHelper`、中转渠道),行仍可选(右下角铭牌不显示登录
48
- 状态,未登录在选择器里以副标题标注)。进去后 CLI 会应用自己的配置;订阅登录在会话里
49
- `/login`,中转渠道用 `/channel` 配。
46
+ 会把 Claude 标为「SDK 未就绪」,并保留已经检测到的 CLI 版本;凭据检测不出**不会**拦住
47
+ 选择——key 完全可以放在检测看不到的地方(Claude 设置的 `env`、`apiKeyHelper`、中转渠道),
48
+ 行仍可选(右下角铭牌不显示登录状态,未登录在选择器里以副标题标注)。进去后 CLI 会应用
49
+ 自己的配置;订阅登录在会话里 `/login`,中转渠道用 `/channel` 配。
50
50
  - `dsh-tui --backend claude`(只对这一次启动生效)。
51
51
  - 在 dsh-tui 的配置行写 `backend: claude`。
52
52
 
@@ -28,17 +28,25 @@ only for a genuinely new service.
28
28
 
29
29
  ## Web search and fetch (DSH 0.2.1-rc.5)
30
30
 
31
- The standard DSH profile loads the new DeepSeek Search / Fetch API providers,
32
- while Messages search and local HTTP fetch remain the defaults. In `/settings`,
33
- use the arrow keys in **Web search** to select **Search API** and **Fetch API**.
34
- Each selection saves immediately and applies to the next operation. Choose
35
- **Messages** / **HTTP** to restore the original providers. Enter accepts a custom
36
- provider ID. Sections use the plugin's actual Loader entry ID, including custom IDs.
37
-
38
- **Web search** has one **API key** input. Paste the key for the selected search API;
39
- typing is masked and confirmation saves it in DSH's credential store, outside
31
+ The standard DSH profile loads the new DeepSeek Search / Fetch API providers. From
32
+ DSH `0.2.2-rc.5` search defaults to **Automatic**: a conversation on a DeepSeek
33
+ model route runs Messages search (no per-search charge), while every other route
34
+ and a search outside a model request runs the Search API. Fetch still defaults to
35
+ local HTTP. In `/settings`, use the arrow keys in **Web search** to select
36
+ **Automatic**, **Search API**, or **Messages** under Search and **Fetch API** or
37
+ **HTTP** under Fetch. Each selection saves immediately and applies to the next
38
+ operation. **Automatic** clears the user-layer provider so the per-route choice
39
+ applies again. Enter accepts a custom provider ID. Sections use the plugin's
40
+ actual Loader entry ID, including custom IDs.
41
+
42
+ The **API key** input follows the selected provider's credential reference:
43
+ under Automatic the Messages search key serves a DeepSeek model route, and the
44
+ Search API gets its own input when the reference it follows differs (a pinned
45
+ `searchApiKeyEnv`, or the model route's own `apiKeyEnv`). One shared reference
46
+ keeps one input.
47
+ Typing is masked and confirmation saves it in DSH's credential store, outside
40
48
  profile configuration. Reopening shows only whether a key is configured. Blank
41
- input preserves the saved key, and switching APIs selects that API's credential.
49
+ input preserves the saved key.
42
50
 
43
51
  The **DeepSeek Search / Fetch API** section edits the API base URL,
44
52
  result count (1–50), and **Send original question**. The base URL
@@ -48,7 +56,11 @@ Search sends the first 128 characters of the latest user prompt by default;
48
56
  the section can disable this. Messages search has its own endpoint and maximum
49
57
  search count section.
50
58
 
51
- The user profile patch can also select both providers:
59
+ A user profile patch can also pin both providers. It only writes the user
60
+ layer, so **Automatic** stays available afterwards and selecting it clears
61
+ this override back to the per-route choice. Only a lower composition layer
62
+ (an older `dsh-base`, or a deployment's own base-layer patch) that pins
63
+ `searchProvider` removes **Automatic**, as in the official Web menu:
52
64
 
53
65
  ```yaml
54
66
  - id: web
@@ -165,6 +177,7 @@ A complete common override looks like this:
165
177
  | `btw.contextTurns` | `4` (number, 1–8) | Completed Q/A pairs a `/btw` follow-up carries; older pairs stay in the thread and panel but are not sent. Applies immediately |
166
178
  | `btw.contextBudget` | `24000` (number, 1000–200000) | Character budget for the recent Q/A pairs a `/btw` follow-up carries; the oldest pairs drop first. Applies immediately |
167
179
  | `codeFrameStyle` | `light` | Frame of fenced code blocks in replies: `light` is a top label plus a left rail and costs no extra rows; `full` closes the box. Very narrow terminals always use a plain fence. Applies immediately |
180
+ | `nerdFontIcons` | `false` | The `present` delivery card uses Nerd Font file-type icons instead of four-cell badges; requires a Nerd Font Mono, otherwise the glyphs render as boxes. Off by default, keeping the card font-independent. Applies immediately |
168
181
  | `turnUsageRow` | `false` (boolean) | Show a right-aligned usage row at the end of each turn (tokens in/out, cache, duration, retries); `/tokens`, `/status` and the footer hover report the same numbers either way |
169
182
  | `modes` | built-in trio | Shift+Tab session-mode cycle (plan/sandbox/approval atom bundles); defaults to default → plan → full-access |
170
183
  | `upstreamRetry` | `true` | Seed a retry policy (5 attempts, transport-drop-aware failure codes including `STREAM_CLOSED`) on the `llm-pi-ai` provider route the bound session actually uses, whenever it declares no `retryPolicy` — at every bind (boot, `/model` switch, resume), through the official `llm-pi-ai` settings section (the policy the kernel's `llm-retry` plugin executes). Dormant channels are never written; routes with an explicit `retryPolicy` (cordis.yml or hand-edited settings) are never overwritten; `false` opts out entirely |
@@ -398,6 +411,7 @@ for the complete field reference.
398
411
  | Variable | Purpose |
399
412
  | --- | --- |
400
413
  | `VISUAL` / `EDITOR` | External editor opened by `Ctrl+G` (`VISUAL` wins; arguments like `code --wait` are allowed; with neither set the TUI prompts you to configure one — no `vi` fallback) |
414
+ | `TERMINAL` | Linux: terminal command used to run a `Terminal=true` default handler (e.g. `vim.desktop`), optionally with arguments (e.g. `kitty -1`); when unset, the TUI falls back to KDE's `kdeglobals` `TerminalApplication`, `xdg-terminal-exec`, then a known terminal. Non-empty `Path=` is not supported by this wrapper: those entries remain with `xdg-open`, whose generic path can still lack a TTY and ignore the working directory |
401
415
  | `DEEPSEEK_API_KEY` | Required DeepSeek credential |
402
416
  | `DEEPSEEK_BASE_URL` | Override the compatible DeepSeek API endpoint |
403
417
  | `DSH_HOME` | Harness home (profiles, sessions, credentials, attachments); falls back to the upstream default `~/.dsh` |
@@ -482,7 +496,7 @@ The `/provider` add branch signs in to ChatGPT/Codex (`openai-codex`), Claude
482
496
  (`anthropic`), or Grok (`xai`) subscriptions. When the installed host's pi-ai
483
497
  catalog ships the corresponding flows, it also offers OpenAI direct ChatGPT sign-in
484
498
  (`openai`, using the OpenAI API rather than the legacy Codex backend) and Meta
485
- Muse (`meta`). The primary validated DSH `0.2.2-rc.2` development fixture resolves pi-ai
499
+ Muse (`meta`). The primary validated DSH `0.2.2-rc.5` development fixture resolves pi-ai
486
500
  `1.2.0`, which includes Meta Muse and OpenAI direct sign-in.
487
501
  `/auth status`, `/auth login [provider]`, and `/auth logout <provider>` use
488
502
  that credential store for these pi-ai routes. Browser authorization tries to open the page
@@ -27,15 +27,19 @@ Profile 启动按顺序叠加:
27
27
 
28
28
  ## 网页搜索与抓取(DSH 0.2.1-rc.5)
29
29
 
30
- 标准 DSH profile 会加载新的 DeepSeek Search / Fetch API 提供者,默认仍使用
31
- Messages 搜索和本地 HTTP 抓取。在 `/settings` 的「网页搜索」分区,用左右键将
32
- 「搜索」选为「搜索 API」、「抓取」选为「抓取 API」;选择立即保存,从下一次操作
33
- 生效,不需要重启。切回 `Messages` / `HTTP` 可恢复原提供者。Enter 可输入第三方
30
+ 标准 DSH profile 会加载新的 DeepSeek Search / Fetch API 提供者。DSH `0.2.2-rc.5`
31
+ 起搜索默认是「自动」:DeepSeek 模型路由上的会话使用 Messages 搜索(不按次计费),
32
+ 其他路由以及模型对话之外的搜索使用搜索 API;抓取默认仍是本地 HTTP。在 `/settings`
33
+ 的「网页搜索」分区,用左右键在「搜索」里选择「自动」「搜索 API」或「Messages」、
34
+ 在「抓取」里选择「抓取 API」或「HTTP」;选择立即保存,从下一次操作生效,不需要
35
+ 重启。选择「自动」会清掉用户层的搜索提供者,交回按路由选择。Enter 可输入第三方
34
36
  提供者 ID。分区使用插件实际的 Loader 行 ID,也支持自定义 ID。
35
37
 
36
- 「网页搜索」分区只有一个 API key 输入框,可直接粘贴当前搜索 API 的密钥。
37
- 输入时显示掩码,确认后保存到 DSH 凭据库,不写入 profile 配置;重新打开只显示
38
- 是否已设置,不回显原值。留空保留已有密钥,切换搜索 API 后使用该 API 的凭据。
38
+ 「网页搜索」分区的 API key 输入框跟随当前提供者的凭据引用:自动模式下 DeepSeek
39
+ 模型路由用 Messages 搜索的密钥;搜索 API 跟随的引用与它不同时(固定了
40
+ `searchApiKeyEnv`,或模型路由自带 `apiKeyEnv`),会再显示一个输入框,两者共用
41
+ 同一引用时只显示一个。输入时显示掩码,确认后保存到 DSH 凭据库,不写入 profile
42
+ 配置;重新打开只显示是否已设置,不回显原值。留空保留已有密钥。
39
43
 
40
44
  「DeepSeek 搜索 / 抓取 API」分区可修改 API 基础地址、搜索结果数
41
45
  (1–50)和「发送原始问题」。基础地址包含路径前缀,不含 `/search` 或 `/fetch`,
@@ -44,7 +48,10 @@ Messages 搜索和本地 HTTP 抓取。在 `/settings` 的「网页搜索」分
44
48
  用户提示的前 128 个字符随搜索请求发送,可在该分区关闭。Messages 搜索的端点与
45
49
  最大搜索次数在独立分区设置。
46
50
 
47
- 也可通过用户 profile 补丁选择两个提供者:
51
+ 也可通过用户 profile 补丁固定两个提供者。它只写用户层,之后仍可在 `/settings` 选择
52
+ 「自动」清除这次覆盖、回到按路由选择;只有更下层的组合层(旧验证线的 `dsh-base`,或
53
+ 部署自带的 base 层补丁)固定了 `searchProvider` 时,才不提供「自动」,与官方 Web
54
+ 菜单一致:
48
55
 
49
56
  ```yaml
50
57
  - id: web
@@ -148,6 +155,7 @@ TUI bundle 继承已安装 DSH 官方组合的上报配置;上游未提供的
148
155
  | `btw.contextTurns` | `4`(数值,1–8) | `/btw` 追问时带上的最近已完成问答组数;更早的组不进请求,线程和面板里仍保留。立即生效 |
149
156
  | `btw.contextBudget` | `24000`(数值,1000–200000) | `/btw` 追问携带的最近问答总字符数上限,超出时从最旧的一组开始丢。立即生效 |
150
157
  | `codeFrameStyle` | `light` | 回复里代码块的边框:`light` 只有顶部标签和左侧竖线,不多占行;`full` 是封闭的框。终端太窄时总是用纯文本 fence。立即生效 |
158
+ | `nerdFontIcons` | `false` | `present` 交付卡用 Nerd Font 文件类型图标代替四格徽章;需要终端使用 Nerd Font Mono,否则图标显示为方框。默认关闭,保持与字体无关。立即生效 |
151
159
  | `turnUsageRow` | `false`(布尔) | 每回合末尾显示一行右对齐的用量(输入/输出、缓存、耗时、重试);关闭时 `/tokens`、`/status` 和底栏悬停照样能看到这些数字 |
152
160
  | `modes` | 内置三档 | Shift+Tab 会话模式循环(plan/sandbox/approval 原子组合);缺省为 默认 → 计划 → 完全访问 |
153
161
  | `upstreamRetry` | `true` | 为当前会话实际使用的 `llm-pi-ai` 渠道播种重试策略(最多重试 5 次,失败码覆盖传输类中断、含 `STREAM_CLOSED` 上游断链):每次绑定(启动、`/model` 切换、resume)时检查该渠道,未声明 `retryPolicy` 才写入官方 `llm-pi-ai` settings 分节——内核 `llm-retry` 插件执行的就是这份策略。从不写闲置渠道;已显式声明 `retryPolicy` 的渠道(cordis.yml 或手改 settings)不会被覆盖;`false` 整体关闭 |
@@ -349,6 +357,7 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
349
357
  | 变量 | 用途 |
350
358
  | --- | --- |
351
359
  | `VISUAL` / `EDITOR` | `Ctrl+G` 打开的外部编辑器(`VISUAL` 优先,可带参数如 `code --wait`;两者都未设置时提示配置,无 `vi` 兜底) |
360
+ | `TERMINAL` | Linux:默认桌面处理器标记 `Terminal=true`(如 `vim.desktop`)时用于运行它的终端命令,可带参数(如 `kitty -1`);未设置时依次用 KDE `kdeglobals` 的 `TerminalApplication`、`xdg-terminal-exec`、常见终端。此包装路径不支持非空 `Path=`,这类条目仍交给 `xdg-open`;其 generic 路径仍可能没有 TTY、忽略工作目录 |
352
361
  | `DEEPSEEK_API_KEY` | DeepSeek 凭证;运行模型的必需项 |
353
362
  | `DEEPSEEK_BASE_URL` | 覆盖 DeepSeek 兼容 API 端点 |
354
363
  | `DSH_HOME` | harness 家目录(profile、会话、凭据、附件);未设置时用上游默认 `~/.dsh` |
@@ -421,7 +430,7 @@ Profile 模式不再使用旧的 `DSH_TUI_COMPACT_RATIO`、`DSH_TUI_COMPACT_RETA
421
430
  `dsh-auth` 插件包**。`/provider` 的添加分支提供 ChatGPT/Codex(`openai-codex`)、
422
431
  Claude(`anthropic`)、Grok(`xai`)订阅账号登录。宿主 pi-ai catalog 提供相应流程
423
432
  时还可使用 OpenAI 直连 ChatGPT 登录(`openai`,使用 OpenAI API 而非旧版 Codex
424
- 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.2-rc.2` 的开发依赖解析到 pi-ai
433
+ 后端)和 Meta Muse(`meta`)。当前主验证线 DSH `0.2.2-rc.5` 的开发依赖解析到 pi-ai
425
434
  `1.2.0`,包含 Meta Muse 与 OpenAI 直连登录。`/auth status`、`/auth login [provider]`、
426
435
  `/auth logout <provider>` 对这些 pi-ai 路由操作同一套凭据。浏览器授权会尝试自动打开页面,并在同一
427
436
  问卷中提供授权链接与手动粘贴回调 URL/代码的输入;设备码流程在轮询期间显示可复制的
@@ -266,14 +266,22 @@ engine is no longer loadable), the new TUI is kept and only the restart is
266
266
  refused. "The old engine is still loadable"
267
267
  needs positive proof — its `bin.dsh` entry starts in a fresh process and
268
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
269
+ readable manifest is not enough. After a pnpm upgrade, a shared runtime
270
+ fallback link that still points at the retained old store is refreshed only
271
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
272
+ and passes the startup probe: POSIX renames atomically, while Windows stages a
273
+ junction, moves the old link aside and renames the staged one into place
274
+ (restoring the old link on failure and keeping the backup when even that
275
+ fails). Default launches still verify the profile link and PATH. A direct or
276
+ delegated DSH launch instead re-resolves the singleton group in its original
277
+ pnpm home and verifies the target manifest and the version reported by its own
278
+ JS entry, without letting an unrelated PATH engine veto it. An in-place npm
279
+ upgrade uses its target manifest and the PATH startup probe. If the profile
280
+ explicitly installs its own host, these shortcuts are disabled and profile-local
281
+ verification is retained. The profile's own dependencies, real directories and
282
+ links to other installs are left untouched; a link that points at another install
283
+ (an old npx cache, say) is never rewritten unconditionally, and the update plan no
284
+ longer treats it as the current engine's source. A preflight refusal writes the current
277
285
  version, target range and next step (with the manual command when one can run)
278
286
  into the transcript; when the engine step fails only after the TUI was torn
279
287
  down, the same details go to the terminal's stderr (`dsh-tui update` writes
@@ -301,10 +309,10 @@ downgrade; for an unpublished release it only asks you to wait):
301
309
  # TUI only
302
310
  dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest
303
311
  # engine
304
- npm install -g @deepseek-ai/dsh@0.2.2-rc.2
312
+ npm install -g @deepseek-ai/dsh@0.2.2-rc.5
305
313
  # or, for a pnpm global layout (first confirm the global group holds dsh
306
314
  # alone; a one-package install replaces the whole group and its other commands):
307
- pnpm add -g @deepseek-ai/dsh@0.2.2-rc.2
315
+ pnpm add -g @deepseek-ai/dsh@0.2.2-rc.5
308
316
  # global launcher
309
317
  npm install -g --legacy-peer-deps @deepseek-harness-tui/dsh-tui@latest
310
318
  # or, only after confirming the pnpm global group contains this package alone:
@@ -235,11 +235,15 @@ dsh 意外结束时,安全模式提供只读的环境诊断、profile 插件
235
235
  (版本未前进,或旧引擎已不可用),则保留新 TUI、拒绝重启。
236
236
  「旧引擎仍可用」必须由真实启动探测证明(在独立进程里启动 `bin.dsh` 入口且
237
237
  `--version` 退出 0,或 `dsh --version` 能跑);入口文件存在、manifest 可读都不算。
238
- POSIX 上,pnpm 升级后若共享 runtime 回退链接仍指向保留的旧 store,仅当新入口
239
- 属于同一 pnpm home、版本等于目标且启动探测通过时才原子刷新该链接,再按 profile
240
- 链接和 PATH 两处校验;不改 profile 自己的依赖、普通目录或其他安装的链接。
241
- Windows 不做非原子的 junction 替换:保留旧链接和未验证结果,需手动核对并重建
242
- 共享回退链接。
238
+ pnpm 升级后若共享 runtime 回退链接仍指向保留的旧 store,仅当新入口属于同一
239
+ pnpm home、版本等于目标且启动探测通过时才刷新:POSIX 用原子 rename,Windows
240
+ 先造暂存 junction、挪开旧链接再换位,失败恢复旧链接,恢复也失败则保留 backup
241
+ 供人工核对。默认启动仍按 profile 链接和 PATH 两处校验;直接或委托 DSH 启动的
242
+ pnpm 安装则从原 home 重新定位所属单包组,校验目标 manifest 与实际 JS 入口报告的
243
+ 版本,不让另一套 PATH 引擎否决。npm 就地升级以目标 manifest 与 PATH 启动探测为准;
244
+ 若 profile 显式安装了宿主,上述快捷验证不启用,仍保留 profile-local 校验。
245
+ 不改 profile 自己的依赖、普通目录或其他安装的链接。指向另一安装(例如旧 npx 缓存)的链接不会被无条件改写,更新计划也不再
246
+ 把它当作当前引擎的来源。
243
247
  预检拒绝会把当前版本、目标范围与下一步(命令可执行时附手工命令)写入会话转录;
244
248
  若安装后引擎步骤才失败(TUI 已拆),同一份信息写入终端 stderr(`dsh-tui update`
245
249
  也写 stderr),toast 只留一句短提示。拒绝还会按原因给出下一步:当前引擎不在
@@ -262,10 +266,10 @@ pnpm 轮换全局安装组后,直接 DSH 启动路径会重新解析并探测
262
266
  # 只对齐 TUI
263
267
  dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest
264
268
  # 对齐引擎
265
- npm install -g @deepseek-ai/dsh@0.2.2-rc.2
269
+ npm install -g @deepseek-ai/dsh@0.2.2-rc.5
266
270
  # 或(pnpm 全局布局;先确认 dsh 所在全局组只有它自己,
267
271
  # 否则单包安装会替换整组并移除同组其他命令)
268
- pnpm add -g @deepseek-ai/dsh@0.2.2-rc.2
272
+ pnpm add -g @deepseek-ai/dsh@0.2.2-rc.5
269
273
  # 对齐全局启动器
270
274
  npm install -g --legacy-peer-deps @deepseek-harness-tui/dsh-tui@latest
271
275
  # 或(确认 pnpm 全局组内只有本包时;刚发布的版本见下面「pnpm 延迟」一条)
@@ -252,6 +252,7 @@ Type `@` at **any position** of the message to open file completion.
252
252
 
253
253
  - Keep typing to filter; `Tab`/`Enter` to pick; directories can be entered further.
254
254
  - Plain fragments match **fuzzily** — `@ment` matches `src/utils/mentions.ts` (prefix/boundary and short-path boosts).
255
+ - Fuzzy candidates are cached for 2 seconds after a scan completes; the next query after expiry rescans on demand to reflect added/deleted files without restarting. An idle menu does not poll in the background, fast typing and pending queries share one scan, and the existing 100-file/100-directory budgets remain.
255
256
  - Path-shaped queries (`@src/`, `@./`, `@../`, `@~/`, `@D:\`, or anything containing a separator) read **only that directory** for local completion.
256
257
  - `~/` and `~\` expand to home at **any depth** (`@~/a/b/c` names the same directory as `@<home>/a/b/c`); the two spellings are equivalent, and a non-Windows terminal expands `~\` before completing too.
257
258
  - `~user/` is **not** expanded (it is a literal path); when the current directory really has a child named `~`, `@~/…` still expands to home (shell semantics) — use `@./~/…` for the literal directory.
@@ -222,6 +222,7 @@ Bracketed paste(右键或终端原生粘贴)保留普通文本与换行。
222
222
 
223
223
  - 输入即过滤,`Tab`/`Enter` 选择,目录可继续深入。
224
224
  - 普通片段走**模糊匹配**(`@ment` 命中 `src/utils/mentions.ts`;前缀/边界命中优先,短路径优先)。
225
+ - 模糊候选在扫描完成后缓存 2 秒;过期后的下一次查询按需重扫,反映新增/删除文件,不必重启。菜单静止时不后台轮询,快速输入及在途查询复用同一扫描;原有 100 文件/100 目录预算保留。
225
226
  - 路径形态(`@src/`、`@./`、`@../`、`@~/`、`@D:\` 或含分隔符)只读**该目录**,不全仓扫描。
226
227
  - `~/` 与 `~\` 展开到 home,且**逐级深入到任意层**(`@~/a/b/c` 与 `@<home>/a/b/c` 指向同一个目录);两种写法同义,非 Windows 终端也把 `~\` 展开后再补全。
227
228
  - `~user/` **不展开**(按字面路径处理);当前目录里确实有名为 `~` 的目录时,`@~/…` 仍按 home 展开(与 shell 一致),要引用字面目录用 `@./~/…`。
@@ -126,6 +126,8 @@ with that source pre-checked; any other key dismisses it.
126
126
  `dsh-tui migrate` prints.
127
127
  - **`needs the profile's compiled copy`**: the profile's compiled output is
128
128
  missing or too old — run `dsh-tui update` first.
129
+ - **`could not run`**: the entry exists but a dependency or execution failed.
130
+ Use the named package and cause to check the `dsh` installation on PATH.
129
131
  - **Imports fewer than the scan count**: the scan count matches candidate
130
132
  files by name; import additionally filters unreadable and empty
131
133
  conversations, so landing slightly lower is expected.
@@ -138,6 +140,9 @@ with that source pre-checked; any other key dismisses it.
138
140
 
139
141
  ## Design notes (for maintainers and contributors)
140
142
 
143
+ - CLI and TUI children install host resolution before importing migration,
144
+ then dispose it. Scanning and dry-run in an initialized profile neither
145
+ rewrite its configuration nor compose its plugins.
141
146
  - Parsing is separate from IO: `adapters/<source>.parse.ts` are pure
142
147
  functions (raw text → turn model) over shared rules in `parse/` (jsonl
143
148
  bad-line counting, injection recognition and unwrapping, title
@@ -101,6 +101,8 @@ TUI 启动约 12 秒后做一次后台检测:任一源在最近 20 分钟内
101
101
  - **`unknown agent`**:源名以 `dsh-tui migrate` 无参输出的名单为准。
102
102
  - **`needs the profile's compiled copy`**:profile 内编译产物缺失或过旧,
103
103
  先运行 `dsh-tui update`。
104
+ - **`migrate` 无法运行 / `could not run`**:入口存在,但依赖加载或执行失败;
105
+ 根据后面的包名与原因检查 PATH 上的 `dsh` 安装,而不是重复升级 TUI。
104
106
  - **导入数低于扫描计数**:扫描计数是候选文件数(按文件名匹配),
105
107
  导入会过滤解析失败与空对话,略低属正常。
106
108
  - **全新 `DSH_HOME` 首跑报 installation rejected**:profile 自举撞上
@@ -110,6 +112,8 @@ TUI 启动约 12 秒后做一次后台检测:任一源在最近 20 分钟内
110
112
 
111
113
  ## 设计取舍(维护者与贡献者参考)
112
114
 
115
+ - CLI 与 TUI 子进程在首次导入迁移模块前安装宿主解析,结束时释放;
116
+ 已初始化 profile 的扫描与 dry-run 不写配置、不组合用户插件。
113
117
  - 解析与 IO 分离:`adapters/<源>.parse.ts` 是纯函数(原始文本 → 轮模型),
114
118
  共享规则在 `parse/`(jsonl 坏行计数、注入识别与包装剥离、标题归一、
115
119
  工具调用配对);adapter 只做文件发现。OMP 仍产出角色列表,经
@@ -37,7 +37,7 @@ reference**, not a promise:
37
37
  | Tier | Seams |
38
38
  | --- | --- |
39
39
  | Stable candidate (shape frozen; breaking changes go through a minor-version deprecation warning before removal) | VI settings sections · VIII full-screen scenes · X managed dialogs · XI status line (+ footer fields via `setField`) · XII keyboard shortcuts · XIII entry renderers |
40
- | Experimental (may still shift with dsh-std / the TUI Profile) | IX decision events · toast notifications (`ctx.tuiToast`, new) · **Side panels (`ctx.tuiPanels`, full panel + compact row, experimental)** |
40
+ | Experimental (may still shift with dsh-std / the TUI Profile) | IX decision events · toast notifications (`ctx.tuiToast`, new) · **Side panels (`ctx.tuiPanels`, full panel + compact row, experimental)** · XV `@`-mention providers (`ctx.tuiMentions`, new) |
41
41
  | Upstream-tracked (stability owned by the cordis / dsh mechanisms underneath) | I session events · II official prompt slots · III bundled skills · IV themes · V system-prompt sections · VII profile composition |
42
42
 
43
43
  **Footer fields (an addition to seam XI)**: `ctx.tuiStatus.setField(key, text,
@@ -85,6 +85,22 @@ Also an experimental public surface:
85
85
  ④ keep the body content **unchanged** to hit `React.memo` (strings compare
86
86
  by value, so a fresh string with the same content still hits; only changed
87
87
  content re-runs formatting and layout, while lexing is cached by content).
88
+ - **`@`-mention providers (experimental, seam XV)**: `ctx.tuiMentions.register({
89
+ id, title, complete(query, signal) })` adds plugin rows to the composer's `@`
90
+ completion popup (the same card as workspace files). A row is `{ label,
91
+ detail?, insertText }`: choosing it replaces the typed `@query` with
92
+ `insertText` (plain text, one line, ≤200 characters, no `@` mention token of
93
+ its own), which is never resolved as a path at submit time. Plugin rows merge
94
+ into the file list by the same fuzzy score (file order is kept, a tie goes to
95
+ the file), and the card title switches from "files" to "mentions" once one is
96
+ present; with no provider the popup is unchanged frame for frame. Every query
97
+ gets its own AbortSignal: typing on aborts the previous call, each call has a
98
+ 300 ms budget, and a timeout or throw costs only that provider's rows; ≤50 rows
99
+ per provider per query, ≤4 providers per plugin, ≤16 in total; `register`
100
+ throws on malformed input or an exhausted budget, and the disposer is bound to
101
+ the activation. Types live at `@deepseek-harness-tui/dsh-tui/extensions` and
102
+ `./api`; the rule table is seam XV of the
103
+ [admission & development guide](../tui-profile/docs/plugin-admission-and-development.md).
88
104
  - The `@deepseek-harness-tui/dsh-tui/test-utils` subpath and
89
105
  `ctx.tuiPluginHost.grants.corrupt` were removed in the adapter layering
90
106
  refactor (#705).
@@ -32,7 +32,7 @@
32
32
  | 分级 | 接缝 |
33
33
  | --- | --- |
34
34
  | 稳定候选(形态冻结;如有破坏性变更,先在次版本弃用告警再移除) | 六 设置区块 · 八 全屏场景 · 十 托管对话框 · 十一 状态行(+ 底栏字段 `setField`) · 十二 键盘快捷键 · 十三 条目渲染器 |
35
- | 实验性(仍可能随 dsh-std / TUI Profile 演进调整) | 九 决策事件 · toast 通知(`ctx.tuiToast`,新增) · **侧栏 Panel(`ctx.tuiPanels`,full 面板与 compact 行,实验性)** |
35
+ | 实验性(仍可能随 dsh-std / TUI Profile 演进调整) | 九 决策事件 · toast 通知(`ctx.tuiToast`,新增) · **侧栏 Panel(`ctx.tuiPanels`,full 面板与 compact 行,实验性)** · 十五 `@` 提及提供方(`ctx.tuiMentions`,新增) |
36
36
  | 跟随上游(稳定性由 cordis / dsh 官方机制决定) | 一 会话事件 · 二 官方 prompt 槽位 · 三 技能打包 · 四 主题 · 五 system prompt 段 · 七 profile 组合 |
37
37
 
38
38
  另:
@@ -68,6 +68,17 @@
68
68
  偏好**(终端支持图形时走图片),行内公式不走图片、仍排成 Unicode;④ 正文
69
69
  内容**保持不变**才能命中 `React.memo`(字符串按值比较,内容相同的新字符串
70
70
  一样命中;只有内容变化才重跑格式化与排版,分词按内容缓存)。
71
+ - **`@` 提及提供方(实验性,接缝十五)**:`ctx.tuiMentions.register({ id,
72
+ title, complete(query, signal) })` 往输入框的 `@` 补全浮窗加插件行(与工作区
73
+ 文件同一张卡)。行是 `{ label, detail?, insertText }`:选中后 `insertText`
74
+ (纯文本、单行、≤200 字符、不得含 `@` 提及记号)替换敲入的 `@query`,提交时
75
+ 不按路径解析。插件行按与文件同一个模糊分并入(文件顺序不动、平分归文件),
76
+ 出现插件行时卡片标题从「文件」变「提及」;没有提供方时浮窗逐帧不变。每次查询
77
+ 单独一个 AbortSignal:继续打字即 abort 上一次,单次预算 300ms,超时/抛错只丢
78
+ 它自己那份;每提供方每次 ≤50 行,每插件 ≤4 个、全局 ≤16 个;`register` 遇
79
+ 非法输入或超额直接抛错,dispose 随 activation 回收。类型见
80
+ `@deepseek-harness-tui/dsh-tui/extensions` 与 `./api`,规则表见
81
+ [准入与开发指南](../tui-profile/docs/plugin-admission-and-development.md)接缝十五。
71
82
  - `@deepseek-harness-tui/dsh-tui/test-utils` 子路径与
72
83
  `ctx.tuiPluginHost.grants.corrupt` 已随 adapter 分层重构(#705)移除。
73
84
  - **后端贡献族(`tui.dsh/v1alpha1` `Backend`,接缝十四)的公开面已随第一版 apiVersion 冻结**:类型面
@@ -112,7 +112,7 @@ Available color keys by purpose:
112
112
  - Panels/borders: `permission`, `permissionShimmer`, `promptBorder`, `promptBorderShimmer`, `bashBorder`, `planMode`, `ide`, `background`
113
113
  - Body text: `text`, `inverseText`, `inactive`, `inactiveShimmer`, `subtle`
114
114
  - Tool names & status dots: `toolNameMutate`, `toolNameExec`, `toolDotExec`, `toolDotRead`, `toolDotWrite`, `toolDotWeb`, `toolDotTask`
115
- - Tool card surfaces: `toolCardBackground`, `toolCardBackgroundDim`
115
+ - Tool card surfaces: `toolCardBackground`, `toolCardBackgroundDim`, `presentCardWarm`, `presentCardTint`
116
116
  - Status: `autoAccept`, `success`, `error`, `warning`, `warningShimmer`, `merged`
117
117
  - Diff: `diffAdded`, `diffRemoved`, `diffAddedDimmed`, `diffRemovedDimmed`, `diffAddedWord`, `diffRemovedWord`
118
118
  - Diff syntax highlighting: `syntaxKeyword`, `syntaxString`, `syntaxComment`, `syntaxNumber`, `syntaxFunction`, `syntaxType`
@@ -105,7 +105,7 @@ DSH_TUI_THEME
105
105
  - 正文:`text`、`inverseText`、`inactive`、`inactiveShimmer`、`subtle`
106
106
  - 工具名与状态点:`toolNameMutate`、`toolNameExec`、`toolDotExec`、`toolDotRead`
107
107
  - 工具名与状态点(续):`toolDotWrite`、`toolDotWeb`、`toolDotTask`
108
- - 工具卡衬底:`toolCardBackground`、`toolCardBackgroundDim`
108
+ - 工具卡衬底:`toolCardBackground`、`toolCardBackgroundDim`、`presentCardWarm`、`presentCardTint`
109
109
  - 状态:`autoAccept`、`success`、`error`、`warning`、`warningShimmer`、`merged`
110
110
  - diff:`diffAdded`、`diffRemoved`、`diffAddedDimmed`、`diffRemovedDimmed`
111
111
  - diff(续):`diffAddedWord`、`diffRemovedWord`