@deepseek-harness-tui/dsh-tui 0.9.2 → 0.10.0-beta.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 (423) hide show
  1. package/README.md +27 -9
  2. package/bin/dsh-tui.js +26 -4
  3. package/cordis.patch.yml +117 -39
  4. package/cordis.yml +13 -10
  5. package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
  6. package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
  7. package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
  8. package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
  9. package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
  10. package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
  11. package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
  12. package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
  13. package/dsh-ecosystem-spec/registry/README.md +14 -14
  14. package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
  15. package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
  16. package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
  17. package/lib/types/api.d.ts +7 -0
  18. package/lib/types/api.d.ts.map +1 -0
  19. package/lib/types/api.js +1 -0
  20. package/lib/types/cc/hyperlink.d.ts.map +1 -1
  21. package/lib/types/cc/hyperlink.js +42 -4
  22. package/lib/types/cc/markdown.d.ts.map +1 -1
  23. package/lib/types/cc/markdown.js +15 -5
  24. package/lib/types/commands.d.ts +6 -0
  25. package/lib/types/commands.d.ts.map +1 -1
  26. package/lib/types/commands.js +13 -10
  27. package/lib/types/components/BalanceReportRow.d.ts +24 -0
  28. package/lib/types/components/BalanceReportRow.d.ts.map +1 -0
  29. package/lib/types/components/BalanceReportRow.js +87 -0
  30. package/lib/types/components/HistorySearchDialog.js +1 -1
  31. package/lib/types/components/MessageList.d.ts +6 -4
  32. package/lib/types/components/MessageList.d.ts.map +1 -1
  33. package/lib/types/components/MessageList.js +36 -31
  34. package/lib/types/components/PermissionsPicker.d.ts +6 -7
  35. package/lib/types/components/PermissionsPicker.d.ts.map +1 -1
  36. package/lib/types/components/PermissionsPicker.js +20 -14
  37. package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
  38. package/lib/types/components/PluginSceneBoundary.js +1 -1
  39. package/lib/types/components/PromptEditor.d.ts +46 -0
  40. package/lib/types/components/PromptEditor.d.ts.map +1 -0
  41. package/lib/types/components/PromptEditor.js +60 -0
  42. package/lib/types/components/PromptInput.d.ts +12 -0
  43. package/lib/types/components/PromptInput.d.ts.map +1 -1
  44. package/lib/types/components/PromptInput.js +1256 -205
  45. package/lib/types/components/RewindPicker.js +1 -1
  46. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
  47. package/lib/types/components/StreamingMarkdown.js +140 -3
  48. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  49. package/lib/types/components/SubagentDashboard.js +2 -2
  50. package/lib/types/components/SubagentDetailScene.js +1 -1
  51. package/lib/types/components/ThemePicker.d.ts +13 -15
  52. package/lib/types/components/ThemePicker.d.ts.map +1 -1
  53. package/lib/types/components/ThemePicker.js +24 -26
  54. package/lib/types/components/Tooltip.d.ts +67 -0
  55. package/lib/types/components/Tooltip.d.ts.map +1 -0
  56. package/lib/types/components/Tooltip.js +220 -0
  57. package/lib/types/components/Whale.d.ts +15 -4
  58. package/lib/types/components/Whale.d.ts.map +1 -1
  59. package/lib/types/components/Whale.js +9 -8
  60. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  61. package/lib/types/components/approvals/ApprovalPanel.js +1 -1
  62. package/lib/types/components/design-system/Divider.d.ts +9 -1
  63. package/lib/types/components/design-system/Divider.d.ts.map +1 -1
  64. package/lib/types/components/design-system/Divider.js +42 -8
  65. package/lib/types/components/design-system/ThemeProvider.d.ts +5 -2
  66. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
  67. package/lib/types/components/design-system/ThemeProvider.js +52 -16
  68. package/lib/types/components/design-system/ThemedBox.d.ts +23 -2
  69. package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -1
  70. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +5 -5
  71. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  72. package/lib/types/components/messages/AssistantThinkingMessage.js +4 -4
  73. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +7 -1
  74. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  75. package/lib/types/components/messages/AssistantToolUseMessage.js +48 -7
  76. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
  77. package/lib/types/components/messages/UserPromptMessage.js +7 -1
  78. package/lib/types/components/questions/AskUserQuestionPanel.js +1 -1
  79. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  80. package/lib/types/components/questions/PlanReviewPanel.js +29 -3
  81. package/lib/types/components/sessions/SessionListRow.d.ts +8 -1
  82. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  83. package/lib/types/components/sessions/SessionListRow.js +9 -2
  84. package/lib/types/components/sessions/SessionPreview.d.ts.map +1 -1
  85. package/lib/types/components/sessions/SessionPreview.js +5 -3
  86. package/lib/types/components/sessions/WorkspaceListRow.d.ts +17 -0
  87. package/lib/types/components/sessions/WorkspaceListRow.d.ts.map +1 -0
  88. package/lib/types/components/sessions/WorkspaceListRow.js +27 -0
  89. package/lib/types/customTheme.d.ts +4 -0
  90. package/lib/types/customTheme.d.ts.map +1 -1
  91. package/lib/types/customTheme.js +9 -5
  92. package/lib/types/deepseekBalance.d.ts +53 -0
  93. package/lib/types/deepseekBalance.d.ts.map +1 -0
  94. package/lib/types/deepseekBalance.js +86 -0
  95. package/lib/types/deepseekPricing.d.ts +82 -0
  96. package/lib/types/deepseekPricing.d.ts.map +1 -0
  97. package/lib/types/deepseekPricing.js +133 -0
  98. package/lib/types/dsh-adapter/approvals.d.ts +114 -2
  99. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  100. package/lib/types/dsh-adapter/approvals.js +241 -3
  101. package/lib/types/dsh-adapter/channel.d.ts +88 -3
  102. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  103. package/lib/types/dsh-adapter/channel.js +567 -89
  104. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
  105. package/lib/types/dsh-adapter/childStderr.js +9 -0
  106. package/lib/types/dsh-adapter/contract.d.ts +17 -13
  107. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  108. package/lib/types/dsh-adapter/contract.js +36 -27
  109. package/lib/types/dsh-adapter/credentialRefGuard.d.ts +40 -0
  110. package/lib/types/dsh-adapter/credentialRefGuard.d.ts.map +1 -0
  111. package/lib/types/dsh-adapter/credentialRefGuard.js +43 -0
  112. package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
  113. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  114. package/lib/types/dsh-adapter/effect-ledger.js +1 -0
  115. package/lib/types/dsh-adapter/extensions.d.ts +4 -1
  116. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
  117. package/lib/types/dsh-adapter/extensions.js +8 -1
  118. package/lib/types/dsh-adapter/index.d.ts +11 -1
  119. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  120. package/lib/types/dsh-adapter/index.js +2 -0
  121. package/lib/types/dsh-adapter/plugin-test-utils.d.ts +62 -0
  122. package/lib/types/dsh-adapter/plugin-test-utils.d.ts.map +1 -0
  123. package/lib/types/dsh-adapter/plugin-test-utils.js +61 -0
  124. package/lib/types/dsh-adapter/plugin.d.ts +26 -0
  125. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  126. package/lib/types/dsh-adapter/plugin.js +279 -56
  127. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  128. package/lib/types/dsh-adapter/plugins-info.js +12 -0
  129. package/lib/types/dsh-adapter/preset-resolution.d.ts +49 -0
  130. package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -0
  131. package/lib/types/dsh-adapter/preset-resolution.js +42 -0
  132. package/lib/types/dsh-adapter/presets.d.ts +0 -26
  133. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  134. package/lib/types/dsh-adapter/presets.js +4 -14
  135. package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -1
  136. package/lib/types/dsh-adapter/promptDebug.js +4 -1
  137. package/lib/types/dsh-adapter/providerGuard.d.ts +75 -0
  138. package/lib/types/dsh-adapter/providerGuard.d.ts.map +1 -0
  139. package/lib/types/dsh-adapter/providerGuard.js +104 -0
  140. package/lib/types/dsh-adapter/questions-answerer.d.ts +49 -0
  141. package/lib/types/dsh-adapter/questions-answerer.d.ts.map +1 -0
  142. package/lib/types/dsh-adapter/questions-answerer.js +61 -0
  143. package/lib/types/dsh-adapter/recap.d.ts.map +1 -1
  144. package/lib/types/dsh-adapter/recap.js +12 -6
  145. package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -1
  146. package/lib/types/dsh-adapter/sanitize.js +6 -1
  147. package/lib/types/dsh-adapter/sessions/digest.d.ts +21 -1
  148. package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
  149. package/lib/types/dsh-adapter/sessions/digest.js +229 -3
  150. package/lib/types/dsh-adapter/sessions/frames.d.ts +3 -0
  151. package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -1
  152. package/lib/types/dsh-adapter/sessions/frames.js +34 -19
  153. package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/sessions/list.js +148 -31
  155. package/lib/types/dsh-adapter/sessions/store.d.ts +8 -0
  156. package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/sessions/store.js +24 -4
  158. package/lib/types/dsh-adapter/sessions/types.d.ts +3 -0
  159. package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -1
  160. package/lib/types/dsh-adapter/settings-sections.d.ts +1 -0
  161. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  162. package/lib/types/dsh-adapter/settings-sections.js +48 -3
  163. package/lib/types/dsh-adapter/settingsEditor.d.ts +6 -0
  164. package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -1
  165. package/lib/types/dsh-adapter/settingsEditor.js +15 -3
  166. package/lib/types/dsh-adapter/subagents.d.ts +4 -0
  167. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  168. package/lib/types/dsh-adapter/subagents.js +8 -0
  169. package/lib/types/dsh-adapter/themes.d.ts +51 -0
  170. package/lib/types/dsh-adapter/themes.d.ts.map +1 -0
  171. package/lib/types/dsh-adapter/themes.js +272 -0
  172. package/lib/types/dsh-adapter/toast.d.ts +67 -0
  173. package/lib/types/dsh-adapter/toast.d.ts.map +1 -0
  174. package/lib/types/dsh-adapter/toast.js +141 -0
  175. package/lib/types/dsh-adapter/types.d.ts +1 -1
  176. package/lib/types/extensions.d.ts +4 -0
  177. package/lib/types/extensions.d.ts.map +1 -1
  178. package/lib/types/extensions.js +5 -1
  179. package/lib/types/history.d.ts +4 -3
  180. package/lib/types/history.d.ts.map +1 -1
  181. package/lib/types/history.js +71 -18
  182. package/lib/types/hooks/useRuntimeThemeSnapshot.d.ts +10 -0
  183. package/lib/types/hooks/useRuntimeThemeSnapshot.d.ts.map +1 -0
  184. package/lib/types/hooks/useRuntimeThemeSnapshot.js +32 -0
  185. package/lib/types/i18n.d.ts +319 -94
  186. package/lib/types/i18n.d.ts.map +1 -1
  187. package/lib/types/i18n.js +118 -35
  188. package/lib/types/ink/components/App.d.ts +20 -0
  189. package/lib/types/ink/components/App.d.ts.map +1 -1
  190. package/lib/types/ink/components/App.js +142 -13
  191. package/lib/types/ink/components/Box.d.ts +39 -2
  192. package/lib/types/ink/components/Box.d.ts.map +1 -1
  193. package/lib/types/ink/components/Box.js +61 -37
  194. package/lib/types/ink/events/context-menu-event.d.ts +19 -0
  195. package/lib/types/ink/events/context-menu-event.d.ts.map +1 -0
  196. package/lib/types/ink/events/context-menu-event.js +20 -0
  197. package/lib/types/ink/events/drag-event.d.ts +44 -0
  198. package/lib/types/ink/events/drag-event.d.ts.map +1 -0
  199. package/lib/types/ink/events/drag-event.js +39 -0
  200. package/lib/types/ink/events/event-handlers.d.ts +8 -0
  201. package/lib/types/ink/events/event-handlers.d.ts.map +1 -1
  202. package/lib/types/ink/events/event-handlers.js +8 -0
  203. package/lib/types/ink/hit-test.d.ts +69 -0
  204. package/lib/types/ink/hit-test.d.ts.map +1 -1
  205. package/lib/types/ink/hit-test.js +260 -6
  206. package/lib/types/ink/ink.d.ts +25 -0
  207. package/lib/types/ink/ink.d.ts.map +1 -1
  208. package/lib/types/ink/ink.js +141 -27
  209. package/lib/types/ink/parse-keypress.d.ts +2 -0
  210. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  211. package/lib/types/ink/parse-keypress.js +12 -15
  212. package/lib/types/ink/renderer.d.ts.map +1 -1
  213. package/lib/types/ink/renderer.js +7 -0
  214. package/lib/types/ink/root.d.ts +16 -0
  215. package/lib/types/ink/root.d.ts.map +1 -1
  216. package/lib/types/ink/root.js +2 -0
  217. package/lib/types/ink/screen.d.ts +7 -0
  218. package/lib/types/ink/screen.d.ts.map +1 -1
  219. package/lib/types/ink/screen.js +8 -1
  220. package/lib/types/ink/terminal-querier.d.ts +8 -0
  221. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  222. package/lib/types/ink/terminal-querier.js +13 -0
  223. package/lib/types/ink/terminal.d.ts +42 -0
  224. package/lib/types/ink/terminal.d.ts.map +1 -1
  225. package/lib/types/ink/terminal.js +52 -2
  226. package/lib/types/ink/termio/osc.d.ts +2 -1
  227. package/lib/types/ink/termio/osc.d.ts.map +1 -1
  228. package/lib/types/ink/termio/osc.js +26 -5
  229. package/lib/types/plugin-spec/registry.d.ts +1 -1
  230. package/lib/types/plugin-spec/registry.js +1 -1
  231. package/lib/types/presetPrefs.d.ts +6 -5
  232. package/lib/types/presetPrefs.d.ts.map +1 -1
  233. package/lib/types/presetPrefs.js +10 -5
  234. package/lib/types/screens/Chat.d.ts +4 -1
  235. package/lib/types/screens/Chat.d.ts.map +1 -1
  236. package/lib/types/screens/Chat.js +240 -104
  237. package/lib/types/screens/SessionBrowser.d.ts +9 -4
  238. package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
  239. package/lib/types/screens/SessionBrowser.js +497 -74
  240. package/lib/types/screens/SessionTree.d.ts.map +1 -1
  241. package/lib/types/screens/SessionTree.js +37 -9
  242. package/lib/types/screens/Settings.d.ts +7 -5
  243. package/lib/types/screens/Settings.d.ts.map +1 -1
  244. package/lib/types/screens/Settings.js +211 -100
  245. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  246. package/lib/types/screens/StatusLine.js +37 -2
  247. package/lib/types/screens/chatOverlay.d.ts +3 -2
  248. package/lib/types/screens/chatOverlay.d.ts.map +1 -1
  249. package/lib/types/screens/chatOverlay.js +2 -0
  250. package/lib/types/sessionHistory.d.ts +11 -0
  251. package/lib/types/sessionHistory.d.ts.map +1 -1
  252. package/lib/types/sessionHistory.js +29 -0
  253. package/lib/types/sessionPins.d.ts +33 -0
  254. package/lib/types/sessionPins.d.ts.map +1 -0
  255. package/lib/types/sessionPins.js +181 -0
  256. package/lib/types/sessions/format.d.ts +2 -0
  257. package/lib/types/sessions/format.d.ts.map +1 -1
  258. package/lib/types/sessions/format.js +23 -4
  259. package/lib/types/sessions/view.d.ts +42 -6
  260. package/lib/types/sessions/view.d.ts.map +1 -1
  261. package/lib/types/sessions/view.js +133 -35
  262. package/lib/types/test-utils.d.ts +2 -0
  263. package/lib/types/test-utils.d.ts.map +1 -0
  264. package/lib/types/test-utils.js +8 -0
  265. package/lib/types/theme.d.ts +22 -5
  266. package/lib/types/theme.d.ts.map +1 -1
  267. package/lib/types/theme.js +57 -7
  268. package/lib/types/themeCatalog.d.ts +36 -0
  269. package/lib/types/themeCatalog.d.ts.map +1 -0
  270. package/lib/types/themeCatalog.js +157 -0
  271. package/lib/types/tips.d.ts.map +1 -1
  272. package/lib/types/tips.js +115 -19
  273. package/lib/types/tuiDisplayPrefs.d.ts +3 -0
  274. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  275. package/lib/types/tuiDisplayPrefs.js +1 -0
  276. package/lib/types/update.d.ts +202 -0
  277. package/lib/types/update.d.ts.map +1 -1
  278. package/lib/types/update.js +716 -6
  279. package/lib/types/utils/debug.d.ts.map +1 -1
  280. package/lib/types/utils/debug.js +2 -1
  281. package/lib/types/utils/keymap.d.ts +1 -1
  282. package/lib/types/utils/keymap.d.ts.map +1 -1
  283. package/lib/types/utils/keymap.js +19 -2
  284. package/lib/types/utils/urlGuard.d.ts +28 -0
  285. package/lib/types/utils/urlGuard.d.ts.map +1 -0
  286. package/lib/types/utils/urlGuard.js +21 -0
  287. package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -21
  288. package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +3 -0
  289. package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -44
  290. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.d.ts +7 -11
  291. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.d.ts +16 -1
  292. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.js +23 -2
  293. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.d.ts +5 -5
  294. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/pi-ai.d.ts +23 -0
  295. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/pi-ai.js +27 -0
  296. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.d.ts +17 -3
  297. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +36 -4
  298. package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +11 -12
  299. package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
  300. package/node_modules/@dsh-std/command/LICENSE +21 -21
  301. package/node_modules/@dsh-std/command/README.md +26 -26
  302. package/node_modules/@dsh-std/command/README.zh.md +28 -28
  303. package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
  304. package/node_modules/@dsh-std/command/package.json +22 -22
  305. package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  306. package/node_modules/@dsh-std/connection/LICENSE +21 -21
  307. package/node_modules/@dsh-std/connection/README.md +42 -42
  308. package/node_modules/@dsh-std/connection/README.zh.md +42 -42
  309. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  310. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  311. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  312. package/node_modules/@dsh-std/connection/package.json +20 -20
  313. package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  314. package/node_modules/@dsh-std/core/LICENSE +21 -21
  315. package/node_modules/@dsh-std/core/README.md +13 -13
  316. package/node_modules/@dsh-std/core/README.zh.md +13 -13
  317. package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  318. package/node_modules/@dsh-std/core/package.json +21 -21
  319. package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  320. package/node_modules/@dsh-std/manifest/LICENSE +21 -21
  321. package/node_modules/@dsh-std/manifest/README.md +5 -5
  322. package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  323. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  324. package/node_modules/@dsh-std/manifest/package.json +20 -20
  325. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  326. package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
  327. package/node_modules/@dsh-std/messages/LICENSE +21 -21
  328. package/node_modules/@dsh-std/messages/README.md +5 -5
  329. package/node_modules/@dsh-std/messages/README.zh.md +7 -7
  330. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
  331. package/node_modules/@dsh-std/messages/package.json +20 -20
  332. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
  333. package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  334. package/node_modules/@dsh-std/presentation/LICENSE +21 -21
  335. package/node_modules/@dsh-std/presentation/README.md +27 -27
  336. package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  337. package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  338. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  339. package/node_modules/@dsh-std/presentation/package.json +25 -25
  340. package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
  341. package/node_modules/@dsh-std/storage/LICENSE +21 -21
  342. package/node_modules/@dsh-std/storage/README.md +5 -5
  343. package/node_modules/@dsh-std/storage/README.zh.md +7 -7
  344. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
  345. package/node_modules/@dsh-std/storage/package.json +20 -20
  346. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
  347. package/package.json +204 -75
  348. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  349. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
  350. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
  351. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
  352. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  353. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  354. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  355. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
  356. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  357. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
  358. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
  359. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
  360. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  361. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
  362. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  363. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
  364. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
  365. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  366. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  367. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
  368. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  369. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  370. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
  371. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
  372. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  373. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  374. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  375. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
  376. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  377. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
  378. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
  379. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
  380. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  381. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
  382. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  383. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
  384. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
  385. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
  386. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  387. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
  388. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  389. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
  390. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
  391. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
  392. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  393. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
  394. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  395. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
  396. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
  397. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
  398. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  399. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  400. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  401. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
  402. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  403. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
  404. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
  405. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
  406. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  407. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
  408. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  409. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
  410. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
  411. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
  412. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  413. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
  414. package/lib/types/dsh-adapter/packaged-skills.d.ts +0 -10
  415. package/lib/types/dsh-adapter/packaged-skills.d.ts.map +0 -1
  416. package/lib/types/dsh-adapter/packaged-skills.js +0 -63
  417. package/skills/audit/SKILL.md +0 -24
  418. package/skills/bug/SKILL.md +0 -27
  419. package/skills/pr-comments/SKILL.md +0 -20
  420. package/skills/practice/SKILL.md +0 -22
  421. package/skills/release-notes/SKILL.md +0 -25
  422. package/skills/review/SKILL.md +0 -25
  423. package/skills/vuln-check/SKILL.md +0 -25
