@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
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/testing/react.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport { render as rtlRender, type RenderOptions, type RenderResult } from '@testing-library/react';\nimport React, { type FC, Fragment, type PropsWithChildren, type ReactNode } from 'react';\n\nimport { ContextProtocolProvider } from '@dxos/web-context-react';\n\nimport { Capabilities } from '../common';\nimport { PluginManagerContext } from '../context';\nimport { topologicalSort } from '../helpers';\nimport { PluginManagerProvider } from '../ui/components/PluginManager/PluginManagerProvider';\nimport { SurfaceComponent } from '../ui/components/Surface/SurfaceComponent';\nimport { type TestHarness } from './harness';\n\nexport type HarnessRenderOptions = Omit<RenderOptions, 'wrapper'> & {\n /** Additional providers to wrap around the harness tree (applied innermost first). */\n reactContexts?: FC<PropsWithChildren>[];\n};\n\n/**\n * Renders `ui` wrapped in the same provider tree as `useApp` plus every contributed\n * `Capabilities.ReactContext`.\n */\nexport const render = (harness: TestHarness, ui: ReactNode, options?: HarnessRenderOptions): RenderResult => {\n const { reactContexts = [], ...rest } = options ?? {};\n const Wrapper = ({ children }: PropsWithChildren) => (\n <HarnessProviders harness={harness} extra={reactContexts}>\n {children}\n </HarnessProviders>\n );\n return rtlRender(<>{ui}</>, { ...rest, wrapper: Wrapper });\n};\n\nexport type RenderSurfaceProps = {\n role: string;\n data?: unknown;\n limit?: number;\n fallback?: FC<{ error: Error; data?: any }>;\n placeholder?: ReactNode;\n};\n\n/**\n * Renders a `Surface` with the given role/data inside the harness provider tree.\n */\nexport const renderSurface = (\n harness: TestHarness,\n props: RenderSurfaceProps,\n options?: HarnessRenderOptions,\n): RenderResult => {\n const { role, data, limit, fallback, placeholder } = props;\n return render(\n harness,\n <SurfaceComponent role={role} data={data as any} limit={limit} fallback={fallback} placeholder={placeholder} />,\n options,\n );\n};\n\ntype HarnessProvidersProps = PropsWithChildren<{\n harness: TestHarness;\n extra: FC<PropsWithChildren>[];\n}>;\n\nconst HarnessProviders = ({ harness, extra, children }: HarnessProvidersProps) => {\n const contributed = harness.getAll(Capabilities.ReactContext);\n const ContributedContext = composeContexts(contributed);\n const ExtraContext = composeExtra(extra);\n return (\n <PluginManagerProvider value={harness.manager}>\n <ContextProtocolProvider value={harness.manager} context={PluginManagerContext}>\n <RegistryContext.Provider value={harness.registry}>\n <ContributedContext>\n <ExtraContext>{children}</ExtraContext>\n </ContributedContext>\n </RegistryContext.Provider>\n </ContextProtocolProvider>\n </PluginManagerProvider>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]): FC<PropsWithChildren> => {\n if (contexts.length === 0) {\n return Passthrough;\n }\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }: PropsWithChildren) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n\n// Composes in innermost-first order: the first context in the array wraps\n// `children` directly; subsequent contexts wrap the accumulator.\nconst composeExtra = (contexts: FC<PropsWithChildren>[]): FC<PropsWithChildren> => {\n if (contexts.length === 0) {\n return Passthrough;\n }\n return contexts.reduce<FC<PropsWithChildren>>(\n (Acc, Next) =>\n ({ children }: PropsWithChildren) => (\n <Next>\n <Acc>{children}</Acc>\n </Next>\n ),\n Passthrough,\n );\n};\n\nconst Passthrough: FC<PropsWithChildren> = ({ children }) => <Fragment>{children}</Fragment>;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,uBAAuB;AAChC,SAASC,UAAUC,iBAAwD;AAC3E,OAAOC,SAAkBC,gBAAwD;AAEjF,SAASC,+BAA+B;AAkBjC,IAAMC,SAAS,CAACC,SAAsBC,IAAeC,YAAAA;AAC1D,QAAM,EAAEC,gBAAgB,CAAA,GAAI,GAAGC,KAAAA,IAASF,WAAW,CAAC;AACpD,QAAMG,UAAU,CAAC,EAAEC,SAAQ,MACzB,sBAAA,cAACC,kBAAAA;IAAiBP;IAAkBQ,OAAOL;KACxCG,QAAAA;AAGL,SAAOG,UAAU,sBAAA,cAAA,MAAA,UAAA,MAAGR,EAAAA,GAAQ;IAAE,GAAGG;IAAMM,SAASL;EAAQ,CAAA;AAC1D;AAaO,IAAMM,gBAAgB,CAC3BX,SACAY,OACAV,YAAAA;AAEA,QAAM,EAAEW,MAAMC,MAAMC,OAAOC,UAAUC,YAAW,IAAKL;AACrD,SAAOb,OACLC,SACA,sBAAA,cAACkB,kBAAAA;IAAiBL;IAAYC;IAAmBC;IAAcC;IAAoBC;MACnFf,OAAAA;AAEJ;AAOA,IAAMK,mBAAmB,CAAC,EAAEP,SAASQ,OAAOF,SAAQ,MAAyB;AAC3E,QAAMa,cAAcnB,QAAQoB,OAAOC,qBAAaC,YAAY;AAC5D,QAAMC,qBAAqBC,gBAAgBL,WAAAA;AAC3C,QAAMM,eAAeC,aAAalB,KAAAA;AAClC,SACE,sBAAA,cAACmB,uBAAAA;IAAsBC,OAAO5B,QAAQ6B;KACpC,sBAAA,cAACC,yBAAAA;IAAwBF,OAAO5B,QAAQ6B;IAASE,SAASC;KACxD,sBAAA,cAACC,gBAAgBC,UAAQ;IAACN,OAAO5B,QAAQmC;KACvC,sBAAA,cAACZ,oBAAAA,MACC,sBAAA,cAACE,cAAAA,MAAcnB,QAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAM3B;AAEA,IAAMkB,kBAAkB,CAACY,aAAAA;AACvB,MAAIA,SAASC,WAAW,GAAG;AACzB,WAAOC;EACT;AACA,SAAOC,gBAAgBH,QAAAA,EACpBI,IAAI,CAAC,EAAET,QAAO,MAAOA,OAAAA,EACrBU,OAAO,CAACC,KAAKC,SAAS,CAAC,EAAErC,SAAQ,MAChC,sBAAA,cAACoC,KAAAA,MACC,sBAAA,cAACC,MAAAA,MAAMrC,QAAAA,CAAAA,CAAAA;AAGf;AAIA,IAAMoB,eAAe,CAACU,aAAAA;AACpB,MAAIA,SAASC,WAAW,GAAG;AACzB,WAAOC;EACT;AACA,SAAOF,SAASK,OACd,CAACC,KAAKC,SACJ,CAAC,EAAErC,SAAQ,MACT,sBAAA,cAACqC,MAAAA,MACC,sBAAA,cAACD,KAAAA,MAAKpC,QAAAA,CAAAA,GAGZgC,WAAAA;AAEJ;AAEA,IAAMA,cAAqC,CAAC,EAAEhC,SAAQ,MAAO,sBAAA,cAACsC,UAAAA,MAAUtC,QAAAA;",
6
+ "names": ["RegistryContext", "render", "rtlRender", "React", "Fragment", "ContextProtocolProvider", "render", "harness", "ui", "options", "reactContexts", "rest", "Wrapper", "children", "HarnessProviders", "extra", "rtlRender", "wrapper", "renderSurface", "props", "role", "data", "limit", "fallback", "placeholder", "SurfaceComponent", "contributed", "getAll", "Capabilities", "ReactContext", "ContributedContext", "composeContexts", "ExtraContext", "composeExtra", "PluginManagerProvider", "value", "manager", "ContextProtocolProvider", "context", "PluginManagerContext", "RegistryContext", "Provider", "registry", "contexts", "length", "Passthrough", "topologicalSort", "map", "reduce", "Acc", "Next", "Fragment"]
7
+ }
@@ -1,10 +1,7 @@
1
1
  import {
2
2
  App,
3
- DefaultFallback,
4
- ErrorBoundary,
5
3
  LoadingState,
6
- PluginManagerProvider,
7
- surface_exports,
4
+ Placeholder,
8
5
  useApp,
9
6
  useAtomCapability,
10
7
  useAtomCapabilityState,
@@ -12,28 +9,34 @@ import {
12
9
  useCapability,
13
10
  useLoading,
14
11
  useOperationInvoker,
15
- useOperationResolver,
16
- usePluginManager,
12
+ useProcessManagerRuntime,
17
13
  useSettingsState,
14
+ useSpaceCallback,
15
+ useSpaceService
16
+ } from "../chunk-SZMB3K2N.mjs";
17
+ import {
18
+ PluginManagerProvider,
19
+ Surface,
20
+ usePluginManager,
18
21
  useSurface
19
- } from "../chunk-YZQ6NFG4.mjs";
20
- import "../chunk-FHQTHCX7.mjs";
21
- import "../chunk-4DQMLMGU.mjs";
22
- import "../chunk-IGRQWMWW.mjs";
23
- import "../chunk-NPUEVX42.mjs";
24
- import "../chunk-YAFEA4GV.mjs";
25
- import "../chunk-WGWEEBUV.mjs";
26
- import "../chunk-PKQT6C53.mjs";
27
- import "../chunk-KWP6PKIU.mjs";
28
- import "../chunk-ZQO3UZ4R.mjs";
22
+ } from "../chunk-67GCXX5I.mjs";
23
+ import "../chunk-FJ4765WW.mjs";
24
+ import "../chunk-LUQOVTWB.mjs";
25
+ import "../chunk-2ZIYRDAF.mjs";
26
+ import "../chunk-5GY3YOEL.mjs";
27
+ import "../chunk-FO3IYSLV.mjs";
28
+ import "../chunk-KLHQNYJ2.mjs";
29
+ import "../chunk-VJ5PFAWC.mjs";
30
+ import "../chunk-66IXTIVK.mjs";
31
+ import "../chunk-SLX73WRZ.mjs";
32
+ import "../chunk-IW44C7UL.mjs";
29
33
  import "../chunk-J5LGTIGS.mjs";
