@dxos/app-framework 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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 (363) hide show
  1. package/.storybook/main.mts +1 -3
  2. package/dist/lib/browser/{capability-7PCNSWBT.mjs → capability-6YMUBS54.mjs} +15 -11
  3. package/dist/lib/browser/capability-6YMUBS54.mjs.map +7 -0
  4. package/dist/lib/browser/capability-LF3OXSCV.mjs +34 -0
  5. package/dist/lib/browser/capability-LF3OXSCV.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-272IPLHQ.mjs} +1 -1
  7. package/dist/lib/browser/{chunk-PKQT6C53.mjs.map → chunk-272IPLHQ.mjs.map} +1 -1
  8. package/dist/lib/browser/{chunk-FMZN33N4.mjs → chunk-2UI6ACB5.mjs} +48 -31
  9. package/dist/lib/browser/chunk-2UI6ACB5.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-TCLLRCS3.mjs → chunk-7M4467QR.mjs} +6 -6
  11. package/dist/lib/browser/chunk-7M4467QR.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-7IQHKD4U.mjs → chunk-JGWCBVKJ.mjs} +2 -2
  13. package/dist/lib/browser/chunk-JGWCBVKJ.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-M5IC326L.mjs +34 -0
  15. package/dist/lib/browser/chunk-M5IC326L.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-XYNO72GQ.mjs → chunk-NQPYE365.mjs} +435 -478
  17. package/dist/lib/browser/chunk-NQPYE365.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-TGX63LTL.mjs +8 -0
  19. package/dist/lib/browser/{chunk-FHQTHCX7.mjs.map → chunk-TGX63LTL.mjs.map} +1 -1
  20. package/dist/lib/browser/chunk-TIEBZMTF.mjs +44 -0
  21. package/dist/lib/browser/chunk-TIEBZMTF.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-WEBSGU5L.mjs +80 -0
  23. package/dist/lib/browser/chunk-WEBSGU5L.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-YAFEA4GV.mjs +1 -0
  25. package/dist/lib/browser/{chunk-6Y7PZV72.mjs → chunk-YNFPIQGB.mjs} +2 -3
  26. package/dist/lib/browser/{chunk-6Y7PZV72.mjs.map → chunk-YNFPIQGB.mjs.map} +3 -3
  27. package/dist/lib/browser/cli/index.mjs +89 -0
  28. package/dist/lib/browser/cli/index.mjs.map +7 -0
  29. package/dist/lib/browser/common/activation-events.mjs +23 -0
  30. package/dist/lib/browser/common/capabilities.mjs +45 -0
  31. package/dist/lib/browser/core/activation-event.mjs +1 -1
  32. package/dist/lib/browser/core/capability.mjs +1 -1
  33. package/dist/lib/browser/core/plugin-manager.mjs +4 -4
  34. package/dist/lib/browser/core/plugin.mjs +2 -2
  35. package/dist/lib/browser/index.mjs +37 -132
  36. package/dist/lib/browser/index.mjs.map +4 -4
  37. package/dist/lib/browser/{invoker-capability-SZRSTHEH.mjs → invoker-capability-4AUGUMM5.mjs} +16 -12
  38. package/dist/lib/browser/invoker-capability-4AUGUMM5.mjs.map +7 -0
  39. package/dist/lib/browser/meta.json +1 -1
  40. package/dist/lib/browser/testing/index.mjs +28 -20
  41. package/dist/lib/browser/testing/index.mjs.map +3 -3
  42. package/dist/lib/browser/{react → ui}/index.mjs +18 -19
  43. package/dist/lib/node-esm/{capability-CFLQ2QQU.mjs → capability-R5O2OYX4.mjs} +15 -11
  44. package/dist/lib/node-esm/capability-R5O2OYX4.mjs.map +7 -0
  45. package/dist/lib/node-esm/capability-SA6LPYGL.mjs +35 -0
  46. package/dist/lib/node-esm/capability-SA6LPYGL.mjs.map +7 -0
  47. package/dist/lib/node-esm/{chunk-663A54LQ.mjs → chunk-3D66SZHP.mjs} +2 -2
  48. package/dist/lib/node-esm/chunk-3D66SZHP.mjs.map +7 -0
  49. package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs → chunk-6REV5DE7.mjs} +1 -1
  50. package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs.map → chunk-6REV5DE7.mjs.map} +1 -1
  51. package/dist/lib/node-esm/{chunk-6WXBT3EC.mjs → chunk-FHWPWQRJ.mjs} +435 -478
  52. package/dist/lib/node-esm/chunk-FHWPWQRJ.mjs.map +7 -0
  53. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs → chunk-FKE4Z3D6.mjs} +2 -2
  54. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs.map → chunk-FKE4Z3D6.mjs.map} +1 -1
  55. package/dist/lib/node-esm/{chunk-GT6OKM5I.mjs → chunk-JHFY3HTS.mjs} +6 -6
  56. package/dist/lib/node-esm/chunk-JHFY3HTS.mjs.map +7 -0
  57. package/dist/lib/node-esm/{chunk-XYQTBFPA.mjs → chunk-JIVXIJ2T.mjs} +48 -31
  58. package/dist/lib/node-esm/chunk-JIVXIJ2T.mjs.map +7 -0
  59. package/dist/lib/node-esm/chunk-NHXBSAQR.mjs +35 -0
  60. package/dist/lib/node-esm/chunk-NHXBSAQR.mjs.map +7 -0
  61. package/dist/lib/node-esm/{chunk-STMXUEPO.mjs → chunk-SB5ODNPX.mjs} +2 -3
  62. package/dist/lib/node-esm/{chunk-STMXUEPO.mjs.map → chunk-SB5ODNPX.mjs.map} +3 -3
  63. package/dist/lib/node-esm/chunk-SCDGIGGU.mjs +45 -0
  64. package/dist/lib/node-esm/chunk-SCDGIGGU.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-SQICGJBW.mjs +81 -0
  66. package/dist/lib/node-esm/chunk-SQICGJBW.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +2 -0
  68. package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs.map +7 -0
  69. package/dist/lib/node-esm/cli/index.mjs +90 -0
  70. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  71. package/dist/lib/node-esm/common/activation-events.mjs +24 -0
  72. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  73. package/dist/lib/node-esm/common/capabilities.mjs +46 -0
  74. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  75. package/dist/lib/node-esm/core/activation-event.mjs +1 -1
  76. package/dist/lib/node-esm/core/capability.mjs +1 -1
  77. package/dist/lib/node-esm/core/plugin-manager.mjs +4 -4
  78. package/dist/lib/node-esm/core/plugin.mjs +2 -2
  79. package/dist/lib/node-esm/index.mjs +37 -132
  80. package/dist/lib/node-esm/index.mjs.map +4 -4
  81. package/dist/lib/node-esm/{invoker-capability-PNMA5JOS.mjs → invoker-capability-3YDIVDWV.mjs} +16 -12
  82. package/dist/lib/node-esm/invoker-capability-3YDIVDWV.mjs.map +7 -0
  83. package/dist/lib/node-esm/meta.json +1 -1
  84. package/dist/lib/node-esm/testing/index.mjs +28 -20
  85. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  86. package/dist/lib/node-esm/{react → ui}/index.mjs +18 -19
  87. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  88. package/dist/types/src/{cli.d.ts → cli/cli.d.ts} +2 -2
  89. package/dist/types/src/cli/cli.d.ts.map +1 -0
  90. package/dist/types/src/cli/index.d.ts +2 -0
  91. package/dist/types/src/cli/index.d.ts.map +1 -0
  92. package/dist/types/src/common/activation-events.d.ts +27 -0
  93. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  94. package/dist/types/src/common/capabilities.d.ts +115 -0
  95. package/dist/types/src/common/capabilities.d.ts.map +1 -0
  96. package/dist/types/src/common/index.d.ts +4 -9
  97. package/dist/types/src/common/index.d.ts.map +1 -1
  98. package/dist/types/src/common/operations.d.ts +1 -348
  99. package/dist/types/src/common/operations.d.ts.map +1 -1
  100. package/dist/types/src/common/translations.d.ts +0 -9
  101. package/dist/types/src/common/translations.d.ts.map +1 -1
  102. package/dist/types/src/core/activation-event.d.ts +1 -1
  103. package/dist/types/src/core/capability.d.ts +7 -7
  104. package/dist/types/src/core/capability.d.ts.map +1 -1
  105. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  106. package/dist/types/src/core/plugin.d.ts +1 -1
  107. package/dist/types/src/core/plugin.d.ts.map +1 -1
  108. package/dist/types/src/index.d.ts +1 -3
  109. package/dist/types/src/index.d.ts.map +1 -1
  110. package/dist/types/src/plugin-operation/history/capability.d.ts +1 -1
  111. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +11 -3
  112. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -1
  113. package/dist/types/src/plugin-operation/invoker-capability.d.ts +1 -1
  114. package/dist/types/src/plugin-runtime/capability.d.ts +2 -2
  115. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -1
  116. package/dist/types/src/testing/withPluginManager.d.ts +1 -1
  117. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  118. package/dist/types/src/{react → ui/components/App}/App.d.ts +1 -1
  119. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  120. package/dist/types/src/{react/Surface.stories.d.ts → ui/components/App/App.stories.d.ts} +7 -2
  121. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  122. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  123. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  124. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  125. package/dist/types/src/{react → ui/components/PluginManager}/PluginManagerProvider.d.ts +1 -1
  126. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  127. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  128. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  129. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +12 -0
  130. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  131. package/dist/types/src/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
  132. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  133. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  134. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  135. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  136. package/dist/types/src/ui/components/Surface/index.d.ts +20 -0
  137. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  138. package/dist/types/src/{common/surface.d.ts → ui/components/Surface/types.d.ts} +20 -18
  139. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  140. package/dist/types/src/ui/components/index.d.ts +4 -0
  141. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  142. package/dist/types/src/ui/hooks/index.d.ts +7 -0
  143. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  144. package/dist/types/src/{react → ui/hooks}/useApp.d.ts +14 -9
  145. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  146. package/dist/types/src/{react → ui/hooks}/useCapabilities.d.ts +6 -1
  147. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  148. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  149. package/dist/types/src/{react → ui/hooks}/useOperationResolver.d.ts +2 -2
  150. package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +1 -0
  151. package/dist/types/src/{react/common.d.ts → ui/hooks/useSettingsState.d.ts} +1 -5
  152. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  153. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  154. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  155. package/dist/types/src/ui/index.d.ts +3 -0
  156. package/dist/types/src/ui/index.d.ts.map +1 -0
  157. package/dist/types/tsconfig.tsbuildinfo +1 -1
  158. package/moon.yml +6 -6
  159. package/package.json +72 -64
  160. package/src/{cli.ts → cli/cli.ts} +10 -10
  161. package/src/{playground/debug → cli}/index.ts +1 -1
  162. package/src/common/activation-events.ts +44 -0
  163. package/src/common/capabilities.ts +178 -0
  164. package/src/common/index.ts +4 -9
  165. package/src/common/operations.ts +2 -376
  166. package/src/common/translations.ts +0 -12
  167. package/src/context.ts +1 -1
  168. package/src/core/activation-event.ts +1 -1
  169. package/src/core/capability.ts +9 -9
  170. package/src/core/plugin-manager.test.ts +44 -44
  171. package/src/core/plugin-manager.ts +19 -0
  172. package/src/core/plugin.ts +3 -2
  173. package/src/index.ts +1 -3
  174. package/src/plugin-operation/OperationPlugin.ts +5 -5
  175. package/src/plugin-operation/history/capability.ts +5 -5
  176. package/src/plugin-operation/history/undo-mapping.ts +6 -3
  177. package/src/plugin-operation/invoker-capability.ts +5 -5
  178. package/src/plugin-operation/meta.ts +1 -1
  179. package/src/plugin-runtime/RuntimePlugin.ts +4 -4
  180. package/src/plugin-runtime/capability.ts +5 -5
  181. package/src/plugin-runtime/meta.ts +1 -1
  182. package/src/testing/service.ts +6 -6
  183. package/src/testing/withPluginManager.stories.tsx +6 -6
  184. package/src/testing/withPluginManager.tsx +11 -8
  185. package/src/ui/components/App/App.stories.tsx +92 -0
  186. package/src/{react → ui/components/App}/App.tsx +6 -9
  187. package/src/{playground/layout → ui/components/App}/index.ts +1 -1
  188. package/src/{react → ui/components/PluginManager}/PluginManagerContext.stories.tsx +13 -14
  189. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +1 -1
  190. package/src/ui/components/PluginManager/index.ts +5 -0
  191. package/src/{react/Surface.stories.tsx → ui/components/Surface/SurfaceComponent.stories.tsx} +18 -16
  192. package/src/{react/Surface.tsx → ui/components/Surface/SurfaceComponent.tsx} +36 -56
  193. package/src/{react → ui/components/Surface}/SurfaceInfo.tsx +2 -2
  194. package/src/ui/components/Surface/context.ts +12 -0
  195. package/src/ui/components/Surface/index.ts +20 -0
  196. package/src/{common/surface.ts → ui/components/Surface/types.ts} +22 -25
  197. package/src/ui/components/index.ts +7 -0
  198. package/src/ui/hooks/index.ts +10 -0
  199. package/src/{react → ui/hooks}/useApp.tsx +29 -25
  200. package/src/{react → ui/hooks}/useCapabilities.ts +9 -5
  201. package/src/{react → ui/hooks}/useOperationResolver.ts +5 -5
  202. package/src/{react/common.ts → ui/hooks/useSettingsState.ts} +0 -11
  203. package/src/ui/hooks/useSurface.ts +13 -0
  204. package/src/ui/index.ts +6 -0
  205. package/tsconfig.json +2 -29
  206. package/tsconfig.node.json +1 -3
  207. package/typedoc.json +2 -4
  208. package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs +0 -149
  209. package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs.map +0 -7
  210. package/dist/lib/browser/capability-7PCNSWBT.mjs.map +0 -7
  211. package/dist/lib/browser/capability-KP3PFEXD.mjs +0 -31
  212. package/dist/lib/browser/capability-KP3PFEXD.mjs.map +0 -7
  213. package/dist/lib/browser/chunk-7IQHKD4U.mjs.map +0 -7
  214. package/dist/lib/browser/chunk-BLQJSGL3.mjs +0 -732
  215. package/dist/lib/browser/chunk-BLQJSGL3.mjs.map +0 -7
  216. package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
  217. package/dist/lib/browser/chunk-FMZN33N4.mjs.map +0 -7
  218. package/dist/lib/browser/chunk-H4WPA7U7.mjs +0 -77
  219. package/dist/lib/browser/chunk-H4WPA7U7.mjs.map +0 -7
  220. package/dist/lib/browser/chunk-TCLLRCS3.mjs.map +0 -7
  221. package/dist/lib/browser/chunk-XYNO72GQ.mjs.map +0 -7
  222. package/dist/lib/browser/common/index.mjs +0 -38
  223. package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs.map +0 -7
  224. package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs +0 -64
  225. package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs.map +0 -7
  226. package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs +0 -150
  227. package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs.map +0 -7
  228. package/dist/lib/node-esm/capability-CFLQ2QQU.mjs.map +0 -7
  229. package/dist/lib/node-esm/capability-RCUNM2M7.mjs +0 -32
  230. package/dist/lib/node-esm/capability-RCUNM2M7.mjs.map +0 -7
  231. package/dist/lib/node-esm/chunk-663A54LQ.mjs.map +0 -7
  232. package/dist/lib/node-esm/chunk-6WXBT3EC.mjs.map +0 -7
  233. package/dist/lib/node-esm/chunk-GQEBIGKD.mjs +0 -733
  234. package/dist/lib/node-esm/chunk-GQEBIGKD.mjs.map +0 -7
  235. package/dist/lib/node-esm/chunk-GT6OKM5I.mjs.map +0 -7
  236. package/dist/lib/node-esm/chunk-XR6NMKEP.mjs +0 -78
  237. package/dist/lib/node-esm/chunk-XR6NMKEP.mjs.map +0 -7
  238. package/dist/lib/node-esm/chunk-XYQTBFPA.mjs.map +0 -7
  239. package/dist/lib/node-esm/common/index.mjs +0 -39
  240. package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs.map +0 -7
  241. package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs +0 -65
  242. package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs.map +0 -7
  243. package/dist/types/src/cli.d.ts.map +0 -1
  244. package/dist/types/src/common/activation-event.d.ts +0 -66
  245. package/dist/types/src/common/activation-event.d.ts.map +0 -1
  246. package/dist/types/src/common/capability.d.ts +0 -265
  247. package/dist/types/src/common/capability.d.ts.map +0 -1
  248. package/dist/types/src/common/collaboration.d.ts +0 -26
  249. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  250. package/dist/types/src/common/file.d.ts +0 -14
  251. package/dist/types/src/common/file.d.ts.map +0 -1
  252. package/dist/types/src/common/graph.d.ts +0 -21
  253. package/dist/types/src/common/graph.d.ts.map +0 -1
  254. package/dist/types/src/common/plugin.d.ts +0 -201
  255. package/dist/types/src/common/plugin.d.ts.map +0 -1
  256. package/dist/types/src/common/surface.d.ts.map +0 -1
  257. package/dist/types/src/playground/debug/Debug.d.ts +0 -8
  258. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  259. package/dist/types/src/playground/debug/index.d.ts +0 -2
  260. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  261. package/dist/types/src/playground/debug/plugin.d.ts +0 -3
  262. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  263. package/dist/types/src/playground/generator/Main.d.ts +0 -8
  264. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  265. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -8
  266. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  267. package/dist/types/src/playground/generator/generator.d.ts +0 -19
  268. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  269. package/dist/types/src/playground/generator/index.d.ts +0 -3
  270. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  271. package/dist/types/src/playground/generator/plugin.d.ts +0 -3
  272. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  273. package/dist/types/src/playground/layout/Layout.d.ts +0 -10
  274. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  275. package/dist/types/src/playground/layout/index.d.ts +0 -2
  276. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  277. package/dist/types/src/playground/layout/plugin.d.ts +0 -3
  278. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  279. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -8
  280. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  281. package/dist/types/src/playground/logger/index.d.ts +0 -2
  282. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  283. package/dist/types/src/playground/logger/plugin.d.ts +0 -3
  284. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  285. package/dist/types/src/playground/logger/schema.d.ts +0 -27
  286. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  287. package/dist/types/src/playground/playground.stories.d.ts +0 -11
  288. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  289. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -3
  290. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  291. package/dist/types/src/plugin-settings/actions.d.ts +0 -61
  292. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  293. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -6
  294. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  295. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  296. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  297. package/dist/types/src/plugin-settings/meta.d.ts +0 -3
  298. package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
  299. package/dist/types/src/plugin-settings/operation-resolver.d.ts +0 -6
  300. package/dist/types/src/plugin-settings/operation-resolver.d.ts.map +0 -1
  301. package/dist/types/src/plugin-settings/translations.d.ts +0 -11
  302. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  303. package/dist/types/src/react/App.d.ts.map +0 -1
  304. package/dist/types/src/react/App.stories.d.ts.map +0 -1
  305. package/dist/types/src/react/DefaultFallback.d.ts +0 -8
  306. package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
  307. package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
  308. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  309. package/dist/types/src/react/PluginManagerContext.stories.d.ts.map +0 -1
  310. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  311. package/dist/types/src/react/Surface.d.ts +0 -14
  312. package/dist/types/src/react/Surface.d.ts.map +0 -1
  313. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  314. package/dist/types/src/react/SurfaceInfo.d.ts.map +0 -1
  315. package/dist/types/src/react/common.d.ts.map +0 -1
  316. package/dist/types/src/react/index.d.ts +0 -9
  317. package/dist/types/src/react/index.d.ts.map +0 -1
  318. package/dist/types/src/react/types.d.ts +0 -12
  319. package/dist/types/src/react/types.d.ts.map +0 -1
  320. package/dist/types/src/react/useApp.d.ts.map +0 -1
  321. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  322. package/dist/types/src/react/useLoading.d.ts.map +0 -1
  323. package/dist/types/src/react/useOperationResolver.d.ts.map +0 -1
  324. package/src/common/activation-event.ts +0 -99
  325. package/src/common/capability.ts +0 -343
  326. package/src/common/collaboration.ts +0 -31
  327. package/src/common/file.ts +0 -22
  328. package/src/common/graph.ts +0 -30
  329. package/src/common/plugin.ts +0 -364
  330. package/src/playground/debug/Debug.tsx +0 -49
  331. package/src/playground/debug/plugin.ts +0 -16
  332. package/src/playground/generator/Main.tsx +0 -80
  333. package/src/playground/generator/Toolbar.tsx +0 -57
  334. package/src/playground/generator/generator.ts +0 -48
  335. package/src/playground/generator/index.ts +0 -6
  336. package/src/playground/generator/plugin.ts +0 -21
  337. package/src/playground/layout/Layout.tsx +0 -37
  338. package/src/playground/layout/plugin.ts +0 -18
  339. package/src/playground/logger/Toolbar.tsx +0 -33
  340. package/src/playground/logger/index.ts +0 -5
  341. package/src/playground/logger/plugin.ts +0 -42
  342. package/src/playground/logger/schema.ts +0 -22
  343. package/src/playground/playground.stories.tsx +0 -54
  344. package/src/plugin-settings/SettingsPlugin.ts +0 -19
  345. package/src/plugin-settings/actions.ts +0 -64
  346. package/src/plugin-settings/app-graph-builder.ts +0 -140
  347. package/src/plugin-settings/index.ts +0 -6
  348. package/src/plugin-settings/meta.ts +0 -10
  349. package/src/plugin-settings/operation-resolver.ts +0 -55
  350. package/src/plugin-settings/translations.ts +0 -19
  351. package/src/react/App.stories.tsx +0 -63
  352. package/src/react/DefaultFallback.tsx +0 -26
  353. package/src/react/ErrorBoundary.tsx +0 -56
  354. package/src/react/index.ts +0 -14
  355. package/src/react/types.ts +0 -27
  356. /package/dist/lib/{node-esm/react/index.mjs.map → browser/chunk-YAFEA4GV.mjs.map} +0 -0
  357. /package/dist/lib/{node-esm/common/index.mjs.map → browser/common/activation-events.mjs.map} +0 -0
  358. /package/dist/lib/browser/{react/index.mjs.map → common/capabilities.mjs.map} +0 -0
  359. /package/dist/lib/browser/{common → ui}/index.mjs.map +0 -0
  360. /package/dist/types/src/{react → ui/components/PluginManager}/PluginManagerContext.stories.d.ts +0 -0
  361. /package/dist/types/src/{react → ui/components/Surface}/SurfaceInfo.d.ts +0 -0
  362. /package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +0 -0
  363. /package/src/{react → ui/hooks}/useLoading.tsx +0 -0
