@deepseek-harness-tui/dsh-tui 0.7.3 → 0.8.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 (371) hide show
  1. package/README.md +15 -7
  2. package/bin/dsh-tui.js +19 -3
  3. package/cordis.patch.yml +43 -11
  4. package/cordis.yml +20 -1
  5. package/ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
  6. package/ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
  7. package/ecosystem-spec/registry/permissions-0.1.json +13 -0
  8. package/ecosystem-spec/registry/registry-0.15.json +57 -0
  9. package/ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
  10. package/ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
  11. package/ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
  12. package/lib/types/cc/figures.d.ts +4 -0
  13. package/lib/types/cc/figures.d.ts.map +1 -1
  14. package/lib/types/cc/figures.js +4 -0
  15. package/lib/types/commands.d.ts.map +1 -1
  16. package/lib/types/commands.js +4 -1
  17. package/lib/types/components/ExtensionDialog.d.ts +40 -0
  18. package/lib/types/components/ExtensionDialog.d.ts.map +1 -0
  19. package/lib/types/components/ExtensionDialog.js +210 -0
  20. package/lib/types/components/HelpMenu.js +1 -1
  21. package/lib/types/components/LoadedContextPanel.d.ts +5 -10
  22. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
  23. package/lib/types/components/LoadedContextPanel.js +7 -18
  24. package/lib/types/components/LogoV2.d.ts.map +1 -1
  25. package/lib/types/components/LogoV2.js +1 -2
  26. package/lib/types/components/MessageList.d.ts +3 -1
  27. package/lib/types/components/MessageList.d.ts.map +1 -1
  28. package/lib/types/components/MessageList.js +29 -5
  29. package/lib/types/components/PluginSceneBoundary.d.ts +31 -0
  30. package/lib/types/components/PluginSceneBoundary.d.ts.map +1 -0
  31. package/lib/types/components/PluginSceneBoundary.js +29 -0
  32. package/lib/types/components/RewindPicker.d.ts +13 -1
  33. package/lib/types/components/RewindPicker.d.ts.map +1 -1
  34. package/lib/types/components/RewindPicker.js +26 -2
  35. package/lib/types/components/SkillsPicker.d.ts +18 -0
  36. package/lib/types/components/SkillsPicker.d.ts.map +1 -0
  37. package/lib/types/components/SkillsPicker.js +50 -0
  38. package/lib/types/components/SplitDiffView.d.ts +28 -0
  39. package/lib/types/components/SplitDiffView.d.ts.map +1 -0
  40. package/lib/types/components/SplitDiffView.js +417 -0
  41. package/lib/types/components/ToolUseLoader.d.ts +8 -3
  42. package/lib/types/components/ToolUseLoader.d.ts.map +1 -1
  43. package/lib/types/components/ToolUseLoader.js +43 -9
  44. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +3 -1
  45. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  46. package/lib/types/components/messages/AssistantToolUseMessage.js +17 -7
  47. package/lib/types/dsh-adapter/channel.d.ts +98 -7
  48. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  49. package/lib/types/dsh-adapter/channel.js +623 -26
  50. package/lib/types/dsh-adapter/command-attribution.d.ts +51 -0
  51. package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -0
  52. package/lib/types/dsh-adapter/command-attribution.js +93 -0
  53. package/lib/types/dsh-adapter/command-errors.d.ts +42 -0
  54. package/lib/types/dsh-adapter/command-errors.d.ts.map +1 -0
  55. package/lib/types/dsh-adapter/command-errors.js +63 -0
  56. package/lib/types/dsh-adapter/component-identity.d.ts +28 -0
  57. package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -0
  58. package/lib/types/dsh-adapter/component-identity.js +108 -0
  59. package/lib/types/dsh-adapter/contract.d.ts +2 -2
  60. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  61. package/lib/types/dsh-adapter/contract.js +3 -2
  62. package/lib/types/dsh-adapter/decision-guard.d.ts +84 -0
  63. package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -0
  64. package/lib/types/dsh-adapter/decision-guard.js +354 -0
  65. package/lib/types/dsh-adapter/dialogs.d.ts +146 -0
  66. package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -0
  67. package/lib/types/dsh-adapter/dialogs.js +262 -0
  68. package/lib/types/dsh-adapter/effect-ledger.d.ts +99 -0
  69. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -0
  70. package/lib/types/dsh-adapter/effect-ledger.js +231 -0
  71. package/lib/types/dsh-adapter/extension-events.d.ts +193 -0
  72. package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -0
  73. package/lib/types/dsh-adapter/extension-events.js +169 -0
  74. package/lib/types/dsh-adapter/extensions.d.ts +32 -0
  75. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -0
  76. package/lib/types/dsh-adapter/extensions.js +42 -0
  77. package/lib/types/dsh-adapter/grants.d.ts +25 -0
  78. package/lib/types/dsh-adapter/grants.d.ts.map +1 -0
  79. package/lib/types/dsh-adapter/grants.js +184 -0
  80. package/lib/types/dsh-adapter/host-descriptor.d.ts +24 -0
  81. package/lib/types/dsh-adapter/host-descriptor.d.ts.map +1 -0
  82. package/lib/types/dsh-adapter/host-descriptor.js +146 -0
  83. package/lib/types/dsh-adapter/index.d.ts +4 -0
  84. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  85. package/lib/types/dsh-adapter/index.js +1 -0
  86. package/lib/types/dsh-adapter/message-observer.d.ts +178 -0
  87. package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -0
  88. package/lib/types/dsh-adapter/message-observer.js +509 -0
  89. package/lib/types/dsh-adapter/plugin-host.d.ts +103 -0
  90. package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -0
  91. package/lib/types/dsh-adapter/plugin-host.js +270 -0
  92. package/lib/types/dsh-adapter/plugin-storage.d.ts +113 -0
  93. package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -0
  94. package/lib/types/dsh-adapter/plugin-storage.js +385 -0
  95. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  96. package/lib/types/dsh-adapter/plugin.js +106 -1
  97. package/lib/types/dsh-adapter/plugins-info.d.ts +43 -0
  98. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -0
  99. package/lib/types/dsh-adapter/plugins-info.js +276 -0
  100. package/lib/types/dsh-adapter/promptDebug.d.ts +10 -0
  101. package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -0
  102. package/lib/types/dsh-adapter/promptDebug.js +148 -0
  103. package/lib/types/dsh-adapter/renderers.d.ts +65 -0
  104. package/lib/types/dsh-adapter/renderers.d.ts.map +1 -0
  105. package/lib/types/dsh-adapter/renderers.js +138 -0
  106. package/lib/types/dsh-adapter/sanitize.d.ts +36 -0
  107. package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -0
  108. package/lib/types/dsh-adapter/sanitize.js +65 -0
  109. package/lib/types/dsh-adapter/scenes.d.ts +81 -0
  110. package/lib/types/dsh-adapter/scenes.d.ts.map +1 -0
  111. package/lib/types/dsh-adapter/scenes.js +93 -0
  112. package/lib/types/dsh-adapter/settings-sections.d.ts +116 -0
  113. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -0
  114. package/lib/types/dsh-adapter/settings-sections.js +63 -0
  115. package/lib/types/dsh-adapter/settingsEditor.d.ts +128 -0
  116. package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -0
  117. package/lib/types/dsh-adapter/settingsEditor.js +244 -0
  118. package/lib/types/dsh-adapter/shortcuts.d.ts +109 -0
  119. package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -0
  120. package/lib/types/dsh-adapter/shortcuts.js +268 -0
  121. package/lib/types/dsh-adapter/status.d.ts +75 -0
  122. package/lib/types/dsh-adapter/status.d.ts.map +1 -0
  123. package/lib/types/dsh-adapter/status.js +168 -0
  124. package/lib/types/extensions.d.ts +8 -0
  125. package/lib/types/extensions.d.ts.map +1 -0
  126. package/lib/types/extensions.js +15 -0
  127. package/lib/types/i18n.d.ts +299 -26
  128. package/lib/types/i18n.d.ts.map +1 -1
  129. package/lib/types/i18n.js +89 -8
  130. package/lib/types/ink/ink.d.ts +11 -0
  131. package/lib/types/ink/ink.d.ts.map +1 -1
  132. package/lib/types/ink/ink.js +33 -0
  133. package/lib/types/ink/log-update.d.ts.map +1 -1
  134. package/lib/types/ink/log-update.js +101 -51
  135. package/lib/types/ink/output.d.ts +7 -0
  136. package/lib/types/ink/output.d.ts.map +1 -1
  137. package/lib/types/ink/output.js +125 -4
  138. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  139. package/lib/types/ink/render-node-to-output.js +14 -6
  140. package/lib/types/ink/terminal.d.ts.map +1 -1
  141. package/lib/types/ink/terminal.js +18 -6
  142. package/lib/types/jsx-runtime.d.ts +2 -0
  143. package/lib/types/jsx-runtime.d.ts.map +1 -0
  144. package/lib/types/jsx-runtime.js +13 -0
  145. package/lib/types/modelRoute.d.ts +10 -2
  146. package/lib/types/modelRoute.d.ts.map +1 -1
  147. package/lib/types/modelRoute.js +33 -4
  148. package/lib/types/plugin-host.d.ts +13 -0
  149. package/lib/types/plugin-host.d.ts.map +1 -0
  150. package/lib/types/plugin-host.js +17 -0
  151. package/lib/types/plugin-spec/negotiate.d.ts +11 -0
  152. package/lib/types/plugin-spec/negotiate.d.ts.map +1 -0
  153. package/lib/types/plugin-spec/negotiate.js +97 -0
  154. package/lib/types/plugin-spec/permission-scope.d.ts +32 -0
  155. package/lib/types/plugin-spec/permission-scope.d.ts.map +1 -0
  156. package/lib/types/plugin-spec/permission-scope.js +90 -0
  157. package/lib/types/plugin-spec/registry.d.ts +23 -0
  158. package/lib/types/plugin-spec/registry.d.ts.map +1 -0
  159. package/lib/types/plugin-spec/registry.js +157 -0
  160. package/lib/types/plugin-spec/schema-check.d.ts +17 -0
  161. package/lib/types/plugin-spec/schema-check.d.ts.map +1 -0
  162. package/lib/types/plugin-spec/schema-check.js +165 -0
  163. package/lib/types/plugin-spec/tui-extension.d.ts +16 -0
  164. package/lib/types/plugin-spec/tui-extension.d.ts.map +1 -0
  165. package/lib/types/plugin-spec/tui-extension.js +77 -0
  166. package/lib/types/plugin-spec/types.d.ts +114 -0
  167. package/lib/types/plugin-spec/types.d.ts.map +1 -0
  168. package/lib/types/plugin-spec/types.js +10 -0
  169. package/lib/types/plugin-spec/validate.d.ts +21 -0
  170. package/lib/types/plugin-spec/validate.d.ts.map +1 -0
  171. package/lib/types/plugin-spec/validate.js +119 -0
  172. package/lib/types/scenes.d.ts +3 -0
  173. package/lib/types/scenes.d.ts.map +1 -0
  174. package/lib/types/scenes.js +4 -0
  175. package/lib/types/screens/Chat.d.ts +14 -1
  176. package/lib/types/screens/Chat.d.ts.map +1 -1
  177. package/lib/types/screens/Chat.js +247 -48
  178. package/lib/types/screens/Settings.d.ts +20 -0
  179. package/lib/types/screens/Settings.d.ts.map +1 -0
  180. package/lib/types/screens/Settings.js +333 -0
  181. package/lib/types/screens/StatusLine.js +1 -1
  182. package/lib/types/settings-sections.d.ts +3 -0
  183. package/lib/types/settings-sections.d.ts.map +1 -0
  184. package/lib/types/settings-sections.js +4 -0
  185. package/lib/types/theme.d.ts +17 -0
  186. package/lib/types/theme.d.ts.map +1 -1
  187. package/lib/types/theme.js +51 -0
  188. package/lib/types/update.d.ts +20 -0
  189. package/lib/types/update.d.ts.map +1 -1
  190. package/lib/types/update.js +54 -7
  191. package/lib/types/utils/loaded-context.d.ts +8 -3
  192. package/lib/types/utils/loaded-context.d.ts.map +1 -1
  193. package/lib/types/utils/loaded-context.js +39 -3
  194. package/lib/types/utils/modifiers.d.ts.map +1 -1
  195. package/lib/types/utils/modifiers.js +3 -2
  196. package/lib/types/working-activity.d.ts +12 -0
  197. package/lib/types/working-activity.d.ts.map +1 -1
  198. package/lib/types/working-activity.js +13 -0
  199. package/node_modules/@dsh-std/command/LICENSE +21 -0
  200. package/node_modules/@dsh-std/command/README.md +26 -0
  201. package/node_modules/@dsh-std/command/README.zh.md +28 -0
  202. package/node_modules/@dsh-std/command/lib/index.d.ts +144 -0
  203. package/node_modules/@dsh-std/command/lib/index.d.ts.map +1 -0
  204. package/node_modules/@dsh-std/command/lib/index.js +252 -0
  205. package/node_modules/@dsh-std/command/lib/index.js.map +1 -0
  206. package/node_modules/@dsh-std/command/package.json +22 -0
  207. package/node_modules/@dsh-std/connection/LICENSE +21 -0
  208. package/node_modules/@dsh-std/connection/README.md +42 -0
  209. package/node_modules/@dsh-std/connection/README.zh.md +42 -0
  210. package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  211. package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  212. package/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  213. package/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  214. package/node_modules/@dsh-std/connection/lib/index.js +158 -0
  215. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  216. package/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  217. package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  218. package/node_modules/@dsh-std/connection/lib/memory.js +257 -0
  219. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  220. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  221. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  222. package/node_modules/@dsh-std/connection/package.json +20 -0
  223. package/node_modules/@dsh-std/core/LICENSE +21 -0
  224. package/node_modules/@dsh-std/core/README.md +13 -0
  225. package/node_modules/@dsh-std/core/README.zh.md +13 -0
  226. package/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  227. package/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  228. package/node_modules/@dsh-std/core/lib/index.js +424 -0
  229. package/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  230. package/node_modules/@dsh-std/core/package.json +21 -0
  231. package/node_modules/@dsh-std/manifest/LICENSE +21 -0
  232. package/node_modules/@dsh-std/manifest/README.md +5 -0
  233. package/node_modules/@dsh-std/manifest/README.zh.md +5 -0
  234. package/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
  235. package/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
  236. package/node_modules/@dsh-std/manifest/lib/index.js +625 -0
  237. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
  238. package/node_modules/@dsh-std/manifest/package.json +20 -0
  239. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
  240. package/node_modules/@dsh-std/messages/LICENSE +21 -0
  241. package/node_modules/@dsh-std/messages/README.md +5 -0
  242. package/node_modules/@dsh-std/messages/README.zh.md +7 -0
  243. package/node_modules/@dsh-std/messages/lib/index.d.ts +50 -0
  244. package/node_modules/@dsh-std/messages/lib/index.d.ts.map +1 -0
  245. package/node_modules/@dsh-std/messages/lib/index.js +151 -0
  246. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -0
  247. package/node_modules/@dsh-std/messages/package.json +20 -0
  248. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -0
  249. package/node_modules/@dsh-std/presentation/LICENSE +21 -0
  250. package/node_modules/@dsh-std/presentation/README.md +26 -0
  251. package/node_modules/@dsh-std/presentation/README.zh.md +28 -0
  252. package/node_modules/@dsh-std/presentation/lib/index.d.ts +219 -0
  253. package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
  254. package/node_modules/@dsh-std/presentation/lib/index.js +547 -0
  255. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
  256. package/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
  257. package/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
  258. package/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
  259. package/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
  260. package/node_modules/@dsh-std/presentation/package.json +21 -0
  261. package/node_modules/@dsh-std/storage/LICENSE +21 -0
  262. package/node_modules/@dsh-std/storage/README.md +5 -0
  263. package/node_modules/@dsh-std/storage/README.zh.md +7 -0
  264. package/node_modules/@dsh-std/storage/lib/index.d.ts +48 -0
  265. package/node_modules/@dsh-std/storage/lib/index.d.ts.map +1 -0
  266. package/node_modules/@dsh-std/storage/lib/index.js +104 -0
  267. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -0
  268. package/node_modules/@dsh-std/storage/package.json +20 -0
  269. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -0
  270. package/package.json +118 -67
  271. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -0
  272. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -0
  273. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -0
  274. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  275. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  276. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  277. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  278. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js +158 -0
  279. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  280. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  281. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  282. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +257 -0
  283. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  284. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  285. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  286. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -0
  287. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -0
  288. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -0
  289. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -0
  290. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  291. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  292. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js +424 -0
  293. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  294. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -0
  295. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -0
  296. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -0
  297. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -0
  298. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
  299. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
  300. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js +625 -0
  301. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
  302. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -0
  303. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
  304. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -0
  305. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +26 -0
  306. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +28 -0
  307. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +219 -0
  308. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
  309. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +547 -0
  310. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
  311. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
  312. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
  313. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
  314. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
  315. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +21 -0
  316. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -0
  317. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -0
  318. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -0
  319. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  320. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  321. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js +424 -0
  322. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  323. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -0
  324. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -0
  325. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -0
  326. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -0
  327. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  328. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  329. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js +424 -0
  330. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  331. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -0
  332. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -0
  333. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -0
  334. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -0
  335. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  336. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  337. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js +424 -0
  338. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  339. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -0
  340. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -0
  341. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -0
  342. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -0
  343. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  344. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  345. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  346. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  347. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js +158 -0
  348. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  349. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  350. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  351. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +257 -0
  352. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  353. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  354. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  355. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -0
  356. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -0
  357. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -0
  358. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -0
  359. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  360. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  361. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js +424 -0
  362. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  363. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -0
  364. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -0
  365. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -0
  366. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -0
  367. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  368. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  369. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js +424 -0
  370. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  371. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -0
