@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
@@ -1,10 +1,9 @@
1
1
  import type { LoadedContext } from '../dsh-adapter/channel.js';
2
- /** Per-entry display cap: the panel shows the beginning of long texts. */
2
+ /** Per-entry display cap: `/context` shows the beginning of long texts. */
3
3
  export declare const CONTEXT_ENTRY_MAX_CHARS = 800;
4
4
  /**
5
5
  * Truncate one entry's text for the panel body. The model-visible text is
6
- * the source of truth and stays complete in the session log; the panel only
7
- * bounds its own rendering.
6
+ * the source of truth; the local report only bounds its own rendering.
8
7
  * @param text - the interpolated model-visible text.
9
8
  * @param max - character cap, defaults to {@link CONTEXT_ENTRY_MAX_CHARS}.
10
9
  * @returns the text, or its head plus a truncation marker.
@@ -17,4 +16,10 @@ export declare function truncateContextText(text: string, max?: number): string;
17
16
  * @returns the summary, or `''` when every group is empty.
18
17
  */
19
18
  export declare function summarizeLoadedContext(context: LoadedContext): string;
19
+ /**
20
+ * Format the loaded-context snapshot for the local `/context` report.
21
+ * The report preserves the former startup panel's grouping and truncation
22
+ * without keeping a second expandable surface in the transcript header.
23
+ */
24
+ export declare function formatLoadedContextReport(context: LoadedContext): string[];
20
25
  //# sourceMappingURL=loaded-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loaded-context.d.ts","sourceRoot":"","sources":["../../../src/utils/loaded-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAG9D,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAA0B,GAAG,MAAM,CAGvF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAQrE"}