@@ -4,8 +4,6 @@
4
4
 
5
5
  import { createConfig } from '../../../../tools/storybook-react/.storybook/main';
6
6
 
7
- export const stories = [
8
- '../src/**/*.stories.tsx',
9
- ]
7
+ export const stories = ['../src/**/*.stories.tsx'];
10
8
 
11
9
  export default createConfig({ stories });
@@ -1,15 +1,19 @@
1
+ import "./chunk-TIEBZMTF.mjs";
1
2
  import {
2
- ActivationEvent,
3
- Capability
4
- } from "./chunk-BLQJSGL3.mjs";
5
- import "./chunk-FMZN33N4.mjs";
6
- import "./chunk-PKQT6C53.mjs";
3
+ capabilities_exports
4
+ } from "./chunk-WEBSGU5L.mjs";
5
+ import {
6
+ activation_events_exports
7
+ } from "./chunk-M5IC326L.mjs";
8
+ import "./chunk-YAFEA4GV.mjs";
9
+ import "./chunk-2UI6ACB5.mjs";
10
+ import "./chunk-272IPLHQ.mjs";
7
11
  import {
8
12
  plugin_exports
9
- } from "./chunk-TCLLRCS3.mjs";
13
+ } from "./chunk-7M4467QR.mjs";
10
14
  import {
11
15
  capability_exports
12
- } from "./chunk-6Y7PZV72.mjs";
16
+ } from "./chunk-YNFPIQGB.mjs";
13
17
  import "./chunk-J5LGTIGS.mjs";