@@ -1,32 +1,32 @@
1
- export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
2
- export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
3
- export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
4
- export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
5
- export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
6
-
7
- export function createTuiChannelEndpointDescriptor(origin) {
8
- const normalized = new URL(origin)
9
- if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
10
- throw new TypeError('TUI Channel endpoint origin must use http or https')
11
- }
12
- normalized.pathname = '/'
13
- normalized.search = ''
14
- normalized.hash = ''
15
- return Object.freeze({
16
- apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
17
- kind: TUI_CHANNEL_HTTP_KIND,
18
- origin: normalized.toString().replace(/\/$/u, ''),
19
- connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
20
- })
21
- }
22
-
23
- export function validateTuiChannelEndpointDescriptor(value) {
24
- if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
25
- if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
26
- throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
27
- }
28
- if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
29
- createTuiChannelEndpointDescriptor(value.origin)
30
- if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
31
- return value
32
- }
1
+ export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
2
+ export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
3
+ export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
4
+ export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
5
+ export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
6
+
7
+ export function createTuiChannelEndpointDescriptor(origin) {
8
+ const normalized = new URL(origin)
9
+ if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
10
+ throw new TypeError('TUI Channel endpoint origin must use http or https')
11
+ }
12
+ normalized.pathname = '/'
13
+ normalized.search = ''
14
+ normalized.hash = ''
15
+ return Object.freeze({
16
+ apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
17
+ kind: TUI_CHANNEL_HTTP_KIND,
18
+ origin: normalized.toString().replace(/\/$/u, ''),
19
+ connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
20
+ })
21
+ }
22
+
23
+ export function validateTuiChannelEndpointDescriptor(value) {
24
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
25
+ if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
26
+ throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
27
+ }
28
+ if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
29
+ createTuiChannelEndpointDescriptor(value.origin)
30
+ if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
31
+ return value
32
+ }
@@ -1,59 +1,59 @@
1
- import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
2
-
3
- export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
4
-
5
- export const TUI_CHANNEL: Readonly<ApiReference & {
6
- apiVersion: 'tui.dsh/v1alpha1'
7
- kind: 'Channel'
8
- }>
9
- export const TUI_CHANNEL_WIRE_REVISION: 6
10
- export const TUI_CHANNEL_FEATURES: readonly string[]
11
-
12
- export interface TuiChannelRequirementSpec {
13
- readonly wireRevision: number
14
- readonly features: readonly string[]
15
- }
16
- export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
17
-
18
- export interface TuiChannelSnapshot {
19
- readonly wireRevision: number
20
- readonly channelId: string
21
- readonly version: number
22
- readonly state: Readonly<Record<string, JsonValue>>
23
- }
24
-
25
- export interface TuiChannelWorkspaceFlowChoice {
26
- readonly id: string
27
- readonly label: string
28
- readonly description?: string
29
- readonly badge?: string
30
- readonly action: string
31
- readonly input?: {
32
- readonly action: string
33
- readonly initialValue?: string
34
- readonly placeholder?: string
35
- }
36
- }
37
-
38
- export type TuiChannelWorkspaceFlowResult =
39
- | { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
40
- | { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
41
-
42
- export type TuiChannelInput =
43
- | { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
44
- | { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
45
- | { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
46
- | { readonly operation: 'close'; readonly value: { readonly channelId: string } }
47
-
48
- export interface TuiChannelInvokeOutput {
49
- readonly value: JsonValue
50
- readonly valueDefined?: boolean
51
- readonly snapshot?: TuiChannelSnapshot
52
- }
53
-
54
- export const tuiChannelDefinition: ProtocolDefinition
55
- export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
56
- export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
57
- export function validateTuiChannelInput(operation: string, value: unknown): object
58
- export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
59
- export function validateTuiChannelOutput(operation: string, value: unknown): object
1
+ import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
2
+
3
+ export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
4
+
5
+ export const TUI_CHANNEL: Readonly<ApiReference & {
6
+ apiVersion: 'tui.dsh/v1alpha1'
7
+ kind: 'Channel'
8
+ }>
9
+ export const TUI_CHANNEL_WIRE_REVISION: 6
10
+ export const TUI_CHANNEL_FEATURES: readonly string[]
11
+
12
+ export interface TuiChannelRequirementSpec {
13
+ readonly wireRevision: number
14
+ readonly features: readonly string[]
15
+ }
16
+ export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
17
+
18
+ export interface TuiChannelSnapshot {
19
+ readonly wireRevision: number
20
+ readonly channelId: string
21
+ readonly version: number
22
+ readonly state: Readonly<Record<string, JsonValue>>
23
+ }
24
+
25
+ export interface TuiChannelWorkspaceFlowChoice {
26
+ readonly id: string
27
+ readonly label: string
28
+ readonly description?: string
29
+ readonly badge?: string
30
+ readonly action: string
31
+ readonly input?: {
32
+ readonly action: string
33
+ readonly initialValue?: string
34
+ readonly placeholder?: string
35
+ }
36
+ }
37
+
38
+ export type TuiChannelWorkspaceFlowResult =
39
+ | { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
40
+ | { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
41
+
42
+ export type TuiChannelInput =
43
+ | { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
44
+ | { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
45
+ | { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
46
+ | { readonly operation: 'close'; readonly value: { readonly channelId: string } }
47
+
48
+ export interface TuiChannelInvokeOutput {
49
+ readonly value: JsonValue
50
+ readonly valueDefined?: boolean
51
+ readonly snapshot?: TuiChannelSnapshot
52
+ }
53
+
54
+ export const tuiChannelDefinition: ProtocolDefinition
55
+ export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
56
+ export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
57
+ export function validateTuiChannelInput(operation: string, value: unknown): object
58
+ export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
59
+ export function validateTuiChannelOutput(operation: string, value: unknown): object
@@ -1,166 +1,166 @@
1
- import { defineCapabilityProtocol } from '@dsh-std/connection'
2
-
3
- export const TUI_CHANNEL = Object.freeze({
4
- apiVersion: 'tui.dsh/v1alpha1',
5
- kind: 'Channel',
6
- })
7
-
8
- export const TUI_CHANNEL_WIRE_REVISION = 6
9
-
10
- export const TUI_CHANNEL_FEATURES = Object.freeze([
11
- 'commands',
12
- 'credentials',
13
- 'diagnostics',
14
- 'files',
15
- 'models',
16
- 'modes',
17
- 'presets',
18
- 'presentation',
19
- 'provider-setup',
20
- 'scenes',
21
- 'session-history',
22
- 'session-input',
23
- 'session-lifecycle',
24
- 'session-state',
25
- 'settings',
26
- 'skills',
27
- 'subagents',
28
- 'trace',
29
- 'workspaces',
30
- ])
31
-
32
- export const tuiChannelDefinition = defineCapabilityProtocol({
33
- ...TUI_CHANNEL,
34
- validateRequirement: validateTuiChannelRequirement,
35
- validateSupport: validateTuiChannelSupport,
36
- })
37
-
38
- export function validateTuiChannelRequirement(value) {
39
- const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel requirement')
40
- const wireRevision = positiveInteger(spec.wireRevision, 'Channel requirement.wireRevision')
41
- const features = featureList(spec.features, 'Channel requirement.features')
42
- return Object.freeze({ wireRevision, features })
43
- }
44
-
45
- export function validateTuiChannelSupport(value) {
46
- const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel support')
47
- const wireRevision = positiveInteger(spec.wireRevision, 'Channel support.wireRevision')
48
- const features = featureList(spec.features, 'Channel support.features')
49
- return Object.freeze({ wireRevision, features })
50
- }
51
-
52
- export function validateTuiChannelInput(operation, value) {
53
- switch (operation) {
54
- case 'open': {
55
- const input = exactRecord(value, ['workspace', 'sessionId', 'options'], 'Channel.open input')
56
- optionalString(input.workspace, 'Channel.open input.workspace')
57
- optionalString(input.sessionId, 'Channel.open input.sessionId')
58
- if (input.options !== undefined) jsonValue(input.options, 'Channel.open input.options', new Set())
59
- return input
60
- }
61
- case 'subscribe': {
62
- const input = exactRecord(value, ['channelId', 'afterVersion'], 'Channel.subscribe input')
63
- nonEmpty(input.channelId, 'Channel.subscribe input.channelId')
64
- nonNegativeInteger(input.afterVersion, 'Channel.subscribe input.afterVersion')
65
- return input
66
- }
67
- case 'invoke': {
68
- const input = exactRecord(value, ['channelId', 'method', 'arguments'], 'Channel.invoke input')
69
- nonEmpty(input.channelId, 'Channel.invoke input.channelId')
70
- nonEmpty(input.method, 'Channel.invoke input.method')
71
- if (!Array.isArray(input.arguments)) throw new TypeError('Channel.invoke input.arguments must be an array')
72
- jsonValue(input.arguments, 'Channel.invoke input.arguments', new Set())
73
- return input
74
- }
75
- case 'close': {
76
- const input = exactRecord(value, ['channelId'], 'Channel.close input')
77
- nonEmpty(input.channelId, 'Channel.close input.channelId')
78
- return input
79
- }
80
- default:
81
- throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
82
- }
83
- }
84
-
85
- export function validateTuiChannelSnapshot(value) {
86
- const snapshot = exactRecord(value, ['wireRevision', 'channelId', 'version', 'state'], 'Channel snapshot')
87
- positiveInteger(snapshot.wireRevision, 'Channel snapshot.wireRevision')
88
- nonEmpty(snapshot.channelId, 'Channel snapshot.channelId')
89
- nonNegativeInteger(snapshot.version, 'Channel snapshot.version')
90
- const state = exactRecord(snapshot.state, Object.keys(snapshot.state ?? {}), 'Channel snapshot.state')
91
- jsonValue(state, 'Channel snapshot.state', new Set())
92
- return snapshot
93
- }
94
-
95
- export function validateTuiChannelOutput(operation, value) {
96
- if (operation === 'open' || operation === 'subscribe') return validateTuiChannelSnapshot(value)
97
- if (operation === 'invoke') {
98
- const output = exactRecord(value, ['value', 'valueDefined', 'snapshot'], 'Channel.invoke output')
99
- jsonValue(output.value, 'Channel.invoke output.value', new Set())
100
- if (output.valueDefined !== undefined && typeof output.valueDefined !== 'boolean') {
101
- throw new TypeError('Channel.invoke output.valueDefined must be boolean')
102
- }
103
- if (output.snapshot !== undefined) validateTuiChannelSnapshot(output.snapshot)
104
- return output
105
- }
106
- if (operation === 'close') {
107
- const output = exactRecord(value, ['closed'], 'Channel.close output')
108
- if (output.closed !== true) throw new TypeError('Channel.close output.closed must be true')
109
- return output
110
- }
111
- throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
112
- }
113
-
114
- function exactRecord(value, allowed, label) {
115
- if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError(`${label} must be an object`)
116
- const unknown = Object.keys(value).filter(key => !allowed.includes(key) && !key.startsWith('x-'))
117
- if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)
118
- return value
119
- }
120
-
121
- function featureList(value, label) {
122
- if (!Array.isArray(value) || value.length === 0) throw new TypeError(`${label} must be a non-empty array`)
123
- const features = value.map((feature, index) => {
124
- nonEmpty(feature, `${label}[${index}]`)
125
- return feature
126
- })
127
- if (new Set(features).size !== features.length) throw new TypeError(`${label} contains duplicates`)
128
- return Object.freeze([...features].sort())
129
- }
130
-
131
- function positiveInteger(value, label) {
132
- if (!Number.isSafeInteger(value) || value < 1) throw new TypeError(`${label} must be a positive integer`)
133
- return value
134
- }
135
-
136
- function nonNegativeInteger(value, label) {
137
- if (!Number.isSafeInteger(value) || value < 0) throw new TypeError(`${label} must be a non-negative integer`)
138
- return value
139
- }
140
-
141
- function nonEmpty(value, label) {
142
- if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)
143
- }
144
-
145
- function optionalString(value, label) {
146
- if (value !== undefined) nonEmpty(value, label)
147
- }
148
-
149
- function jsonValue(value, label, ancestors) {
150
- if (value === null || typeof value === 'boolean' || typeof value === 'string') return
151
- if (typeof value === 'number') {
152
- if (!Number.isFinite(value)) throw new TypeError(`${label} must contain only finite numbers`)
153
- return
154
- }
155
- if (typeof value !== 'object') throw new TypeError(`${label} must be a JSON value`)
156
- if (ancestors.has(value)) throw new TypeError(`${label} must not contain cycles`)
157
- ancestors.add(value)
158
- if (Array.isArray(value)) {
159
- for (const [index, item] of value.entries()) jsonValue(item, `${label}[${index}]`, ancestors)
160
- } else {
161
- const prototype = Object.getPrototypeOf(value)
162
- if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must contain only plain objects`)
163
- for (const [key, item] of Object.entries(value)) jsonValue(item, `${label}.${key}`, ancestors)
164
- }
165
- ancestors.delete(value)
166
- }
1
+ import { defineCapabilityProtocol } from '@dsh-std/connection'
2
+
3
+ export const TUI_CHANNEL = Object.freeze({
4
+ apiVersion: 'tui.dsh/v1alpha1',
5
+ kind: 'Channel',
6
+ })
7
+
8
+ export const TUI_CHANNEL_WIRE_REVISION = 6
9
+
10
+ export const TUI_CHANNEL_FEATURES = Object.freeze([
11
+ 'commands',
12
+ 'credentials',
13
+ 'diagnostics',
14
+ 'files',
15
+ 'models',
16
+ 'modes',
17
+ 'presets',
18
+ 'presentation',
19
+ 'provider-setup',
20
+ 'scenes',
21
+ 'session-history',
22
+ 'session-input',
23
+ 'session-lifecycle',
24
+ 'session-state',
25
+ 'settings',
26
+ 'skills',
27
+ 'subagents',
28
+ 'trace',
29
+ 'workspaces',
30
+ ])
31
+
32
+ export const tuiChannelDefinition = defineCapabilityProtocol({
33
+ ...TUI_CHANNEL,
34
+ validateRequirement: validateTuiChannelRequirement,
35
+ validateSupport: validateTuiChannelSupport,
36
+ })
37
+
38
+ export function validateTuiChannelRequirement(value) {
39
+ const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel requirement')
40
+ const wireRevision = positiveInteger(spec.wireRevision, 'Channel requirement.wireRevision')
41
+ const features = featureList(spec.features, 'Channel requirement.features')
42
+ return Object.freeze({ wireRevision, features })
43
+ }
44
+
45
+ export function validateTuiChannelSupport(value) {
46
+ const spec = exactRecord(value, ['wireRevision', 'features'], 'Channel support')
47
+ const wireRevision = positiveInteger(spec.wireRevision, 'Channel support.wireRevision')
48
+ const features = featureList(spec.features, 'Channel support.features')
49
+ return Object.freeze({ wireRevision, features })
50
+ }
51
+
52
+ export function validateTuiChannelInput(operation, value) {
53
+ switch (operation) {
54
+ case 'open': {
55
+ const input = exactRecord(value, ['workspace', 'sessionId', 'options'], 'Channel.open input')
56
+ optionalString(input.workspace, 'Channel.open input.workspace')
57
+ optionalString(input.sessionId, 'Channel.open input.sessionId')
58
+ if (input.options !== undefined) jsonValue(input.options, 'Channel.open input.options', new Set())
59
+ return input
60
+ }
61
+ case 'subscribe': {
62
+ const input = exactRecord(value, ['channelId', 'afterVersion'], 'Channel.subscribe input')
63
+ nonEmpty(input.channelId, 'Channel.subscribe input.channelId')
64
+ nonNegativeInteger(input.afterVersion, 'Channel.subscribe input.afterVersion')
65
+ return input
66
+ }
67
+ case 'invoke': {
68
+ const input = exactRecord(value, ['channelId', 'method', 'arguments'], 'Channel.invoke input')
69
+ nonEmpty(input.channelId, 'Channel.invoke input.channelId')
70
+ nonEmpty(input.method, 'Channel.invoke input.method')
71
+ if (!Array.isArray(input.arguments)) throw new TypeError('Channel.invoke input.arguments must be an array')
72
+ jsonValue(input.arguments, 'Channel.invoke input.arguments', new Set())
73
+ return input
74
+ }
75
+ case 'close': {
76
+ const input = exactRecord(value, ['channelId'], 'Channel.close input')
77
+ nonEmpty(input.channelId, 'Channel.close input.channelId')
78
+ return input
79
+ }
80
+ default:
81
+ throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
82
+ }
83
+ }
84
+
85
+ export function validateTuiChannelSnapshot(value) {
86
+ const snapshot = exactRecord(value, ['wireRevision', 'channelId', 'version', 'state'], 'Channel snapshot')
87
+ positiveInteger(snapshot.wireRevision, 'Channel snapshot.wireRevision')
88
+ nonEmpty(snapshot.channelId, 'Channel snapshot.channelId')
89
+ nonNegativeInteger(snapshot.version, 'Channel snapshot.version')
90
+ const state = exactRecord(snapshot.state, Object.keys(snapshot.state ?? {}), 'Channel snapshot.state')
91
+ jsonValue(state, 'Channel snapshot.state', new Set())
92
+ return snapshot
93
+ }
94
+
95
+ export function validateTuiChannelOutput(operation, value) {
96
+ if (operation === 'open' || operation === 'subscribe') return validateTuiChannelSnapshot(value)
97
+ if (operation === 'invoke') {
98
+ const output = exactRecord(value, ['value', 'valueDefined', 'snapshot'], 'Channel.invoke output')
99
+ jsonValue(output.value, 'Channel.invoke output.value', new Set())
100
+ if (output.valueDefined !== undefined && typeof output.valueDefined !== 'boolean') {
101
+ throw new TypeError('Channel.invoke output.valueDefined must be boolean')
102
+ }
103
+ if (output.snapshot !== undefined) validateTuiChannelSnapshot(output.snapshot)
104
+ return output
105
+ }
106
+ if (operation === 'close') {
107
+ const output = exactRecord(value, ['closed'], 'Channel.close output')
108
+ if (output.closed !== true) throw new TypeError('Channel.close output.closed must be true')
109
+ return output
110
+ }
111
+ throw new TypeError(`Channel operation ${JSON.stringify(operation)} is not defined`)
112
+ }
113
+
114
+ function exactRecord(value, allowed, label) {
115
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError(`${label} must be an object`)
116
+ const unknown = Object.keys(value).filter(key => !allowed.includes(key) && !key.startsWith('x-'))
117
+ if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)
118
+ return value
119
+ }
120
+
121
+ function featureList(value, label) {
122
+ if (!Array.isArray(value) || value.length === 0) throw new TypeError(`${label} must be a non-empty array`)
123
+ const features = value.map((feature, index) => {
124
+ nonEmpty(feature, `${label}[${index}]`)
125
+ return feature
126
+ })
127
+ if (new Set(features).size !== features.length) throw new TypeError(`${label} contains duplicates`)
128
+ return Object.freeze([...features].sort())
129
+ }
130
+
131
+ function positiveInteger(value, label) {
132
+ if (!Number.isSafeInteger(value) || value < 1) throw new TypeError(`${label} must be a positive integer`)
133
+ return value
134
+ }
135
+
136
+ function nonNegativeInteger(value, label) {
137
+ if (!Number.isSafeInteger(value) || value < 0) throw new TypeError(`${label} must be a non-negative integer`)
138
+ return value
139
+ }
140
+
141
+ function nonEmpty(value, label) {
142
+ if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)
143
+ }
144
+
145
+ function optionalString(value, label) {
146
+ if (value !== undefined) nonEmpty(value, label)
147
+ }
148
+
149
+ function jsonValue(value, label, ancestors) {
150
+ if (value === null || typeof value === 'boolean' || typeof value === 'string') return
151
+ if (typeof value === 'number') {
152
+ if (!Number.isFinite(value)) throw new TypeError(`${label} must contain only finite numbers`)
153
+ return
154
+ }
155
+ if (typeof value !== 'object') throw new TypeError(`${label} must be a JSON value`)
156
+ if (ancestors.has(value)) throw new TypeError(`${label} must not contain cycles`)
157
+ ancestors.add(value)
158
+ if (Array.isArray(value)) {
159
+ for (const [index, item] of value.entries()) jsonValue(item, `${label}[${index}]`, ancestors)
160
+ } else {
161
+ const prototype = Object.getPrototypeOf(value)
162
+ if (prototype !== Object.prototype && prototype !== null) throw new TypeError(`${label} must contain only plain objects`)
163
+ for (const [key, item] of Object.entries(value)) jsonValue(item, `${label}.${key}`, ancestors)
164
+ }
165
+ ancestors.delete(value)
166
+ }
@@ -1,42 +1,42 @@
1
- import type { ApiReference } from '@dsh-std/core'
2
- import type { ManifestDefinitionCatalog, ManifestObjectDefinition } from '@dsh-std/manifest'
3
-
4
- export const API_VERSION: 'tui.dsh/v1alpha1'
5
- export const SETTINGS_SECTION: Readonly<ApiReference & { kind: 'SettingsSection' }>
6
- export const SCENE: Readonly<ApiReference & { kind: 'Scene' }>
7
-
8
- export type LocalizedText = Readonly<Record<string, string>>
9
- export type SettingsFieldKind = 'text' | 'number' | 'boolean' | 'select'
10
- export interface SettingsFieldOption { readonly value: string; readonly label: string; readonly titles?: LocalizedText }
11
- export interface SettingsFieldSpec {
12
- readonly path: readonly string[]
13
- readonly label: string
14
- readonly titles?: LocalizedText
15
- readonly hint?: string
16
- readonly hintTitles?: LocalizedText
17
- readonly kind: SettingsFieldKind
18
- readonly options?: readonly SettingsFieldOption[]
19
- readonly placeholder?: string
20
- readonly secretRef?: string
21
- }
22
- export interface SettingsSectionSpec {
23
- readonly namespace: string
24
- readonly title: string
25
- readonly titles?: LocalizedText
26
- readonly fields: readonly SettingsFieldSpec[]
27
- }
28
- export interface SettingsSectionHandler {}
29
-
30
- export interface SceneSpec { readonly title?: string; readonly titles?: LocalizedText }
31
- export interface SceneHandler<Props = unknown, Result = unknown> {
32
- readonly component: (props: Props) => Result
33
- }
34
-
35
- export const settingsSectionExtensionDefinition: ManifestObjectDefinition
36
- export const sceneExtensionDefinition: ManifestObjectDefinition
37
- export const contributionExtensionDefinitions: readonly ManifestObjectDefinition[]
38
- export function validateSettingsSectionSpec(value: unknown): Readonly<SettingsSectionSpec>
39
- export function validateSceneSpec(value: unknown): Readonly<SceneSpec>
40
- export function registerTuiContributionExtensions(catalog: ManifestDefinitionCatalog): () => void
41
- export function assertSettingsSectionHandler(value: unknown): asserts value is SettingsSectionHandler
42
- export function assertSceneHandler(value: unknown): asserts value is SceneHandler
1
+ import type { ApiReference } from '@dsh-std/core'
2
+ import type { ManifestDefinitionCatalog, ManifestObjectDefinition } from '@dsh-std/manifest'
3
+
4
+ export const API_VERSION: 'tui.dsh/v1alpha1'
5
+ export const SETTINGS_SECTION: Readonly<ApiReference & { kind: 'SettingsSection' }>
6
+ export const SCENE: Readonly<ApiReference & { kind: 'Scene' }>
7
+
8
+ export type LocalizedText = Readonly<Record<string, string>>
9
+ export type SettingsFieldKind = 'text' | 'number' | 'boolean' | 'select'
10
+ export interface SettingsFieldOption { readonly value: string; readonly label: string; readonly titles?: LocalizedText }
11
+ export interface SettingsFieldSpec {
12
+ readonly path: readonly string[]
13
+ readonly label: string
14
+ readonly titles?: LocalizedText
15
+ readonly hint?: string
16
+ readonly hintTitles?: LocalizedText
17
+ readonly kind: SettingsFieldKind
18
+ readonly options?: readonly SettingsFieldOption[]
19
+ readonly placeholder?: string
20
+ readonly secretRef?: string
21
+ }
22
+ export interface SettingsSectionSpec {
23
+ readonly namespace: string
24
+ readonly title: string
25
+ readonly titles?: LocalizedText
26
+ readonly fields: readonly SettingsFieldSpec[]
27
+ }
28
+ export interface SettingsSectionHandler {}
29
+
30
+ export interface SceneSpec { readonly title?: string; readonly titles?: LocalizedText }
31
+ export interface SceneHandler<Props = unknown, Result = unknown> {
32
+ readonly component: (props: Props) => Result
33
+ }
34
+
35
+ export const settingsSectionExtensionDefinition: ManifestObjectDefinition
36
+ export const sceneExtensionDefinition: ManifestObjectDefinition
37
+ export const contributionExtensionDefinitions: readonly ManifestObjectDefinition[]
38
+ export function validateSettingsSectionSpec(value: unknown): Readonly<SettingsSectionSpec>
39
+ export function validateSceneSpec(value: unknown): Readonly<SceneSpec>
40
+ export function registerTuiContributionExtensions(catalog: ManifestDefinitionCatalog): () => void
41
+ export function assertSettingsSectionHandler(value: unknown): asserts value is SettingsSectionHandler
42
+ export function assertSceneHandler(value: unknown): asserts value is SceneHandler