1
+ {"version":3,"file":"loaded-context.d.ts","sourceRoot":"","sources":["../../../src/utils/loaded-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAG9D,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAA0B,GAAG,MAAM,CAGvF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAQrE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE,CA6B1E"}
@@ -1,10 +1,9 @@
1
1
  import { t } from '../i18n.js';
2
- /** Per-entry display cap: the panel shows the beginning of long texts. */
2
+ /** Per-entry display cap: `/context` shows the beginning of long texts. */
3
3
  export const CONTEXT_ENTRY_MAX_CHARS = 800;
4
4
  /**
5
5
  * Truncate one entry's text for the panel body. The model-visible text is
6
- * the source of truth and stays complete in the session log; the panel only
7
- * bounds its own rendering.
6
+ * the source of truth; the local report only bounds its own rendering.
8
7
  * @param text - the interpolated model-visible text.
9
8
  * @param max - character cap, defaults to {@link CONTEXT_ENTRY_MAX_CHARS}.
10
9
  * @returns the text, or its head plus a truncation marker.
@@ -34,3 +33,40 @@ export function summarizeLoadedContext(context) {
34
33
  parts.push(t('context-tools', { n: context.tools.length }));
35
34
  return parts.join(' · ');
36
35
  }
36
+ /**
37
+ * Format the loaded-context snapshot for the local `/context` report.
38
+ * The report preserves the former startup panel's grouping and truncation
39
+ * without keeping a second expandable surface in the transcript header.
40
+ */
41
+ export function formatLoadedContextReport(context) {
42
+ const lines = [];
43
+ const appendEntry = (name, text, max = CONTEXT_ENTRY_MAX_CHARS) => {
44
+ lines.push(` ${name}`);
45
+ lines.push(...truncateContextText(text, max).split('\n').map(line => ` ${line}`));
46
+ };
47
+ if (context.sections.length > 0) {
48
+ lines.push(t('context-panel-sections', { n: context.sections.length }));
49
+ for (const section of context.sections)
50
+ appendEntry(section.name, section.text);
51
+ }
52
+ if (context.files.length > 0) {
53
+ lines.push(t('context-panel-files', { n: context.files.length }));
54
+ lines.push(...context.files.map(file => ` ${file.displayPath}`));
55
+ }
56
+ if (context.contexts.length > 0) {
57
+ lines.push(t('context-panel-runtime', { n: context.contexts.length }));
58
+ for (const entry of context.contexts)
59
+ appendEntry(entry.name, entry.text);
60
+ }
61
+ if (context.skills.length > 0) {
62
+ lines.push(t('context-panel-skills', { n: context.skills.length }));
63
+ for (const skill of context.skills)
64
+ appendEntry(skill.name, skill.description);
65
+ }
66
+ if (context.tools.length > 0) {
67
+ lines.push(t('context-panel-tools', { n: context.tools.length }));
68
+ for (const tool of context.tools)
69
+ appendEntry(tool.name, tool.description, 160);
70
+ }
71
+ return lines;
72
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/utils/modifiers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,KAAK,SAAgC,CAAA;AAElD,yEAAyE;AACzE,wBAAgB,KAAK,CAAC,GAAG,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEvE;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAwB,CAAA;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GAAG,OAAO,CAEV;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAChE,OAAO,CAOT"}
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/utils/modifiers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,KAAK,SAAgC,CAAA;AAElD,yEAAyE;AACzE,wBAAgB,KAAK,CAAC,GAAG,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEvE;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAwB,CAAA;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GAAG,OAAO,CAEV;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAChE,OAAO,CAQT"}
@@ -33,12 +33,13 @@ export function isPlainReturn(key) {
33
33
  * pickers must do the same or their UI can render while Enter appears inert.
34
34
  */
35
35
  export function isPlainReturnInput(input, key) {
36
- if (isPlainReturn(key))
37
- return true;
38
36
  // Bracketed paste can deliver a chunk that is all line breaks — that is
39
37
  // pasted content, not an Enter press, and must never confirm a modal.
38
+ // Checked FIRST: a paste chunk may even carry the return flag.
40
39
  if (key.isPasted === true)
41
40
  return false;
41
+ if (isPlainReturn(key))
42
+ return true;
42
43
  return /^[\r\n]+$/u.test(input)
43
44
  && !key.ctrl && !key.meta && !key.shift && !key.super;
44
45
  }
@@ -13,7 +13,19 @@
13
13
  * subpath keeps resolution anchored at @deepseek-harness-tui/dsh-tui itself — always a direct
14
14
  * profile dependency — and from its real location `dsh-working-activity`
15
15
  * resolves under every package-manager layout.
16
+ *
17
+ * `publish` is forced off at this mount point: the TUI derives its working
18
+ * line in-process (issue #143) and never wants activity/status snapshots in
19
+ * the session log — they make the shared JSONL unreadable for Web (issue
20
+ * #153). A stale global-launcher patch (≤0.6.x, resolved anchor-first by
21
+ * the dsh CLI) still carries `publish: true` on this row, which re-enabled
22
+ * the pollution even on an up-to-date profile install. A local `apply`
23
+ * shadows the star re-export, so the row config can never turn publishing
24
+ * back on; a log-replaying consumer mounts the bare package instead.
16
25
  * @module @deepseek-harness-tui/dsh-tui/working-activity
17
26
  */
27
+ import { apply as mountedApply } from 'dsh-working-activity';
18
28
  export * from 'dsh-working-activity';
29
+ type MountedContext = Parameters<typeof mountedApply>[0];
30
+ export declare const apply: (ctx: MountedContext, config: Parameters<typeof mountedApply>[1]) => void;
19
31
  //# sourceMappingURL=working-activity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"working-activity.d.ts","sourceRoot":"","sources":["../../src/working-activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"working-activity.d.ts","sourceRoot":"","sources":["../../src/working-activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,cAAc,sBAAsB,CAAA;AAIpC,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;AAExD,eAAO,MAAM,KAAK,GAAI,KAAK,cAAc,EAAE,QAAQ,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,KAAG,IAEvF,CAAA"}
@@ -13,6 +13,19 @@
13
13
  * subpath keeps resolution anchored at @deepseek-harness-tui/dsh-tui itself — always a direct
14
14
  * profile dependency — and from its real location `dsh-working-activity`
15
15
  * resolves under every package-manager layout.
16
+ *
17
+ * `publish` is forced off at this mount point: the TUI derives its working
18
+ * line in-process (issue #143) and never wants activity/status snapshots in
19
+ * the session log — they make the shared JSONL unreadable for Web (issue
20
+ * #153). A stale global-launcher patch (≤0.6.x, resolved anchor-first by
21
+ * the dsh CLI) still carries `publish: true` on this row, which re-enabled
22
+ * the pollution even on an up-to-date profile install. A local `apply`
23
+ * shadows the star re-export, so the row config can never turn publishing
24
+ * back on; a log-replaying consumer mounts the bare package instead.
16
25
  * @module @deepseek-harness-tui/dsh-tui/working-activity
17
26
  */
27
+ import { apply as mountedApply } from 'dsh-working-activity';
18
28
  export * from 'dsh-working-activity';
29
+ export const apply = (ctx, config) => {
30
+ mountedApply(ctx, { ...config, publish: false });
31
+ };
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DSH Standard contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,26 @@
1
+ # @dsh-std/command
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ Named human-command resources and their shared callable Runtime dispatcher.
6
+
7
+ ## Contract
8
+
9
+ A `Command` resource describes one root command and its nested subcommands. Nodes provide a title, localized titles, description, aliases, positional arguments, options, and child nodes. Arguments may be required, variadic, or restricted to documented values. Options declare every literal spelling and may accept one value.
10
+
11
+ `CommandRuntime` defines the generic `catalog` and `execute` operations once for every command extension. A runtime adapter joins extensions published by active facets with its authoritative command registry and implements that capability. The execution context id remains opaque to the standard; a DSH adapter maps it to a session. Results contain only the command outcome. Invocation-scoped UI work uses typed clients from `@dsh-std/presentation`.
12
+
13
+ `commandRuntime()` wraps a consumer-scoped `CapabilityClient` with typed methods, and `commandRuntimeImplementation()` builds the operation dispatcher for an adapter. Consumers and adapters do not repeat operation strings or payload validation.
14
+
15
+ Presentation clients can build completion trees and forms without importing the owning component. A component such as dsh-codex declares `Command/codex`; its selected facet publishes the handler in its local runtime and never defines a connection-specific method.
16
+
17
+ Names and aliases are single tokens. Sibling names and aliases, argument names, option spellings, and enumerated values must be unique. A variadic argument must be last.
18
+
19
+ ## Extension points
20
+
21
+ Fields prefixed with `x-` may carry experimental metadata. Portable clients ignore extensions they do not understand. Incompatible command semantics require a new contract major version rather than redefining an existing field.
22
+
23
+ ## Known Limitations and Deferred Work
24
+
25
+ - The contract does not define a command-line parser or quoting rules.
26
+ - Dynamic completion is not part of `v1alpha1`; declared values are static.
@@ -0,0 +1,28 @@
1
+ # @dsh-std/command
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 拟议设计见 [Command Resources and Runtime](../../docs/proposals/command.zh.md)。
6
+
7
+ 具名用户命令资源及其共享的可调用 Runtime 分派器。
8
+
9
+ ## 协议
10
+
11
+ 一项 `Command` 资源描述一个根命令及其嵌套子命令。节点可以提供标题、本地化标题、说明、别名、位置参数、选项和子节点。参数可以是必需、可变长或受已声明值限制;选项声明全部字面拼写,并可接收一个值。
12
+
13
+ `CommandRuntime` 为全部命令 extension 统一定义 `catalog` 与 `execute` 操作。运行时适配器把 active facets 发布的 extension 与自身权威命令注册表关联,并实现该能力。执行上下文 id 对标准保持不透明;DSH 适配器将其映射为会话。结果只包含命令结果;调用作用域内的 UI 操作使用 `@dsh-std/presentation` 的类型化 client。
14
+
15
+ `commandRuntime()` 用类型化方法包装按消费方隔离的 `CapabilityClient`,`commandRuntimeImplementation()` 为适配器创建操作分派器。消费方与适配器都无需重复操作字符串或载荷校验。
16
+
17
+ 表现客户端无需导入所属 component,即可构建补全树和表单。dsh-codex 之类的 component 声明 `Command/codex`,由选中的 facet 在本地运行时发布 handler;它不定义 connection 专用方法。
18
+
19
+ 名称与别名必须是单个 token。同级名称与别名、参数名、选项拼写和枚举值必须唯一。可变长参数必须位于末尾。
20
+
21
+ ## 扩展点
22
+
23
+ 以 `x-` 开头的字段可以承载实验性元数据。可移植客户端忽略无法理解的扩展。不兼容的命令语义需要新的协议主版本,不能重新定义现有字段。
24
+
25
+ ## 已知限制与暂缓事项
26
+
27
+ - 协议不定义命令行解析器或引号规则。
28
+ - `v1alpha1` 不包含动态补全;已声明值是静态的。
@@ -0,0 +1,144 @@
1
+ import { CapabilityCall, CapabilityClient, CapabilityHandlerContext, CapabilityImplementation } from "@dsh-std/connection";
2
+ import { PresentationClients, PresentationDescriptor } from "@dsh-std/presentation";
3
+ import { ProtocolCatalog, ProtocolDefinition, ProtocolSupport } from "@dsh-std/core";
4
+ import { ManifestDefinitionCatalog, ManifestExtension } from "@dsh-std/manifest";
5
+ //#region src/index.d.ts
6
+ declare const API_VERSION = "commands.dsh/v1alpha1";
7
+ declare const KIND = "Command";
8
+ declare const RUNTIME_KIND = "CommandRuntime";
9
+ /** Stable reference to one declared command path. */
10
+ interface CommandReference {
11
+ readonly name: string;
12
+ readonly path?: readonly string[];
13
+ }
14
+ interface CommandValueSpec {
15
+ readonly value: string;
16
+ readonly title?: string;
17
+ readonly titles?: Readonly<Record<string, string>>;
18
+ }
19
+ interface CommandArgumentSpec {
20
+ readonly name: string;
21
+ readonly title?: string;
22
+ readonly titles?: Readonly<Record<string, string>>;
23
+ readonly required?: boolean;
24
+ readonly variadic?: boolean;
25
+ readonly values?: readonly CommandValueSpec[];
26
+ }
27
+ interface CommandOptionSpec {
28
+ /** Literal spellings such as `--verbose` and `-v`. */
29
+ readonly names: readonly string[];
30
+ readonly title: string;
31
+ readonly titles?: Readonly<Record<string, string>>;
32
+ readonly value?: CommandArgumentSpec;
33
+ }
34
+ interface CommandNodeSpec {
35
+ readonly title: string;
36
+ readonly titles?: Readonly<Record<string, string>>;
37
+ readonly description?: string;
38
+ readonly aliases?: readonly string[];
39
+ readonly arguments?: readonly CommandArgumentSpec[];
40
+ readonly options?: readonly CommandOptionSpec[];
41
+ readonly children?: readonly CommandNode[];
42
+ }
43
+ interface CommandNode {
44
+ readonly name: string;
45
+ readonly spec: CommandNodeSpec;
46
+ }
47
+ type CommandSpec = CommandNodeSpec;
48
+ type CommandResource = ManifestExtension<CommandSpec>;
49
+ interface CommandOwnerReference {
50
+ readonly component: string;
51
+ readonly facet: string;
52
+ readonly participantId?: string;
53
+ }
54
+ interface CommandDescriptor {
55
+ readonly name: string;
56
+ readonly description: string;
57
+ readonly input?: {
58
+ readonly hint: string;
59
+ };
60
+ readonly owner: CommandOwnerReference;
61
+ readonly resource: CommandResource;
62
+ readonly available: boolean;
63
+ readonly missingPresentation: readonly ProtocolSupport[];
64
+ readonly issues: readonly {
65
+ readonly code: string;
66
+ readonly message: string;
67
+ }[];
68
+ }
69
+ interface CommandCatalog {
70
+ readonly apiVersion: typeof API_VERSION;
71
+ readonly commands: readonly CommandDescriptor[];
72
+ }
73
+ interface CommandCatalogInput {
74
+ /** Opaque execution context selected by the consuming product. */
75
+ readonly contextId: string;
76
+ readonly presentation?: PresentationDescriptor;
77
+ }
78
+ interface CommandExecutionInput extends CommandCatalogInput {
79
+ readonly line: string;
80
+ }
81
+ interface CommandExecution {
82
+ readonly apiVersion: typeof API_VERSION;
83
+ readonly commandId: string;
84
+ readonly result: {
85
+ readonly kind: 'success' | 'error';
86
+ readonly text?: string;
87
+ readonly sourceEventSeq?: number;
88
+ };
89
+ }
90
+ type CommandRuntimeCall = {
91
+ readonly operation: 'catalog';
92
+ readonly input: CommandCatalogInput;
93
+ readonly output: CommandCatalog;
94
+ } | {
95
+ readonly operation: 'execute';
96
+ readonly input: CommandExecutionInput;
97
+ readonly output: CommandExecution | undefined;
98
+ };
99
+ interface CommandRuntimeClient {
100
+ catalog(input: CommandCatalogInput, options?: {
101
+ readonly signal?: AbortSignal;
102
+ }): CapabilityCall<CommandCatalog>;
103
+ execute(input: CommandExecutionInput, options?: {
104
+ readonly signal?: AbortSignal;
105
+ }): CapabilityCall<CommandExecution | undefined>;
106
+ }
107
+ interface CommandRuntimeHandler {
108
+ catalog(input: CommandCatalogInput, context: CapabilityHandlerContext): CommandCatalog | Promise<CommandCatalog>;
109
+ execute(input: CommandExecutionInput, context: CapabilityHandlerContext): CommandExecution | undefined | Promise<CommandExecution | undefined>;
110
+ }
111
+ interface CommandHandlerInput {
112
+ readonly rawInput: string;
113
+ }
114
+ interface CommandHandlerContext {
115
+ readonly signal: AbortSignal;
116
+ /** Host-bound clients for Presentation agreements active in this invocation. */
117
+ readonly presentation?: PresentationClients;
118
+ }
119
+ interface CommandHandler {
120
+ execute(input: CommandHandlerInput, context: CommandHandlerContext): CommandExecution['result'] | Promise<CommandExecution['result']>;
121
+ }
122
+ declare function assertCommandHandler(value: unknown): asserts value is CommandHandler;
123
+ declare const extensionDefinition: Readonly<{
124
+ apiVersion: "commands.dsh/v1alpha1";
125
+ kind: "Command";
126
+ validateMetadata(metadata: {
127
+ readonly name: string;
128
+ }): void;
129
+ validateSpec(value: unknown): void;
130
+ }>;
131
+ /** Host support for accepting and owning Command resource publications. */
132
+ declare const resourceProtocol: ProtocolDefinition;
133
+ declare const resourceSupport: ProtocolSupport;
134
+ /** Callable, resource-keyed command dispatcher implemented once by a Runtime adapter. */
135
+ declare const runtimeProtocol: ProtocolDefinition<unknown, unknown, unknown, unknown>;
136
+ declare const runtimeSupport: ProtocolSupport;
137
+ /** Bind the typed CommandRuntime operations to a consumer-scoped connection client. */
138
+ declare function commandRuntime(client: CapabilityClient): CommandRuntimeClient;
139
+ /** Create the sole Runtime-side dispatcher implementation for every Command resource. */
140
+ declare function commandRuntimeImplementation(participantId: string, handler: CommandRuntimeHandler): CapabilityImplementation;
141
+ declare function register(protocols: ProtocolCatalog, manifest?: ManifestDefinitionCatalog): () => void;
142
+ //#endregion
143
+ export { API_VERSION, CommandArgumentSpec, CommandCatalog, CommandCatalogInput, CommandDescriptor, CommandExecution, CommandExecutionInput, CommandHandler, CommandHandlerContext, CommandHandlerInput, CommandNode, CommandNodeSpec, CommandOptionSpec, CommandOwnerReference, CommandReference, CommandResource, CommandRuntimeCall, CommandRuntimeClient, CommandRuntimeHandler, CommandSpec, CommandValueSpec, KIND, RUNTIME_KIND, assertCommandHandler, commandRuntime, commandRuntimeImplementation, extensionDefinition, register, resourceProtocol, resourceSupport, runtimeProtocol, runtimeSupport };
144
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;cAoBa;cACA;cACA;;UAGI;WACN;WACA;;UAGM;WACN;WACA;WACA,SAAS,SAAS;;UAGZ;WACN;WACA;WACA,SAAS,SAAS;WAClB;WACA;WACA,kBAAkB;;UAGZ;;WAEN;WACA;WACA,SAAS,SAAS;WAClB,QAAQ;;UAGF;WACN;WACA,SAAS,SAAS;WAClB;WACA;WACA,qBAAqB;WACrB,mBAAmB;WACnB,oBAAoB;;UAGd;WACN;WACA,MAAM;;KAGL,cAAc;KAEd,kBAAkB,kBAAkB;UAE/B;WACN;WACA;WACA;;UAGM;WACN;WACA;WACA;aAAmB;;WACnB,OAAO;WACP,UAAU;WACV;WACA,8BAA8B;WAC9B;aAA4B;aAAuB;;;UAG7C;WACN,mBAAmB;WACnB,mBAAmB;;UAGb;;WAEN;WACA,eAAe;;UAGT,8BAA8B;WACpC;;UAGM;WACN,mBAAmB;WACnB;WACA;aACE;aACA;aACA;;;KAID;WACG;WAA+B,OAAO;WAA8B,QAAQ;;WAC5E;WAA+B,OAAO;WAAgC,QAAQ;;UAE5E;EACf,QAAQ,OAAO,qBAAqB;aAAqB,SAAS;MAAgB,eAAe;EACjG,QAAQ,OAAO,uBAAuB;aAAqB,SAAS;MAAgB,eAAe;;UAGpF;EACf,QAAQ,OAAO,qBAAqB,SAAS,2BAA2B,iBAAiB,QAAQ;EACjG,QACE,OAAO,uBACP,SAAS,2BACR,+BAA+B,QAAQ;;UAG3B;WACN;;UAGM;WACN,QAAQ;;WAER,eAAe;;UAGT;EACf,QACE,OAAO,qBACP,SAAS,wBACR,6BAA6B,QAAQ;;iBAG1B,qBAAqB,yBAAyB,SAAS;cAM1D,qBAAmB;;;EAGH,iBAAA;aAAW;;EAGlB,aAAA;;;cAMT,kBAAkB;cAuBlB,iBAAiB;;cAMjB,iBAAe;cAKf,gBAAgB;;iBAMb,eAAe,QAAQ,mBAAmB;;iBAY1C,6BACd,uBACA,SAAS,wBACR;iBAYa,SAAS,WAAW,iBAAiB,WAAW"}
@@ -0,0 +1,252 @@
1
+ import { defineCapabilityProtocol } from "@dsh-std/connection";
2
+ import { validatePresentationDescriptor } from "@dsh-std/presentation";
3
+ //#region src/index.ts
4
+ const API_VERSION = "commands.dsh/v1alpha1";
5
+ const KIND = "Command";
6
+ const RUNTIME_KIND = "CommandRuntime";
7
+ function assertCommandHandler(value) {
8
+ if (!record(value) || typeof value.execute !== "function") throw new TypeError("Command handler must provide execute(input, context)");
9
+ }
10
+ const extensionDefinition = Object.freeze({
11
+ apiVersion: API_VERSION,
12
+ kind: KIND,
13
+ validateMetadata(metadata) {
14
+ if (!/^[a-z][a-z0-9_-]*$/u.test(metadata.name)) throw new TypeError("Command metadata.name is invalid");
15
+ },
16
+ validateSpec(value) {
17
+ validateNodeSpec(value, "Command spec");
18
+ }
19
+ });
20
+ /** Host support for accepting and owning Command resource publications. */
21
+ const resourceProtocol = Object.freeze({
22
+ apiVersion: API_VERSION,
23
+ kind: KIND,
24
+ validateRequirement: emptyProtocolSpec,
25
+ validateSupport: emptyProtocolSpec,
26
+ negotiate(input) {
27
+ const issues = [];
28
+ for (const row of input.requirements) {
29
+ if (input.supports.some((candidate) => candidate.participant !== row.participant)) continue;
30
+ issues.push(Object.freeze({
31
+ code: row.requirement.optional === true ? "optional-support-missing" : "required-support-missing",
32
+ severity: row.requirement.optional === true ? "warning" : "error",
33
+ participant: row.participant,
34
+ message: `no participant accepts ${row.requirement.apiVersion} ${row.requirement.kind} resources`
35
+ }));
36
+ }
37
+ return {
38
+ agreement: Object.freeze({ kind: "ResourcePublication" }),
39
+ issues: Object.freeze(issues)
40
+ };
41
+ }
42
+ });
43
+ const resourceSupport = Object.freeze({
44
+ apiVersion: API_VERSION,
45
+ kind: KIND
46
+ });
47
+ /** Callable, resource-keyed command dispatcher implemented once by a Runtime adapter. */
48
+ const runtimeProtocol = defineCapabilityProtocol({
49
+ apiVersion: API_VERSION,
50
+ kind: RUNTIME_KIND
51
+ });
52
+ const runtimeSupport = Object.freeze({
53
+ apiVersion: API_VERSION,
54
+ kind: RUNTIME_KIND
55
+ });
56
+ /** Bind the typed CommandRuntime operations to a consumer-scoped connection client. */
57
+ function commandRuntime(client) {
58
+ return Object.freeze({
59
+ catalog(input, options) {
60
+ return client.invoke(runtimeSupport, "catalog", validateCatalogInput(input), options);
61
+ },
62
+ execute(input, options) {
63
+ return client.invoke(runtimeSupport, "execute", validateExecutionInput(input), options);
64
+ }
65
+ });
66
+ }
67
+ /** Create the sole Runtime-side dispatcher implementation for every Command resource. */
68
+ function commandRuntimeImplementation(participantId, handler) {
69
+ return Object.freeze({
70
+ participantId,
71
+ protocol: runtimeSupport,
72
+ handle(operation, input, context) {
73
+ if (operation === "catalog") return handler.catalog(validateCatalogInput(input), context);
74
+ if (operation === "execute") return handler.execute(validateExecutionInput(input), context);
75
+ throw new TypeError(`unsupported CommandRuntime operation ${JSON.stringify(operation)}`);
76
+ }
77
+ });
78
+ }
79
+ function register(protocols, manifest) {
80
+ const disposeResource = manifest?.registerExtension(extensionDefinition) ?? (() => void 0);
81
+ const disposeResourceProtocol = protocols.register(resourceProtocol);
82
+ const disposeRuntime = protocols.register(runtimeProtocol);
83
+ return () => {
84
+ disposeRuntime();
85
+ disposeResourceProtocol();
86
+ disposeResource();
87
+ };
88
+ }
89
+ function emptyProtocolSpec(value) {
90
+ if (value !== void 0) throw new TypeError("Command resource protocol does not accept spec");
91
+ }
92
+ function record(value) {
93
+ return typeof value === "object" && value !== null && !Array.isArray(value);
94
+ }
95
+ function validateCatalogInput(value) {
96
+ if (!record(value)) throw new TypeError("CommandRuntime.catalog input must be an object");
97
+ exact(value, ["contextId", "presentation"], "CommandRuntime.catalog input");
98
+ text(value.contextId, "CommandRuntime.catalog input.contextId");
99
+ if (value.presentation !== void 0) validatePresentationDescriptor(value.presentation);
100
+ return Object.freeze({
101
+ contextId: value.contextId,
102
+ ...value.presentation === void 0 ? {} : { presentation: value.presentation }
103
+ });
104
+ }
105
+ function validateExecutionInput(value) {
106
+ if (!record(value)) throw new TypeError("CommandRuntime.execute input must be an object");
107
+ exact(value, [
108
+ "contextId",
109
+ "line",
110
+ "presentation"
111
+ ], "CommandRuntime.execute input");
112
+ const catalog = validateCatalogInput({
113
+ contextId: value.contextId,
114
+ ...value.presentation === void 0 ? {} : { presentation: value.presentation }
115
+ });
116
+ text(value.line, "CommandRuntime.execute input.line");
117
+ return Object.freeze({
118
+ ...catalog,
119
+ line: value.line
120
+ });
121
+ }
122
+ function validateNodeSpec(value, label) {
123
+ if (!record(value)) throw new TypeError(`${label} must be an object`);
124
+ exact(value, [
125
+ "title",
126
+ "titles",
127
+ "description",
128
+ "aliases",
129
+ "arguments",
130
+ "options",
131
+ "children"
132
+ ], label);
133
+ text(value.title, `${label}.title`);
134
+ if (value.description !== void 0) text(value.description, `${label}.description`);
135
+ if (value.titles !== void 0) localized(value.titles, `${label}.titles`);
136
+ if (value.aliases !== void 0) tokens(value.aliases, `${label}.aliases`);
137
+ if (value.arguments !== void 0) argumentsList(value.arguments, `${label}.arguments`);
138
+ if (value.options !== void 0) optionsList(value.options, `${label}.options`);
139
+ if (value.children !== void 0) children(value.children, `${label}.children`);
140
+ }
141
+ function argumentsList(value, label) {
142
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`);
143
+ const names = /* @__PURE__ */ new Set();
144
+ for (const [index, argument] of value.entries()) {
145
+ const item = `${label}[${index}]`;
146
+ if (!record(argument)) throw new TypeError(`${item} must be an object`);
147
+ exact(argument, [
148
+ "name",
149
+ "title",
150
+ "titles",
151
+ "required",
152
+ "variadic",
153
+ "values"
154
+ ], item);
155
+ token(argument.name, `${item}.name`);
156
+ if (names.has(argument.name)) throw new TypeError(`${label} contains a duplicate argument`);
157
+ names.add(argument.name);
158
+ if (argument.title !== void 0) text(argument.title, `${item}.title`);
159
+ if (argument.titles !== void 0) localized(argument.titles, `${item}.titles`);
160
+ if (argument.required !== void 0 && typeof argument.required !== "boolean") throw new TypeError(`${item}.required must be boolean`);
161
+ if (argument.variadic !== void 0 && typeof argument.variadic !== "boolean") throw new TypeError(`${item}.variadic must be boolean`);
162
+ if (argument.variadic === true && index !== value.length - 1) throw new TypeError(`${item} must be the last argument when variadic`);
163
+ if (argument.values !== void 0) values(argument.values, `${item}.values`);
164
+ }
165
+ }
166
+ function optionsList(value, label) {
167
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`);
168
+ const names = /* @__PURE__ */ new Set();
169
+ for (const [index, option] of value.entries()) {
170
+ const item = `${label}[${index}]`;
171
+ if (!record(option)) throw new TypeError(`${item} must be an object`);
172
+ exact(option, [
173
+ "names",
174
+ "title",
175
+ "titles",
176
+ "value"
177
+ ], item);
178
+ text(option.title, `${item}.title`);
179
+ if (option.titles !== void 0) localized(option.titles, `${item}.titles`);
180
+ if (!Array.isArray(option.names) || option.names.length === 0) throw new TypeError(`${item}.names must be a non-empty array`);
181
+ for (const name of option.names) {
182
+ if (typeof name !== "string" || !/^-{1,2}[^\s-][^\s]*$/u.test(name)) throw new TypeError(`${item}.names contains an invalid option`);
183
+ if (names.has(name)) throw new TypeError(`${label} contains a duplicate option name`);
184
+ names.add(name);
185
+ }
186
+ if (option.value !== void 0) argumentsList([option.value], `${item}.value`);
187
+ }
188
+ }
189
+ function children(value, label) {
190
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`);
191
+ const names = /* @__PURE__ */ new Set();
192
+ for (const [index, child] of value.entries()) {
193
+ const item = `${label}[${index}]`;
194
+ if (!record(child)) throw new TypeError(`${item} must be an object`);
195
+ exact(child, ["name", "spec"], item);
196
+ token(child.name, `${item}.name`);
197
+ for (const name of [child.name, ...Array.isArray(child.spec?.aliases) ? child.spec.aliases : []]) {
198
+ if (typeof name !== "string") continue;
199
+ if (names.has(name)) throw new TypeError(`${label} contains a duplicate name or alias`);
200
+ names.add(name);
201
+ }
202
+ validateNodeSpec(child.spec, `${item}.spec`);
203
+ }
204
+ }
205
+ function values(value, label) {
206
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`);
207
+ const seen = /* @__PURE__ */ new Set();
208
+ for (const [index, choice] of value.entries()) {
209
+ const item = `${label}[${index}]`;
210
+ if (!record(choice)) throw new TypeError(`${item} must be an object`);
211
+ exact(choice, [
212
+ "value",
213
+ "title",
214
+ "titles"
215
+ ], item);
216
+ text(choice.value, `${item}.value`);
217
+ if (seen.has(choice.value)) throw new TypeError(`${label} contains a duplicate value`);
218
+ seen.add(choice.value);
219
+ if (choice.title !== void 0) text(choice.title, `${item}.title`);
220
+ if (choice.titles !== void 0) localized(choice.titles, `${item}.titles`);
221
+ }
222
+ }
223
+ function localized(value, label) {
224
+ if (!record(value)) throw new TypeError(`${label} must be an object`);
225
+ for (const [locale, translation] of Object.entries(value)) {
226
+ if (locale.trim() === "") throw new TypeError(`${label} contains an empty locale`);
227
+ text(translation, `${label}.${locale}`);
228
+ }
229
+ }
230
+ function tokens(value, label) {
231
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`);
232
+ const seen = /* @__PURE__ */ new Set();
233
+ for (const valueItem of value) {
234
+ token(valueItem, label);
235
+ if (seen.has(valueItem)) throw new TypeError(`${label} contains a duplicate token`);
236
+ seen.add(valueItem);
237
+ }
238
+ }
239
+ function token(value, label) {
240
+ if (typeof value !== "string" || !/^[^\s/]+$/u.test(value)) throw new TypeError(`${label} must be one token`);
241
+ }
242
+ function text(value, label) {
243
+ if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${label} must be a non-empty string`);
244
+ }
245
+ function exact(value, allowed, label) {
246
+ const unknown = Object.keys(value).filter((key) => !allowed.includes(key) && !key.startsWith("x-"));
247
+ if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`);
248
+ }
249
+ //#endregion
250
+ export { API_VERSION, KIND, RUNTIME_KIND, assertCommandHandler, commandRuntime, commandRuntimeImplementation, extensionDefinition, register, resourceProtocol, resourceSupport, runtimeProtocol, runtimeSupport };
251
+
252
+ //# sourceMappingURL=index.js.map