14
18
 
15
19
  // src/plugin-runtime/capability.ts
@@ -19,15 +23,15 @@ import * as ManagedRuntime from "effect/ManagedRuntime";
19
23
  var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
20
24
  const capabilityManager = yield* capability_exports.Service;
21
25
  const pluginManager = yield* plugin_exports.Service;
22
- yield* plugin_exports.activate(ActivationEvent.SetupLayer);
23
- const layers = yield* capability_exports.getAll(Capability.Layer);
26
+ yield* plugin_exports.activate(activation_events_exports.SetupLayer);
27
+ const layers = yield* capability_exports.getAll(capabilities_exports.Layer);
24
28
  const capabilityServiceLayer = Layer.succeed(capability_exports.Service, capabilityManager);
25
29
  const pluginServiceLayer = Layer.succeed(plugin_exports.Service, pluginManager);
26
30
  const composedLayer = layers.length > 0 ? Layer.mergeAll(capabilityServiceLayer, pluginServiceLayer, ...layers) : Layer.mergeAll(capabilityServiceLayer, pluginServiceLayer);
27
31
  const runtime = ManagedRuntime.make(composedLayer);
28
- return capability_exports.contributes(Capability.ManagedRuntime, runtime);
32
+ return capability_exports.contributes(capabilities_exports.ManagedRuntime, runtime);
29
33
  }));
30
34
  export {
31
35
  capability_default as default
32
36
  };
33
- //# sourceMappingURL=capability-7PCNSWBT.mjs.map
37
+ //# sourceMappingURL=capability-6YMUBS54.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,34 @@
1
+ import {
2
+ make,
3
+ make2
4
+ } from "./chunk-JGWCBVKJ.mjs";
5
+ import "./chunk-TIEBZMTF.mjs";
6
+ import {
7
+ capabilities_exports
8
+ } from "./chunk-WEBSGU5L.mjs";
9
+ import "./chunk-M5IC326L.mjs";
10
+ import "./chunk-YAFEA4GV.mjs";
11
+ import "./chunk-2UI6ACB5.mjs";
12
+ import "./chunk-272IPLHQ.mjs";
13
+ import "./chunk-7M4467QR.mjs";
14
+ import {
15
+ capability_exports
16
+ } from "./chunk-YNFPIQGB.mjs";
17
+ import "./chunk-J5LGTIGS.mjs";
18
+
19
+ // src/plugin-operation/history/capability.ts
20
+ import * as Effect from "effect/Effect";
21
+ var capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
22
+ const capabilities = yield* capability_exports.Service;
23
+ const undoRegistry = make(() => capabilities.getAll(capabilities_exports.UndoMapping).flat());
24
+ const invoker = yield* capability_exports.get(capabilities_exports.OperationInvoker);
25
+ const historyTracker = make2(invoker, undoRegistry);
26
+ return [
27
+ capability_exports.contributes(capabilities_exports.UndoRegistry, undoRegistry),
28
+ capability_exports.contributes(capabilities_exports.HistoryTracker, historyTracker)
29
+ ];
30
+ }));
31
+ export {
32
+ capability_default as default
33
+ };
34
+ //# sourceMappingURL=capability-LF3OXSCV.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';\n\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;AAcxB,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
+ }
@@ -44,4 +44,4 @@ export {
44
44
  getEvents,
45
45
  activation_event_exports
46
46
  };
47
- //# sourceMappingURL=chunk-PKQT6C53.mjs.map
47
+ //# sourceMappingURL=chunk-272IPLHQ.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/core/activation-event.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * A unique string identifier representing an event.\n * This is expected to be a URI, where initial parts are often the id of the plugin whose package defines the event.\n *\n * @example dxos.org/plugin/example/event/ready\n */\nexport type ActivationEvent = {\n id: string;\n specifier?: string;\n};\n\n/**\n * An activation event that can be a single event, or a combination of events.\n */\nexport type Events =\n | ActivationEvent\n | { type: 'one-of'; events: ActivationEvent[] }\n | { type: 'all-of'; events: ActivationEvent[] };\n\n/**\n * Helper to define an activation event.\n */\nexport const make = (id: string, specifier?: string) => {\n return { id, specifier } as ActivationEvent;\n};\n\n/**\n * Helper to create an activation event key.\n */\nexport const eventKey = (event: ActivationEvent) => (event.specifier ? `${event.id}:${event.specifier}` : event.id);\n\n/**\n * Helper to create an activation event that triggers when any of the given events are activated.\n */\nexport const oneOf = (...events: ActivationEvent[]) => ({ type: 'one-of' as const, events });\n\n/**\n * Helper to create an activation event that triggers when all of the given events are activated.\n */\nexport const allOf = (...events: ActivationEvent[]) => ({ type: 'all-of' as const, events });\n\n/**\n * Helper to check if an activation event is a one-of event.\n */\nexport const isOneOf = (events: Events): events is { type: 'one-of'; events: ActivationEvent[] } =>\n 'type' in events && events.type === 'one-of';\n\n/**\n * Helper to check if an activation event is an all-of event.\n */\nexport const isAllOf = (events: Events): events is { type: 'all-of'; events: ActivationEvent[] } =>\n 'type' in events && events.type === 'all-of';\n\n/**\n * Helper to get the events from an activation event.\n */\nexport const getEvents = (events: Events) => ('type' in events ? events.events : [events]);\n"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * A unique string identifier representing an event.\n * This is expected to be a URI, where initial parts are often the id of the plugin whose package defines the event.\n *\n * @example org.dxos.plugin.example.event.ready\n */\nexport type ActivationEvent = {\n id: string;\n specifier?: string;\n};\n\n/**\n * An activation event that can be a single event, or a combination of events.\n */\nexport type Events =\n | ActivationEvent\n | { type: 'one-of'; events: ActivationEvent[] }\n | { type: 'all-of'; events: ActivationEvent[] };\n\n/**\n * Helper to define an activation event.\n */\nexport const make = (id: string, specifier?: string) => {\n return { id, specifier } as ActivationEvent;\n};\n\n/**\n * Helper to create an activation event key.\n */\nexport const eventKey = (event: ActivationEvent) => (event.specifier ? `${event.id}:${event.specifier}` : event.id);\n\n/**\n * Helper to create an activation event that triggers when any of the given events are activated.\n */\nexport const oneOf = (...events: ActivationEvent[]) => ({ type: 'one-of' as const, events });\n\n/**\n * Helper to create an activation event that triggers when all of the given events are activated.\n */\nexport const allOf = (...events: ActivationEvent[]) => ({ type: 'all-of' as const, events });\n\n/**\n * Helper to check if an activation event is a one-of event.\n */\nexport const isOneOf = (events: Events): events is { type: 'one-of'; events: ActivationEvent[] } =>\n 'type' in events && events.type === 'one-of';\n\n/**\n * Helper to check if an activation event is an all-of event.\n */\nexport const isAllOf = (events: Events): events is { type: 'all-of'; events: ActivationEvent[] } =>\n 'type' in events && events.type === 'all-of';\n\n/**\n * Helper to get the events from an activation event.\n */\nexport const getEvents = (events: Events) => ('type' in events ? events.events : [events]);\n"],
5
5
  "mappings": ";;;;;AAAA;;;;;;;;;;AA0BO,IAAMA,OAAO,CAACC,IAAYC,cAAAA;AAC/B,SAAO;IAAED;IAAIC;EAAU;AACzB;AAKO,IAAMC,WAAW,CAACC,UAA4BA,MAAMF,YAAY,GAAGE,MAAMH,EAAE,IAAIG,MAAMF,SAAS,KAAKE,MAAMH;AAKzG,IAAMI,QAAQ,IAAIC,YAA+B;EAAEC,MAAM;EAAmBD;AAAO;AAKnF,IAAME,QAAQ,IAAIF,YAA+B;EAAEC,MAAM;EAAmBD;AAAO;AAKnF,IAAMG,UAAU,CAACH,WACtB,UAAUA,UAAUA,OAAOC,SAAS;AAK/B,IAAMG,UAAU,CAACJ,WACtB,UAAUA,UAAUA,OAAOC,SAAS;AAK/B,IAAMI,YAAY,CAACL,WAAoB,UAAUA,SAASA,OAAOA,SAAS;EAACA;;",
6
6
  "names": ["make", "id", "specifier", "eventKey", "event", "oneOf", "events", "type", "allOf", "isOneOf", "isAllOf", "getEvents"]
7
7
  }
@@ -2,13 +2,13 @@ import {
2
2
  eventKey,
3
3
  getEvents,
4
4
  isAllOf
5
- } from "./chunk-PKQT6C53.mjs";
5
+ } from "./chunk-272IPLHQ.mjs";
6
6
  import {
7
7
  Service as Service2
8
- } from "./chunk-TCLLRCS3.mjs";
8
+ } from "./chunk-7M4467QR.mjs";
9
9
  import {
10
10
  Service
11
- } from "./chunk-6Y7PZV72.mjs";
11
+ } from "./chunk-YNFPIQGB.mjs";
12
12
  import {
13
13
  __export
14
14
  } from "./chunk-J5LGTIGS.mjs";
@@ -32,6 +32,7 @@ import * as HashSet from "effect/HashSet";
32
32
  import * as PubSub from "effect/PubSub";
33
33
  import * as Ref from "effect/Ref";
34
34
  import { runAndForwardErrors } from "@dxos/effect";
35
+ import { Performance } from "@dxos/effect";
35
36
  import { log as log2 } from "@dxos/log";
36
37
 
37
38
  // src/core/capability-manager.ts
@@ -177,7 +178,7 @@ var make2 = (options) => new CapabilityManagerImpl(options);
177
178
 
178
179
  // src/core/plugin-manager.ts
179
180
  var __dxlog_file2 = "/__w/dxos/dxos/packages/sdk/app-framework/src/core/plugin-manager.ts";
180
- var ManagerTypeId = Symbol.for("@dxos/app-framework/Manager");
181
+ var ManagerTypeId = /* @__PURE__ */ Symbol.for("@dxos/app-framework/Manager");
181
182
  var isManager = (value) => {
182
183
  return typeof value === "object" && value !== null && ManagerTypeId in value;
183
184
  };
@@ -285,7 +286,7 @@ var ManagerImpl = class {
285
286
  id
286
287
  }, {
287
288
  F: __dxlog_file2,
288
- L: 210,
289
+ L: 211,
289
290
  S: this,
290
291
  C: (f, a) => f(...a)
291
292
  });
@@ -304,7 +305,7 @@ var ManagerImpl = class {
304
305
  id
305
306
  }, {
306
307
  F: __dxlog_file2,
307
- L: 223,
308
+ L: 224,
308
309
  S: this,
309
310
  C: (f, a) => f(...a)
310
311
  });
@@ -326,7 +327,7 @@ var ManagerImpl = class {
326
327
  ]
327
328
  }, {
328
329
  F: __dxlog_file2,
329
- L: 236,
330
+ L: 237,
330
331
  S: this,
331
332
  C: (f, a) => f(...a)
332
333
  });
@@ -345,7 +346,7 @@ var ManagerImpl = class {
345
346
  id
346
347
  }, {
347
348
  F: __dxlog_file2,
348
- L: 251,
349
+ L: 252,
349
350
  S: this,
350
351
  C: (f, a) => f(...a)
351
352
  });
