@dxos/app-framework 0.8.4-main.c85a9c8dae → 0.8.4-main.d05539e30a

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 (387) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/browser/{capability-7RLVE42K.mjs → capability-K5XIVCQU.mjs} +12 -11
  4. package/dist/lib/browser/capability-K5XIVCQU.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-5AHASNDW.mjs +95 -0
  6. package/dist/lib/browser/chunk-5AHASNDW.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
  8. package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-PKQT6C53.mjs → chunk-66IXTIVK.mjs} +3 -2
  10. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-ZRWBPIZG.mjs → chunk-BRK6GYNB.mjs} +14 -42
  12. package/dist/lib/browser/chunk-BRK6GYNB.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  14. package/dist/lib/browser/{chunk-FHQTHCX7.mjs.map → chunk-FJ4765WW.mjs.map} +3 -3
  15. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  16. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  17. package/dist/lib/browser/{chunk-YNFPIQGB.mjs → chunk-IW44C7UL.mjs} +9 -2
  18. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-5RJNZV7K.mjs → chunk-KFDF7KR3.mjs} +11 -13
  20. package/dist/lib/browser/{chunk-5RJNZV7K.mjs.map → chunk-KFDF7KR3.mjs.map} +3 -3
  21. package/dist/lib/browser/chunk-KLHQNYJ2.mjs +422 -0
  22. package/dist/lib/browser/chunk-KLHQNYJ2.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-QLML5QFJ.mjs +581 -0
  24. package/dist/lib/browser/chunk-QLML5QFJ.mjs.map +7 -0
  25. package/dist/lib/browser/{chunk-FNKT2QQ2.mjs → chunk-SLX73WRZ.mjs} +90 -17
  26. package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-UVTGHZQF.mjs +513 -0
  28. package/dist/lib/browser/chunk-UVTGHZQF.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-VJ5PFAWC.mjs +1446 -0
  30. package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
  31. package/dist/lib/browser/cli/index.mjs +17 -32
  32. package/dist/lib/browser/cli/index.mjs.map +3 -3
  33. package/dist/lib/browser/common/activation-events.mjs +11 -14
  34. package/dist/lib/browser/common/capabilities.mjs +19 -8
  35. package/dist/lib/browser/core/activation-event.mjs +1 -1
  36. package/dist/lib/browser/core/capability.mjs +5 -1
  37. package/dist/lib/browser/core/plugin-manager.mjs +8 -4
  38. package/dist/lib/browser/core/plugin.mjs +16 -4
  39. package/dist/lib/browser/core/url-loader.mjs +24 -0
  40. package/dist/lib/browser/index.mjs +47 -49
  41. package/dist/lib/browser/index.mjs.map +4 -4
  42. package/dist/lib/browser/meta.json +1 -1
  43. package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs +89 -0
  44. package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs.map +7 -0
  45. package/dist/lib/browser/testing/index.mjs +199 -56
  46. package/dist/lib/browser/testing/index.mjs.map +4 -4
  47. package/dist/lib/browser/testing/react.mjs +78 -0
  48. package/dist/lib/browser/testing/react.mjs.map +7 -0
  49. package/dist/lib/browser/ui/index.mjs +24 -15
  50. package/dist/lib/node-esm/{capability-EVZK4REM.mjs → capability-RLKFFLTB.mjs} +12 -11
  51. package/dist/lib/node-esm/capability-RLKFFLTB.mjs.map +7 -0
  52. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs → chunk-37Z53PXZ.mjs} +2 -2
  53. package/dist/lib/node-esm/{chunk-UEWJDI2L.mjs.map → chunk-37Z53PXZ.mjs.map} +3 -3
  54. package/dist/lib/node-esm/chunk-42UNAKYO.mjs +423 -0
  55. package/dist/lib/node-esm/chunk-42UNAKYO.mjs.map +7 -0
  56. package/dist/lib/node-esm/{chunk-CJCQS2YL.mjs → chunk-6S45OMUP.mjs} +90 -17
  57. package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
  58. package/dist/lib/node-esm/{chunk-2A4PRBIX.mjs → chunk-BYHYYJZH.mjs} +14 -42
  59. package/dist/lib/node-esm/chunk-BYHYYJZH.mjs.map +7 -0
  60. package/dist/lib/node-esm/{chunk-SB5ODNPX.mjs → chunk-CTKEZHKF.mjs} +9 -2
  61. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-JNT72ZCN.mjs +514 -0
  63. package/dist/lib/node-esm/chunk-JNT72ZCN.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
  65. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-LJNUFNDO.mjs +582 -0
  67. package/dist/lib/node-esm/chunk-LJNUFNDO.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-VUIUFIGT.mjs → chunk-OUEMWPIW.mjs} +11 -13
  69. package/dist/lib/node-esm/{chunk-VUIUFIGT.mjs.map → chunk-OUEMWPIW.mjs.map} +3 -3
  70. package/dist/lib/node-esm/chunk-PW2VYGOS.mjs +96 -0
  71. package/dist/lib/node-esm/chunk-PW2VYGOS.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-SFYCO3PT.mjs +1447 -0
  73. package/dist/lib/node-esm/chunk-SFYCO3PT.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  75. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  76. package/dist/lib/node-esm/{chunk-7OWSHPYK.mjs → chunk-XOCUANHO.mjs} +3 -2
  77. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  78. package/dist/lib/node-esm/cli/index.mjs +17 -32
  79. package/dist/lib/node-esm/cli/index.mjs.map +3 -3
  80. package/dist/lib/node-esm/common/activation-events.mjs +11 -14
  81. package/dist/lib/node-esm/common/capabilities.mjs +19 -8
  82. package/dist/lib/node-esm/core/activation-event.mjs +1 -1
  83. package/dist/lib/node-esm/core/capability.mjs +5 -1
  84. package/dist/lib/node-esm/core/plugin-manager.mjs +8 -4
  85. package/dist/lib/node-esm/core/plugin.mjs +16 -4
  86. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  87. package/dist/lib/node-esm/index.mjs +47 -49
  88. package/dist/lib/node-esm/index.mjs.map +4 -4
  89. package/dist/lib/node-esm/meta.json +1 -1
  90. package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs +90 -0
  91. package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs.map +7 -0
  92. package/dist/lib/node-esm/testing/index.mjs +199 -56
  93. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  94. package/dist/lib/node-esm/testing/react.mjs +79 -0
  95. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  96. package/dist/lib/node-esm/ui/index.mjs +24 -15
  97. package/dist/plugin/node-esm/index.mjs +893 -0
  98. package/dist/plugin/node-esm/index.mjs.map +7 -0
  99. package/dist/plugin/node-esm/meta.json +1 -0
  100. package/dist/types/src/cli/cli.d.ts +1 -3
  101. package/dist/types/src/cli/cli.d.ts.map +1 -1
  102. package/dist/types/src/common/activation-events.d.ts +10 -13
  103. package/dist/types/src/common/activation-events.d.ts.map +1 -1
  104. package/dist/types/src/common/annotations.d.ts +1 -0
  105. package/dist/types/src/common/annotations.d.ts.map +1 -0
  106. package/dist/types/src/common/capabilities.d.ts +113 -12
  107. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  108. package/dist/types/src/common/operations.d.ts +8 -22
  109. package/dist/types/src/common/operations.d.ts.map +1 -1
  110. package/dist/types/src/core/activation-event.d.ts +5 -5
  111. package/dist/types/src/core/activation-event.d.ts.map +1 -1
  112. package/dist/types/src/core/capability-manager.d.ts +5 -0
  113. package/dist/types/src/core/capability-manager.d.ts.map +1 -1
  114. package/dist/types/src/core/capability.d.ts +13 -2
  115. package/dist/types/src/core/capability.d.ts.map +1 -1
  116. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  117. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  118. package/dist/types/src/core/index.d.ts +6 -0
  119. package/dist/types/src/core/index.d.ts.map +1 -1
  120. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  121. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  122. package/dist/types/src/core/plugin-manager.d.ts +238 -7
  123. package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
  124. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  125. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  126. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  127. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  128. package/dist/types/src/core/plugin.d.ts +182 -7
  129. package/dist/types/src/core/plugin.d.ts.map +1 -1
  130. package/dist/types/src/core/registry.d.ts +107 -0
  131. package/dist/types/src/core/registry.d.ts.map +1 -0
  132. package/dist/types/src/core/url-loader.d.ts +127 -0
  133. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  134. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  135. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  136. package/dist/types/src/helpers.d.ts.map +1 -1
  137. package/dist/types/src/index.d.ts +1 -2
  138. package/dist/types/src/index.d.ts.map +1 -1
  139. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
  140. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
  141. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
  142. package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
  143. package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
  144. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.d.ts +1 -1
  145. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
  146. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
  147. package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
  148. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/types.d.ts +1 -1
  149. package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
  150. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.d.ts +1 -1
  151. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
  152. package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.d.ts +1 -1
  153. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
  154. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
  155. package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
  156. package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
  157. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
  158. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
  159. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
  160. package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
  161. package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
  162. package/dist/types/src/testing/harness.d.ts +79 -0
  163. package/dist/types/src/testing/harness.d.ts.map +1 -0
  164. package/dist/types/src/testing/index.d.ts +1 -0
  165. package/dist/types/src/testing/index.d.ts.map +1 -1
  166. package/dist/types/src/testing/react.d.ts +27 -0
  167. package/dist/types/src/testing/react.d.ts.map +1 -0
  168. package/dist/types/src/testing/react.test.d.ts +2 -0
  169. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  170. package/dist/types/src/testing/service.d.ts.map +1 -1
  171. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  172. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  173. package/dist/types/src/ui/components/App/App.d.ts +3 -2
  174. package/dist/types/src/ui/components/App/App.d.ts.map +1 -1
  175. package/dist/types/src/ui/components/App/App.stories.d.ts +2 -2
  176. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
  177. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
  178. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
  179. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
  180. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
  181. package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
  182. package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
  183. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -1
  184. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +16 -4
  185. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -1
  186. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
  187. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -1
  188. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  189. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  190. package/dist/types/src/ui/components/Surface/index.d.ts +22 -6
  191. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
  192. package/dist/types/src/ui/components/Surface/types.d.ts +110 -9
  193. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
  194. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  195. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  196. package/dist/types/src/ui/components/index.d.ts +1 -0
  197. package/dist/types/src/ui/components/index.d.ts.map +1 -1
  198. package/dist/types/src/ui/hooks/index.d.ts +1 -1
  199. package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
  200. package/dist/types/src/ui/hooks/useApp.d.ts +47 -11
  201. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
  202. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  203. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  204. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
  205. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -1
  206. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +24 -0
  207. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
  208. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -1
  209. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
  210. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
  211. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  212. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  213. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
  214. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  215. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  216. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  217. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  218. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  219. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  220. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  221. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  222. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  223. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  224. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  225. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  226. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  227. package/dist/types/tsconfig.tsbuildinfo +1 -1
  228. package/moon.yml +15 -0
  229. package/package.json +53 -54
  230. package/src/cli/cli.ts +4 -9
  231. package/src/common/activation-events.ts +12 -17
  232. package/src/common/annotations.ts +3 -0
  233. package/src/common/capabilities.ts +160 -29
  234. package/src/common/operations.ts +7 -10
  235. package/src/context.ts +1 -1
  236. package/src/core/activation-event.ts +5 -2
  237. package/src/core/capability-manager.test.ts +1 -1
  238. package/src/core/capability-manager.ts +22 -1
  239. package/src/core/capability.ts +20 -2
  240. package/src/core/edge-registry-plugin-provider.ts +92 -0
  241. package/src/core/index.ts +6 -0
  242. package/src/core/plugin-asset-cache.ts +60 -0
  243. package/src/core/plugin-manager.test.ts +1085 -31
  244. package/src/core/plugin-manager.ts +1170 -198
  245. package/src/core/plugin-manifest.test.ts +75 -0
  246. package/src/core/plugin-manifest.ts +134 -0
  247. package/src/core/plugin.ts +194 -12
  248. package/src/core/registry.ts +163 -0
  249. package/src/core/url-loader.test.ts +221 -0
  250. package/src/core/url-loader.ts +388 -0
  251. package/src/index.ts +1 -2
  252. package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
  253. package/src/{plugin-operation → plugin-process-manager}/history/capability.ts +1 -2
  254. package/src/plugin-process-manager/history/errors.ts +7 -0
  255. package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.ts +37 -43
  256. package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.ts +1 -2
  257. package/src/{plugin-operation → plugin-process-manager}/history/types.ts +1 -1
  258. package/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.ts +1 -1
  259. package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.ts +3 -4
  260. package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.ts +1 -1
  261. package/src/{plugin-operation → plugin-process-manager}/index.ts +1 -1
  262. package/src/plugin-process-manager/meta.ts +14 -0
  263. package/src/plugin-process-manager/process-manager-capability.ts +178 -0
  264. package/src/{plugin-operation → plugin-process-manager}/testing.ts +26 -45
  265. package/src/testing/harness.ts +247 -0
  266. package/src/testing/index.ts +1 -0
  267. package/src/testing/react.test.tsx +48 -0
  268. package/src/testing/react.tsx +113 -0
  269. package/src/testing/service.ts +4 -4
  270. package/src/testing/withPluginManager.stories.tsx +1 -2
  271. package/src/testing/withPluginManager.tsx +45 -20
  272. package/src/ui/components/App/App.stories.tsx +7 -13
  273. package/src/ui/components/App/App.tsx +29 -5
  274. package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
  275. package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
  276. package/src/{plugin-runtime → ui/components/Placeholder}/index.ts +1 -1
  277. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +8 -7
  278. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +16 -15
  279. package/src/ui/components/Surface/SurfaceComponent.tsx +111 -55
  280. package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
  281. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  282. package/src/ui/components/Surface/index.ts +35 -1
  283. package/src/ui/components/Surface/types.test.ts +126 -0
  284. package/src/ui/components/Surface/types.ts +164 -12
  285. package/src/ui/components/index.ts +1 -0
  286. package/src/ui/hooks/index.ts +1 -1
  287. package/src/ui/hooks/useApp.test.tsx +159 -0
  288. package/src/ui/hooks/useApp.tsx +229 -24
  289. package/src/ui/hooks/useLoading.tsx +14 -6
  290. package/src/ui/hooks/useProcessManagerRuntime.ts +68 -0
  291. package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
  292. package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
  293. package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
  294. package/src/vite-plugin/boot-loader/index.ts +5 -0
  295. package/src/vite-plugin/boot-loader/loader.ts +123 -0
  296. package/src/vite-plugin/composer/index.ts +306 -0
  297. package/src/vite-plugin/import-map/index.ts +527 -0
  298. package/src/vite-plugin/index.ts +10 -0
  299. package/src/vite-plugin/manifest.test.ts +46 -0
  300. package/src/vite-plugin/manifest.ts +57 -0
  301. package/src/vite-plugin/packages.ts +187 -0
  302. package/tsconfig.json +25 -1
  303. package/tsconfig.node.json +1 -1
  304. package/vitest.config.ts +1 -1
  305. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  306. package/dist/lib/browser/capability-2GL5JAGJ.mjs +0 -37
  307. package/dist/lib/browser/capability-2GL5JAGJ.mjs.map +0 -7
  308. package/dist/lib/browser/capability-7RLVE42K.mjs.map +0 -7
  309. package/dist/lib/browser/chunk-4CTRO67U.mjs +0 -703
  310. package/dist/lib/browser/chunk-4CTRO67U.mjs.map +0 -7
  311. package/dist/lib/browser/chunk-FHQTHCX7.mjs +0 -8
  312. package/dist/lib/browser/chunk-FNKT2QQ2.mjs.map +0 -7
  313. package/dist/lib/browser/chunk-HE27PNNQ.mjs +0 -824
  314. package/dist/lib/browser/chunk-HE27PNNQ.mjs.map +0 -7
  315. package/dist/lib/browser/chunk-NPUEVX42.mjs +0 -34
  316. package/dist/lib/browser/chunk-NPUEVX42.mjs.map +0 -7
  317. package/dist/lib/browser/chunk-PKQT6C53.mjs.map +0 -7
  318. package/dist/lib/browser/chunk-REORGDJT.mjs +0 -80
  319. package/dist/lib/browser/chunk-REORGDJT.mjs.map +0 -7
  320. package/dist/lib/browser/chunk-YAFEA4GV.mjs +0 -1
  321. package/dist/lib/browser/chunk-YNFPIQGB.mjs.map +0 -7
  322. package/dist/lib/browser/chunk-ZRWBPIZG.mjs.map +0 -7
  323. package/dist/lib/browser/invoker-capability-BNLVNYHU.mjs +0 -36
  324. package/dist/lib/browser/invoker-capability-BNLVNYHU.mjs.map +0 -7
  325. package/dist/lib/node-esm/capability-CHIMU6LX.mjs +0 -38
  326. package/dist/lib/node-esm/capability-CHIMU6LX.mjs.map +0 -7
  327. package/dist/lib/node-esm/capability-EVZK4REM.mjs.map +0 -7
  328. package/dist/lib/node-esm/chunk-2A4PRBIX.mjs.map +0 -7
  329. package/dist/lib/node-esm/chunk-7CPNAEGV.mjs +0 -704
  330. package/dist/lib/node-esm/chunk-7CPNAEGV.mjs.map +0 -7
  331. package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +0 -7
  332. package/dist/lib/node-esm/chunk-CJCQS2YL.mjs.map +0 -7
  333. package/dist/lib/node-esm/chunk-DTCHT2X2.mjs +0 -825
  334. package/dist/lib/node-esm/chunk-DTCHT2X2.mjs.map +0 -7
  335. package/dist/lib/node-esm/chunk-JAZVHID3.mjs +0 -35
  336. package/dist/lib/node-esm/chunk-JAZVHID3.mjs.map +0 -7
  337. package/dist/lib/node-esm/chunk-SB5ODNPX.mjs.map +0 -7
  338. package/dist/lib/node-esm/chunk-UFW652GS.mjs +0 -81
  339. package/dist/lib/node-esm/chunk-UFW652GS.mjs.map +0 -7
  340. package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +0 -2
  341. package/dist/lib/node-esm/invoker-capability-VF6SP44V.mjs +0 -37
  342. package/dist/lib/node-esm/invoker-capability-VF6SP44V.mjs.map +0 -7
  343. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +0 -3
  344. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +0 -1
  345. package/dist/types/src/plugin-operation/history/capability.d.ts.map +0 -1
  346. package/dist/types/src/plugin-operation/history/errors.d.ts +0 -5
  347. package/dist/types/src/plugin-operation/history/errors.d.ts.map +0 -1
  348. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +0 -1
  349. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +0 -1
  350. package/dist/types/src/plugin-operation/history/index.d.ts.map +0 -1
  351. package/dist/types/src/plugin-operation/history/types.d.ts.map +0 -1
  352. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +0 -1
  353. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +0 -1
  354. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +0 -1
  355. package/dist/types/src/plugin-operation/index.d.ts +0 -3
  356. package/dist/types/src/plugin-operation/index.d.ts.map +0 -1
  357. package/dist/types/src/plugin-operation/invoker-capability.d.ts +0 -6
  358. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +0 -1
  359. package/dist/types/src/plugin-operation/meta.d.ts.map +0 -1
  360. package/dist/types/src/plugin-operation/testing.d.ts +0 -109
  361. package/dist/types/src/plugin-operation/testing.d.ts.map +0 -1
  362. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +0 -3
  363. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +0 -1
  364. package/dist/types/src/plugin-runtime/capability.d.ts +0 -6
  365. package/dist/types/src/plugin-runtime/capability.d.ts.map +0 -1
  366. package/dist/types/src/plugin-runtime/index.d.ts +0 -2
  367. package/dist/types/src/plugin-runtime/index.d.ts.map +0 -1
  368. package/dist/types/src/plugin-runtime/meta.d.ts +0 -3
  369. package/dist/types/src/plugin-runtime/meta.d.ts.map +0 -1
  370. package/dist/types/src/ui/hooks/useOperationResolver.d.ts +0 -19
  371. package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +0 -1
  372. package/src/plugin-operation/OperationPlugin.ts +0 -25
  373. package/src/plugin-operation/history/errors.ts +0 -11
  374. package/src/plugin-operation/invoker-capability.ts +0 -40
  375. package/src/plugin-operation/meta.ts +0 -11
  376. package/src/plugin-runtime/RuntimePlugin.ts +0 -20
  377. package/src/plugin-runtime/capability.ts +0 -53
  378. package/src/plugin-runtime/meta.ts +0 -11
  379. package/src/ui/hooks/useOperationResolver.ts +0 -40
  380. /package/dist/lib/browser/{chunk-YAFEA4GV.mjs.map → core/url-loader.mjs.map} +0 -0
  381. /package/dist/lib/node-esm/{chunk-Z4TJPSMP.mjs.map → core/url-loader.mjs.map} +0 -0
  382. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/capability.d.ts +0 -0
  383. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.d.ts +0 -0
  384. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/index.d.ts +0 -0
  385. /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.d.ts +0 -0
  386. /package/dist/types/src/{plugin-operation → plugin-process-manager}/meta.d.ts +0 -0
  387. /package/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
