@dxos/app-framework 0.8.4-main.fffef41 → 0.9.0

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 (569) hide show
  1. package/.storybook/main.mts +2 -4
  2. package/.storybook/preview.mts +2 -2
  3. package/LICENSE +102 -5
  4. package/README.md +1 -1
  5. package/dist/lib/browser/capability-BOPAKKWG.mjs +35 -0
  6. package/dist/lib/browser/capability-BOPAKKWG.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-66IXTIVK.mjs +48 -0
  10. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-CO3XLNUX.mjs +95 -0
  12. package/dist/lib/browser/chunk-CO3XLNUX.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-DC3WRPBV.mjs +227 -0
  14. package/dist/lib/browser/chunk-DC3WRPBV.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  16. package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  18. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-HFLKXMT7.mjs +587 -0
  20. package/dist/lib/browser/chunk-HFLKXMT7.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-IW44C7UL.mjs +83 -0
  22. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  24. package/dist/lib/browser/chunk-KZUDO43J.mjs +422 -0
  25. package/dist/lib/browser/chunk-KZUDO43J.mjs.map +7 -0
  26. package/dist/lib/browser/chunk-Q2GLJTVV.mjs +12 -0
  27. package/dist/lib/browser/chunk-Q2GLJTVV.mjs.map +7 -0
  28. package/dist/lib/browser/chunk-SYXIYT6T.mjs +143 -0
  29. package/dist/lib/browser/chunk-SYXIYT6T.mjs.map +7 -0
  30. package/dist/lib/browser/chunk-XHS5KDNX.mjs +1471 -0
  31. package/dist/lib/browser/chunk-XHS5KDNX.mjs.map +7 -0
  32. package/dist/lib/browser/chunk-Y66ELD4U.mjs +476 -0
  33. package/dist/lib/browser/chunk-Y66ELD4U.mjs.map +7 -0
  34. package/dist/lib/browser/cli/index.mjs +74 -0
  35. package/dist/lib/browser/cli/index.mjs.map +7 -0
  36. package/dist/lib/browser/common/activation-events.mjs +20 -0
  37. package/dist/lib/browser/common/capabilities.mjs +56 -0
  38. package/dist/lib/browser/core/activation-event.mjs +20 -0
  39. package/dist/lib/browser/core/capability.mjs +32 -0
  40. package/dist/lib/browser/core/capability.mjs.map +7 -0
  41. package/dist/lib/browser/core/plugin-manager.mjs +19 -0
  42. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  43. package/dist/lib/browser/core/plugin.mjs +41 -0
  44. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  45. package/dist/lib/browser/core/url-loader.mjs +24 -0
  46. package/dist/lib/browser/core/url-loader.mjs.map +7 -0
  47. package/dist/lib/browser/index.mjs +86 -122
  48. package/dist/lib/browser/index.mjs.map +4 -4
  49. package/dist/lib/browser/meta.json +1 -1
  50. package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs +132 -0
  51. package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs.map +7 -0
  52. package/dist/lib/browser/testing/index.mjs +316 -47
  53. package/dist/lib/browser/testing/index.mjs.map +4 -4
  54. package/dist/lib/browser/testing/react.mjs +78 -0
  55. package/dist/lib/browser/testing/react.mjs.map +7 -0
  56. package/dist/lib/browser/ui/index.mjs +52 -0
  57. package/dist/lib/browser/ui/index.mjs.map +7 -0
  58. package/dist/lib/node-esm/capability-KZWRTX7R.mjs +36 -0
  59. package/dist/lib/node-esm/capability-KZWRTX7R.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
  61. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs +588 -0
  63. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-COHOWGGJ.mjs +144 -0
  65. package/dist/lib/node-esm/chunk-COHOWGGJ.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs +84 -0
  67. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-FPW45EZH.mjs +14 -0
  69. package/dist/lib/node-esm/chunk-FPW45EZH.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs +477 -0
  71. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  73. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
  75. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-NULBHQYS.mjs +96 -0
  77. package/dist/lib/node-esm/chunk-NULBHQYS.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-SX5NVETP.mjs +1472 -0
  79. package/dist/lib/node-esm/chunk-SX5NVETP.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  81. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs +423 -0
  83. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs.map +7 -0
  84. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs +228 -0
  85. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs.map +7 -0
  86. package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
  87. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  88. package/dist/lib/node-esm/cli/index.mjs +75 -0
  89. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  90. package/dist/lib/node-esm/common/activation-events.mjs +21 -0
  91. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  92. package/dist/lib/node-esm/common/capabilities.mjs +57 -0
  93. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  94. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  95. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  96. package/dist/lib/node-esm/core/capability.mjs +33 -0
  97. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  98. package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
  99. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  100. package/dist/lib/node-esm/core/plugin.mjs +42 -0
  101. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  102. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  103. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  104. package/dist/lib/node-esm/index.mjs +86 -122
  105. package/dist/lib/node-esm/index.mjs.map +4 -4
  106. package/dist/lib/node-esm/meta.json +1 -1
  107. package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs +133 -0
  108. package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs.map +7 -0
  109. package/dist/lib/node-esm/testing/index.mjs +316 -47
  110. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  111. package/dist/lib/node-esm/testing/react.mjs +79 -0
  112. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  113. package/dist/lib/node-esm/ui/index.mjs +53 -0
  114. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  115. package/dist/plugin/node-esm/index.mjs +977 -0
  116. package/dist/plugin/node-esm/index.mjs.map +7 -0
  117. package/dist/plugin/node-esm/meta.json +1 -0
  118. package/dist/types/src/cli/cli.d.ts +37 -0
  119. package/dist/types/src/cli/cli.d.ts.map +1 -0
  120. package/dist/types/src/cli/index.d.ts +2 -0
  121. package/dist/types/src/cli/index.d.ts.map +1 -0
  122. package/dist/types/src/common/activation-events.d.ts +24 -0
  123. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  124. package/dist/types/src/common/annotations.d.ts +1 -0
  125. package/dist/types/src/common/annotations.d.ts.map +1 -0
  126. package/dist/types/src/common/capabilities.d.ts +214 -193
  127. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  128. package/dist/types/src/common/index.d.ts +3 -8
  129. package/dist/types/src/common/index.d.ts.map +1 -1
  130. package/dist/types/src/common/translations.d.ts +7 -7
  131. package/dist/types/src/common/translations.d.ts.map +1 -1
  132. package/dist/types/src/context.d.ts +5 -0
  133. package/dist/types/src/context.d.ts.map +1 -0
  134. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
  135. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  136. package/dist/types/src/core/capability-manager.d.ts +52 -0
  137. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  138. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  139. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  140. package/dist/types/src/core/capability.d.ts +161 -0
  141. package/dist/types/src/core/capability.d.ts.map +1 -0
  142. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  143. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  144. package/dist/types/src/core/index.d.ts +11 -4
  145. package/dist/types/src/core/index.d.ts.map +1 -1
  146. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  147. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  148. package/dist/types/src/core/plugin-manager.d.ts +297 -0
  149. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  150. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  151. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  152. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  153. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  154. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  155. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  156. package/dist/types/src/core/plugin.d.ts +303 -43
  157. package/dist/types/src/core/plugin.d.ts.map +1 -1
  158. package/dist/types/src/core/registry.d.ts +107 -0
  159. package/dist/types/src/core/registry.d.ts.map +1 -0
  160. package/dist/types/src/core/url-loader.d.ts +127 -0
  161. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  162. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  163. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  164. package/dist/types/src/helpers.d.ts.map +1 -1
  165. package/dist/types/src/index.d.ts +2 -2
  166. package/dist/types/src/index.d.ts.map +1 -1
  167. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
  168. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
  169. package/dist/types/src/plugin-process-manager/history/capability.d.ts +7 -0
  170. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
  171. package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
  172. package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
  173. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts +32 -0
  174. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
  175. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts +2 -0
  176. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
  177. package/dist/types/src/plugin-process-manager/history/index.d.ts +6 -0
  178. package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
  179. package/dist/types/src/plugin-process-manager/history/types.d.ts +13 -0
  180. package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
  181. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts +101 -0
  182. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
  183. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts +23 -0
  184. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
  185. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts +2 -0
  186. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
  187. package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts +10 -0
  188. package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts.map +1 -0
  189. package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
  190. package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
  191. package/dist/types/src/plugin-process-manager/meta.d.ts +3 -0
  192. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
  193. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
  194. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
  195. package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
  196. package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
  197. package/dist/types/src/testing/harness.d.ts +79 -0
  198. package/dist/types/src/testing/harness.d.ts.map +1 -0
  199. package/dist/types/src/testing/index.d.ts +3 -0
  200. package/dist/types/src/testing/index.d.ts.map +1 -1
  201. package/dist/types/src/testing/operationCapture.d.ts +64 -0
  202. package/dist/types/src/testing/operationCapture.d.ts.map +1 -0
  203. package/dist/types/src/testing/react.d.ts +27 -0
  204. package/dist/types/src/testing/react.d.ts.map +1 -0
  205. package/dist/types/src/testing/react.test.d.ts +2 -0
  206. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  207. package/dist/types/src/testing/service.d.ts +8 -0
  208. package/dist/types/src/testing/service.d.ts.map +1 -0
  209. package/dist/types/src/testing/withPluginManager.d.ts +4 -4
  210. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  211. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  212. package/dist/types/src/ui/components/App/App.d.ts +41 -0
  213. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  214. package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
  215. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  216. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  217. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  218. package/dist/types/src/{react/Surface.stories.d.ts → ui/components/PluginManager/PluginManagerContext.stories.d.ts} +2 -3
  219. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  220. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
  221. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  222. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  223. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  224. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
  225. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  226. package/dist/types/src/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
  227. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  228. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
  229. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  230. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  231. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  232. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  233. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  234. package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
  235. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  236. package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
  237. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  238. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  239. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  240. package/dist/types/src/ui/components/index.d.ts +4 -0
  241. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  242. package/dist/types/src/ui/hooks/index.d.ts +7 -0
  243. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  244. package/dist/types/src/ui/hooks/useApp.d.ts +80 -0
  245. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  246. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  247. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  248. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  249. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  250. package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +1 -2
  251. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  252. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +30 -0
  253. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
  254. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  255. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  256. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  257. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  258. package/dist/types/src/ui/index.d.ts +3 -0
  259. package/dist/types/src/ui/index.d.ts.map +1 -0
  260. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  261. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  262. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +59 -0
  263. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  264. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  265. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  266. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  267. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  268. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  269. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  270. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  271. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  272. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  273. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  274. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  275. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  276. package/dist/types/tsconfig.tsbuildinfo +1 -1
  277. package/moon.yml +25 -6
  278. package/package.json +125 -59
  279. package/src/cli/cli.ts +102 -0
  280. package/src/{playground/debug → cli}/index.ts +1 -1
  281. package/src/common/activation-events.ts +39 -0
  282. package/src/{playground/logger/index.ts → common/annotations.ts} +0 -2
  283. package/src/common/capabilities.ts +287 -192
  284. package/src/common/index.ts +3 -8
  285. package/src/common/translations.ts +17 -9
  286. package/src/context.ts +9 -0
  287. package/src/core/{events.ts → activation-event.ts} +10 -7
  288. package/src/core/capability-manager.test.ts +154 -0
  289. package/src/core/capability-manager.ts +213 -0
  290. package/src/core/capability.ts +254 -0
  291. package/src/core/edge-registry-plugin-provider.ts +92 -0
  292. package/src/core/index.ts +11 -4
  293. package/src/core/plugin-asset-cache.ts +60 -0
  294. package/src/core/plugin-manager.test.ts +1929 -0
  295. package/src/core/plugin-manager.ts +1696 -0
  296. package/src/core/plugin-manifest.test.ts +75 -0
  297. package/src/core/plugin-manifest.ts +134 -0
  298. package/src/core/plugin.ts +449 -48
  299. package/src/core/registry.ts +163 -0
  300. package/src/core/url-loader.test.ts +222 -0
  301. package/src/core/url-loader.ts +388 -0
  302. package/src/index.ts +2 -2
  303. package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
  304. package/src/plugin-process-manager/history/capability.ts +36 -0
  305. package/src/plugin-process-manager/history/errors.ts +7 -0
  306. package/src/plugin-process-manager/history/history-tracker.test.ts +353 -0
  307. package/src/plugin-process-manager/history/history-tracker.ts +144 -0
  308. package/src/plugin-process-manager/history/index.ts +9 -0
  309. package/src/plugin-process-manager/history/types.ts +17 -0
  310. package/src/plugin-process-manager/history/undo-mapping.ts +135 -0
  311. package/src/plugin-process-manager/history/undo-registry.test.ts +74 -0
  312. package/src/plugin-process-manager/history/undo-registry.ts +54 -0
  313. package/src/plugin-process-manager/idb-key-value-store.ts +64 -0
  314. package/src/plugin-process-manager/index.ts +6 -0
  315. package/src/plugin-process-manager/meta.ts +16 -0
  316. package/src/plugin-process-manager/process-manager-capability.ts +178 -0
  317. package/src/plugin-process-manager/testing.ts +156 -0
  318. package/src/testing/harness.ts +247 -0
  319. package/src/testing/index.ts +3 -0
  320. package/src/testing/operationCapture.ts +144 -0
  321. package/src/testing/react.test.tsx +50 -0
  322. package/src/testing/react.tsx +113 -0
  323. package/src/testing/service.ts +52 -0
  324. package/src/testing/withPluginManager.stories.tsx +8 -9
  325. package/src/testing/withPluginManager.tsx +69 -42
  326. package/src/ui/components/App/App.stories.tsx +84 -0
  327. package/src/ui/components/App/App.tsx +144 -0
  328. package/src/{playground/layout → ui/components/App}/index.ts +1 -1
  329. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +179 -0
  330. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
  331. package/src/ui/components/PluginManager/index.ts +5 -0
  332. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
  333. package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
  334. package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
  335. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  336. package/src/ui/components/Surface/context.ts +12 -0
  337. package/src/ui/components/Surface/index.ts +54 -0
  338. package/src/ui/components/Surface/types.test.ts +126 -0
  339. package/src/ui/components/Surface/types.ts +290 -0
  340. package/src/ui/components/index.ts +7 -0
  341. package/src/ui/hooks/index.ts +10 -0
  342. package/src/ui/hooks/useApp.test.tsx +161 -0
  343. package/src/ui/hooks/useApp.tsx +404 -0
  344. package/src/ui/hooks/useCapabilities.ts +68 -0
  345. package/src/{react → ui/hooks}/useLoading.tsx +16 -10
  346. package/src/ui/hooks/useProcessManagerRuntime.ts +78 -0
  347. package/src/ui/hooks/useSettingsState.ts +26 -0
  348. package/src/ui/hooks/useSurface.ts +13 -0
  349. package/src/ui/index.ts +6 -0
  350. package/src/vite-plugin/boot-loader/BootLoader.solid-stories.tsx +198 -0
  351. package/src/vite-plugin/boot-loader/index.ts +5 -0
  352. package/src/vite-plugin/boot-loader/loader-app/Loader.tsx +166 -0
  353. package/src/vite-plugin/boot-loader/loader-app/boot-loader.css +311 -0
  354. package/src/vite-plugin/boot-loader/loader-app/bridge.ts +25 -0
  355. package/src/vite-plugin/boot-loader/loader-app/entry.tsx +21 -0
  356. package/src/vite-plugin/boot-loader/loader-app/mount.tsx +70 -0
  357. package/src/vite-plugin/boot-loader/loader-app/store.test.ts +137 -0
  358. package/src/vite-plugin/boot-loader/loader-app/store.ts +149 -0
  359. package/src/vite-plugin/boot-loader/loader-app/tsconfig.json +11 -0
  360. package/src/vite-plugin/boot-loader/loader-app/types.ts +78 -0
  361. package/src/vite-plugin/boot-loader/loader.ts +204 -0
  362. package/src/vite-plugin/composer/index.ts +306 -0
  363. package/src/vite-plugin/import-map/index.ts +527 -0
  364. package/src/vite-plugin/index.ts +10 -0
  365. package/src/vite-plugin/manifest.test.ts +55 -0
  366. package/src/vite-plugin/manifest.ts +63 -0
  367. package/src/vite-plugin/packages.ts +187 -0
  368. package/tsconfig.json +27 -22
  369. package/tsconfig.node.json +2 -4
  370. package/typedoc.json +2 -4
  371. package/vitest.config.ts +1 -1
  372. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  373. package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
  374. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs +0 -138
  375. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +0 -7
  376. package/dist/lib/browser/chunk-6XKO24JP.mjs +0 -483
  377. package/dist/lib/browser/chunk-6XKO24JP.mjs.map +0 -7
  378. package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
  379. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
  380. package/dist/lib/browser/chunk-WPW5VVAX.mjs +0 -1651
  381. package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +0 -7
  382. package/dist/lib/browser/intent-dispatcher-LZ4AE66E.mjs +0 -11
  383. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs +0 -39
  384. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +0 -7
  385. package/dist/lib/browser/react/index.mjs +0 -34
  386. package/dist/lib/browser/store-CNPHOYTJ.mjs +0 -30
  387. package/dist/lib/browser/store-CNPHOYTJ.mjs.map +0 -7
  388. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs +0 -139
  389. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +0 -7
  390. package/dist/lib/node-esm/chunk-3UPX5OIS.mjs +0 -484
  391. package/dist/lib/node-esm/chunk-3UPX5OIS.mjs.map +0 -7
  392. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs +0 -1653
  393. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +0 -7
  394. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
  395. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
  396. package/dist/lib/node-esm/intent-dispatcher-MGOJ3CHD.mjs +0 -12
  397. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs +0 -40
  398. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +0 -7
  399. package/dist/lib/node-esm/react/index.mjs +0 -35
  400. package/dist/lib/node-esm/store-RK5B4XEL.mjs +0 -31
  401. package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +0 -7
  402. package/dist/types/src/common/collaboration.d.ts +0 -20
  403. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  404. package/dist/types/src/common/events.d.ts +0 -52
  405. package/dist/types/src/common/events.d.ts.map +0 -1
  406. package/dist/types/src/common/file.d.ts +0 -14
  407. package/dist/types/src/common/file.d.ts.map +0 -1
  408. package/dist/types/src/common/graph.d.ts +0 -21
  409. package/dist/types/src/common/graph.d.ts.map +0 -1
  410. package/dist/types/src/common/layout.d.ts +0 -279
  411. package/dist/types/src/common/layout.d.ts.map +0 -1
  412. package/dist/types/src/common/surface.d.ts +0 -68
  413. package/dist/types/src/common/surface.d.ts.map +0 -1
  414. package/dist/types/src/core/capabilities.d.ts +0 -117
  415. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  416. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  417. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  418. package/dist/types/src/core/events.d.ts.map +0 -1
  419. package/dist/types/src/core/manager.d.ts +0 -126
  420. package/dist/types/src/core/manager.d.ts.map +0 -1
  421. package/dist/types/src/core/manager.test.d.ts +0 -2
  422. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  423. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  424. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  425. package/dist/types/src/playground/debug/index.d.ts +0 -2
  426. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  427. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  428. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  429. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  430. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  431. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  432. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  433. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  434. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  435. package/dist/types/src/playground/generator/index.d.ts +0 -3
  436. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  437. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  438. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  439. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  440. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  441. package/dist/types/src/playground/layout/index.d.ts +0 -2
  442. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  443. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  444. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  445. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  446. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  447. package/dist/types/src/playground/logger/index.d.ts +0 -2
  448. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  449. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  450. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  451. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  452. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  453. package/dist/types/src/playground/playground.stories.d.ts +0 -11
  454. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  455. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  456. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  457. package/dist/types/src/plugin-intent/actions.d.ts +0 -36
  458. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  459. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  460. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  461. package/dist/types/src/plugin-intent/index.d.ts +0 -6
  462. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  463. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  464. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  465. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  466. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  467. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  468. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  469. package/dist/types/src/plugin-intent/meta.d.ts +0 -3
  470. package/dist/types/src/plugin-intent/meta.d.ts.map +0 -1
  471. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  472. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  473. package/dist/types/src/plugin-settings/actions.d.ts +0 -25
  474. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  475. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  476. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  477. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  478. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  479. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  480. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  481. package/dist/types/src/plugin-settings/meta.d.ts +0 -3
  482. package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
  483. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  484. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  485. package/dist/types/src/plugin-settings/translations.d.ts +0 -11
  486. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  487. package/dist/types/src/react/App.d.ts +0 -10
  488. package/dist/types/src/react/App.d.ts.map +0 -1
  489. package/dist/types/src/react/App.stories.d.ts.map +0 -1
  490. package/dist/types/src/react/DefaultFallback.d.ts +0 -8
  491. package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
  492. package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
  493. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  494. package/dist/types/src/react/IntentContext.d.ts +0 -8
  495. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  496. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  497. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  498. package/dist/types/src/react/Surface.d.ts +0 -12
  499. package/dist/types/src/react/Surface.d.ts.map +0 -1
  500. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  501. package/dist/types/src/react/common.d.ts +0 -13
  502. package/dist/types/src/react/common.d.ts.map +0 -1
  503. package/dist/types/src/react/index.d.ts +0 -9
  504. package/dist/types/src/react/index.d.ts.map +0 -1
  505. package/dist/types/src/react/types.d.ts +0 -14
  506. package/dist/types/src/react/types.d.ts.map +0 -1
  507. package/dist/types/src/react/useApp.d.ts +0 -44
  508. package/dist/types/src/react/useApp.d.ts.map +0 -1
  509. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  510. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  511. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  512. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  513. package/dist/types/src/react/useLoading.d.ts.map +0 -1
  514. package/src/common/collaboration.ts +0 -18
  515. package/src/common/events.ts +0 -79
  516. package/src/common/file.ts +0 -22
  517. package/src/common/graph.ts +0 -30
  518. package/src/common/layout.ts +0 -277
  519. package/src/common/surface.ts +0 -88
  520. package/src/core/capabilities.test.ts +0 -136
  521. package/src/core/capabilities.ts +0 -263
  522. package/src/core/manager.test.ts +0 -516
  523. package/src/core/manager.ts +0 -604
  524. package/src/playground/debug/Debug.tsx +0 -39
  525. package/src/playground/debug/plugin.ts +0 -16
  526. package/src/playground/generator/Main.tsx +0 -70
  527. package/src/playground/generator/Toolbar.tsx +0 -47
  528. package/src/playground/generator/generator.ts +0 -48
  529. package/src/playground/generator/index.ts +0 -6
  530. package/src/playground/generator/plugin.ts +0 -22
  531. package/src/playground/layout/Layout.tsx +0 -33
  532. package/src/playground/layout/plugin.ts +0 -18
  533. package/src/playground/logger/Toolbar.tsx +0 -30
  534. package/src/playground/logger/plugin.ts +0 -41
  535. package/src/playground/logger/schema.ts +0 -12
  536. package/src/playground/playground.stories.tsx +0 -46
  537. package/src/plugin-intent/IntentPlugin.ts +0 -20
  538. package/src/plugin-intent/actions.ts +0 -31
  539. package/src/plugin-intent/errors.ts +0 -40
  540. package/src/plugin-intent/index.ts +0 -9
  541. package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
  542. package/src/plugin-intent/intent-dispatcher.ts +0 -342
  543. package/src/plugin-intent/intent.ts +0 -154
  544. package/src/plugin-intent/meta.ts +0 -10
  545. package/src/plugin-settings/SettingsPlugin.ts +0 -34
  546. package/src/plugin-settings/actions.ts +0 -25
  547. package/src/plugin-settings/app-graph-builder.ts +0 -160
  548. package/src/plugin-settings/index.ts +0 -6
  549. package/src/plugin-settings/intent-resolver.ts +0 -35
  550. package/src/plugin-settings/meta.ts +0 -10
  551. package/src/plugin-settings/store.ts +0 -33
  552. package/src/plugin-settings/translations.ts +0 -19
  553. package/src/react/App.stories.tsx +0 -33
  554. package/src/react/App.tsx +0 -59
  555. package/src/react/DefaultFallback.tsx +0 -26
  556. package/src/react/ErrorBoundary.tsx +0 -56
  557. package/src/react/IntentContext.tsx +0 -35
  558. package/src/react/Surface.stories.tsx +0 -125
  559. package/src/react/Surface.tsx +0 -109
  560. package/src/react/common.ts +0 -13
  561. package/src/react/index.ts +0 -14
  562. package/src/react/types.ts +0 -38
  563. package/src/react/useApp.tsx +0 -165
  564. package/src/react/useCapabilities.ts +0 -31
  565. package/src/react/useIntentResolver.ts +0 -22
  566. /package/dist/lib/browser/{intent-dispatcher-LZ4AE66E.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  567. /package/dist/lib/browser/{react/index.mjs.map → common/activation-events.mjs.map} +0 -0
  568. /package/dist/lib/{node-esm/intent-dispatcher-MGOJ3CHD.mjs.map → browser/common/capabilities.mjs.map} +0 -0
  569. /package/dist/lib/{node-esm/react/index.mjs.map → browser/core/activation-event.mjs.map} +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,7 +1,52 @@
1
- import { type MaybePromise } from '@dxos/util';
2
- import { type AnyCapability, type PluginContext } from './capabilities';
3
- import { type ActivationEvent, type ActivationEvents } from './events';
4
- interface PluginModuleInterface {
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Pipeable from 'effect/Pipeable';
4
+ import { BaseError } from '@dxos/errors';
5
+ import { DXN } from '@dxos/keys';
6
+ import type * as ActivationEvent from './activation-event';
7
+ import * as Capability from './capability';
8
+ import type * as PluginManager from './plugin-manager';
9
+ declare const Service_base: Context.TagClass<Service, "@dxos/app-framework/PluginManager", PluginManager.PluginManager>;
10
+ /**
11
+ * Effect Context.Tag for accessing PluginManager via the Effect layer system.
12
+ * This allows lifecycle operations to access the plugin manager without having it passed as an argument.
13
+ */
14
+ export declare class Service extends Service_base {
15
+ }
16
+ /**
17
+ * Activates plugins based on the activation event.
18
+ * Accesses the PluginManager via the Effect layer system.
19
+ * @param event The activation event.
20
+ * @returns Whether the activation was successful.
21
+ */
22
+ export declare const activate: (event: ActivationEvent.ActivationEvent) => Effect.Effect<boolean, Error, Service>;
23
+ /**
24
+ * Re-activates the modules that were activated by the event.
25
+ * Accesses the PluginManager via the Effect layer system.
26
+ * @param event The activation event.
27
+ * @returns Whether the reset was successful.
28
+ */
29
+ export declare const reset: (event: ActivationEvent.ActivationEvent) => Effect.Effect<boolean, Error, Service>;
30
+ /**
31
+ * Shuts down the plugin manager, deactivating all active modules and clearing lifecycle state.
32
+ * Accesses the PluginManager via the Effect layer system.
33
+ */
34
+ export declare const shutdown: () => Effect.Effect<boolean, Error, Service>;
35
+ /**
36
+ * Identifier denoting a PluginModule.
37
+ */
38
+ export declare const PluginModuleTypeId: unique symbol;
39
+ export type PluginModuleTypeId = typeof PluginModuleTypeId;
40
+ /**
41
+ * Type guard to check if a value is a PluginModule.
42
+ */
43
+ export declare const isPluginModule: (value: unknown) => value is PluginModule;
44
+ /**
45
+ * A unit of containment of modular functionality that can be provided to an application.
46
+ * Activation of a module is async allowing for code to split and loaded lazily.
47
+ */
48
+ export interface PluginModule {
49
+ readonly [PluginModuleTypeId]: PluginModuleTypeId;
5
50
  /**
6
51
  * Unique id of the module.
7
52
  */
@@ -9,57 +54,80 @@ interface PluginModuleInterface {
9
54
  /**
10
55
  * Events for which the module will be activated.
11
56
  */
12
- activatesOn: ActivationEvents;
57
+ activatesOn: ActivationEvent.Events;
13
58
  /**
14
- * Events which the plugin depends on being activated.
15
- * Plugin is marked as needing reset a plugin activated by a dependent event is removed.
16
- * Events are automatically activated before activation of the plugin.
59
+ * Events that this module fires *before* its own activation runs.
60
+ *
61
+ * When this module is asked to activate (via {@link activatesOn}), the
62
+ * plugin manager first activates every event listed here, ensuring any
63
+ * other modules that contribute to those events have completed before
64
+ * this module's {@link activate} body executes. These events are fired
65
+ * by the framework on this module's behalf — the module does not need
66
+ * to wait for some other code to fire them.
67
+ *
68
+ * The module is marked as needing reset if a module activated by one
69
+ * of these events is later removed.
70
+ *
71
+ * Read as: "this module fires these events before [its] activation".
17
72
  */
18
- activatesBefore?: ActivationEvent[];
73
+ firesBeforeActivation?: ActivationEvent.ActivationEvent[];
19
74
  /**
20
- * Events which this plugin triggers upon activation.
75
+ * Events that this module fires *after* its own activation completes.
76
+ *
77
+ * Once this module's {@link activate} body has finished executing, the
78
+ * plugin manager activates every event listed here, causing any modules
79
+ * listening on those events to run. These events are fired by the
80
+ * framework on this module's behalf as part of this module's lifecycle.
81
+ *
82
+ * Read as: "this module fires these events after [its] activation".
21
83
  */
22
- activatesAfter?: ActivationEvent[];
84
+ firesAfterActivation?: ActivationEvent.ActivationEvent[];
23
85
  /**
24
86
  * Called when the module is activated.
25
- * @param context The plugin context.
87
+ * CapabilityManager is accessed via the Effect layer system (Capability.Service).
88
+ * PluginManager is accessed via Plugin.Service.
89
+ * @param props Optional props passed to the module.
26
90
  * @returns The capabilities of the module.
27
91
  */
28
- activate: (context: PluginContext) => MaybePromise<AnyCapability | AnyCapability[]> | Promise<() => Promise<AnyCapability | AnyCapability[]>>;
29
- }
30
- /**
31
- * A unit of containment of modular functionality that can be provided to an application.
32
- * Activation of a module is async allowing for code to split and loaded lazily.
33
- */
34
- export declare class PluginModule implements PluginModuleInterface {
35
- readonly id: PluginModuleInterface['id'];
36
- readonly activatesOn: PluginModuleInterface['activatesOn'];
37
- readonly activatesBefore?: PluginModuleInterface['activatesBefore'];
38
- readonly activatesAfter?: PluginModuleInterface['activatesAfter'];
39
- readonly activate: PluginModuleInterface['activate'];
40
- constructor(options: PluginModuleInterface);
92
+ activate: (props?: any) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service | Service | never>;
41
93
  }
42
- /**
43
- * Helper to define a module.
44
- */
45
- export declare const defineModule: (options: PluginModuleInterface) => PluginModule;
46
- export type PluginMeta = {
94
+ export type PluginModuleOptions = Omit<PluginModule, 'id' | typeof PluginModuleTypeId> & {
95
+ id?: string;
96
+ };
97
+ export type Meta = {
47
98
  /**
48
- * Globally unique ID.
49
- *
50
- * Expected to be in the form of a valid URL.
51
- *
52
- * @example dxos.org/plugin/example
99
+ * Bare NSID (the name portion of {@link key}, e.g. `org.dxos.plugin.example`).
100
+ * Stable across versions; used for module-id namespacing, i18n namespaces,
101
+ * enable/disable, and registry lookups. Derived from `key` by {@link makeMeta} —
102
+ * do not set directly.
53
103
  */
54
104
  id: string;
105
+ /**
106
+ * Canonical identity DXN, including version when published
107
+ * (e.g. `dxn:org.dxos.plugin.example:0.8.3`). The validated source of truth
108
+ * from which {@link id} and {@link version} are derived.
109
+ *
110
+ * @example DXN.make('org.dxos.plugin.example', '0.8.3')
111
+ */
112
+ key: DXN.DXN;
55
113
  /**
56
114
  * Human-readable name.
57
115
  */
58
116
  name: string;
117
+ /**
118
+ * Semver version string of the plugin, typically the publishing package's
119
+ * `package.json` version. Derived from the version segment of {@link key} by
120
+ * {@link makeMeta} — do not set directly.
121
+ */
122
+ version?: string;
59
123
  /**
60
124
  * Short description of plugin functionality.
61
125
  */
62
126
  description?: string;
127
+ /**
128
+ * Name of the author or organization that created the plugin.
129
+ */
130
+ author?: string;
63
131
  /**
64
132
  * URL of home page.
65
133
  */
@@ -68,6 +136,13 @@ export type PluginMeta = {
68
136
  * URL of source code.
69
137
  */
70
138
  source?: string;
139
+ /**
140
+ * Relative path (inside the published package) to the plugin's bundled MDL
141
+ * specification file — e.g. `'PLUGIN.mdl'` or `'docs/PLUGIN.mdl'`. The file
142
+ * is shipped via the package's `files` entry and resolved by registry
143
+ * surfaces to render an in-app viewer and/or external link.
144
+ */
145
+ spec?: string;
71
146
  /**
72
147
  * URL of screenshot.
73
148
  */
@@ -84,22 +159,207 @@ export type PluginMeta = {
84
159
  * Icon hue (ChromaticPalette).
85
160
  */
86
161
  iconHue?: string;
162
+ /**
163
+ * IDs of plugins this plugin functionally depends on.
164
+ *
165
+ * Treated as a convenience by the default `PluginManager` flow:
166
+ * - Enabling this plugin auto-enables the transitive closure of `dependsOn`
167
+ * (installing missing entries from the plugin registry when possible).
168
+ * - Disabling a depended-upon plugin surfaces dependents to the caller; the
169
+ * `PluginManager.disable` API supports an opt-in cascade.
170
+ *
171
+ * Not an invariant: low-level `PluginManager` APIs accept opt-outs
172
+ * (`resolveDependencies: false`, `ignoreDependents: true`) so a caller may
173
+ * substitute an alternative implementation that satisfies the dependent's
174
+ * capability needs in its own way.
175
+ */
176
+ dependsOn?: string[];
87
177
  };
178
+ /**
179
+ * Options for {@link makeMeta}: a {@link Meta} minus the fields derived from `key`.
180
+ * Identity and version are specified solely through the `key` DXN — `id` and
181
+ * `version` cannot be passed directly.
182
+ */
183
+ export type MakeMetaOptions = Omit<Meta, 'id' | 'version'>;
184
+ /**
185
+ * Constructs a plugin {@link Meta} from a single canonical DXN. The `key` DXN is
186
+ * the one source of truth; `id` (bare NSID) and `version` (semver) are derived
187
+ * from it so each datum has exactly one home and cannot drift out of sync.
188
+ *
189
+ * @example
190
+ * export const meta = Plugin.makeMeta({
191
+ * key: DXN.make('org.dxos.plugin.example', '0.8.3'),
192
+ * name: 'Example',
193
+ * });
194
+ */
195
+ export declare const makeMeta: (options: MakeMetaOptions) => Meta;
196
+ /**
197
+ * Identifier denoting a Plugin.
198
+ */
199
+ export declare const PluginTypeId: unique symbol;
200
+ export type PluginTypeId = typeof PluginTypeId;
201
+ /**
202
+ * Type guard to check if a value is a Plugin.
203
+ */
204
+ export declare const isPlugin: (value: unknown) => value is Plugin;
88
205
  /**
89
206
  * A collection of modules that are be enabled/disabled as a unit.
90
207
  * Plugins provide things such as components, state, actions, etc. to the application.
91
208
  */
92
- export declare class Plugin {
93
- readonly meta: PluginMeta;
94
- readonly modules: PluginModule[];
95
- constructor(meta: PluginMeta, modules: PluginModule[]);
209
+ export interface Plugin {
210
+ readonly [PluginTypeId]: PluginTypeId;
211
+ readonly meta: Readonly<Meta>;
212
+ readonly modules: ReadonlyArray<PluginModule>;
213
+ }
214
+ /**
215
+ * Builder interface for creating plugins incrementally.
216
+ */
217
+ export interface PluginBuilder<T = void> extends Pipeable.Pipeable {
218
+ readonly meta: Meta;
219
+ readonly modules: ReadonlyArray<PluginModuleOptions | ((options: T) => PluginModuleOptions)>;
220
+ addModule(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;
221
+ }
222
+ /**
223
+ * Creates a new PluginBuilder to start building a plugin.
224
+ */
225
+ export declare const define: <T = void>(meta: Meta) => PluginBuilder<T>;
226
+ /**
227
+ * Adds a module to a plugin builder.
228
+ * Supports both pipeline and direct call styles.
229
+ * Modules can be either PluginModuleOptions or functions that receive options.
230
+ */
231
+ export declare function addModule<T>(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): (builder: PluginBuilder<T>) => PluginBuilder<T>;
232
+ export declare function addModule<T>(builder: PluginBuilder<T>, moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;
233
+ export type PluginFactory<T = void> = ((options: T) => Plugin) & {
234
+ meta: Meta;
235
+ };
236
+ /**
237
+ * Creates a Plugin from a builder.
238
+ * Supports both pipeline and direct call styles.
239
+ * Always returns a factory function (options: T) => Plugin.
240
+ * When T is void, the function takes no arguments: () => Plugin.
241
+ */
242
+ export declare function make<T>(builder: PluginBuilder<T>): PluginFactory<T>;
243
+ /**
244
+ * Async loader for a lazy plugin's real implementation.
245
+ * The default export of the loaded module must be a `PluginFactory<T>` —
246
+ * i.e. the same shape `Plugin.make` produces.
247
+ */
248
+ export type LazyLoader<T = void> = () => Promise<{
249
+ default: PluginFactory<T>;
250
+ }>;
251
+ /**
252
+ * Defines a lazy plugin whose body is loaded on first enable.
253
+ *
254
+ * The returned factory produces a stub `Plugin` that exposes `meta`
255
+ * synchronously (so callers can read `Plugin.meta.id` for free) but defers
256
+ * loading the real plugin's modules until the manager calls
257
+ * `Plugin.resolveLazy`. This lets the plugin's main entry point ship as a
258
+ * tiny meta-only chunk — the heavy capabilities, schema, React surfaces,
259
+ * etc. live behind the dynamic `import()` and become a separate Rollup
260
+ * chunk that is only fetched when the plugin is enabled.
261
+ *
262
+ * @example
263
+ * ```ts
264
+ * // plugin-markdown/src/index.ts
265
+ * import { Plugin } from '@dxos/app-framework';
266
+ * import { meta } from './meta';
267
+ *
268
+ * export const MarkdownPlugin = Plugin.lazy(meta, () => import('./MarkdownPlugin'));
269
+ *
270
+ * // plugin-markdown/src/MarkdownPlugin.tsx
271
+ * export const MarkdownPlugin = Plugin.define(meta).pipe(...heavy modules..., Plugin.make);
272
+ * export default MarkdownPlugin;
273
+ * ```
274
+ */
275
+ export declare const lazy: <T = void>(meta: Meta, loader: LazyLoader<T>) => PluginFactory<T>;
276
+ /**
277
+ * Type guard for lazy plugin stubs produced by {@link lazy}.
278
+ */
279
+ export declare const isLazy: (plugin: Plugin) => boolean;
280
+ declare const LazyPluginError_base: {
281
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
282
+ cause?: unknown;
283
+ stack?: string;
284
+ name: "LazyPluginError";
285
+ context: Record<string, unknown>;
286
+ readonly message: string;
287
+ readonly _tag: "LazyPluginError";
288
+ };
289
+ isError(error: unknown): error is Error;
290
+ name: "LazyPluginError";
291
+ is(error: unknown): error is BaseError;
292
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
293
+ ifTypeDiffers?: boolean;
294
+ }): (error: unknown) => {
295
+ cause?: unknown;
296
+ stack?: string;
297
+ name: "LazyPluginError";
298
+ context: Record<string, unknown>;
299
+ readonly message: string;
300
+ readonly _tag: "LazyPluginError";
301
+ };
302
+ extend<Name extends string = string>(name: Name, message?: string): any;
303
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
304
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
305
+ stackTraceLimit: number;
306
+ };
307
+ /**
308
+ * Tagged error for failures during lazy plugin resolution. `context.id` is
309
+ * the lazy plugin's `meta.id`; `context.reason` discriminates the failure
310
+ * mode (`'load-failed' | 'missing-default' | 'invalid-plugin' |
311
+ * 'meta-mismatch'`) so callers can route on it.
312
+ */
313
+ export declare class LazyPluginError extends LazyPluginError_base {
96
314
  }
97
- export type PluginFactory<T = void> = ((args: T) => Plugin) & {
98
- meta: PluginMeta;
315
+ declare const PluginDependencyError_base: {
316
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
317
+ cause?: unknown;
318
+ stack?: string;
319
+ name: "PluginDependencyError";
320
+ context: Record<string, unknown>;
321
+ readonly message: string;
322
+ readonly _tag: "PluginDependencyError";
323
+ };
324
+ isError(error: unknown): error is Error;
325
+ name: "PluginDependencyError";
326
+ is(error: unknown): error is BaseError;
327
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
328
+ ifTypeDiffers?: boolean;
329
+ }): (error: unknown) => {
330
+ cause?: unknown;
331
+ stack?: string;
332
+ name: "PluginDependencyError";
333
+ context: Record<string, unknown>;
334
+ readonly message: string;
335
+ readonly _tag: "PluginDependencyError";
336
+ };
337
+ extend<Name extends string = string>(name: Name, message?: string): any;
338
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
339
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
340
+ stackTraceLimit: number;
99
341
  };
100
342
  /**
101
- * Helper to define a plugin.
343
+ * Tagged error for plugin-level dependency resolution failures.
344
+ *
345
+ * `context.id` is the plugin id the manager was acting on. `context.reason`
346
+ * discriminates the failure mode:
347
+ * - `'missing'` — declared dep is neither registered nor in the catalog.
348
+ * `context.missing` lists offending ids.
349
+ * - `'install-failed'` — dep was found in the catalog but `add()` failed.
350
+ * `cause` carries the original error.
351
+ * - `'cycle'` — closure walk detected a cycle. `context.path` is the cycle path.
352
+ * - `'core-dependent'` — cascade-disable would have to disable a core plugin.
353
+ * `context.coreDependent` is the blocking id.
354
+ */
355
+ export declare class PluginDependencyError extends PluginDependencyError_base {
356
+ }
357
+ /**
358
+ * Resolves a lazy plugin stub to its real plugin.
359
+ * Returns the plugin unchanged if it is not lazy. Failures surface as
360
+ * {@link LazyPluginError} with `context.reason` indicating the failure mode
361
+ * and (for loader failures) `cause` set to the original error.
102
362
  */
103
- export declare const definePlugin: <T = void>(meta: PluginMeta, provider: (args: T) => PluginModule[]) => PluginFactory<T>;
363
+ export declare const resolveLazy: (plugin: Plugin) => Effect.Effect<Plugin, LazyPluginError>;
104
364
  export {};
105
365
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/core/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE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CAAC;AAyBhF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAyBrE;;;;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,EAAE,IAAI,EAAE,KAAK,QAAQ,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QA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