@@ -366,7 +367,7 @@ var ManagerImpl = class {
366
367
  id
367
368
  }, {
368
369
  F: __dxlog_file2,
369
- L: 267,
370
+ L: 268,
370
371
  S: this,
371
372
  C: (f, a) => f(...a)
372
373
  });
@@ -401,7 +402,7 @@ var ManagerImpl = class {
401
402
  ...params
402
403
  }, {
403
404
  F: __dxlog_file2,
404
- L: 302,
405
+ L: 303,
405
406
  S: this,
406
407
  C: (f, a) => f(...a)
407
408
  });
@@ -426,7 +427,7 @@ var ManagerImpl = class {
426
427
  key
427
428
  }, {
428
429
  F: __dxlog_file2,
429
- L: 337,
430
+ L: 338,
430
431
  S: this,
431
432
  C: (f, a) => f(...a)
432
433
  });
@@ -443,7 +444,7 @@ var ManagerImpl = class {
443
444
  modules: modules.map((module) => module.id)
444
445
  }, {
445
446
  F: __dxlog_file2,
446
- L: 344,
447
+ L: 345,
447
448
  S: this,
448
449
  C: (f, a) => f(...a)
449
450
  });
@@ -461,7 +462,7 @@ var ManagerImpl = class {
461
462
  beforeEvents: beforeEvents.map(eventKey)
462
463
  }, {
463
464
  F: __dxlog_file2,
464
- L: 363,
465
+ L: 364,
465
466
  S: this,
466
467
  C: (f, a) => f(...a)
467
468
  }))))));
@@ -493,7 +494,7 @@ var ManagerImpl = class {
493
494
  afterEvents: afterEvents.map(eventKey)
494
495
  }, {
495
496
  F: __dxlog_file2,
496
- L: 412,
497
+ L: 413,
497
498
  S: this,
498
499
  C: (f, a) => f(...a)
499
500
  }))))));
@@ -513,7 +514,7 @@ var ManagerImpl = class {
513
514
  key
514
515
  }, {
515
516
  F: __dxlog_file2,
516
- L: 432,
517
+ L: 433,
517
518
  S: this,
518
519
  C: (f, a) => f(...a)
519
520
  });
@@ -522,10 +523,18 @@ var ManagerImpl = class {
522
523
  event: key
523
524
  }, {
524
525
  F: __dxlog_file2,
525
- L: 438,
526
+ L: 439,
526
527
  S: this,
527
528
  C: (f, a) => f(...a)
528
- }))))));
529
+ }))))), Performance.addTrackEntry({
530
+ name: typeof event === "string" ? event : eventKey(event),
531
+ devtools: {
532
+ dataType: "track-entry",
533
+ track: "Event Activation",
534
+ trackGroup: "Composer",
535
+ color: "primary"
536
+ }
537
+ }));
529
538
  }