@@ -1,7 +0,0 @@
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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A2C,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,35 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- activation_event_exports
4
- } from "./chunk-7OWSHPYK.mjs";
5
- import {
6
- __export
7
- } from "./chunk-HSLMI22Q.mjs";
8
-
9
- // src/common/activation-events.ts
10
- var activation_events_exports = {};
11
- __export(activation_events_exports, {
12
- ManagedRuntimeReady: () => ManagedRuntimeReady,
13
- OperationInvokerReady: () => OperationInvokerReady,
14
- SetupLayer: () => SetupLayer,
15
- SetupOperationResolver: () => SetupOperationResolver,
16
- SetupReactSurface: () => SetupReactSurface,
17
- Startup: () => Startup
18
- });
19
- var Startup = activation_event_exports.make("dxos.org/app-framework/event/startup");
20
- var SetupReactSurface = activation_event_exports.make("dxos.org/app-framework/event/setup-react-surface");
21
- var SetupOperationResolver = activation_event_exports.make("dxos.org/app-framework/event/setup-operation-resolver");
22
- var SetupLayer = activation_event_exports.make("dxos.org/app-framework/event/setup-layer");
23
- var OperationInvokerReady = activation_event_exports.make("dxos.org/app-framework/event/operation-invoker-ready");
24
- var ManagedRuntimeReady = activation_event_exports.make("dxos.org/app-framework/event/managed-runtime-ready");
25
-
26
- export {
27
- Startup,
28
- SetupReactSurface,
29
- SetupOperationResolver,
30
- SetupLayer,
31
- OperationInvokerReady,
32
- ManagedRuntimeReady,
33
- activation_events_exports
34
- };
35
- //# sourceMappingURL=chunk-JAZVHID3.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/common/activation-events.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent as ActivationEvent$ } from '../core';\n\n/**\n * Fired when the app is started.\n */\nexport const Startup = ActivationEvent$.make('dxos.org/app-framework/event/startup');\n\n//\n// Dependent Events\n//\n\n/**\n * Fired to load any newly available surfaces.\n */\nexport const SetupReactSurface = ActivationEvent$.make('dxos.org/app-framework/event/setup-react-surface');\n\n/**\n * Fired before the operation invoker is activated.\n */\nexport const SetupOperationResolver = ActivationEvent$.make('dxos.org/app-framework/event/setup-operation-resolver');\n\n/**\n * Fired before the managed runtime is created.\n * Plugins should contribute their Layer capabilities before this event.\n */\nexport const SetupLayer = ActivationEvent$.make('dxos.org/app-framework/event/setup-layer');\n\n//\n// Triggered Events\n//\n\n/**\n * Fired after the operation invoker is ready.\n */\nexport const OperationInvokerReady = ActivationEvent$.make('dxos.org/app-framework/event/operation-invoker-ready');\n\n/**\n * Fired after the managed runtime is ready.\n */\nexport const ManagedRuntimeReady = ActivationEvent$.make('dxos.org/app-framework/event/managed-runtime-ready');\n"],
5
- "mappings": ";;;;;;;;;AAAA;;;;;;;;;AASO,IAAMA,UAAUC,yBAAiBC,KAAK,sCAAA;AAStC,IAAMC,oBAAoBF,yBAAiBC,KAAK,kDAAA;AAKhD,IAAME,yBAAyBH,yBAAiBC,KAAK,uDAAA;AAMrD,IAAMG,aAAaJ,yBAAiBC,KAAK,0CAAA;AASzC,IAAMI,wBAAwBL,yBAAiBC,KAAK,sDAAA;AAKpD,IAAMK,sBAAsBN,yBAAiBC,KAAK,oDAAA;",
6
- "names": ["Startup", "ActivationEvent$", "make", "SetupReactSurface", "SetupOperationResolver", "SetupLayer", "OperationInvokerReady", "ManagedRuntimeReady"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/core/capability.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\n\nimport type * as CapabilityManager from './capability-manager';\nimport type * as Plugin from './plugin';\n\n//\n// Capability Service Layer\n//\n\n/**\n * Effect Context.Tag for accessing CapabilityManager via the Effect layer system.\n * This allows capability modules to access the capability manager without having it passed as an argument.\n */\nexport class Service extends Context.Tag('@dxos/app-framework/CapabilityManager')<\n Service,\n CapabilityManager.CapabilityManager\n>() {}\n\n/**\n * Get a single capability from the capability manager.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation.\n * @throws If no capability is found.\n */\n// TODO(wittjosiah): Add custom tagged errors (Data.TaggedError) for app-framework to enable\n// type-safe error handling with Effect. Consider CapabilityNotFoundError, ModuleActivationError, etc.\nexport const get = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) =>\n Effect.try({\n try: () => manager.get(interfaceDef),\n catch: (error) => (error instanceof Error ? error : new Error(String(error))),\n }),\n );\n\n/**\n * Get all capabilities from the capability manager for a given interface.\n * @param interfaceDef The interface definition of the capability.\n * @returns An array of capability implementations.\n */\nexport const getAll = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T[], never, Service> =>\n Effect.map(Service, (manager) => manager.getAll(interfaceDef));\n\n/**\n * Wait for a capability to be available.\n * @param interfaceDef The interface definition of the capability.\n * @returns The capability implementation once available.\n */\nexport const waitFor = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<T, Error, Service> =>\n Effect.flatMap(Service, (manager) => manager.waitFor(interfaceDef));\n\n/**\n * Get the Atom reference to capabilities for reactive access.\n * @param interfaceDef The interface definition of the capability.\n * @returns An Atom containing the array of capability implementations.\n */\nexport const atom = <T>(interfaceDef: InterfaceDef<T>): Effect.Effect<Atom.Atom<T[]>, never, Service> =>\n Effect.map(Service, (manager) => manager.atom(interfaceDef));\n\nconst InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');\n\n/**\n * Symbol used to tag lazy capability functions with their module ID.\n */\nexport const ModuleTag: unique symbol = Symbol.for('@dxos/app-framework/ModuleTag');\n\n/**\n * The interface definition of a capability.\n */\nexport type InterfaceDef<T> = {\n [InterfaceDefTypeId]: T;\n identifier: string;\n};\n\nexport namespace InterfaceDef {\n export type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;\n}\n\n/**\n * Helper to define the interface of a capability.\n */\nexport const make = <T>(identifier: string) => {\n return { identifier } as InterfaceDef<T>;\n};\n\n/**\n * A unique string identifier with a Typescript type associated with it.\n * When a capability is contributed to the application an implementation of the interface is provided.\n */\nexport type Capability<T> = {\n /**\n * The interface definition of the capability.\n */\n readonly interface: InterfaceDef<T>;\n\n /**\n * The implementation of the capability.\n */\n readonly implementation: T;\n\n /**\n * Called when the capability is deactivated.\n */\n readonly deactivate?: () => Effect.Effect<void, Error>;\n};\n\nexport type Any = Capability<any>;\n\n/**\n * Union type representing all valid return types for a capability module.\n * Supports single capabilities, arrays, and tuples of different capability types.\n */\nexport type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]] | readonly [Any, ...Any[]];\n\n/**\n * Helper to define the implementation of a capability.\n */\nexport const contributes = <I extends InterfaceDef<any>>(\n interfaceDef: I,\n implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],\n deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],\n): Capability<I> => {\n return {\n interface: interfaceDef,\n implementation,\n deactivate,\n } satisfies Capability<I>;\n};\n\ntype LoadCapability<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\ntype LoadCapabilities<Props, Capabilities extends ModuleReturn = ModuleReturn> = () => Promise<{\n default: (props: Props) => Effect.Effect<Capabilities, Error, Service | Plugin.Service | never>;\n}>;\n\ntype NormalizeReturn<R> = R extends readonly (infer A)[]\n ? A[]\n : R extends (infer A)[]\n ? A[]\n : R extends Any\n ? [R]\n : Any[];\n\nexport type LazyCapability<Props = void, Capabilities extends ModuleReturn = ModuleReturn, E extends Error = Error> = (\n props: Props,\n) => Effect.Effect<NormalizeReturn<Capabilities>, E, Service | Plugin.Service | never>;\n\n/**\n * Helper to define a lazily loaded implementation of a capability.\n * Supports single capabilities, arrays, and tuples of different capability types.\n * @param name The export name (e.g., 'AppGraphBuilder') - used to auto-compute module IDs.\n * @param loader The lazy loader function.\n * @returns A lazy capability function with ModuleTag symbol attached.\n */\nexport const lazy = <T = void, R extends ModuleReturn = ModuleReturn>(\n name: string,\n c: LoadCapability<T, R> | LoadCapabilities<T, R>,\n): LazyCapability<T, R> => {\n const lazyFn: LazyCapability<T, R> = (props: T) =>\n Effect.gen(function* () {\n const { default: getCapability } = yield* Effect.tryPromise(() => c());\n const result = yield* getCapability(props);\n const normalized = result == null ? [] : Array.isArray(result) ? Array.from(result) : [result];\n return normalized as NormalizeReturn<R>;\n });\n\n return Object.assign(lazyFn, { [ModuleTag]: name });\n};\n\n/**\n * Gets the module tag (export name) from a lazy capability function.\n * @param capability The lazy capability function.\n * @returns The module tag if present, undefined otherwise.\n */\n// TODO(wittjosiah): Stricter type for capability.\nexport const getModuleTag = (capability: unknown): string | undefined => {\n return capability && typeof capability === 'function' && ModuleTag in capability\n ? String(capability[ModuleTag])\n : undefined;\n};\n\n/**\n * Helper to define a capability module with explicit typing.\n * Wraps the default export function to provide better type inference and make the pattern explicit.\n *\n * This helper provides explicit typing for the module activation function,\n * making it clear that the function should:\n * - Access CapabilityManager via the Effect layer system (Capability.get, Capability.getAll, etc.)\n * - Return a capability, array of capabilities, or tuple of different capability types (sync or async)\n *\n * Supports returning multiple capabilities of different types as a tuple, which will be normalized\n * to an array at runtime for compatibility with the plugin system.\n *\n * @example\n * ```ts\n * // Module without options - single capability\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * const client = yield* Capability.get(ClientCapabilities.Client);\n * return contributes(Capabilities.SettingsStore, store);\n * })\n * );\n *\n * // Module with multiple capabilities\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* () {\n * return [\n * contributes(Capabilities.SettingsStore, store),\n * contributes(Capabilities.Translations, translations),\n * ];\n * })\n * );\n *\n * // Module with required options (context accessed via layer)\n * export default Capability.makeModule(\n * Effect.fnUntraced(function* (props: { observability: boolean }) {\n * const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n * return contributes(Capabilities.IntentResolver, ...);\n * })\n * );\n * ```\n */\nexport const makeModule = <\n TProps = void,\n TReturn extends ModuleReturn = ModuleReturn,\n E extends Error = Error,\n R extends Service | Plugin.Service | never = Service,\n>(\n fn: (props: TProps) => Effect.Effect<TReturn, E, R>,\n): ((props: TProps) => Effect.Effect<TReturn, E, R>) => fn;\n"],
5
- "mappings": ";;;;;;AAAA;;;;;;;;;;;;;;AAKA,YAAYA,aAAa;AACzB,YAAYC,YAAY;AAajB,IAAMC,UAAN,cAA8BC,YAAI,uCAAA,EAAA,EAAA;AAGpC;AAUE,IAAMC,MAAM,CAAIC,iBACdC,eAAQJ,SAAS,CAACK,YAChBC,WAAI;EACTA,KAAK,MAAMD,QAAQH,IAAIC,YAAAA;EACvBI,OAAO,CAACC,UAAWA,iBAAiBC,QAAQD,QAAQ,IAAIC,MAAMC,OAAOF,KAAAA,CAAAA;AACvE,CAAA,CAAA;AAQG,IAAMG,SAAS,CAAIR,iBACjBS,WAAIZ,SAAS,CAACK,YAAYA,QAAQM,OAAOR,YAAAA,CAAAA;AAO3C,IAAMU,UAAU,CAAIV,iBAClBC,eAAQJ,SAAS,CAACK,YAAYA,QAAQQ,QAAQV,YAAAA,CAAAA;AAOhD,IAAMW,OAAO,CAAIX,iBACfS,WAAIZ,SAAS,CAACK,YAAYA,QAAQS,KAAKX,YAAAA,CAAAA;AAOzC,IAAMY,YAA2BC,uBAAOC,IAAI,+BAAA;AAiB5C,IAAMC,OAAO,CAAIC,eAAAA;AACtB,SAAO;IAAEA;EAAW;AACtB;AAkCO,IAAMC,cAAc,CACzBC,cACAC,gBACAC,eAAAA;AAEA,SAAO;IACLC,WAAWH;IACXC;IACAC;EACF;AACF;AA4BO,IAAME,OAAO,CAClBC,MACAC,MAAAA;AAEA,QAAMC,SAA+B,CAACC,UAC7BC,WAAI,aAAA;AACT,UAAM,EAAEC,SAASC,cAAa,IAAK,OAAcC,kBAAW,MAAMN,EAAAA,CAAAA;AAClE,UAAMO,SAAS,OAAOF,cAAcH,KAAAA;AACpC,UAAMM,aAAaD,UAAU,OAAO,CAAA,IAAKE,MAAMC,QAAQH,MAAAA,IAAUE,MAAME,KAAKJ,MAAAA,IAAU;MAACA;;AACvF,WAAOC;EACT,CAAA;AAEF,SAAOI,OAAOC,OAAOZ,QAAQ;IAAE,CAACb,SAAAA,GAAYW;EAAK,CAAA;AACnD;AAQO,IAAMe,eAAe,CAACC,eAAAA;AAC3B,SAAOA,cAAc,OAAOA,eAAe,cAAc3B,aAAa2B,aAClEC,OAAOD,WAAW3B,SAAAA,CAAU,IAC5B6B;AACN;AA2CO,IAAMC,aAAa,CAMxBC,OACsDA;",
6
- "names": ["Context", "Effect", "Service", "Tag", "get", "interfaceDef", "flatMap", "manager", "try", "catch", "error", "Error", "String", "getAll", "map", "waitFor", "atom", "ModuleTag", "Symbol", "for", "make", "identifier", "contributes", "interfaceDef", "implementation", "deactivate", "interface", "lazy", "name", "c", "lazyFn", "props", "gen", "default", "getCapability", "tryPromise", "result", "normalized", "Array", "isArray", "from", "Object", "assign", "getModuleTag", "capability", "String", "undefined", "makeModule", "fn"]
7
- }
@@ -1,81 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- capability_exports
4
- } from "./chunk-SB5ODNPX.mjs";
5
- import {
6
- __export
7
- } from "./chunk-HSLMI22Q.mjs";
8
-
9
- // src/common/capabilities.ts
10
- var capabilities_exports = {};
11
- __export(capabilities_exports, {
12
- AtomRegistry: () => AtomRegistry,
13
- Command: () => Command,
14
- HistoryTracker: () => HistoryTracker,
15
- Layer: () => Layer,
16
- ManagedRuntime: () => ManagedRuntime,
17
- Null: () => Null,
18
- OperationInvoker: () => OperationInvoker,
19
- OperationResolver: () => OperationResolver,
20
- PluginManager: () => PluginManager,
21
- ReactContext: () => ReactContext,
22
- ReactRoot: () => ReactRoot,
23
- ReactSurface: () => ReactSurface,
24
- UndoMapping: () => UndoMapping,
25
- UndoRegistry: () => UndoRegistry,
26
- getAtomValue: () => getAtomValue,
27
- subscribeAtom: () => subscribeAtom,
28
- updateAtomValue: () => updateAtomValue
29
- });
30
- import * as Effect from "effect/Effect";
31
- var Null = capability_exports.make("dxos.org/app-framework/capability/null");
32
- var PluginManager = capability_exports.make("dxos.org/app-framework/capability/plugin-manager");
33
- var AtomRegistry = capability_exports.make("dxos.org/app-framework/capability/atom-registry");
34
- var ReactContext = capability_exports.make("dxos.org/app-framework/capability/react-context");
35
- var ReactRoot = capability_exports.make("dxos.org/app-framework/capability/react-root");
36
- var ReactSurface = capability_exports.make("dxos.org/app-framework/common/react-surface");
37
- var Command = capability_exports.make("dxos.org/app-framework/capability/command");
38
- var Layer = capability_exports.make("dxos.org/app-framework/capability/layer");
39
- var ManagedRuntime = capability_exports.make("dxos.org/app-framework/capability/managed-runtime");
40
- var OperationResolver = capability_exports.make("dxos.org/app-framework/capability/operation-resolver");
41
- var UndoMapping = capability_exports.make("dxos.org/app-framework/capability/undo-mapping");
42
- var OperationInvoker = capability_exports.make("dxos.org/app-framework/capability/operation-invoker");
43
- var UndoRegistry = capability_exports.make("dxos.org/app-framework/capability/undo-registry");
44
- var HistoryTracker = capability_exports.make("dxos.org/app-framework/capability/history-tracker");
45
- var getAtomValue = (atomCapability) => Effect.gen(function* () {
46
- const registry = yield* capability_exports.get(AtomRegistry);
47
- const atom = yield* capability_exports.get(atomCapability);
48
- return registry.get(atom);
49
- });
50
- var updateAtomValue = (atomCapability, fn) => Effect.gen(function* () {
51
- const registry = yield* capability_exports.get(AtomRegistry);
52
- const atom = yield* capability_exports.get(atomCapability);
53
- registry.set(atom, fn(registry.get(atom)));
54
- });
55
- var subscribeAtom = (atomCapability, callback) => Effect.gen(function* () {
56
- const registry = yield* capability_exports.get(AtomRegistry);
57
- const atom = yield* capability_exports.get(atomCapability);
58
- return registry.subscribe(atom, () => callback(registry.get(atom)));
59
- });
60
-
61
- export {
62
- Null,
63
- PluginManager,
64
- AtomRegistry,
65
- ReactContext,
66
- ReactRoot,
67
- ReactSurface,
68
- Command,
69
- Layer,
70
- ManagedRuntime,
71
- OperationResolver,
72
- UndoMapping,
73
- OperationInvoker,
74
- UndoRegistry,
75
- HistoryTracker,
76
- getAtomValue,
77
- updateAtomValue,
78
- subscribeAtom,
79
- capabilities_exports
80
- };
81
- //# sourceMappingURL=chunk-UFW652GS.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/common/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Command$ from '@effect/cli/Command';\nimport { type Atom, type Registry } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport type * as Layer$ from 'effect/Layer';\nimport type * as ManagedRuntime$ from 'effect/ManagedRuntime';\nimport type { FC, PropsWithChildren } from 'react';\n\nimport type { OperationInvoker as OperationInvoker$, OperationResolver as OperationResolver$ } from '@dxos/operation';\n\nimport { Capability as Capability$, type PluginManager as PluginManager$ } from '../core';\nimport type {\n HistoryTracker as HistoryTracker$,\n UndoMapping as UndoMapping$,\n UndoRegistry as UndoRegistry$,\n} from '../plugin-operation';\nimport type { Surface } from '../ui';\n\n/**\n * Null capability.\n * @category Capability\n */\nexport const Null = Capability$.make<null>('dxos.org/app-framework/capability/null');\n\n/**\n * @category Capability\n */\nexport const PluginManager = Capability$.make<PluginManager$.PluginManager>(\n 'dxos.org/app-framework/capability/plugin-manager',\n);\n\n/**\n * @category Capability\n */\nexport const AtomRegistry = Capability$.make<Registry.Registry>('dxos.org/app-framework/capability/atom-registry');\n\nexport type ReactContext = Readonly<{\n id: string;\n dependsOn?: string[];\n context: FC<PropsWithChildren>;\n}>;\n\n/**\n * @category Capability\n */\nexport const ReactContext = Capability$.make<ReactContext>('dxos.org/app-framework/capability/react-context');\n\nexport type ReactRoot = Readonly<{ id: string; root: FC<PropsWithChildren> }>;\n\n/**\n * @category Capability\n */\nexport const ReactRoot = Capability$.make<ReactRoot>('dxos.org/app-framework/capability/react-root');\n\n/**\n * Surface definitions that can be either React components or Web Components.\n */\nexport type ReactSurface = Surface.Definition | readonly Surface.Definition[];\n\n/**\n * @category Capability\n */\nexport const ReactSurface = Capability$.make<ReactSurface>('dxos.org/app-framework/common/react-surface');\n\nexport type AnyCommand = Command$.Command<any, any, any, any>;\n\n/**\n * @category Capability\n */\nexport const Command = Capability$.make<AnyCommand>('dxos.org/app-framework/capability/command');\n\n/**\n * @category Capability\n */\nexport const Layer = Capability$.make<Layer$.Layer<any, any, any>>('dxos.org/app-framework/capability/layer');\n\nexport type ManagedRuntime = ManagedRuntime$.ManagedRuntime<any, any>;\n\n/**\n * @category Capability\n */\nexport const ManagedRuntime = Capability$.make<ManagedRuntime>('dxos.org/app-framework/capability/managed-runtime');\n\n//\n// Operation System Capabilities\n//\n\nexport type OperationResolver = OperationResolver$.OperationResolver<any, any, any, any>;\n\n/**\n * Handler registration for operations - contributed by plugins.\n * @category Capability\n */\nexport const OperationResolver = Capability$.make<OperationResolver[]>(\n 'dxos.org/app-framework/capability/operation-resolver',\n);\n\nexport type UndoMapping = UndoMapping$.UndoMapping;\n\n/**\n * Undo mapping registration - contributed by plugins.\n * @category Capability\n */\nexport const UndoMapping = Capability$.make<UndoMapping[]>('dxos.org/app-framework/capability/undo-mapping');\n\nexport type OperationInvoker = OperationInvoker$.OperationInvoker;\n\n/**\n * Operation invoker - provided by OperationPlugin.\n * @category Capability\n */\nexport const OperationInvoker = Capability$.make<OperationInvoker>(\n 'dxos.org/app-framework/capability/operation-invoker',\n);\n\nexport type UndoRegistry = UndoRegistry$.UndoRegistry;\n\n/**\n * Undo registry - provided by OperationPlugin.\n * @category Capability\n */\nexport const UndoRegistry = Capability$.make<UndoRegistry>('dxos.org/app-framework/capability/undo-registry');\n\nexport type HistoryTracker = HistoryTracker$.HistoryTracker;\n\n/**\n * History tracker - provided by OperationPlugin.\n * @category Capability\n */\nexport const HistoryTracker = Capability$.make<HistoryTracker>('dxos.org/app-framework/capability/history-tracker');\n\n//\n// Atom Capability Helpers\n//\n\n/**\n * Get the current value of an atom capability.\n * @example const settings = yield* Capabilities.getAtomValue(ThreadCapabilities.Settings);\n */\nexport const getAtomValue = <T>(\n atomCapability: Capability$.InterfaceDef<Atom.Atom<T>>,\n): Effect.Effect<T, Error, Capability$.Service> =>\n Effect.gen(function* () {\n const registry = yield* Capability$.get(AtomRegistry);\n const atom = yield* Capability$.get(atomCapability);\n return registry.get(atom);\n });\n\n/**\n * Update an atom capability value (requires writable atom).\n * @example yield* Capabilities.updateAtomValue(ThreadCapabilities.Settings, (s) => ({ ...s, foo: true }));\n */\nexport const updateAtomValue = <T>(\n atomCapability: Capability$.InterfaceDef<Atom.Writable<T>>,\n fn: (current: T) => T,\n): Effect.Effect<void, Error, Capability$.Service> =>\n Effect.gen(function* () {\n const registry = yield* Capability$.get(AtomRegistry);\n const atom = yield* Capability$.get(atomCapability);\n registry.set(atom, fn(registry.get(atom)));\n });\n\n/**\n * Subscribe to an atom capability.\n * @example const unsubscribe = yield* Capabilities.subscribeAtom(ThreadCapabilities.Settings, (value) => ...);\n */\nexport const subscribeAtom = <T>(\n atomCapability: Capability$.InterfaceDef<Atom.Atom<T>>,\n callback: (value: T) => void,\n): Effect.Effect<() => void, Error, Capability$.Service> =>\n Effect.gen(function* () {\n const registry = yield* Capability$.get(AtomRegistry);\n const atom = yield* Capability$.get(atomCapability);\n return registry.subscribe(atom, () => callback(registry.get(atom)));\n });\n"],
5
- "mappings": ";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;AAMA,YAAYA,YAAY;AAmBjB,IAAMC,OAAOC,mBAAYC,KAAW,wCAAA;AAKpC,IAAMC,gBAAgBF,mBAAYC,KACvC,kDAAA;AAMK,IAAME,eAAeH,mBAAYC,KAAwB,iDAAA;AAWzD,IAAMG,eAAeJ,mBAAYC,KAAmB,iDAAA;AAOpD,IAAMI,YAAYL,mBAAYC,KAAgB,8CAAA;AAU9C,IAAMK,eAAeN,mBAAYC,KAAmB,6CAAA;AAOpD,IAAMM,UAAUP,mBAAYC,KAAiB,2CAAA;AAK7C,IAAMO,QAAQR,mBAAYC,KAAkC,yCAAA;AAO5D,IAAMQ,iBAAiBT,mBAAYC,KAAqB,mDAAA;AAYxD,IAAMS,oBAAoBV,mBAAYC,KAC3C,sDAAA;AASK,IAAMU,cAAcX,mBAAYC,KAAoB,gDAAA;AAQpD,IAAMW,mBAAmBZ,mBAAYC,KAC1C,qDAAA;AASK,IAAMY,eAAeb,mBAAYC,KAAmB,iDAAA;AAQpD,IAAMa,iBAAiBd,mBAAYC,KAAqB,mDAAA;AAUxD,IAAMc,eAAe,CAC1BC,mBAEOC,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOlB,mBAAYmB,IAAIhB,YAAAA;AACxC,QAAMiB,OAAO,OAAOpB,mBAAYmB,IAAIH,cAAAA;AACpC,SAAOE,SAASC,IAAIC,IAAAA;AACtB,CAAA;AAMK,IAAMC,kBAAkB,CAC7BL,gBACAM,OAEOL,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOlB,mBAAYmB,IAAIhB,YAAAA;AACxC,QAAMiB,OAAO,OAAOpB,mBAAYmB,IAAIH,cAAAA;AACpCE,WAASK,IAAIH,MAAME,GAAGJ,SAASC,IAAIC,IAAAA,CAAAA,CAAAA;AACrC,CAAA;AAMK,IAAMI,gBAAgB,CAC3BR,gBACAS,aAEOR,WAAI,aAAA;AACT,QAAMC,WAAW,OAAOlB,mBAAYmB,IAAIhB,YAAAA;AACxC,QAAMiB,OAAO,OAAOpB,mBAAYmB,IAAIH,cAAAA;AACpC,SAAOE,SAASQ,UAAUN,MAAM,MAAMK,SAASP,SAASC,IAAIC,IAAAA,CAAAA,CAAAA;AAC9D,CAAA;",
6
- "names": ["Effect", "Null", "Capability$", "make", "PluginManager", "AtomRegistry", "ReactContext", "ReactRoot", "ReactSurface", "Command", "Layer", "ManagedRuntime", "OperationResolver", "UndoMapping", "OperationInvoker", "UndoRegistry", "HistoryTracker", "getAtomValue", "atomCapability", "gen", "registry", "get", "atom", "updateAtomValue", "fn", "set", "subscribeAtom", "callback", "subscribe"]
7
- }
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- //# sourceMappingURL=chunk-Z4TJPSMP.mjs.map
@@ -1,37 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import "./chunk-VUIUFIGT.mjs";
3
- import {
4
- capabilities_exports
5
- } from "./chunk-UFW652GS.mjs";
6
- import {
7
- activation_events_exports
8
- } from "./chunk-JAZVHID3.mjs";
9
- import "./chunk-Z4TJPSMP.mjs";
10
- import "./chunk-DTCHT2X2.mjs";
11
- import "./chunk-7OWSHPYK.mjs";
12
- import {
13
- plugin_exports
14
- } from "./chunk-CJCQS2YL.mjs";
15
- import {
16
- capability_exports
17
- } from "./chunk-SB5ODNPX.mjs";
18
- import "./chunk-HSLMI22Q.mjs";
19
-
20
- // src/plugin-operation/invoker-capability.ts
21
- import * as Effect from "effect/Effect";
22
- import { OperationInvoker } from "@dxos/operation";
23
- var invoker_capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
24
- const capabilityManager = yield* capability_exports.Service;
25
- const pluginManager = yield* plugin_exports.Service;
26
- const managedRuntimes = yield* capability_exports.getAll(capabilities_exports.ManagedRuntime);
27
- const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : void 0;
28
- const invoker = OperationInvoker.make(() => Effect.gen(function* () {
29
- yield* plugin_exports.activate(activation_events_exports.SetupOperationResolver);
30
- return (yield* capability_exports.getAll(capabilities_exports.OperationResolver)).flat();
31
- }).pipe(Effect.provideService(capability_exports.Service, capabilityManager), Effect.provideService(plugin_exports.Service, pluginManager)), managedRuntime);
32
- return capability_exports.contributes(capabilities_exports.OperationInvoker, invoker);
33
- }));
34
- export {
35
- invoker_capability_default as default
36
- };
37
- //# sourceMappingURL=invoker-capability-VF6SP44V.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/plugin-operation/invoker-capability.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { OperationInvoker } from '@dxos/operation';\n\nimport { 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 services for synchronous access in callbacks.\n const capabilityManager = yield* Capability.Service;\n const pluginManager = yield* Plugin.Service;\n\n // Get the ManagedRuntime capability (should be available since we activate after ManagedRuntimeReady).\n const managedRuntimes = yield* Capability.getAll(Capabilities.ManagedRuntime);\n const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : undefined;\n\n const invoker = OperationInvoker.make(\n () =>\n Effect.gen(function* () {\n yield* Plugin.activate(ActivationEvents.SetupOperationResolver);\n return (yield* Capability.getAll(Capabilities.OperationResolver)).flat();\n }).pipe(\n Effect.provideService(Capability.Service, capabilityManager),\n Effect.provideService(Plugin.Service, pluginManager),\n ),\n managedRuntime,\n );\n\n return Capability.contributes(Capabilities.OperationInvoker, invoker);\n }),\n);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,wBAAwB;AASjC,IAAA,6BAAeC,mBAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,oBAAoB,OAAOH,mBAAWI;AAC5C,QAAMC,gBAAgB,OAAOC,eAAOF;AAGpC,QAAMG,kBAAkB,OAAOP,mBAAWQ,OAAOC,qBAAaC,cAAc;AAC5E,QAAMC,iBAAiBJ,gBAAgBK,SAAS,IAAIL,gBAAgB,CAAA,IAAKM;AAEzE,QAAMC,UAAUC,iBAAiBC,KAC/B,MACSC,WAAI,aAAA;AACT,WAAOX,eAAOY,SAASC,0BAAiBC,sBAAsB;AAC9D,YAAQ,OAAOpB,mBAAWQ,OAAOC,qBAAaY,iBAAiB,GAAGC,KAAI;EACxE,CAAA,EAAGC,KACMC,sBAAexB,mBAAWI,SAASD,iBAAAA,GACnCqB,sBAAelB,eAAOF,SAASC,aAAAA,CAAAA,GAE1CM,cAAAA;AAGF,SAAOX,mBAAWyB,YAAYhB,qBAAaM,kBAAkBD,OAAAA;AAC/D,CAAA,CAAA;",
6
- "names": ["Effect", "OperationInvoker", "Capability", "makeModule", "fnUntraced", "capabilityManager", "Service", "pluginManager", "Plugin", "managedRuntimes", "getAll", "Capabilities", "ManagedRuntime", "managedRuntime", "length", "undefined", "invoker", "OperationInvoker", "make", "gen", "activate", "ActivationEvents", "SetupOperationResolver", "OperationResolver", "flat", "pipe", "provideService", "contributes"]
7
- }
@@ -1,3 +0,0 @@
1
- import { Plugin } from '../core';
2
- export declare const OperationPlugin: Plugin.PluginFactory<void>;
3
- //# sourceMappingURL=OperationPlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OperationPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/OperationPlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAO7C,eAAO,MAAM,eAAe,4BAY3B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;;AAMhD,wBAkBE"}
@@ -1,5 +0,0 @@
1
- import { OperationError } from '@dxos/operation';
2
- export declare class EmptyHistoryError extends OperationError {
3
- constructor();
4
- }
5
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBAAa,iBAAkB,SAAQ,cAAc;;CAIpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"history-tracker.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/history-tracker.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQpD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,WAAW,EAAE,MAAM,OAAO,CAAC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAC9C,OAAO,EAAE,MAAM,OAAO,CAAC;CACxB;AAMD;;GAEG;AACH,eAAO,MAAM,IAAI,GACf,SAAS,gBAAgB,CAAC,wBAAwB,EAClD,cAAc,YAAY,KACzB,cAqFF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"history-tracker.test.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/history-tracker.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1C,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxC,YAAY,EAAE,GAAG,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"undo-mapping.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/undo-mapping.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,KAAK,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;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mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAMnD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxC,mEAAmE;IACnE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,CAAC;IAC5D,8DAA8D;IAC9D,OAAO,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;CACvE,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,iBAAiB,GAAG,SAAS,CAAC;CACtF;AAMD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,aAAa,MAAM,WAAW,CAAC,WAAW,EAAE,KAAG,YAgBnE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"undo-registry.test.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/undo-registry.test.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export * from './history';
2
- export * from './OperationPlugin';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
@@ -1,6 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { OperationInvoker } from '@dxos/operation';
3
- import { Capability, Plugin } from '../core';
4
- declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<OperationInvoker.OperationInvoker>>, never, Capability.Service | Plugin.Service>;
5
- export default _default;
6
- //# sourceMappingURL=invoker-capability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoker-capability.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/invoker-capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;;AAM7C,wBAwBE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAIzB,CAAC"}
@@ -1,109 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import * as Schema from 'effect/Schema';
3
- import { Operation, type OperationInvoker, OperationResolver } from '@dxos/operation';
4
- export declare const Compute: Omit<{
5
- readonly schema: {
6
- readonly input: Schema.Struct<{
7
- value: typeof Schema.Number;
8
- }>;
9
- readonly output: Schema.Struct<{
10
- value: typeof Schema.Number;
11
- }>;
12
- };
13
- readonly meta: {
14
- readonly key: "test.compute";
15
- };
16
- }, "executionMode"> & import("effect/Pipeable").Pipeable & {
17
- readonly executionMode: "sync" | "async";
18
- };
19
- export declare const HalveCompute: Omit<{
20
- readonly schema: {
21
- readonly input: Schema.Struct<{
22
- value: typeof Schema.Number;
23
- }>;
24
- readonly output: Schema.Struct<{
25
- value: typeof Schema.Number;
26
- }>;
27
- };
28
- readonly meta: {
29
- readonly key: "test.halve-compute";
30
- };
31
- }, "executionMode"> & import("effect/Pipeable").Pipeable & {
32
- readonly executionMode: "sync" | "async";
33
- };
34
- export declare const ToString: Omit<{
35
- readonly schema: {
36
- readonly input: Schema.Struct<{
37
- value: typeof Schema.Number;
38
- }>;
39
- readonly output: Schema.Struct<{
40
- string: typeof Schema.String;
41
- }>;
42
- };
43
- readonly meta: {
44
- readonly key: "test.to-string";
45
- };
46
- }, "executionMode"> & import("effect/Pipeable").Pipeable & {
47
- readonly executionMode: "sync" | "async";
48
- };
49
- export declare const Add: Omit<{
50
- readonly schema: {
51
- readonly input: Schema.Tuple2<typeof Schema.Number, typeof Schema.Number>;
52
- readonly output: typeof Schema.Number;
53
- };
54
- readonly meta: {
55
- readonly key: "test.add";
56
- };
57
- }, "executionMode"> & import("effect/Pipeable").Pipeable & {
58
- readonly executionMode: "sync" | "async";
59
- };
60
- export declare const SideEffect: Omit<{
61
- readonly schema: {
62
- readonly input: typeof Schema.Void;
63
- readonly output: typeof Schema.Void;
64
- };
65
- readonly meta: {
66
- readonly key: "test.side-effect";
67
- };
68
- }, "executionMode"> & import("effect/Pipeable").Pipeable & {
69
- readonly executionMode: "sync" | "async";
70
- };
71
- export declare const computeHandler: OperationResolver.OperationResolver<{
72
- readonly value: number;
73
- }, {
74
- readonly value: number;
75
- }, never, Operation.Service>;
76
- export declare const halveComputeHandler: OperationResolver.OperationResolver<{
77
- readonly value: number;
78
- }, {
79
- readonly value: number;
80
- }, never, Operation.Service>;
81
- export declare const toStringHandler: OperationResolver.OperationResolver<{
82
- readonly value: number;
83
- }, {
84
- readonly string: string;
85
- }, never, Operation.Service>;
86
- export declare const addHandler: OperationResolver.OperationResolver<readonly [number, number], number, never, Operation.Service>;
87
- export declare const sideEffectHandler: OperationResolver.OperationResolver<void, void, never, Operation.Service>;
88
- /**
89
- * Event collector for testing - provides deterministic event collection using Effect primitives.
90
- */
91
- export interface EventCollector {
92
- /** All collected events. */
93
- readonly events: OperationInvoker.InvocationEvent[];
94
- /** Wait until N events have been collected. */
95
- waitForEvents: (count: number) => Effect.Effect<void>;
96
- /** Clean up the subscription fiber. */
97
- dispose: Effect.Effect<void>;
98
- }
99
- /**
100
- * Creates an event collector that subscribes to invoker events.
101
- * Uses Effect primitives for synchronization.
102
- */
103
- export declare const createEventCollector: (invoker: OperationInvoker.OperationInvoker) => Effect.Effect<EventCollector>;
104
- /**
105
- * Waits until a condition is true, yielding to the JS event loop between checks.
106
- * Uses setImmediate to allow other async work to complete.
107
- */
108
- export declare const waitUntil: (condition: () => boolean) => Effect.Effect<void>;
109
- //# sourceMappingURL=testing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/testing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMtF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;CAMlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAMvB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAMnB,CAAC;AAEH,eAAO,MAAM,GAAG;;;;;;;;;;CAMd,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;CAMrB,CAAC;AAMH,eAAO,MAAM,cAAc;;;;4BAOzB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;4BAG9B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;4BAG1B,CAAC;AAEH,eAAO,MAAM,UAAU,kGAGrB,CAAC;AAEH,eAAO,MAAM,iBAAiB,2EAG5B,CAAC;AAMH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,eAAe,EAAE,CAAC;IACpD,+CAA+C;IAC/C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtD,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,gBAAgB,CAAC,gBAAgB,KAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAoD1G,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAKnE,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Plugin } from '../core';
2
- export declare const RuntimePlugin: Plugin.PluginFactory<void>;
3
- //# sourceMappingURL=RuntimePlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuntimePlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/RuntimePlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,aAAa,4BAQzB,CAAC"}
@@ -1,6 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Capabilities } from '../common';
3
- import { Capability, Plugin } from '../core';
4
- declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.ManagedRuntime>>, Error, Capability.Service | Plugin.Service>;
5
- export default _default;
6
- //# sourceMappingURL=capability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAoB,YAAY,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;;AAM7C,wBAqCE"}
@@ -1,2 +0,0 @@
1
- export * from './RuntimePlugin';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type Plugin } from '../core';
2
- export declare const meta: Plugin.Meta;
3
- //# sourceMappingURL=meta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAIzB,CAAC"}