@dxos/app-framework 0.8.4-main.ef1bc66f44 → 0.8.4-main.effb148878

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 (436) hide show
  1. package/.storybook/main.mts +1 -3
  2. package/LICENSE +102 -5
  3. package/README.md +1 -1
  4. package/dist/lib/browser/{capability-DU35RXMD.mjs → capability-C4WE22TJ.mjs} +12 -11
  5. package/dist/lib/browser/capability-C4WE22TJ.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-2ZIYRDAF.mjs +95 -0
  7. package/dist/lib/browser/chunk-2ZIYRDAF.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
  9. package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-66IXTIVK.mjs} +3 -2
  11. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-67GCXX5I.mjs +581 -0
  13. package/dist/lib/browser/chunk-67GCXX5I.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  15. package/dist/lib/browser/{chunk-FHQTHCX7.mjs.map → chunk-FJ4765WW.mjs.map} +3 -3
  16. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  17. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-ZQO3UZ4R.mjs → chunk-IW44C7UL.mjs} +10 -4
  19. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-KLHQNYJ2.mjs +422 -0
  21. package/dist/lib/browser/chunk-KLHQNYJ2.mjs.map +7 -0
  22. package/dist/lib/browser/{chunk-EIFGKQSA.mjs → chunk-LPWOVOOB.mjs} +14 -42
  23. package/dist/lib/browser/chunk-LPWOVOOB.mjs.map +7 -0
  24. package/dist/lib/browser/{chunk-4DQMLMGU.mjs → chunk-LUQOVTWB.mjs} +13 -14
  25. package/dist/lib/browser/chunk-LUQOVTWB.mjs.map +7 -0
  26. package/dist/lib/browser/{chunk-KWP6PKIU.mjs → chunk-SLX73WRZ.mjs} +92 -19
  27. package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
  28. package/dist/lib/browser/chunk-SZMB3K2N.mjs +517 -0
  29. package/dist/lib/browser/chunk-SZMB3K2N.mjs.map +7 -0
  30. package/dist/lib/browser/chunk-VJ5PFAWC.mjs +1446 -0
  31. package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
  32. package/dist/lib/browser/cli/index.mjs +17 -32
  33. package/dist/lib/browser/cli/index.mjs.map +3 -3
  34. package/dist/lib/browser/common/activation-events.mjs +11 -14
  35. package/dist/lib/browser/common/capabilities.mjs +19 -8
  36. package/dist/lib/browser/core/activation-event.mjs +1 -1
  37. package/dist/lib/browser/core/capability.mjs +5 -1
  38. package/dist/lib/browser/core/plugin-manager.mjs +8 -4
  39. package/dist/lib/browser/core/plugin.mjs +16 -4
  40. package/dist/lib/browser/core/url-loader.mjs +24 -0
  41. package/dist/lib/browser/index.mjs +47 -49
  42. package/dist/lib/browser/index.mjs.map +4 -4
  43. package/dist/lib/browser/meta.json +1 -1
  44. package/dist/lib/browser/process-manager-capability-3Q4TA73T.mjs +89 -0
  45. package/dist/lib/browser/process-manager-capability-3Q4TA73T.mjs.map +7 -0
  46. package/dist/lib/browser/testing/index.mjs +199 -52
  47. package/dist/lib/browser/testing/index.mjs.map +4 -4
  48. package/dist/lib/browser/testing/react.mjs +78 -0
  49. package/dist/lib/browser/testing/react.mjs.map +7 -0
  50. package/dist/lib/browser/ui/index.mjs +25 -20
  51. package/dist/lib/node-esm/{capability-SR2EIZFP.mjs → capability-GPN6OS6M.mjs} +12 -11
  52. package/dist/lib/node-esm/capability-GPN6OS6M.mjs.map +7 -0
  53. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs → chunk-37Z53PXZ.mjs} +2 -2
  54. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs.map → chunk-37Z53PXZ.mjs.map} +3 -3
  55. package/dist/lib/node-esm/chunk-42UNAKYO.mjs +423 -0
  56. package/dist/lib/node-esm/chunk-42UNAKYO.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-DZ2XLAGI.mjs → chunk-6S45OMUP.mjs} +92 -19
  58. package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-64IMLAS2.mjs → chunk-CTKEZHKF.mjs} +10 -4
  60. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-DHSHRYIB.mjs → chunk-FEVJEUD7.mjs} +14 -42
  62. package/dist/lib/node-esm/chunk-FEVJEUD7.mjs.map +7 -0
  63. package/dist/lib/node-esm/chunk-GBHZF46K.mjs +518 -0
  64. package/dist/lib/node-esm/chunk-GBHZF46K.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-GUE5V5CG.mjs +582 -0
  66. package/dist/lib/node-esm/chunk-GUE5V5CG.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
  68. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
  69. package/dist/lib/node-esm/{chunk-J2PHTRHC.mjs → chunk-MXWDXYV2.mjs} +13 -14
  70. package/dist/lib/node-esm/chunk-MXWDXYV2.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-QBUGLR4H.mjs +96 -0
  72. package/dist/lib/node-esm/chunk-QBUGLR4H.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-SFYCO3PT.mjs +1447 -0
  74. package/dist/lib/node-esm/chunk-SFYCO3PT.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  76. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  77. package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs → chunk-XOCUANHO.mjs} +3 -2
  78. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  79. package/dist/lib/node-esm/cli/index.mjs +17 -32
  80. package/dist/lib/node-esm/cli/index.mjs.map +3 -3
  81. package/dist/lib/node-esm/common/activation-events.mjs +11 -14
  82. package/dist/lib/node-esm/common/capabilities.mjs +19 -8
  83. package/dist/lib/node-esm/core/activation-event.mjs +1 -1
  84. package/dist/lib/node-esm/core/capability.mjs +5 -1
  85. package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
  86. package/dist/lib/node-esm/core/plugin.mjs +16 -4
  87. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  88. package/dist/lib/node-esm/index.mjs +47 -49
  89. package/dist/lib/node-esm/index.mjs.map +4 -4
  90. package/dist/lib/node-esm/meta.json +1 -1
  91. package/dist/lib/node-esm/process-manager-capability-5KCLSNQM.mjs +90 -0
  92. package/dist/lib/node-esm/process-manager-capability-5KCLSNQM.mjs.map +7 -0
  93. package/dist/lib/node-esm/testing/index.mjs +199 -52
  94. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  95. package/dist/lib/node-esm/testing/react.mjs +79 -0
  96. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  97. package/dist/lib/node-esm/ui/index.mjs +25 -20
  98. package/dist/plugin/node-esm/index.mjs +893 -0
  99. package/dist/plugin/node-esm/index.mjs.map +7 -0
  100. package/dist/plugin/node-esm/meta.json +1 -0
  101. package/dist/types/src/cli/cli.d.ts +1 -3
  102. package/dist/types/src/cli/cli.d.ts.map +1 -1
  103. package/dist/types/src/common/activation-events.d.ts +10 -13
  104. package/dist/types/src/common/activation-events.d.ts.map +1 -1
  105. package/dist/types/src/common/annotations.d.ts +1 -0
  106. package/dist/types/src/common/annotations.d.ts.map +1 -0
  107. package/dist/types/src/common/capabilities.d.ts +113 -12
  108. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  109. package/dist/types/src/common/operations.d.ts +8 -22
  110. package/dist/types/src/common/operations.d.ts.map +1 -1
  111. package/dist/types/src/core/activation-event.d.ts +5 -5
  112. package/dist/types/src/core/activation-event.d.ts.map +1 -1
  113. package/dist/types/src/core/capability-manager.d.ts +5 -0
  114. package/dist/types/src/core/capability-manager.d.ts.map +1 -1
  115. package/dist/types/src/core/capability.d.ts +19 -8
  116. package/dist/types/src/core/capability.d.ts.map +1 -1
  117. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  118. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  119. package/dist/types/src/core/index.d.ts +6 -0
  120. package/dist/types/src/core/index.d.ts.map +1 -1
  121. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  122. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  123. package/dist/types/src/core/plugin-manager.d.ts +238 -7
  124. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  125. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  126. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  127. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  128. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  129. package/dist/types/src/core/plugin.d.ts +182 -7
  130. package/dist/types/src/core/plugin.d.ts.map +1 -1
  131. package/dist/types/src/core/registry.d.ts +107 -0
  132. package/dist/types/src/core/registry.d.ts.map +1 -0
  133. package/dist/types/src/core/url-loader.d.ts +127 -0
  134. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  135. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  136. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  137. package/dist/types/src/helpers.d.ts.map +1 -1
  138. package/dist/types/src/index.d.ts +1 -2
  139. package/dist/types/src/index.d.ts.map +1 -1
  140. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
  141. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
  142. package/dist/types/src/plugin-process-manager/history/capability.d.ts +7 -0
  143. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
  144. package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
  145. package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
  146. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.d.ts +1 -1
  147. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
  148. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
  149. package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
  150. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/types.d.ts +1 -1
  151. package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
  152. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.d.ts +1 -1
  153. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
  154. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.d.ts +1 -1
  155. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
  156. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
  157. package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
  158. package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
  159. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
  160. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
  161. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
  162. package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
  163. package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
  164. package/dist/types/src/testing/harness.d.ts +79 -0
  165. package/dist/types/src/testing/harness.d.ts.map +1 -0
  166. package/dist/types/src/testing/index.d.ts +1 -0
  167. package/dist/types/src/testing/index.d.ts.map +1 -1
  168. package/dist/types/src/testing/react.d.ts +27 -0
  169. package/dist/types/src/testing/react.d.ts.map +1 -0
  170. package/dist/types/src/testing/react.test.d.ts +2 -0
  171. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  172. package/dist/types/src/testing/service.d.ts.map +1 -1
  173. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  174. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  175. package/dist/types/src/ui/components/{App.d.ts → App/App.d.ts} +3 -2
  176. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  177. package/dist/types/src/ui/components/{App.stories.d.ts → App/App.stories.d.ts} +6 -1
  178. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  179. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  180. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  181. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
  182. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
  183. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
  184. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
  185. package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
  186. package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
  187. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  188. package/dist/types/src/ui/components/{PluginManagerProvider.d.ts → PluginManager/PluginManagerProvider.d.ts} +1 -1
  189. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  190. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  191. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  192. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
  193. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  194. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  195. package/dist/types/src/ui/components/{surface → Surface}/SurfaceInfo.d.ts.map +1 -1
  196. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  197. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  198. package/dist/types/src/ui/components/{surface → Surface}/context.d.ts.map +1 -1
  199. package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
  200. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  201. package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
  202. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  203. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  204. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  205. package/dist/types/src/ui/components/index.d.ts +3 -3
  206. package/dist/types/src/ui/components/index.d.ts.map +1 -1
  207. package/dist/types/src/ui/hooks/index.d.ts +1 -1
  208. package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
  209. package/dist/types/src/ui/hooks/useApp.d.ts +51 -15
  210. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
  211. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  212. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  213. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
  214. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -1
  215. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +30 -0
  216. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
  217. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -1
  218. package/dist/types/src/ui/hooks/useSurface.d.ts +2 -2
  219. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -1
  220. package/dist/types/src/ui/index.d.ts +0 -1
  221. package/dist/types/src/ui/index.d.ts.map +1 -1
  222. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
  223. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
  224. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  225. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  226. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
  227. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  228. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  229. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  230. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  231. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  232. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  233. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  234. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  235. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  236. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  237. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  238. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  239. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  240. package/dist/types/tsconfig.tsbuildinfo +1 -1
  241. package/moon.yml +16 -4
  242. package/package.json +63 -63
  243. package/src/cli/cli.ts +4 -9
  244. package/src/common/activation-events.ts +12 -17
  245. package/src/common/annotations.ts +3 -0
  246. package/src/common/capabilities.ts +160 -29
  247. package/src/common/operations.ts +8 -10
  248. package/src/context.ts +1 -1
  249. package/src/core/activation-event.ts +5 -2
  250. package/src/core/capability-manager.test.ts +1 -1
  251. package/src/core/capability-manager.ts +22 -1
  252. package/src/core/capability.ts +28 -10
  253. package/src/core/edge-registry-plugin-provider.ts +92 -0
  254. package/src/core/index.ts +6 -0
  255. package/src/core/plugin-asset-cache.ts +60 -0
  256. package/src/core/plugin-manager.test.ts +1085 -31
  257. package/src/core/plugin-manager.ts +1180 -189
  258. package/src/core/plugin-manifest.test.ts +75 -0
  259. package/src/core/plugin-manifest.ts +134 -0
  260. package/src/core/plugin.ts +195 -12
  261. package/src/core/registry.ts +163 -0
  262. package/src/core/url-loader.test.ts +221 -0
  263. package/src/core/url-loader.ts +388 -0
  264. package/src/index.ts +1 -2
  265. package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
  266. package/src/{plugin-operation → plugin-process-manager}/history/capability.ts +1 -2
  267. package/src/plugin-process-manager/history/errors.ts +7 -0
  268. package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.ts +37 -43
  269. package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.ts +1 -2
  270. package/src/{plugin-operation → plugin-process-manager}/history/types.ts +1 -1
  271. package/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.ts +1 -1
  272. package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.ts +3 -4
  273. package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.ts +1 -1
  274. package/src/{plugin-operation → plugin-process-manager}/index.ts +1 -1
  275. package/src/plugin-process-manager/meta.ts +14 -0
  276. package/src/plugin-process-manager/process-manager-capability.ts +178 -0
  277. package/src/{plugin-operation → plugin-process-manager}/testing.ts +26 -45
  278. package/src/testing/harness.ts +247 -0
  279. package/src/testing/index.ts +1 -0
  280. package/src/testing/react.test.tsx +48 -0
  281. package/src/testing/react.tsx +113 -0
  282. package/src/testing/service.ts +4 -4
  283. package/src/testing/withPluginManager.stories.tsx +1 -2
  284. package/src/testing/withPluginManager.tsx +45 -17
  285. package/src/ui/components/App/App.stories.tsx +86 -0
  286. package/src/ui/components/App/App.tsx +81 -0
  287. package/src/{plugin-runtime → ui/components/App}/index.ts +1 -1
  288. package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
  289. package/src/ui/components/Placeholder/Placeholder.tsx +156 -0
  290. package/src/ui/components/Placeholder/index.ts +5 -0
  291. package/src/ui/components/{PluginManagerContext.stories.tsx → PluginManager/PluginManagerContext.stories.tsx} +15 -14
  292. package/src/ui/components/{PluginManagerProvider.ts → PluginManager/PluginManagerProvider.ts} +1 -1
  293. package/src/ui/components/PluginManager/index.ts +5 -0
  294. package/src/ui/components/{surface → Surface}/SurfaceComponent.stories.tsx +25 -23
  295. package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
  296. package/src/ui/components/{surface → Surface}/SurfaceInfo.tsx +1 -2
  297. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  298. package/src/ui/components/Surface/index.ts +54 -0
  299. package/src/ui/components/Surface/types.test.ts +126 -0
  300. package/src/ui/components/Surface/types.ts +269 -0
  301. package/src/ui/components/index.ts +3 -3
  302. package/src/ui/hooks/index.ts +1 -1
  303. package/src/ui/hooks/useApp.test.tsx +159 -0
  304. package/src/ui/hooks/useApp.tsx +236 -33
  305. package/src/ui/hooks/useCapabilities.ts +2 -1
  306. package/src/ui/hooks/useLoading.tsx +14 -6
  307. package/src/ui/hooks/useProcessManagerRuntime.ts +78 -0
  308. package/src/ui/hooks/useSurface.ts +3 -3
  309. package/src/ui/index.ts +0 -1
  310. package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
  311. package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
  312. package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
  313. package/src/vite-plugin/boot-loader/index.ts +5 -0
  314. package/src/vite-plugin/boot-loader/loader.ts +123 -0
  315. package/src/vite-plugin/composer/index.ts +306 -0
  316. package/src/vite-plugin/import-map/index.ts +527 -0
  317. package/src/vite-plugin/index.ts +10 -0
  318. package/src/vite-plugin/manifest.test.ts +46 -0
  319. package/src/vite-plugin/manifest.ts +57 -0
  320. package/src/vite-plugin/packages.ts +187 -0
  321. package/tsconfig.json +28 -1
  322. package/tsconfig.node.json +2 -4
  323. package/typedoc.json +2 -4
  324. package/vitest.config.ts +1 -1
  325. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  326. package/dist/lib/browser/capability-7LE5X2NH.mjs +0 -37
  327. package/dist/lib/browser/capability-7LE5X2NH.mjs.map +0 -7
  328. package/dist/lib/browser/capability-DU35RXMD.mjs.map +0 -7
  329. package/dist/lib/browser/chunk-4DQMLMGU.mjs.map +0 -7
  330. package/dist/lib/browser/chunk-EIFGKQSA.mjs.map +0 -7
  331. package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
  332. package/dist/lib/browser/chunk-IGRQWMWW.mjs +0 -80
  333. package/dist/lib/browser/chunk-IGRQWMWW.mjs.map +0 -7
  334. package/dist/lib/browser/chunk-KWP6PKIU.mjs.map +0 -7
  335. package/dist/lib/browser/chunk-NPUEVX42.mjs +0 -34
  336. package/dist/lib/browser/chunk-NPUEVX42.mjs.map +0 -7
  337. package/dist/lib/browser/chunk-PKQT6C53.mjs.map +0 -7
  338. package/dist/lib/browser/chunk-WGWEEBUV.mjs +0 -807
  339. package/dist/lib/browser/chunk-WGWEEBUV.mjs.map +0 -7
  340. package/dist/lib/browser/chunk-YAFEA4GV.mjs +0 -1
  341. package/dist/lib/browser/chunk-YZQ6NFG4.mjs +0 -781
  342. package/dist/lib/browser/chunk-YZQ6NFG4.mjs.map +0 -7
  343. package/dist/lib/browser/chunk-ZQO3UZ4R.mjs.map +0 -7
  344. package/dist/lib/browser/invoker-capability-7QW56NOM.mjs +0 -36
  345. package/dist/lib/browser/invoker-capability-7QW56NOM.mjs.map +0 -7
  346. package/dist/lib/node-esm/capability-OSVYGK4X.mjs +0 -38
  347. package/dist/lib/node-esm/capability-OSVYGK4X.mjs.map +0 -7
  348. package/dist/lib/node-esm/capability-SR2EIZFP.mjs.map +0 -7
  349. package/dist/lib/node-esm/chunk-64IMLAS2.mjs.map +0 -7
  350. package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +0 -7
  351. package/dist/lib/node-esm/chunk-DHSHRYIB.mjs.map +0 -7
  352. package/dist/lib/node-esm/chunk-DZ2XLAGI.mjs.map +0 -7
  353. package/dist/lib/node-esm/chunk-J2PHTRHC.mjs.map +0 -7
  354. package/dist/lib/node-esm/chunk-JAZVHID3.mjs +0 -35
  355. package/dist/lib/node-esm/chunk-JAZVHID3.mjs.map +0 -7
  356. package/dist/lib/node-esm/chunk-OQYHRZYF.mjs +0 -81
  357. package/dist/lib/node-esm/chunk-OQYHRZYF.mjs.map +0 -7
  358. package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs +0 -782
  359. package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs.map +0 -7
  360. package/dist/lib/node-esm/chunk-XHAKT6UD.mjs +0 -808
  361. package/dist/lib/node-esm/chunk-XHAKT6UD.mjs.map +0 -7
  362. package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +0 -2
  363. package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs +0 -37
  364. package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs.map +0 -7
  365. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +0 -3
  366. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +0 -1
  367. package/dist/types/src/plugin-operation/history/capability.d.ts +0 -7
  368. package/dist/types/src/plugin-operation/history/capability.d.ts.map +0 -1
  369. package/dist/types/src/plugin-operation/history/errors.d.ts +0 -5
  370. package/dist/types/src/plugin-operation/history/errors.d.ts.map +0 -1
  371. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +0 -1
  372. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +0 -1
  373. package/dist/types/src/plugin-operation/history/index.d.ts.map +0 -1
  374. package/dist/types/src/plugin-operation/history/types.d.ts.map +0 -1
  375. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +0 -1
  376. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +0 -1
  377. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +0 -1
  378. package/dist/types/src/plugin-operation/index.d.ts +0 -3
  379. package/dist/types/src/plugin-operation/index.d.ts.map +0 -1
  380. package/dist/types/src/plugin-operation/invoker-capability.d.ts +0 -6
  381. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +0 -1
  382. package/dist/types/src/plugin-operation/meta.d.ts.map +0 -1
  383. package/dist/types/src/plugin-operation/testing.d.ts +0 -109
  384. package/dist/types/src/plugin-operation/testing.d.ts.map +0 -1
  385. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +0 -3
  386. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +0 -1
  387. package/dist/types/src/plugin-runtime/capability.d.ts +0 -6
  388. package/dist/types/src/plugin-runtime/capability.d.ts.map +0 -1
  389. package/dist/types/src/plugin-runtime/index.d.ts +0 -2
  390. package/dist/types/src/plugin-runtime/index.d.ts.map +0 -1
  391. package/dist/types/src/plugin-runtime/meta.d.ts +0 -3
  392. package/dist/types/src/plugin-runtime/meta.d.ts.map +0 -1
  393. package/dist/types/src/ui/components/App.d.ts.map +0 -1
  394. package/dist/types/src/ui/components/App.stories.d.ts.map +0 -1
  395. package/dist/types/src/ui/components/DefaultFallback.d.ts +0 -8
  396. package/dist/types/src/ui/components/DefaultFallback.d.ts.map +0 -1
  397. package/dist/types/src/ui/components/ErrorBoundary.d.ts +0 -30
  398. package/dist/types/src/ui/components/ErrorBoundary.d.ts.map +0 -1
  399. package/dist/types/src/ui/components/PluginManagerContext.stories.d.ts.map +0 -1
  400. package/dist/types/src/ui/components/PluginManagerProvider.d.ts.map +0 -1
  401. package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts +0 -12
  402. package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts.map +0 -1
  403. package/dist/types/src/ui/components/surface/SurfaceComponent.stories.d.ts.map +0 -1
  404. package/dist/types/src/ui/components/surface/index.d.ts +0 -5
  405. package/dist/types/src/ui/components/surface/index.d.ts.map +0 -1
  406. package/dist/types/src/ui/components/surface/types.d.ts +0 -94
  407. package/dist/types/src/ui/components/surface/types.d.ts.map +0 -1
  408. package/dist/types/src/ui/hooks/useOperationResolver.d.ts +0 -19
  409. package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +0 -1
  410. package/src/plugin-operation/OperationPlugin.ts +0 -25
  411. package/src/plugin-operation/history/errors.ts +0 -11
  412. package/src/plugin-operation/invoker-capability.ts +0 -40
  413. package/src/plugin-operation/meta.ts +0 -11
  414. package/src/plugin-runtime/RuntimePlugin.ts +0 -20
  415. package/src/plugin-runtime/capability.ts +0 -53
  416. package/src/plugin-runtime/meta.ts +0 -11
  417. package/src/ui/components/App.stories.tsx +0 -62
  418. package/src/ui/components/App.tsx +0 -57
  419. package/src/ui/components/DefaultFallback.tsx +0 -26
  420. package/src/ui/components/ErrorBoundary.tsx +0 -56
  421. package/src/ui/components/surface/SurfaceComponent.tsx +0 -262
  422. package/src/ui/components/surface/index.ts +0 -8
  423. package/src/ui/components/surface/types.ts +0 -119
  424. package/src/ui/hooks/useOperationResolver.ts +0 -40
  425. /package/dist/lib/browser/{chunk-YAFEA4GV.mjs.map → core/url-loader.mjs.map} +0 -0
  426. /package/dist/lib/node-esm/{chunk-Z4TJPSMP.mjs.map → core/url-loader.mjs.map} +0 -0
  427. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.d.ts +0 -0
  428. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/index.d.ts +0 -0
  429. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.d.ts +0 -0
  430. /package/dist/types/src/{plugin-operation → plugin-process-manager}/meta.d.ts +0 -0
  431. /package/dist/types/src/ui/components/{PluginManagerContext.stories.d.ts → PluginManager/PluginManagerContext.stories.d.ts} +0 -0
  432. /package/dist/types/src/ui/components/{surface → Surface}/SurfaceComponent.stories.d.ts +0 -0
  433. /package/dist/types/src/ui/components/{surface → Surface}/SurfaceInfo.d.ts +0 -0
  434. /package/dist/types/src/ui/components/{surface → Surface}/context.d.ts +0 -0
  435. /package/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
  436. /package/src/ui/components/{surface → Surface}/context.ts +0 -0