@@ -0,0 +1,333 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Box, Text, useInput, useTerminalSize } from '../ui.js';
4
+ import { Divider } from '../components/design-system/Divider.js';
5
+ import { HintLine } from '../components/design-system/HintLine.js';
6
+ import { isMod, isPlainReturn } from '../utils/modifiers.js';
7
+ import { truncateWidth } from '../sessions/format.js';
8
+ import { getLang, t } from '../i18n.js';
9
+ import { SettingsForm } from '../dsh-adapter/settingsEditor.js';
10
+ /** Pick the provider-owned translation for the active language. */
11
+ function pick(text, descriptions) {
12
+ return descriptions?.[getLang()] ?? text;
13
+ }
14
+ /** Compact one-line preview of a read-only namespace's resolved value. */
15
+ function valuePreview(value, budget) {
16
+ let raw;
17
+ try {
18
+ raw = JSON.stringify(value) ?? 'undefined';
19
+ }
20
+ catch {
21
+ raw = String(value);
22
+ }
23
+ return truncateWidth(raw, Math.max(8, budget));
24
+ }
25
+ /**
26
+ * The settings screen — `/settings` as a screen of its own (issue #165).
27
+ *
28
+ * The TUI owns only presentation here: plugin-declared sections from the
29
+ * `tuiSettingsSections` seam render as editable forms; every write goes back
30
+ * through the dsh settings service (revision-fenced `mutate` path ops) or the
31
+ * credentials seam (secret fields, blank-until-typed). Namespaces no plugin
32
+ * declared a section for stay read-only with a YAML hint — the same fallback
33
+ * the web front door gives namespaces without a card.
34
+ *
35
+ * Edits are staged, never settled live: typing changes a draft, and only the
36
+ * explicit save writes the durable document (see settingsEditor.ts for why).
37
+ */
38
+ export function Settings({ channel, onClose, }) {
39
+ // Explicit terminal size (not flexGrow) — the same rule SessionBrowser's
40
+ // root follows inside the alternate screen's fixed-height box.
41
+ const { columns, rows } = useTerminalSize();
42
+ // channel caches the host — a fresh object per call would re-fire the
43
+ // host-keyed effects below on every render (an endless render loop).
44
+ const host = channel.settingsHost();
45
+ const [namespaces, setNamespaces] = React.useState(() => host?.listNamespaces() ?? []);
46
+ const [sections, setSections] = React.useState(() => channel.settingsSections());
47
+ const [mode, setMode] = React.useState('list');
48
+ const [editing, setEditing] = React.useState(null);
49
+ const [focusIndex, setFocusIndex] = React.useState(0);
50
+ const [notice, setNotice] = React.useState(undefined);
51
+ /** Configured status of every secret field's credential ref. */
52
+ const [secrets, setSecrets] = React.useState(new Map());
53
+ /** First line of the windowed entry list (focus-follow scrolling). */
54
+ const [windowStart, setWindowStart] = React.useState(0);
55
+ /** Repaint after a form mutation — staged drafts live in the (React-free)
56
+ * SettingsForm, so editing one changes no React state by itself. */
57
+ const [, bump] = React.useReducer((count) => count + 1, 0);
58
+ /** Async save completions must not touch state after the screen closes. */
59
+ const mountedRef = React.useRef(true);
60
+ React.useEffect(() => () => {
61
+ mountedRef.current = false;
62
+ }, []);
63
+ React.useEffect(() => channel.subscribeSettingsSections(() => {
64
+ setSections(channel.settingsSections());
65
+ }), [channel]);
66
+ // One form per section namespace. A fresh namespace view replaces the form
67
+ // only while it holds no edits — replacing a dirty form would discard the
68
+ // drafts the user is still typing.
69
+ const formsRef = React.useRef(new Map());
70
+ const forms = new Map();
71
+ if (host !== undefined) {
72
+ for (const section of sections) {
73
+ const view = namespaces.find(entry => entry.ns === section.ns);
74
+ const kept = formsRef.current.get(section.ns);
75
+ const reuse = kept !== undefined && (kept.namespace === view || kept.shell().dirty);
76
+ const form = reuse ? kept : new SettingsForm(host, view, section.fields);
77
+ forms.set(section.ns, form);
78
+ }
79
+ }
80
+ formsRef.current = forms;
81
+ const refresh = () => {
82
+ setNamespaces(host?.listNamespaces() ?? []);
83
+ };
84
+ // Secret fields report only configured/unconfigured; resolve each ref once
85
+ // per section-list change (and after every save, which may have set one).
86
+ const [secretProbe, setSecretProbe] = React.useState(0);
87
+ React.useEffect(() => {
88
+ if (host === undefined)
89
+ return;
90
+ let stale = false;
91
+ const pending = sections.flatMap(section => section.fields
92
+ .filter((field) => field.secret !== undefined)
93
+ .map(async (field) => [`${section.ns}:${field.path.join('.')}`, await host.credentialConfigured(field.secret.ref)]));
94
+ void Promise.all(pending).then(entries => {
95
+ if (!stale && mountedRef.current)
96
+ setSecrets(new Map(entries));
97
+ });
98
+ return () => {
99
+ stale = true;
100
+ };
101
+ // eslint-disable-next-line react-hooks/exhaustive-deps
102
+ }, [host, sections, secretProbe]);
103
+ /** Focusable rows in display order: every field of every section. */
104
+ const focusable = sections.flatMap(section => section.fields.map(field => ({ ns: section.ns, field })));
105
+ const effFocus = Math.min(focusIndex, Math.max(0, focusable.length - 1));
106
+ const focused = focusable.length === 0 ? undefined : focusable[effFocus];
107
+ const focusedForm = focused === undefined ? undefined : forms.get(focused.ns);
108
+ const commitSave = (ns) => {
109
+ const form = forms.get(ns);
110
+ if (form === undefined || form.saving || !form.shell().dirty)
111
+ return;
112
+ void form.save().then(ok => {
113
+ if (!mountedRef.current)
114
+ return;
115
+ if (ok) {
116
+ setNotice({ text: t('settings-saved', { ns }), tone: 'success' });
117
+ refresh();
118
+ setSecretProbe(count => count + 1);
119
+ }
120
+ else {
121
+ setNotice({ text: t('settings-save-failed', { ns }), tone: 'error' });
122
+ }
123
+ });
124
+ };
125
+ /** Stage the next choice for a boolean/select field (Enter cycles). */
126
+ const cycleField = (ns, field) => {
127
+ const form = forms.get(ns);
128
+ if (form === undefined || !form.available || form.saving)
129
+ return;
130
+ const current = form.field(field).text;
131
+ if (field.kind === 'boolean') {
132
+ form.edit(field, current === 'true' ? 'false' : 'true');
133
+ }
134
+ else {
135
+ const options = field.options ?? [];
136
+ if (options.length === 0)
137
+ return;
138
+ const index = options.findIndex(option => option.value === current);
139
+ form.edit(field, options[(index + 1) % options.length]?.value ?? options[0]?.value ?? '');
140
+ }
141
+ setNotice(undefined);
142
+ bump();
143
+ };
144
+ useInput((input, key) => {
145
+ if (mode === 'edit' && editing !== null) {
146
+ if (isPlainReturn(key)) {
147
+ const form = forms.get(editing.ns);
148
+ form?.edit(editing.field, editing.draft);
149
+ bump();
150
+ setMode('list');
151
+ setEditing(null);
152
+ }
153
+ else if (key.escape) {
154
+ setMode('list');
155
+ setEditing(null);
156
+ }
157
+ else if (key.backspace || key.delete) {
158
+ setEditing(state => state === null ? null : { ...state, draft: state.draft.slice(0, -1) });
159
+ }
160
+ else if (!isMod(key) && !key.meta && !key.super && input && !key.return) {
161
+ // Only real characters reach the draft (see SessionBrowser's query).
162
+ const typed = input.replace(/\p{Cc}/gu, '');
163
+ if (typed.length > 0) {
164
+ setEditing(state => state === null ? null : { ...state, draft: state.draft + typed });
165
+ }
166
+ }
167
+ return;
168
+ }
169
+ if (key.upArrow) {
170
+ setFocusIndex(Math.max(0, effFocus - 1));
171
+ }
172
+ else if (key.downArrow) {
173
+ setFocusIndex(Math.min(Math.max(0, focusable.length - 1), effFocus + 1));
174
+ }
175
+ else if (isPlainReturn(key) && focused !== undefined) {
176
+ // A save in flight owns the section's drafts; starting an edit mid-write
177
+ // is exactly the lost-draft race the staged model exists to prevent.
178
+ if (focusedForm === undefined || !focusedForm.available || focusedForm.saving)
179
+ return;
180
+ if (focused.field.kind === 'boolean' || focused.field.kind === 'select') {
181
+ cycleField(focused.ns, focused.field);
182
+ }
183
+ else {
184
+ setEditing({ ns: focused.ns, field: focused.field, draft: focusedForm.field(focused.field).text });
185
+ setMode('edit');
186
+ }
187
+ }
188
+ else if (input === 's' && focused !== undefined) {
189
+ commitSave(focused.ns);
190
+ }
191
+ else if (input === 'd' && focused !== undefined) {
192
+ if (focusedForm?.saving)
193
+ return;
194
+ focusedForm?.discard();
195
+ setNotice(undefined);
196
+ bump();
197
+ }
198
+ else if (key.escape) {
199
+ // Esc backs out one layer at a time: staged drafts first — ANY dirty
200
+ // section, not just the focused one, so leaving never silently drops
201
+ // an edit made two sections ago — the screen second. A save in flight
202
+ // cannot be undone from here; let it settle instead of discarding
203
+ // around it.
204
+ const dirty = [...forms.values()].filter(form => form.shell().dirty);
205
+ if (dirty.length > 0) {
206
+ if (dirty.some(form => form.saving))
207
+ return;
208
+ for (const form of dirty)
209
+ form.discard();
210
+ setNotice({ text: t('settings-discarded'), tone: 'success' });
211
+ bump();
212
+ }
213
+ else {
214
+ onClose();
215
+ }
216
+ }
217
+ });
218
+ const renderField = (section, field) => {
219
+ const ns = section.ns;
220
+ const form = forms.get(ns);
221
+ const state = form?.field(field) ?? { text: '', overridden: false, invalid: false };
222
+ const isFocused = focused !== undefined && focused.ns === ns && focused.field === field;
223
+ const isEditing = isFocused && mode === 'edit' && editing !== null;
224
+ const label = pick(field.label, field.descriptions);
225
+ const hint = field.hint !== undefined ? pick(field.hint, field.hintDescriptions) : undefined;
226
+ let value;
227
+ if (field.secret !== undefined) {
228
+ const configured = secrets.get(`${ns}:${field.path.join('.')}`) === true;
229
+ if (isEditing) {
230
+ value = '•'.repeat(editing?.draft.length ?? 0) + '▌';
231
+ }
232
+ else if (state.text !== '') {
233
+ value = `${'•'.repeat(state.text.length)} ${t('settings-secret-staged')}`;
234
+ }
235
+ else {
236
+ value = configured ? t('settings-secret-set') : t('settings-secret-unset');
237
+ }
238
+ }
239
+ else if (isEditing) {
240
+ value = `${editing?.draft ?? ''}▌`;
241
+ }
242
+ else if (state.text === '') {
243
+ value = t('settings-field-empty');
244
+ }
245
+ else {
246
+ value = state.text;
247
+ }
248
+ return (_jsxs(Box, { children: [_jsx(Text, { color: isFocused ? 'suggestion' : undefined, children: isFocused ? '❯ ' : ' ' }), _jsx(Text, { bold: isFocused, children: label }), _jsx(Box, { flexGrow: 1 }), state.invalid && _jsxs(Text, { color: "error", children: [t('settings-field-invalid'), " "] }), state.overridden && _jsxs(Text, { dimColor: true, children: ["[", t('settings-badge-override'), "] "] }), form?.isStaged(field) === true && !isEditing && _jsx(Text, { color: "suggestion", children: "* " }), _jsx(Text, { color: isEditing || isFocused ? 'suggestion' : undefined, dimColor: !isFocused && !isEditing && state.text === '', children: value }), hint !== undefined && isFocused && (_jsxs(Text, { dimColor: true, children: ['\n ', hint] }))] }));
249
+ };
250
+ // ── Layout: a flat entry list with accounted line heights, windowed so the
251
+ // focused field is always on screen no matter how long the list gets. ────
252
+ const entries = [];
253
+ let focusCursor = 0;
254
+ sections.forEach((section, sectionIndex) => {
255
+ const form = forms.get(section.ns);
256
+ const view = form?.namespace;
257
+ const shell = form?.shell();
258
+ entries.push({
259
+ key: `section:${section.ns}`,
260
+ lines: sectionIndex === 0 ? 1 : 2,
261
+ node: (_jsxs(Box, { flexDirection: "column", children: [sectionIndex > 0 && _jsx(Text, { children: " " }), _jsxs(Box, { children: [_jsx(Text, { bold: true, color: "permission", children: pick(section.title, section.descriptions) }), _jsxs(Text, { dimColor: true, children: [" (", section.ns, ")"] }), view?.applies === 'restart' && _jsxs(Text, { color: "warning", children: [" [", t('settings-badge-restart'), "]"] }), view === undefined && _jsxs(Text, { color: "warning", children: [" [", t('settings-section-unavailable'), "]"] }), shell?.dirty === true && _jsxs(Text, { color: "suggestion", children: [" [", t('settings-badge-dirty'), "]"] }), shell?.saving === true && _jsxs(Text, { dimColor: true, children: [" [", t('settings-badge-saving'), "]"] }), shell?.failed === true && _jsxs(Text, { color: "error", children: [" [", t('settings-badge-failed'), "]"] })] })] })),
262
+ });
263
+ for (const field of section.fields) {
264
+ const isFocused = focused !== undefined && focused.ns === section.ns && focused.field === field;
265
+ const hasHint = field.hint !== undefined && isFocused;
266
+ const index = focusCursor;
267
+ focusCursor += 1;
268
+ entries.push({
269
+ key: `field:${section.ns}:${field.path.join('.')}`,
270
+ lines: hasHint ? 2 : 1,
271
+ focus: index,
272
+ node: renderField(section, field),
273
+ });
274
+ }
275
+ });
276
+ const registeredNs = new Set(sections.map(section => section.ns));
277
+ const readonlyNamespaces = namespaces.filter(entry => !registeredNs.has(entry.ns));
278
+ if (readonlyNamespaces.length > 0) {
279
+ entries.push({
280
+ key: 'readonly:heading',
281
+ lines: 2,
282
+ node: (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: " " }), _jsx(Text, { bold: true, dimColor: true, children: t('settings-readonly-heading') })] })),
283
+ });
284
+ for (const entry of readonlyNamespaces) {
285
+ entries.push({
286
+ key: `readonly:${entry.ns}`,
287
+ lines: 1,
288
+ node: (_jsxs(Box, { children: [_jsxs(Text, { children: [' ', entry.ns] }), entry.applies === 'restart' && _jsxs(Text, { color: "warning", children: [" [", t('settings-badge-restart'), "]"] }), _jsxs(Text, { dimColor: true, children: [' ', valuePreview(entry.value, 60)] })] })),
289
+ });
290
+ }
291
+ entries.push({
292
+ key: 'readonly:hint',
293
+ lines: 1,
294
+ node: _jsxs(Text, { dimColor: true, children: [' ', t('settings-readonly-hint', { path: '~/.dsh/settings.yaml' })] }),
295
+ });
296
+ }
297
+ if (sections.length === 0 && readonlyNamespaces.length === 0) {
298
+ entries.push({
299
+ key: 'empty',
300
+ lines: 1,
301
+ node: _jsx(Text, { dimColor: true, children: t('settings-empty') }),
302
+ });
303
+ }
304
+ // Focus-follow window: keep the focused entry fully inside the viewport.
305
+ let totalLines = 0;
306
+ let focusedOffset = 0;
307
+ let focusedLines = 1;
308
+ for (const entry of entries) {
309
+ if (entry.focus === effFocus) {
310
+ focusedOffset = totalLines;
311
+ focusedLines = entry.lines;
312
+ }
313
+ totalLines += entry.lines;
314
+ }
315
+ // Chrome: title row, top rule, bottom rule, hint row, plus the notice.
316
+ const viewport = Math.max(1, rows - 4 - (notice === undefined ? 0 : 1));
317
+ React.useEffect(() => {
318
+ setWindowStart(start => {
319
+ if (focusedOffset < start)
320
+ return focusedOffset;
321
+ if (focusedOffset + focusedLines > start + viewport)
322
+ return focusedOffset + focusedLines - viewport;
323
+ return start;
324
+ });
325
+ }, [focusedOffset, focusedLines, viewport]);
326
+ let entryOffset = 0;
327
+ const visible = entries.filter(entry => {
328
+ const start = entryOffset;
329
+ entryOffset += entry.lines;
330
+ return start >= windowStart && start + entry.lines <= windowStart + viewport;
331
+ });
332
+ return (_jsxs(Box, { flexDirection: "column", width: columns, height: rows, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: t('settings-title') }), _jsx(Box, { flexGrow: 1 }), host === undefined && _jsx(Text, { color: "warning", children: t('settings-unavailable') })] }), _jsx(Divider, {}), visible.map(entry => (_jsx(React.Fragment, { children: entry.node }, entry.key))), _jsx(Box, { flexGrow: 1 }), notice !== undefined && (_jsx(Text, { color: notice.tone === 'error' ? 'error' : 'success', children: notice.text })), _jsx(Divider, {}), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: mode === 'edit' ? t('settings-hint-edit') : t('settings-hint-list') }) })] }));
333
+ }
@@ -105,7 +105,7 @@ export function StatusLine({ channel, selectionActive = false, helpOpen = false,
105
105
  if (channel.contextBarEnabled && barWidth >= 14 && channel.contextWindow !== undefined) {
106
106
  bar = renderContextBar(channel.contextSegments, usage !== undefined ? usage.input + usage.cacheRead + usage.cacheWrite : 0, channel.contextWindow, barWidth, barColors);
107
107
  }
108
- return (_jsx(Box, { paddingX: 2, width: columns, flexShrink: 0, children: _jsxs(Box, { flexDirection: "column", width: "100%", children: [bar ? _jsx(Text, { children: bar }) : null, _jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: leftParts }) }), _jsx(Box, { justifyContent: "flex-end", flexShrink: 2, children: _jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: rightParts }) }) })] }), _jsxs(Box, { height: 1, overflow: "hidden", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [showActivity && activity !== undefined ? (_jsx(ActivityLine, { activity: activity, activityFrames: channel.activityFrames, warnPct: contextPressurePct(usage, channel.contextWindow), warnDanger: (contextPressurePct(usage, channel.contextWindow) ?? 0) >= 95 })) : hint ? (_jsx(Text, { color: "inactiveShimmer", children: hint })) : null, showActivity && hint ? (_jsx(Text, { color: "inactiveShimmer", wrap: "truncate", children: hint })) : null, wake !== undefined ? (_jsx(MiniWake, { band: wake.band, hint: wake.hint, tick: wake.tick })) : null] })] }) }));
108
+ return (_jsx(Box, { paddingX: 1, width: columns, flexShrink: 0, children: _jsxs(Box, { flexDirection: "column", width: "100%", children: [bar ? _jsx(Text, { children: bar }) : null, _jsxs(Box, { flexDirection: "row", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: leftParts }) }), _jsx(Box, { justifyContent: "flex-end", flexShrink: 2, children: _jsx(Text, { wrap: "truncate", children: _jsx(Byline, { children: rightParts }) }) })] }), _jsxs(Box, { height: 1, overflow: "hidden", flexDirection: "row", justifyContent: "space-between", gap: 2, children: [showActivity && activity !== undefined ? (_jsx(ActivityLine, { activity: activity, activityFrames: channel.activityFrames, warnPct: contextPressurePct(usage, channel.contextWindow), warnDanger: (contextPressurePct(usage, channel.contextWindow) ?? 0) >= 95 })) : hint ? (_jsx(Text, { color: "inactiveShimmer", children: hint })) : null, showActivity && hint ? (_jsx(Text, { color: "inactiveShimmer", wrap: "truncate", children: hint })) : null, wake !== undefined ? (_jsx(MiniWake, { band: wake.band, hint: wake.hint, tick: wake.tick })) : null] })] }) }));
109
109
  }
