@askdkc/dsh-cli 0.13.5 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/bin/{dsh-tui.js → dsh-cli.js} +27 -27
  2. package/cordis.patch.yml +32 -32
  3. package/cordis.yml +17 -17
  4. package/lib/types/activityPrefs.d.ts +2 -2
  5. package/lib/types/activityPrefs.js +2 -2
  6. package/lib/types/adapter/channel/actions.js +1 -1
  7. package/lib/types/adapter/channel/consumer.js +1 -1
  8. package/lib/types/adapter/channel/internal-token.js +1 -1
  9. package/lib/types/adapter/channel/plugins.js +1 -1
  10. package/lib/types/adapter/channel/session-projection.js +3 -3
  11. package/lib/types/adapter/channel/transcript.js +1 -1
  12. package/lib/types/adapter/channel/ui.js +3 -3
  13. package/lib/types/adapter/kernel/host-facade.d.ts +1 -1
  14. package/lib/types/adapter/kernel/host-facade.js +6 -6
  15. package/lib/types/adapter/kernel/host-probe-access.d.ts +1 -1
  16. package/lib/types/adapter/kernel/host-probe-access.js +6 -6
  17. package/lib/types/adapter/kernel/kernel-runtime.js +1 -1
  18. package/lib/types/adapter/kernel/legacy-facade.d.ts +1 -1
  19. package/lib/types/adapter/kernel/legacy-facade.js +1 -1
  20. package/lib/types/adapter/kernel/replay-isolation.js +1 -1
  21. package/lib/types/adapter/kernel/runtime.d.ts +1 -1
  22. package/lib/types/adapter/kernel/runtime.js +7 -7
  23. package/lib/types/adapter/ports/channel-display.d.ts +1 -1
  24. package/lib/types/adapter/ports/channel-ui.d.ts +15 -15
  25. package/lib/types/adapter/standard/descriptor.d.ts +1 -1
  26. package/lib/types/adapter/standard/descriptor.js +2 -2
  27. package/lib/types/adapter/standard/registry.d.ts +1 -1
  28. package/lib/types/adapter/standard/registry.js +2 -2
  29. package/lib/types/adapter/standard/tui-extension.d.ts +2 -2
  30. package/lib/types/adapter/standard/tui-extension.js +3 -3
  31. package/lib/types/adapter/upstream/channel-driver.js +10 -10
  32. package/lib/types/adapter/upstream/decisions-driver.js +3 -3
  33. package/lib/types/adapter/upstream/extensions-driver.js +18 -18
  34. package/lib/types/adapter/upstream/host-descriptor-driver.js +4 -4
  35. package/lib/types/adapter/upstream/presentation-driver.js +5 -5
  36. package/lib/types/adapter/upstream/scenes-driver.js +4 -4
  37. package/lib/types/adapter/upstream/settings-driver.js +4 -4
  38. package/lib/types/adapter/upstream/workspace-driver.js +2 -2
  39. package/lib/types/bootstrap/state.d.ts +4 -4
  40. package/lib/types/bootstrap/state.js +4 -4
  41. package/lib/types/{tuiDisplayPrefs.d.ts → cliDisplayPrefs.d.ts} +1 -1
  42. package/lib/types/{tuiDisplayPrefs.d.ts.map → cliDisplayPrefs.d.ts.map} +1 -1
  43. package/lib/types/{tuiDisplayPrefs.js → cliDisplayPrefs.js} +1 -1
  44. package/lib/types/commands.js +7 -7
  45. package/lib/types/components/AutoRecapRow.d.ts +1 -1
  46. package/lib/types/components/AutoRecapRow.js +1 -1
  47. package/lib/types/components/HelpMenu.d.ts +1 -1
  48. package/lib/types/components/HelpMenu.js +1 -1
  49. package/lib/types/components/LogoV2.d.ts +2 -2
  50. package/lib/types/components/LogoV2.d.ts.map +1 -1
  51. package/lib/types/components/LogoV2.js +5 -19
  52. package/lib/types/components/MermaidDiagram.js +1 -1
  53. package/lib/types/components/MessageList.d.ts +2 -2
  54. package/lib/types/components/MessageList.js +1 -1
  55. package/lib/types/components/PageMargin.d.ts +3 -3
  56. package/lib/types/components/PageMargin.js +1 -1
  57. package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
  58. package/lib/types/components/PluginSceneBoundary.js +1 -1
  59. package/lib/types/components/PromptInput.d.ts +1 -1
  60. package/lib/types/components/PromptInput.js +3 -3
  61. package/lib/types/components/ScrollbarGutter.d.ts +1 -1
  62. package/lib/types/components/ScrollbarGutter.js +1 -1
  63. package/lib/types/components/Select.d.ts +1 -1
  64. package/lib/types/components/Select.js +1 -1
  65. package/lib/types/components/SplitDiffView.d.ts +1 -1
  66. package/lib/types/components/ThemePicker.d.ts +1 -1
  67. package/lib/types/components/ThemePicker.js +1 -1
  68. package/lib/types/components/activityFrames.d.ts +1 -1
  69. package/lib/types/components/activityFrames.js +1 -1
  70. package/lib/types/components/design-system/Byline.d.ts +1 -1
  71. package/lib/types/components/design-system/Byline.js +1 -1
  72. package/lib/types/components/design-system/Divider.d.ts +1 -1
  73. package/lib/types/components/design-system/Divider.js +1 -1
  74. package/lib/types/components/design-system/StatusIcon.d.ts +1 -1
  75. package/lib/types/components/design-system/StatusIcon.js +1 -1
  76. package/lib/types/components/design-system/ThemeProvider.d.ts +1 -1
  77. package/lib/types/components/design-system/ThemeProvider.js +11 -11
  78. package/lib/types/components/design-system/ThemedBox.d.ts +1 -1
  79. package/lib/types/components/design-system/ThemedBox.js +1 -1
  80. package/lib/types/components/design-system/ThemedText.d.ts +1 -1
  81. package/lib/types/components/design-system/ThemedText.js +1 -1
  82. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +1 -1
  83. package/lib/types/components/messages/AssistantThinkingMessage.js +1 -1
  84. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +3 -3
  85. package/lib/types/components/messages/AssistantToolUseMessage.js +1 -1
  86. package/lib/types/components/messages/originalImage.js +1 -1
  87. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +1 -1
  88. package/lib/types/components/questions/AskUserQuestionPanel.js +1 -1
  89. package/lib/types/components/smoothReveal.d.ts +1 -1
  90. package/lib/types/components/smoothReveal.js +1 -1
  91. package/lib/types/customTheme.d.ts +5 -5
  92. package/lib/types/customTheme.js +7 -7
  93. package/lib/types/dsh-adapter/activity-store.d.ts +1 -1
  94. package/lib/types/dsh-adapter/activity-store.js +3 -3
  95. package/lib/types/dsh-adapter/bundled-presets.js +2 -2
  96. package/lib/types/dsh-adapter/channel/action-readiness.js +2 -2
  97. package/lib/types/dsh-adapter/channel/agent-view-projection.js +1 -1
  98. package/lib/types/dsh-adapter/channel/background-action.js +1 -1
  99. package/lib/types/dsh-adapter/channel/binding-events.js +1 -1
  100. package/lib/types/dsh-adapter/channel/binding.js +14 -14
  101. package/lib/types/dsh-adapter/channel/external-commands.js +3 -3
  102. package/lib/types/dsh-adapter/channel/input-delivery.js +1 -1
  103. package/lib/types/dsh-adapter/channel/job-projection.js +1 -1
  104. package/lib/types/dsh-adapter/channel/lifetime-resources.js +1 -1
  105. package/lib/types/dsh-adapter/channel/local-actions.js +1 -1
  106. package/lib/types/dsh-adapter/channel/mode-actions.js +1 -1
  107. package/lib/types/dsh-adapter/channel/mode-permission.js +6 -6
  108. package/lib/types/dsh-adapter/channel/mode-roster.js +1 -1
  109. package/lib/types/dsh-adapter/channel/owner.js +2 -2
  110. package/lib/types/dsh-adapter/channel/preferences.js +1 -1
  111. package/lib/types/dsh-adapter/channel/projection.js +1 -1
  112. package/lib/types/dsh-adapter/channel/reports.js +3 -3
  113. package/lib/types/dsh-adapter/channel/session-fork.js +1 -1
  114. package/lib/types/dsh-adapter/channel/session-metadata.d.ts +4 -4
  115. package/lib/types/dsh-adapter/channel/session-metadata.js +2 -2
  116. package/lib/types/dsh-adapter/channel/session-rewind.js +2 -2
  117. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  118. package/lib/types/dsh-adapter/channel/state.js +1 -1
  119. package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
  120. package/lib/types/dsh-adapter/channel-ui.js +2 -2
  121. package/lib/types/dsh-adapter/channel.js +9 -9
  122. package/lib/types/dsh-adapter/cli-registration.d.ts.map +1 -1
  123. package/lib/types/dsh-adapter/cli-registration.js +5 -4
  124. package/lib/types/dsh-adapter/command-trees.d.ts +1 -1
  125. package/lib/types/dsh-adapter/command-trees.js +2 -2
  126. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +3 -3
  127. package/lib/types/dsh-adapter/compat/sessionLog.js +5 -5
  128. package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -1
  129. package/lib/types/dsh-adapter/compat/settings.js +15 -7
  130. package/lib/types/dsh-adapter/contract.d.ts +1 -1
  131. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/contract.js +0 -1
  133. package/lib/types/dsh-adapter/decision-guard.d.ts +3 -3
  134. package/lib/types/dsh-adapter/decision-guard.js +6 -6
  135. package/lib/types/dsh-adapter/dialogs.d.ts +1 -1
  136. package/lib/types/dsh-adapter/dialogs.js +7 -7
  137. package/lib/types/dsh-adapter/effect-ledger.d.ts +2 -2
  138. package/lib/types/dsh-adapter/effect-ledger.js +5 -5
  139. package/lib/types/dsh-adapter/extension-events.js +10 -10
  140. package/lib/types/dsh-adapter/extensions.d.ts +3 -3
  141. package/lib/types/dsh-adapter/extensions.js +3 -3
  142. package/lib/types/dsh-adapter/host-access.js +11 -11
  143. package/lib/types/dsh-adapter/ide-channel.d.ts +6 -6
  144. package/lib/types/dsh-adapter/ide-channel.js +6 -6
  145. package/lib/types/dsh-adapter/index.d.ts +18 -18
  146. package/lib/types/dsh-adapter/index.js +5 -5
  147. package/lib/types/dsh-adapter/inject-channel.d.ts +4 -4
  148. package/lib/types/dsh-adapter/inject-channel.js +5 -5
  149. package/lib/types/dsh-adapter/invariant.d.ts +9 -2
  150. package/lib/types/dsh-adapter/invariant.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/invariant.js +1 -1
  152. package/lib/types/dsh-adapter/message-observer.d.ts +2 -2
  153. package/lib/types/dsh-adapter/message-observer.js +23 -23
  154. package/lib/types/dsh-adapter/migrate/adapters/scan.js +1 -1
  155. package/lib/types/dsh-adapter/migrate/bin-path.d.ts +1 -1
  156. package/lib/types/dsh-adapter/migrate/bin-path.js +4 -4
  157. package/lib/types/dsh-adapter/migrate/picker.d.ts +1 -1
  158. package/lib/types/dsh-adapter/migrate/picker.js +1 -1
  159. package/lib/types/dsh-adapter/migrate/uuid.js +1 -1
  160. package/lib/types/dsh-adapter/packaged-presets.js +1 -1
  161. package/lib/types/dsh-adapter/plugin-host.d.ts +2 -2
  162. package/lib/types/dsh-adapter/plugin-host.js +32 -32
  163. package/lib/types/dsh-adapter/plugin-storage.d.ts +3 -3
  164. package/lib/types/dsh-adapter/plugin-storage.js +5 -5
  165. package/lib/types/dsh-adapter/plugin.d.ts +4 -4
  166. package/lib/types/dsh-adapter/plugin.js +89 -89
  167. package/lib/types/dsh-adapter/preset-resolution.d.ts +1 -1
  168. package/lib/types/dsh-adapter/presets.js +1 -1
  169. package/lib/types/dsh-adapter/promptDebug.js +1 -1
  170. package/lib/types/dsh-adapter/questions.d.ts +1 -1
  171. package/lib/types/dsh-adapter/questions.js +1 -1
  172. package/lib/types/dsh-adapter/renderers.js +7 -7
  173. package/lib/types/dsh-adapter/scenes.d.ts +1 -1
  174. package/lib/types/dsh-adapter/scenes.js +6 -6
  175. package/lib/types/dsh-adapter/settings-sections.d.ts +1 -1
  176. package/lib/types/dsh-adapter/settings-sections.js +5 -5
  177. package/lib/types/dsh-adapter/sharp.js +1 -1
  178. package/lib/types/dsh-adapter/shortcuts.js +9 -9
  179. package/lib/types/dsh-adapter/status.js +21 -21
  180. package/lib/types/dsh-adapter/themes.js +2 -2
  181. package/lib/types/dsh-adapter/toast.js +7 -7
  182. package/lib/types/dsh-adapter/types.d.ts +0 -1
  183. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  184. package/lib/types/dsh-adapter/workspaces.d.ts +1 -1
  185. package/lib/types/dsh-adapter/workspaces.js +6 -6
  186. package/lib/types/effortPrefs.d.ts +2 -2
  187. package/lib/types/effortPrefs.js +2 -2
  188. package/lib/types/force-production-react.js +1 -1
  189. package/lib/types/herdr.js +4 -4
  190. package/lib/types/homePrefs.js +1 -1
  191. package/lib/types/i18n.d.ts +54 -54
  192. package/lib/types/i18n.js +39 -39
  193. package/lib/types/ink/clearTerminal.d.ts +1 -1
  194. package/lib/types/ink/clearTerminal.js +1 -1
  195. package/lib/types/ink/colorize.js +1 -1
  196. package/lib/types/ink/components/App.d.ts +1 -1
  197. package/lib/types/ink/components/App.js +5 -5
  198. package/lib/types/ink/components/Text.d.ts +1 -1
  199. package/lib/types/ink/devtools.d.ts +1 -1
  200. package/lib/types/ink/dom.d.ts +1 -1
  201. package/lib/types/ink/dom.js +1 -1
  202. package/lib/types/ink/geometry-trace.js +4 -4
  203. package/lib/types/ink/ink.d.ts.map +1 -1
  204. package/lib/types/ink/ink.js +8 -19
  205. package/lib/types/ink/reconciler.d.ts +1 -1
  206. package/lib/types/ink/reconciler.d.ts.map +1 -1
  207. package/lib/types/ink/reconciler.js +6 -3
  208. package/lib/types/ink/render-to-screen.d.ts.map +1 -1
  209. package/lib/types/ink/render-to-screen.js +0 -5
  210. package/lib/types/ink/terminal.js +3 -3
  211. package/lib/types/ink/termio/osc.js +1 -1
  212. package/lib/types/ink/update-overflow-guard.js +2 -2
  213. package/lib/types/minimalMode.d.ts +2 -2
  214. package/lib/types/minimalMode.js +2 -2
  215. package/lib/types/modelGroups.d.ts +1 -1
  216. package/lib/types/modelGroups.js +1 -1
  217. package/lib/types/modelPrefs.d.ts +1 -1
  218. package/lib/types/modelPrefs.js +1 -1
  219. package/lib/types/modelRecents.d.ts +2 -2
  220. package/lib/types/modelRecents.js +2 -2
  221. package/lib/types/package-version.d.ts +3 -0
  222. package/lib/types/package-version.d.ts.map +1 -0
  223. package/lib/types/package-version.js +25 -0
  224. package/lib/types/presetPrefs.d.ts +1 -1
  225. package/lib/types/presetPrefs.js +1 -1
  226. package/lib/types/reload.d.ts +8 -8
  227. package/lib/types/reload.js +4 -4
  228. package/lib/types/screens/Chat.js +27 -27
  229. package/lib/types/screens/StatusLine.js +1 -1
  230. package/lib/types/screens/StatusMetrics.js +1 -1
  231. package/lib/types/sessionHistory.d.ts +3 -3
  232. package/lib/types/sessionHistory.js +7 -7
  233. package/lib/types/sessionModes.js +1 -1
  234. package/lib/types/sessionMounts.d.ts +1 -1
  235. package/lib/types/sessionMounts.js +1 -1
  236. package/lib/types/sessionPins.d.ts +1 -1
  237. package/lib/types/sessionPins.js +1 -1
  238. package/lib/types/terminal-utils/cliHighlight.d.ts +1 -1
  239. package/lib/types/terminal-utils/hash.d.ts +1 -1
  240. package/lib/types/terminal-utils/hash.js +1 -1
  241. package/lib/types/terminal-utils/mermaid.d.ts +1 -1
  242. package/lib/types/terminal-utils/syntaxTheme.js +1 -1
  243. package/lib/types/theme.d.ts +3 -3
  244. package/lib/types/theme.js +3 -3
  245. package/lib/types/themePrefs.d.ts +3 -3
  246. package/lib/types/themePrefs.js +3 -3
  247. package/lib/types/tips.js +4 -4
  248. package/lib/types/trajectory/effortIgnition.d.ts +1 -1
  249. package/lib/types/trajectoryPrefs.d.ts +1 -1
  250. package/lib/types/trajectoryPrefs.js +1 -1
  251. package/lib/types/ui.d.ts +1 -1
  252. package/lib/types/ui.js +1 -1
  253. package/lib/types/update.d.ts +25 -26
  254. package/lib/types/update.d.ts.map +1 -1
  255. package/lib/types/update.js +55 -73
  256. package/lib/types/utils/clipboard.js +1 -1
  257. package/lib/types/utils/credentials.js +2 -2
  258. package/lib/types/utils/debug.d.ts +3 -3
  259. package/lib/types/utils/debug.js +6 -6
  260. package/lib/types/utils/earlyInput.d.ts +1 -1
  261. package/lib/types/utils/earlyInput.js +1 -1
  262. package/lib/types/utils/externalEditor.js +1 -1
  263. package/lib/types/utils/fullscreen.d.ts +3 -3
  264. package/lib/types/utils/fullscreen.js +4 -4
  265. package/lib/types/utils/log.js +1 -1
  266. package/lib/types/utils/paths.d.ts +3 -3
  267. package/lib/types/utils/paths.js +4 -4
  268. package/lib/types/working-activity.js +1 -1
  269. package/node_modules/@askdkc/dsh-auth/dsh-plugin.json +1 -1
  270. package/node_modules/@askdkc/dsh-auth/lib/index.d.ts +2 -2
  271. package/node_modules/@askdkc/dsh-auth/lib/index.js +2 -2
  272. package/node_modules/@askdkc/dsh-auth/lib/pi-ai.d.ts +0 -2
  273. package/node_modules/@askdkc/dsh-auth/lib/pi-ai.js +0 -2
  274. package/node_modules/@askdkc/dsh-auth/lib/service.d.ts +1 -1
  275. package/node_modules/@askdkc/dsh-auth/lib/service.js +2 -2
  276. package/node_modules/dsh-working-activity/lib/client.js.map +1 -1
  277. package/node_modules/dsh-working-activity/lib/types/client/index.d.ts +1 -1
  278. package/node_modules/dsh-working-activity/lib/types/config.d.ts +2 -2
  279. package/node_modules/dsh-working-activity/lib/types/config.js +2 -2
  280. package/node_modules/dsh-working-activity/lib/types/frames.d.ts +1 -1
  281. package/node_modules/dsh-working-activity/lib/types/frames.js +1 -1
  282. package/node_modules/dsh-working-activity/lib/types/index.d.ts +1 -1
  283. package/node_modules/dsh-working-activity/lib/types/index.js +2 -2
  284. package/node_modules/dsh-working-activity/lib/types/invariant.d.ts +13 -1
  285. package/node_modules/dsh-working-activity/lib/types/lang.d.ts +5 -5
  286. package/node_modules/dsh-working-activity/lib/types/lang.js +8 -8
  287. package/node_modules/dsh-working-activity/lib/types/projection.d.ts +1 -1
  288. package/node_modules/dsh-working-activity/lib/types/projection.js +1 -1
  289. package/node_modules/dsh-working-activity/lib/types/status.d.ts +1 -1
  290. package/node_modules/dsh-working-activity/lib/types/status.js +1 -1
  291. package/node_modules/dsh-working-activity/package.json +0 -4
  292. package/node_modules/dsh-working-activity/src/client/index.ts +1 -1
  293. package/node_modules/dsh-working-activity/src/config.ts +2 -2
  294. package/node_modules/dsh-working-activity/src/frames.ts +1 -1
  295. package/node_modules/dsh-working-activity/src/index.ts +4 -4
  296. package/node_modules/dsh-working-activity/src/invariant.ts +10 -3
  297. package/node_modules/dsh-working-activity/src/lang.ts +8 -8
  298. package/node_modules/dsh-working-activity/src/projection.ts +1 -1
  299. package/node_modules/dsh-working-activity/src/status.ts +1 -1
  300. package/package.json +8 -13
  301. package/presets/liangshen/agent.cordis.yml +1 -1
  302. package/presets/liangshen/custom-bash.mjs +2 -2
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Debug logger for the renderer. Writes to stderr only when
3
- * `DSH_TUI_DEBUG` is set, so normal runs stay quiet.
3
+ * `DSH_CLI_DEBUG` is set, so normal runs stay quiet.
4
4
  * @param message - The message to log.