@@ -4,13 +4,12 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Operation } from '@dxos/operation';
7
+ import { Operation } from '@dxos/compute';
8
8
 
9
9
  import { Capability } from '../core';
10
-
11
10
  import { Label } from './translations';
12
11
 
13
- const UNDO_NAMESPACE = 'dxos.org/app-framework/undo';
12
+ const UNDO_NAMESPACE = 'org.dxos.app-framework.undo';
14
13
 
15
14
  /**
16
15
  * Operations related to undo/history functionality.
@@ -22,17 +21,16 @@ export namespace UndoOperation {
22
21
  */
23
22
  export const ShowUndo = Operation.make({
24
23
  meta: {
25
- key: `${UNDO_NAMESPACE}/operation/show-undo`,
24
+ key: `${UNDO_NAMESPACE}.operation.show-undo`,
26
25
  name: 'Show Undo',
27
26
  description: 'Show an undo toast notification.',
27
+ icon: 'ph--arrow-counter-clockwise--regular',
28
28
  },
29
29
  executionMode: 'sync',
30
30
  services: [Capability.Service],
31
- schema: {
32
- input: Schema.Struct({
33
- message: Schema.optional(Label.annotations({ description: 'The message to display in the undo toast.' })),
34
- }),
35
- output: Schema.Void,
36
- },
31
+ input: Schema.Struct({
32
+ message: Schema.optional(Label.annotations({ description: 'The message to display in the undo toast.' })),
33
+ }),
34
+ output: Schema.Void,
37
35
  });