110
110
  function basename(path) {
111
111
  const parts = path.split(/[\\/]/);
@@ -0,0 +1,3 @@
1
+ export * from './dsh-adapter/settings-sections.js';
2
+ export { default } from './dsh-adapter/settings-sections.js';
3
+ //# sourceMappingURL=settings-sections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-sections.d.ts","sourceRoot":"","sources":["../../src/settings-sections.ts"],"names":[],"mappings":"AAEA,cAAc,oCAAoC,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA"}
@@ -0,0 +1,4 @@
1
+ // Re-export shim: the Cordis-backed implementation lives behind the adapter
2
+ // boundary so UI consumers never import official @deepseek-ai/* packages.
3
+ export * from './dsh-adapter/settings-sections.js';
4
+ export { default } from './dsh-adapter/settings-sections.js';
@@ -47,6 +47,23 @@ export type Theme = {
47
47
  diffRemovedDimmed: string;
48
48
  diffAddedWord: string;
49
49
  diffRemovedWord: string;
50
+ toolCardBackground: string;
51
+ toolCardBackgroundDim: string;
52
+ toolDotExec: string;
53
+ toolDotRead: string;
54
+ toolDotWrite: string;
55
+ toolDotWeb: string;
56
+ toolDotTask: string;
57
+ syntaxKeyword: string;
58
+ syntaxString: string;
59
+ syntaxComment: string;
60
+ syntaxNumber: string;
61
+ syntaxFunction: string;
62
+ syntaxType: string;
63
+ syntaxVariable: string;
64
+ syntaxOperator: string;
65
+ syntaxPunctuation: string;
66
+ syntaxConstant: string;
50
67
  red_FOR_SUBAGENTS_ONLY: string;
51
68
  blue_FOR_SUBAGENTS_ONLY: string;
52
69
  green_FOR_SUBAGENTS_ONLY: string;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,6BAA6B,EAAE,MAAM,CAAA;IACrC,oCAAoC,EAAE,MAAM,CAAA;IAC5C,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAElB,OAAO,EAAE,MAAM,C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,EAAE,MAAM,CAAA;IAC5B,sBAAsB,EAAE,MAAM,CAAA;IAC9B,sBAAsB,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED,kDAAkD;AAClD,eAAO,MAAM,WAAW,yCAA0C,CAAA;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SAAS,CAAA;AAWrC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAE7D;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,IAAI,OAAO,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAqS9B;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK,CAiBpD;AASD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,GAAG,SAAS,GAC5C,IAAI,CAEN;AASD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAExD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,KAAK,CAEtC"}
@@ -86,6 +86,23 @@ const darkTheme = {
86
86
  diffRemovedDimmed: rgb('#362B2C'),
87
87
  diffAddedWord: rgb('#57956B'),
88
88
  diffRemovedWord: rgb('#B26671'),
89
+ toolCardBackground: rgb('#242B3A'), // lighter blue-grey card surface
90
+ toolCardBackgroundDim: rgb('#1C2330'), // deeper blue substrate
91
+ toolDotExec: rgb('#7FAE99'), // sage green — bash/pwsh
92
+ toolDotRead: rgb('#82B8C7'), // cyan blue — read/grep/glob
93
+ toolDotWrite: rgb('#B3A0D4'), // soft violet — edit/write
94
+ toolDotWeb: rgb('#7DA1DE'), // mist blue — web search/fetch
95
+ toolDotTask: rgb('#D194AE'), // mist rose — subagent/jobs
96
+ syntaxKeyword: rgb('#8FA8E8'), // mist blue
97
+ syntaxString: rgb('#9FBF8F'), // soft sage
98
+ syntaxComment: rgb('#6B7280'), // neutral grey
99
+ syntaxNumber: rgb('#D9A97E'), // warm tan
100
+ syntaxFunction: rgb('#82B8C7'), // cyan blue
101
+ syntaxType: rgb('#B39DDB'), // soft violet
102
+ syntaxVariable: rgb('#C9D1D9'), // near-text
103
+ syntaxOperator: rgb('#93A1B0'), // blue grey
104
+ syntaxPunctuation: rgb('#7A8694'), // dim blue grey
105
+ syntaxConstant: rgb('#D98C9B'), // soft rose
89
106
  red_FOR_SUBAGENTS_ONLY: rgb('#D4685E'),
90
107
  blue_FOR_SUBAGENTS_ONLY: rgb('#7496D6'),
91
108
  green_FOR_SUBAGENTS_ONLY: rgb('#66B285'),
@@ -163,6 +180,23 @@ const lightTheme = {
163
180
  diffRemovedDimmed: rgb('#F5E6E4'),
164
181
  diffAddedWord: rgb('#A9D3B4'),
165
182
  diffRemovedWord: rgb('#E5B3AE'),
183
+ toolCardBackground: rgb('#E9EFF9'), // cool light blue card
184
+ toolCardBackgroundDim: rgb('#DEE7F4'), // deeper blue-tinted substrate
185
+ toolDotExec: rgb('#4E7A4E'),
186
+ toolDotRead: rgb('#3F7E8F'),
187
+ toolDotWrite: rgb('#7A5CA8'),
188
+ toolDotWeb: rgb('#4A63A8'),
189
+ toolDotTask: rgb('#B04A5A'),
190
+ syntaxKeyword: rgb('#4A63A8'),
191
+ syntaxString: rgb('#4E7A4E'),
192
+ syntaxComment: rgb('#8A8F98'),
193
+ syntaxNumber: rgb('#A96B32'),
194
+ syntaxFunction: rgb('#3F7E8F'),
195
+ syntaxType: rgb('#7A5CA8'),
196
+ syntaxVariable: rgb('#343945'),
197
+ syntaxOperator: rgb('#5B6672'),
198
+ syntaxPunctuation: rgb('#9AA0A8'),
199
+ syntaxConstant: rgb('#B04A5A'),
166
200
  red_FOR_SUBAGENTS_ONLY: rgb('#BE5A52'),
167
201
  blue_FOR_SUBAGENTS_ONLY: rgb('#3F6CC4'),
168
202
  green_FOR_SUBAGENTS_ONLY: rgb('#4E9675'),
@@ -242,6 +276,23 @@ const darkAnsiTheme = {
242
276
  diffRemovedDimmed: 'ansi:red',
243
277
  diffAddedWord: 'ansi:greenBright',
244
278
  diffRemovedWord: 'ansi:redBright',
279
+ toolCardBackground: 'ansi:blackBright',
280
+ toolCardBackgroundDim: 'ansi:black',
281
+ toolDotExec: 'ansi:greenBright',
282
+ toolDotRead: 'ansi:cyanBright',
283
+ toolDotWrite: 'ansi:magentaBright',
284
+ toolDotWeb: 'ansi:blueBright',
285
+ toolDotTask: 'ansi:redBright',
286
+ syntaxKeyword: 'ansi:blueBright',
287
+ syntaxString: 'ansi:greenBright',
288
+ syntaxComment: 'ansi:blackBright',
289
+ syntaxNumber: 'ansi:yellowBright',
290
+ syntaxFunction: 'ansi:cyanBright',
291
+ syntaxType: 'ansi:magentaBright',
292
+ syntaxVariable: 'ansi:white',
293
+ syntaxOperator: 'ansi:white',
294
+ syntaxPunctuation: 'ansi:blackBright',
295
+ syntaxConstant: 'ansi:redBright',
245
296
  red_FOR_SUBAGENTS_ONLY: 'ansi:redBright',
246
297
  blue_FOR_SUBAGENTS_ONLY: 'ansi:blueBright',
247
298
  green_FOR_SUBAGENTS_ONLY: 'ansi:greenBright',
@@ -9,6 +9,7 @@ export type TuiUpdateTarget = {
9
9
  kind: 'update';
10
10
  current: string;
11
11
  latest: string;
12
+ authoritative?: string;
12
13
  } | {
13
14
  kind: 'latest';
14
15
  current: string;
@@ -43,10 +44,29 @@ export declare function resolveDshProfileName(argv?: readonly string[]): string
43
44
  export declare function resolveRegistryBase(): string;
44
45
  /** True when `current` is a strictly newer valid version than `previous`. */
45
46
  export declare function isVersionNewer(current: string, previous: string): boolean;
47
+ /**
48
+ * Versions whose compiled plugin hard-injects `tuiWorkspaces`
49
+ * ('0.7.0'–'0.7.1'; removed in 0.7.2). Installing one while the globally
50
+ * installed launcher copy predates the `dsh-tui-workspaces` patch row
51
+ * deadlocks boot forever at "pending (waiting for service: tuiWorkspaces)"
52
+ * (issues #183/#307) — and /update reaching such a target is exactly how
53
+ * stale-mirror installs stranded users. /update must refuse them.
54
+ * @param version - the candidate install target.
55
+ * @returns true for the known boot-deadlock version range.
56
+ */
57
+ export declare function isBootDeadlockTarget(version: string): boolean;
46
58
  /**
47
59
  * Classify this install against a fresh registry lookup: an update is
48
60
  * available, the install is already latest, or the answer is unknown
49
61
  * (offline / registry error / unreadable own version).
62
+ *
63
+ * The configured registry decides the install target (pnpm must be able to
64
+ * fetch it), but when that registry is a mirror it can lag behind npmjs —
65
+ * issue #307's users were pinned onto stale versions this way. A
66
+ * best-effort npmjs.org check runs in parallel and surfaces as
67
+ * `authoritative` when it knows a strictly newer release, so callers can
68
+ * say "installing X now, official latest is Y" instead of silently
69
+ * upgrading to yesterday's version.
50
70
  */
51
71
  export declare function resolveTuiUpdateTarget(): Promise<TuiUpdateTarget>;
52
72
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/update.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAIlD,OAAO,EAAE,UAAU,EAAE,CAAA;AAQrB,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AAED,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAEvB,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,gFAAgF;AAChF,wBAAgB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1B"}
@@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs';
3
3
  import { homedir } from 'node:os';
4
4
  import { dirname, join } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
- import { gt, valid } from 'semver';
6
+ import { gte, gt, lt, valid } from 'semver';
7
7
  import { shellQuote } from './utils/shellQuote.js';
8
8
  // Re-exported for scripts/verify-update.mjs and the bin launcher, which reads
9
9
  // the compiled copy at lib/types/utils/shellQuote.js.
@@ -81,15 +81,29 @@ export function isVersionNewer(current, previous) {
81
81
  const b = valid(previous);
82
82
  return a !== null && b !== null && gt(a, b);
83
83
  }
84
+ /**
85
+ * Versions whose compiled plugin hard-injects `tuiWorkspaces`
86
+ * ('0.7.0'–'0.7.1'; removed in 0.7.2). Installing one while the globally
87
+ * installed launcher copy predates the `dsh-tui-workspaces` patch row
88
+ * deadlocks boot forever at "pending (waiting for service: tuiWorkspaces)"
89
+ * (issues #183/#307) — and /update reaching such a target is exactly how
90
+ * stale-mirror installs stranded users. /update must refuse them.
91
+ * @param version - the candidate install target.
92
+ * @returns true for the known boot-deadlock version range.
93
+ */
94
+ export function isBootDeadlockTarget(version) {
95
+ const v = valid(version);
96
+ return v !== null && gte(v, '0.7.0') && lt(v, '0.7.2');
97
+ }
84
98
  function isRecord(value) {
85
99
  return value !== null && typeof value === 'object' && !Array.isArray(value);
86
100
  }
87
- /** Fetch `latest` from the configured registry; undefined on any failure. */
88
- async function fetchLatestVersion() {
101
+ /** Fetch `latest` from a registry; undefined on any failure. */
102
+ async function fetchLatestVersion(registryBase) {
89
103
  const controller = new AbortController();
90
104
  const timeout = setTimeout(() => controller.abort(), UPDATE_CHECK_TIMEOUT_MS);
91
105
  try {
92
- const response = await fetch(`${resolveRegistryBase()}/${PACKAGE_NAME}/latest`, {
106
+ const response = await fetch(`${registryBase}/${PACKAGE_NAME}/latest`, {
93
107
  headers: { accept: 'application/json' },
94
108
  signal: controller.signal,
95
109
  });
@@ -112,18 +126,31 @@ async function fetchLatestVersion() {
112
126
  * Classify this install against a fresh registry lookup: an update is
113
127
  * available, the install is already latest, or the answer is unknown
114
128
  * (offline / registry error / unreadable own version).
129
+ *
130
+ * The configured registry decides the install target (pnpm must be able to
131
+ * fetch it), but when that registry is a mirror it can lag behind npmjs —
132
+ * issue #307's users were pinned onto stale versions this way. A
133
+ * best-effort npmjs.org check runs in parallel and surfaces as
134
+ * `authoritative` when it knows a strictly newer release, so callers can
135
+ * say "installing X now, official latest is Y" instead of silently
136
+ * upgrading to yesterday's version.
115
137
  */
116
138
  export async function resolveTuiUpdateTarget() {
117
139
  const current = installedTuiVersion();
118
140
  const currentVersion = current === undefined ? null : valid(current);
119
141
  if (currentVersion === null)
120
142
  return { kind: 'unknown' };
121
- const latest = await fetchLatestVersion();
143
+ const registryBase = resolveRegistryBase();
144
+ const [latest, official] = await Promise.all([
145
+ fetchLatestVersion(registryBase),
146
+ registryBase === DEFAULT_REGISTRY ? undefined : fetchLatestVersion(DEFAULT_REGISTRY),
147
+ ]);
122
148
  if (latest === undefined)
123
149
  return { kind: 'unknown' };
124
150
  if (!gt(latest, currentVersion))
125
151
  return { kind: 'latest', current: currentVersion };
126
- return { kind: 'update', current: currentVersion, latest };
152
+ const authoritative = official !== undefined && gt(official, latest) ? official : undefined;
153
+ return { kind: 'update', current: currentVersion, latest, ...(authoritative === undefined ? {} : { authoritative }) };
127
154
  }
128
155
  /**
129
156
  * Check npm for a newer published TUI version. Network and registry errors
@@ -217,6 +244,12 @@ export function isTransientUpdateFailure(stderr) {
217
244
  * @returns Exit codes for the update run and the replacement process.
218
245
  */
219
246
  export async function updateTuiAndRestart(sessionId, profile, targetVersion) {
247
+ // Stamp the pre-update version BEFORE pnpm runs: it reads this package's
248
+ // manifest from disk, which the update replaces on the fly — a
249
+ // post-update read already sees the NEW version, and the restarted
250
+ // process then compares new-vs-new and false-alarms "version did not
251
+ // advance" on every successful update (issue #307's screenshots).
252
+ const updatedFrom = installedTuiVersion() ?? '';
220
253
  const dsh = process.platform === 'win32' ? 'dsh.cmd' : 'dsh';
221
254
  const updateArgs = tuiUpdatePluginArgs(profile, targetVersion);
222
255
  let updateStderr = '';
@@ -232,6 +265,20 @@ export async function updateTuiAndRestart(sessionId, profile, targetVersion) {
232
265
  }
233
266
  if (updateCode !== 0)
234
267
  return { updateCode, restartCode: updateCode };
268
+ // A --latest fallback (preflight failed) on a stale mirror can still land
269
+ // on the 0.7.0–0.7.1 hard-inject range — restarting into it under an older
270
+ // global-launcher patch is the permanent boot deadlock of issues
271
+ // #183/#307. Refuse the restart when the version JUST moved there; a user
272
+ // who was already on it keeps their restart (their combo demonstrably
273
+ // boots) and gets the repair hint on the next /update instead.
274
+ const installedNow = installedTuiVersion();
275
+ if (installedNow !== undefined && installedNow !== updatedFrom && isBootDeadlockTarget(installedNow)) {
276
+ process.stderr.write(`dsh-tui: update landed on ${installedNow}, which can permanently deadlock boot under older launcher patches ` +
277
+ `(#183/#307) — NOT restarting into it. Repair with:\n` +
278
+ ` dsh plugin --profile ${profile} add ${PACKAGE_NAME}@latest\n` +
279
+ `(if the mirror has not synced the latest release yet, retry later)\n`);
280
+ return { updateCode: 1, restartCode: 1 };
281
+ }
235
282
  // Post-update verification (issue #225): pnpm can report success yet leave
236
283
  // the profile half-updated (manifest old / lockfile new). Verify against
237
284
  // the preflight target; a full `install` reconciles lockfile →
@@ -257,7 +304,7 @@ export async function updateTuiAndRestart(sessionId, profile, targetVersion) {
257
304
  // still-old TUI build reads only DSH_CC_RESUME_SESSION.
258
305
  DSH_TUI_RESUME_SESSION: sessionId,
259
306
  DSH_CC_RESUME_SESSION: sessionId,
260
- [UPDATED_FROM_ENV]: installedTuiVersion() ?? '',
307
+ [UPDATED_FROM_ENV]: updatedFrom,
261
308
  },
262
309
  });
263
310
  return { updateCode, restartCode };