@dxos/app-framework 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe

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 (430) hide show
  1. package/.storybook/main.mts +1 -3
  2. package/dist/lib/browser/{capability-7PCNSWBT.mjs → capability-BBBBAPDI.mjs} +16 -11
  3. package/dist/lib/browser/capability-BBBBAPDI.mjs.map +7 -0
  4. package/dist/lib/browser/capability-OP63CD5N.mjs +35 -0
  5. package/dist/lib/browser/capability-OP63CD5N.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-6Y7PZV72.mjs → chunk-2CKCJ6PN.mjs} +6 -4
  7. package/dist/lib/browser/chunk-2CKCJ6PN.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-7IQHKD4U.mjs → chunk-F7FW2RK2.mjs} +9 -12
  9. package/dist/lib/browser/chunk-F7FW2RK2.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-TCLLRCS3.mjs → chunk-FU4GAFUQ.mjs} +10 -7
  11. package/dist/lib/browser/chunk-FU4GAFUQ.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-FMZN33N4.mjs → chunk-GX4TUNM6.mjs} +343 -187
  13. package/dist/lib/browser/chunk-GX4TUNM6.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-I34GF4NG.mjs +34 -0
  15. package/dist/lib/browser/chunk-I34GF4NG.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-JKWMHZP6.mjs +80 -0
  17. package/dist/lib/browser/chunk-JKWMHZP6.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-LVJW5EFU.mjs +157 -0
  19. package/dist/lib/browser/chunk-LVJW5EFU.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-QSXYHXCE.mjs} +3 -2
  21. package/dist/lib/browser/chunk-QSXYHXCE.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-RFSO3JRG.mjs +1 -0
  23. package/dist/lib/browser/chunk-T3Y4AEKX.mjs +42 -0
  24. package/dist/lib/browser/chunk-T3Y4AEKX.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-TGX63LTL.mjs +8 -0
  26. package/dist/lib/browser/{chunk-FHQTHCX7.mjs.map → chunk-TGX63LTL.mjs.map} +1 -1
  27. package/dist/lib/browser/chunk-WPE6AL7I.mjs +905 -0
  28. package/dist/lib/browser/chunk-WPE6AL7I.mjs.map +7 -0
  29. package/dist/lib/browser/cli/index.mjs +90 -0
  30. package/dist/lib/browser/cli/index.mjs.map +7 -0
  31. package/dist/lib/browser/common/activation-events.mjs +24 -0
  32. package/dist/lib/browser/common/capabilities.mjs +46 -0
  33. package/dist/lib/browser/core/activation-event.mjs +1 -1
  34. package/dist/lib/browser/core/capability.mjs +3 -1
  35. package/dist/lib/browser/core/plugin-manager.mjs +4 -4
  36. package/dist/lib/browser/core/plugin.mjs +6 -4
  37. package/dist/lib/browser/core/url-loader.mjs +12 -0
  38. package/dist/lib/browser/index.mjs +40 -131
  39. package/dist/lib/browser/index.mjs.map +4 -4
  40. package/dist/lib/browser/invoker-capability-H5PPENOC.mjs +43 -0
  41. package/dist/lib/browser/invoker-capability-H5PPENOC.mjs.map +7 -0
  42. package/dist/lib/browser/meta.json +1 -1
  43. package/dist/lib/browser/testing/index.mjs +56 -34
  44. package/dist/lib/browser/testing/index.mjs.map +3 -3
  45. package/dist/lib/browser/{react → ui}/index.mjs +19 -21
  46. package/dist/lib/browser/ui/index.mjs.map +7 -0
  47. package/dist/lib/node-esm/{capability-CFLQ2QQU.mjs → capability-AWBEMRYR.mjs} +16 -11
  48. package/dist/lib/node-esm/capability-AWBEMRYR.mjs.map +7 -0
  49. package/dist/lib/node-esm/capability-WFEG6CIZ.mjs +36 -0
  50. package/dist/lib/node-esm/capability-WFEG6CIZ.mjs.map +7 -0
  51. package/dist/lib/node-esm/{chunk-STMXUEPO.mjs → chunk-42KBWDE4.mjs} +6 -4
  52. package/dist/lib/node-esm/chunk-42KBWDE4.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-4A3ZCMI3.mjs +158 -0
  54. package/dist/lib/node-esm/chunk-4A3ZCMI3.mjs.map +7 -0
  55. package/dist/lib/node-esm/{chunk-XYQTBFPA.mjs → chunk-BCEOLX47.mjs} +343 -187
  56. package/dist/lib/node-esm/chunk-BCEOLX47.mjs.map +7 -0
  57. package/dist/lib/node-esm/chunk-EL3R25OQ.mjs +2 -0
  58. package/dist/lib/node-esm/chunk-EL3R25OQ.mjs.map +7 -0
  59. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs → chunk-FKE4Z3D6.mjs} +2 -2
  60. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs.map → chunk-FKE4Z3D6.mjs.map} +1 -1
  61. package/dist/lib/node-esm/chunk-G3RTFSNG.mjs +81 -0
  62. package/dist/lib/node-esm/chunk-G3RTFSNG.mjs.map +7 -0
  63. package/dist/lib/node-esm/chunk-LQKOTNJW.mjs +906 -0
  64. package/dist/lib/node-esm/chunk-LQKOTNJW.mjs.map +7 -0
  65. package/dist/lib/node-esm/{chunk-GT6OKM5I.mjs → chunk-ULUEXB7Q.mjs} +10 -7
  66. package/dist/lib/node-esm/chunk-ULUEXB7Q.mjs.map +7 -0
  67. package/dist/lib/node-esm/{chunk-663A54LQ.mjs → chunk-URWHJQT2.mjs} +9 -12
  68. package/dist/lib/node-esm/chunk-URWHJQT2.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-VKHGNEDB.mjs +43 -0
  70. package/dist/lib/node-esm/chunk-VKHGNEDB.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-WZCSOX5Q.mjs +35 -0
  72. package/dist/lib/node-esm/chunk-WZCSOX5Q.mjs.map +7 -0
  73. package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs → chunk-ZZ7CKK6W.mjs} +3 -2
  74. package/dist/lib/node-esm/chunk-ZZ7CKK6W.mjs.map +7 -0
  75. package/dist/lib/node-esm/cli/index.mjs +91 -0
  76. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  77. package/dist/lib/node-esm/common/activation-events.mjs +25 -0
  78. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  79. package/dist/lib/node-esm/common/capabilities.mjs +47 -0
  80. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  81. package/dist/lib/node-esm/core/activation-event.mjs +1 -1
  82. package/dist/lib/node-esm/core/capability.mjs +3 -1
  83. package/dist/lib/node-esm/core/plugin-manager.mjs +4 -4
  84. package/dist/lib/node-esm/core/plugin.mjs +6 -4
  85. package/dist/lib/node-esm/core/url-loader.mjs +13 -0
  86. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  87. package/dist/lib/node-esm/index.mjs +40 -131
  88. package/dist/lib/node-esm/index.mjs.map +4 -4
  89. package/dist/lib/node-esm/invoker-capability-S3ZA527J.mjs +44 -0
  90. package/dist/lib/node-esm/invoker-capability-S3ZA527J.mjs.map +7 -0
  91. package/dist/lib/node-esm/meta.json +1 -1
  92. package/dist/lib/node-esm/testing/index.mjs +56 -34
  93. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  94. package/dist/lib/node-esm/{react → ui}/index.mjs +19 -21
  95. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  96. package/dist/plugin/node-esm/index.mjs +384 -0
  97. package/dist/plugin/node-esm/index.mjs.map +7 -0
  98. package/dist/plugin/node-esm/meta.json +1 -0
  99. package/dist/types/src/{cli.d.ts → cli/cli.d.ts} +2 -2
  100. package/dist/types/src/cli/cli.d.ts.map +1 -0
  101. package/dist/types/src/cli/index.d.ts +2 -0
  102. package/dist/types/src/cli/index.d.ts.map +1 -0
  103. package/dist/types/src/common/activation-events.d.ts +27 -0
  104. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  105. package/dist/types/src/common/capabilities.d.ts +110 -0
  106. package/dist/types/src/common/capabilities.d.ts.map +1 -0
  107. package/dist/types/src/common/index.d.ts +4 -9
  108. package/dist/types/src/common/index.d.ts.map +1 -1
  109. package/dist/types/src/common/operations.d.ts +8 -369
  110. package/dist/types/src/common/operations.d.ts.map +1 -1
  111. package/dist/types/src/common/translations.d.ts +0 -9
  112. package/dist/types/src/common/translations.d.ts.map +1 -1
  113. package/dist/types/src/core/activation-event.d.ts +1 -1
  114. package/dist/types/src/core/activation-event.d.ts.map +1 -1
  115. package/dist/types/src/core/capability-manager.d.ts +5 -0
  116. package/dist/types/src/core/capability-manager.d.ts.map +1 -1
  117. package/dist/types/src/core/capability.d.ts +13 -7
  118. package/dist/types/src/core/capability.d.ts.map +1 -1
  119. package/dist/types/src/core/index.d.ts +1 -0
  120. package/dist/types/src/core/index.d.ts.map +1 -1
  121. package/dist/types/src/core/plugin-manager.d.ts +9 -2
  122. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  123. package/dist/types/src/core/plugin.d.ts +6 -1
  124. package/dist/types/src/core/plugin.d.ts.map +1 -1
  125. package/dist/types/src/core/url-loader.d.ts +25 -0
  126. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  127. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  128. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  129. package/dist/types/src/index.d.ts +1 -3
  130. package/dist/types/src/index.d.ts.map +1 -1
  131. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -1
  132. package/dist/types/src/plugin-operation/history/capability.d.ts +1 -1
  133. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -1
  134. package/dist/types/src/plugin-operation/history/errors.d.ts +30 -3
  135. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -1
  136. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -1
  137. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +11 -3
  138. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -1
  139. package/dist/types/src/plugin-operation/invoker-capability.d.ts +1 -1
  140. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -1
  141. package/dist/types/src/plugin-operation/testing.d.ts +26 -77
  142. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -1
  143. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -1
  144. package/dist/types/src/plugin-runtime/capability.d.ts +2 -2
  145. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -1
  146. package/dist/types/src/testing/withPluginManager.d.ts +1 -1
  147. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  148. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  149. package/dist/types/src/{react → ui/components/App}/App.d.ts +3 -2
  150. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  151. package/dist/types/src/{react/Surface.stories.d.ts → ui/components/App/App.stories.d.ts} +7 -2
  152. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  153. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  154. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  155. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  156. package/dist/types/src/{react → ui/components/PluginManager}/PluginManagerProvider.d.ts +1 -1
  157. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  158. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  159. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  160. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +12 -0
  161. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  162. package/dist/types/src/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
  163. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  164. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  165. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  166. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  167. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  168. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  169. package/dist/types/src/ui/components/Surface/index.d.ts +26 -0
  170. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  171. package/dist/types/src/{common/surface.d.ts → ui/components/Surface/types.d.ts} +20 -18
  172. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  173. package/dist/types/src/ui/components/index.d.ts +4 -0
  174. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  175. package/dist/types/src/ui/hooks/index.d.ts +6 -0
  176. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  177. package/dist/types/src/{react → ui/hooks}/useApp.d.ts +26 -9
  178. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  179. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  180. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  181. package/dist/types/src/{react → ui/hooks}/useCapabilities.d.ts +6 -1
  182. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  183. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  184. package/dist/types/src/{react/common.d.ts → ui/hooks/useSettingsState.d.ts} +1 -5
  185. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  186. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  187. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  188. package/dist/types/src/ui/index.d.ts +3 -0
  189. package/dist/types/src/ui/index.d.ts.map +1 -0
  190. package/dist/types/src/vite-plugin/composer-plugin.d.ts +18 -0
  191. package/dist/types/src/vite-plugin/composer-plugin.d.ts.map +1 -0
  192. package/dist/types/src/vite-plugin/import-map-plugin.d.ts +16 -0
  193. package/dist/types/src/vite-plugin/import-map-plugin.d.ts.map +1 -0
  194. package/dist/types/src/vite-plugin/index.d.ts +3 -0
  195. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  196. package/dist/types/src/vite-plugin/packages.d.ts +7 -0
  197. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  198. package/dist/types/tsconfig.tsbuildinfo +1 -1
  199. package/moon.yml +20 -6
  200. package/package.json +91 -64
  201. package/src/{cli.ts → cli/cli.ts} +10 -10
  202. package/src/{playground/debug → cli}/index.ts +1 -1
  203. package/src/common/activation-events.ts +44 -0
  204. package/src/common/capabilities.ts +172 -0
  205. package/src/common/index.ts +4 -9
  206. package/src/common/operations.ts +6 -383
  207. package/src/common/translations.ts +0 -12
  208. package/src/context.ts +1 -1
  209. package/src/core/activation-event.ts +5 -2
  210. package/src/core/capability-manager.test.ts +1 -1
  211. package/src/core/capability-manager.ts +22 -1
  212. package/src/core/capability.ts +21 -10
  213. package/src/core/index.ts +1 -0
  214. package/src/core/plugin-manager.test.ts +314 -46
  215. package/src/core/plugin-manager.ts +344 -157
  216. package/src/core/plugin.ts +10 -2
  217. package/src/core/url-loader.test.ts +79 -0
  218. package/src/core/url-loader.ts +148 -0
  219. package/src/index.ts +1 -3
  220. package/src/plugin-operation/OperationPlugin.ts +5 -6
  221. package/src/plugin-operation/history/capability.ts +5 -6
  222. package/src/plugin-operation/history/errors.ts +2 -6
  223. package/src/plugin-operation/history/history-tracker.test.ts +36 -43
  224. package/src/plugin-operation/history/history-tracker.ts +0 -1
  225. package/src/plugin-operation/history/undo-mapping.ts +6 -3
  226. package/src/plugin-operation/history/undo-registry.test.ts +3 -4
  227. package/src/plugin-operation/invoker-capability.ts +21 -7
  228. package/src/plugin-operation/meta.ts +1 -1
  229. package/src/plugin-operation/testing.ts +25 -45
  230. package/src/plugin-runtime/RuntimePlugin.ts +4 -5
  231. package/src/plugin-runtime/capability.ts +5 -5
  232. package/src/plugin-runtime/meta.ts +1 -1
  233. package/src/testing/service.ts +6 -6
  234. package/src/testing/withPluginManager.stories.tsx +6 -7
  235. package/src/testing/withPluginManager.tsx +44 -19
  236. package/src/ui/components/App/App.stories.tsx +92 -0
  237. package/src/{react → ui/components/App}/App.tsx +9 -11
  238. package/src/{playground/layout → ui/components/App}/index.ts +1 -1
  239. package/src/{react → ui/components/PluginManager}/PluginManagerContext.stories.tsx +13 -14
  240. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +1 -1
  241. package/src/ui/components/PluginManager/index.ts +5 -0
  242. package/src/{react/Surface.stories.tsx → ui/components/Surface/SurfaceComponent.stories.tsx} +31 -28
  243. package/src/{react/Surface.tsx → ui/components/Surface/SurfaceComponent.tsx} +59 -60
  244. package/src/{react → ui/components/Surface}/SurfaceInfo.tsx +2 -2
  245. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  246. package/src/ui/components/Surface/context.ts +12 -0
  247. package/src/ui/components/Surface/index.ts +35 -0
  248. package/src/{common/surface.ts → ui/components/Surface/types.ts} +22 -25
  249. package/src/ui/components/index.ts +7 -0
  250. package/src/ui/hooks/index.ts +9 -0
  251. package/src/ui/hooks/useApp.test.tsx +159 -0
  252. package/src/{react → ui/hooks}/useApp.tsx +110 -30
  253. package/src/{react → ui/hooks}/useCapabilities.ts +9 -5
  254. package/src/{react/common.ts → ui/hooks/useSettingsState.ts} +0 -11
  255. package/src/ui/hooks/useSurface.ts +13 -0
  256. package/src/ui/index.ts +6 -0
  257. package/src/vite-plugin/composer-plugin.ts +128 -0
  258. package/src/vite-plugin/import-map-plugin.ts +314 -0
  259. package/src/vite-plugin/index.ts +6 -0
  260. package/src/vite-plugin/packages.ts +29 -0
  261. package/tsconfig.json +4 -28
  262. package/tsconfig.node.json +2 -4
  263. package/typedoc.json +2 -4
  264. package/vitest.config.ts +1 -1
  265. package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs +0 -149
  266. package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs.map +0 -7
  267. package/dist/lib/browser/capability-7PCNSWBT.mjs.map +0 -7
  268. package/dist/lib/browser/capability-KP3PFEXD.mjs +0 -31
  269. package/dist/lib/browser/capability-KP3PFEXD.mjs.map +0 -7
  270. package/dist/lib/browser/chunk-6Y7PZV72.mjs.map +0 -7
  271. package/dist/lib/browser/chunk-7IQHKD4U.mjs.map +0 -7
  272. package/dist/lib/browser/chunk-BLQJSGL3.mjs +0 -732
  273. package/dist/lib/browser/chunk-BLQJSGL3.mjs.map +0 -7
  274. package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
  275. package/dist/lib/browser/chunk-FMZN33N4.mjs.map +0 -7
  276. package/dist/lib/browser/chunk-H4WPA7U7.mjs +0 -77
  277. package/dist/lib/browser/chunk-H4WPA7U7.mjs.map +0 -7
  278. package/dist/lib/browser/chunk-PKQT6C53.mjs.map +0 -7
  279. package/dist/lib/browser/chunk-TCLLRCS3.mjs.map +0 -7
  280. package/dist/lib/browser/chunk-XYNO72GQ.mjs +0 -746
  281. package/dist/lib/browser/chunk-XYNO72GQ.mjs.map +0 -7
  282. package/dist/lib/browser/common/index.mjs +0 -38
  283. package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs +0 -32
  284. package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs.map +0 -7
  285. package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs +0 -64
  286. package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs.map +0 -7
  287. package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs +0 -150
  288. package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs.map +0 -7
  289. package/dist/lib/node-esm/capability-CFLQ2QQU.mjs.map +0 -7
  290. package/dist/lib/node-esm/capability-RCUNM2M7.mjs +0 -32
  291. package/dist/lib/node-esm/capability-RCUNM2M7.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-663A54LQ.mjs.map +0 -7
  293. package/dist/lib/node-esm/chunk-6WXBT3EC.mjs +0 -747
  294. package/dist/lib/node-esm/chunk-6WXBT3EC.mjs.map +0 -7
  295. package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +0 -7
  296. package/dist/lib/node-esm/chunk-GQEBIGKD.mjs +0 -733
  297. package/dist/lib/node-esm/chunk-GQEBIGKD.mjs.map +0 -7
  298. package/dist/lib/node-esm/chunk-GT6OKM5I.mjs.map +0 -7
  299. package/dist/lib/node-esm/chunk-STMXUEPO.mjs.map +0 -7
  300. package/dist/lib/node-esm/chunk-XR6NMKEP.mjs +0 -78
  301. package/dist/lib/node-esm/chunk-XR6NMKEP.mjs.map +0 -7
  302. package/dist/lib/node-esm/chunk-XYQTBFPA.mjs.map +0 -7
  303. package/dist/lib/node-esm/common/index.mjs +0 -39
  304. package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs +0 -33
  305. package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs.map +0 -7
  306. package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs +0 -65
  307. package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs.map +0 -7
  308. package/dist/types/src/cli.d.ts.map +0 -1
  309. package/dist/types/src/common/activation-event.d.ts +0 -66
  310. package/dist/types/src/common/activation-event.d.ts.map +0 -1
  311. package/dist/types/src/common/capability.d.ts +0 -265
  312. package/dist/types/src/common/capability.d.ts.map +0 -1
  313. package/dist/types/src/common/collaboration.d.ts +0 -26
  314. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  315. package/dist/types/src/common/file.d.ts +0 -14
  316. package/dist/types/src/common/file.d.ts.map +0 -1
  317. package/dist/types/src/common/graph.d.ts +0 -21
  318. package/dist/types/src/common/graph.d.ts.map +0 -1
  319. package/dist/types/src/common/plugin.d.ts +0 -201
  320. package/dist/types/src/common/plugin.d.ts.map +0 -1
  321. package/dist/types/src/common/surface.d.ts.map +0 -1
  322. package/dist/types/src/playground/debug/Debug.d.ts +0 -8
  323. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  324. package/dist/types/src/playground/debug/index.d.ts +0 -2
  325. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  326. package/dist/types/src/playground/debug/plugin.d.ts +0 -3
  327. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  328. package/dist/types/src/playground/generator/Main.d.ts +0 -8
  329. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  330. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -8
  331. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  332. package/dist/types/src/playground/generator/generator.d.ts +0 -19
  333. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  334. package/dist/types/src/playground/generator/index.d.ts +0 -3
  335. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  336. package/dist/types/src/playground/generator/plugin.d.ts +0 -3
  337. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  338. package/dist/types/src/playground/layout/Layout.d.ts +0 -10
  339. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  340. package/dist/types/src/playground/layout/index.d.ts +0 -2
  341. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  342. package/dist/types/src/playground/layout/plugin.d.ts +0 -3
  343. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  344. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -8
  345. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  346. package/dist/types/src/playground/logger/index.d.ts +0 -2
  347. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  348. package/dist/types/src/playground/logger/plugin.d.ts +0 -3
  349. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  350. package/dist/types/src/playground/logger/schema.d.ts +0 -27
  351. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  352. package/dist/types/src/playground/playground.stories.d.ts +0 -11
  353. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  354. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -3
  355. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  356. package/dist/types/src/plugin-settings/actions.d.ts +0 -61
  357. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  358. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -6
  359. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  360. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  361. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  362. package/dist/types/src/plugin-settings/meta.d.ts +0 -3
  363. package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
  364. package/dist/types/src/plugin-settings/operation-resolver.d.ts +0 -6
  365. package/dist/types/src/plugin-settings/operation-resolver.d.ts.map +0 -1
  366. package/dist/types/src/plugin-settings/translations.d.ts +0 -11
  367. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  368. package/dist/types/src/react/App.d.ts.map +0 -1
  369. package/dist/types/src/react/App.stories.d.ts.map +0 -1
  370. package/dist/types/src/react/DefaultFallback.d.ts +0 -8
  371. package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
  372. package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
  373. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  374. package/dist/types/src/react/PluginManagerContext.stories.d.ts.map +0 -1
  375. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  376. package/dist/types/src/react/Surface.d.ts +0 -14
  377. package/dist/types/src/react/Surface.d.ts.map +0 -1
  378. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  379. package/dist/types/src/react/SurfaceInfo.d.ts.map +0 -1
  380. package/dist/types/src/react/common.d.ts.map +0 -1
  381. package/dist/types/src/react/index.d.ts +0 -9
  382. package/dist/types/src/react/index.d.ts.map +0 -1
  383. package/dist/types/src/react/types.d.ts +0 -12
  384. package/dist/types/src/react/types.d.ts.map +0 -1
  385. package/dist/types/src/react/useApp.d.ts.map +0 -1
  386. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  387. package/dist/types/src/react/useLoading.d.ts.map +0 -1
  388. package/dist/types/src/react/useOperationResolver.d.ts +0 -19
  389. package/dist/types/src/react/useOperationResolver.d.ts.map +0 -1
  390. package/src/common/activation-event.ts +0 -99
  391. package/src/common/capability.ts +0 -343
  392. package/src/common/collaboration.ts +0 -31
  393. package/src/common/file.ts +0 -22
  394. package/src/common/graph.ts +0 -30
  395. package/src/common/plugin.ts +0 -364
  396. package/src/playground/debug/Debug.tsx +0 -49
  397. package/src/playground/debug/plugin.ts +0 -16
  398. package/src/playground/generator/Main.tsx +0 -80
  399. package/src/playground/generator/Toolbar.tsx +0 -57
  400. package/src/playground/generator/generator.ts +0 -48
  401. package/src/playground/generator/index.ts +0 -6
  402. package/src/playground/generator/plugin.ts +0 -21
  403. package/src/playground/layout/Layout.tsx +0 -37
  404. package/src/playground/layout/plugin.ts +0 -18
  405. package/src/playground/logger/Toolbar.tsx +0 -33
  406. package/src/playground/logger/index.ts +0 -5
  407. package/src/playground/logger/plugin.ts +0 -42
  408. package/src/playground/logger/schema.ts +0 -22
  409. package/src/playground/playground.stories.tsx +0 -54
  410. package/src/plugin-settings/SettingsPlugin.ts +0 -19
  411. package/src/plugin-settings/actions.ts +0 -64
  412. package/src/plugin-settings/app-graph-builder.ts +0 -140
  413. package/src/plugin-settings/index.ts +0 -6
  414. package/src/plugin-settings/meta.ts +0 -10
  415. package/src/plugin-settings/operation-resolver.ts +0 -55
  416. package/src/plugin-settings/translations.ts +0 -19
  417. package/src/react/App.stories.tsx +0 -63
  418. package/src/react/DefaultFallback.tsx +0 -26
  419. package/src/react/ErrorBoundary.tsx +0 -56
  420. package/src/react/index.ts +0 -14
  421. package/src/react/types.ts +0 -27
  422. package/src/react/useOperationResolver.ts +0 -40
  423. /package/dist/lib/{node-esm/react/index.mjs.map → browser/chunk-RFSO3JRG.mjs.map} +0 -0
  424. /package/dist/lib/{node-esm/common/index.mjs.map → browser/common/activation-events.mjs.map} +0 -0
  425. /package/dist/lib/browser/{react/index.mjs.map → common/capabilities.mjs.map} +0 -0
  426. /package/dist/lib/browser/{common/index.mjs.map → core/url-loader.mjs.map} +0 -0
  427. /package/dist/types/src/{react → ui/components/PluginManager}/PluginManagerContext.stories.d.ts +0 -0
  428. /package/dist/types/src/{react → ui/components/Surface}/SurfaceInfo.d.ts +0 -0
  429. /package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +0 -0
  430. /package/src/{react → ui/hooks}/useLoading.tsx +0 -0