38
36
  }
package/src/context.ts CHANGED
@@ -6,4 +6,4 @@ import { createContext } from '@dxos/web-context';
6
6
 
7
7
  import { type PluginManager } from './core';
8
8
 
9
- export const PluginManagerContext = createContext<PluginManager.PluginManager>('dxos.org/app-framework/plugin-manager');
9
+ export const PluginManagerContext = createContext<PluginManager.PluginManager>('org.dxos.app-framework.plugin-manager');
@@ -2,11 +2,13 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { compositeKey } from '@dxos/util';
6
+
5
7
  /**
6
8
  * A unique string identifier representing an event.
7
9
  * This is expected to be a URI, where initial parts are often the id of the plugin whose package defines the event.
8
10
  *
9
- * @example dxos.org/plugin/example/event/ready
11
+ * @example org.dxos.plugin.example.event.ready
10
12
  */
11
13
  export type ActivationEvent = {
12
14
  id: string;
@@ -31,7 +33,8 @@ export const make = (id: string, specifier?: string) => {
31
33
  /**
32
34
  * Helper to create an activation event key.
33
35
  */
34
- export const eventKey = (event: ActivationEvent) => (event.specifier ? `${event.id}:${event.specifier}` : event.id);
36
+ export const eventKey = (event: ActivationEvent) =>
37
+ event.specifier ? compositeKey(event.id, event.specifier) : event.id;
35
38
 
36
39
  /**
37
40
  * Helper to create an activation event that triggers when any of the given events are activated.
@@ -2,8 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { describe, expect, it, onTestFinished } from '@effect/vitest';
6
5
  import { Registry } from '@effect-atom/atom-react';
6
+ import { describe, expect, it, onTestFinished } from '@effect/vitest';
7
7
  import * as Effect from 'effect/Effect';
8
8
 
9
9
  import * as Capability from './capability';
@@ -59,6 +59,12 @@ export interface CapabilityManager {
59
59
  * @returns The capability.
60
60
  */
61
61
  waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error>;
62
+
63
+ /**
64
+ * Get capabilities grouped by the module that contributed them.
65
+ * @returns An atom containing a record from module ID to capability implementations.
66
+ */
67
+ atomByModule<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<Record<string, T[]>>;
62
68
  }
63
69
 
64
70
  /**
@@ -75,7 +81,18 @@ class CapabilityManagerImpl implements CapabilityManager {
75
81
  return Atom.make((get) => {
76
82
  const current = get(this._capabilityEntries(id));
77
83
  return current.map((c) => c.implementation);
78
- });
84
+ }).pipe(Atom.keepAlive);
85
+ });
86
+
87
+ readonly _capabilitiesByModule = Atom.family<string, Atom.Atom<Record<string, unknown[]>>>((id: string) => {
88
+ return Atom.make((get) => {
89
+ const entries = get(this._capabilityEntries(id));
90
+ const result: Record<string, unknown[]> = {};
91
+ for (const entry of entries) {
92
+ (result[entry.moduleId] ??= []).push(entry.implementation);
93
+ }
94
+ return result;
95
+ }).pipe(Atom.keepAlive);
79
96
  });
80
97
 
81
98
  readonly _capability = Atom.family<string, Atom.Atom<unknown>>((id: string) => {
@@ -163,6 +180,10 @@ class CapabilityManagerImpl implements CapabilityManager {
163
180
  return result;
164
181
  });
165
182
  }
183
+
184
+ atomByModule<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<Record<string, T[]>> {
185
+ return this._capabilitiesByModule(interfaceDef.identifier) as Atom.Atom<Record<string, T[]>>;
186
+ }
166
187
  }
167
188
 
168
189
  /**
@@ -5,6 +5,7 @@
5
5
  import { type Atom } from '@effect-atom/atom-react';
6
6
  import * as Context from 'effect/Context';
7
7
  import * as Effect from 'effect/Effect';
8
+ import * as Layer from 'effect/Layer';
8
9
 
9
10
  import type * as CapabilityManager from './capability-manager';
10
11
  import type * as Plugin from './plugin';
@@ -62,6 +63,22 @@ export const waitFor = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Erro
62
63
  export const atom = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<Atom.Atom<T[]>, never, Service> =>
63
64
  Effect.map(Service, (manager) => manager.atom(interfaceDef));
64
65
 
66
+ /**
67
+ * Get capabilities grouped by the module that contributed them.
68
+ * @param interfaceDef The interface definition of the capability.
69
+ * @returns An Atom containing a record from module ID to capability implementations.
70
+ */
71
+ export const atomByModule = <T>(
72
+ interfaceDef: InterfaceDef<T>,
73
+ ): Effect.Effect<Atom.Atom<Record<string, T[]>>, never, Service> =>
74
+ Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));
75
+
76
+ /**
77
+ * Constructs a layer that will request its interface implementation from the capability manager.
78
+ */
79
+ export const asLayer = <T, I>(interfaceDef: InterfaceDef<T>, tag: Context.Tag<I, T>): Layer.Layer<I, never, Service> =>
80
+ Layer.effect(tag, get(interfaceDef).pipe(Effect.orDie));
81
+
65
82
  const InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');