5
5
  * @param fields - Optional JSON-serialized fields appended to the line.
6
6
  */
7
7
  export declare function logForDebugging(message: string, fields?: Record<string, unknown>): void;
8
8
  /**
9
- * Mouse-chain diagnostics: appends to `~/.dsh-tui/mouse-debug.log` when
10
- * `DSH_TUI_DEBUG_MOUSE` is set. Unlike logForDebugging (stderr), a file
9
+ * Mouse-chain diagnostics: appends to `~/.dsh-cli/mouse-debug.log` when
10
+ * `DSH_CLI_DEBUG_MOUSE` is set. Unlike logForDebugging (stderr), a file
11
11
  * keeps the fullscreen alt screen unpolluted and survives the session for
12
12
  * post-mortem reading. Every append is try/catch-guarded — diagnostics
13
13
  * must never take the UI down.
@@ -3,19 +3,19 @@ import { DATA_DIR } from './paths.js';
3
3
  import { join } from 'node:path';
4
4
  /**
5
5
  * Debug logger for the renderer. Writes to stderr only when
6
- * `DSH_TUI_DEBUG` is set, so normal runs stay quiet.
6
+ * `DSH_CLI_DEBUG` is set, so normal runs stay quiet.
7
7
  * @param message - The message to log.
8
8
  * @param fields - Optional JSON-serialized fields appended to the line.
9
9
  */