@@ -1,46 +1,44 @@
1
1
  import {
2
- ErrorBoundary,
2
+ App,
3
+ LoadingState,
3
4
  PluginManagerProvider,
4
5
  Surface,
5
- isSurfaceAvailable,
6
6
  useApp,
7
- useAppGraph,
8
7
  useAtomCapability,
9
8
  useAtomCapabilityState,
10
9
  useCapabilities,
11
10
  useCapability,
12
- useLayout,
11
+ useLoading,
13
12
  useOperationInvoker,
14
- useOperationResolver,
15
13
  usePluginManager,
16
14
  useSettingsState,
17
- useSurface,
18
- useSurfaces
19
- } from "../chunk-XYNO72GQ.mjs";
20
- import "../chunk-FHQTHCX7.mjs";
21
- import "../chunk-BLQJSGL3.mjs";
22
- import "../chunk-FMZN33N4.mjs";
23
- import "../chunk-PKQT6C53.mjs";
24
- import "../chunk-TCLLRCS3.mjs";
25
- import "../chunk-6Y7PZV72.mjs";
15
+ useSurface
16
+ } from "../chunk-WPE6AL7I.mjs";
17
+ import "../chunk-TGX63LTL.mjs";
18
+ import "../chunk-T3Y4AEKX.mjs";
19
+ import "../chunk-JKWMHZP6.mjs";
20
+ import "../chunk-I34GF4NG.mjs";
21
+ import "../chunk-RFSO3JRG.mjs";
22
+ import "../chunk-LVJW5EFU.mjs";
23
+ import "../chunk-GX4TUNM6.mjs";
24
+ import "../chunk-QSXYHXCE.mjs";
25
+ import "../chunk-FU4GAFUQ.mjs";
26
+ import "../chunk-2CKCJ6PN.mjs";
26
27
  import "../chunk-J5LGTIGS.mjs";
