@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
@@ -0,0 +1,101 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import * as Schema from 'effect/Schema';
3
+ import { BaseError } from '@dxos/errors';
4
+ /**
5
+ * Default port the Vite plugin (`composerPlugin`) binds the dev server to.
6
+ *
7
+ * Shared single source of truth — `composerPlugin` reads it as the default
8
+ * port, and the host's "Load Dev Plugin" affordance pre-fills the manifest URL
9
+ * with `http://localhost:${PLUGIN_DEV_SERVER_PORT}/manifest.json`. Lives in
10
+ * app-framework rather than `@dxos/protocols` because the constant is a
11
+ * client-side convention (host loader + Vite plugin) rather than a wire-level
12
+ * protocol.
13
+ */
14
+ export declare const PLUGIN_DEV_SERVER_PORT = 3967;
15
+ declare const PluginManifestError_base: {
16
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
17
+ cause?: unknown;
18
+ stack?: string;
19
+ name: "PluginManifestError";
20
+ context: Record<string, unknown>;
21
+ readonly message: string;
22
+ readonly _tag: "PluginManifestError";
23
+ };
24
+ isError(error: unknown): error is Error;
25
+ name: "PluginManifestError";
26
+ is(error: unknown): error is BaseError;
27
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
28
+ ifTypeDiffers?: boolean;
29
+ }): (error: unknown) => {
30
+ cause?: unknown;
31
+ stack?: string;
32
+ name: "PluginManifestError";
33
+ context: Record<string, unknown>;
34
+ readonly message: string;
35
+ readonly _tag: "PluginManifestError";
36
+ };
37
+ extend<Name extends string = string>(name: Name, message?: string): any;
38
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
39
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
40
+ stackTraceLimit: number;
41
+ };
42
+ /**
43
+ * Tagged error for manifest fetch / parse failures. Construction sites set
44
+ * `context.manifestUrl` and `context.reason` (one of `'fetch-failed' |
45
+ * 'http-error' | 'parse-failed' | 'invalid'`) so handlers can route on the
46
+ * specific failure mode.
47
+ */
48
+ export declare class PluginManifestError extends PluginManifestError_base {
49
+ }
50
+ /**
51
+ * Schema for a third-party plugin manifest.
52
+ *
53
+ * Production manifests are published as a sibling of the plugin's entry module
54
+ * ({@link PLUGIN_ENTRY_FILENAME}) and advertise every file the plugin needs at
55
+ * runtime so the host can eagerly cache them for offline use.
56
+ *
57
+ * Dev manifests (served by `vite dev` via {@link composerPlugin}) set `devEntry`
58
+ * to point at the unbundled source entry. The host's loader treats the presence
59
+ * of `devEntry` as the dev-mode signal: it imports the entry directly from the
60
+ * dev server, skips eager asset caching, and skips static stylesheet injection
61
+ * (Vite handles CSS via runtime `<style>` injection during HMR). `assets` is not
62
+ * required to enumerate every file in dev mode — chunks and styles flow through
63
+ * the dev server on demand.
64
+ */
65
+ export declare const Manifest: Schema.Struct<{
66
+ id: typeof Schema.String;
67
+ name: typeof Schema.String;
68
+ version: typeof Schema.String;
69
+ assets: Schema.Array$<typeof Schema.String>;
70
+ devEntry: Schema.optional<typeof Schema.String>;
71
+ }>;
72
+ export type Manifest = Schema.Schema.Type<typeof Manifest>;
73
+ /**
74
+ * Resolved manifest with all asset paths converted to absolute URLs.
75
+ *
76
+ * `dev` reflects whether the source manifest declared a `devEntry`. Loaders branch
77
+ * on this to skip offline caching and stylesheet injection — both are no-ops (or
78
+ * actively wrong) when the plugin is being served by a Vite dev server.
79
+ */
80
+ export type ResolvedManifest = {
81
+ id: string;
82
+ name: string;
83
+ version: string;
84
+ entryUrl: string;
85
+ assetUrls: readonly string[];
86
+ dev: boolean;
87
+ };
88
+ /**
89
+ * Synchronous decode + validate + resolve for an in-memory manifest payload. Used
90
+ * by tests and tooling that have the manifest body already loaded; the runtime
91
+ * path goes through {@link fetchManifest}.
92
+ */
93
+ export declare const parse: (manifestUrl: string, payload: unknown) => ResolvedManifest;
94
+ /**
95
+ * Fetches and parses a manifest from the given URL via Effect's HTTP client and
96
+ * Schema-driven JSON decoding. All failure modes surface as a single tagged
97
+ * {@link PluginManifestError}; callers route on `error.context.reason`.
98
+ */
99
+ export declare const fetchManifest: (manifestUrl: string) => Effect.Effect<ResolvedManifest, PluginManifestError>;
100
+ export {};
101
+ //# sourceMappingURL=plugin-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-manifest.d.ts","sourceRoot":"","sources":["../../../../src/core/plugin-manifest.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3C;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,wBAAqE;CAAG;AAEjH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ;;;;;;EAMnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAmBF;;;;GAIG;AACH,eAAO,MAAM,KAAK,gBAAiB,MAAM,WAAW,OAAO,KAAG,gBAM7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,gBAAiB,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAuBxC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plugin-manifest.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-manifest.test.d.ts","sourceRoot":"","sources":["../../../../src/core/plugin-manifest.test.ts"],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import * as Context from 'effect/Context';
2
2
  import * as Effect from 'effect/Effect';