30
34
  export {
31
35
  App,
32
- DefaultFallback,
33
- ErrorBoundary,
34
36
  LoadingState,
37
+ Placeholder,
35
38
  PluginManagerProvider,
36
- surface_exports as Surface,
39
+ Surface,
37
40
  useApp,
38
41
  useAtomCapability,
39
42
  useAtomCapabilityState,
@@ -41,9 +44,11 @@ export {
41
44
  useCapability,
42
45
  useLoading,
43
46
  useOperationInvoker,
44
- useOperationResolver,
45
47
  usePluginManager,
48
+ useProcessManagerRuntime,
46
49
  useSettingsState,
50
+ useSpaceCallback,
51
+ useSpaceService,
47
52
  useSurface
48
53
  };
49
54
  //# sourceMappingURL=index.mjs.map
@@ -2,22 +2,23 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  make,
4
4
  make2
5
- } from "./chunk-DHSHRYIB.mjs";
6
- import "./chunk-J2PHTRHC.mjs";
5
+ } from "./chunk-FEVJEUD7.mjs";
6
+ import "./chunk-MXWDXYV2.mjs";
7
7
  import {
8
8
  capabilities_exports
9
- } from "./chunk-OQYHRZYF.mjs";
10
- import "./chunk-JAZVHID3.mjs";
11
- import "./chunk-Z4TJPSMP.mjs";
12
- import "./chunk-XHAKT6UD.mjs";
13
- import "./chunk-7OWSHPYK.mjs";
14
- import "./chunk-DZ2XLAGI.mjs";
9
+ } from "./chunk-QBUGLR4H.mjs";
10
+ import "./chunk-KFZEB6BV.mjs";
11
+ import "./chunk-WK7OIQKI.mjs";
12
+ import "./chunk-42UNAKYO.mjs";
13
+ import "./chunk-SFYCO3PT.mjs";
14
+ import "./chunk-XOCUANHO.mjs";
15
+ import "./chunk-6S45OMUP.mjs";
15
16
  import {
16
17
  capability_exports
17
- } from "./chunk-64IMLAS2.mjs";
18
+ } from "./chunk-CTKEZHKF.mjs";
18
19
  import "./chunk-HSLMI22Q.mjs";