10
10
  export function logForDebugging(message, fields) {
11
- if (!process.env.DSH_TUI_DEBUG)
11
+ if (!process.env.DSH_CLI_DEBUG)
12
12
  return;
13
13
  const suffix = fields === undefined ? '' : ` ${JSON.stringify(fields)}`;
14
- process.stderr.write(`[dsh-tui] ${message}${suffix}\n`);
14
+ process.stderr.write(`[dsh-cli] ${message}${suffix}\n`);
15
15
  }
16
16
  /**
17
- * Mouse-chain diagnostics: appends to `~/.dsh-tui/mouse-debug.log` when
18
- * `DSH_TUI_DEBUG_MOUSE` is set. Unlike logForDebugging (stderr), a file
17
+ * Mouse-chain diagnostics: appends to `~/.dsh-cli/mouse-debug.log` when
18
+ * `DSH_CLI_DEBUG_MOUSE` is set. Unlike logForDebugging (stderr), a file
19
19
  * keeps the fullscreen alt screen unpolluted and survives the session for
20
20
  * post-mortem reading. Every append is try/catch-guarded — diagnostics
21
21
  * must never take the UI down.
@@ -23,7 +23,7 @@ export function logForDebugging(message, fields) {
23
23
  * @param fields - Optional JSON-serialized fields appended to the line.
24
24
  */