27
28
  export {
28
- ErrorBoundary,
29
+ App,
30
+ LoadingState,
29
31
  PluginManagerProvider,
30
32
  Surface,
31
- isSurfaceAvailable,
32
33
  useApp,
33
- useAppGraph,
34
34
  useAtomCapability,
35
35
  useAtomCapabilityState,
36
36
  useCapabilities,
37
37
  useCapability,
38
- useLayout,
38
+ useLoading,
39
39
  useOperationInvoker,
40
- useOperationResolver,
41
40
  usePluginManager,
42
41
  useSettingsState,
43
- useSurface,
44
- useSurfaces
42
+ useSurface
45
43
  };
46
44
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,16 +1,21 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import "./chunk-VKHGNEDB.mjs";
2
3
  import {
3
- ActivationEvent,
4
- Capability
5
- } from "./chunk-GQEBIGKD.mjs";
6
- import "./chunk-XYQTBFPA.mjs";
7
- import "./chunk-7OWSHPYK.mjs";
4
+ capabilities_exports
5
+ } from "./chunk-G3RTFSNG.mjs";
6
+ import {
7
+ activation_events_exports
8
+ } from "./chunk-WZCSOX5Q.mjs";
9
+ import "./chunk-EL3R25OQ.mjs";
10
+ import "./chunk-4A3ZCMI3.mjs";
11
+ import "./chunk-BCEOLX47.mjs";
12
+ import "./chunk-ZZ7CKK6W.mjs";
8
13
  import {
9
14
  plugin_exports
10
- } from "./chunk-GT6OKM5I.mjs";
15
+ } from "./chunk-ULUEXB7Q.mjs";
11
16
  import {
12
17
  capability_exports
13
- } from "./chunk-STMXUEPO.mjs";
18
+ } from "./chunk-42KBWDE4.mjs";
14
19
  import "./chunk-HSLMI22Q.mjs";