19
20
 
20
- // src/plugin-operation/history/capability.ts
21
+ // src/plugin-process-manager/history/capability.ts
21
22
  import * as Effect from "effect/Effect";
22
23
  var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
23
24
  const capabilities = yield* capability_exports.Service;
@@ -32,4 +33,4 @@ var capability_default = capability_exports.makeModule(Effect.fnUntraced(functio
32
33
  export {
33
34
  capability_default as default
34
35
  };
35
- //# sourceMappingURL=capability-SR2EIZFP.mjs.map
36
+ //# sourceMappingURL=capability-GPN6OS6M.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugin-process-manager/history/capability.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationInvoker } from '@dxos/operation';\n\nimport { Capabilities } from '../../common';\nimport { Capability } from '../../core';\nimport * as HistoryTracker from './history-tracker';\nimport * as UndoRegistry from './undo-registry';\n\n//\n// Capability Module - contributes both UndoRegistry and HistoryTracker.\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the context for synchronous access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // Create UndoRegistry.\n const undoRegistry = UndoRegistry.make(() => capabilities.getAll(Capabilities.UndoMapping).flat());\n\n // Create HistoryTracker (depends on UndoRegistry and OperationInvoker).\n const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n // Cast to internal type - the factory always returns OperationInvokerInternal.\n const historyTracker = HistoryTracker.make(invoker as OperationInvoker.OperationInvokerInternal, undoRegistry);\n\n return [\n Capability.contributes(Capabilities.UndoRegistry, undoRegistry),\n Capability.contributes(Capabilities.HistoryTracker, historyTracker),\n ];\n }),\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAaxB,IAAA,qBAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,mBAAWI;AAGvC,QAAMC,eAA4BC,KAAK,MAAMH,aAAaI,OAAOC,qBAAaC,WAAW,EAAEC,KAAI,CAAA;AAG/F,QAAMC,UAAU,OAAOX,mBAAWY,IAAIJ,qBAAaK,gBAAgB;AAEnE,QAAMC,iBAAgCR,MAAKK,SAAsDN,YAAAA;AAEjG,SAAO;IACLL,mBAAWe,YAAYP,qBAAaQ,cAAcX,YAAAA;IAClDL,mBAAWe,YAAYP,qBAAaS,gBAAgBH,cAAAA;;AAExD,CAAA,CAAA;",
6
+ "names": ["Effect", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "undoRegistry", "make", "getAll", "Capabilities", "UndoMapping", "flat", "invoker", "get", "OperationInvoker", "historyTracker", "contributes", "UndoRegistry", "HistoryTracker"]
7
+ }
@@ -2,9 +2,9 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
 
3
3
  // src/context.ts
4
4
  import { createContext } from "@dxos/web-context";
5
- var PluginManagerContext = createContext("dxos.org/app-framework/plugin-manager");
5
+ var PluginManagerContext = createContext("org.dxos.app-framework.plugin-manager");
6
6
 
7
7
  export {
8
8
  PluginManagerContext
9
9
  };
10
- //# sourceMappingURL=chunk-UEWJDI2L.mjs.map
10
+ //# sourceMappingURL=chunk-37Z53PXZ.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/context.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@dxos/web-context';\n\nimport { type PluginManager } from './core';\n\nexport const PluginManagerContext = createContext<PluginManager.PluginManager>('dxos.org/app-framework/plugin-manager');\n"],
5
- "mappings": ";;;AAIA,SAASA,qBAAqB;AAIvB,IAAMC,uBAAuBC,cAA2C,uCAAA;",
6
- "names": ["createContext", "PluginManagerContext", "createContext"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@dxos/web-context';\n\nimport { type PluginManager } from './core';\n\nexport const PluginManagerContext = createContext<PluginManager.PluginManager>('org.dxos.app-framework.plugin-manager');\n"],
5
+ "mappings": ";;;AAIA,SAASA,qBAAqB;AAIvB,IAAMC,uBAAuBD,cAA2C,uCAAA;",
6
+ "names": ["createContext", "PluginManagerContext"]
7
7
  }
@@ -0,0 +1,423 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ isPlugin
4
+ } from "./chunk-6S45OMUP.mjs";
5
+ import {
6
+ __export
7
+ } from "./chunk-HSLMI22Q.mjs";
8
+
9
+ // src/core/url-loader.ts
10
+ var url_loader_exports = {};
11
+ __export(url_loader_exports, {
12
+ RemotePluginLoadError: () => RemotePluginLoadError,
13
+ getInstalledVersion: () => getInstalledVersion,
14
+ getRemoteEntries: () => getRemoteEntries,
15
+ isLocalUrl: () => isLocalUrl,
16
+ make: () => make,
17
+ preload: () => preload,
18
+ setInstalledVersion: () => setInstalledVersion,
19
+ uninstall: () => uninstall
20
+ });
21
+ import * as Effect3 from "effect/Effect";
22
+ import * as Option from "effect/Option";
23
+ import { BaseError as BaseError3 } from "@dxos/errors";
24
+ import { log } from "@dxos/log";
25
+
26
+ // src/core/plugin-asset-cache.ts
27
+ var plugin_asset_cache_exports = {};
28
+ __export(plugin_asset_cache_exports, {
29
+ PluginAssetCacheError: () => PluginAssetCacheError,
30
+ noop: () => noop
31
+ });
32
+ import * as Effect from "effect/Effect";
33
+ import { BaseError } from "@dxos/errors";
34
+ var PluginAssetCacheError = class extends BaseError.extend("PluginAssetCacheError", "Plugin asset cache operation failed") {
35
+ };
36
+ var noop = () => ({
37
+ cache: () => Effect.void,
38
+ evict: () => Effect.void,
39
+ resolve: (_pluginId, url) => Effect.succeed(url),
40
+ list: () => Effect.succeed([])
41
+ });
42
+
43
+ // src/core/plugin-manifest.ts
44
+ var plugin_manifest_exports = {};
45
+ __export(plugin_manifest_exports, {
46
+ Manifest: () => Manifest,
47
+ PLUGIN_DEV_SERVER_PORT: () => PLUGIN_DEV_SERVER_PORT,
48
+ PluginManifestError: () => PluginManifestError,
49
+ fetchManifest: () => fetchManifest,
50
+ parse: () => parse
51
+ });
52
+ import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
53
+ import * as HttpClient from "@effect/platform/HttpClient";
54
+ import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
55
+ import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
56
+ import * as Effect2 from "effect/Effect";
57
+ import * as Schema from "effect/Schema";
58
+ import { BaseError as BaseError2 } from "@dxos/errors";
59
+ import { PLUGIN_ENTRY_FILENAME } from "@dxos/protocols";
60
+ var PLUGIN_DEV_SERVER_PORT = 3967;
61
+ var PluginManifestError = class extends BaseError2.extend("PluginManifestError", "Plugin manifest is invalid") {
62
+ };
63
+ var Manifest = Schema.Struct({
64
+ id: Schema.String,
65
+ name: Schema.String,
66
+ version: Schema.String,
67
+ assets: Schema.Array(Schema.String),
68
+ devEntry: Schema.String.pipe(Schema.optional)
69
+ });
70
+ var resolve = (manifestUrl, manifest) => {
71
+ const dev = manifest.devEntry !== void 0;
72
+ return {
73
+ id: manifest.id,
74
+ name: manifest.name,
75
+ version: manifest.version,
76
+ entryUrl: new URL(dev ? manifest.devEntry : PLUGIN_ENTRY_FILENAME, manifestUrl).toString(),
77
+ assetUrls: manifest.assets.map((asset) => new URL(asset, manifestUrl).toString()),
78
+ dev
79
+ };
80
+ };
81
+ var parse = (manifestUrl, payload) => {
82
+ const manifest = Schema.decodeUnknownSync(Manifest)(payload);
83
+ if (manifest.devEntry === void 0 && !manifest.assets.includes(PLUGIN_ENTRY_FILENAME)) {
84
+ throw new Error(`Manifest at ${manifestUrl} does not list ${PLUGIN_ENTRY_FILENAME} in assets.`);
85
+ }
86
+ return resolve(manifestUrl, manifest);
87
+ };
88
+ var fetchManifest = (manifestUrl) => Effect2.gen(function* () {
89
+ const response = yield* HttpClientRequest.get(manifestUrl).pipe(HttpClient.execute, Effect2.mapError((cause) => new PluginManifestError({
90
+ context: {
91
+ manifestUrl,
92
+ reason: "fetch-failed"
93
+ },
94
+ cause
95
+ })));
96
+ if (response.status >= 400) {
97
+ return yield* Effect2.fail(new PluginManifestError({
98
+ context: {
99
+ manifestUrl,
100
+ reason: "http-error",
101
+ status: response.status
102
+ }
103
+ }));
104
+ }
105
+ const manifest = yield* HttpClientResponse.schemaBodyJson(Manifest)(response).pipe(Effect2.mapError((cause) => new PluginManifestError({
106
+ context: {
107
+ manifestUrl,
108
+ reason: "parse-failed"
109
+ },
110
+ cause
111
+ })));
112
+ if (manifest.devEntry === void 0 && !manifest.assets.includes(PLUGIN_ENTRY_FILENAME)) {
113
+ return yield* Effect2.fail(new PluginManifestError({
114
+ context: {
115
+ manifestUrl,
116
+ reason: "invalid"
117
+ },
118
+ cause: `assets does not include ${PLUGIN_ENTRY_FILENAME}`
119
+ }));
120
+ }
121
+ return resolve(manifestUrl, manifest);
122
+ }).pipe(Effect2.scoped, Effect2.provide(FetchHttpClient.layer));
123
+
124
+ // src/core/url-loader.ts
125
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/core/url-loader.ts";
126
+ var DEFAULT_KEY = "org.dxos.composer.remote-plugins";
127
+ var RemotePluginLoadError = class extends BaseError3.extend("RemotePluginLoadError", "Failed to load remote plugin") {
128
+ };
129
+ var defaultStorage = () => ({
130
+ get: (key) => localStorage.getItem(key),
131
+ set: (key, value) => localStorage.setItem(key, value)
132
+ });
133
+ var getPersistedRemotePlugins = (storage, key) => {
134
+ try {
135
+ const parsed = JSON.parse(storage.get(key) ?? "[]");
136
+ if (!Array.isArray(parsed)) {
137
+ return [];
138
+ }
139
+ return parsed.filter((entry) => typeof entry === "object" && entry !== null && typeof entry.id === "string" && typeof entry.url === "string");
140
+ } catch {
141
+ return [];
142
+ }
143
+ };
144
+ var persistRemotePlugin = (storage, key, entry) => {
145
+ try {
146
+ const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== entry.id);
147
+ entries.push(entry);
148
+ storage.set(key, JSON.stringify(entries));
149
+ } catch (error) {
150
+ log.warn("failed to persist remote plugin entry", {
151
+ entry,
152
+ error
153
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 40, S: void 0 });
154
+ }
155
+ };
156
+ var removePersistedRemotePlugin = (storage, key, pluginId) => {
157
+ try {
158
+ const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== pluginId);
159
+ storage.set(key, JSON.stringify(entries));
160
+ } catch (error) {
161
+ log.warn("failed to remove remote plugin entry", {
162
+ pluginId,
163
+ error
164
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 51, S: void 0 });
165
+ }
166
+ };
167
+ var isUrl = (locator) => {
168
+ try {
169
+ const url = new URL(locator);
170
+ return url.protocol === "http:" || url.protocol === "https:";
171
+ } catch {
172
+ return false;
173
+ }
174
+ };
175
+ var isLocalUrl = (locator) => {
176
+ try {
177
+ const hostname = new URL(locator).hostname.toLowerCase();
178
+ return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1" || hostname === "[::1]";
179
+ } catch {
180
+ return false;
181
+ }
182
+ };
183
+ var getRemoteEntries = (options = {}) => {
184
+ const storage = options.storage ?? defaultStorage();
185
+ const key = options.key ?? DEFAULT_KEY;
186
+ return getPersistedRemotePlugins(storage, key);
187
+ };
188
+ var setInstalledVersion = (id, version, options = {}) => {
189
+ const storage = options.storage ?? defaultStorage();
190
+ const key = options.key ?? DEFAULT_KEY;
191
+ const entries = getPersistedRemotePlugins(storage, key);
192
+ const index = entries.findIndex((entry) => entry.id === id);
193
+ if (index === -1) {
194
+ return;
195
+ }
196
+ entries[index] = {
197
+ ...entries[index],
198
+ version
199
+ };
200
+ try {
201
+ storage.set(key, JSON.stringify(entries));
202
+ } catch (error) {
203
+ log.warn("failed to update installed version for remote plugin", {
204
+ id,
205
+ version,
206
+ error
207
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 103, S: void 0 });
208
+ }
209
+ };
210
+ var getInstalledVersion = (id, options = {}) => {
211
+ const storage = options.storage ?? defaultStorage();
212
+ const key = options.key ?? DEFAULT_KEY;
213
+ return getPersistedRemotePlugins(storage, key).find((entry) => entry.id === id)?.version;
214
+ };
215
+ var normalizePluginExport = (mod) => {
216
+ const exported = mod.default;
217
+ if (isPlugin(exported)) {
218
+ return exported;
219
+ }
220
+ if (typeof exported === "function") {
221
+ const result = exported();
222
+ if (isPlugin(result)) {
223
+ return result;
224
+ }
225
+ }
226
+ throw new Error("Remote module default export is not a Plugin or a zero-arg plugin factory.");
227
+ };
228
+ var loadStylesheets = (manifest, cache) => Effect3.gen(function* () {
229
+ if (typeof document === "undefined") {
230
+ return;
231
+ }
232
+ const cssUrls = manifest.assetUrls.filter((url) => url.endsWith(".css"));
233
+ for (const url of cssUrls) {
234
+ const resolved = yield* cache.resolve(manifest.id, url);
235
+ if (document.querySelector(`link[data-dxos-plugin-id="${manifest.id}"][href="${resolved}"]`)) {
236
+ continue;
237
+ }
238
+ const link = document.createElement("link");
239
+ link.rel = "stylesheet";
240
+ link.href = resolved;
241
+ link.dataset.dxosPluginId = manifest.id;
242
+ document.head.appendChild(link);
243
+ }
244
+ });
245
+ var loadFromManifest = (manifestUrl, cache) => Effect3.gen(function* () {
246
+ log.info("loading remote plugin", {
247
+ manifestUrl
248
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 152, S: this });
249
+ const manifest = yield* fetchManifest(manifestUrl).pipe(Effect3.mapError((cause) => new RemotePluginLoadError({
250
+ context: {
251
+ locator: manifestUrl,
252
+ reason: "manifest-error"
253
+ },
254
+ cause
255
+ })));
256
+ const wrapCacheError = Effect3.mapError((cause) => new RemotePluginLoadError({
257
+ context: {
258
+ locator: manifestUrl,
259
+ reason: "cache-error"
260
+ },
261
+ cause
262
+ }));
263
+ if (!manifest.dev) {
264
+ const cachedUrls = manifest.assetUrls.indexOf(manifestUrl) === -1 ? [
265
+ manifestUrl,
266
+ ...manifest.assetUrls
267
+ ] : manifest.assetUrls;
268
+ yield* cache.cache(manifest.id, cachedUrls).pipe(wrapCacheError);
269
+ }
270
+ const entryUrl = manifest.dev ? manifest.entryUrl : yield* cache.resolve(manifest.id, manifest.entryUrl).pipe(wrapCacheError);
271
+ const mod = yield* Effect3.tryPromise({
272
+ try: () => import(
273
+ /* @vite-ignore */
274
+ entryUrl
275
+ ),
276
+ catch: (cause) => new RemotePluginLoadError({
277
+ context: {
278
+ locator: manifestUrl,
279
+ reason: "import-failed"
280
+ },
281
+ cause
282
+ })
283
+ });
284
+ const plugin = normalizePluginExport(mod);
285
+ if (!plugin.meta.id || !plugin.meta.name) {
286
+ return yield* Effect3.fail(new RemotePluginLoadError({
287
+ context: {
288
+ locator: manifestUrl,
289
+ reason: "meta-missing"
290
+ }
291
+ }));
292
+ }
293
+ if (plugin.meta.id !== manifest.id) {
294
+ return yield* Effect3.fail(new RemotePluginLoadError({
295
+ context: {
296
+ locator: manifestUrl,
297
+ reason: "meta-mismatch",
298
+ metaId: plugin.meta.id,
299
+ manifestId: manifest.id
300
+ }
301
+ }));
302
+ }
303
+ if (!manifest.dev) {
304
+ yield* loadStylesheets(manifest, cache).pipe(wrapCacheError);
305
+ }
306
+ return {
307
+ plugin,
308
+ manifest
309
+ };
310
+ });
311
+ var preload = (options = {}) => Effect3.gen(function* () {
312
+ const storage = options.storage ?? defaultStorage();
313
+ const key = options.key ?? DEFAULT_KEY;
314
+ const cache = options.cache ?? noop();
315
+ const onPluginLoaded = options.onPluginLoaded;
316
+ const entries = getPersistedRemotePlugins(storage, key);
317
+ if (entries.length === 0) {
318
+ return [];
319
+ }
320
+ log.info("preloading remote plugins", {
321
+ count: entries.length
322
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 240, S: this });
323
+ const total = entries.length;
324
+ let loaded = 0;
325
+ const results = yield* Effect3.all(entries.map((entry) => loadFromManifest(entry.url, cache).pipe(
326
+ Effect3.tapError((error) => Effect3.sync(() => log.warn("failed to preload remote plugin", {
327
+ entry,
328
+ error
329
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 245, S: this }))),
330
+ Effect3.option,
331
+ // Tick the progress hook on both success and recoverable failure so
332
+ // the counter monotonically reaches `total`. The host-supplied
333
+ // callback is best-effort: any synchronous throw flows through
334
+ // `Effect.try` and gets logged + ignored so a buggy hook can't
335
+ // derail the preload.
336
+ Effect3.tap(() => Effect3.sync(() => {
337
+ loaded += 1;
338
+ }).pipe(Effect3.andThen(Effect3.try(() => onPluginLoaded?.(loaded, total))), Effect3.tapError((error) => Effect3.sync(() => log.warn("onPluginLoaded threw", {
339
+ loaded,
340
+ total,
341
+ error
342
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 255, S: this }))), Effect3.ignore))
343
+ )), {
344
+ concurrency: "unbounded"
345
+ });
346
+ return results.flatMap((result) => Option.match(result, {
347
+ onNone: () => [],
348
+ onSome: ({ plugin }) => [
349
+ plugin
350
+ ]
351
+ }));
352
+ });
353
+ var make = (builtinPlugins, options = {}) => {
354
+ const storage = options.storage ?? defaultStorage();
355
+ const key = options.key ?? DEFAULT_KEY;
356
+ const cache = options.cache ?? noop();
357
+ return (locator) => Effect3.gen(function* () {
358
+ const builtin = builtinPlugins.find((plugin2) => plugin2.meta.id === locator);
359
+ if (builtin) {
360
+ return {
361
+ plugin: builtin
362
+ };
363
+ }
364
+ if (!isUrl(locator)) {
365
+ return yield* Effect3.fail(new RemotePluginLoadError({
366
+ context: {
367
+ locator,
368
+ reason: "invalid-locator"
369
+ }
370
+ }));
371
+ }
372
+ const { plugin, manifest } = yield* loadFromManifest(locator, cache);
373
+ if (!manifest.dev) {
374
+ const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);
375
+ if (duplicate) {
376
+ return yield* Effect3.fail(new RemotePluginLoadError({
377
+ context: {
378
+ locator,
379
+ reason: "duplicate-id",
380
+ id: plugin.meta.id
381
+ }
382
+ }));
383
+ }
384
+ persistRemotePlugin(storage, key, {
385
+ id: plugin.meta.id,
386
+ url: locator
387
+ });
388
+ }
389
+ return {
390
+ plugin,
391
+ dev: manifest.dev
392
+ };
393
+ });
394
+ };
395
+ var uninstall = (pluginId, options = {}) => Effect3.gen(function* () {
396
+ const storage = options.storage ?? defaultStorage();
397
+ const key = options.key ?? DEFAULT_KEY;
398
+ const cache = options.cache ?? noop();
399
+ removePersistedRemotePlugin(storage, key, pluginId);
400
+ if (typeof document !== "undefined") {
401
+ document.querySelectorAll(`link[data-dxos-plugin-id="${pluginId}"]`).forEach((node) => node.remove());
402
+ }
403
+ yield* cache.evict(pluginId).pipe(Effect3.tapError((error) => Effect3.sync(() => log.warn("failed to evict plugin assets", {
404
+ pluginId,
405
+ error
406
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 337, S: this }))), Effect3.ignore);
407
+ });
408
+
409
+ export {
410
+ plugin_asset_cache_exports,
411
+ PLUGIN_DEV_SERVER_PORT,
412
+ plugin_manifest_exports,
413
+ RemotePluginLoadError,
414
+ isLocalUrl,
415
+ getRemoteEntries,
416
+ setInstalledVersion,
417
+ getInstalledVersion,
418
+ preload,
419
+ make,
420
+ uninstall,
421
+ url_loader_exports
422
+ };
423
+ //# sourceMappingURL=chunk-42UNAKYO.mjs.map