3
3
  import * as Pipeable from 'effect/Pipeable';
4
+ import { BaseError } from '@dxos/errors';
4
5
  import type * as ActivationEvent from './activation-event';
5
6
  import * as Capability from './capability';
6
7
  import type * as PluginManager from './plugin-manager';
@@ -25,6 +26,11 @@ export declare const activate: (event: ActivationEvent.ActivationEvent) => Effec
25
26
  * @returns Whether the reset was successful.
26
27
  */
27
28
  export declare const reset: (event: ActivationEvent.ActivationEvent) => Effect.Effect<boolean, Error, Service>;
29
+ /**
30
+ * Shuts down the plugin manager, deactivating all active modules and clearing lifecycle state.
31
+ * Accesses the PluginManager via the Effect layer system.
32
+ */
33
+ export declare const shutdown: () => Effect.Effect<boolean, Error, Service>;
28
34
  /**
29
35
  * Identifier denoting a PluginModule.
30
36
  */
@@ -49,15 +55,32 @@ export interface PluginModule {
49
55
  */
50
56
  activatesOn: ActivationEvent.Events;
51
57
  /**
52
- * Events which the plugin depends on being activated.
53
- * Plugin is marked as needing reset a plugin activated by a dependent event is removed.
54
- * Events are automatically activated before activation of the plugin.
58
+ * Events that this module fires *before* its own activation runs.
59
+ *
60
+ * When this module is asked to activate (via {@link activatesOn}), the
61
+ * plugin manager first activates every event listed here, ensuring any
62
+ * other modules that contribute to those events have completed before
63
+ * this module's {@link activate} body executes. These events are fired
64
+ * by the framework on this module's behalf — the module does not need
65
+ * to wait for some other code to fire them.
66
+ *
67
+ * The module is marked as needing reset if a module activated by one
68
+ * of these events is later removed.
69
+ *
70
+ * Read as: "this module fires these events before [its] activation".
55
71
  */
56
- activatesBefore?: ActivationEvent.ActivationEvent[];
72
+ firesBeforeActivation?: ActivationEvent.ActivationEvent[];
57
73
  /**
58
- * Events which this plugin triggers upon activation.
74
+ * Events that this module fires *after* its own activation completes.
75
+ *
76
+ * Once this module's {@link activate} body has finished executing, the
77
+ * plugin manager activates every event listed here, causing any modules
78
+ * listening on those events to run. These events are fired by the
79
+ * framework on this module's behalf as part of this module's lifecycle.
80
+ *
81
+ * Read as: "this module fires these events after [its] activation".
59
82
  */
60
- activatesAfter?: ActivationEvent.ActivationEvent[];
83
+ firesAfterActivation?: ActivationEvent.ActivationEvent[];
61
84
  /**
62
85
  * Called when the module is activated.
63
86
  * CapabilityManager is accessed via the Effect layer system (Capability.Service).
@@ -76,17 +99,26 @@ export type Meta = {
76
99
  *
77
100
  * Expected to be in the form of a valid URL.
78
101
  *
79
- * @example dxos.org/plugin/example
102
+ * @example org.dxos.plugin.example
80
103
  */
81
104
  id: string;
82
105
  /**
83
106
  * Human-readable name.
84
107
  */
85
108
  name: string;
109
+ /**
110
+ * Semver version string of the plugin, typically the publishing package's
111
+ * `package.json` version.
112
+ */
113
+ version?: string;
86
114
  /**
87
115
  * Short description of plugin functionality.
88
116
  */
89
117
  description?: string;
118
+ /**
119
+ * Name of the author or organization that created the plugin.
120
+ */
121
+ author?: string;
90
122
  /**
91
123
  * URL of home page.
92
124
  */
@@ -95,6 +127,13 @@ export type Meta = {
95
127
  * URL of source code.
96
128
  */
97
129
  source?: string;
130
+ /**
131
+ * Relative path (inside the published package) to the plugin's bundled MDL
132
+ * specification file — e.g. `'PLUGIN.mdl'` or `'docs/PLUGIN.mdl'`. The file
133
+ * is shipped via the package's `files` entry and resolved by registry
134
+ * surfaces to render an in-app viewer and/or external link.
135
+ */
136
+ spec?: string;
98
137
  /**
99
138
  * URL of screenshot.
100
139
  */
@@ -111,6 +150,21 @@ export type Meta = {
111
150
  * Icon hue (ChromaticPalette).
112
151
  */
113
152
  iconHue?: string;
153
+ /**
154
+ * IDs of plugins this plugin functionally depends on.
155
+ *
156
+ * Treated as a convenience by the default `PluginManager` flow:
157
+ * - Enabling this plugin auto-enables the transitive closure of `dependsOn`
158
+ * (installing missing entries from the plugin registry when possible).
159
+ * - Disabling a depended-upon plugin surfaces dependents to the caller; the
160
+ * `PluginManager.disable` API supports an opt-in cascade.
161
+ *
162
+ * Not an invariant: low-level `PluginManager` APIs accept opt-outs
163
+ * (`resolveDependencies: false`, `ignoreDependents: true`) so a caller may
164
+ * substitute an alternative implementation that satisfies the dependent's
165
+ * capability needs in its own way.
166
+ */
167
+ dependsOn?: string[];
114
168
  };
115
169
  /**
116
170
  * Identifier denoting a Plugin.
@@ -159,5 +213,126 @@ export type PluginFactory<T = void> = ((options: T) => Plugin) & {
159
213
  * When T is void, the function takes no arguments: () => Plugin.
160
214
  */
161
215
  export declare function make<T>(builder: PluginBuilder<T>): PluginFactory<T>;
216
+ /**
217
+ * Async loader for a lazy plugin's real implementation.
218
+ * The default export of the loaded module must be a `PluginFactory<T>` —
219
+ * i.e. the same shape `Plugin.make` produces.
220
+ */
221
+ export type LazyLoader<T = void> = () => Promise<{
222
+ default: PluginFactory<T>;
223
+ }>;
224
+ /**
225
+ * Defines a lazy plugin whose body is loaded on first enable.
226
+ *
227
+ * The returned factory produces a stub `Plugin` that exposes `meta`
228
+ * synchronously (so callers can read `Plugin.meta.id` for free) but defers
229
+ * loading the real plugin's modules until the manager calls
230
+ * `Plugin.resolveLazy`. This lets the plugin's main entry point ship as a
231
+ * tiny meta-only chunk — the heavy capabilities, schema, React surfaces,
232
+ * etc. live behind the dynamic `import()` and become a separate Rollup
233
+ * chunk that is only fetched when the plugin is enabled.
234
+ *
235
+ * @example
236
+ * ```ts
237
+ * // plugin-markdown/src/index.ts
238
+ * import { Plugin } from '@dxos/app-framework';
239
+ * import { meta } from './meta';
240
+ *
241
+ * export const MarkdownPlugin = Plugin.lazy(meta, () => import('./MarkdownPlugin'));
242
+ *
243
+ * // plugin-markdown/src/MarkdownPlugin.tsx
244
+ * export const MarkdownPlugin = Plugin.define(meta).pipe(...heavy modules..., Plugin.make);
245
+ * export default MarkdownPlugin;
246
+ * ```
247
+ */
248
+ export declare const lazy: <T = void>(meta: Meta, loader: LazyLoader<T>) => PluginFactory<T>;
249
+ /**
250
+ * Type guard for lazy plugin stubs produced by {@link lazy}.
251
+ */
252
+ export declare const isLazy: (plugin: Plugin) => boolean;
253
+ declare const LazyPluginError_base: {
254
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
255
+ cause?: unknown;
256
+ stack?: string;
257
+ name: "LazyPluginError";
258
+ context: Record<string, unknown>;
259
+ readonly message: string;
260
+ readonly _tag: "LazyPluginError";
261
+ };
262
+ isError(error: unknown): error is Error;
263
+ name: "LazyPluginError";
264
+ is(error: unknown): error is BaseError;
265
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
266
+ ifTypeDiffers?: boolean;
267
+ }): (error: unknown) => {
268
+ cause?: unknown;
269
+ stack?: string;
270
+ name: "LazyPluginError";
271
+ context: Record<string, unknown>;
272
+ readonly message: string;
273
+ readonly _tag: "LazyPluginError";
274
+ };
275
+ extend<Name extends string = string>(name: Name, message?: string): any;
276
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
277
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
278
+ stackTraceLimit: number;
279
+ };
280
+ /**
281
+ * Tagged error for failures during lazy plugin resolution. `context.id` is
282
+ * the lazy plugin's `meta.id`; `context.reason` discriminates the failure
283
+ * mode (`'load-failed' | 'missing-default' | 'invalid-plugin' |
284
+ * 'meta-mismatch'`) so callers can route on it.
285
+ */
286
+ export declare class LazyPluginError extends LazyPluginError_base {
287
+ }
288
+ declare const PluginDependencyError_base: {
289
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
290
+ cause?: unknown;
291
+ stack?: string;
292
+ name: "PluginDependencyError";
293
+ context: Record<string, unknown>;
294
+ readonly message: string;
295
+ readonly _tag: "PluginDependencyError";
296
+ };
297
+ isError(error: unknown): error is Error;
298
+ name: "PluginDependencyError";
299
+ is(error: unknown): error is BaseError;
300
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
301
+ ifTypeDiffers?: boolean;
302
+ }): (error: unknown) => {
303
+ cause?: unknown;
304
+ stack?: string;
305
+ name: "PluginDependencyError";
306
+ context: Record<string, unknown>;
307
+ readonly message: string;
308
+ readonly _tag: "PluginDependencyError";
309
+ };
310
+ extend<Name extends string = string>(name: Name, message?: string): any;
311
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
312
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
313
+ stackTraceLimit: number;
314
+ };
315
+ /**
316
+ * Tagged error for plugin-level dependency resolution failures.
317
+ *
318
+ * `context.id` is the plugin id the manager was acting on. `context.reason`
319
+ * discriminates the failure mode:
320
+ * - `'missing'` — declared dep is neither registered nor in the catalog.
321
+ * `context.missing` lists offending ids.
322
+ * - `'install-failed'` — dep was found in the catalog but `add()` failed.
323
+ * `cause` carries the original error.
324
+ * - `'cycle'` — closure walk detected a cycle. `context.path` is the cycle path.
325
+ * - `'core-dependent'` — cascade-disable would have to disable a core plugin.
326
+ * `context.coreDependent` is the blocking id.
327
+ */
328
+ export declare class PluginDependencyError extends PluginDependencyError_base {
329
+ }
330
+ /**
331
+ * Resolves a lazy plugin stub to its real plugin.
332
+ * Returns the plugin unchanged if it is not lazy. Failures surface as
333
+ * {@link LazyPluginError} with `context.reason` indicating the failure mode
334
+ * and (for loader failures) `cause` set to the original error.
335
+ */
336
+ export declare const resolveLazy: (plugin: Plugin) => Effect.Effect<Plugin, LazyPluginError>;
162
337
  export {};
