@deepseek-harness-tui/dsh-tui 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. package/README.md +32 -15
  2. package/cordis.patch.yml +21 -2
  3. package/cordis.yml +12 -1
  4. package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
  5. package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
  6. package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
  7. package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
  8. package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
  9. package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
  10. package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
  11. package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
  12. package/dsh-ecosystem-spec/registry/README.md +14 -0
  13. package/dsh-ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
  14. package/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
  15. package/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
  16. package/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
  17. package/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
  18. package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
  19. package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -0
  20. package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
  21. package/dsh-ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
  22. package/dsh-ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
  23. package/dsh-ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
  24. package/lib/types/cc/figures.d.ts +4 -0
  25. package/lib/types/cc/figures.d.ts.map +1 -1
  26. package/lib/types/cc/figures.js +4 -0
  27. package/lib/types/command-trees.d.ts +2 -1
  28. package/lib/types/command-trees.d.ts.map +1 -1
  29. package/lib/types/command-trees.js +1 -1
  30. package/lib/types/commands.d.ts.map +1 -1
  31. package/lib/types/commands.js +2 -0
  32. package/lib/types/components/ExtensionDialog.d.ts +40 -0
  33. package/lib/types/components/ExtensionDialog.d.ts.map +1 -0
  34. package/lib/types/components/ExtensionDialog.js +210 -0
  35. package/lib/types/components/HelpMenu.js +1 -1
  36. package/lib/types/components/LoadedContextPanel.d.ts +5 -5
  37. package/lib/types/components/LoadedContextPanel.js +6 -6
  38. package/lib/types/components/LogoV2.d.ts.map +1 -1
  39. package/lib/types/components/LogoV2.js +16 -8
  40. package/lib/types/components/Markdown.d.ts +13 -1
  41. package/lib/types/components/Markdown.d.ts.map +1 -1
  42. package/lib/types/components/Markdown.js +15 -1
  43. package/lib/types/components/MessageList.d.ts +3 -1
  44. package/lib/types/components/MessageList.d.ts.map +1 -1
  45. package/lib/types/components/MessageList.js +111 -6
  46. package/lib/types/components/PromptInput.d.ts.map +1 -1
  47. package/lib/types/components/PromptInput.js +26 -12
  48. package/lib/types/components/RewindPicker.d.ts +13 -1
  49. package/lib/types/components/RewindPicker.d.ts.map +1 -1
  50. package/lib/types/components/RewindPicker.js +26 -2
  51. package/lib/types/components/StreamingMarkdown.d.ts +2 -8
  52. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
  53. package/lib/types/components/StreamingMarkdown.js +51 -9
  54. package/lib/types/components/ToolUseLoader.d.ts +8 -3
  55. package/lib/types/components/ToolUseLoader.d.ts.map +1 -1
  56. package/lib/types/components/ToolUseLoader.js +43 -9
  57. package/lib/types/components/activityFrames.d.ts +1 -1
  58. package/lib/types/components/activityFrames.d.ts.map +1 -1
  59. package/lib/types/components/activityFrames.js +4 -1
  60. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +5 -1
  61. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  62. package/lib/types/components/messages/AssistantThinkingMessage.js +26 -3
  63. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  64. package/lib/types/components/messages/AssistantToolUseMessage.js +13 -2
  65. package/lib/types/dsh-adapter/channel.d.ts +61 -11
  66. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  67. package/lib/types/dsh-adapter/channel.js +767 -120
  68. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
  69. package/lib/types/dsh-adapter/childStderr.js +10 -0
  70. package/lib/types/dsh-adapter/command-attribution.d.ts +51 -0
  71. package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -0
  72. package/lib/types/dsh-adapter/command-attribution.js +93 -0
  73. package/lib/types/dsh-adapter/command-errors.d.ts +42 -0
  74. package/lib/types/dsh-adapter/command-errors.d.ts.map +1 -0
  75. package/lib/types/dsh-adapter/command-errors.js +63 -0
  76. package/lib/types/dsh-adapter/command-trees.d.ts +7 -1
  77. package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -1
  78. package/lib/types/dsh-adapter/command-trees.js +70 -20
  79. package/lib/types/dsh-adapter/component-identity.d.ts +33 -0
  80. package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -0
  81. package/lib/types/dsh-adapter/component-identity.js +108 -0
  82. package/lib/types/dsh-adapter/contract.d.ts +1 -1
  83. package/lib/types/dsh-adapter/contract.js +2 -2
  84. package/lib/types/dsh-adapter/decision-guard.d.ts +84 -0
  85. package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -0
  86. package/lib/types/dsh-adapter/decision-guard.js +348 -0
  87. package/lib/types/dsh-adapter/dialogs.d.ts +145 -0
  88. package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -0
  89. package/lib/types/dsh-adapter/dialogs.js +316 -0
  90. package/lib/types/dsh-adapter/effect-ledger.d.ts +91 -0
  91. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -0
  92. package/lib/types/dsh-adapter/effect-ledger.js +251 -0
  93. package/lib/types/dsh-adapter/extension-events.d.ts +193 -0
  94. package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -0
  95. package/lib/types/dsh-adapter/extension-events.js +207 -0
  96. package/lib/types/dsh-adapter/extensions.d.ts +32 -0
  97. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -0
  98. package/lib/types/dsh-adapter/extensions.js +42 -0
  99. package/lib/types/dsh-adapter/grants.d.ts +25 -0
  100. package/lib/types/dsh-adapter/grants.d.ts.map +1 -0
  101. package/lib/types/dsh-adapter/grants.js +213 -0
  102. package/lib/types/dsh-adapter/host-access.d.ts +37 -0
  103. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -0
  104. package/lib/types/dsh-adapter/host-access.js +652 -0
  105. package/lib/types/dsh-adapter/host-descriptor.d.ts +24 -0
  106. package/lib/types/dsh-adapter/host-descriptor.d.ts.map +1 -0
  107. package/lib/types/dsh-adapter/host-descriptor.js +169 -0
  108. package/lib/types/dsh-adapter/index.d.ts +4 -0
  109. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/index.js +1 -0
  111. package/lib/types/dsh-adapter/message-observer.d.ts +173 -0
  112. package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -0
  113. package/lib/types/dsh-adapter/message-observer.js +553 -0
  114. package/lib/types/dsh-adapter/plugin-host.d.ts +136 -0
  115. package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -0
  116. package/lib/types/dsh-adapter/plugin-host.js +365 -0
  117. package/lib/types/dsh-adapter/plugin-storage.d.ts +108 -0
  118. package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -0
  119. package/lib/types/dsh-adapter/plugin-storage.js +397 -0
  120. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/plugin.js +124 -14
  122. package/lib/types/dsh-adapter/plugins-info.d.ts +43 -0
  123. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -0
  124. package/lib/types/dsh-adapter/plugins-info.js +276 -0
  125. package/lib/types/dsh-adapter/promptDebug.d.ts +0 -6
  126. package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -1
  127. package/lib/types/dsh-adapter/promptDebug.js +13 -4
  128. package/lib/types/dsh-adapter/renderers.d.ts +57 -0
  129. package/lib/types/dsh-adapter/renderers.d.ts.map +1 -0
  130. package/lib/types/dsh-adapter/renderers.js +173 -0
  131. package/lib/types/dsh-adapter/sanitize.d.ts +36 -0
  132. package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -0
  133. package/lib/types/dsh-adapter/sanitize.js +65 -0
  134. package/lib/types/dsh-adapter/scenes.d.ts +15 -5
  135. package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
  136. package/lib/types/dsh-adapter/scenes.js +149 -35
  137. package/lib/types/dsh-adapter/settings-sections.d.ts +7 -3
  138. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  139. package/lib/types/dsh-adapter/settings-sections.js +106 -26
  140. package/lib/types/dsh-adapter/shortcuts.d.ts +107 -0
  141. package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -0
  142. package/lib/types/dsh-adapter/shortcuts.js +340 -0
  143. package/lib/types/dsh-adapter/status.d.ts +74 -0
  144. package/lib/types/dsh-adapter/status.d.ts.map +1 -0
  145. package/lib/types/dsh-adapter/status.js +234 -0
  146. package/lib/types/dsh-adapter/workspaces.d.ts +16 -5
  147. package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
  148. package/lib/types/dsh-adapter/workspaces.js +287 -170
  149. package/lib/types/extensions.d.ts +13 -0
  150. package/lib/types/extensions.d.ts.map +1 -0
  151. package/lib/types/extensions.js +21 -0
  152. package/lib/types/force-production-react.d.ts +1 -0
  153. package/lib/types/force-production-react.d.ts.map +1 -0
  154. package/lib/types/force-production-react.js +12 -0
  155. package/lib/types/i18n.d.ts +174 -20
  156. package/lib/types/i18n.d.ts.map +1 -1
  157. package/lib/types/i18n.js +56 -6
  158. package/lib/types/index.d.ts +1 -0
  159. package/lib/types/index.d.ts.map +1 -1
  160. package/lib/types/index.js +1 -0
  161. package/lib/types/ink/components/App.d.ts +2 -0
  162. package/lib/types/ink/components/App.d.ts.map +1 -1
  163. package/lib/types/ink/components/App.js +4 -0
  164. package/lib/types/ink/ink.d.ts +31 -3
  165. package/lib/types/ink/ink.d.ts.map +1 -1
  166. package/lib/types/ink/ink.js +90 -5
  167. package/lib/types/ink/log-update.d.ts.map +1 -1
  168. package/lib/types/ink/log-update.js +225 -56
  169. package/lib/types/ink/output.d.ts +35 -2
  170. package/lib/types/ink/output.d.ts.map +1 -1
  171. package/lib/types/ink/output.js +281 -14
  172. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  173. package/lib/types/ink/render-node-to-output.js +14 -6
  174. package/lib/types/ink/screen.d.ts +39 -0
  175. package/lib/types/ink/screen.d.ts.map +1 -1
  176. package/lib/types/ink/screen.js +117 -0
  177. package/lib/types/ink/terminal.d.ts.map +1 -1
  178. package/lib/types/ink/terminal.js +26 -6
  179. package/lib/types/ink/wrapAnsi.d.ts +1 -1
  180. package/lib/types/ink/wrapAnsi.d.ts.map +1 -1
  181. package/lib/types/ink/wrapAnsi.js +29 -2
  182. package/lib/types/plugin-host.d.ts +15 -0
  183. package/lib/types/plugin-host.d.ts.map +1 -0
  184. package/lib/types/plugin-host.js +17 -0
  185. package/lib/types/plugin-spec/negotiate.d.ts +11 -0
  186. package/lib/types/plugin-spec/negotiate.d.ts.map +1 -0
  187. package/lib/types/plugin-spec/negotiate.js +97 -0
  188. package/lib/types/plugin-spec/permission-scope.d.ts +32 -0
  189. package/lib/types/plugin-spec/permission-scope.d.ts.map +1 -0
  190. package/lib/types/plugin-spec/permission-scope.js +90 -0
  191. package/lib/types/plugin-spec/registry.d.ts +23 -0
  192. package/lib/types/plugin-spec/registry.d.ts.map +1 -0
  193. package/lib/types/plugin-spec/registry.js +252 -0
  194. package/lib/types/plugin-spec/schema-check.d.ts +17 -0
  195. package/lib/types/plugin-spec/schema-check.d.ts.map +1 -0
  196. package/lib/types/plugin-spec/schema-check.js +165 -0
  197. package/lib/types/plugin-spec/tui-extension.d.ts +16 -0
  198. package/lib/types/plugin-spec/tui-extension.d.ts.map +1 -0
  199. package/lib/types/plugin-spec/tui-extension.js +79 -0
  200. package/lib/types/plugin-spec/types.d.ts +114 -0
  201. package/lib/types/plugin-spec/types.d.ts.map +1 -0
  202. package/lib/types/plugin-spec/types.js +10 -0
  203. package/lib/types/plugin-spec/validate.d.ts +21 -0
  204. package/lib/types/plugin-spec/validate.d.ts.map +1 -0
  205. package/lib/types/plugin-spec/validate.js +138 -0
  206. package/lib/types/scenes.d.ts +2 -1
  207. package/lib/types/scenes.d.ts.map +1 -1
  208. package/lib/types/scenes.js +1 -1
  209. package/lib/types/screens/Chat.d.ts +14 -1
  210. package/lib/types/screens/Chat.d.ts.map +1 -1
  211. package/lib/types/screens/Chat.js +173 -49
  212. package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
  213. package/lib/types/screens/SessionBrowser.js +10 -3
  214. package/lib/types/sessions/view.d.ts +3 -2
  215. package/lib/types/sessions/view.d.ts.map +1 -1
  216. package/lib/types/sessions/view.js +18 -0
  217. package/lib/types/settings-sections.d.ts +2 -1
  218. package/lib/types/settings-sections.d.ts.map +1 -1
  219. package/lib/types/settings-sections.js +1 -1
  220. package/lib/types/theme.d.ts +5 -0
  221. package/lib/types/theme.d.ts.map +1 -1
  222. package/lib/types/theme.js +15 -0
  223. package/lib/types/update.d.ts +20 -0
  224. package/lib/types/update.d.ts.map +1 -1
  225. package/lib/types/update.js +54 -7
  226. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
  227. package/lib/types/utils/execFileNoThrow.js +3 -0
  228. package/lib/types/utils/loaded-context.d.ts +8 -3
  229. package/lib/types/utils/loaded-context.d.ts.map +1 -1
  230. package/lib/types/utils/loaded-context.js +39 -3
  231. package/lib/types/utils/modifiers.d.ts.map +1 -1
  232. package/lib/types/utils/modifiers.js +3 -2
  233. package/lib/types/working-activity.d.ts +12 -0
  234. package/lib/types/working-activity.d.ts.map +1 -1
  235. package/lib/types/working-activity.js +13 -0
  236. package/lib/types/workspaces.d.ts +2 -1
  237. package/lib/types/workspaces.d.ts.map +1 -1
  238. package/lib/types/workspaces.js +1 -1
  239. package/node_modules/@dsh-std/command/CHANGELOG.md +8 -0
  240. package/node_modules/@dsh-std/command/LICENSE +21 -0
  241. package/node_modules/@dsh-std/command/README.md +26 -0
  242. package/node_modules/@dsh-std/command/README.zh.md +28 -0
  243. package/node_modules/@dsh-std/command/lib/index.d.ts +144 -0
  244. package/node_modules/@dsh-std/command/lib/index.d.ts.map +1 -0
  245. package/node_modules/@dsh-std/command/lib/index.js +252 -0
  246. package/node_modules/@dsh-std/command/lib/index.js.map +1 -0
  247. package/node_modules/@dsh-std/command/package.json +22 -0
  248. package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
  249. package/node_modules/@dsh-std/connection/LICENSE +21 -0
  250. package/node_modules/@dsh-std/connection/README.md +42 -0
  251. package/node_modules/@dsh-std/connection/README.zh.md +42 -0
  252. package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  253. package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  254. package/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  255. package/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  256. package/node_modules/@dsh-std/connection/lib/index.js +158 -0
  257. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  258. package/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  259. package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  260. package/node_modules/@dsh-std/connection/lib/memory.js +258 -0
  261. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  262. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  263. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  264. package/node_modules/@dsh-std/connection/package.json +20 -0
  265. package/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  266. package/node_modules/@dsh-std/core/LICENSE +21 -0
  267. package/node_modules/@dsh-std/core/README.md +13 -0
  268. package/node_modules/@dsh-std/core/README.zh.md +13 -0
  269. package/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  270. package/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  271. package/node_modules/@dsh-std/core/lib/index.js +424 -0
  272. package/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  273. package/node_modules/@dsh-std/core/package.json +21 -0
  274. package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
  275. package/node_modules/@dsh-std/manifest/LICENSE +21 -0
  276. package/node_modules/@dsh-std/manifest/README.md +5 -0
  277. package/node_modules/@dsh-std/manifest/README.zh.md +5 -0
  278. package/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
  279. package/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
  280. package/node_modules/@dsh-std/manifest/lib/index.js +625 -0
  281. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
  282. package/node_modules/@dsh-std/manifest/package.json +20 -0
  283. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
  284. package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -0
  285. package/node_modules/@dsh-std/messages/LICENSE +21 -0
  286. package/node_modules/@dsh-std/messages/README.md +5 -0
  287. package/node_modules/@dsh-std/messages/README.zh.md +7 -0
  288. package/node_modules/@dsh-std/messages/lib/index.d.ts +50 -0
  289. package/node_modules/@dsh-std/messages/lib/index.d.ts.map +1 -0
  290. package/node_modules/@dsh-std/messages/lib/index.js +151 -0
  291. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -0
  292. package/node_modules/@dsh-std/messages/package.json +20 -0
  293. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -0
  294. package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
  295. package/node_modules/@dsh-std/presentation/LICENSE +21 -0
  296. package/node_modules/@dsh-std/presentation/README.md +27 -0
  297. package/node_modules/@dsh-std/presentation/README.zh.md +29 -0
  298. package/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
  299. package/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
  300. package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
  301. package/node_modules/@dsh-std/presentation/lib/index.d.ts +262 -0
  302. package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
  303. package/node_modules/@dsh-std/presentation/lib/index.js +550 -0
  304. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
  305. package/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
  306. package/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
  307. package/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
  308. package/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
  309. package/node_modules/@dsh-std/presentation/package.json +25 -0
  310. package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -0
  311. package/node_modules/@dsh-std/storage/LICENSE +21 -0
  312. package/node_modules/@dsh-std/storage/README.md +5 -0
  313. package/node_modules/@dsh-std/storage/README.zh.md +7 -0
  314. package/node_modules/@dsh-std/storage/lib/index.d.ts +48 -0
  315. package/node_modules/@dsh-std/storage/lib/index.d.ts.map +1 -0
  316. package/node_modules/@dsh-std/storage/lib/index.js +104 -0
  317. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -0
  318. package/node_modules/@dsh-std/storage/package.json +20 -0
  319. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -0
  320. package/package.json +110 -70
  321. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
  322. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -0
  323. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -0
  324. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -0
  325. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  326. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  327. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  328. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  329. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js +158 -0
  330. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  331. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  332. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  333. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +258 -0
  334. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  335. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  336. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  337. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -0
  338. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  339. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -0
  340. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -0
  341. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -0
  342. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  343. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  344. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js +424 -0
  345. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  346. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -0
  347. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
  348. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -0
  349. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -0
  350. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -0
  351. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
  352. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
  353. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js +625 -0
  354. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
  355. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -0
  356. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
  357. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
  358. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -0
  359. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -0
  360. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -0
  361. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
  362. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
  363. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
  364. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +262 -0
  365. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
  366. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +550 -0
  367. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
  368. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
  369. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
  370. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
  371. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
  372. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -0
  373. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  374. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -0
  375. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -0
  376. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -0
  377. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  378. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  379. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js +424 -0
  380. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  381. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -0
  382. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  383. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -0
  384. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -0
  385. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -0
  386. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  387. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  388. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js +424 -0
  389. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  390. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -0
  391. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  392. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -0
  393. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -0
  394. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -0
  395. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  396. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  397. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js +424 -0
  398. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  399. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -0
  400. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
  401. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -0
  402. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -0
  403. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -0
  404. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
  405. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
  406. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
  407. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
  408. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js +158 -0
  409. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
  410. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
  411. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
  412. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +258 -0
  413. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
  414. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
  415. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
  416. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -0
  417. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  418. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -0
  419. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -0
  420. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -0
  421. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  422. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  423. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js +424 -0
  424. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  425. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -0
  426. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
  427. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -0
  428. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -0
  429. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -0
  430. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
  431. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
  432. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js +424 -0
  433. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -0
  434. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n ProtocolCatalog,\n protocolKey,\n validateApiReference,\n type ApiReference,\n type ProtocolRequirement,\n type ProtocolSupport,\n type VersionRange,\n assertVersionRange,\n parseSemanticVersion,\n} from '@dsh-std/core'\nexport const COMMUNITY_V015_MANIFEST_VERSION = '0.15'\nexport const COMPONENT_API_VERSION = 'manifest.dsh/internal/v1alpha1'\nexport const COMMUNITY_PERMISSION_API_VERSION = 'community.dsh/v1alpha1'\nexport const COMMUNITY_PERMISSION_KIND = 'Permission'\n\nconst COMPONENT_ID = /^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$/u\nconst LOCAL_NAME = /^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)*$/u\n\nexport interface CommunityContractReference extends ApiReference {\n readonly optional?: boolean\n readonly fallback?: string\n}\n\nexport interface CommunityPermissionRequest {\n readonly name: string\n readonly scope: string\n readonly reason?: string\n}\n\nexport interface CommunityCommandContribution {\n readonly id: string\n readonly title: string\n readonly description?: string\n}\n\nexport type CommunitySubscription = string | (ApiReference & { readonly scope?: string })\n\nexport interface CommunityPluginManifestV015 {\n /** Draft schema identifier. It is not fetched while loading the plugin. */\n readonly $schema: string\n readonly manifestVersion: typeof COMMUNITY_V015_MANIFEST_VERSION\n readonly id: string\n readonly name: string\n readonly version: string\n readonly facets: {\n readonly host: { readonly entry: string; readonly apiVersion: string }\n }\n readonly requires: {\n readonly contracts: readonly CommunityContractReference[]\n readonly services?: readonly never[]\n }\n readonly permissions: readonly CommunityPermissionRequest[]\n readonly contributes: {\n readonly commands: readonly CommunityCommandContribution[]\n readonly panels?: readonly never[]\n } & Readonly<Record<string, readonly unknown[]>>\n readonly subscriptions: readonly CommunitySubscription[]\n readonly license?: string\n readonly source?: { readonly repository: string; readonly revision?: string }\n readonly artifact?: { readonly digest: string; readonly algorithm: 'sha256'; readonly path: string }\n readonly compat?: { readonly hosts?: readonly string[] }\n readonly overrides?: readonly {\n readonly target: string\n readonly kind: 'patch' | 'native' | 'build'\n readonly description?: string\n }[]\n}\n\nexport type PluginManifest = CommunityPluginManifestV015\n\nexport interface ComponentRelationships {\n readonly depends?: Readonly<Record<string, VersionRange>>\n readonly recommends?: Readonly<Record<string, VersionRange>>\n readonly conflicts?: Readonly<Record<string, VersionRange>>\n readonly breaks?: Readonly<Record<string, VersionRange>>\n}\n\nexport interface ActivationObject<Spec = unknown> extends ApiReference {\n readonly spec: Spec\n}\n\nexport interface ExtensionMetadata {\n readonly name: string\n readonly labels?: Readonly<Record<string, string>>\n}\n\nexport interface ManifestExtension<Spec = unknown> extends ApiReference {\n readonly metadata: ExtensionMetadata\n readonly spec: Spec\n}\n\nexport interface PermissionRequest<Spec = unknown> extends ApiReference {\n readonly action: string\n readonly optional?: boolean\n readonly reason?: string\n readonly spec?: Spec\n}\n\nexport interface ComponentFacet {\n readonly name: string\n readonly activation?: ActivationObject\n readonly protocols?: {\n readonly requires?: readonly ProtocolRequirement[]\n readonly supports?: readonly ProtocolSupport[]\n }\n readonly extensions?: readonly ManifestExtension[]\n readonly permissions?: readonly PermissionRequest[]\n}\n\nexport interface ComponentManifest {\n /** Host-internal projection. Portable packages publish PluginManifest instead. */\n readonly apiVersion: typeof COMPONENT_API_VERSION\n readonly kind: 'Component'\n readonly metadata: {\n readonly name: string\n readonly version: string\n readonly displayName?: string\n }\n readonly spec: {\n readonly facets: readonly ComponentFacet[]\n readonly relationships?: ComponentRelationships\n }\n}\n\nexport interface FacetIdentity {\n readonly component: string\n readonly version: string\n readonly facet: string\n}\n\nexport interface ManifestObjectDefinition<Spec = unknown> extends ApiReference {\n validateSpec(spec: unknown): Spec\n /** Extension-owned identity validation. Activation definitions leave this undefined. */\n validateMetadata?(metadata: ExtensionMetadata): void\n}\n\nexport interface ManifestValidationIssue {\n readonly code: 'unknown-protocol' | 'unknown-activation' | 'unknown-extension' | 'invalid-activation' | 'invalid-extension'\n readonly severity: 'error' | 'warning'\n readonly path: string\n readonly message: string\n}\n\nexport interface ManifestValidationReport {\n readonly apiVersion: 'manifest.dsh/report/v1alpha1'\n readonly validator: { readonly name: string; readonly version: string }\n readonly source: string\n readonly digest: string\n readonly manifest: { readonly name: string; readonly version: string }\n readonly compatible: boolean\n readonly issues: readonly ManifestValidationIssue[]\n}\n\nexport class ManifestDefinitionCatalog {\n private readonly activations = new Map<string, ManifestObjectDefinition>()\n private readonly extensions = new Map<string, ManifestObjectDefinition>()\n\n constructor(readonly validator = Object.freeze({ name: '@dsh-std/manifest', version: '0.1.0' })) {\n nonEmpty(validator.name, 'validator.name')\n nonEmpty(validator.version, 'validator.version')\n }\n\n registerActivation(definition: ManifestObjectDefinition): () => void {\n return registerDefinition(this.activations, definition, 'activation')\n }\n\n registerExtension(definition: ManifestObjectDefinition): () => void {\n return registerDefinition(this.extensions, definition, 'extension')\n }\n\n activation(reference: ApiReference): ManifestObjectDefinition | undefined {\n return this.activations.get(protocolKey(reference))\n }\n\n extension(reference: ApiReference): ManifestObjectDefinition | undefined {\n return this.extensions.get(protocolKey(reference))\n }\n\n validate(\n manifestValue: ComponentManifest,\n protocols?: ProtocolCatalog,\n options: { readonly source?: string; readonly digest?: string } = {},\n ): ManifestValidationReport {\n const manifest = defineComponentManifest(manifestValue)\n const issues: ManifestValidationIssue[] = []\n for (const [facetIndex, facet] of manifest.spec.facets.entries()) {\n const base = `/spec/facets/${facetIndex}`\n if (facet.activation !== undefined) {\n const definition = this.activation(facet.activation)\n if (definition === undefined) {\n issues.push(issue('unknown-activation', 'warning', `${base}/activation`, 'activation definition is not installed'))\n } else {\n try { definition.validateSpec(facet.activation.spec) } catch (error) {\n issues.push(issue('invalid-activation', 'error', `${base}/activation/spec`, errorMessage(error)))\n }\n }\n }\n for (const direction of ['requires', 'supports'] as const) {\n for (const [index, row] of (facet.protocols?.[direction] ?? []).entries()) {\n if (protocols !== undefined && !protocols.understands(row)) {\n issues.push(issue('unknown-protocol', 'warning', `${base}/protocols/${direction}/${index}`, `protocol ${row.apiVersion} ${row.kind} is unknown`))\n }\n }\n }\n for (const [index, extension] of (facet.extensions ?? []).entries()) {\n const definition = this.extension(extension)\n if (definition === undefined) {\n issues.push(issue('unknown-extension', 'warning', `${base}/extensions/${index}`, 'extension definition is not installed'))\n } else {\n try {\n definition.validateMetadata?.(extension.metadata)\n definition.validateSpec(extension.spec)\n } catch (error) {\n issues.push(issue('invalid-extension', 'error', `${base}/extensions/${index}`, errorMessage(error)))\n }\n }\n }\n }\n return Object.freeze({\n apiVersion: 'manifest.dsh/report/v1alpha1',\n validator: Object.freeze({ ...this.validator }),\n source: options.source ?? 'memory:',\n digest: options.digest ?? manifestDigest(manifest),\n manifest: Object.freeze({ name: manifest.metadata.name, version: manifest.metadata.version }),\n compatible: !issues.some(row => row.severity === 'error'),\n issues: Object.freeze(issues),\n })\n }\n}\n\nexport interface ParseManifestOptions {\n readonly source?: string\n}\n\n/** Parse the package-root dsh-plugin.json without executing plugin code or fetching a schema. */\nexport function parseManifest(source: string, options: ParseManifestOptions = {}): PluginManifest {\n if (typeof source !== 'string') throw new TypeError('manifest source must be a string')\n let value: unknown\n try { value = JSON.parse(source) } catch (error) {\n throw new SyntaxError(`${options.source ?? 'dsh-plugin.json'}: ${errorMessage(error)}`, { cause: error })\n }\n try { return defineManifest(value as PluginManifest) } catch (error) {\n throw new TypeError(`${options.source ?? 'dsh-plugin.json'}: ${errorMessage(error)}`, { cause: error })\n }\n}\n\nexport function defineManifest<const T extends PluginManifest>(manifest: T): T {\n validateManifest(manifest)\n return deepFreeze(structuredClone(manifest))\n}\n\nexport function validateManifest(value: unknown): asserts value is PluginManifest {\n if (!record(value)) throw new TypeError('plugin manifest must be an object')\n if (value.manifestVersion === COMMUNITY_V015_MANIFEST_VERSION) {\n validateCommunityManifest(value)\n return\n }\n throw new TypeError(`unsupported plugin manifest $schema ${JSON.stringify(value.$schema)} and manifestVersion ${JSON.stringify(value.manifestVersion)}`)\n}\n\nfunction validateCommunityManifest(value: Record<string, unknown>): void {\n exact(value, [\n '$schema', 'manifestVersion', 'id', 'name', 'version', 'facets', 'requires', 'permissions',\n 'contributes', 'subscriptions', 'license', 'source', 'artifact', 'compat', 'overrides',\n ], 'community v0.15 plugin manifest')\n validateSchemaIdentifier(value.$schema, 'community v0.15 manifest.$schema')\n if (value.manifestVersion !== COMMUNITY_V015_MANIFEST_VERSION) {\n throw new TypeError(`unsupported Community v0.15 manifestVersion ${JSON.stringify(value.manifestVersion)}`)\n }\n namespaced(value.id, 'community v0.15 manifest.id')\n nonEmpty(value.name, 'community v0.15 manifest.name')\n nonEmpty(value.version, 'community v0.15 manifest.version')\n parseSemanticVersion(value.version as string)\n validateCommunityFacets(value.facets)\n validateCommunityRequirements(value.requires)\n validateCommunityPermissions(value.permissions)\n validateCommunityContributions(value.contributes)\n validateCommunitySubscriptions(value.subscriptions)\n if (value.license !== undefined) nonEmpty(value.license, 'community v0.15 manifest.license')\n if (value.source !== undefined) validateCommunitySource(value.source)\n if (value.artifact !== undefined) validateCommunityArtifact(value.artifact)\n if (value.compat !== undefined) validateCommunityCompat(value.compat)\n if (value.overrides !== undefined) validateCommunityOverrides(value.overrides)\n}\n\n/** Validate a host-internal Component/Facet projection. */\nexport function defineComponentManifest<const T extends ComponentManifest>(manifest: T): T {\n validateComponentManifest(manifest)\n return deepFreeze(structuredClone(manifest))\n}\n\nexport function validateComponentManifest(value: unknown): asserts value is ComponentManifest {\n if (!record(value)) throw new TypeError('component manifest must be an object')\n exact(value, ['apiVersion', 'kind', 'metadata', 'spec'], 'component manifest')\n if (value.apiVersion !== COMPONENT_API_VERSION) throw new TypeError(`unsupported component manifest apiVersion ${JSON.stringify(value.apiVersion)}`)\n if (value.kind !== 'Component') throw new TypeError('component manifest kind must be \"Component\"')\n if (!record(value.metadata)) throw new TypeError('component metadata must be an object')\n exact(value.metadata, ['name', 'version', 'displayName'], 'component metadata')\n namespaced(value.metadata.name, 'component metadata.name')\n nonEmpty(value.metadata.version, 'component metadata.version')\n parseSemanticVersion(value.metadata.version as string)\n if (value.metadata.displayName !== undefined) nonEmpty(value.metadata.displayName, 'component metadata.displayName')\n if (!record(value.spec)) throw new TypeError('component spec must be an object')\n exact(value.spec, ['facets', 'relationships'], 'component spec')\n if (!Array.isArray(value.spec.facets) || value.spec.facets.length === 0) throw new TypeError('component spec.facets must be a non-empty array')\n const names = new Set<string>()\n for (const [index, facet] of value.spec.facets.entries()) {\n validateFacet(facet, index)\n const name = (facet as ComponentFacet).name\n if (names.has(name)) throw new TypeError(`duplicate facet name ${JSON.stringify(name)}`)\n names.add(name)\n }\n if (value.spec.relationships !== undefined) validateRelationships(value.spec.relationships, value.metadata.name as string)\n}\n\n/** Project a supported package manifest version into the common host composition model. */\nexport function projectManifest(manifestValue: PluginManifest): ComponentManifest {\n const manifest = defineManifest(manifestValue)\n return projectCommunityManifest(manifest)\n}\n\nfunction projectCommunityManifest(manifest: CommunityPluginManifestV015): ComponentManifest {\n const extensions: ManifestExtension[] = manifest.contributes.commands.map(row => Object.freeze({\n apiVersion: 'commands.dsh/v1alpha1',\n kind: 'Command',\n metadata: Object.freeze({\n name: localContributionName(row.id),\n labels: Object.freeze({ 'dsh.std/contribution-id': row.id }),\n }),\n spec: Object.freeze({\n title: row.title,\n ...(row.description === undefined ? {} : { description: row.description }),\n }),\n }))\n for (const [point, contributions] of Object.entries(manifest.contributes)) {\n if (!point.startsWith('x-')) continue\n for (const contribution of contributions) {\n if (!record(contribution)\n || typeof contribution.apiVersion !== 'string'\n || typeof contribution.kind !== 'string'\n || typeof contribution.id !== 'string'\n || typeof contribution.name !== 'string'\n || !Object.hasOwn(contribution, 'spec')) continue\n extensions.push(Object.freeze({\n apiVersion: contribution.apiVersion,\n kind: contribution.kind,\n metadata: Object.freeze({\n name: contribution.name,\n labels: Object.freeze({ 'dsh.std/contribution-id': contribution.id }),\n }),\n spec: contribution.spec,\n }))\n }\n }\n const requirements = manifest.requires.contracts.map(communityRequirement)\n const permissions: PermissionRequest[] = manifest.permissions.map(permission => Object.freeze({\n apiVersion: COMMUNITY_PERMISSION_API_VERSION,\n kind: COMMUNITY_PERMISSION_KIND,\n action: permission.name,\n ...(permission.reason === undefined ? {} : { reason: permission.reason }),\n spec: Object.freeze({ scope: permission.scope }),\n }))\n return defineComponentManifest({\n apiVersion: COMPONENT_API_VERSION,\n kind: 'Component',\n metadata: { name: manifest.id, displayName: manifest.name, version: manifest.version },\n spec: {\n facets: [{\n name: 'host',\n activation: {\n apiVersion: 'lifecycle.dsh/v1alpha1',\n kind: 'FacetModule',\n spec: { module: manifest.facets.host.entry },\n },\n ...(requirements.length === 0 ? {} : { protocols: { requires: requirements } }),\n ...(extensions.length === 0 ? {} : { extensions }),\n ...(permissions.length === 0 ? {} : { permissions }),\n }],\n },\n })\n}\n\nfunction communityRequirement(reference: CommunityContractReference): ProtocolRequirement {\n return Object.freeze({\n apiVersion: reference.apiVersion,\n kind: reference.kind,\n ...(reference.optional === undefined ? {} : { optional: reference.optional }),\n ...(reference.fallback === undefined ? {} : { 'x-community-fallback': reference.fallback }),\n })\n}\n\nexport function facetIdentity(manifest: ComponentManifest, facet: ComponentFacet): FacetIdentity {\n if (!(manifest.spec.facets as readonly ComponentFacet[]).includes(facet)) {\n const found = manifest.spec.facets.find(candidate => candidate.name === facet.name)\n if (found === undefined) throw new TypeError(`facet ${JSON.stringify(facet.name)} does not belong to component`)\n }\n return Object.freeze({ component: manifest.metadata.name, version: manifest.metadata.version, facet: facet.name })\n}\n\nexport function facetKey(identity: FacetIdentity): string {\n return `${identity.component}@${identity.version}#${identity.facet}`\n}\n\nexport function findFacet(manifest: ComponentManifest, name: string): ComponentFacet | undefined {\n return manifest.spec.facets.find(facet => facet.name === name)\n}\n\nfunction validateCommunityFacets(value: unknown): void {\n const label = 'community v0.15 manifest.facets'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['host'], label, false)\n if (!record(value.host)) throw new TypeError(`${label}.host must be an object`)\n exact(value.host, ['entry', 'apiVersion'], `${label}.host`, false)\n validatePackageRelative(value.host.entry, `${label}.host.entry`)\n if (typeof value.host.apiVersion !== 'string'\n || !/^v[1-9][0-9]*(?:(?:alpha|beta)[1-9][0-9]*)?$/u.test(value.host.apiVersion)) {\n throw new TypeError(`${label}.host.apiVersion is invalid`)\n }\n}\n\nfunction validateCommunityRequirements(value: unknown): void {\n const label = 'community v0.15 manifest.requires'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['contracts', 'services'], label, false)\n if (!Array.isArray(value.contracts)) throw new TypeError(`${label}.contracts must be an array`)\n const seen = new Set<string>()\n for (const [index, referenceValue] of value.contracts.entries()) {\n const rowLabel = `${label}.contracts[${index}]`\n validateApiReference(referenceValue, rowLabel)\n const reference = referenceValue as unknown as Record<string, unknown>\n exact(reference, ['apiVersion', 'kind', 'optional', 'fallback'], rowLabel, false)\n if (reference.optional !== undefined && typeof reference.optional !== 'boolean') {\n throw new TypeError(`${rowLabel}.optional must be boolean`)\n }\n if (reference.fallback !== undefined) nonEmpty(reference.fallback, `${rowLabel}.fallback`)\n const key = protocolKey(reference as unknown as ApiReference)\n if (seen.has(key)) throw new TypeError(`${label}.contracts contains duplicate contract ${JSON.stringify(key)}`)\n seen.add(key)\n }\n if (value.services !== undefined && (!Array.isArray(value.services) || value.services.length !== 0)) {\n throw new TypeError(`${label}.services must be an empty array in v0.15`)\n }\n}\n\nfunction validateCommunityPermissions(value: unknown): void {\n const label = 'community v0.15 manifest.permissions'\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, permissionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n if (!record(permissionValue)) throw new TypeError(`${rowLabel} must be an object`)\n exact(permissionValue, ['name', 'scope', 'reason'], rowLabel, false)\n capabilityId(permissionValue.name, `${rowLabel}.name`)\n nonEmpty(permissionValue.scope, `${rowLabel}.scope`)\n if (permissionValue.reason !== undefined) nonEmpty(permissionValue.reason, `${rowLabel}.reason`)\n const key = `${String(permissionValue.name)}\\0${String(permissionValue.scope)}`\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate permission ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateCommunityContributions(value: unknown): void {\n const label = 'community v0.15 manifest.contributes'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n const unknown = Object.keys(value).filter(point => point !== 'commands' && point !== 'panels' && !point.startsWith('x-'))\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown contribution point ${JSON.stringify(unknown[0])}`)\n if (!Array.isArray(value.commands)) throw new TypeError(`${label}.commands must be an array`)\n const ids = new Set<string>()\n for (const [index, commandValue] of value.commands.entries()) {\n const rowLabel = `${label}.commands[${index}]`\n if (!record(commandValue)) throw new TypeError(`${rowLabel} must be an object`)\n exact(commandValue, ['id', 'title', 'description'], rowLabel, false)\n namespaced(commandValue.id, `${rowLabel}.id`)\n nonEmpty(commandValue.title, `${rowLabel}.title`)\n if (commandValue.description !== undefined) nonEmpty(commandValue.description, `${rowLabel}.description`)\n if (ids.has(commandValue.id)) throw new TypeError(`${label}.commands contains duplicate id ${JSON.stringify(commandValue.id)}`)\n ids.add(commandValue.id)\n }\n if (value.panels !== undefined && (!Array.isArray(value.panels) || value.panels.length !== 0)) {\n throw new TypeError(`${label}.panels must be an empty array in v0.15`)\n }\n for (const [point, contributions] of Object.entries(value)) {\n if (!point.startsWith('x-')) continue\n if (!Array.isArray(contributions)) throw new TypeError(`${label}.${point} must be an array`)\n }\n}\n\nfunction validateCommunitySubscriptions(value: unknown): void {\n const label = 'community v0.15 manifest.subscriptions'\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, subscriptionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n let key: string\n if (typeof subscriptionValue === 'string') {\n nonEmpty(subscriptionValue, rowLabel)\n key = `legacy\\0${subscriptionValue}`\n } else {\n validateApiReference(subscriptionValue, rowLabel)\n const subscription = subscriptionValue as unknown as Record<string, unknown>\n exact(subscription, ['apiVersion', 'kind', 'scope'], rowLabel, false)\n if (subscription.scope !== undefined) nonEmpty(subscription.scope, `${rowLabel}.scope`)\n key = `${protocolKey(subscription as unknown as ApiReference)}\\0${String(subscription.scope ?? '')}`\n }\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate subscription ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateCommunitySource(value: unknown): void {\n const label = 'community v0.15 manifest.source'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['repository', 'revision'], label, false)\n validateSchemaIdentifier(value.repository, `${label}.repository`)\n if (value.revision !== undefined) nonEmpty(value.revision, `${label}.revision`)\n}\n\nfunction validateCommunityArtifact(value: unknown): void {\n const label = 'community v0.15 manifest.artifact'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['digest', 'algorithm', 'path'], label, false)\n if (value.algorithm !== 'sha256') throw new TypeError(`${label}.algorithm must be \"sha256\"`)\n if (typeof value.digest !== 'string' || !/^sha256:[a-f0-9]{64}$/u.test(value.digest)) {\n throw new TypeError(`${label}.digest must be a SHA-256 digest`)\n }\n validatePackageRelative(value.path, `${label}.path`)\n}\n\nfunction validateCommunityCompat(value: unknown): void {\n const label = 'community v0.15 manifest.compat'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['hosts'], label, false)\n if (value.hosts === undefined) return\n if (!Array.isArray(value.hosts)) throw new TypeError(`${label}.hosts must be an array`)\n const seen = new Set<string>()\n for (const [index, host] of value.hosts.entries()) {\n nonEmpty(host, `${label}.hosts[${index}]`)\n if (seen.has(host)) throw new TypeError(`${label}.hosts contains duplicate ${JSON.stringify(host)}`)\n seen.add(host)\n }\n}\n\nfunction validateCommunityOverrides(value: unknown): void {\n const label = 'community v0.15 manifest.overrides'\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n for (const [index, overrideValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n if (!record(overrideValue)) throw new TypeError(`${rowLabel} must be an object`)\n exact(overrideValue, ['target', 'kind', 'description'], rowLabel, false)\n nonEmpty(overrideValue.target, `${rowLabel}.target`)\n if (overrideValue.kind !== 'patch' && overrideValue.kind !== 'native' && overrideValue.kind !== 'build') {\n throw new TypeError(`${rowLabel}.kind is invalid`)\n }\n if (overrideValue.description !== undefined) nonEmpty(overrideValue.description, `${rowLabel}.description`)\n }\n}\n\nfunction validatePackageRelative(value: unknown, label: string): asserts value is string {\n nonEmpty(value, label)\n if (value.startsWith('/') || value.startsWith('\\\\') || /^[a-zA-Z]:[\\\\/]/u.test(value)) {\n throw new TypeError(`${label} must be package-relative`)\n }\n const segments = value.replaceAll('\\\\', '/').split('/')\n if (segments.includes('..')) throw new TypeError(`${label} must remain inside the package`)\n}\n\nfunction capabilityId(value: unknown, label: string): asserts value is string {\n if (value === 'commands' || value === 'storage.local' || value === 'messages.observe') return\n if (typeof value !== 'string' || !/^(?:x-[a-z0-9][a-z0-9.-]*\\.)?[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$/u.test(value)) {\n throw new TypeError(`${label} must be a namespaced capability identifier`)\n }\n}\n\nfunction localContributionName(id: string): string {\n const name = id.split('.').at(-1) ?? id\n localName(name, 'contribution local name')\n return name\n}\n\nfunction validateFacet(value: unknown, index: number): void {\n const label = `component spec.facets[${index}]`\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['name', 'activation', 'protocols', 'extensions', 'permissions'], label)\n localName(value.name, `${label}.name`)\n if (value.activation !== undefined) validateActivation(value.activation, `${label}.activation`)\n if (value.protocols !== undefined) validateProtocols(value.protocols, `${label}.protocols`)\n if (value.extensions !== undefined) validateExtensions(value.extensions, `${label}.extensions`)\n if (value.permissions !== undefined) validatePermissions(value.permissions, `${label}.permissions`)\n if (value.activation === undefined && value.protocols === undefined && value.extensions === undefined && value.permissions === undefined) {\n throw new TypeError(`${label} must declare activation, protocols, extensions, or permissions`)\n }\n}\n\nfunction validateActivation(value: unknown, label: string): void {\n validateApiReference(value, label)\n const row = value as unknown as Record<string, unknown>\n exact(row, ['apiVersion', 'kind', 'spec'], label)\n if (!Object.hasOwn(row, 'spec')) throw new TypeError(`${label}.spec is required`)\n}\n\nfunction validateProtocols(value: unknown, label: string): void {\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['requires', 'supports'], label)\n validateProtocolRows(value.requires, true, `${label}.requires`)\n validateProtocolRows(value.supports, false, `${label}.supports`)\n}\n\nfunction validateProtocolRows(value: unknown, requirement: boolean, label: string): void {\n if (value === undefined) return\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, rowValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n validateApiReference(rowValue, rowLabel)\n const row = rowValue as unknown as Record<string, unknown>\n exact(row, requirement ? ['apiVersion', 'kind', 'optional', 'spec'] : ['apiVersion', 'kind', 'spec'], rowLabel)\n if (requirement && row.optional !== undefined && typeof row.optional !== 'boolean') throw new TypeError(`${rowLabel}.optional must be boolean`)\n const key = protocolKey(row as unknown as ApiReference)\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate protocol ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateExtensions(value: unknown, label: string): void {\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, extensionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n validateApiReference(extensionValue, rowLabel)\n const extension = extensionValue as unknown as Record<string, unknown>\n exact(extension, ['apiVersion', 'kind', 'metadata', 'spec'], rowLabel)\n if (!record(extension.metadata)) throw new TypeError(`${rowLabel}.metadata must be an object`)\n exact(extension.metadata, ['name', 'labels'], `${rowLabel}.metadata`)\n nonEmpty(extension.metadata.name, `${rowLabel}.metadata.name`)\n if (extension.metadata.labels !== undefined) validateLabels(extension.metadata.labels, `${rowLabel}.metadata.labels`)\n if (!Object.hasOwn(extension, 'spec')) throw new TypeError(`${rowLabel}.spec is required`)\n if (Object.hasOwn(extension, 'status')) throw new TypeError(`${rowLabel}.status is runtime-owned`)\n const key = `${protocolKey(extension as unknown as ApiReference)}\\0${String(extension.metadata.name)}`\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate extension ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validatePermissions(value: unknown, label: string): void {\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, permissionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n validateApiReference(permissionValue, rowLabel)\n const permission = permissionValue as unknown as Record<string, unknown>\n exact(permission, ['apiVersion', 'kind', 'action', 'optional', 'reason', 'spec'], rowLabel)\n localName(permission.action, `${rowLabel}.action`)\n if (permission.optional !== undefined && typeof permission.optional !== 'boolean') throw new TypeError(`${rowLabel}.optional must be boolean`)\n if (permission.reason !== undefined) nonEmpty(permission.reason, `${rowLabel}.reason`)\n const key = `${protocolKey(permission as unknown as ApiReference)}\\0${String(permission.action)}`\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate permission ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateRelationships(value: unknown, component: string): void {\n if (!record(value)) throw new TypeError('component relationships must be an object')\n exact(value, ['depends', 'recommends', 'conflicts', 'breaks'], 'component relationships', false)\n for (const kind of ['depends', 'recommends', 'conflicts', 'breaks'] as const) {\n const rows = value[kind]\n if (rows === undefined) continue\n if (!record(rows)) throw new TypeError(`component relationships.${kind} must be an object`)\n for (const [target, range] of Object.entries(rows)) {\n namespaced(target, `component relationships.${kind} target`)\n if (target === component) throw new TypeError(`component cannot declare ${kind} on itself`)\n assertVersionRange(range as VersionRange)\n }\n }\n}\n\nfunction registerDefinition(\n target: Map<string, ManifestObjectDefinition>,\n definition: ManifestObjectDefinition,\n label: string,\n): () => void {\n validateApiReference(definition, `${label} definition`)\n if (typeof definition.validateSpec !== 'function') throw new TypeError(`${label} definition.validateSpec must be a function`)\n const key = protocolKey(definition)\n if (target.has(key)) throw new Error(`${label} definition ${definition.apiVersion} ${definition.kind} is already registered`)\n const stored = Object.freeze({ ...definition })\n target.set(key, stored)\n return () => { if (target.get(key) === stored) target.delete(key) }\n}\n\nfunction issue(\n code: ManifestValidationIssue['code'], severity: ManifestValidationIssue['severity'], path: string, message: string,\n): ManifestValidationIssue {\n return Object.freeze({ code, severity, path, message })\n}\n\nfunction validateLabels(value: unknown, label: string): void {\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n for (const [key, item] of Object.entries(value)) {\n nonEmpty(key, `${label} key`)\n if (typeof item !== 'string') throw new TypeError(`${label}.${key} must be a string`)\n }\n}\n\nfunction namespaced(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || !COMPONENT_ID.test(value)) throw new TypeError(`${label} must be namespaced`)\n}\n\nfunction localName(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || !LOCAL_NAME.test(value)) throw new TypeError(`${label} is invalid`)\n}\n\nfunction nonEmpty(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)\n}\n\nfunction validateSchemaIdentifier(value: unknown, label: string): asserts value is string {\n nonEmpty(value, label)\n try { new URL(value) } catch (error) {\n throw new TypeError(`${label} must be an absolute URI`, { cause: error })\n }\n}\n\nfunction record(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction exact(value: Record<string, unknown>, allowed: readonly string[], label: string, extensions = true): void {\n const unknown = Object.keys(value).filter(key => !allowed.includes(key) && !(extensions && key.startsWith('x-')))\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value !== 'object' || value === null || Object.isFrozen(value)) return value\n Object.freeze(value)\n for (const child of Object.values(value)) deepFreeze(child)\n return value\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction manifestDigest(manifest: ComponentManifest): string {\n const input = canonical(manifest)\n let hash = 2166136261\n for (let index = 0; index < input.length; index += 1) hash = Math.imul(hash ^ input.charCodeAt(index), 16777619)\n return `fnv1a32:${(hash >>> 0).toString(16).padStart(8, '0')}`\n}\n\nfunction canonical(value: unknown): string {\n if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`\n if (record(value)) {\n return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => `${JSON.stringify(key)}:${canonical(item)}`).join(',')}}`\n }\n return JSON.stringify(value) ?? 'null'\n}\n"],"mappings":";;AAWA,MAAa,kCAAkC;AAC/C,MAAa,wBAAwB;AACrC,MAAa,mCAAmC;AAChD,MAAa,4BAA4B;AAEzC,MAAM,eAAe;AACrB,MAAM,aAAa;AAyInB,IAAa,4BAAb,MAAuC;CAIhB;CAHrB,8BAA+B,IAAI,IAAsC;CACzE,6BAA8B,IAAI,IAAsC;CAExE,YAAY,YAAqB,OAAO,OAAO;EAAE,MAAM;EAAqB,SAAS;CAAQ,CAAC,GAAG;EAA5E,KAAA,YAAA;EACnB,SAAS,UAAU,MAAM,gBAAgB;EACzC,SAAS,UAAU,SAAS,mBAAmB;CACjD;CAEA,mBAAmB,Y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AAQ,SAAS,GAAG,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,KAAK,GAAG,QAAQ;CAC/G,OAAO,YAAY,SAAS,EAAA,CAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAC7D;AAEA,SAAS,UAAU,OAAwB;CACzC,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,IAAI,MAAM,IAAI,SAAS,CAAC,CAAC,KAAK,GAAG,EAAE;CACpE,IAAI,OAAO,KAAK,GACd,OAAO,IAAI,OAAO,QAAQ,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,UAAU,GAAG,KAAK,UAAU,GAAG,EAAE,GAAG,UAAU,IAAI,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;CAEtJ,OAAO,KAAK,UAAU,KAAK,KAAK;AAClC"}
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@dsh-std/manifest",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": { "types": "./lib/index.d.ts", "default": "./lib/index.js" },
10
+ "./schema/dsh-plugin-0.15.schema.json": "./schema/dsh-plugin-0.15.schema.json"
11
+ },
12
+ "files": ["lib", "schema", "CHANGELOG.md"],
13
+ "scripts": {
14
+ "build": "pnpm run typecheck && tsdown",
15
+ "typecheck": "tsc -p tsconfig.json --noEmit",
16
+ "test": "vitest run"
17
+ },
18
+ "dependencies": { "@dsh-std/core": "workspace:*" },
19
+ "engines": { "node": "^22.19 || >=24" }
20
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DSH Plugin Manifest Community Draft v0.15",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["$schema", "manifestVersion", "id", "name", "version", "facets", "requires", "permissions", "contributes", "subscriptions"],
7
+ "properties": {
8
+ "$schema": { "type": "string", "format": "uri" },
9
+ "manifestVersion": { "const": "0.15" },
10
+ "id": { "$ref": "#/$defs/namespacedId" },
11
+ "name": { "type": "string", "minLength": 1 },
12
+ "version": { "type": "string", "minLength": 1 },
13
+ "facets": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["host"],
17
+ "properties": {
18
+ "host": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["entry", "apiVersion"],
22
+ "properties": {
23
+ "entry": { "type": "string", "minLength": 1, "pattern": "^(?![\\\\/])(?![A-Za-z]:[\\\\/])(?!.*(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$)).+$" },
24
+ "apiVersion": { "type": "string", "pattern": "^v[1-9][0-9]*(?:(?:alpha|beta)[1-9][0-9]*)?$" }
25
+ }
26
+ }
27
+ }
28
+ },
29
+ "requires": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["contracts"],
33
+ "properties": {
34
+ "contracts": { "type": "array", "items": { "$ref": "#/$defs/contract" } },
35
+ "services": { "type": "array", "maxItems": 0 }
36
+ }
37
+ },
38
+ "permissions": { "type": "array", "items": { "$ref": "#/$defs/permission" } },
39
+ "contributes": {
40
+ "type": "object",
41
+ "required": ["commands"],
42
+ "properties": {
43
+ "commands": { "type": "array", "items": { "$ref": "#/$defs/command" } },
44
+ "panels": { "type": "array", "maxItems": 0 }
45
+ },
46
+ "patternProperties": { "^x-": { "type": "array" } },
47
+ "additionalProperties": false
48
+ },
49
+ "subscriptions": {
50
+ "type": "array",
51
+ "items": {
52
+ "oneOf": [
53
+ { "type": "string", "minLength": 1 },
54
+ { "$ref": "#/$defs/subscription" }
55
+ ]
56
+ }
57
+ },
58
+ "license": { "type": "string", "minLength": 1 },
59
+ "source": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["repository"],
63
+ "properties": {
64
+ "repository": { "type": "string", "format": "uri" },
65
+ "revision": { "type": "string", "minLength": 1 }
66
+ }
67
+ },
68
+ "artifact": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["digest", "algorithm", "path"],
72
+ "properties": {
73
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
74
+ "algorithm": { "const": "sha256" },
75
+ "path": { "type": "string", "minLength": 1 }
76
+ }
77
+ },
78
+ "compat": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "properties": { "hosts": { "type": "array", "items": { "type": "string", "minLength": 1 } } }
82
+ },
83
+ "overrides": {
84
+ "type": "array",
85
+ "items": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": ["target", "kind"],
89
+ "properties": {
90
+ "target": { "type": "string", "minLength": 1 },
91
+ "kind": { "enum": ["patch", "native", "build"] },
92
+ "description": { "type": "string", "minLength": 1 }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "patternProperties": { "^x-": {} },
98
+ "$defs": {
99
+ "namespacedId": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$" },
100
+ "apiVersion": { "type": "string", "pattern": "^[a-z][a-z0-9.-]*/v[1-9][0-9]*(?:(?:alpha|beta)[1-9][0-9]*)?$" },
101
+ "kind": { "type": "string", "pattern": "^[A-Z][A-Za-z0-9]*$" },
102
+ "contract": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["apiVersion", "kind"],
106
+ "properties": {
107
+ "apiVersion": { "$ref": "#/$defs/apiVersion" },
108
+ "kind": { "$ref": "#/$defs/kind" },
109
+ "optional": { "type": "boolean" },
110
+ "fallback": { "type": "string", "minLength": 1 }
111
+ }
112
+ },
113
+ "permission": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["name", "scope"],
117
+ "properties": {
118
+ "name": { "$ref": "#/$defs/namespacedId" },
119
+ "scope": { "type": "string", "minLength": 1 },
120
+ "reason": { "type": "string", "minLength": 1 }
121
+ }
122
+ },
123
+ "command": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["id", "title"],
127
+ "properties": {
128
+ "id": { "$ref": "#/$defs/namespacedId" },
129
+ "title": { "type": "string", "minLength": 1 },
130
+ "description": { "type": "string", "minLength": 1 }
131
+ }
132
+ },
133
+ "subscription": {
134
+ "type": "object",
135
+ "additionalProperties": false,
136
+ "required": ["apiVersion", "kind"],
137
+ "properties": {
138
+ "apiVersion": { "$ref": "#/$defs/apiVersion" },
139
+ "kind": { "$ref": "#/$defs/kind" },
140
+ "scope": { "type": "string", "minLength": 1 }
141
+ }
142
+ }
143
+ }
144
+ }
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ Changes to `@dsh-std/presentation` are recorded here.
4
+
5
+ ## 0.1.0 (draft)
6
+
7
+ - Defined invocation-scoped `OpenExternal`, `CopyText`, `Notification`, `UserInteraction`, and `ExternalRedirect` capabilities.
8
+ - Added typed question, approval, secret-input, and one-shot loopback redirect flows.
9
+ - Added optional exact loopback callback URIs with explicit-port validation, no-substitution semantics, and address-in-use failure reporting.
@@ -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,27 @@
1
+ # @dsh-std/presentation
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ Small, invocation-scoped operations that a runtime facet may request from a connected presentation client.
6
+
7
+ ## Contracts
8
+
9
+ `v1alpha1` defines five independent presentation protocols:
10
+
11
+ - `OpenExternal` asks the client to open an HTTP or HTTPS URI.
12
+ - `CopyText` asks the client to copy text to its clipboard.
13
+ - `Notification` asks the client to display informational, warning, or error text.
14
+ - `UserInteraction` carries structured questions, one-invocation approvals, and secret input.
15
+ - `ExternalRedirect` receives a one-shot HTTP redirect on the user side and may reserve an exact loopback URI requested by the consumer.
16
+
17
+ A facet declares each required operation in its manifest. A client advertises only the protocols it can perform for the current connection. The runtime admits the command only when all required presentation protocols are available, and it accepts only operations declared by that facet. Operations belong to the active invocation; they are not a global event bus or a persistent client capability.
18
+
19
+ The package provides protocol definitions, invocation-scoped typed client and implementation binders, and request/result validation. The Host binds request identity and origin when it creates a client; consumers supply only operation-specific input. It does not perform UI work. Native applications, terminals, browsers, editors, and automation clients may implement different subsets.
20
+
21
+ Simple operations are available from `@dsh-std/presentation/operations`, while interaction types are available from `@dsh-std/presentation/interaction`. A Host-provided `PresentationDescriptor` is only a projection of active agreements for the current invocation; it is not a separate Snapshot protocol.
22
+
23
+ ## Known Limitations and Deferred Work
24
+
25
+ - `OpenExternal` intentionally rejects non-HTTP(S) URI schemes.
26
+ - Clipboard reads, arbitrary UI trees, and file pickers are not defined.
27
+ - Delivery acknowledgement and durable replay are outside `v1alpha1`.
@@ -0,0 +1,29 @@
1
+ # @dsh-std/presentation
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 拟议设计见 [Presentation Operations](../../docs/proposals/presentation.zh.md)。
6
+
7
+ 运行时插件可以向已连接表现客户端请求的小型、调用作用域内操作。
8
+
9
+ ## 协议
10
+
11
+ `v1alpha1` 定义五个彼此独立的表现协议:
12
+
13
+ - `OpenExternal` 请求客户端打开 HTTP 或 HTTPS URI;
14
+ - `CopyText` 请求客户端把文本复制到剪贴板;
15
+ - `Notification` 请求客户端显示信息、警告或错误文本;
16
+ - `UserInteraction` 承载结构化 question、单次 approval 和 secret input。
17
+ - `ExternalRedirect` 在用户侧接收一次 HTTP redirect,并可按调用方要求独占精确的 loopback URI。
18
+
19
+ Facet 在清单中声明每项所需操作。客户端只为当前连接声明自己能够执行的协议。仅当全部必需表现协议可用时,运行时才接纳命令;运行时也只接受该 facet 事先声明的操作。操作属于当前调用,不是全局事件总线或持久客户端能力。
20
+
21
+ 本包提供 protocol definitions、调用作用域内的类型化 client/implementation binder、请求与结果校验。Host 创建 client 时绑定 request identity 与 origin,Consumer 只提交 operation 自有输入。它不执行 UI 工作;原生应用、终端、浏览器、编辑器和自动化客户端可以实现不同子集。
22
+
23
+ 普通操作可以从 `@dsh-std/presentation/operations` 导入,交互协议可以从 `@dsh-std/presentation/interaction` 导入。Host 交给领域调用的 `PresentationDescriptor` 只是当前 invocation active agreements 的投影,不是额外的 Snapshot 协议。
24
+
25
+ ## 已知限制与暂缓事项
26
+
27
+ - `OpenExternal` 有意拒绝非 HTTP(S) URI scheme。
28
+ - 协议不定义剪贴板读取、任意 UI tree 或文件选择器。
29
+ - `v1alpha1` 不包含投递确认与持久回放。
@@ -0,0 +1,2 @@
1
+ import { EXTERNAL_REDIRECT_KIND, ExternalRedirectCall, ExternalRedirectClient, ExternalRedirectHandler, ExternalRedirectInput, ExternalRedirectReady, ExternalRedirectRequest, ExternalRedirectValue, externalRedirectClient, externalRedirectImplementation, externalRedirectProtocol, externalRedirectSupport, validateExternalRedirectReady, validateExternalRedirectRequest, validateExternalRedirectResult } from "./index.js";
2
+ export { EXTERNAL_REDIRECT_KIND, ExternalRedirectCall, ExternalRedirectClient, ExternalRedirectHandler, ExternalRedirectInput, ExternalRedirectReady, ExternalRedirectRequest, ExternalRedirectValue, externalRedirectClient, externalRedirectImplementation, externalRedirectProtocol, externalRedirectSupport, validateExternalRedirectReady, validateExternalRedirectRequest, validateExternalRedirectResult };
@@ -0,0 +1,179 @@
1
+ import { defineCapabilityProtocol } from "@dsh-std/connection";
2
+ //#region src/callback.ts
3
+ const EXTERNAL_REDIRECT_KIND = "ExternalRedirect";
4
+ const emptySpec = (value) => {
5
+ if (value !== void 0) throw new TypeError("ExternalRedirect does not accept spec in v1alpha1");
6
+ };
7
+ const externalRedirectProtocol = defineCapabilityProtocol({
8
+ apiVersion: "presentation.dsh/v1alpha1",
9
+ kind: EXTERNAL_REDIRECT_KIND,
10
+ validateRequirement: emptySpec,
11
+ validateSupport: emptySpec
12
+ });
13
+ const externalRedirectSupport = Object.freeze({
14
+ apiVersion: "presentation.dsh/v1alpha1",
15
+ kind: EXTERNAL_REDIRECT_KIND
16
+ });
17
+ function externalRedirectClient(client, scope) {
18
+ validateScope(scope);
19
+ return Object.freeze({ receive(input = {}, options) {
20
+ const request = Object.freeze({
21
+ ...input,
22
+ mode: input.mode ?? "http-get",
23
+ requestId: nextRequestId(scope),
24
+ invocationId: scope.invocationId,
25
+ origin: scope.origin,
26
+ ...scope.deadline === void 0 ? {} : { deadline: scope.deadline }
27
+ });
28
+ validateExternalRedirectRequest(request);
29
+ const call = client.invoke(externalRedirectSupport, "receive", request, options);
30
+ return Object.freeze({
31
+ invocationId: call.invocationId,
32
+ ready: firstReady(call.progress),
33
+ result: call.result.then(validateExternalRedirectResult),
34
+ cancel: (reason) => call.cancel(reason)
35
+ });
36
+ } });
37
+ }
38
+ function externalRedirectImplementation(participantId, handler) {
39
+ return Object.freeze({
40
+ participantId,
41
+ protocol: externalRedirectSupport,
42
+ async handle(operation, input, context) {
43
+ if (operation !== "receive") throw new TypeError(`unsupported ExternalRedirect operation ${JSON.stringify(operation)}`);
44
+ validateExternalRedirectRequest(input);
45
+ let announced = false;
46
+ const guardedContext = Object.freeze({
47
+ ...context,
48
+ progress(value) {
49
+ if (announced) throw new TypeError("ExternalRedirect provider emitted more than one ready event");
50
+ validateExternalRedirectReady(value);
51
+ if (input.exactRedirectUri !== void 0 && value.redirectUri !== input.exactRedirectUri) throw new TypeError("ExternalRedirect provider did not announce the exact requested redirect URI");
52
+ announced = true;
53
+ context.progress(value);
54
+ }
55
+ });
56
+ const result = validateExternalRedirectResult(await handler.receive(input, guardedContext));
57
+ if (result.status === "submitted" && !announced) throw new TypeError("ExternalRedirect provider submitted a result before announcing redirectUri");
58
+ return result;
59
+ }
60
+ });
61
+ }
62
+ function validateExternalRedirectRequest(value) {
63
+ const request = exactRecord(value, [
64
+ "requestId",
65
+ "invocationId",
66
+ "origin",
67
+ "deadline",
68
+ "mode",
69
+ "exactRedirectUri"
70
+ ], [
71
+ "requestId",
72
+ "invocationId",
73
+ "origin",
74
+ "mode"
75
+ ], "ExternalRedirect request");
76
+ nonEmpty(request.requestId, "ExternalRedirect request.requestId");
77
+ nonEmpty(request.invocationId, "ExternalRedirect request.invocationId");
78
+ nonEmpty(request.origin, "ExternalRedirect request.origin");
79
+ if (request.mode !== "http-get") throw new TypeError("ExternalRedirect request.mode must be \"http-get\"");
80
+ if (request.exactRedirectUri !== void 0) validateLoopbackUri(request.exactRedirectUri, "ExternalRedirect request.exactRedirectUri", true);
81
+ dateTime(request.deadline, "ExternalRedirect request.deadline");
82
+ }
83
+ function validateExternalRedirectReady(value) {
84
+ const ready = exactRecord(value, [
85
+ "type",
86
+ "redirectUri",
87
+ "expiresAt"
88
+ ], ["type", "redirectUri"], "ExternalRedirect ready");
89
+ if (ready.type !== "ready") throw new TypeError("ExternalRedirect ready.type must be \"ready\"");
90
+ validateLoopbackUri(ready.redirectUri, "ExternalRedirect ready.redirectUri", false);
91
+ dateTime(ready.expiresAt, "ExternalRedirect ready.expiresAt");
92
+ }
93
+ function validateExternalRedirectResult(value) {
94
+ if (!record(value)) throw new TypeError("ExternalRedirect result must be an object");
95
+ if (value.status === "submitted") {
96
+ const submitted = exactRecord(exactRecord(value, ["status", "value"], ["status", "value"], "ExternalRedirect result").value, ["query"], ["query"], "ExternalRedirect value");
97
+ if (!record(submitted.query)) throw new TypeError("ExternalRedirect value.query must be an object");
98
+ const query = {};
99
+ for (const [name, entries] of Object.entries(submitted.query)) {
100
+ if (name === "" || !Array.isArray(entries) || entries.some((entry) => typeof entry !== "string")) throw new TypeError("ExternalRedirect value.query must map non-empty names to string arrays");
101
+ query[name] = Object.freeze([...entries]);
102
+ }
103
+ return Object.freeze({
104
+ status: "submitted",
105
+ value: Object.freeze({ query: Object.freeze(query) })
106
+ });
107
+ }
108
+ if (value.status === "unavailable") {
109
+ const result = exactRecord(value, ["status", "reason"], ["status"], "ExternalRedirect result");
110
+ if (result.reason !== void 0) nonEmpty(result.reason, "ExternalRedirect result.reason");
111
+ return Object.freeze({
112
+ status: "unavailable",
113
+ ...result.reason === void 0 ? {} : { reason: result.reason }
114
+ });
115
+ }
116
+ if (value.status === "cancelled" || value.status === "expired") {
117
+ exactRecord(value, ["status"], ["status"], "ExternalRedirect result");
118
+ return Object.freeze({ status: value.status });
119
+ }
120
+ throw new TypeError("ExternalRedirect result.status is invalid");
121
+ }
122
+ async function firstReady(progress) {
123
+ for await (const value of progress) {
124
+ validateExternalRedirectReady(value);
125
+ return Object.freeze({ ...value });
126
+ }
127
+ throw new TypeError("ExternalRedirect provider completed without announcing redirectUri");
128
+ }
129
+ function validateScope(scope) {
130
+ if (!record(scope)) throw new TypeError("Presentation invocation scope must be an object");
131
+ nonEmpty(scope.invocationId, "Presentation invocation scope.invocationId");
132
+ nonEmpty(scope.origin, "Presentation invocation scope.origin");
133
+ dateTime(scope.deadline, "Presentation invocation scope.deadline");
134
+ if (typeof scope.nextRequestId !== "function") throw new TypeError("Presentation invocation scope.nextRequestId must be a function");
135
+ }
136
+ function nextRequestId(scope) {
137
+ const value = scope.nextRequestId();
138
+ nonEmpty(value, "Presentation requestId");
139
+ return value;
140
+ }
141
+ function exactRecord(value, allowed, required, label) {
142
+ if (!record(value)) throw new TypeError(`${label} must be an object`);
143
+ const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
144
+ if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`);
145
+ for (const key of required) if (!Object.hasOwn(value, key)) throw new TypeError(`${label}.${key} is required`);
146
+ return value;
147
+ }
148
+ function record(value) {
149
+ return typeof value === "object" && value !== null && !Array.isArray(value);
150
+ }
151
+ function nonEmpty(value, label) {
152
+ if (typeof value !== "string" || value.trim() === "") throw new TypeError(`${label} must be a non-empty string`);
153
+ }
154
+ function dateTime(value, label) {
155
+ if (value !== void 0 && (typeof value !== "string" || Number.isNaN(Date.parse(value)))) throw new TypeError(`${label} must be an RFC 3339 date-time`);
156
+ }
157
+ function validateLoopbackUri(value, label, requireExplicitPort) {
158
+ nonEmpty(value, label);
159
+ let uri;
160
+ try {
161
+ uri = new URL(value);
162
+ } catch {
163
+ throw new TypeError(`${label} must be an absolute URI`);
164
+ }
165
+ if (uri.protocol !== "http:") throw new TypeError(`${label} must use HTTP`);
166
+ if (uri.hostname !== "127.0.0.1" && uri.hostname !== "[::1]" && uri.hostname !== "localhost") throw new TypeError(`${label} must target a loopback host`);
167
+ if (uri.username !== "" || uri.password !== "") throw new TypeError(`${label} must not contain user information`);
168
+ if (uri.hash !== "") throw new TypeError(`${label} must not contain a fragment`);
169
+ if (requireExplicitPort) {
170
+ const authority = value.slice(value.indexOf("//") + 2).split(/[/?#]/u, 1)[0];
171
+ const match = /^(?:127\.0\.0\.1|localhost):(\d+)$|^\[::1\]:(\d+)$/iu.exec(authority);
172
+ const port = Number(match?.[1] ?? match?.[2]);
173
+ if (!Number.isSafeInteger(port) || port < 1 || port > 65535) throw new TypeError(`${label} must include an explicit TCP port`);
174
+ }
175
+ }
176
+ //#endregion
177
+ export { EXTERNAL_REDIRECT_KIND, externalRedirectClient, externalRedirectImplementation, externalRedirectProtocol, externalRedirectSupport, validateExternalRedirectReady, validateExternalRedirectRequest, validateExternalRedirectResult };
178
+
179
+ //# sourceMappingURL=callback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callback.js","names":[],"sources":["../src/callback.ts"],"sourcesContent":["import type {\n CapabilityClient,\n CapabilityHandlerContext,\n CapabilityImplementation,\n} from '@dsh-std/connection'\nimport { defineCapabilityProtocol } from '@dsh-std/connection'\nimport type { ProtocolSupport } from '@dsh-std/core'\nimport type { PresentationInvocationScope, PresentationRequestContext, PresentationResult } from './index.js'\n\nexport const EXTERNAL_REDIRECT_KIND = 'ExternalRedirect'\n\nexport interface ExternalRedirectRequest extends PresentationRequestContext {\n readonly mode: 'http-get'\n /** Exact loopback URI required by the external provider, including an explicit port. */\n readonly exactRedirectUri?: string\n}\nexport interface ExternalRedirectInput {\n readonly mode?: 'http-get'\n /** The provider must bind and announce this exact URI or report the request unavailable. */\n readonly exactRedirectUri?: string\n}\n\nexport interface ExternalRedirectReady {\n readonly type: 'ready'\n readonly redirectUri: string\n readonly expiresAt?: string\n}\n\nexport interface ExternalRedirectValue {\n readonly query: Readonly<Record<string, readonly string[]>>\n}\n\nexport interface ExternalRedirectCall {\n readonly invocationId: string\n readonly ready: Promise<ExternalRedirectReady>\n readonly result: Promise<PresentationResult<ExternalRedirectValue>>\n cancel(reason?: string): void\n}\n\nexport interface ExternalRedirectClient {\n receive(input?: ExternalRedirectInput, options?: { readonly signal?: AbortSignal }): ExternalRedirectCall\n}\n\nexport interface ExternalRedirectHandler {\n receive(\n request: ExternalRedirectRequest,\n context: CapabilityHandlerContext<ExternalRedirectReady>,\n ): PresentationResult<ExternalRedirectValue> | Promise<PresentationResult<ExternalRedirectValue>>\n}\n\nconst emptySpec = (value: unknown): undefined => {\n if (value !== undefined) throw new TypeError('ExternalRedirect does not accept spec in v1alpha1')\n return undefined\n}\n\nexport const externalRedirectProtocol = defineCapabilityProtocol({\n apiVersion: 'presentation.dsh/v1alpha1', kind: EXTERNAL_REDIRECT_KIND,\n validateRequirement: emptySpec, validateSupport: emptySpec,\n})\nexport const externalRedirectSupport: ProtocolSupport = Object.freeze({\n apiVersion: 'presentation.dsh/v1alpha1', kind: EXTERNAL_REDIRECT_KIND,\n})\n\nexport function externalRedirectClient(client: CapabilityClient, scope: PresentationInvocationScope): ExternalRedirectClient {\n validateScope(scope)\n return Object.freeze({\n receive(input: ExternalRedirectInput = {}, options?: { readonly signal?: AbortSignal }) {\n const request = Object.freeze({\n ...input,\n mode: input.mode ?? 'http-get',\n requestId: nextRequestId(scope), invocationId: scope.invocationId, origin: scope.origin,\n ...(scope.deadline === undefined ? {} : { deadline: scope.deadline }),\n })\n validateExternalRedirectRequest(request)\n const call = client.invoke<ExternalRedirectRequest, PresentationResult<ExternalRedirectValue>, ExternalRedirectReady>(\n externalRedirectSupport, 'receive', request, options,\n )\n return Object.freeze({\n invocationId: call.invocationId,\n ready: firstReady(call.progress),\n result: call.result.then(validateExternalRedirectResult),\n cancel: (reason?: string) => call.cancel(reason),\n })\n },\n })\n}\n\nexport function externalRedirectImplementation(\n participantId: string,\n handler: ExternalRedirectHandler,\n): CapabilityImplementation<ExternalRedirectRequest, PresentationResult<ExternalRedirectValue>, ExternalRedirectReady> {\n return Object.freeze({\n participantId, protocol: externalRedirectSupport,\n async handle(operation: string, input: ExternalRedirectRequest, context: CapabilityHandlerContext<ExternalRedirectReady>) {\n if (operation !== 'receive') throw new TypeError(`unsupported ExternalRedirect operation ${JSON.stringify(operation)}`)\n validateExternalRedirectRequest(input)\n let announced = false\n const guardedContext: CapabilityHandlerContext<ExternalRedirectReady> = Object.freeze({\n ...context,\n progress(value: ExternalRedirectReady) {\n if (announced) throw new TypeError('ExternalRedirect provider emitted more than one ready event')\n validateExternalRedirectReady(value)\n if (input.exactRedirectUri !== undefined && value.redirectUri !== input.exactRedirectUri) {\n throw new TypeError('ExternalRedirect provider did not announce the exact requested redirect URI')\n }\n announced = true\n context.progress(value)\n },\n })\n const result = validateExternalRedirectResult(await handler.receive(input, guardedContext))\n if (result.status === 'submitted' && !announced) {\n throw new TypeError('ExternalRedirect provider submitted a result before announcing redirectUri')\n }\n return result\n },\n })\n}\n\nexport function validateExternalRedirectRequest(value: unknown): asserts value is ExternalRedirectRequest {\n const request = exactRecord(value, ['requestId', 'invocationId', 'origin', 'deadline', 'mode', 'exactRedirectUri'], ['requestId', 'invocationId', 'origin', 'mode'], 'ExternalRedirect request')\n nonEmpty(request.requestId, 'ExternalRedirect request.requestId')\n nonEmpty(request.invocationId, 'ExternalRedirect request.invocationId')\n nonEmpty(request.origin, 'ExternalRedirect request.origin')\n if (request.mode !== 'http-get') throw new TypeError('ExternalRedirect request.mode must be \"http-get\"')\n if (request.exactRedirectUri !== undefined) validateLoopbackUri(request.exactRedirectUri, 'ExternalRedirect request.exactRedirectUri', true)\n dateTime(request.deadline, 'ExternalRedirect request.deadline')\n}\n\nexport function validateExternalRedirectReady(value: unknown): asserts value is ExternalRedirectReady {\n const ready = exactRecord(value, ['type', 'redirectUri', 'expiresAt'], ['type', 'redirectUri'], 'ExternalRedirect ready')\n if (ready.type !== 'ready') throw new TypeError('ExternalRedirect ready.type must be \"ready\"')\n validateLoopbackUri(ready.redirectUri, 'ExternalRedirect ready.redirectUri', false)\n dateTime(ready.expiresAt, 'ExternalRedirect ready.expiresAt')\n}\n\nexport function validateExternalRedirectResult(value: unknown): PresentationResult<ExternalRedirectValue> {\n if (!record(value)) throw new TypeError('ExternalRedirect result must be an object')\n if (value.status === 'submitted') {\n const result = exactRecord(value, ['status', 'value'], ['status', 'value'], 'ExternalRedirect result')\n const submitted = exactRecord(result.value, ['query'], ['query'], 'ExternalRedirect value')\n if (!record(submitted.query)) throw new TypeError('ExternalRedirect value.query must be an object')\n const query: Record<string, readonly string[]> = {}\n for (const [name, entries] of Object.entries(submitted.query)) {\n if (name === '' || !Array.isArray(entries) || entries.some(entry => typeof entry !== 'string')) {\n throw new TypeError('ExternalRedirect value.query must map non-empty names to string arrays')\n }\n query[name] = Object.freeze([...entries])\n }\n return Object.freeze({ status: 'submitted', value: Object.freeze({ query: Object.freeze(query) }) })\n }\n if (value.status === 'unavailable') {\n const result = exactRecord(value, ['status', 'reason'], ['status'], 'ExternalRedirect result')\n if (result.reason !== undefined) nonEmpty(result.reason, 'ExternalRedirect result.reason')\n return Object.freeze({ status: 'unavailable', ...(result.reason === undefined ? {} : { reason: result.reason as string }) })\n }\n if (value.status === 'cancelled' || value.status === 'expired') {\n exactRecord(value, ['status'], ['status'], 'ExternalRedirect result')\n return Object.freeze({ status: value.status })\n }\n throw new TypeError('ExternalRedirect result.status is invalid')\n}\n\nasync function firstReady(progress: AsyncIterable<ExternalRedirectReady>): Promise<ExternalRedirectReady> {\n for await (const value of progress) {\n validateExternalRedirectReady(value)\n return Object.freeze({ ...value })\n }\n throw new TypeError('ExternalRedirect provider completed without announcing redirectUri')\n}\n\nfunction validateScope(scope: PresentationInvocationScope): void {\n if (!record(scope)) throw new TypeError('Presentation invocation scope must be an object')\n nonEmpty(scope.invocationId, 'Presentation invocation scope.invocationId')\n nonEmpty(scope.origin, 'Presentation invocation scope.origin')\n dateTime(scope.deadline, 'Presentation invocation scope.deadline')\n if (typeof scope.nextRequestId !== 'function') throw new TypeError('Presentation invocation scope.nextRequestId must be a function')\n}\n\nfunction nextRequestId(scope: PresentationInvocationScope): string {\n const value = scope.nextRequestId()\n nonEmpty(value, 'Presentation requestId')\n return value\n}\n\nfunction exactRecord(value: unknown, allowed: readonly string[], required: readonly string[], label: string): Record<string, unknown> {\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n const unknown = Object.keys(value).filter(key => !allowed.includes(key))\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)\n for (const key of required) if (!Object.hasOwn(value, key)) throw new TypeError(`${label}.${key} is required`)\n return value\n}\nfunction record(value: unknown): value is Record<string, unknown> { return typeof value === 'object' && value !== null && !Array.isArray(value) }\nfunction nonEmpty(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)\n}\nfunction dateTime(value: unknown, label: string): void {\n if (value !== undefined && (typeof value !== 'string' || Number.isNaN(Date.parse(value)))) throw new TypeError(`${label} must be an RFC 3339 date-time`)\n}\n\nfunction validateLoopbackUri(value: unknown, label: string, requireExplicitPort: boolean): asserts value is string {\n nonEmpty(value, label)\n let uri: URL\n try {\n uri = new URL(value)\n } catch {\n throw new TypeError(`${label} must be an absolute URI`)\n }\n if (uri.protocol !== 'http:') throw new TypeError(`${label} must use HTTP`)\n if (uri.hostname !== '127.0.0.1' && uri.hostname !== '[::1]' && uri.hostname !== 'localhost') {\n throw new TypeError(`${label} must target a loopback host`)\n }\n if (uri.username !== '' || uri.password !== '') throw new TypeError(`${label} must not contain user information`)\n if (uri.hash !== '') throw new TypeError(`${label} must not contain a fragment`)\n if (requireExplicitPort) {\n const authority = value.slice(value.indexOf('//') + 2).split(/[/?#]/u, 1)[0]!\n const match = /^(?:127\\.0\\.0\\.1|localhost):(\\d+)$|^\\[::1\\]:(\\d+)$/iu.exec(authority)\n const port = Number(match?.[1] ?? match?.[2])\n if (!Number.isSafeInteger(port) || port < 1 || port > 65_535) {\n throw new TypeError(`${label} must include an explicit TCP port`)\n }\n }\n}\n"],"mappings":";;AASA,MAAa,yBAAyB;AAyCtC,MAAM,aAAa,UAA8B;CAC/C,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,UAAU,mDAAmD;AAElG;AAEA,MAAa,2BAA2B,yBAAyB;CAC/D,YAAY;CAA6B,MAAM;CAC/C,qBAAqB;CAAW,iBAAiB;AACnD,CAAC;AACD,MAAa,0BAA2C,OAAO,OAAO;CACpE,YAAY;CAA6B,MAAM;AACjD,CAAC;AAED,SAAgB,uBAAuB,QAA0B,OAA4D;CAC3H,cAAc,KAAK;CACnB,OAAO,OAAO,OAAO,EACnB,QAAQ,QAA+B,CAAC,GAAG,SAA6C;EACtF,MAAM,UAAU,OAAO,OAAO;GAC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