66
83
 
67
84
  /**
@@ -120,6 +137,7 @@ export type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]]
120
137
  /**
121
138
  * Helper to define the implementation of a capability.
122
139
  */
140
+ // TODO(dmaretskyi): Make the return type non-generic so capabilities are non-discernable.
123
141
  export const contributes = <I extends InterfaceDef<any>>(
124
142
  interfaceDef: I,
125
143
  implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],
@@ -133,10 +151,10 @@ export const contributes = <I extends InterfaceDef<any>>(
133
151
  };
134
152
 
135
153
  type LoadCapability<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{
136
- default: (props?: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;
154
+ default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;
137
155
  }>;
138
156
  type LoadCapabilities<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{
139
- default: (props?: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;
157
+ default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;
140
158
  }>;
141
159
 
142
160
  type NormalizeReturn<R> = R extends readonly (infer A)[]
@@ -148,7 +166,7 @@ type NormalizeReturn<R> = R extends readonly (infer A)[]
148
166
  : Any[];
149
167
 
150
168
  export type LazyCapability<Props = void, Capabilities extends ModuleReturn = ModuleReturn, E extends Error = Error> = (
151
- props?: Props,
169
+ props: Props,
152
170
  ) => Effect.Effect<NormalizeReturn<Capabilities>, E, Service | Plugin.Service | never>;
153
171
 
154
172
  /**
@@ -162,9 +180,9 @@ export const lazy = <T = void, R extends ModuleReturn = ModuleReturn>(
162
180
  name: string,
163
181
  c: LoadCapability<T, R> | LoadCapabilities<T, R>,
164
182
  ): LazyCapability<T, R> => {
165
- const lazyFn: LazyCapability<T, R> = (props?: T) =>
183
+ const lazyFn: LazyCapability<T, R> = (props: T) =>
166
184
  Effect.gen(function* () {
167
- const { default: getCapability } = yield* Effect.tryPromise(() => c());
185
+ const { default: getCapability } = yield* Effect.promise(() => c());
168
186
  const result = yield* getCapability(props);
169
187
  const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [result];
170
188
  return normalized as NormalizeReturn<R>;
@@ -217,11 +235,11 @@ export const getModuleTag = (capability: unknown): string | undefined => {
217
235
  * })
218
236
  * );
219
237
  *
220
- * // Module with additional options (context accessed via layer)
238
+ * // Module with required options (context accessed via layer)
221
239
  * export default Capability.makeModule(
222
- * Effect.fnUntraced(function* ({ observability }: { observability?: boolean }) {
240
+ * Effect.fnUntraced(function* (props: { observability: boolean }) {
223
241
  * const invoker = yield* Capability.get(Capabilities.OperationInvoker);
224
- * return contributes(Capabilities.IntentResolver, ...);
242
+ * return contributes(Capabilities.OperationHandler, ...);
225
243
  * })
226
244
  * );
227
245
  * ```
@@ -232,5 +250,5 @@ export const makeModule = <
232
250
  E extends Error = Error,
233
251
  R extends Service | Plugin.Service | never = Service,
234
252
  >(
235
- fn: (props?: TProps) => Effect.Effect<TReturn, E, R>,
236
- ): ((props?: TProps) => Effect.Effect<TReturn, E, R>) => fn;
253
+ fn: (props: TProps) => Effect.Effect<TReturn, E, R>,
254
+ ): ((props: TProps) => Effect.Effect<TReturn, E, R>) => fn;
@@ -0,0 +1,92 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Context } from '@dxos/context';
8
+ import { type EdgeHttpClient } from '@dxos/edge-client';
9
+ import { type PluginEntry } from '@dxos/protocols';
10
+
11
+ import * as Registry from './registry';
12
+
13
+ /**
14
+ * Maps a wire-format `PluginEntry` (from `@dxos/protocols`) to a
15
+ * `Registry.Plugin` (the app-framework domain type).
16
+ *
17
+ * This is the only translation seam between the two independently-defined type
18
+ * hierarchies — fields are mapped explicitly, with no shared type between them.
19
+ */
20
+ const toRegistryPlugin = (entry: PluginEntry): Registry.Plugin => ({
21
+ id: entry.meta.id,
22
+ name: entry.meta.name,
23
+ description: entry.meta.description,
24
+ homePage: entry.meta.homePage,
25
+ source: entry.meta.source,
26
+ screenshots: entry.meta.screenshots ? [...entry.meta.screenshots] : undefined,
27
+ tags: entry.meta.tags ? [...entry.meta.tags] : undefined,
28
+ icon: entry.meta.icon,
29
+ iconHue: entry.meta.iconHue,
30
+ moduleUrl: entry.moduleUrl,
31
+ repo: entry.repo,
32
+ version: entry.releaseTag,
33
+ });
34
+
35
+ /**
36
+ * Implements `Registry.PluginProvider` against the Edge `/registry` HTTP endpoints.
37
+ *
38
+ * Lives in app-framework (rather than the more obvious home of `@dxos/edge-client`)
39
+ * because edge-client doesn't depend on app-framework; siting the implementation
40
+ * here keeps the dependency arrow `app-framework → edge-client` and avoids a
41
+ * cycle. The class needs only the public `EdgeHttpClient` type, so a one-way
42
+ * type-import is enough.
43
+ *
44
+ * `listVersions` is currently a stub: it returns the single latest version derived
45
+ * from the cached plugin list, so the host's version picker has something to render.
46
+ * The wire contract for the real endpoint already exists — see
47
+ * `GetPluginVersionsResponseBodySchema` in `@dxos/protocols/edge/registry` and
48
+ * {@link EdgeHttpClient.getRegistryPluginVersions} — so once Edge ships
49
+ * `GET /registry/plugins/:repo/versions`, swap this stub for a call to
50
+ * `this._client.getRegistryPluginVersions(...)` and map each entry through a
51
+ * `toRegistryPluginVersion` helper (mirror of {@link toRegistryPlugin}).
52
+ */
53
+ export class EdgeRegistryPluginProvider implements Registry.PluginProvider {
54
+ // Cached on first load so getPlugin/listVersions can resolve without re-fetching.
55
+ #cachedPlugins: readonly Registry.Plugin[] = [];
56
+
57
+ constructor(private readonly _client: EdgeHttpClient) {}
58
+
59
+ listPlugins(): Effect.Effect<readonly Registry.Plugin[], Error> {
60
+ return Effect.tryPromise({
61
+ try: () => this._client.getRegistryPlugins(Context.default()),
62
+ catch: (error) => (error instanceof Error ? error : new Error(String(error))),
63
+ }).pipe(
64
+ Effect.map((body) => {
65
+ const plugins = body.plugins.filter((entry) => entry.health === 'ok').map(toRegistryPlugin);
66
+ this.#cachedPlugins = plugins;
67
+ return plugins;
68
+ }),
69
+ );
70
+ }
71
+
72
+ listVersions(repo: string): Effect.Effect<readonly Registry.PluginVersion[], Error> {
73
+ // Stub: return only the currently-known version until Edge implements the versions endpoint.
74
+ const plugin = this.#cachedPlugins.find((candidate) => candidate.repo === repo);
75
+ if (!plugin) {
76
+ return Effect.fail(new Error(`Plugin not found in catalog: ${repo}`));
77
+ }
78
+ const version: Registry.PluginVersion = { tag: plugin.version, moduleUrl: plugin.moduleUrl };
79
+ return Effect.succeed([version]);
80
+ }
81
+
82
+ getPlugin(repo: string, version?: string): Effect.Effect<Registry.Plugin, Error> {
83
+ const plugin = this.#cachedPlugins.find((p) => p.repo === repo);
84
+ if (!plugin) {
85
+ return Effect.fail(new Error(`Plugin not found in catalog: ${repo}`));
86
+ }
87
+ if (version && version !== plugin.version) {
88
+ return Effect.fail(new Error(`Version ${version} not available for ${repo}; only ${plugin.version} is cached`));
89
+ }
90
+ return Effect.succeed(plugin);
91
+ }
92
+ }
package/src/core/index.ts CHANGED
@@ -6,4 +6,10 @@ export * as ActivationEvent from './activation-event';
6
6
  export * as Capability from './capability';
7
7
  export * as CapabilityManager from './capability-manager';
8
8
  export * as Plugin from './plugin';
9
+ export * as PluginAssetCache from './plugin-asset-cache';
9
10
  export * as PluginManager from './plugin-manager';
11
+ export * as PluginManifest from './plugin-manifest';
12
+ export { PLUGIN_DEV_SERVER_PORT } from './plugin-manifest';
13
+ export * as Registry from './registry';
14
+ export { EdgeRegistryPluginProvider } from './edge-registry-plugin-provider';
15
+ export * as UrlLoader from './url-loader';
@@ -0,0 +1,60 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { BaseError } from '@dxos/errors';
8
+
9
+ /**
10
+ * Tagged error for cache operations. Construction sites supply `context.operation`
11
+ * (one of `'cache' | 'evict' | 'resolve' | 'list'`) and `context.pluginId` so
12
+ * downstream handlers can route on the failed call without scanning the message.
13
+ */
14
+ export class PluginAssetCacheError extends BaseError.extend(
15
+ 'PluginAssetCacheError',
16
+ 'Plugin asset cache operation failed',
17
+ ) {}
18
+
19
+ /**
20
+ * Per-platform offline cache for third-party plugin assets.
21
+ *
22
+ * Implementations live alongside their platform glue (composer-app's
23
+ * `asset-cache/{tauri,service-worker}.ts`); the no-op default is for tests
24
+ * and unsupported environments.
25
+ */
26
+ export interface Cache {
27
+ /**
28
+ * Persist all listed URLs under the namespace of `pluginId`. Idempotent.
29
+ * The order of `urls` is significant — the first entry is treated as the entry module.
30
+ */
31
+ cache(pluginId: string, urls: readonly string[]): Effect.Effect<void, PluginAssetCacheError>;
32
+
33
+ /**
34
+ * Drop all assets for a plugin (uninstall).
35
+ */
36
+ evict(pluginId: string): Effect.Effect<void, PluginAssetCacheError>;
37
+
38
+ /**
39
+ * Resolves a plugin asset URL to a platform-specific cached URL when one is available.
40
+ * Returns the original URL when no cached copy exists or the platform serves cached
41
+ * responses transparently (e.g. service worker fetch interception on web).
42
+ */
43
+ resolve(pluginId: string, url: string): Effect.Effect<string, PluginAssetCacheError>;
44
+
45
+ /**
46
+ * List currently cached plugin ids (diagnostic).
47
+ */
48
+ list(): Effect.Effect<readonly string[], PluginAssetCacheError>;
49
+ }
50
+
51
+ /**
52
+ * No-op implementation. Used when no platform cache is registered (tests, unsupported environments).
53
+ * Plugins still load — they just have no offline guarantee.
54
+ */
55
+ export const noop = (): Cache => ({
56
+ cache: () => Effect.void,
57
+ evict: () => Effect.void,
58
+ resolve: (_pluginId, url) => Effect.succeed(url),
59
+ list: () => Effect.succeed([] as readonly string[]),
60
+ });