163
338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zB,aAAa,EAAE,mBAAmB,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,mBAAmB,CAAC,GACzE,aAAa,CAAC,CAAC,CAAC,CAAC;AAcpB,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAwBhF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAwBrE;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAC;AAKhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,GAAG,IAAI,QAAQ,IAAI,UAAU,UAAU,CAAC,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAUjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,OAA4B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErE;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,oBAAoE;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5G;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,SAAQ,0BAG1C;CAAG;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,WAAW,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAwB9E,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { Atom, type Registry as AtomRegistry } from '@effect-atom/atom-react';
2
+ import * as Effect from 'effect/Effect';
3
+ /**
4
+ * A registry plugin entry as seen by the plugin manager layer.
5
+ * Populated from the registry catalog; represents the latest available version of a plugin.
6
+ *
7
+ * Independently defined from @dxos/protocols PluginEntry — similar shape but not the same type.
8
+ * Implementations of {@link PluginProvider} (e.g. {@link EdgeRegistryPluginProvider})
9
+ * are responsible for mapping their wire-format entries to this shape.
10
+ */
11
+ export type Plugin = {
12
+ id: string;
13
+ name: string;
14
+ description?: string;
15
+ homePage?: string;
16
+ source?: string;
17
+ screenshots?: string[];
18
+ tags?: string[];
19
+ icon?: string;
20
+ iconHue?: string;
21
+ /**
22
+ * IDs of plugins this entry declares as runtime dependencies. Mirrors
23
+ * {@link Plugin.Meta.dependsOn}. Surfaced in the catalog so the manager can
24
+ * resolve and auto-install transitive deps before they are first loaded.
25
+ */
26
+ dependsOn?: string[];
27
+ /** URL to dynamic-import the latest version of this plugin module. */
28
+ moduleUrl: string;
29
+ /** GitHub repository slug, e.g. `owner/name`. Used to fetch version history. */
30
+ repo: string;
31
+ /**
32
+ * Latest known version string, e.g. `v1.2.0`.
33
+ * Corresponds to releaseTag in the wire-format PluginEntry; named `version` here
34
+ * because the plugin manager layer speaks versions, not release tags.
35
+ */
36
+ version: string;
37
+ };
38
+ /**
39
+ * A single installable version of a registry plugin.
40
+ */
41
+ export type PluginVersion = {
42
+ /** Version string, e.g. `v1.2.0`. */
43
+ tag: string;
44
+ /** URL to dynamic-import this specific version of the plugin module. */
45
+ moduleUrl: string;
46
+ /** Unix ms of when this version was published (optional; omitted when unknown). */
47
+ releasedAt?: number;
48
+ };
49
+ /**
50
+ * Abstraction over the plugin registry catalog backend.
51
+ * Implementations may call Edge, a local cache, or a stub.
52
+ *
53
+ * The interface itself is transport-agnostic; concrete implementations live
54
+ * alongside it in this package (see {@link EdgeRegistryPluginProvider}) so we
55
+ * avoid `app-framework ↔ edge-client` cycles, but they only need to satisfy
56
+ * this shape — callers can substitute their own.
57
+ */
58
+ export interface PluginProvider {
59
+ /**
60
+ * Returns all healthy registry plugins (latest version of each).
61
+ */
62
+ listPlugins(): Effect.Effect<readonly Plugin[], Error>;
63
+ /**
64
+ * Returns all known versions of a plugin identified by its GitHub repo slug.
65
+ * Until the backend implements a versions endpoint, implementations MUST
66
+ * return at least one entry representing the current/latest release.
67
+ */
68
+ listVersions(repo: string): Effect.Effect<readonly PluginVersion[], Error>;
69
+ /**
70
+ * Returns a single plugin entry for the given repo.
71
+ * If `version` is omitted, returns the latest.
72
+ * Fails if the specified version is not found.
73
+ */
74
+ getPlugin(repo: string, version?: string): Effect.Effect<Plugin, Error>;
75
+ }
76
+ /**
77
+ * Atomic snapshot of the registry catalog as observed by the host.
78
+ * Exposed via {@link Manager.plugins} so consumers can subscribe reactively
79
+ * (loading state, list contents, last error).
80
+ */
81
+ export type PluginsState = {
82
+ entries: readonly Plugin[];
83
+ loading: boolean;
84
+ error: Error | null;
85
+ };
86
+ /**
87
+ * Owns the cached registry catalog state and forwards `listVersions` / `getPlugin`
88
+ * calls to the underlying {@link PluginProvider}. Lives on the `PluginManager`
89
+ * (as `manager.pluginRegistry`) so consumers can reach it through the manager
90
+ * without a separate capability lookup.
91
+ *
92
+ * On construction the manager kicks off a background fetch via `provider.listPlugins()`
93
+ * and writes the result into the {@link plugins} atom. Subscribers see `loading: true`
94
+ * during the fetch and `loading: false` once it settles.
95
+ */
96
+ export declare class Manager {
97
+ #private;
98
+ readonly plugins: Atom.Writable<PluginsState>;
99
+ constructor(provider: PluginProvider | undefined, atomRegistry: AtomRegistry.Registry);
100
+ /** Forwards to the underlying provider. */
101
+ listPlugins(): Effect.Effect<readonly Plugin[], Error>;
102
+ /** Forwards to the underlying provider. */
103
+ listVersions(repo: string): Effect.Effect<readonly PluginVersion[], Error>;
104
+ /** Forwards to the underlying provider. */
105
+ getPlugin(repo: string, version?: string): Effect.Effect<Plugin, Error>;
106
+ }
107
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/core/registry.ts"],"names":[],"mappings":"AAIA,OAAO,EA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AAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CACzE;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;AAgBF;;;;;;;;;GASG;AACH,qBAAa,OAAO;;IAClB,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAG9C,YAAY,QAAQ,EAAE,cAAc,GAAG,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,QAAQ,EAmBpF;IAED,2CAA2C;IAC3C,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,KAAK,CAAC,CAErD;IAED,2CAA2C;IAC3C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,aAAa,EAAE,EAAE,KAAK,CAAC,CAEzE;IAED,2CAA2C;IAC3C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAEtE;CACF"}
@@ -0,0 +1,127 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { BaseError } from '@dxos/errors';
3
+ import * as Plugin from './plugin';
4
+ import * as PluginAssetCache from './plugin-asset-cache';
5
+ declare const RemotePluginLoadError_base: {
6
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
7
+ cause?: unknown;
8
+ stack?: string;
9
+ name: "RemotePluginLoadError";
10
+ context: Record<string, unknown>;
11
+ readonly message: string;
12
+ readonly _tag: "RemotePluginLoadError";
13
+ };
14
+ isError(error: unknown): error is Error;
15
+ name: "RemotePluginLoadError";
16
+ is(error: unknown): error is BaseError;
17
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
18
+ ifTypeDiffers?: boolean;
19
+ }): (error: unknown) => {
20
+ cause?: unknown;
21
+ stack?: string;
22
+ name: "RemotePluginLoadError";
23
+ context: Record<string, unknown>;
24
+ readonly message: string;
25
+ readonly _tag: "RemotePluginLoadError";
26
+ };
27
+ extend<Name extends string = string>(name: Name, message?: string): any;
28
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
29
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
30
+ stackTraceLimit: number;
31
+ };
32
+ /**
33
+ * Tagged error for any failure during remote plugin loading. Construction sites
34
+ * set `context.locator` and `context.reason` (one of `'invalid-locator' |
35
+ * 'manifest-error' | 'cache-error' | 'import-failed' | 'meta-missing' |
36
+ * 'meta-mismatch' | 'duplicate-id'`) so handlers can route on the failure mode.
37
+ */
38
+ export declare class RemotePluginLoadError extends RemotePluginLoadError_base {
39
+ }
40
+ /**
41
+ * Abstraction over key-value storage (defaults to localStorage).
42
+ */
43
+ export type Storage = {
44
+ get(key: string): string | null;
45
+ set(key: string, value: string): void;
46
+ };
47
+ /**
48
+ * Options for configuring the URL loader.
49
+ */
50
+ export type Options = {
51
+ storage?: Storage;
52
+ key?: string;
53
+ /**
54
+ * Per-platform offline asset cache. Defaults to a no-op cache (no offline support).
55
+ */
56
+ cache?: PluginAssetCache.Cache;
57
+ };
58
+ /**
59
+ * Options for the preload entry point. Adds an optional progress hook so hosts
60
+ * can drive a boot-loader counter (`Loading plugins (3/12)…`) as remote plugin
61
+ * manifests resolve. Resolution order is *not* deterministic — each entry races
62
+ * its own network fetch — so callers should treat `loaded` as a count, not an
63
+ * index. Failures are still swallowed; `loaded` advances on both success and
64
+ * recoverable failure so the counter always reaches `total`.
65
+ */
66
+ export type PreloadOptions = Options & {
67
+ onPluginLoaded?: (loaded: number, total: number) => void;
68
+ };
69
+ /**
70
+ * Persisted record of a remote plugin that has been loaded previously.
71
+ *
72
+ * `url` is the URL of the plugin manifest (`plugin.json`), not the entry module.
73
+ */
74
+ export type RemotePluginEntry = {
75
+ id: string;
76
+ url: string;
77
+ /** Installed version string, e.g. `v1.0.0`. Populated after install from a community catalog entry. */
78
+ version?: string;
79
+ };
80
+ /**
81
+ * Returns true when the URL's hostname is the local host (localhost, 127.0.0.1, or ::1).
82
+ */
83
+ export declare const isLocalUrl: (locator: string) => boolean;
84
+ /**
85
+ * Returns the list of remote plugin entries previously persisted by {@link make}.
86
+ * Useful for UI code that needs to know which loaded plugins were installed from a URL
87
+ * (e.g. to surface a tag on remote or localhost-hosted plugins).
88
+ */
89
+ export declare const getRemoteEntries: (options?: Options) => readonly RemotePluginEntry[];
90
+ /**
91
+ * Updates the persisted installed version for an already-stored remote plugin entry.
92
+ * Does nothing if the plugin has not been persisted yet.
93
+ */
94
+ export declare const setInstalledVersion: (id: string, version: string, options?: Options) => void;
95
+ /**
96
+ * Returns the installed version string for the given plugin id, or `undefined` if
97
+ * the plugin was installed without version tracking (legacy install) or is not found.
98
+ */
99
+ export declare const getInstalledVersion: (id: string, options?: Options) => string | undefined;
100
+ /**
101
+ * Preloads previously persisted remote plugins from storage. Per-entry failures
102
+ * are logged and swallowed — the returned effect always succeeds with whichever
103
+ * plugins loaded cleanly, so a single bad entry can't block the host's startup.
104
+ */
105
+ export declare const preload: (options?: PreloadOptions) => Effect.Effect<Plugin.Plugin[], never>;
106
+ /**
107
+ * Creates a plugin loader that resolves built-in plugins by ID or loads remote plugins from URLs.
108
+ *
109
+ * Remote URLs must point at a plugin manifest (`plugin.json`). The loader fetches the manifest,
110
+ * eagerly persists every declared asset via the configured `PluginAssetCache`, then dynamic-imports
111
+ * the entry module.
112
+ */
113
+ export declare const make: (builtinPlugins: Plugin.Plugin[], options?: Options) => (locator: string) => Effect.Effect<{
114
+ plugin: Plugin.Plugin;
115
+ dev?: boolean;
116
+ }, RemotePluginLoadError>;
117
+ /**
118
+ * Removes a previously installed remote plugin: drops the persisted entry, evicts cached
119
+ * assets, and removes any stylesheet `<link>` tags that {@link loadFromManifest} appended.
120
+ *
121
+ * Cache eviction failures are logged and swallowed — the persisted entry has already been
122
+ * dropped so the user-visible state is consistent regardless of whether the platform
123
+ * cache cooperated.
124
+ */
125
+ export declare const uninstall: (pluginId: string, options?: Options) => Effect.Effect<void, never>;
126
+ export {};
127
+ //# sourceMappingURL=url-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-loader.d.ts","sourceRoot":"","sources":["../../../../src/core/url-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,gBAAgB,MAAM,sBAAsB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKzD;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,0BAAyE;CAAG;AAEvH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC;CAChC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG;IACrC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,uGAAuG;IACvG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAkDF;;GAEG;AACH,eAAO,MAAM,UAAU,YAAa,MAAM,KAAG,OAQ5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,aAAa,OAAO,KAAQ,SAAS,iBAAiB,EAIlF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,OAAQ,MAAM,WAAW,MAAM,YAAW,OAAO,KAAQ,IAcxF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,OAAQ,MAAM,YAAW,OAAO,KAAQ,MAAM,GAAG,SAIhF,CAAC;AA2GF;;;;GAIG;AACH,eAAO,MAAM,OAAO,aAAa,cAAc,KAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,CA2CvF,CAAC;AAEL;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,mBAAoB,MAAM,CAAC,MAAM,EAAE,YAAW,OAAO,eAKnD,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,qBAAqB,CA0BxG,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,aAAc,MAAM,YAAW,OAAO,KAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAczF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=url-loader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-loader.test.d.ts","sourceRoot":"","sources":["../../../../src/core/url-loader.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAIA,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,cAAc,EAAE,OAAO,CAAC,EAAE,KAAG,CAAC,EA+BvE,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AAIA,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,cAAc,SAAS,CAAC,EAAE,KAAG,CAAC,EA+BvE,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export * from './common';
2
2
  export * from './context';
3
3
  export * from './core';
4
- export * from './plugin-operation';
5
- export * from './plugin-runtime';
4
+ export * from './plugin-process-manager';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '../core';
2
+ export declare const ProcessManagerPlugin: Plugin.PluginFactory<void>;
3
+ //# sourceMappingURL=ProcessManagerPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcessManagerPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-process-manager/ProcessManagerPlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,oBAAoB,4BAYhC,CAAC"}