25
25
  export function logMouseDebug(message, fields) {
26
- if (!process.env.DSH_TUI_DEBUG_MOUSE)
26
+ if (!process.env.DSH_CLI_DEBUG_MOUSE)
27
27
  return;
28
28
  const suffix = fields === undefined ? '' : ` ${JSON.stringify(fields)}`;
29
29
  try {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The renderer calls this once stdin handoff completes. Early-input capture is
3
- * not used by dsh-tui, so this is a no-op.
3
+ * not used by dsh-cli, so this is a no-op.
4
4
  */
5
5
  export declare function stopCapturingEarlyInput(): void;
6
6
  //# sourceMappingURL=earlyInput.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * The renderer calls this once stdin handoff completes. Early-input capture is
3
- * not used by dsh-tui, so this is a no-op.
3
+ * not used by dsh-cli, so this is a no-op.
4
4
  */
5
5
  export function stopCapturingEarlyInput() { }
@@ -222,7 +222,7 @@ export async function editInExternalEditor(draft) {
222
222
  let handed = false;
223
223
  let dir;
224
224
  try {
225
- dir = await mkdtemp(join(tmpdir(), 'dsh-tui-prompt-'));
225
+ dir = await mkdtemp(join(tmpdir(), 'dsh-cli-prompt-'));
226
226
  // .md so markdown-aware editors highlight the draft like a chat message.
227
227
  const file = join(dir, 'input.md');
228
228
  await writeFile(file, draft, 'utf8');
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Whether mouse click handling is disabled. dsh-tui reads its own environment
3
- * flag (`DSH_TUI_DISABLE_MOUSE`) for this decision.
4
- * @returns True when DSH_TUI_DISABLE_MOUSE is set to a truthy value.
2
+ * Whether mouse click handling is disabled. dsh-cli reads its own environment
3
+ * flag (`DSH_CLI_DISABLE_MOUSE`) for this decision.
4
+ * @returns True when DSH_CLI_DISABLE_MOUSE is set to a truthy value.
5
5
  */
6
6
  export declare function isMouseClicksDisabled(): boolean;
7
7
  //# sourceMappingURL=fullscreen.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { isEnvTruthy } from './envUtils.js';
2
2
  /**
3
- * Whether mouse click handling is disabled. dsh-tui reads its own environment
4
- * flag (`DSH_TUI_DISABLE_MOUSE`) for this decision.
5
- * @returns True when DSH_TUI_DISABLE_MOUSE is set to a truthy value.
3
+ * Whether mouse click handling is disabled. dsh-cli reads its own environment
4
+ * flag (`DSH_CLI_DISABLE_MOUSE`) for this decision.
5
+ * @returns True when DSH_CLI_DISABLE_MOUSE is set to a truthy value.
6
6
  */
7
7
  export function isMouseClicksDisabled() {
8
- return isEnvTruthy(process.env.DSH_TUI_DISABLE_MOUSE);
8
+ return isEnvTruthy(process.env.DSH_CLI_DISABLE_MOUSE);
9
9
  }
@@ -5,5 +5,5 @@
5
5
  */
6
6
  export function logError(error) {
7
7
  const text = error instanceof Error ? error.stack ?? error.message : String(error);
8
- process.stderr.write(`[dsh-tui] ${text}\n`);
8
+ process.stderr.write(`[dsh-cli] ${text}\n`);
9
9
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Data-directory paths for the dsh-tui profile. All preferences and history
3
- * live under `~/.dsh-tui`.
2
+ * Data-directory paths for the dsh-cli profile. All preferences and history
3
+ * live under `~/.dsh-cli`.
4
4
  *
5
5
  * The compiled copy (lib/types/utils/paths.js) is also imported by the bin
6
6
  * launcher, mirroring the shellQuote precedent.
@@ -11,6 +11,6 @@
11
11
  * @returns Absolute home path.
12
12
  */
13
13
  export declare function homeDir(): string;
14
- /** Data directory all preferences/history live in (`~/.dsh-tui`). */
14
+ /** Data directory all preferences/history live in (`~/.dsh-cli`). */
15
15
  export declare const DATA_DIR: string;
16
16
  //# sourceMappingURL=paths.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Data-directory paths for the dsh-tui profile. All preferences and history
3
- * live under `~/.dsh-tui`.
2
+ * Data-directory paths for the dsh-cli profile. All preferences and history
3
+ * live under `~/.dsh-cli`.
4
4
  *
5
5
  * The compiled copy (lib/types/utils/paths.js) is also imported by the bin
6
6
  * launcher, mirroring the shellQuote precedent.
@@ -15,5 +15,5 @@ import { join } from 'node:path';
15
15
  export function homeDir() {
16
16
  return homedir() || process.env.USERPROFILE || process.env.HOME || '';
17
17
  }
18
- /** Data directory all preferences/history live in (`~/.dsh-tui`). */
19
- export const DATA_DIR = join(homeDir(), '.dsh-tui');
18
+ /** Data directory all preferences/history live in (`~/.dsh-cli`). */
19
+ export const DATA_DIR = join(homeDir(), '.dsh-cli');
@@ -29,7 +29,7 @@ import { apply as mountedApply } from 'dsh-working-activity';
29
29
  import { mergeActivityPreferences, readActivityConfig } from './activityPrefs.js';
30
30
  export * from 'dsh-working-activity';
31
31
  export const apply = (ctx, config = {}) => {
32
- // The user's own file (~/.dsh-tui/working-activity.json — what /activity
32
+ // The user's own file (~/.dsh-cli/working-activity.json — what /activity
33
33
  // and the settings panel write) folds in under the row: an explicit row
34
34
  // value wins, otherwise the file's feature switches, phrases, tok-per-sec
35
35
  // and work reminder reach the plugin, as they did when the line was folded
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
3
- "id": "com.dsh-tui.dsh-auth",
3
+ "id": "com.dsh-cli.dsh-auth",
4
4
  "name": "dsh-auth",
5
5
  "version": "0.2.0",
6
6
  "manifestVersion": "0.15",
@@ -39,10 +39,10 @@ export declare const name = "dsh-auth";
39
39
  /**
40
40
  * Deliberately empty. A hard code-level inject would deadlock any
41
41
  * composition lacking the `llm`/`commands` services at boot ("pending
42
- * (waiting for service: …)") — the failure mode dsh-tui documented for its
42
+ * (waiting for service: …)") — the failure mode dsh-cli documented for its
43
43
  * own optional rows (#183). Both services resolve per call through
44
44
  * `ctx.get` in {@link apply}; compositions that guarantee them (the
45
- * dsh-tui patch row, this package's bundle patch) declare the inject at the
45
+ * dsh-cli patch row, this package's bundle patch) declare the inject at the
46
46
  * *entry* level, where a stale patch cannot deadlock a newer boot.
47
47
  */
48
48
  export declare const inject: readonly string[];
@@ -45,10 +45,10 @@ export const name = 'dsh-auth';
45
45
  /**
46
46
  * Deliberately empty. A hard code-level inject would deadlock any
47
47
  * composition lacking the `llm`/`commands` services at boot ("pending
48
- * (waiting for service: …)") — the failure mode dsh-tui documented for its
48
+ * (waiting for service: …)") — the failure mode dsh-cli documented for its
49
49
  * own optional rows (#183). Both services resolve per call through
50
50
  * `ctx.get` in {@link apply}; compositions that guarantee them (the
51
- * dsh-tui patch row, this package's bundle patch) declare the inject at the
51
+ * dsh-cli patch row, this package's bundle patch) declare the inject at the
52
52
  * *entry* level, where a stale patch cannot deadlock a newer boot.
53
53
  */
54
54
  export const inject = [];
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * The pi-ai instance owned by the installed dsh-llm-pi-ai adapter.
3
3
  *
4
- * dsh-llm-pi-ai 0.2.0-rc.2 declares pi-ai ^0.87.1; the workspace override
5
- * pins @earendil-works/pi-ai to the latest verified catalog (0.99.1).
6
4
  * Loading a second catalog from dsh-auth and handing its Provider objects to
7
5
  * the adapter crosses package instances and is neither type- nor runtime-safe.
8
6
  * Resolve the adapter's own dependency instead, and derive every public type
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * The pi-ai instance owned by the installed dsh-llm-pi-ai adapter.
3
3
  *
4
- * dsh-llm-pi-ai 0.2.0-rc.2 declares pi-ai ^0.87.1; the workspace override
5
- * pins @earendil-works/pi-ai to the latest verified catalog (0.99.1).
6
4
  * Loading a second catalog from dsh-auth and handing its Provider objects to
7
5
  * the adapter crosses package instances and is neither type- nor runtime-safe.
8
6
  * Resolve the adapter's own dependency instead, and derive every public type
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `ctx.dshAuth` service: the programmatic surface over this plugin's
3
- * mounted provider routes. UIs (the dsh-tui /provider wizard, a web settings
3
+ * mounted provider routes. UIs (the dsh-cli /provider wizard, a web settings
4
4
  * page) enumerate providers with masked sign-in state and drive login/logout
5
5
  * without touching the credential file or the pi-ai flow objects; the `/auth`
6
6
  * command in `command.ts` is a thin textual veneer over the same api.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `ctx.dshAuth` service: the programmatic surface over this plugin's
3
- * mounted provider routes. UIs (the dsh-tui /provider wizard, a web settings
3
+ * mounted provider routes. UIs (the dsh-cli /provider wizard, a web settings
4
4
  * page) enumerate providers with masked sign-in state and drive login/logout
5
5
  * without touching the credential file or the pi-ai flow objects; the `/auth`
6
6
  * command in `command.ts` is a thin textual veneer over the same api.
@@ -195,7 +195,7 @@ export function createDshAuthApi(deps) {
195
195
  throw new Error(`dsh-auth: unknown provider "${target}" (mounted: ${[...deps.profiles.keys()].join(', ')})`);
196
196
  }
197
197
  if (ask === undefined) {
198
- throw new Error(`dsh-auth: signing in to "${target}" needs an interactive surface (run inside dsh-tui or the web client); `
198
+ throw new Error(`dsh-auth: signing in to "${target}" needs an interactive surface (run inside dsh-cli or the web client); `
199
199
  + 'this plugin refuses to assume a browser on this machine');
200
200
  }
201
201
  const existing = inflight.get(target);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["css"],"sources":["../src/client/activity.ts","../src/client/elapsed.ts","../src/client/WorkingLine.tsx","../src/client/index.ts"],"sourcesContent":["/**\n * Client-side contract of the working-activity Web half: the `workingActivity`\n * key of the session-projection type table.\n *\n * The browser reads the line through the session standard kit's\n * `useProjection('workingActivity')` — the host folds the projection from\n * committed session events and ships the whole value, so no client-side domain\n * folding exists and nothing is appended to the session log.\n *\n * The runtime patch that used to carry the value on the conversation snapshot\n * (`ConversationSnapshot.activity`, declared against `@deepseek-ai/dsh-client-runtime`)\n * is obsolete for the current host line: that package is frozen at `0.1.1-rc.2`\n * and absent from the `0.1.7-rc.2` client cohort.\n *\n * {@link WorkingActivityView} is imported from the host half on purpose — one\n * definition of the wire value, so the two halves cannot drift. The import is\n * TYPE-ONLY: a value import would pull host-only code (zod, node builtins) into\n * the browser bundle, which the build's purity gate rejects.\n * @module @deepseek-ai/dsh-working-activity/client/activity\n */\n\nimport type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'\nimport type { WorkingActivityView } from '../projection.js'\n\ndeclare module '@deepseek-ai/dsh-session-projection/types' {\n interface SessionProjectionMap {\n /**\n * Latest folded working line for the current session, or absent while the\n * host unit is unmounted or no committed event has folded yet.\n */\n workingActivity: WorkingActivityView\n }\n}\n\n/**\n * The projection key this package reads, checked against the merged table: a\n * rename on the host side, or a merge that silently failed to land, is a\n * compile error here instead of a dock row that never renders.\n */\nexport const ACTIVITY_PROJECTION_KEY =\n 'workingActivity' satisfies Extract<keyof SessionProjectionMap, string>\n\nexport type { WorkingActivityView }\n","/**\n * Client-side elapsed re-tick for the working line.\n *\n * The projection is event-driven: the host pushes a value when a committed\n * event folds, and `view` renders at read time. The TUI creates its own\n * cadence by re-reading; a browser cannot, so between folds the shipped\n * `line` ages — measured on the rc.2 corridor, one turn carried three\n * pushes, freezing the elapsed text for the length of a tool. While `live`\n * is true, the dock row therefore re-ticks the ONE moving segment locally:\n * the elapsed counter.\n *\n * Safety: a segment is replaced only when it matches the shapes the host\n * emits (`总1m23s` / `total 5s` / a bare `87ms`). Any format drift on the\n * host side makes the matcher miss and the row falls back to the host's\n * (aging) text — stale, but never wrong. Settled `✓` lines carry a fixed\n * duration, not a counter, and are left alone. This module is deliberately\n * dependency-free: the host's `phrases.ts` reaches node builtins for\n * language detection, which the client bundle's purity gate rejects.\n * @module @deepseek-ai/dsh-working-activity/client/elapsed\n */\n\n/** What the caller knows about the value whose line is displayed. */\nexport interface ElapsedTickView {\n /** Current phase; only live phases carry a moving counter. */\n readonly phase: 'idle' | 'waiting' | 'thinking' | 'tool' | 'done'\n /** Wall clock the current phase began (the tool counter counts from it). */\n readonly phaseStartedAt: number\n /** Wall clock the current turn began (the elapsed counter counts from it). */\n readonly turnStartedAt: number\n /** Language the host rendered `line` in. */\n readonly lang: 'zh' | 'en'\n}\n\n/** The duration shapes the host emits: `87ms`, `5s`, `1m23s`, `4h0m`. */\nconst DURATION = /^\\d+(?:ms|s|m\\d+s|h\\d+m)$/\n/** The localized elapsed segment: `总5s`, `total 1m23s`. */\nconst ELAPSED = /^(?:总|total )\\d+(?:ms|s|m\\d+s|h\\d+m)$/\n/** The segment separator the host composes the line with. */\nconst SEP = ' · '\n\n/** Mirror of the host's `fmtDuration` (second granularity and shapes). */\nfunction formatDuration(ms: number): string {\n if (ms < 1000) return '0s'\n const total = Math.floor(ms / 1000)\n if (total < 60) return `${total}s`\n const minutes = Math.floor(total / 60)\n const seconds = total % 60\n if (minutes < 60) return `${minutes}m${seconds}s`\n return `${Math.floor(minutes / 60)}h${minutes % 60}m`\n}\n\n/** Mirror of the host's `durationLabel` (sub-second reads in milliseconds). */\nfunction formatCounter(ms: number): string {\n return ms < 1000 ? `${Math.max(0, Math.floor(ms))}ms` : formatDuration(ms)\n}\n\n/**\n * Replace the line's elapsed segment with one computed at `nowMs`.\n *\n * @param line - The host-rendered line (aged to the last fold).\n * @param view - The value's phase, counters and language.\n * @param nowMs - Wall clock to re-tick to.\n * @returns the line with a current counter, or the input when there is\n * nothing safe to replace.\n */\nexport function refreshElapsedSuffix(line: string, view: ElapsedTickView, nowMs: number): string {\n if (view.phase === 'idle' || view.phase === 'done') return line\n // A settled tool's `✓ … · 887ms` is a fixed fact, not a counter.\n if (line.startsWith('✓ ')) return line\n // The tool counter counts from the phase's entry; with concurrent tools the\n // host's own counter tracks the OLDEST one, so this may trail it by the\n // overlap — a display nuance, not a wrong number.\n const since = view.phase === 'tool' ? view.phaseStartedAt : view.turnStartedAt\n if (!(since > 0)) return line\n const elapsed = Math.max(0, nowMs - since)\n const replacement = view.phase === 'tool'\n ? formatCounter(elapsed)\n : (view.lang === 'en' ? `total ${formatDuration(elapsed)}` : `总${formatDuration(elapsed)}`)\n const segments = line.split(SEP)\n for (let i = segments.length - 1; i > 0; i--) {\n const segment = segments[i]\n if (segment !== undefined && (DURATION.test(segment) || ELAPSED.test(segment))) {\n segments[i] = replacement\n return segments.join(SEP)\n }\n }\n return line\n}\n","// Working-line dock entry: one dim full-width row above the composer card\n// showing the live working-activity line — phase-colored breathing marker,\n// the host-composed status line, and the turn's tool count badge.\n// Renders for every live phase (waiting/thinking/tool) and the done summary;\n// hides while idle or before the first frame.\n//\n// Data path: the host folds the `workingActivity` session projection and ships\n// the whole value to clients; the session standard kit's `useProjection` reads\n// it by key. Nothing is appended to the session log, and no client-runtime\n// patch is involved — the old `ConversationSnapshot.activity` transport is dead\n// on the current host line.\n//\n// The 'conversation.input.dock' SlotMap declaration lives in\n// @deepseek-ai/dsh-client-ui-conversation/client (contract/slots.ts) and the\n// `useProjection` standard seat in @deepseek-ai/dsh-client-ui-session/client;\n// this entry contributes into the slot without owning it.\nimport type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\n// Type-only merges, erased at build time and never required by the bundle:\n// the ui-conversation SlotMap entry (the dock seat's owner props) and the\n// ui-session standard kit (`useProjection`). ./activity.ts carries this\n// package's own projection-key merge, the key constant, and the view type.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-session/client'\nimport { ACTIVITY_PROJECTION_KEY, type WorkingActivityView } from './activity.ts'\nimport { refreshElapsedSuffix } from './elapsed.js'\nimport css from './WorkingLine.module.css'\n\n/** Full props of the dock entry: the input-zone runtime share (session standard kit). */\nexport type WorkingLineProps = PropsRuntime<'conversation.input.dock'>\n\n/** Tool-count badge copy (no locale seat: the line text itself is host-composed). */\nconst TOOLS_LABEL = 'tools this turn'\n\n/** The one live tick attachment (exactly one dock row exists at a time). */\nlet tickAttachment: { readonly el: HTMLElement; readonly timer: ReturnType<typeof setInterval> } | undefined\n\n/**\n * Re-tick the elapsed counter on the mounted text node, once per second.\n *\n * The projection only pushes when a committed event folds (measured: three\n * pushes per turn), so the host-rendered `line` ages between folds — the\n * elapsed text would freeze for the length of a tool. The row therefore\n * re-ticks the ONE moving segment locally; only segments matching the host's\n * elapsed shapes are ever replaced (see ./elapsed.ts).\n *\n * Imperative on purpose, and hook-free: the component is also invoked as a\n * plain function (the bundle gate reads its tree without a renderer), and a\n * ref callback plus this module-level slot is enough — React detaches a\n * changed inline ref with `null` first, which is where the previous interval\n * dies; a settled value simply never attaches a new one.\n */\nfunction attachElapsedTick(el: HTMLElement | null, activity: WorkingActivityView | undefined): void {\n if (tickAttachment !== undefined && (el === null || tickAttachment.el !== el)) {\n clearInterval(tickAttachment.timer)\n tickAttachment = undefined\n }\n if (el === null || activity === undefined || activity.live !== true) return\n const paint = (): void => {\n el.textContent = refreshElapsedSuffix(activity.line, activity, Date.now())\n }\n paint()\n tickAttachment = { el, timer: setInterval(paint, 1000) }\n}\n\n/**\n * Working-line dock entry: reads the session's latest `workingActivity`\n * projection value and renders the row, or nothing when idle/absent.\n */\nexport function WorkingLine({ useProjection }: WorkingLineProps) {\n // `undefined` is the uniform absence signal: the host unit is unmounted, no\n // frame carried the key for this session yet, or no session is current.\n // Rendering nothing (rather than an empty row) keeps the dock from reserving\n // space ahead of the first committed event.\n //\n // The annotation is load-bearing: `useProjection`'s precise engine type lives\n // in the session kit's own dependency (`@deepseek-ai/dsh-api-session-controller`),\n // which this package deliberately does not install (it would drag the whole\n // client peer closure into the dev tree). The key is pinned in ./activity.ts\n // against the merged table; this keeps the render body checked against the\n // host's view type.\n const activity: WorkingActivityView | undefined = useProjection(ACTIVITY_PROJECTION_KEY)\n if (activity === undefined || activity.phase === 'idle' || activity.line === '') return null\n return (\n <div className={css.line} data-activity-phase={activity.phase}>\n <span className={css.marker} aria-hidden=\"true\" />\n <span className={css.text} ref={el => attachElapsedTick(el, activity)}>{activity.line}</span>\n {activity.toolCount > 0 && (\n <span className={css.tools} title={`${activity.toolCount} ${TOOLS_LABEL}`}>\n {activity.toolCount}\n </span>\n )}\n </div>\n )\n}\n","/**\n * Working-activity surface plugin, browser half: the working-line entry in\n * the conversation.input.dock strip.\n *\n * The node half folds every committed session event into the `workingActivity`\n * session projection and the host ships that value to clients; this dock entry\n * reads it through the session standard kit's `useProjection` and owns no\n * store, no refresh chain, and no event listener. Nothing is appended to the\n * session log — the reason dsh-tui mounts this plugin with `publish: false`.\n *\n * Mount contract (see the root README's \"Web UI 集成\" section): the web\n * client's client-modules host scans loader entries for `dsh.client`\n * declarations and serves this package's `./client` bundle at\n * /plugins/dsh-working-activity/client.js. The entry contributes into the\n * input dock — no official-source patch is involved.\n */\nimport type { Context } from '@deepseek-ai/cordis'\n// Type-only merges: the ui-conversation SlotMap entry (the dock seat) and the\n// ui-renderer `slots` service on the client Context. Both are erased at build\n// time and never required by the bundle.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport { WorkingLine } from './WorkingLine.tsx'\n\nexport { WorkingLine, type WorkingLineProps } from './WorkingLine.tsx'\nexport type { WorkingActivityView } from './activity.ts'\n\n/** Required services for the dock registration. */\nexport const inject = ['slots']\n\n/**\n * Client plugin body: the working-line dock entry.\n * @param ctx - client root context.\n */\nexport function apply(ctx: Context): void {\n ctx.slots.inject('conversation.input.dock', () => ctx.slots.register({\n name: 'conversation.input.dock',\n // The pre-slots patch used the same id in ui-conversation; entries with\n // equal order render in registration order, and goal (10) / queue (20)\n // keep their seats — this row sits between them.\n id: 'activity',\n order: 15,\n registrant: 'dsh-working-activity',\n }, WorkingLine))\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"client.js","names":["css"],"sources":["../src/client/activity.ts","../src/client/elapsed.ts","../src/client/WorkingLine.tsx","../src/client/index.ts"],"sourcesContent":["/**\n * Client-side contract of the working-activity Web half: the `workingActivity`\n * key of the session-projection type table.\n *\n * The browser reads the line through the session standard kit's\n * `useProjection('workingActivity')` — the host folds the projection from\n * committed session events and ships the whole value, so no client-side domain\n * folding exists and nothing is appended to the session log.\n *\n * The runtime patch that used to carry the value on the conversation snapshot\n * (`ConversationSnapshot.activity`, declared against `@deepseek-ai/dsh-client-runtime`)\n * is obsolete for the current host line: that package is frozen at `0.1.1-rc.2`\n * and absent from the `0.1.7-rc.2` client cohort.\n *\n * {@link WorkingActivityView} is imported from the host half on purpose — one\n * definition of the wire value, so the two halves cannot drift. The import is\n * TYPE-ONLY: a value import would pull host-only code (zod, node builtins) into\n * the browser bundle, which the build's purity gate rejects.\n * @module @deepseek-ai/dsh-working-activity/client/activity\n */\n\nimport type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'\nimport type { WorkingActivityView } from '../projection.js'\n\ndeclare module '@deepseek-ai/dsh-session-projection/types' {\n interface SessionProjectionMap {\n /**\n * Latest folded working line for the current session, or absent while the\n * host unit is unmounted or no committed event has folded yet.\n */\n workingActivity: WorkingActivityView\n }\n}\n\n/**\n * The projection key this package reads, checked against the merged table: a\n * rename on the host side, or a merge that silently failed to land, is a\n * compile error here instead of a dock row that never renders.\n */\nexport const ACTIVITY_PROJECTION_KEY =\n 'workingActivity' satisfies Extract<keyof SessionProjectionMap, string>\n\nexport type { WorkingActivityView }\n","/**\n * Client-side elapsed re-tick for the working line.\n *\n * The projection is event-driven: the host pushes a value when a committed\n * event folds, and `view` renders at read time. The TUI creates its own\n * cadence by re-reading; a browser cannot, so between folds the shipped\n * `line` ages — measured on the rc.2 corridor, one turn carried three\n * pushes, freezing the elapsed text for the length of a tool. While `live`\n * is true, the dock row therefore re-ticks the ONE moving segment locally:\n * the elapsed counter.\n *\n * Safety: a segment is replaced only when it matches the shapes the host\n * emits (`总1m23s` / `total 5s` / a bare `87ms`). Any format drift on the\n * host side makes the matcher miss and the row falls back to the host's\n * (aging) text — stale, but never wrong. Settled `✓` lines carry a fixed\n * duration, not a counter, and are left alone. This module is deliberately\n * dependency-free: the host's `phrases.ts` reaches node builtins for\n * language detection, which the client bundle's purity gate rejects.\n * @module @deepseek-ai/dsh-working-activity/client/elapsed\n */\n\n/** What the caller knows about the value whose line is displayed. */\nexport interface ElapsedTickView {\n /** Current phase; only live phases carry a moving counter. */\n readonly phase: 'idle' | 'waiting' | 'thinking' | 'tool' | 'done'\n /** Wall clock the current phase began (the tool counter counts from it). */\n readonly phaseStartedAt: number\n /** Wall clock the current turn began (the elapsed counter counts from it). */\n readonly turnStartedAt: number\n /** Language the host rendered `line` in. */\n readonly lang: 'zh' | 'en'\n}\n\n/** The duration shapes the host emits: `87ms`, `5s`, `1m23s`, `4h0m`. */\nconst DURATION = /^\\d+(?:ms|s|m\\d+s|h\\d+m)$/\n/** The localized elapsed segment: `总5s`, `total 1m23s`. */\nconst ELAPSED = /^(?:总|total )\\d+(?:ms|s|m\\d+s|h\\d+m)$/\n/** The segment separator the host composes the line with. */\nconst SEP = ' · '\n\n/** Mirror of the host's `fmtDuration` (second granularity and shapes). */\nfunction formatDuration(ms: number): string {\n if (ms < 1000) return '0s'\n const total = Math.floor(ms / 1000)\n if (total < 60) return `${total}s`\n const minutes = Math.floor(total / 60)\n const seconds = total % 60\n if (minutes < 60) return `${minutes}m${seconds}s`\n return `${Math.floor(minutes / 60)}h${minutes % 60}m`\n}\n\n/** Mirror of the host's `durationLabel` (sub-second reads in milliseconds). */\nfunction formatCounter(ms: number): string {\n return ms < 1000 ? `${Math.max(0, Math.floor(ms))}ms` : formatDuration(ms)\n}\n\n/**\n * Replace the line's elapsed segment with one computed at `nowMs`.\n *\n * @param line - The host-rendered line (aged to the last fold).\n * @param view - The value's phase, counters and language.\n * @param nowMs - Wall clock to re-tick to.\n * @returns the line with a current counter, or the input when there is\n * nothing safe to replace.\n */\nexport function refreshElapsedSuffix(line: string, view: ElapsedTickView, nowMs: number): string {\n if (view.phase === 'idle' || view.phase === 'done') return line\n // A settled tool's `✓ … · 887ms` is a fixed fact, not a counter.\n if (line.startsWith('✓ ')) return line\n // The tool counter counts from the phase's entry; with concurrent tools the\n // host's own counter tracks the OLDEST one, so this may trail it by the\n // overlap — a display nuance, not a wrong number.\n const since = view.phase === 'tool' ? view.phaseStartedAt : view.turnStartedAt\n if (!(since > 0)) return line\n const elapsed = Math.max(0, nowMs - since)\n const replacement = view.phase === 'tool'\n ? formatCounter(elapsed)\n : (view.lang === 'en' ? `total ${formatDuration(elapsed)}` : `总${formatDuration(elapsed)}`)\n const segments = line.split(SEP)\n for (let i = segments.length - 1; i > 0; i--) {\n const segment = segments[i]\n if (segment !== undefined && (DURATION.test(segment) || ELAPSED.test(segment))) {\n segments[i] = replacement\n return segments.join(SEP)\n }\n }\n return line\n}\n","// Working-line dock entry: one dim full-width row above the composer card\n// showing the live working-activity line — phase-colored breathing marker,\n// the host-composed status line, and the turn's tool count badge.\n// Renders for every live phase (waiting/thinking/tool) and the done summary;\n// hides while idle or before the first frame.\n//\n// Data path: the host folds the `workingActivity` session projection and ships\n// the whole value to clients; the session standard kit's `useProjection` reads\n// it by key. Nothing is appended to the session log, and no client-runtime\n// patch is involved — the old `ConversationSnapshot.activity` transport is dead\n// on the current host line.\n//\n// The 'conversation.input.dock' SlotMap declaration lives in\n// @deepseek-ai/dsh-client-ui-conversation/client (contract/slots.ts) and the\n// `useProjection` standard seat in @deepseek-ai/dsh-client-ui-session/client;\n// this entry contributes into the slot without owning it.\nimport type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\n// Type-only merges, erased at build time and never required by the bundle:\n// the ui-conversation SlotMap entry (the dock seat's owner props) and the\n// ui-session standard kit (`useProjection`). ./activity.ts carries this\n// package's own projection-key merge, the key constant, and the view type.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-session/client'\nimport { ACTIVITY_PROJECTION_KEY, type WorkingActivityView } from './activity.ts'\nimport { refreshElapsedSuffix } from './elapsed.js'\nimport css from './WorkingLine.module.css'\n\n/** Full props of the dock entry: the input-zone runtime share (session standard kit). */\nexport type WorkingLineProps = PropsRuntime<'conversation.input.dock'>\n\n/** Tool-count badge copy (no locale seat: the line text itself is host-composed). */\nconst TOOLS_LABEL = 'tools this turn'\n\n/** The one live tick attachment (exactly one dock row exists at a time). */\nlet tickAttachment: { readonly el: HTMLElement; readonly timer: ReturnType<typeof setInterval> } | undefined\n\n/**\n * Re-tick the elapsed counter on the mounted text node, once per second.\n *\n * The projection only pushes when a committed event folds (measured: three\n * pushes per turn), so the host-rendered `line` ages between folds — the\n * elapsed text would freeze for the length of a tool. The row therefore\n * re-ticks the ONE moving segment locally; only segments matching the host's\n * elapsed shapes are ever replaced (see ./elapsed.ts).\n *\n * Imperative on purpose, and hook-free: the component is also invoked as a\n * plain function (the bundle gate reads its tree without a renderer), and a\n * ref callback plus this module-level slot is enough — React detaches a\n * changed inline ref with `null` first, which is where the previous interval\n * dies; a settled value simply never attaches a new one.\n */\nfunction attachElapsedTick(el: HTMLElement | null, activity: WorkingActivityView | undefined): void {\n if (tickAttachment !== undefined && (el === null || tickAttachment.el !== el)) {\n clearInterval(tickAttachment.timer)\n tickAttachment = undefined\n }\n if (el === null || activity === undefined || activity.live !== true) return\n const paint = (): void => {\n el.textContent = refreshElapsedSuffix(activity.line, activity, Date.now())\n }\n paint()\n tickAttachment = { el, timer: setInterval(paint, 1000) }\n}\n\n/**\n * Working-line dock entry: reads the session's latest `workingActivity`\n * projection value and renders the row, or nothing when idle/absent.\n */\nexport function WorkingLine({ useProjection }: WorkingLineProps) {\n // `undefined` is the uniform absence signal: the host unit is unmounted, no\n // frame carried the key for this session yet, or no session is current.\n // Rendering nothing (rather than an empty row) keeps the dock from reserving\n // space ahead of the first committed event.\n //\n // The annotation is load-bearing: `useProjection`'s precise engine type lives\n // in the session kit's own dependency (`@deepseek-ai/dsh-api-session-controller`),\n // which this package deliberately does not install (it would drag the whole\n // client peer closure into the dev tree). The key is pinned in ./activity.ts\n // against the merged table; this keeps the render body checked against the\n // host's view type.\n const activity: WorkingActivityView | undefined = useProjection(ACTIVITY_PROJECTION_KEY)\n if (activity === undefined || activity.phase === 'idle' || activity.line === '') return null\n return (\n <div className={css.line} data-activity-phase={activity.phase}>\n <span className={css.marker} aria-hidden=\"true\" />\n <span className={css.text} ref={el => attachElapsedTick(el, activity)}>{activity.line}</span>\n {activity.toolCount > 0 && (\n <span className={css.tools} title={`${activity.toolCount} ${TOOLS_LABEL}`}>\n {activity.toolCount}\n </span>\n )}\n </div>\n )\n}\n","/**\n * Working-activity surface plugin, browser half: the working-line entry in\n * the conversation.input.dock strip.\n *\n * The node half folds every committed session event into the `workingActivity`\n * session projection and the host ships that value to clients; this dock entry\n * reads it through the session standard kit's `useProjection` and owns no\n * store, no refresh chain, and no event listener. Nothing is appended to the\n * session log — the reason dsh-cli mounts this plugin with `publish: false`.\n *\n * Mount contract (see the root README's \"Web UI 集成\" section): the web\n * client's client-modules host scans loader entries for `dsh.client`\n * declarations and serves this package's `./client` bundle at\n * /plugins/dsh-working-activity/client.js. The entry contributes into the\n * input dock — no official-source patch is involved.\n */\nimport type { Context } from '@deepseek-ai/cordis'\n// Type-only merges: the ui-conversation SlotMap entry (the dock seat) and the\n// ui-renderer `slots` service on the client Context. Both are erased at build\n// time and never required by the bundle.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport { WorkingLine } from './WorkingLine.tsx'\n\nexport { WorkingLine, type WorkingLineProps } from './WorkingLine.tsx'\nexport type { WorkingActivityView } from './activity.ts'\n\n/** Required services for the dock registration. */\nexport const inject = ['slots']\n\n/**\n * Client plugin body: the working-line dock entry.\n * @param ctx - client root context.\n */\nexport function apply(ctx: Context): void {\n ctx.slots.inject('conversation.input.dock', () => ctx.slots.register({\n name: 'conversation.input.dock',\n // The pre-slots patch used the same id in ui-conversation; entries with\n // equal order render in registration order, and goal (10) / queue (20)\n // keep their seats — this row sits between them.\n id: 'activity',\n order: 15,\n registrant: 'dsh-working-activity',\n }, WorkingLine))\n}\n"],"mappings":"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"}
@@ -6,7 +6,7 @@
6
6
  * session projection and the host ships that value to clients; this dock entry
7
7
  * reads it through the session standard kit's `useProjection` and owns no
8
8
  * store, no refresh chain, and no event listener. Nothing is appended to the
9
- * session log — the reason dsh-tui mounts this plugin with `publish: false`.
9
+ * session log — the reason dsh-cli mounts this plugin with `publish: false`.
10
10
  *
11
11
  * Mount contract (see the root README's "Web UI 集成" section): the web
12
12
  * client's client-modules host scans loader entries for `dsh.client`
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Working-activity user configuration, mirroring the pi extension's
3
- * `~/.pi/agent/working-activity.json` shape: the UI owns the file (dsh-tui
4
- * persists `frames` at `~/.dsh-tui/working-activity.json`) and consumers use
3
+ * `~/.pi/agent/working-activity.json` shape: the UI owns the file (dsh-cli
4
+ * persists `frames` at `~/.dsh-cli/working-activity.json`) and consumers use
5
5
  * the pure parser here to honor `mode` / `features` / `customPhrases` /
6
6
  * `customActions` without duplicating validation. No I/O — filesystem
7
7
  * ownership stays with the host.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Working-activity user configuration, mirroring the pi extension's
3
- * `~/.pi/agent/working-activity.json` shape: the UI owns the file (dsh-tui
4
- * persists `frames` at `~/.dsh-tui/working-activity.json`) and consumers use
3
+ * `~/.pi/agent/working-activity.json` shape: the UI owns the file (dsh-cli
4
+ * persists `frames` at `~/.dsh-cli/working-activity.json`) and consumers use
5
5
  * the pure parser here to honor `mode` / `features` / `customPhrases` /
6
6
  * `customActions` without duplicating validation. No I/O — filesystem
7
7
  * ownership stays with the host.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Working-activity indicator frame presets — the single home for every
3
3
  * spinner animation, ported from the pi working-activity extension
4
- * (`FRAME_PRESETS`) plus the dsh-tui additions (moon8 / rainbow / whale
4
+ * (`FRAME_PRESETS`) plus the dsh-cli additions (moon8 / rainbow / whale
5
5
  * family / clock / traffic lights). Consumers (TUI row, Web slot) render the
6
6
  * current frame next to the live working line; the preset name is chosen by
7
7
  * the UI and persisted in `working-activity.json` (`frames` key).
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Working-activity indicator frame presets — the single home for every
3
3
  * spinner animation, ported from the pi working-activity extension
4
- * (`FRAME_PRESETS`) plus the dsh-tui additions (moon8 / rainbow / whale
4
+ * (`FRAME_PRESETS`) plus the dsh-cli additions (moon8 / rainbow / whale
5
5
  * family / clock / traffic lights). Consumers (TUI row, Web slot) render the
6
6
  * current frame next to the live working line; the preset name is chosen by
7
7
  * the UI and persisted in `working-activity.json` (`frames` key).
@@ -39,7 +39,7 @@ export type Config = {
39
39
  customActions?: Record<string, string[]>;
40
40
  /** Inject the `⏵` self-narration contract into the system prompt and surface it. */
41
41
  narrate?: boolean;
42
- /** UI language: `auto` follows `DSH_TUI_LANG` → `~/.dsh-tui/lang.json` →
42
+ /** UI language: `auto` follows `DSH_CLI_LANG` → `~/.dsh-cli/lang.json` →
43
43
  * OS locale → zh; `zh`/`en` pin the copy directly. */
44
44
  lang?: 'auto' | 'zh' | 'en' | 'ja' | 'input';
45
45
  /** Default frame preset name (informational for UI consumers; the TUI
@@ -77,11 +77,11 @@ export function apply(ctx, config = {}) {
77
77
  workRemindAt: config.workRemindAt ?? 0,
78
78
  debugLog: config.debugLog ?? false,
79
79
  };
80
- // Trace target for {@link traceLine}: `~/.dsh-tui` mirrors where the UI keeps
80
+ // Trace target for {@link traceLine}: `~/.dsh-cli` mirrors where the UI keeps
81
81
  // this plugin's config file; the env var redirects it (tests, bug reports).
82
82
  const debugLogPath = resolved.debugLog
83
83
  ? process.env.DSH_WORKING_ACTIVITY_DEBUG_LOG
84
- ?? join(homedir(), '.dsh-tui', 'working-activity-debug.log')
84
+ ?? join(homedir(), '.dsh-cli', 'working-activity-debug.log')
85
85
  : undefined;
86
86
  // A pinned plugin-level language beats the env/file chain; releasing it on
87
87
  // dispose restores `auto` for any other composition in the process.
@@ -3,13 +3,25 @@
3
3
  * @module dsh-working-activity/invariant
4
4
  */
5
5
  import type { Context } from '@deepseek-ai/cordis';
6
+ /** Compatibility boundary for hosts that still load invariant companions. */
7
+ type InvariantFailure = (message: string) => never;
8
+ type InvariantContext = Context & {
9
+ invariants: {
10
+ register(packageName: string, installer: typeof install): () => void;
11
+ };
12
+ };
6
13
  /** Cordis companion plugin name. */
7
14
  export declare const name = "working-activity-invariant";
8
15
  /** Service required before the companion can reserve package ownership. */
9
16
  export declare const inject: string[];
17
+ /** Install validation for loaded and newly appended activity snapshots. */
18
+ declare const install: ((ctx: Context, fail: InvariantFailure) => void) & {
19
+ inject: string[];
20
+ };
10
21
  /**
11
22
  * Register the working-activity invariant companion.
12
23
  * @param ctx - Cordis context carrying the invariant service.
13
24
  * @returns the installed registration's disposer after setup succeeds.
14
25
  */
15
- export declare const apply: (ctx: Context) => Promise<() => void>;
26
+ export declare const apply: (ctx: InvariantContext) => Promise<() => void>;
27
+ export {};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Language resolution + copy dictionary for the working-activity plugin.
3
3
  *
4
- * The plugin follows the dsh-tui UI language without importing it: the same
5
- * chain dsh-tui resolves (`DSH_TUI_LANG` env → `~/.dsh-tui/lang.json` → OS
4
+ * The plugin follows the dsh-cli UI language without importing it: the same
5
+ * chain dsh-cli resolves (`DSH_CLI_LANG` env → `~/.dsh-cli/lang.json` → OS
6
6
  * locale → en) is read here directly, so a `/lang en|zh` switch (or the
7
7
  * /settings language pick) hot-swaps rendered status-line copy. Model-facing
8
8
  * narration instructions are locale-independent.
@@ -10,8 +10,8 @@
10
10
  * Resolution order:
11
11
  * 1. `setLangOverride()` — a plugin-level `lang: zh|en` config key
12
12
  * (cordis.yml) or an explicit test pin.
13
- * 2. `DSH_TUI_LANG` env var — pinned at process start.
14
- * 3. `~/.dsh-tui/lang.json` — the persisted dsh-tui choice, mtime-cached
13
+ * 2. `DSH_CLI_LANG` env var — pinned at process start.
14
+ * 3. `~/.dsh-cli/lang.json` — the persisted dsh-cli choice, mtime-cached
15
15
  * so the per-tick status render never re-reads an unchanged file.
16
16
  * 4. OS locale guess (`LC_ALL` / `LC_MESSAGES` / `LANG`); POSIX/C means
17
17
  * "no locale selected" and maps to English.
@@ -113,7 +113,7 @@ export declare function t(key: I18nKey, params?: I18nParams): string;
113
113
  /** Is a value a valid shipped language code? */
114
114
  export declare function isLang(value: unknown): value is Lang;
115
115
  /**
116
- * Read the persisted dsh-tui language choice.
116
+ * Read the persisted dsh-cli language choice.
117
117
  *
118
118
  * The probe is cached twice over: the parsed value is reused while the file's
119
119
  * mtime is unchanged, and even the `statSync` itself is skipped for
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Language resolution + copy dictionary for the working-activity plugin.
3
3
  *
4
- * The plugin follows the dsh-tui UI language without importing it: the same
5
- * chain dsh-tui resolves (`DSH_TUI_LANG` env → `~/.dsh-tui/lang.json` → OS
4
+ * The plugin follows the dsh-cli UI language without importing it: the same
5
+ * chain dsh-cli resolves (`DSH_CLI_LANG` env → `~/.dsh-cli/lang.json` → OS
6
6
  * locale → en) is read here directly, so a `/lang en|zh` switch (or the
7
7
  * /settings language pick) hot-swaps rendered status-line copy. Model-facing
8
8
  * narration instructions are locale-independent.
@@ -10,8 +10,8 @@
10
10
  * Resolution order:
11
11
  * 1. `setLangOverride()` — a plugin-level `lang: zh|en` config key
12
12
  * (cordis.yml) or an explicit test pin.
13
- * 2. `DSH_TUI_LANG` env var — pinned at process start.
14
- * 3. `~/.dsh-tui/lang.json` — the persisted dsh-tui choice, mtime-cached
13
+ * 2. `DSH_CLI_LANG` env var — pinned at process start.
14
+ * 3. `~/.dsh-cli/lang.json` — the persisted dsh-cli choice, mtime-cached
15
15
  * so the per-tick status render never re-reads an unchanged file.
16
16
  * 4. OS locale guess (`LC_ALL` / `LC_MESSAGES` / `LANG`); POSIX/C means
17
17
  * "no locale selected" and maps to English.
@@ -60,8 +60,8 @@ export function detectInputLanguage(input) {
60
60
  return 'en';
61
61
  return undefined;
62
62
  }
63
- /** The dsh-tui prefs file this plugin mirrors (shared language contract). */
64
- const LANG_FILE = join(homedir(), '.dsh-tui', 'lang.json');
63
+ /** The dsh-cli prefs file this plugin mirrors (shared language contract). */
64
+ const LANG_FILE = join(homedir(), '.dsh-cli', 'lang.json');
65
65
  /** Model instructions never inherit the interface or terminal language. */
66
66
  export const NARRATE_INSTRUCTION = '[Status line] You have a status line visible to the user. [Required] At the start of each step or subtask (not only before tool calls), write exactly one standalone line at the very beginning of your response: ⏵ a concrete description of what you are doing (20 words max), then continue with the normal response on the next line. Write only one ⏵ line per response and do not repeat it. Prioritize information so the user can understand the current work at a glance; keep the style natural and optionally playful. Examples: ⏵ Fixing the login page styles, ⏵ Investigating the error, ⏵ Running validation for the patch. Update it when the task changes. Write the status description in the same response language chosen for the user request; use English when unclear.';
67
67
  const dict = {
@@ -108,7 +108,7 @@ export function langNow() {
108
108
  return scoped;
109
109
  if (override !== 'auto')
110
110
  return override;
111
- const env = process.env.DSH_TUI_LANG;
111
+ const env = process.env.DSH_CLI_LANG;
112
112
  if (env === 'zh' || env === 'en')
113
113
  return env;
114
114
  return readLangFile() ?? detectLocaleLang();
@@ -130,7 +130,7 @@ export function isLang(value) {
130
130
  */
131
131
  const LANG_FILE_PROBE_TTL_MS = 1000;
132
132
  /**
133
- * Read the persisted dsh-tui language choice.
133
+ * Read the persisted dsh-cli language choice.
134
134
  *
135
135
  * The probe is cached twice over: the parsed value is reused while the file's
136
136
  * mtime is unchanged, and even the `statSync` itself is skipped for
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The browser cannot see the host's in-process state, and the previous
5
5
  * transport (appending `activity/status` events into the shared session log)
6
- * made the log unreadable for other readers — the reason dsh-tui mounts this
6
+ * made the log unreadable for other readers — the reason dsh-cli mounts this
7
7
  * plugin with `publish: false`. A **session projection** is the supported
8
8
  * replacement: the host folds committed events into a value and ships it to
9
9
  * clients through the projection store, so nothing is written to the log.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The browser cannot see the host's in-process state, and the previous
5
5
  * transport (appending `activity/status` events into the shared session log)
6
- * made the log unreadable for other readers — the reason dsh-tui mounts this
6
+ * made the log unreadable for other readers — the reason dsh-cli mounts this
7
7
  * plugin with `publish: false`. A **session projection** is the supported
8
8
  * replacement: the host folds committed events into a value and ships it to
9
9
  * clients through the projection store, so nothing is written to the log.
@@ -189,7 +189,7 @@ export declare class ActivityTracker {
189
189
  /**
190
190
  * Feed one raw durable session event.
191
191
  * @deprecated Host-shape input kept for one release so an already-published
192
- * consumer that drives this tracker itself (dsh-TUI ≤ 0.11.x calls this
192
+ * consumer that drives this tracker itself (dsh-CLI ≤ 0.11.x calls this
193
193
  * method) keeps working across the upgrade. New code normalizes through
194
194
  * `src/compat/*` and calls {@link onEvent}. The parameter type is inferred
195
195
  * from the compat function on purpose — this module must not import a DSH
@@ -505,7 +505,7 @@ export class ActivityTracker {
505
505
  /**
506
506
  * Feed one raw durable session event.
507
507
  * @deprecated Host-shape input kept for one release so an already-published
508
- * consumer that drives this tracker itself (dsh-TUI ≤ 0.11.x calls this
508
+ * consumer that drives this tracker itself (dsh-CLI ≤ 0.11.x calls this
509
509
  * method) keeps working across the upgrade. New code normalizes through
510
510
  * `src/compat/*` and calls {@link onEvent}. The parameter type is inferred
511
511
  * from the compat function on purpose — this module must not import a DSH
@@ -78,7 +78,6 @@
78
78
  "@deepseek-ai/dsh-client-ui-renderer": "*",
79
79
  "@deepseek-ai/dsh-client-ui-session": "*",
80
80
  "@deepseek-ai/dsh-client-ui-slots": "*",
81
- "@deepseek-ai/dsh-invariants": "*",
82
81
  "@deepseek-ai/dsh-session": "*",
83
82
  "@deepseek-ai/dsh-session-projection": "*",
84
83
  "@deepseek-ai/dsh-system-prompt": "*",
@@ -110,9 +109,6 @@
110
109
  "@deepseek-ai/dsh-agent": {
111
110
  "optional": true
112
111
  },
113
- "@deepseek-ai/dsh-invariants": {
114
- "optional": true
115
- },
116
112
  "@deepseek-ai/dsh-session": {
117
113
  "optional": true
118
114
  },
@@ -6,7 +6,7 @@
6
6
  * session projection and the host ships that value to clients; this dock entry
7
7
  * reads it through the session standard kit's `useProjection` and owns no
8
8
  * store, no refresh chain, and no event listener. Nothing is appended to the
9
- * session log — the reason dsh-tui mounts this plugin with `publish: false`.
9
+ * session log — the reason dsh-cli mounts this plugin with `publish: false`.
10
10
  *
11
11
  * Mount contract (see the root README's "Web UI 集成" section): the web
12
12
  * client's client-modules host scans loader entries for `dsh.client`
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Working-activity user configuration, mirroring the pi extension's
3
- * `~/.pi/agent/working-activity.json` shape: the UI owns the file (dsh-tui
4
- * persists `frames` at `~/.dsh-tui/working-activity.json`) and consumers use
3
+ * `~/.pi/agent/working-activity.json` shape: the UI owns the file (dsh-cli
4
+ * persists `frames` at `~/.dsh-cli/working-activity.json`) and consumers use
5
5
  * the pure parser here to honor `mode` / `features` / `customPhrases` /
6
6
  * `customActions` without duplicating validation. No I/O — filesystem
7
7
  * ownership stays with the host.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Working-activity indicator frame presets — the single home for every
3
3
  * spinner animation, ported from the pi working-activity extension
4
- * (`FRAME_PRESETS`) plus the dsh-tui additions (moon8 / rainbow / whale
4
+ * (`FRAME_PRESETS`) plus the dsh-cli additions (moon8 / rainbow / whale
5
5
  * family / clock / traffic lights). Consumers (TUI row, Web slot) render the
6
6
  * current frame next to the live working line; the preset name is chosen by
7
7
  * the UI and persisted in `working-activity.json` (`frames` key).