15
20
 
16
21
  // src/plugin-runtime/capability.ts
@@ -20,15 +25,15 @@ import * as ManagedRuntime from "effect/ManagedRuntime";
20
25
  var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
21
26
  const capabilityManager = yield* capability_exports.Service;
22
27
  const pluginManager = yield* plugin_exports.Service;
23
- yield* plugin_exports.activate(ActivationEvent.SetupLayer);
24
- const layers = yield* capability_exports.getAll(Capability.Layer);
28
+ yield* plugin_exports.activate(activation_events_exports.SetupLayer);
29
+ const layers = yield* capability_exports.getAll(capabilities_exports.Layer);
25
30
  const capabilityServiceLayer = Layer.succeed(capability_exports.Service, capabilityManager);
26
31
  const pluginServiceLayer = Layer.succeed(plugin_exports.Service, pluginManager);
27
32
  const composedLayer = layers.length > 0 ? Layer.mergeAll(capabilityServiceLayer, pluginServiceLayer, ...layers) : Layer.mergeAll(capabilityServiceLayer, pluginServiceLayer);
28
33
  const runtime = ManagedRuntime.make(composedLayer);
29
- return capability_exports.contributes(Capability.ManagedRuntime, runtime);
34
+ return capability_exports.contributes(capabilities_exports.ManagedRuntime, runtime);
30
35
  }));
31
36
  export {
32
37
  capability_default as default
33
38
  };