530
539
  /**
531
540
  * Deactivates all of the modules for a plugin.
@@ -557,7 +566,7 @@ var ManagerImpl = class {
557
566
  key
558
567
  }, {
559
568
  F: __dxlog_file2,
560
- L: 473,
569
+ L: 483,
561
570
  S: this,
562
571
  C: (f, a) => f(...a)
563
572
  });
@@ -586,7 +595,7 @@ var ManagerImpl = class {
586
595
  id: plugin.meta.id
587
596
  }, {
588
597
  F: __dxlog_file2,
589
- L: 501,
598
+ L: 511,
590
599
  S: this,
591
600
  C: (f, a) => f(...a)
592
601
  });
@@ -600,7 +609,7 @@ var ManagerImpl = class {
600
609
  id
601
610
  }, {
602
611
  F: __dxlog_file2,
603
- L: 507,
612
+ L: 517,
604
613
  S: this,
605
614
  C: (f, a) => f(...a)
606
615
  });
@@ -611,7 +620,7 @@ var ManagerImpl = class {
611
620
  id: module.id
612
621
  }, {
613
622
  F: __dxlog_file2,
614
- L: 512,
623
+ L: 522,
615
624
  S: this,
616
625
  C: (f, a) => f(...a)
617
626
  });
@@ -625,7 +634,7 @@ var ManagerImpl = class {
625
634
  id
626
635
  }, {
627
636
  F: __dxlog_file2,
628
- L: 518,
637
+ L: 528,
629
638
  S: this,
630
639
  C: (f, a) => f(...a)
631
640
  });
@@ -659,7 +668,7 @@ var ManagerImpl = class {
659
668
  events: pendingReset
660
669
  }, {
661
670
  F: __dxlog_file2,
662
- L: 558,
671
+ L: 568,
663
672
  S: this,
664
673
  C: (f, a) => f(...a)
665
674
  });
@@ -691,7 +700,7 @@ var ManagerImpl = class {
691
700
  module: module.id
692
701
  }, {
693
702
  F: __dxlog_file2,
694
- L: 588,
703
+ L: 598,
695
704
  S: this,
696
705
  C: (f, a) => f(...a)
697
706
  });
@@ -705,7 +714,7 @@ var ManagerImpl = class {
705
714
  failed: false
706
715
  }, {
707
716
  F: __dxlog_file2,
708
- L: 597,
717
+ L: 607,
709
718
  S: this,
710
719
  C: (f, a) => f(...a)
711
720
  });
@@ -714,10 +723,18 @@ var ManagerImpl = class {
714
723
  module: module.id
715
724
  }, {
716
725
  F: __dxlog_file2,
717
- L: 608,
726
+ L: 618,
718
727
  S: this,
719
728
  C: (f, a) => f(...a)
720
- }))))));
729
+ }))))), Performance.addTrackEntry({
730
+ name: module.id,
731
+ devtools: {
732
+ dataType: "track-entry",
733
+ track: "Module Activation",
734
+ trackGroup: "Composer",
735
+ color: "primary"
736
+ }
737
+ }));
721
738
  yield* Effect2.forkDaemon(loadEffect.pipe(Effect2.tap((result) => Deferred2.succeed(deferred, result)), Effect2.catchAllCause((cause) => {
722
739
  const error = Cause.squash(cause);
723
740
  log2.error("module failed to activate", {
@@ -727,7 +744,7 @@ var ManagerImpl = class {
727
744
  isDefect: !Cause.isFailure(cause)
728
745
  }, {
729
746
  F: __dxlog_file2,
730
- L: 620,
747
+ L: 639,
731
748
  S: this,
732
749
  C: (f, a) => f(...a)
733
750
  });
@@ -759,7 +776,7 @@ var ManagerImpl = class {
759
776
  id
760
777
  }, {
761
778
  F: __dxlog_file2,
762
- L: 654,
779
+ L: 673,
763
780
  S: this,
764
781
  C: (f, a) => f(...a)
765
782
  });
@@ -781,7 +798,7 @@ var ManagerImpl = class {
781
798
  id
782
799
  }, {
783
800
  F: __dxlog_file2,
784
- L: 672,
801
+ L: 691,
785
802
  S: this,
786
803
  C: (f, a) => f(...a)
787
804
  });
@@ -804,4 +821,4 @@ export {
804
821
  make5 as make,
805
822
  plugin_manager_exports
806
823
  };
807
- //# sourceMappingURL=chunk-FMZN33N4.mjs.map
824
+ //# sourceMappingURL=chunk-2UI6ACB5.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/core/plugin-manager.ts", "../../../src/core/capability-manager.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, Registry } from '@effect-atom/atom-react';\nimport * as Array from 'effect/Array';\nimport * as Cause from 'effect/Cause';\nimport * as Deferred from 'effect/Deferred';\nimport * as Duration from 'effect/Duration';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as Function from 'effect/Function';\nimport * as HashSet from 'effect/HashSet';\nimport * as PubSub from 'effect/PubSub';\nimport * as Ref from 'effect/Ref';\n\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { Performance } from '@dxos/effect';\nimport { log } from '@dxos/log';\n\nimport * as ActivationEvent from './activation-event';\nimport * as Capability from './capability';\nimport * as CapabilityManager from './capability-manager';\nimport * as Plugin from './plugin';\n\n/**\n * Identifier denoting a Manager.\n */\nexport const ManagerTypeId: unique symbol = Symbol.for('@dxos/app-framework/Manager');\nexport type ManagerTypeId = typeof ManagerTypeId;\n\nexport type ManagerOptions = {\n pluginLoader: (id: string) => Effect.Effect<Plugin.Plugin, Error>;\n plugins?: Plugin.Plugin[];\n core?: string[];\n enabled?: string[];\n registry?: Registry.Registry;\n};\n\ntype ActivationMessage = { event: string; state: 'activating' | 'activated' | 'error'; error?: Error };\n\n/**\n * Interface for the Plugin Manager.\n */\nexport interface PluginManager {\n readonly [ManagerTypeId]: ManagerTypeId;\n readonly activation: PubSub.PubSub<ActivationMessage>;\n readonly capabilities: CapabilityManager.CapabilityManager;\n readonly registry: Registry.Registry;\n\n readonly plugins: Atom.Atom<readonly Plugin.Plugin[]>;\n readonly core: Atom.Atom<readonly string[]>;\n readonly enabled: Atom.Atom<readonly string[]>;\n readonly modules: Atom.Atom<readonly Plugin.PluginModule[]>;\n readonly active: Atom.Atom<readonly string[]>;\n readonly eventsFired: Atom.Atom<readonly string[]>;\n readonly pendingReset: Atom.Atom<readonly string[]>;\n\n getPlugins(): readonly Plugin.Plugin[];\n getCore(): readonly string[];\n getEnabled(): readonly string[];\n getModules(): readonly Plugin.PluginModule[];\n getActive(): readonly string[];\n getEventsFired(): readonly string[];\n getPendingReset(): readonly string[];\n\n add(id: string): Effect.Effect<boolean, Error>;\n enable(id: string): Effect.Effect<boolean, Error>;\n remove(id: string): boolean;\n disable(id: string): Effect.Effect<boolean, Error>;\n // TODO(wittjosiah): Improve error typing.\n activate(\n event: ActivationEvent.ActivationEvent | string,\n params?: { before?: string; after?: string },\n ): Effect.Effect<boolean, Error>;\n deactivate(id: string): Effect.Effect<boolean, Error>;\n reset(event: ActivationEvent.ActivationEvent | string): Effect.Effect<boolean, Error>;\n}\n\n/**\n * Type guard to check if a value is a PluginManager.\n */\nexport const isManager = (value: unknown): value is PluginManager => {\n return typeof value === 'object' && value !== null && ManagerTypeId in value;\n};\n\n/**\n * Internal implementation of PluginManager.\n */\nclass ManagerImpl implements PluginManager {\n readonly [ManagerTypeId]: ManagerTypeId = ManagerTypeId;\n readonly activation = Effect.runSync(PubSub.unbounded<ActivationMessage>());\n readonly capabilities: CapabilityManager.CapabilityManager;\n readonly registry: Registry.Registry;\n\n private readonly _pluginsAtom: Atom.Writable<Plugin.Plugin[]>;\n private readonly _coreAtom: Atom.Writable<string[]>;\n private readonly _enabledAtom: Atom.Writable<string[]>;\n private readonly _modulesAtom: Atom.Writable<Plugin.PluginModule[]>;\n private readonly _activeAtom: Atom.Writable<string[]>;\n private readonly _eventsFiredAtom: Atom.Writable<string[]>;\n private readonly _pendingResetAtom: Atom.Writable<string[]>;\n private readonly _pluginLoader: ManagerOptions['pluginLoader'];\n private readonly _capabilities = new Map<string, Capability.Any[]>();\n private readonly _moduleMemoMap = new Map<Plugin.PluginModule['id'], Deferred.Deferred<Capability.Any[], Error>>();\n private readonly _moduleSemaphores = new Map<Plugin.PluginModule['id'], Effect.Semaphore>();\n private readonly _activatingEvents = Effect.runSync(Ref.make<string[]>([]));\n private readonly _activatingModules = Effect.runSync(Ref.make<string[]>([]));\n\n constructor({\n pluginLoader,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n enabled = [],\n registry,\n }: ManagerOptions) {\n this.registry = registry ?? Registry.make();\n this.capabilities = CapabilityManager.make({\n registry: this.registry,\n });\n\n this._pluginLoader = pluginLoader;\n this._pluginsAtom = Atom.make(plugins).pipe(Atom.keepAlive);\n this._coreAtom = Atom.make(core).pipe(Atom.keepAlive);\n this._enabledAtom = Atom.make(enabled).pipe(Atom.keepAlive);\n this._modulesAtom = Atom.make<Plugin.PluginModule[]>([]).pipe(Atom.keepAlive);\n this._activeAtom = Atom.make<string[]>([]).pipe(Atom.keepAlive);\n this._eventsFiredAtom = Atom.make<string[]>([]).pipe(Atom.keepAlive);\n this._pendingResetAtom = Atom.make<string[]>([]).pipe(Atom.keepAlive);\n plugins.forEach((plugin) => this._addPlugin(plugin));\n void Effect.all([...core, ...enabled].map((id) => this.enable(id))).pipe(runAndForwardErrors);\n }\n\n get plugins(): Atom.Atom<readonly Plugin.Plugin[]> {\n return this._pluginsAtom;\n }\n\n get core(): Atom.Atom<readonly string[]> {\n return this._coreAtom;\n }\n\n /**\n * Ids of plugins that are currently enabled.\n */\n get enabled(): Atom.Atom<readonly string[]> {\n return this._enabledAtom;\n }\n\n /**\n * Modules of plugins which are currently enabled.\n */\n get modules(): Atom.Atom<readonly Plugin.PluginModule[]> {\n return this._modulesAtom;\n }\n\n /**\n * Ids of modules which are currently active.\n */\n get active(): Atom.Atom<readonly string[]> {\n return this._activeAtom;\n }\n\n /**\n * Ids of events which have been fired.\n */\n get eventsFired(): Atom.Atom<readonly string[]> {\n return this._eventsFiredAtom;\n }\n\n /**\n * Ids of modules which are pending reset.\n */\n get pendingReset(): Atom.Atom<readonly string[]> {\n return this._pendingResetAtom;\n }\n\n getPlugins(): readonly Plugin.Plugin[] {\n return this._get(this._pluginsAtom);\n }\n\n getCore(): readonly string[] {\n return this._get(this._coreAtom);\n }\n\n getEnabled(): readonly string[] {\n return this._get(this._enabledAtom);\n }\n\n getModules(): readonly Plugin.PluginModule[] {\n return this._get(this._modulesAtom);\n }\n\n getActive(): readonly string[] {\n return this._get(this._activeAtom);\n }\n\n getEventsFired(): readonly string[] {\n return this._get(this._eventsFiredAtom);\n }\n\n getPendingReset(): readonly string[] {\n return this._get(this._pendingResetAtom);\n }\n\n /**\n * Adds a plugin to the manager via the plugin loader.\n * @param id The id of the plugin.\n */\n add(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n log('add plugin', { id });\n const plugin = yield* this._pluginLoader(id);\n this._addPlugin(plugin);\n return yield* this.enable(id);\n });\n }\n\n /**\n * Enables a plugin.\n * @param id The id of the plugin.\n */\n enable(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n log('enable plugin', { id });\n const plugin = this._getPlugin(id);\n if (!plugin) {\n return false;\n }\n\n this._update(this._enabledAtom, (enabled) => (enabled.includes(id) ? enabled : [...enabled, id]));\n\n plugin.modules.forEach((module) => {\n this._addModule(module);\n this._setPendingResetByModule(module);\n });\n\n log('pending reset', { events: [...this.getPendingReset()] });\n yield* Effect.all(\n this.getPendingReset().map((event) => this.activate(event)),\n { concurrency: 'unbounded' },\n );\n\n return true;\n });\n }\n\n /**\n * Removes a plugin from the manager.\n * @param id The id of the plugin.\n */\n remove(id: string): boolean {\n log('remove plugin', { id });\n const result = this.disable(id);\n if (!result) {\n return false;\n }\n\n this._removePlugin(id);\n return true;\n }\n\n /**\n * Disables a plugin.\n * @param id The id of the plugin.\n */\n disable(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n log('disable plugin', { id });\n if (this._get(this._coreAtom).includes(id)) {\n return false;\n }\n\n const plugin = this._getPlugin(id);\n if (!plugin) {\n return false;\n }\n\n const enabledIndex = this._get(this._enabledAtom).findIndex((enabled) => enabled === id);\n if (enabledIndex !== -1) {\n this._update(this._enabledAtom, (enabled) => enabled.filter((item) => item !== id));\n yield* this.deactivate(id);\n\n plugin.modules.forEach((module) => {\n this._removeModule(module.id);\n });\n }\n\n return true;\n });\n }\n\n /**\n * Activates plugins based on the activation event.\n * @param event The activation event.\n * @returns Whether the activation was successful.\n */\n activate(\n event: ActivationEvent.ActivationEvent | string,\n params?: { before?: string; after?: string },\n ): Effect.Effect<boolean, Error> {\n const key = typeof event === 'string' ? event : ActivationEvent.eventKey(event);\n return Effect.gen(this, function* () {\n log('activating', { key, ...params });\n yield* Ref.update(this._activatingEvents, (activating) => Array.append(activating, key));\n const pendingIndex = this._get(this._pendingResetAtom).findIndex((event) => event === key);\n if (pendingIndex !== -1) {\n this._update(this._pendingResetAtom, (pending) => pending.filter((event) => event !== key));\n }\n\n const activatingEvents = yield* this._activatingEvents;\n const activatingModules = yield* this._activatingModules;\n const modules = this._getInactiveModulesByEvent(key).filter((module) => {\n const allOf = ActivationEvent.isAllOf(module.activatesOn);\n if (!allOf) {\n return true;\n }\n\n // Check to see if all of the events in the `allOf` have been fired.\n // An event can be considered \"fired\" if it is in the `eventsFired` list or if it is currently being activated.\n const events = ActivationEvent.getEvents(module.activatesOn).filter(\n (event) => ActivationEvent.eventKey(event) !== key,\n );\n return (\n events.every(\n (event) =>\n this._get(this._eventsFiredAtom).includes(ActivationEvent.eventKey(event)) ||\n activatingEvents.includes(ActivationEvent.eventKey(event)),\n ) && !activatingModules.includes(module.id)\n );\n });\n yield* Ref.update(this._activatingModules, (activating) =>\n Array.appendAll(\n activating,\n modules.map((module) => module.id),\n ),\n );\n if (modules.length === 0) {\n log('no modules to activate', { key });\n if (!this._get(this._eventsFiredAtom).includes(key)) {\n this._update(this._eventsFiredAtom, (events) => [...events, key]);\n }\n return false;\n }\n\n log('activating modules', { key, modules: modules.map((module) => module.id) });\n yield* PubSub.publish(this.activation, { event: key, state: 'activating' });\n\n // Fire activatesBefore events.\n const beforeEvents = Function.pipe(\n modules,\n Array.flatMap((module) => module.activatesBefore ?? []),\n HashSet.fromIterable,\n HashSet.toValues,\n Array.filter((event) => !activatingEvents.includes(ActivationEvent.eventKey(event))),\n );\n yield* Function.pipe(\n beforeEvents,\n Array.map((event) => this.activate(event, { before: key })),\n Effect.allWith({ concurrency: 'unbounded' }),\n together(\n Effect.sleep(Duration.seconds(10)).pipe(\n Effect.andThen(\n Effect.sync(() =>\n log.warn('activatesBefore is taking a long time', {\n event: key,\n beforeEvents: beforeEvents.map(ActivationEvent.eventKey),\n }),\n ),\n ),\n ),\n ),\n );\n\n // Concurrently triggers loading of lazy capabilities.\n const getCapabilities = yield* Function.pipe(\n modules,\n Array.map((mod) => this._loadModule(mod)),\n Effect.allWith({ concurrency: 'unbounded' }),\n Effect.catchAll((error) => {\n return Effect.gen(this, function* () {\n yield* PubSub.publish(this.activation, { event: key, state: 'error', error });\n return yield* Effect.fail(error);\n });\n }),\n );\n\n // Contribute the capabilities from the activated modules.\n yield* Function.pipe(\n modules,\n Array.zip(getCapabilities),\n Array.map(([module, capabilities]) => this._contributeCapabilities(module, capabilities)),\n // TODO(wittjosiah): This currently can't be run in parallel.\n // Running this with concurrency causes races with `allOf` activation events.\n Effect.all,\n );\n\n // Fire activatesAfter events.\n const afterEvents = Function.pipe(\n modules,\n Array.flatMap((module) => module.activatesAfter ?? []),\n HashSet.fromIterable,\n HashSet.toValues,\n Array.filter((event) => !activatingEvents.includes(ActivationEvent.eventKey(event))),\n );\n yield* Function.pipe(\n afterEvents,\n Array.map((event) => this.activate(event, { after: key })),\n Effect.allWith({ concurrency: 'unbounded' }),\n together(\n Effect.sleep(Duration.seconds(10)).pipe(\n Effect.andThen(\n Effect.sync(() =>\n log.warn('activatesAfter is taking a long time', {\n event: key,\n afterEvents: afterEvents.map(ActivationEvent.eventKey),\n }),\n ),\n ),\n ),\n ),\n );\n\n yield* Ref.update(this._activatingEvents, (activating) => Array.filter(activating, (event) => event !== key));\n yield* Ref.update(this._activatingModules, (activating) =>\n Array.filter(activating, (module) => !modules.map((module) => module.id).includes(module)),\n );\n\n if (!this._get(this._eventsFiredAtom).includes(key)) {\n this._update(this._eventsFiredAtom, (events) => [...events, key]);\n }\n\n yield* PubSub.publish(this.activation, { event: key, state: 'activated' });\n log('activated', { key });\n\n return true;\n }).pipe(\n together(\n Effect.sleep(Duration.seconds(15)).pipe(\n Effect.andThen(Effect.sync(() => log.warn('event activation is taking a long time', { event: key }))),\n ),\n ),\n Performance.addTrackEntry({\n name: typeof event === 'string' ? event : ActivationEvent.eventKey(event),\n devtools: {\n dataType: 'track-entry',\n track: 'Event Activation',\n trackGroup: 'Composer',\n color: 'primary',\n },\n }),\n );\n }\n\n /**\n * Deactivates all of the modules for a plugin.\n * @param id The id of the plugin.\n * @returns Whether the deactivation was successful.\n */\n deactivate(id: string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n const plugin = this._getPlugin(id);\n if (!plugin) {\n return false;\n }\n\n const modules = plugin.modules;\n const results = yield* Effect.all(\n modules.map((module) => this._deactivateModule(module)),\n { concurrency: 'unbounded' },\n );\n return results.every((result) => result);\n });\n }\n\n /**\n * Re-activates the modules that were activated by the event.\n * @param event The activation event.\n * @returns Whether the reset was successful.\n */\n reset(event: ActivationEvent.ActivationEvent | string): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n const key = typeof event === 'string' ? event : ActivationEvent.eventKey(event);\n log('reset', { key });\n const modules = this._getActiveModulesByEvent(key);\n const results = yield* Effect.all(\n modules.map((module) => this._deactivateModule(module)),\n { concurrency: 'unbounded' },\n );\n\n if (results.every((result) => result)) {\n return yield* this.activate(key);\n } else {\n return false;\n }\n });\n }\n\n private _get<T>(atom: Atom.Atom<T>): T {\n return this.registry.get(atom);\n }\n\n private _set<T>(atom: Atom.Writable<T>, value: T): void {\n this.registry.set(atom, value);\n }\n\n private _update<T>(atom: Atom.Writable<T>, updater: (current: T) => T): void {\n this._set(atom, updater(this._get(atom)));\n }\n\n private _addPlugin(plugin: Plugin.Plugin): void {\n log('add plugin', { id: plugin.meta.id });\n // TODO(wittjosiah): Find a way to add a warning for duplicate plugins that doesn't cause log spam.\n this._update(this._pluginsAtom, (plugins) => (plugins.includes(plugin) ? plugins : [...plugins, plugin]));\n }\n\n private _removePlugin(id: string): void {\n log('remove plugin', { id });\n this._update(this._pluginsAtom, (plugins) => plugins.filter((plugin) => plugin.meta.id !== id));\n }\n\n private _addModule(module: Plugin.PluginModule): void {\n log('add module', { id: module.id });\n // TODO(wittjosiah): Find a way to add a warning for duplicate modules that doesn't cause log spam.\n this._update(this._modulesAtom, (modules) => (modules.includes(module) ? modules : [...modules, module]));\n }\n\n private _removeModule(id: string): void {\n log('remove module', { id });\n this._update(this._modulesAtom, (modules) => modules.filter((module) => module.id !== id));\n }\n\n private _getPlugin(id: string): Plugin.Plugin | undefined {\n return this._get(this._pluginsAtom).find((plugin) => plugin.meta.id === id);\n }\n\n private _getActiveModules(): Plugin.PluginModule[] {\n const active = this._get(this._activeAtom);\n return this._get(this._modulesAtom).filter((module) => active.includes(module.id));\n }\n\n private _getInactiveModules(): Plugin.PluginModule[] {\n const active = this._get(this._activeAtom);\n return this._get(this._modulesAtom).filter((module) => !active.includes(module.id));\n }\n\n private _getActiveModulesByEvent(key: string): Plugin.PluginModule[] {\n return this._getActiveModules().filter((module) =>\n ActivationEvent.getEvents(module.activatesOn).map(ActivationEvent.eventKey).includes(key),\n );\n }\n\n private _getInactiveModulesByEvent(key: string): Plugin.PluginModule[] {\n return this._getInactiveModules().filter((module) =>\n ActivationEvent.getEvents(module.activatesOn).map(ActivationEvent.eventKey).includes(key),\n );\n }\n\n private _setPendingResetByModule(module: Plugin.PluginModule): void {\n const activationEvents = ActivationEvent.getEvents(module.activatesOn)\n .map(ActivationEvent.eventKey)\n .filter((key) => this._get(this._eventsFiredAtom).includes(key));\n\n const pendingReset = Array.fromIterable(new Set(activationEvents)).filter((event) => {\n const pending = this._get(this._pendingResetAtom);\n return !pending.includes(event);\n });\n if (pendingReset.length > 0) {\n log('pending reset', { events: pendingReset });\n this._update(this._pendingResetAtom, (current) => [...current, ...pendingReset]);\n }\n }\n\n private _getModuleSemaphore(moduleId: Plugin.PluginModule['id']): Effect.Semaphore {\n let semaphore = this._moduleSemaphores.get(moduleId);\n if (!semaphore) {\n semaphore = Effect.runSync(Effect.makeSemaphore(1));\n this._moduleSemaphores.set(moduleId, semaphore);\n }\n return semaphore;\n }\n\n private _loadModule = (module: Plugin.PluginModule): Effect.Effect<Capability.Any[], Error> =>\n Effect.gen(this, function* () {\n const semaphore = this._getModuleSemaphore(module.id);\n\n // Atomically check-and-set under per-module semaphore to prevent race conditions.\n const deferredToAwait = yield* Effect.gen(this, function* () {\n const existing = this._moduleMemoMap.get(module.id);\n if (existing) {\n return existing;\n }\n\n // First caller - create deferred, store it, and start loading in background.\n const deferred = yield* Deferred.make<Capability.Any[], Error>();\n this._moduleMemoMap.set(module.id, deferred);\n\n const loadEffect = Effect.gen(this, function* () {\n log('loading module', { module: module.id });\n const [duration, capabilities] = yield* module\n .activate()\n .pipe(\n Effect.provideService(Capability.Service, this.capabilities),\n Effect.provideService(Plugin.Service, this),\n Effect.timed,\n );\n const normalized = capabilities == null ? [] : Array.isArray(capabilities) ? capabilities : [capabilities];\n log('loaded module', {\n module: module.id,\n elapsed: Duration.toMillis(duration),\n failed: false,\n });\n return normalized as Capability.Any[];\n }).pipe(\n Effect.withSpan('PluginManager._loadModule'),\n together(\n Effect.sleep(Duration.seconds(10)).pipe(\n Effect.andThen(\n Effect.sync(() => log.warn(`module is taking a long time to activate`, { module: module.id })),\n ),\n ),\n ),\n Performance.addTrackEntry({\n name: module.id,\n devtools: {\n dataType: 'track-entry',\n track: 'Module Activation',\n trackGroup: 'Composer',\n color: 'primary',\n },\n }),\n );\n\n // Fork the load to run in background, completing the deferred when done.\n yield* Effect.forkDaemon(\n loadEffect.pipe(\n Effect.tap((result) => Deferred.succeed(deferred, result)),\n Effect.catchAllCause((cause) => {\n const error = Cause.squash(cause);\n log.error('module failed to activate', {\n module: module.id,\n error: error instanceof Error ? error.message : String(error),\n stack: error instanceof Error ? error.stack : undefined,\n isDefect: !Cause.isFailure(cause),\n });\n return Deferred.fail(deferred, error instanceof Error ? error : new Error(String(error)));\n }),\n ),\n );\n\n return deferred;\n }).pipe(semaphore.withPermits(1));\n\n // Wait for result outside the semaphore so multiple waiters can proceed concurrently.\n return yield* Deferred.await(deferredToAwait);\n });\n\n private _contributeCapabilities(\n module: Plugin.PluginModule,\n capabilities: Capability.Any[],\n ): Effect.Effect<void, Error> {\n return Effect.gen(this, function* () {\n capabilities.forEach((capability) => {\n this.capabilities.contribute({ module: module.id, ...capability });\n });\n this._update(this._activeAtom, (active) => [...active, module.id]);\n this._capabilities.set(module.id, capabilities);\n });\n }\n\n private _deactivateModule(module: Plugin.PluginModule): Effect.Effect<boolean, Error> {\n return Effect.gen(this, function* () {\n const id = module.id;\n log('deactivating', { id });\n this._moduleMemoMap.delete(id);\n\n const capabilities = this._capabilities.get(id);\n if (capabilities) {\n for (const capability of capabilities) {\n this.capabilities.remove(capability.interface, capability.implementation);\n const program = capability.deactivate?.() ?? Effect.succeed(undefined);\n yield* program;\n }\n this._capabilities.delete(id);\n }\n\n const activeIndex = this._get(this._activeAtom).findIndex((event) => event === id);\n if (activeIndex !== -1) {\n this._update(this._activeAtom, (active) => active.filter((event) => event !== id));\n }\n\n log('deactivated', { id });\n return true;\n });\n }\n}\n\n/**\n * Creates a new Plugin Manager instance.\n */\nexport const make = (options: ManagerOptions): PluginManager => new ManagerImpl(options);\n\n/**\n * Runs an effect concurrently with another effect.\n * If the first effect completes, the second effect is interrupted.\n */\n// TODO(dmaretskyi): Effect.race > Effect.asVoid\nconst together =\n <R1>(togetherEffect: Effect.Effect<void, never, R1>) =>\n <A, E, R2>(effect: Effect.Effect<A, E, R2>): Effect.Effect<A, E, R1 | R2> =>\n Effect.gen(function* () {\n const togetherFiber = yield* Effect.fork(togetherEffect);\n const result = yield* effect;\n yield* Fiber.interrupt(togetherFiber);\n return result;\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, type Registry } from '@effect-atom/atom-react';\nimport * as Deferred from 'effect/Deferred';\nimport * as Effect from 'effect/Effect';\n\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nimport type * as Capability from './capability';\n\ntype CapabilityEntry<T> = {\n moduleId: string;\n implementation: T;\n};\n\n/**\n * Options for creating a capability manager.\n * @internal\n */\nexport type CapabilityManagerOptions = {\n registry: Registry.Registry;\n};\n\n/**\n * Interface for the Capability Manager.\n * Provides methods for contributing, removing, and accessing capabilities.\n */\nexport interface CapabilityManager {\n contribute<T>(args: { module: string; interface: Capability.InterfaceDef<T>; implementation: T }): void;\n\n remove<T>(interfaceDef: Capability.InterfaceDef<T>, implementation: T): void;\n\n /**\n * Get the Atom reference to the available capabilities for a given interface.\n * Primarily useful for deriving other Atom values based on the capabilities or\n * for subscribing to changes in the capabilities.\n * @returns An atom reference to the available capabilities.\n */\n atom<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<T[]>;\n\n /**\n * Get capabilities from the capability manager.\n * @returns An array of capabilities.\n */\n getAll<T>(interfaceDef: Capability.InterfaceDef<T>): T[];\n\n /**\n * Requests a single capability from the capability manager.\n * @returns The capability.\n * @throws If no capability is found.\n */\n get<T>(interfaceDef: Capability.InterfaceDef<T>): T;\n\n /**\n * Waits for a capability to be available.\n * @returns The capability.\n */\n waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error>;\n}\n\n/**\n * Internal implementation of CapabilityManager.\n */\nclass CapabilityManagerImpl implements CapabilityManager {\n private readonly _registry: Registry.Registry;\n\n private readonly _capabilityEntries = Atom.family<string, Atom.Writable<CapabilityEntry<unknown>[]>>(() => {\n return Atom.make<CapabilityEntry<unknown>[]>([]).pipe(Atom.keepAlive);\n });\n\n readonly _capabilities = Atom.family<string, Atom.Atom<unknown[]>>((id: string) => {\n return Atom.make((get) => {\n const current = get(this._capabilityEntries(id));\n return current.map((c) => c.implementation);\n });\n });\n\n readonly _capability = Atom.family<string, Atom.Atom<unknown>>((id: string) => {\n return Atom.make((get) => {\n const current = get(this._capabilities(id));\n invariant(current.length > 0, `No capability found for ${id}`);\n return current[0];\n });\n });\n\n constructor({ registry }: CapabilityManagerOptions) {\n this._registry = registry;\n }\n\n contribute<T>({\n module: moduleId,\n interface: interfaceDef,\n implementation,\n }: {\n module: string;\n interface: Capability.InterfaceDef<T>;\n implementation: T;\n }): void {\n const current = this._registry.get(this._capabilityEntries(interfaceDef.identifier));\n const isDuplicate = current.some((c) => c.moduleId === moduleId && c.implementation === implementation);\n if (isDuplicate) {\n log('capability already contributed, skipping', { id: interfaceDef.identifier, moduleId });\n return;\n }\n\n const entry: CapabilityEntry<T> = { moduleId, implementation };\n this._registry.set(this._capabilityEntries(interfaceDef.identifier), [...current, entry]);\n log('capability contributed', {\n id: interfaceDef.identifier,\n moduleId,\n count: current.length,\n });\n }\n\n remove<T>(interfaceDef: Capability.InterfaceDef<T>, implementation: T): void {\n const current = this._registry.get(this._capabilityEntries(interfaceDef.identifier));\n if (current.length === 0) {\n return;\n }\n\n const next = current.filter((c) => c.implementation !== implementation);\n if (next.length !== current.length) {\n this._registry.set(this._capabilityEntries(interfaceDef.identifier), next);\n log('capability removed', { id: interfaceDef.identifier, count: current.length });\n } else {\n log.warn('capability not removed', { id: interfaceDef.identifier });\n }\n }\n\n atom<T>(interfaceDef: Capability.InterfaceDef<T>): Atom.Atom<T[]> {\n // NOTE: This the type-checking for capabilities is done at the time of contribution.\n return this._capabilities(interfaceDef.identifier) as Atom.Atom<T[]>;\n }\n\n getAll<T>(interfaceDef: Capability.InterfaceDef<T>): T[] {\n return this._registry.get(this.atom(interfaceDef));\n }\n\n get<T>(interfaceDef: Capability.InterfaceDef<T>): T {\n const capabilities = this.getAll(interfaceDef);\n invariant(capabilities.length > 0, `No capability found for ${interfaceDef.identifier}`);\n return capabilities[0];\n }\n\n waitFor<T>(interfaceDef: Capability.InterfaceDef<T>): Effect.Effect<T, Error> {\n return Effect.gen(this, function* () {\n const [capability] = this.getAll(interfaceDef);\n if (capability) {\n return capability;\n }\n\n const deferred = yield* Deferred.make<T, Error>();\n const cancel = this._registry.subscribe(this.atom(interfaceDef), (capabilities) => {\n if (capabilities.length > 0) {\n Effect.runSync(Deferred.succeed(deferred, capabilities[0]));\n }\n });\n const result = yield* Deferred.await(deferred);\n cancel();\n return result;\n });\n }\n}\n\n/**\n * Creates a new Capability Manager instance.\n */\nexport const make = (options: CapabilityManagerOptions): CapabilityManager => new CapabilityManagerImpl(options);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;;;;cAAAA;;AAIA,SAASC,QAAAA,OAAMC,gBAAgB;AAC/B,YAAYC,WAAW;AACvB,YAAYC,WAAW;AACvB,YAAYC,eAAc;AAC1B,YAAYC,cAAc;AAC1B,YAAYC,aAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,cAAc;AAC1B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,SAAS;AAErB,SAASC,2BAA2B;AACpC,SAASC,mBAAmB;AAC5B,SAASC,OAAAA,YAAW;;;AClBpB;;cAAAC;;AAIA,SAASC,YAA2B;AACpC,YAAYC,cAAc;AAC1B,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;;AAyDpB,IAAMC,wBAAN,MAAMA;EACaC;EAEAC,qBAAqBP,KAAKQ,OAA0D,MAAA;AACnG,WAAOR,KAAKD,KAAiC,CAAA,CAAE,EAAEU,KAAKT,KAAKU,SAAS;EACtE,CAAA;EAESC,gBAAgBX,KAAKQ,OAAqC,CAACI,OAAAA;AAClE,WAAOZ,KAAKD,KAAK,CAACc,QAAAA;AAChB,YAAMC,UAAUD,IAAI,KAAKN,mBAAmBK,EAAAA,CAAAA;AAC5C,aAAOE,QAAQC,IAAI,CAACC,MAAMA,EAAEC,cAAc;IAC5C,CAAA;EACF,CAAA;EAESC,cAAclB,KAAKQ,OAAmC,CAACI,OAAAA;AAC9D,WAAOZ,KAAKD,KAAK,CAACc,QAAAA;AAChB,YAAMC,UAAUD,IAAI,KAAKF,cAAcC,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EQ0H,kBAAkBtE,QAA4D;AACpF,WAAcL,YAAI,MAAM,aAAA;AACtB,YAAMzB,KAAK8B,OAAO9B;AAClB0B,MAAAA,KAAI,gBAAgB;QAAE1B;MAAG,GAAA;;;;;;AACzB,WAAKV,eAAe+J,OAAOrJ,EAAAA;AAE3B,YAAMtB,eAAe,KAAKU,cAAcoH,IAAIxG,EAAAA;AAC5C,UAAItB,cAAc;AAChB,mBAAWyK,cAAczK,cAAc;AACrC,eAAKA,aAAa2D,OAAO8G,WAAWG,WAAWH,WAAWI,cAAc;AACxE,gBAAMC,UAAUL,WAAWtG,aAAU,KAAeyF,gBAAQQ,MAAAA;AAC5D,iBAAOU;QACT;AACA,aAAKpK,cAAciK,OAAOrJ,EAAAA;MAC5B;AAEA,YAAMyJ,cAAc,KAAKxI,KAAK,KAAKjC,WAAW,EAAE0D,UAAU,CAACR,UAAUA,UAAUlC,EAAAA;AAC/E,UAAIyJ,gBAAgB,IAAI;AACtB,aAAK7H,QAAQ,KAAK5C,aAAa,CAAC6B,WAAWA,OAAO8B,OAAO,CAACT,UAAUA,UAAUlC,EAAAA,CAAAA;MAChF;AAEA0B,MAAAA,KAAI,eAAe;QAAE1B;MAAG,GAAA;;;;;;AACxB,aAAO;IACT,CAAA;EACF;AACF;AAKO,IAAMP,QAAO,CAACiK,YAA2C,IAAIpL,YAAYoL,OAAAA;AAOhF,IAAMhF,WACJ,CAAKiF,mBACL,CAAWC,WACFnI,YAAI,aAAA;AACT,QAAMoI,gBAAgB,OAAcC,aAAKH,cAAAA;AACzC,QAAMrH,SAAS,OAAOsH;AACtB,SAAaG,gBAAUF,aAAAA;AACvB,SAAOvH;AACT,CAAA;",
6
+ "names": ["make", "Atom", "Registry", "Array", "Cause", "Deferred", "Duration", "Effect", "Fiber", "Function", "HashSet", "PubSub", "Ref", "runAndForwardErrors", "Performance", "log", "make", "Atom", "Deferred", "Effect", "invariant", "log", "CapabilityManagerImpl", "_registry", "_capabilityEntries", "family", "pipe", "keepAlive", "_capabilities", "id", "get", "current", "map", "c", "implementation", "_capability", "length", "registry", "contribute", "module", "moduleId", "interface", "interfaceDef", "identifier", "isDuplicate", "some", "entry", "set", "count", "remove", "next", "filter", "warn", "atom", "getAll", "capabilities", "waitFor", "gen", "capability", "deferred", "cancel", "subscribe", "runSync", "succeed", "result", "await", "options", "ManagerTypeId", "Symbol", "for", "isManager", "value", "ManagerImpl", "activation", "runSync", "unbounded", "capabilities", "registry", "_pluginsAtom", "_coreAtom", "_enabledAtom", "_modulesAtom", "_activeAtom", "_eventsFiredAtom", "_pendingResetAtom", "_pluginLoader", "_capabilities", "Map", "_moduleMemoMap", "_moduleSemaphores", "_activatingEvents", "make", "_activatingModules", "pluginLoader", "plugins", "core", "map", "meta", "id", "enabled", "Registry", "Atom", "pipe", "keepAlive", "forEach", "plugin", "_addPlugin", "all", "enable", "runAndForwardErrors", "modules", "active", "eventsFired", "pendingReset", "getPlugins", "_get", "getCore", "getEnabled", "getModules", "getActive", "getEventsFired", "getPendingReset", "add", "gen", "log", "_getPlugin", "_update", "includes", "module", "_addModule", "_setPendingResetByModule", "events", "event", "activate", "concurrency", "remove", "result", "disable", "_removePlugin", "enabledIndex", "findIndex", "filter", "item", "deactivate", "_removeModule", "params", "key", "eventKey", "update", "activating", "append", "pendingIndex", "pending", "activatingEvents", "activatingModules", "_getInactiveModulesByEvent", "allOf", "isAllOf", "activatesOn", "getEvents", "every", "appendAll", "length", "publish", "state", "beforeEvents", "flatMap", "activatesBefore", "fromIterable", "toValues", "before", "allWith", "together", "sleep", "seconds", "andThen", "sync", "warn", "getCapabilities", "mod", "_loadModule", "catchAll", "error", "fail", "zip", "_contributeCapabilities", "afterEvents", "activatesAfter", "after", "Performance", "addTrackEntry", "name", "devtools", "dataType", "track", "trackGroup", "color", "results", "_deactivateModule", "reset", "_getActiveModulesByEvent", "atom", "get", "_set", "set", "updater", "find", "_getActiveModules", "_getInactiveModules", "activationEvents", "Set", "current", "_getModuleSemaphore", "moduleId", "semaphore", "makeSemaphore", "deferredToAwait", "existing", "deferred", "loadEffect", "duration", "provideService", "Service", "timed", "normalized", "isArray", "elapsed", "toMillis", "failed", "withSpan", "forkDaemon", "tap", "succeed", "catchAllCause", "cause", "squash", "Error", "message", "String", "stack", "undefined", "isDefect", "isFailure", "withPermits", "await", "capability", "contribute", "delete", "interface", "implementation", "program", "activeIndex", "options", "togetherEffect", "effect", "togetherFiber", "fork", "interrupt"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getModuleTag
3
- } from "./chunk-6Y7PZV72.mjs";
3
+ } from "./chunk-YNFPIQGB.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-J5LGTIGS.mjs";
@@ -30,9 +30,9 @@ var Service = class extends Context.Tag("@dxos/app-framework/PluginManager")() {
30
30
  var activate = (event) => Effect.flatMap(Service, (manager) => manager.activate(event));
31
31
  var reset = (event) => Effect.flatMap(Service, (manager) => manager.reset(event));
32
32
  var computeModuleId = (pluginId, moduleName) => {
33
- return `${pluginId}/module/${moduleName}`;
33
+ return `${pluginId}.module.${moduleName}`;
34
34
  };
35
- var PluginModuleTypeId = Symbol.for("@dxos/app-framework/PluginModule");
35
+ var PluginModuleTypeId = /* @__PURE__ */ Symbol.for("@dxos/app-framework/PluginModule");
36
36
  var isPluginModule = (value) => {
37
37
  return typeof value === "object" && value !== null && PluginModuleTypeId in value;
38
38
  };
@@ -51,7 +51,7 @@ var PluginModuleImpl = class {
51
51
  this.activate = options.activate;
52
52
  }
53
53
  };
54
- var PluginTypeId = Symbol.for("@dxos/app-framework/Plugin");
54
+ var PluginTypeId = /* @__PURE__ */ Symbol.for("@dxos/app-framework/Plugin");
55
55
  var isPlugin = (value) => {
56
56
  return typeof value === "object" && value !== null && PluginTypeId in value;
57
57
  };
@@ -102,7 +102,7 @@ var resolveModule = (meta, module, options) => {
102
102
  const exportName = getModuleTag(moduleOptions.activate);
103
103
  invariant(exportName, `Plugin module missing name. Plugin: ${meta.id}`, {
104
104
  F: __dxlog_file,
105
- L: 300,
105
+ L: 301,
106
106
  S: void 0,
107
107
  A: [
108
108
  "exportName",
@@ -142,4 +142,4 @@ export {
142
142
  make,
143
143
  plugin_exports
144
144
  };
145
- //# sourceMappingURL=chunk-TCLLRCS3.mjs.map
145
+ //# sourceMappingURL=chunk-7M4467QR.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/core/plugin.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\nimport * as Pipeable from 'effect/Pipeable';\n\nimport { invariant } from '@dxos/invariant';\n\nimport type * as ActivationEvent from './activation-event';\nimport * as Capability from './capability';\nimport type * as PluginManager from './plugin-manager';\n\n//\n// Plugin Service Layer\n//\n\n/**\n * Effect Context.Tag for accessing PluginManager via the Effect layer system.\n * This allows lifecycle operations to access the plugin manager without having it passed as an argument.\n */\nexport class Service extends Context.Tag('@dxos/app-framework/PluginManager')<Service, PluginManager.PluginManager>() {}\n\n//\n// Lifecycle Functions\n//\n\n/**\n * Activates plugins based on the activation event.\n * Accesses the PluginManager via the Effect layer system.\n * @param event The activation event.\n * @returns Whether the activation was successful.\n */\nexport const activate = (event: ActivationEvent.ActivationEvent): Effect.Effect<boolean, Error, Service> =>\n Effect.flatMap(Service, (manager) => manager.activate(event));\n\n/**\n * Re-activates the modules that were activated by the event.\n * Accesses the PluginManager via the Effect layer system.\n * @param event The activation event.\n * @returns Whether the reset was successful.\n */\nexport const reset = (event: ActivationEvent.ActivationEvent): Effect.Effect<boolean, Error, Service> =>\n Effect.flatMap(Service, (manager) => manager.reset(event));\n\n/**\n * Computes a module ID from plugin ID and export name.\n */\nconst computeModuleId = (pluginId: string, moduleName: string): string => {\n return `${pluginId}.module.${moduleName}`;\n};\n\n/**\n * Identifier denoting a PluginModule.\n */\nexport const PluginModuleTypeId: unique symbol = Symbol.for('@dxos/app-framework/PluginModule');\nexport type PluginModuleTypeId = typeof PluginModuleTypeId;\n\n/**\n * Type guard to check if a value is a PluginModule.\n */\nexport const isPluginModule = (value: unknown): value is PluginModule => {\n return typeof value === 'object' && value !== null && PluginModuleTypeId in value;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Activation of a module is async allowing for code to split and loaded lazily.\n */\nexport interface PluginModule {\n readonly [PluginModuleTypeId]: PluginModuleTypeId;\n /**\n * Unique id of the module.\n */\n id: string;\n\n /**\n * Events for which the module will be activated.\n */\n activatesOn: ActivationEvent.Events;\n\n /**\n * Events which the plugin depends on being activated.\n * Plugin is marked as needing reset a plugin activated by a dependent event is removed.\n * Events are automatically activated before activation of the plugin.\n */\n activatesBefore?: ActivationEvent.ActivationEvent[];\n\n /**\n * Events which this plugin triggers upon activation.\n */\n activatesAfter?: ActivationEvent.ActivationEvent[];\n\n /**\n * Called when the module is activated.\n * CapabilityManager is accessed via the Effect layer system (Capability.Service).\n * PluginManager is accessed via Plugin.Service.\n * @param props Optional props passed to the module.\n * @returns The capabilities of the module.\n */\n activate: (props?: any) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service | Service | never>;\n}\n\nexport type PluginModuleOptions = Omit<PluginModule, 'id' | typeof PluginModuleTypeId> & { id?: string };\n\nclass PluginModuleImpl implements PluginModule {\n readonly [PluginModuleTypeId]: PluginModuleTypeId = PluginModuleTypeId;\n readonly id: PluginModule['id'];\n readonly activatesOn: PluginModule['activatesOn'];\n readonly activatesBefore?: PluginModule['activatesBefore'];\n readonly activatesAfter?: PluginModule['activatesAfter'];\n readonly activate: PluginModule['activate'];\n\n constructor(options: Omit<PluginModule, typeof PluginModuleTypeId>) {\n this.id = options.id;\n this.activatesOn = options.activatesOn;\n this.activatesBefore = options.activatesBefore;\n this.activatesAfter = options.activatesAfter;\n this.activate = options.activate;\n }\n}\n\nexport type Meta = {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example org.dxos.plugin.example\n */\n id: string;\n\n /**\n * Human-readable name.\n */\n name: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * URL of source code.\n */\n source?: string;\n\n /**\n * URL of screenshot.\n */\n screenshots?: string[];\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.\n */\n icon?: string;\n\n /**\n * Icon hue (ChromaticPalette).\n */\n iconHue?: string;\n};\n\n/**\n * Identifier denoting a Plugin.\n */\nexport const PluginTypeId: unique symbol = Symbol.for('@dxos/app-framework/Plugin');\nexport type PluginTypeId = typeof PluginTypeId;\n\n/**\n * Type guard to check if a value is a Plugin.\n */\nexport const isPlugin = (value: unknown): value is Plugin => {\n return typeof value === 'object' && value !== null && PluginTypeId in value;\n};\n\n/**\n * A collection of modules that are be enabled/disabled as a unit.\n * Plugins provide things such as components, state, actions, etc. to the application.\n */\n// TODO(burdon): Convert to ECHO schema.\nexport interface Plugin {\n readonly [PluginTypeId]: PluginTypeId;\n readonly meta: Readonly<Meta>;\n readonly modules: ReadonlyArray<PluginModule>;\n}\n\n/**\n * Internal implementation of Plugin.\n * @internal\n */\nclass PluginImpl implements Plugin {\n readonly [PluginTypeId]: PluginTypeId = PluginTypeId;\n\n constructor(\n private readonly _meta: Meta,\n private readonly _modules: PluginModule[],\n ) {}\n\n get meta(): Readonly<Meta> {\n return this._meta;\n }\n\n get modules(): ReadonlyArray<PluginModule> {\n return this._modules;\n }\n}\n\n/**\n * Builder interface for creating plugins incrementally.\n */\nexport interface PluginBuilder<T = void> extends Pipeable.Pipeable {\n readonly meta: Meta;\n readonly modules: ReadonlyArray<PluginModuleOptions | ((options: T) => PluginModuleOptions)>;\n addModule(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;\n}\n\n/**\n * Builder implementation for creating plugins incrementally.\n */\nclass PluginBuilderImpl<T = void> implements PluginBuilder<T> {\n readonly meta: Meta;\n private readonly _modules: Array<PluginModuleOptions | ((options: T) => PluginModuleOptions)> = [];\n\n constructor(meta: Meta) {\n this.meta = meta;\n }\n\n get modules(): ReadonlyArray<PluginModuleOptions | ((options: T) => PluginModuleOptions)> {\n return this._modules;\n }\n\n addModule(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T> {\n this._modules.push(moduleOptions);\n return this;\n }\n\n pipe() {\n // eslint-disable-next-line prefer-rest-params\n return Pipeable.pipeArguments(this, arguments);\n }\n}\n\n/**\n * Creates a new PluginBuilder to start building a plugin.\n */\nexport const define = <T = void>(meta: Meta): PluginBuilder<T> => new PluginBuilderImpl<T>(meta);\n\n/**\n * Adds a module to a plugin builder.\n * Supports both pipeline and direct call styles.\n * Modules can be either PluginModuleOptions or functions that receive options.\n */\nexport function addModule<T>(\n moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions),\n): (builder: PluginBuilder<T>) => PluginBuilder<T>;\nexport function addModule<T>(\n builder: PluginBuilder<T>,\n moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions),\n): PluginBuilder<T>;\nexport function addModule<T>(\n moduleOptionsOrBuilder: PluginModuleOptions | ((options: T) => PluginModuleOptions) | PluginBuilder<T>,\n moduleOptions?: PluginModuleOptions | ((options: T) => PluginModuleOptions),\n): ((builder: PluginBuilder<T>) => PluginBuilder<T>) | PluginBuilder<T> {\n // If second arg is provided, it's the direct call style: addModule(builder, moduleOptions)\n if (moduleOptions !== undefined) {\n return (moduleOptionsOrBuilder as PluginBuilder<T>).addModule(moduleOptions);\n }\n // Otherwise it's pipeline style: addModule(moduleOptions) returns a function\n const moduleOpts = moduleOptionsOrBuilder as PluginModuleOptions | ((options: T) => PluginModuleOptions);\n return (builder: PluginBuilder<T>) => builder.addModule(moduleOpts);\n}\n\nexport type PluginFactory<T = void> = ((options: T) => Plugin) & { meta: Meta };\n\n/**\n * Resolves a module from either PluginModuleOptions or a function that returns PluginModuleOptions.\n */\nconst resolveModule = (\n meta: Meta,\n module: PluginModuleOptions | ((options: any) => PluginModuleOptions),\n options?: any,\n): PluginModuleImpl => {\n const moduleOptions = typeof module === 'function' ? module(options) : module;\n const id = Option.fromNullable(moduleOptions.id).pipe(\n Option.match({\n onNone: () => {\n const exportName = Capability.getModuleTag(moduleOptions.activate);\n invariant(exportName, `Plugin module missing name. Plugin: ${meta.id}`);\n return computeModuleId(meta.id, exportName);\n },\n onSome: (id) => computeModuleId(meta.id, id),\n }),\n );\n return new PluginModuleImpl({ ...moduleOptions, id });\n};\n\n/**\n * Creates a Plugin from a builder.\n * Supports both pipeline and direct call styles.\n * Always returns a factory function (options: T) => Plugin.\n * When T is void, the function takes no arguments: () => Plugin.\n */\nexport function make<T>(builder: PluginBuilder<T>): PluginFactory<T>;\nexport function make<T>(builder: PluginBuilder<T>): PluginFactory<T> {\n const meta = builder.meta;\n\n const factory = (options: T) => {\n const modules = builder.modules.map((module) => resolveModule(meta, module, options));\n return new PluginImpl(meta, modules);\n };\n\n return Object.assign(factory, { meta });\n}\n"],
5
+ "mappings": ";;;;;;;;AAAA;;;;;;;;;;;;;AAIA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,iBAAiB;;AAcnB,IAAMC,UAAN,cAA8BC,YAAI,mCAAA,EAAA,EAAA;AAA8E;AAYhH,IAAMC,WAAW,CAACC,UAChBC,eAAQJ,SAAS,CAACK,YAAYA,QAAQH,SAASC,KAAAA,CAAAA;AAQjD,IAAMG,QAAQ,CAACH,UACbC,eAAQJ,SAAS,CAACK,YAAYA,QAAQC,MAAMH,KAAAA,CAAAA;AAKrD,IAAMI,kBAAkB,CAACC,UAAkBC,eAAAA;AACzC,SAAO,GAAGD,QAAAA,WAAmBC,UAAAA;AAC/B;AAKO,IAAMC,qBAAoCC,uBAAOC,IAAI,kCAAA;AAMrD,IA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C1D;AAOA,IAAME,gBAAgB,CACpBd,MACAe,QACArB,YAAAA;AAEA,QAAMU,gBAAgB,OAAOW,WAAW,aAAaA,OAAOrB,OAAAA,IAAWqB;AACvE,QAAMzB,KAAY0B,oBAAaZ,cAAcd,EAAE,EAAEgB,KACxCW,aAAM;IACXC,QAAQ,MAAA;AACN,YAAMC,aAAwBC,aAAahB,cAAc5B,QAAQ;AACjE6C,gBAAUF,YAAY,uCAAuCnB,KAAKV,EAAE,IAAE;;;;;;;;;AACtE,aAAOT,gBAAgBmB,KAAKV,IAAI6B,UAAAA;IAClC;IACAG,QAAQ,CAAChC,QAAOT,gBAAgBmB,KAAKV,IAAIA,GAAAA;EAC3C,CAAA,CAAA;AAEF,SAAO,IAAID,iBAAiB;IAAE,GAAGe;IAAed;EAAG,CAAA;AACrD;AASO,SAASiC,KAAQV,SAAyB;AAC/C,QAAMb,OAAOa,QAAQb;AAErB,QAAMwB,UAAU,CAAC9B,YAAAA;AACf,UAAMO,UAAUY,QAAQZ,QAAQwB,IAAI,CAACV,WAAWD,cAAcd,MAAMe,QAAQrB,OAAAA,CAAAA;AAC5E,WAAO,IAAIG,WAAWG,MAAMC,OAAAA;EAC9B;AAEA,SAAOyB,OAAOC,OAAOH,SAAS;IAAExB;EAAK,CAAA;AACvC;",
6
+ "names": ["Context", "Effect", "Option", "Pipeable", "invariant", "Service", "Tag", "activate", "event", "flatMap", "manager", "reset", "computeModuleId", "pluginId", "moduleName", "PluginModuleTypeId", "Symbol", "for", "isPluginModule", "value", "PluginModuleImpl", "id", "activatesOn", "activatesBefore", "activatesAfter", "options", "PluginTypeId", "isPlugin", "PluginImpl", "_meta", "_modules", "meta", "modules", "PluginBuilderImpl", "addModule", "moduleOptions", "push", "pipe", "pipeArguments", "arguments", "define", "moduleOptionsOrBuilder", "undefined", "moduleOpts", "builder", "resolveModule", "module", "fromNullable", "match", "onNone", "exportName", "getModuleTag", "invariant", "onSome", "make", "factory", "map", "Object", "assign"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  UndoOperation
3
- } from "./chunk-BLQJSGL3.mjs";
3
+ } from "./chunk-TIEBZMTF.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-J5LGTIGS.mjs";
@@ -167,4 +167,4 @@ export {
167
167
  make3 as make2,
168
168
  history_tracker_exports
169
169
  };
170
- //# sourceMappingURL=chunk-7IQHKD4U.mjs.map
170
+ //# sourceMappingURL=chunk-JGWCBVKJ.mjs.map