34
- //# sourceMappingURL=capability-CFLQ2QQU.mjs.map
39
+ //# sourceMappingURL=capability-AWBEMRYR.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugin-runtime/capability.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { ActivationEvents, Capabilities } from '../common';\nimport { Capability, Plugin } from '../core';\n\n//\n// Capability Module\n//\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get the CapabilityManager to create a layer for it.\n const capabilityManager = yield* Capability.Service;\n\n // Get the PluginManager to create a layer for it.\n const pluginManager = yield* Plugin.Service;\n\n // Trigger setup event so plugins can contribute their layers.\n yield* Plugin.activate(ActivationEvents.SetupLayer);\n\n // Gather all contributed layers.\n const layers = yield* Capability.getAll(Capabilities.Layer);\n\n // Create layers that provide Capability.Service and Plugin.Service.\n const capabilityServiceLayer = Layer.succeed(Capability.Service, capabilityManager);\n const pluginServiceLayer = Layer.succeed(Plugin.Service, pluginManager);\n\n // Merge all layers including service layers.\n // Layer.mergeAll requires a tuple type, so we use a cast for dynamic arrays.\n const composedLayer =\n layers.length > 0\n ? (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(\n capabilityServiceLayer,\n pluginServiceLayer,\n ...layers,\n )\n : (Layer.mergeAll as (...args: Layer.Layer<any, any, any>[]) => Layer.Layer<any, any, never>)(\n capabilityServiceLayer,\n pluginServiceLayer,\n );\n\n // Create the managed runtime from the composed layer.\n const runtime = ManagedRuntime.make(composedLayer) as Capabilities.ManagedRuntime;\n\n return Capability.contributes(Capabilities.ManagedRuntime, runtime);\n }),\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,oBAAoB;AAShC,IAAA,qBAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,oBAAoB,OAAOH,mBAAWI;AAG5C,QAAMC,gBAAgB,OAAOC,eAAOF;AAGpC,SAAOE,eAAOC,SAASC,0BAAiBC,UAAU;AAGlD,QAAMC,SAAS,OAAOV,mBAAWW,OAAOC,qBAAaC,KAAK;AAG1D,QAAMC,yBAA+BC,cAAQf,mBAAWI,SAASD,iBAAAA;AACjE,QAAMa,qBAA2BD,cAAQT,eAAOF,SAASC,aAAAA;AAIzD,QAAMY,gBACJP,OAAOQ,SAAS,IACLC,eACLL,wBACAE,oBAAAA,GACGN,MAAAA,IAEES,eACLL,wBACAE,kBAAAA;AAIR,QAAMI,UAAyBC,oBAAKJ,aAAAA;AAEpC,SAAOjB,mBAAWsB,YAAYV,qBAAaW,gBAAgBH,OAAAA;AAC7D,CAAA,CAAA;",
6
+ "names": ["Effect", "Layer", "ManagedRuntime", "Capability", "makeModule", "fnUntraced", "capabilityManager", "Service", "pluginManager", "Plugin", "activate", "ActivationEvents", "SetupLayer", "layers", "getAll", "Capabilities", "Layer", "capabilityServiceLayer", "succeed", "pluginServiceLayer", "composedLayer", "length", "mergeAll", "runtime", "make", "contributes", "ManagedRuntime"]
7
+ }
@@ -0,0 +1,36 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ make,
4
+ make2
5
+ } from "./chunk-URWHJQT2.mjs";
6
+ import "./chunk-VKHGNEDB.mjs";
7
+ import {
8
+ capabilities_exports
9
+ } from "./chunk-G3RTFSNG.mjs";
10
+ import "./chunk-WZCSOX5Q.mjs";
11
+ import "./chunk-EL3R25OQ.mjs";
12
+ import "./chunk-4A3ZCMI3.mjs";
13
+ import "./chunk-BCEOLX47.mjs";
14
+ import "./chunk-ZZ7CKK6W.mjs";
15
+ import "./chunk-ULUEXB7Q.mjs";
16
+ import {
17
+ capability_exports
18
+ } from "./chunk-42KBWDE4.mjs";
19
+ import "./chunk-HSLMI22Q.mjs";
20
+
21
+ // src/plugin-operation/history/capability.ts
22
+ import * as Effect from "effect/Effect";
23
+ var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
24
+ const capabilities = yield* capability_exports.Service;
25
+ const undoRegistry = make(() => capabilities.getAll(capabilities_exports.UndoMapping).flat());
26
+ const invoker = yield* capability_exports.get(capabilities_exports.OperationInvoker);
27
+ const historyTracker = make2(invoker, undoRegistry);
28
+ return [
29
+ capability_exports.contributes(capabilities_exports.UndoRegistry, undoRegistry),
30
+ capability_exports.contributes(capabilities_exports.HistoryTracker, historyTracker)
31
+ ];
32
+ }));
33
+ export {
34
+ capability_default as default
35
+ };
36
+ //# sourceMappingURL=capability-WFEG6CIZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugin-operation/history/capability.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { type 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
+ }
@@ -9,6 +9,7 @@ __export(capability_exports, {
9
9
  ModuleTag: () => ModuleTag,
10
10
  Service: () => Service,
11
11
  atom: () => atom,
12
+ atomByModule: () => atomByModule,
12
13
  contributes: () => contributes,
13
14
  get: () => get,
14
15
  getAll: () => getAll,
@@ -29,8 +30,8 @@ var get = (interfaceDef) => Effect.flatMap(Service, (manager) => Effect.try({
29
30
  var getAll = (interfaceDef) => Effect.map(Service, (manager) => manager.getAll(interfaceDef));
30
31
  var waitFor = (interfaceDef) => Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));
31
32
  var atom = (interfaceDef) => Effect.map(Service, (manager) => manager.atom(interfaceDef));
32
- var InterfaceDefTypeId = Symbol.for("InterfaceDefTypeId");
33
- var ModuleTag = Symbol.for("@dxos/app-framework/ModuleTag");
33
+ var atomByModule = (interfaceDef) => Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));
34
+ var ModuleTag = /* @__PURE__ */ Symbol.for("@dxos/app-framework/ModuleTag");
34
35
  var make = (identifier) => {
35
36
  return {
36
37
  identifier
@@ -45,7 +46,7 @@ var contributes = (interfaceDef, implementation, deactivate) => {
45
46
  };
46
47
  var lazy = (name, c) => {
47
48
  const lazyFn = (props) => Effect.gen(function* () {
48
- const { default: getCapability } = yield* Effect.tryPromise(() => c());
49
+ const { default: getCapability } = yield* Effect.promise(() => c());
49
50
  const result = yield* getCapability(props);
50
51
  const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [
51
52
  result
@@ -67,6 +68,7 @@ export {
67
68
  getAll,
68
69
  waitFor,
69
70
  atom,
71
+ atomByModule,
70
72
  ModuleTag,
71
73
  make,
72
74
  contributes,
@@ -75,4 +77,4 @@ export {
75
77
  makeModule,
76
78
  capability_exports
77
79
  };
78
- //# sourceMappingURL=chunk-STMXUEPO.mjs.map
80
+ //# sourceMappingURL=chunk-42KBWDE4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/core/capability.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\n\nimport type * as CapabilityManager from './capability-manager';\nimport type * as Plugin from './plugin';\n\n//\n// Capability Service Layer\n//\n\n/**\n * Effect Context.Tag for accessing CapabilityManager via the Effect layer system.\n * This allows capability modules to access the capability manager without having it passed as an argument.\n */\nexport class Service extends Context.Tag('@dxos/app-framework/CapabilityManager')<\n Service,\n CapabilityManager.CapabilityManager\n>() {}\n\n/**\n * Get a single capability from the capability manager.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation.\n * @throws If no capability is found.\n */\n// TODO(wittjosiah): Add custom tagged errors (Data.TaggedError) for app-framework to enable\n// type-safe error handling with Effect. Consider CapabilityNotFoundError, ModuleActivationError, etc.\nexport const get = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) =>\n Effect.try({\n try: () => manager.get(interfaceDef),\n catch: (error) => (error instanceof Error ? error : new Error(String(error))),\n }),\n );\n\n/**\n * Get all capabilities from the capability manager for a given interface.\n * @param interfaceDef The interface definition of the capability.\n * @returns An array of capability implementations.\n */\nexport const getAll = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T[], never, Service> =>\n Effect.map(Service, (manager) => manager.getAll(interfaceDef));\n\n/**\n * Wait for a capability to be available.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation once available.\n */\nexport const waitFor = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));\n\n/**\n * Get the Atom reference to capabilities for reactive access.\n * @param interfaceDef The interface definition of the capability.\n * @returns An Atom containing the array of capability implementations.\n */\nexport const atom = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<Atom.Atom<T[]>, never, Service> =>\n Effect.map(Service, (manager) => manager.atom(interfaceDef));\n\n/**\n * Get capabilities grouped by the module that contributed them.\n * @param interfaceDef The interface definition of the capability.\n * @returns An Atom containing a record from module ID to capability implementations.\n */\nexport const atomByModule = <T>(\n interfaceDef: InterfaceDef<T>,\n): Effect.Effect<Atom.Atom<Record<string, T[]>>, never, Service> =>\n Effect.map(Service, (manager) => manager.atomByModule(interfaceDef));\n\nconst InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');\n\n/**\n * Symbol used to tag lazy capability functions with their module ID.\n */\nexport const ModuleTag: unique symbol = Symbol.for('@dxos/app-framework/ModuleTag');\n\n/**\n * The interface definition of a capability.\n */\nexport type InterfaceDef<T> = {\n [InterfaceDefTypeId]: T;\n identifier: string;\n};\n\nexport namespace InterfaceDef {\n export type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;\n}\n\n/**\n * Helper to define the interface of a capability.\n */\nexport const make = <T>(identifier: string) => {\n return { identifier } as InterfaceDef<T>;\n};\n\n/**\n * A unique string identifier with a Typescript type associated with it.\n * When a capability is contributed to the application an implementation of the interface is provided.\n */\nexport type Capability<T> = {\n /**\n * The interface definition of the capability.\n */\n readonly interface: InterfaceDef<T>;\n\n /**\n * The implementation of the capability.\n */\n readonly implementation: T;\n\n /**\n * Called when the capability is deactivated.\n */\n readonly deactivate?: () => Effect.Effect<void, Error>;\n};\n\nexport type Any = Capability<any>;\n\n/**\n * Union type representing all valid return types for a capability module.\n * Supports single capabilities, arrays, and tuples of different capability types.\n */\nexport type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]] | readonly [Any, ...Any[]];\n\n/**\n * Helper to define the implementation of a capability.\n */\n// TODO(dmaretskyi): Make the return type non-generic so capabilities are non-discernable.\nexport const contributes = <I extends InterfaceDef<any>>(\n interfaceDef: I,\n implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],\n deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],\n): Capability<I> => {\n return {\n interface: interfaceDef,\n implementation,\n deactivate,\n } satisfies Capability<I>;\n};\n\ntype LoadCapability<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\ntype LoadCapabilities<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\n\ntype NormalizeReturn<R> = R extends readonly (infer A)[]\n ? A[]\n : R extends (infer A)[]\n ? A[]\n : R extends Any\n ? [R]\n : Any[];\n\nexport type LazyCapability<Props = void, Capabilities extends ModuleReturn = ModuleReturn, E extends Error = Error> = (\n props: Props,\n) => Effect.Effect<NormalizeReturn<Capabilities>, E, Service | Plugin.Service | never>;\n\n/**\n * Helper to define a lazily loaded implementation of a capability.\n * Supports single capabilities, arrays, and tuples of different capability types.\n * @param name The export name (e.g., 'AppGraphBuilder') - used to auto-compute module IDs.\n * @param loader The lazy loader function.\n * @returns A lazy capability function with ModuleTag symbol attached.\n */\nexport const lazy = <T = void, R extends ModuleReturn = ModuleReturn>(\n name: string,\n c: LoadCapability<T, R> | LoadCapabilities<T, R>,\n): LazyCapability<T, R> => {\n const lazyFn: LazyCapability<T, R> = (props: T) =>\n Effect.gen(function* () {\n const { default: getCapability } = yield* Effect.promise(() => c());\n const result = yield* getCapability(props);\n const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [result];\n return normalized as NormalizeReturn<R>;\n });\n\n return Object.assign(lazyFn, { [ModuleTag]: name });\n};\n\n/**\n * Gets the module tag (export name) from a lazy capability function.\n * @param capability The lazy capability function.\n * @returns The module tag if present, undefined otherwise.\n */\n// TODO(wittjosiah): Stricter type for capability.\nexport const getModuleTag = (capability: unknown): string | undefined => {\n return capability && typeof capability === 'function' && ModuleTag in capability\n ? String(capability[ModuleTag])\n : undefined;\n};\n\n/**\n * Helper to define a capability module with explicit typing.\n * Wraps the default export function to provide better type inference and make the pattern explicit.\n *\n * This helper provides explicit typing for the module activation function,\n * making it clear that the function should:\n * - Access CapabilityManager via the Effect layer system (Capability.get, Capability.getAll, etc.)\n * - Return a capability, array of capabilities, or tuple of different capability types (sync or async)\n *\n * Supports returning multiple capabilities of different types as a tuple, which will be normalized\n * to an array at runtime for compatibility with the plugin system.\n *\n * @example\n * ```ts\n * // Module without options - single capability\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * const client = yield* Capability.get(ClientCapabilities.Client);\n * return contributes(Capabilities.SettingsStore, store);\n * })\n * );\n *\n * // Module with multiple capabilities\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * return [\n * contributes(Capabilities.SettingsStore, store),\n * contributes(Capabilities.Translations, translations),\n * ];\n * })\n * );\n *\n * // Module with required options (context accessed via layer)\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* (props: { observability: boolean }) {\n * const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n * return contributes(Capabilities.IntentResolver, ...);\n * })\n * );\n * ```\n */\nexport const makeModule = <\n TProps = void,\n TReturn extends ModuleReturn = ModuleReturn,\n E extends Error = Error,\n R extends Service | Plugin.Service | never = Service,\n>(\n fn: (props: TProps) => Effect.Effect<TReturn, E, R>,\n): ((props: TProps) => Effect.Effect<TReturn, E, R>) => fn;\n"],
5
+ "mappings": ";;;;;;AAAA;;;;;;;;;;;;;;;AAKA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AAajB,IAAMC,UAAN,cAA8BC,YAAI,uCAAA,EAAA,EAAA;AAGpC;AAUE,IAAMC,MAAM,CAAIC,iBACdC,eAAQJ,SAAS,CAACK,YAChBC,WAAI;EACTA,KAAK,MAAMD,QAAQH,IAAIC,YAAAA;EACvBI,OAAO,CAACC,UAAWA,iBAAiBC,QAAQD,QAAQ,IAAIC,MAAMC,OAAOF,KAAAA,CAAAA;AACvE,CAAA,CAAA;AAQG,IAAMG,SAAS,CAAIR,iBACjBS,WAAIZ,SAAS,CAACK,YAAYA,QAAQM,OAAOR,YAAAA,CAAAA;AAO3C,IAAMU,UAAU,CAAIV,iBAClBC,eAAQJ,SAAS,CAACK,YAAYA,QAAQQ,QAAQV,YAAAA,CAAAA;AAOhD,IAAMW,OAAO,CAAIX,iBACfS,WAAIZ,SAAS,CAACK,YAAYA,QAAQS,KAAKX,YAAAA,CAAAA;AAOzC,IAAMY,eAAe,CAC1BZ,iBAEOS,WAAIZ,SAAS,CAACK,YAAYA,QAAQU,aAAaZ,YAAAA,CAAAA;AAOjD,IAAMa,YAA2BC,uBAAOC,IAAI,+BAAA;AAiB5C,IAAMC,OAAO,CAAIC,eAAAA;AACtB,SAAO;IAAEA;EAAW;AACtB;AAmCO,IAAMC,cAAc,CACzBC,cACAC,gBACAC,eAAAA;AAEA,SAAO;IACLC,WAAWH;IACXC;IACAC;EACF;AACF;AA4BO,IAAME,OAAO,CAClBC,MACAC,MAAAA;AAEA,QAAMC,SAA+B,CAACC,UAC7BC,WAAI,aAAA;AACT,UAAM,EAAEC,SAASC,cAAa,IAAK,OAAcC,eAAQ,MAAMN,EAAAA,CAAAA;AAC/D,UAAMO,SAAS,OAAOF,cAAcH,KAAAA;AACpC,UAAMM,aAAaD,UAAU,OAAO,CAAA,IAAKE,MAAMC,QAAQH,MAAAA,IAAUE,MAAME,KAAKJ,MAAAA,IAAU;MAACA;;AACvF,WAAOC;EACT,CAAA;AAEF,SAAOI,OAAOC,OAAOZ,QAAQ;IAAE,CAACb,SAAAA,GAAYW;EAAK,CAAA;AACnD;AAQO,IAAMe,eAAe,CAACC,eAAAA;AAC3B,SAAOA,cAAc,OAAOA,eAAe,cAAc3B,aAAa2B,aAClEC,OAAOD,WAAW3B,SAAAA,CAAU,IAC5B6B;AACN;AA2CO,IAAMC,aAAa,CAMxBC,OACsDA;",
6
+ "names": ["Context", "Effect", "Service", "Tag", "get", "interfaceDef", "flatMap", "manager", "try", "catch", "error", "Error", "String", "getAll", "map", "waitFor", "atom", "atomByModule", "ModuleTag", "Symbol", "for", "make", "identifier", "contributes", "interfaceDef", "implementation", "deactivate", "interface", "lazy", "name", "c", "lazyFn", "props", "gen", "default", "getCapability", "promise", "result", "normalized", "Array", "isArray", "from", "Object", "assign", "getModuleTag", "capability", "String", "undefined", "makeModule", "fn"]
7
+ }
@@ -0,0 +1,158 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ isPlugin
4
+ } from "./chunk-ULUEXB7Q.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
+ make: () => make,
13
+ preload: () => preload
14
+ });
15
+ import * as Effect from "effect/Effect";
16
+ import { log } from "@dxos/log";
17
+ var __dxlog_file = "/__w/dxos/dxos/packages/sdk/app-framework/src/core/url-loader.ts";
18
+ var DEFAULT_KEY = "org.dxos.composer.remote-plugins";
19
+ var defaultStorage = () => ({
20
+ get: (key) => localStorage.getItem(key),
21
+ set: (key, value) => localStorage.setItem(key, value)
22
+ });
23
+ var getPersistedRemotePlugins = (storage, key) => {
24
+ try {
25
+ const parsed = JSON.parse(storage.get(key) ?? "[]");
26
+ if (!Array.isArray(parsed)) {
27
+ return [];
28
+ }
29
+ return parsed.filter((entry) => typeof entry === "object" && entry !== null && typeof entry.id === "string" && typeof entry.url === "string");
30
+ } catch {
31
+ return [];
32
+ }
33
+ };
34
+ var persistRemotePlugin = (storage, key, entry) => {
35
+ try {
36
+ const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== entry.id);
37
+ entries.push(entry);
38
+ storage.set(key, JSON.stringify(entries));
39
+ } catch (error) {
40
+ log.warn("failed to persist remote plugin entry", {
41
+ entry,
42
+ error
43
+ }, {
44
+ F: __dxlog_file,
45
+ L: 57,
46
+ S: void 0,
47
+ C: (f, a) => f(...a)
48
+ });
49
+ }
50
+ };
51
+ var isUrl = (locator) => {
52
+ try {
53
+ const url = new URL(locator);
54
+ return url.protocol === "http:" || url.protocol === "https:";
55
+ } catch {
56
+ return false;
57
+ }
58
+ };
59
+ var normalizePluginExport = (mod) => {
60
+ const exported = mod.default;
61
+ if (isPlugin(exported)) {
62
+ return exported;
63
+ }
64
+ if (typeof exported === "function") {
65
+ const result = exported();
66
+ if (isPlugin(result)) {
67
+ return result;
68
+ }
69
+ }
70
+ throw new Error("Remote module default export is not a Plugin or a zero-arg plugin factory.");
71
+ };
72
+ var loadRemotePlugin = async (url) => {
73
+ log.info("loading remote plugin", {
74
+ url
75
+ }, {
76
+ F: __dxlog_file,
77
+ L: 85,
78
+ S: void 0,
79
+ C: (f, a) => f(...a)
80
+ });
81
+ const mod = await import(
82
+ /* @vite-ignore */
83
+ url
84
+ );
85
+ const plugin = normalizePluginExport(mod);
86
+ if (!plugin.meta.id || !plugin.meta.name) {
87
+ throw new Error(`Remote plugin at ${url} is missing required meta.id or meta.name.`);
88
+ }
89
+ return plugin;
90
+ };
91
+ var preload = async (options = {}) => {
92
+ const storage = options.storage ?? defaultStorage();
93
+ const key = options.key ?? DEFAULT_KEY;
94
+ const entries = getPersistedRemotePlugins(storage, key);
95
+ if (entries.length === 0) {
96
+ return [];
97
+ }
98
+ log.info("preloading remote plugins", {
99
+ count: entries.length
100
+ }, {
101
+ F: __dxlog_file,
102
+ L: 105,
103
+ S: void 0,
104
+ C: (f, a) => f(...a)
105
+ });
106
+ const results = await Promise.allSettled(entries.map((entry) => loadRemotePlugin(entry.url)));
107
+ const plugins = [];
108
+ for (let index = 0; index < results.length; index++) {
109
+ const result = results[index];
110
+ if (result.status === "fulfilled") {
111
+ plugins.push(result.value);
112
+ } else {
113
+ log.warn("failed to preload remote plugin", {
114
+ entry: entries[index],
115
+ error: result.reason
116
+ }, {
117
+ F: __dxlog_file,
118
+ L: 113,
119
+ S: void 0,
120
+ C: (f, a) => f(...a)
121
+ });
122
+ }
123
+ }
124
+ return plugins;
125
+ };
126
+ var make = (builtinPlugins, options = {}) => {
127
+ const storage = options.storage ?? defaultStorage();
128
+ const key = options.key ?? DEFAULT_KEY;
129
+ return (locator) => Effect.gen(function* () {
130
+ const builtin = builtinPlugins.find((plugin2) => plugin2.meta.id === locator);
131
+ if (builtin) {
132
+ return builtin;
133
+ }
134
+ if (!isUrl(locator)) {
135
+ return yield* Effect.fail(new Error(`Plugin not found and locator is not a URL: ${locator}`));
136
+ }
137
+ const plugin = yield* Effect.tryPromise({
138
+ try: () => loadRemotePlugin(locator),
139
+ catch: (error) => new Error(`Failed to load remote plugin from ${locator}: ${error}`)
140
+ });
141
+ const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);
142
+ if (duplicate) {
143
+ return yield* Effect.fail(new Error(`Remote plugin ${plugin.meta.id} conflicts with built-in plugin of the same id.`));
144
+ }
145
+ persistRemotePlugin(storage, key, {
146
+ id: plugin.meta.id,
147
+ url: locator
148
+ });
149
+ return plugin;
150
+ });
151
+ };
152
+
153
+ export {
154
+ preload,
155
+ make,
156
+ url_loader_exports
157
+ };
158
+ //# sourceMappingURL=chunk-4A3ZCMI3.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/core/url-loader.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { log } from '@dxos/log';\n\nimport * as Plugin from './plugin';\n\nconst DEFAULT_KEY = 'org.dxos.composer.remote-plugins';\n\n/**\n * Abstraction over key-value storage (defaults to localStorage).\n */\nexport type Storage = {\n get(key: string): string | null;\n set(key: string, value: string): void;\n};\n\n/**\n * Options for configuring the URL loader.\n */\nexport type Options = {\n storage?: Storage;\n key?: string;\n};\n\ntype RemotePluginEntry = { id: string; url: string };\n\nconst defaultStorage = (): Storage => ({\n get: (key) => localStorage.getItem(key),\n set: (key, value) => localStorage.setItem(key, value),\n});\n\nconst getPersistedRemotePlugins = (storage: Storage, key: string): RemotePluginEntry[] => {\n try {\n const parsed: unknown = JSON.parse(storage.get(key) ?? '[]');\n if (!Array.isArray(parsed)) {\n return [];\n }\n return parsed.filter(\n (entry): entry is RemotePluginEntry =>\n typeof entry === 'object' && entry !== null && typeof entry.id === 'string' && typeof entry.url === 'string',\n );\n } catch {\n return [];\n }\n};\n\nconst persistRemotePlugin = (storage: Storage, key: string, entry: RemotePluginEntry): void => {\n try {\n const entries = getPersistedRemotePlugins(storage, key).filter((existing) => existing.id !== entry.id);\n entries.push(entry);\n storage.set(key, JSON.stringify(entries));\n } catch (error) {\n log.warn('failed to persist remote plugin entry', { entry, error });\n }\n};\n\nconst isUrl = (locator: string): boolean => {\n try {\n const url = new URL(locator);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n};\n\nconst normalizePluginExport = (mod: Record<string, unknown>): Plugin.Plugin => {\n const exported = mod.default;\n if (Plugin.isPlugin(exported)) {\n return exported;\n }\n if (typeof exported === 'function') {\n const result = (exported as () => unknown)();\n if (Plugin.isPlugin(result)) {\n return result;\n }\n }\n throw new Error('Remote module default export is not a Plugin or a zero-arg plugin factory.');\n};\n\nconst loadRemotePlugin = async (url: string): Promise<Plugin.Plugin> => {\n log.info('loading remote plugin', { url });\n const mod = await import(/* @vite-ignore */ url);\n const plugin = normalizePluginExport(mod);\n if (!plugin.meta.id || !plugin.meta.name) {\n throw new Error(`Remote plugin at ${url} is missing required meta.id or meta.name.`);\n }\n return plugin;\n};\n\n/**\n * Preloads previously persisted remote plugins from storage.\n */\nexport const preload = async (options: Options = {}): Promise<Plugin.Plugin[]> => {\n const storage = options.storage ?? defaultStorage();\n const key = options.key ?? DEFAULT_KEY;\n\n const entries = getPersistedRemotePlugins(storage, key);\n if (entries.length === 0) {\n return [];\n }\n log.info('preloading remote plugins', { count: entries.length });\n const results = await Promise.allSettled(entries.map((entry) => loadRemotePlugin(entry.url)));\n const plugins: Plugin.Plugin[] = [];\n for (let index = 0; index < results.length; index++) {\n const result = results[index];\n if (result.status === 'fulfilled') {\n plugins.push(result.value);\n } else {\n log.warn('failed to preload remote plugin', { entry: entries[index], error: result.reason });\n }\n }\n return plugins;\n};\n\n/**\n * Creates a plugin loader that resolves built-in plugins by ID or loads remote plugins from URLs.\n */\nexport const make = (builtinPlugins: Plugin.Plugin[], options: Options = {}) => {\n const storage = options.storage ?? defaultStorage();\n const key = options.key ?? DEFAULT_KEY;\n\n return (locator: string): Effect.Effect<Plugin.Plugin, Error> =>\n Effect.gen(function* () {\n const builtin = builtinPlugins.find((plugin) => plugin.meta.id === locator);\n if (builtin) {\n return builtin;\n }\n if (!isUrl(locator)) {\n return yield* Effect.fail(new Error(`Plugin not found and locator is not a URL: ${locator}`));\n }\n const plugin = yield* Effect.tryPromise({\n try: () => loadRemotePlugin(locator),\n catch: (error) => new Error(`Failed to load remote plugin from ${locator}: ${error}`),\n });\n const duplicate = builtinPlugins.find((existing) => existing.meta.id === plugin.meta.id);\n if (duplicate) {\n return yield* Effect.fail(\n new Error(`Remote plugin ${plugin.meta.id} conflicts with built-in plugin of the same id.`),\n );\n }\n persistRemotePlugin(storage, key, { id: plugin.meta.id, url: locator });\n return plugin;\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,WAAW;;AAIpB,IAAMC,cAAc;AAoBpB,IAAMC,iBAAiB,OAAgB;EACrCC,KAAK,CAACC,QAAQC,aAAaC,QAAQF,GAAAA;EACnCG,KAAK,CAACH,KAAKI,UAAUH,aAAaI,QAAQL,KAAKI,KAAAA;AACjD;AAEA,IAAME,4BAA4B,CAACC,SAAkBP,QAAAA;AACnD,MAAI;AACF,UAAMQ,SAAkBC,KAAKC,MAAMH,QAAQR,IAAIC,GAAAA,KAAQ,IAAA;AACvD,QAAI,CAACW,MAAMC,QAAQJ,MAAAA,GAAS;AAC1B,aAAO,CAAA;IACT;AACA,WAAOA,OAAOK,OACZ,CAACC,UACC,OAAOA,UAAU,YAAYA,UAAU,QAAQ,OAAOA,MAAMC,OAAO,YAAY,OAAOD,MAAME,QAAQ,QAAA;EAE1G,QAAQ;AACN,WAAO,CAAA;EACT;AACF;AAEA,IAAMC,sBAAsB,CAACV,SAAkBP,KAAac,UAAAA;AAC1D,MAAI;AACF,UAAMI,UAAUZ,0BAA0BC,SAASP,GAAAA,EAAKa,OAAO,CAACM,aAAaA,SAASJ,OAAOD,MAAMC,EAAE;AACrGG,YAAQE,KAAKN,KAAAA;AACbP,YAAQJ,IAAIH,KAAKS,KAAKY,UAAUH,OAAAA,CAAAA;EAClC,SAASI,OAAO;AACdC,QAAIC,KAAK,yCAAyC;MAAEV;MAAOQ;IAAM,GAAA;;;;;;EACnE;AACF;AAEA,IAAMG,QAAQ,CAACC,YAAAA;AACb,MAAI;AACF,UAAMV,MAAM,IAAIW,IAAID,OAAAA;AACpB,WAAOV,IAAIY,aAAa,WAAWZ,IAAIY,aAAa;EACtD,QAAQ;AACN,WAAO;EACT;AACF;AAEA,IAAMC,wBAAwB,CAACC,QAAAA;AAC7B,QAAMC,WAAWD,IAAIE;AACrB,MAAWC,SAASF,QAAAA,GAAW;AAC7B,WAAOA;EACT;AACA,MAAI,OAAOA,aAAa,YAAY;AAClC,UAAMG,SAAUH,SAAAA;AAChB,QAAWE,SAASC,MAAAA,GAAS;AAC3B,aAAOA;IACT;EACF;AACA,QAAM,IAAIC,MAAM,4EAAA;AAClB;AAEA,IAAMC,mBAAmB,OAAOpB,QAAAA;AAC9BO,MAAIc,KAAK,yBAAyB;IAAErB;EAAI,GAAA;;;;;;AACxC,QAAMc,MAAM,MAAM;;IAA0Bd;;AAC5C,QAAMsB,SAAST,sBAAsBC,GAAAA;AACrC,MAAI,CAACQ,OAAOC,KAAKxB,MAAM,CAACuB,OAAOC,KAAKC,MAAM;AACxC,UAAM,IAAIL,MAAM,oBAAoBnB,GAAAA,4CAA+C;EACrF;AACA,SAAOsB;AACT;AAKO,IAAMG,UAAU,OAAOC,UAAmB,CAAC,MAAC;AACjD,QAAMnC,UAAUmC,QAAQnC,WAAWT,eAAAA;AACnC,QAAME,MAAM0C,QAAQ1C,OAAOH;AAE3B,QAAMqB,UAAUZ,0BAA0BC,SAASP,GAAAA;AACnD,MAAIkB,QAAQyB,WAAW,GAAG;AACxB,WAAO,CAAA;EACT;AACApB,MAAIc,KAAK,6BAA6B;IAAEO,OAAO1B,QAAQyB;EAAO,GAAA;;;;;;AAC9D,QAAME,UAAU,MAAMC,QAAQC,WAAW7B,QAAQ8B,IAAI,CAAClC,UAAUsB,iBAAiBtB,MAAME,GAAG,CAAA,CAAA;AAC1F,QAAMiC,UAA2B,CAAA;AACjC,WAASC,QAAQ,GAAGA,QAAQL,QAAQF,QAAQO,SAAS;AACnD,UAAMhB,SAASW,QAAQK,KAAAA;AACvB,QAAIhB,OAAOiB,WAAW,aAAa;AACjCF,cAAQ7B,KAAKc,OAAO9B,KAAK;IAC3B,OAAO;AACLmB,UAAIC,KAAK,mCAAmC;QAAEV,OAAOI,QAAQgC,KAAAA;QAAQ5B,OAAOY,OAAOkB;MAAO,GAAA;;;;;;IAC5F;EACF;AACA,SAAOH;AACT;AAKO,IAAMI,OAAO,CAACC,gBAAiCZ,UAAmB,CAAC,MAAC;AACzE,QAAMnC,UAAUmC,QAAQnC,WAAWT,eAAAA;AACnC,QAAME,MAAM0C,QAAQ1C,OAAOH;AAE3B,SAAO,CAAC6B,YACC6B,WAAI,aAAA;AACT,UAAMC,UAAUF,eAAeG,KAAK,CAACnB,YAAWA,QAAOC,KAAKxB,OAAOW,OAAAA;AACnE,QAAI8B,SAAS;AACX,aAAOA;IACT;AACA,QAAI,CAAC/B,MAAMC,OAAAA,GAAU;AACnB,aAAO,OAAcgC,YAAK,IAAIvB,MAAM,8CAA8CT,OAAAA,EAAS,CAAA;IAC7F;AACA,UAAMY,SAAS,OAAcqB,kBAAW;MACtCC,KAAK,MAAMxB,iBAAiBV,OAAAA;MAC5BmC,OAAO,CAACvC,UAAU,IAAIa,MAAM,qCAAqCT,OAAAA,KAAYJ,KAAAA,EAAO;IACtF,CAAA;AACA,UAAMwC,YAAYR,eAAeG,KAAK,CAACtC,aAAaA,SAASoB,KAAKxB,OAAOuB,OAAOC,KAAKxB,EAAE;AACvF,QAAI+C,WAAW;AACb,aAAO,OAAcJ,YACnB,IAAIvB,MAAM,iBAAiBG,OAAOC,KAAKxB,EAAE,iDAAiD,CAAA;IAE9F;AACAE,wBAAoBV,SAASP,KAAK;MAAEe,IAAIuB,OAAOC,KAAKxB;MAAIC,KAAKU;IAAQ,CAAA;AACrE,WAAOY;EACT,CAAA;AACJ;",
6
+ "names": ["Effect", "log", "DEFAULT_KEY", "defaultStorage", "get", "key", "localStorage", "getItem", "set", "value", "setItem", "getPersistedRemotePlugins", "storage", "parsed", "JSON", "parse", "Array", "isArray", "filter", "entry", "id", "url", "persistRemotePlugin", "entries", "existing", "push", "stringify", "error", "log", "warn", "isUrl", "locator", "URL", "protocol", "normalizePluginExport", "mod", "exported", "default", "isPlugin", "result", "Error", "loadRemotePlugin", "info", "plugin", "meta", "name", "preload", "options", "length", "count", "results", "Promise", "allSettled", "map", "plugins", "index", "status", "reason", "make", "builtinPlugins", "gen", "builtin", "find", "fail", "tryPromise", "try", "catch", "duplicate"]
7
+ }