@dxos/app-framework 0.8.4-main.b97322e → 0.8.4-main.bc2380dfbc

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 (571) hide show
  1. package/.storybook/main.mts +9 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/LICENSE +102 -5
  4. package/README.md +1 -1
  5. package/dist/lib/browser/capability-HRFPP52W.mjs +35 -0
  6. package/dist/lib/browser/capability-HRFPP52W.mjs.map +7 -0
  7. package/dist/lib/browser/capability-VQ236TY5.mjs +38 -0
  8. package/dist/lib/browser/capability-VQ236TY5.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-23D4SJUE.mjs +42 -0
  10. package/dist/lib/browser/chunk-23D4SJUE.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-3JWJXGLK.mjs +79 -0
  12. package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-45CHLTBV.mjs +34 -0
  14. package/dist/lib/browser/chunk-45CHLTBV.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-66IXTIVK.mjs +48 -0
  16. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-6GZYCP73.mjs +422 -0
  18. package/dist/lib/browser/chunk-6GZYCP73.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-7VZJR2OA.mjs +581 -0
  20. package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  22. package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  24. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-G6Q2M2M5.mjs +218 -0
  26. package/dist/lib/browser/chunk-G6Q2M2M5.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-J43JDWAV.mjs +1445 -0
  28. package/dist/lib/browser/chunk-J43JDWAV.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  30. package/dist/lib/browser/chunk-WBHCSOBW.mjs +80 -0
  31. package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
  32. package/dist/lib/browser/chunk-XLYULXAO.mjs +469 -0
  33. package/dist/lib/browser/chunk-XLYULXAO.mjs.map +7 -0
  34. package/dist/lib/browser/chunk-ZGJAZSNE.mjs +142 -0
  35. package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
  36. package/dist/lib/browser/cli/index.mjs +76 -0
  37. package/dist/lib/browser/cli/index.mjs.map +7 -0
  38. package/dist/lib/browser/common/activation-events.mjs +24 -0
  39. package/dist/lib/browser/common/capabilities.mjs +46 -0
  40. package/dist/lib/browser/core/activation-event.mjs +20 -0
  41. package/dist/lib/browser/core/capability.mjs +30 -0
  42. package/dist/lib/browser/core/capability.mjs.map +7 -0
  43. package/dist/lib/browser/core/plugin-manager.mjs +19 -0
  44. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  45. package/dist/lib/browser/core/plugin.mjs +39 -0
  46. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  47. package/dist/lib/browser/core/url-loader.mjs +24 -0
  48. package/dist/lib/browser/core/url-loader.mjs.map +7 -0
  49. package/dist/lib/browser/index.mjs +108 -156
  50. package/dist/lib/browser/index.mjs.map +4 -4
  51. package/dist/lib/browser/invoker-capability-CEL2L6GX.mjs +44 -0
  52. package/dist/lib/browser/invoker-capability-CEL2L6GX.mjs.map +7 -0
  53. package/dist/lib/browser/meta.json +1 -1
  54. package/dist/lib/browser/testing/index.mjs +236 -51
  55. package/dist/lib/browser/testing/index.mjs.map +4 -4
  56. package/dist/lib/browser/testing/react.mjs +78 -0
  57. package/dist/lib/browser/testing/react.mjs.map +7 -0
  58. package/dist/lib/browser/ui/index.mjs +48 -0
  59. package/dist/lib/browser/ui/index.mjs.map +7 -0
  60. package/dist/lib/node-esm/capability-GS3XJH74.mjs +39 -0
  61. package/dist/lib/node-esm/capability-GS3XJH74.mjs.map +7 -0
  62. package/dist/lib/node-esm/capability-I5P7ACFL.mjs +36 -0
  63. package/dist/lib/node-esm/capability-I5P7ACFL.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
  65. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-4RJL37GN.mjs +423 -0
  67. package/dist/lib/node-esm/chunk-4RJL37GN.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-6XW6LET6.mjs +35 -0
  69. package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-D347W3KO.mjs +143 -0
  71. package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-DW45NFLW.mjs +1446 -0
  73. package/dist/lib/node-esm/chunk-DW45NFLW.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-EI4LYXFY.mjs +470 -0
  75. package/dist/lib/node-esm/chunk-EI4LYXFY.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  77. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-KIFOQXD4.mjs +219 -0
  79. package/dist/lib/node-esm/chunk-KIFOQXD4.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-SBS2YMPT.mjs +43 -0
  81. package/dist/lib/node-esm/chunk-SBS2YMPT.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs +80 -0
  83. package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +7 -0
  84. package/dist/lib/node-esm/chunk-V24UWT36.mjs +582 -0
  85. package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
  86. package/dist/lib/node-esm/chunk-WFSRZKBP.mjs +81 -0
  87. package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
  88. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  89. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  90. package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
  91. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  92. package/dist/lib/node-esm/cli/index.mjs +77 -0
  93. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  94. package/dist/lib/node-esm/common/activation-events.mjs +25 -0
  95. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  96. package/dist/lib/node-esm/common/capabilities.mjs +47 -0
  97. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  98. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  99. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  100. package/dist/lib/node-esm/core/capability.mjs +31 -0
  101. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  102. package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
  103. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  104. package/dist/lib/node-esm/core/plugin.mjs +40 -0
  105. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  106. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  107. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  108. package/dist/lib/node-esm/index.mjs +108 -156
  109. package/dist/lib/node-esm/index.mjs.map +4 -4
  110. package/dist/lib/node-esm/invoker-capability-QKUKN2MF.mjs +45 -0
  111. package/dist/lib/node-esm/invoker-capability-QKUKN2MF.mjs.map +7 -0
  112. package/dist/lib/node-esm/meta.json +1 -1
  113. package/dist/lib/node-esm/testing/index.mjs +236 -51
  114. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  115. package/dist/lib/node-esm/testing/react.mjs +79 -0
  116. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  117. package/dist/lib/node-esm/ui/index.mjs +49 -0
  118. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  119. package/dist/plugin/node-esm/index.mjs +893 -0
  120. package/dist/plugin/node-esm/index.mjs.map +7 -0
  121. package/dist/plugin/node-esm/meta.json +1 -0
  122. package/dist/types/src/cli/cli.d.ts +39 -0
  123. package/dist/types/src/cli/cli.d.ts.map +1 -0
  124. package/dist/types/src/cli/index.d.ts +2 -0
  125. package/dist/types/src/cli/index.d.ts.map +1 -0
  126. package/dist/types/src/common/activation-events.d.ts +27 -0
  127. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  128. package/dist/types/src/common/annotations.d.ts +1 -0
  129. package/dist/types/src/common/annotations.d.ts.map +1 -0
  130. package/dist/types/src/common/capabilities.d.ts +110 -123
  131. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  132. package/dist/types/src/common/index.d.ts +4 -8
  133. package/dist/types/src/common/index.d.ts.map +1 -1
  134. package/dist/types/src/common/operations.d.ts +19 -0
  135. package/dist/types/src/common/operations.d.ts.map +1 -0
  136. package/dist/types/src/common/translations.d.ts +8 -8
  137. package/dist/types/src/common/translations.d.ts.map +1 -1
  138. package/dist/types/src/context.d.ts +5 -0
  139. package/dist/types/src/context.d.ts.map +1 -0
  140. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
  141. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  142. package/dist/types/src/core/capability-manager.d.ts +48 -0
  143. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  144. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  145. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  146. package/dist/types/src/core/capability.d.ts +156 -0
  147. package/dist/types/src/core/capability.d.ts.map +1 -0
  148. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  149. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  150. package/dist/types/src/core/index.d.ts +11 -4
  151. package/dist/types/src/core/index.d.ts.map +1 -1
  152. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  153. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  154. package/dist/types/src/core/plugin-manager.d.ts +298 -0
  155. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  156. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  157. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  158. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  159. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  160. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  161. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  162. package/dist/types/src/core/plugin.d.ts +265 -37
  163. package/dist/types/src/core/plugin.d.ts.map +1 -1
  164. package/dist/types/src/core/registry.d.ts +107 -0
  165. package/dist/types/src/core/registry.d.ts.map +1 -0
  166. package/dist/types/src/core/url-loader.d.ts +127 -0
  167. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  168. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  169. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  170. package/dist/types/src/helpers.d.ts.map +1 -1
  171. package/dist/types/src/index.d.ts +3 -4
  172. package/dist/types/src/index.d.ts.map +1 -1
  173. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
  174. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
  175. package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
  176. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
  177. package/dist/types/src/plugin-operation/history/errors.d.ts +32 -0
  178. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
  179. package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
  180. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
  181. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
  182. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
  183. package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
  184. package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
  185. package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
  186. package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
  187. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
  188. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
  189. package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
  190. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
  191. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
  192. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
  193. package/dist/types/src/plugin-operation/index.d.ts +3 -0
  194. package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
  195. package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
  196. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
  197. package/dist/types/src/plugin-operation/meta.d.ts +3 -0
  198. package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
  199. package/dist/types/src/plugin-operation/testing.d.ts +59 -0
  200. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
  201. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
  202. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
  203. package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
  204. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
  205. package/dist/types/src/plugin-runtime/index.d.ts +2 -0
  206. package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
  207. package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
  208. package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
  209. package/dist/types/src/testing/harness.d.ts +67 -0
  210. package/dist/types/src/testing/harness.d.ts.map +1 -0
  211. package/dist/types/src/testing/index.d.ts +2 -0
  212. package/dist/types/src/testing/index.d.ts.map +1 -1
  213. package/dist/types/src/testing/react.d.ts +27 -0
  214. package/dist/types/src/testing/react.d.ts.map +1 -0
  215. package/dist/types/src/testing/react.test.d.ts +2 -0
  216. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  217. package/dist/types/src/testing/service.d.ts +8 -0
  218. package/dist/types/src/testing/service.d.ts.map +1 -0
  219. package/dist/types/src/testing/withPluginManager.d.ts +11 -10
  220. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  221. package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
  222. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  223. package/dist/types/src/ui/components/App/App.d.ts +9 -0
  224. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  225. package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
  226. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  227. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  228. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  229. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
  230. package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
  231. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
  232. package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
  233. package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
  234. package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
  235. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts +13 -0
  236. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  237. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
  238. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  239. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  240. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  241. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
  242. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  243. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts +14 -0
  244. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  245. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
  246. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  247. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  248. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  249. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  250. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  251. package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
  252. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  253. package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
  254. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  255. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  256. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  257. package/dist/types/src/ui/components/index.d.ts +5 -0
  258. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  259. package/dist/types/src/ui/hooks/index.d.ts +6 -0
  260. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  261. package/dist/types/src/ui/hooks/useApp.d.ts +89 -0
  262. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  263. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  264. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  265. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  266. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  267. package/dist/types/src/ui/hooks/useLoading.d.ts +18 -0
  268. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  269. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  270. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  271. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  272. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  273. package/dist/types/src/ui/index.d.ts +3 -0
  274. package/dist/types/src/ui/index.d.ts.map +1 -0
  275. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
  276. package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
  277. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  278. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  279. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
  280. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  281. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  282. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  283. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  284. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  285. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  286. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  287. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  288. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  289. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  290. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  291. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  292. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  293. package/dist/types/tsconfig.tsbuildinfo +1 -1
  294. package/moon.yml +26 -3
  295. package/package.json +117 -53
  296. package/src/cli/cli.ts +107 -0
  297. package/src/{playground/layout → cli}/index.ts +1 -1
  298. package/src/common/activation-events.ts +44 -0
  299. package/src/{playground/debug/index.ts → common/annotations.ts} +0 -2
  300. package/src/common/capabilities.ts +169 -114
  301. package/src/common/index.ts +4 -8
  302. package/src/common/operations.ts +35 -0
  303. package/src/common/translations.ts +18 -10
  304. package/src/context.ts +9 -0
  305. package/src/core/{events.ts → activation-event.ts} +10 -7
  306. package/src/core/capability-manager.test.ts +151 -0
  307. package/src/core/capability-manager.ts +192 -0
  308. package/src/core/capability.ts +247 -0
  309. package/src/core/edge-registry-plugin-provider.ts +92 -0
  310. package/src/core/index.ts +11 -4
  311. package/src/core/plugin-asset-cache.ts +60 -0
  312. package/src/core/plugin-manager.test.ts +1899 -0
  313. package/src/core/plugin-manager.ts +1685 -0
  314. package/src/core/plugin-manifest.test.ts +75 -0
  315. package/src/core/plugin-manifest.ts +134 -0
  316. package/src/core/plugin.ts +404 -43
  317. package/src/core/registry.ts +163 -0
  318. package/src/core/url-loader.test.ts +221 -0
  319. package/src/core/url-loader.ts +388 -0
  320. package/src/helpers.test.ts +1 -1
  321. package/src/index.ts +3 -4
  322. package/src/plugin-operation/OperationPlugin.ts +24 -0
  323. package/src/plugin-operation/history/capability.ts +36 -0
  324. package/src/plugin-operation/history/errors.ts +7 -0
  325. package/src/plugin-operation/history/history-tracker.test.ts +374 -0
  326. package/src/plugin-operation/history/history-tracker.ts +128 -0
  327. package/src/plugin-operation/history/index.ts +9 -0
  328. package/src/plugin-operation/history/types.ts +17 -0
  329. package/src/plugin-operation/history/undo-mapping.ts +135 -0
  330. package/src/plugin-operation/history/undo-registry.test.ts +72 -0
  331. package/src/plugin-operation/history/undo-registry.ts +54 -0
  332. package/src/plugin-operation/index.ts +6 -0
  333. package/src/plugin-operation/invoker-capability.ts +55 -0
  334. package/src/plugin-operation/meta.ts +12 -0
  335. package/src/plugin-operation/testing.ts +155 -0
  336. package/src/plugin-runtime/RuntimePlugin.ts +19 -0
  337. package/src/plugin-runtime/capability.ts +53 -0
  338. package/src/plugin-runtime/index.ts +5 -0
  339. package/src/plugin-runtime/meta.ts +12 -0
  340. package/src/testing/harness.ts +229 -0
  341. package/src/testing/index.ts +2 -0
  342. package/src/testing/react.test.tsx +48 -0
  343. package/src/testing/react.tsx +113 -0
  344. package/src/testing/service.ts +52 -0
  345. package/src/testing/withPluginManager.stories.tsx +15 -12
  346. package/src/testing/withPluginManager.tsx +78 -54
  347. package/src/ui/components/App/App.stories.tsx +88 -0
  348. package/src/ui/components/App/App.tsx +81 -0
  349. package/src/{playground/logger → ui/components/App}/index.ts +1 -1
  350. package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
  351. package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
  352. package/src/ui/components/Placeholder/index.ts +5 -0
  353. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +185 -0
  354. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
  355. package/src/ui/components/PluginManager/index.ts +5 -0
  356. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
  357. package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
  358. package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
  359. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  360. package/src/ui/components/Surface/context.ts +12 -0
  361. package/src/ui/components/Surface/index.ts +54 -0
  362. package/src/ui/components/Surface/types.test.ts +126 -0
  363. package/src/ui/components/Surface/types.ts +269 -0
  364. package/src/ui/components/index.ts +8 -0
  365. package/src/ui/hooks/index.ts +9 -0
  366. package/src/ui/hooks/useApp.test.tsx +159 -0
  367. package/src/ui/hooks/useApp.tsx +424 -0
  368. package/src/ui/hooks/useCapabilities.ts +67 -0
  369. package/src/ui/hooks/useLoading.tsx +76 -0
  370. package/src/ui/hooks/useSettingsState.ts +26 -0
  371. package/src/ui/hooks/useSurface.ts +13 -0
  372. package/src/ui/index.ts +6 -0
  373. package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
  374. package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
  375. package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
  376. package/src/vite-plugin/boot-loader/index.ts +5 -0
  377. package/src/vite-plugin/boot-loader/loader.ts +123 -0
  378. package/src/vite-plugin/composer/index.ts +306 -0
  379. package/src/vite-plugin/import-map/index.ts +527 -0
  380. package/src/vite-plugin/index.ts +10 -0
  381. package/src/vite-plugin/manifest.test.ts +46 -0
  382. package/src/vite-plugin/manifest.ts +57 -0
  383. package/src/vite-plugin/packages.ts +187 -0
  384. package/tsconfig.json +25 -23
  385. package/tsconfig.node.json +2 -4
  386. package/typedoc.json +2 -4
  387. package/vitest.config.ts +8 -6
  388. package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
  389. package/.swc/plugins/v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 +0 -0
  390. package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs +0 -137
  391. package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
  392. package/dist/lib/browser/chunk-FMN65HSW.mjs +0 -1519
  393. package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
  394. package/dist/lib/browser/chunk-FO2PH7M3.mjs +0 -415
  395. package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
  396. package/dist/lib/browser/chunk-ORWHM7CO.mjs +0 -32
  397. package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
  398. package/dist/lib/browser/intent-dispatcher-LSYQZSEB.mjs +0 -11
  399. package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs +0 -39
  400. package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
  401. package/dist/lib/browser/store-KML2R4IE.mjs +0 -30
  402. package/dist/lib/browser/store-KML2R4IE.mjs.map +0 -7
  403. package/dist/lib/browser/worker.mjs +0 -79
  404. package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs +0 -138
  405. package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
  406. package/dist/lib/node-esm/chunk-73HGSHKE.mjs +0 -416
  407. package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
  408. package/dist/lib/node-esm/chunk-UMZQERLE.mjs +0 -34
  409. package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
  410. package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs +0 -1521
  411. package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
  412. package/dist/lib/node-esm/intent-dispatcher-6CYNGPSW.mjs +0 -12
  413. package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs +0 -40
  414. package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
  415. package/dist/lib/node-esm/store-QEXGXLWZ.mjs +0 -31
  416. package/dist/lib/node-esm/store-QEXGXLWZ.mjs.map +0 -7
  417. package/dist/lib/node-esm/worker.mjs +0 -80
  418. package/dist/types/src/App.d.ts +0 -43
  419. package/dist/types/src/App.d.ts.map +0 -1
  420. package/dist/types/src/common/collaboration.d.ts +0 -19
  421. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  422. package/dist/types/src/common/events.d.ts +0 -52
  423. package/dist/types/src/common/events.d.ts.map +0 -1
  424. package/dist/types/src/common/file.d.ts +0 -14
  425. package/dist/types/src/common/file.d.ts.map +0 -1
  426. package/dist/types/src/common/graph.d.ts +0 -21
  427. package/dist/types/src/common/graph.d.ts.map +0 -1
  428. package/dist/types/src/common/layout.d.ts +0 -281
  429. package/dist/types/src/common/layout.d.ts.map +0 -1
  430. package/dist/types/src/common/surface.d.ts +0 -65
  431. package/dist/types/src/common/surface.d.ts.map +0 -1
  432. package/dist/types/src/core/capabilities.d.ts +0 -114
  433. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  434. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  435. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  436. package/dist/types/src/core/events.d.ts.map +0 -1
  437. package/dist/types/src/core/manager.d.ts +0 -122
  438. package/dist/types/src/core/manager.d.ts.map +0 -1
  439. package/dist/types/src/core/manager.test.d.ts +0 -2
  440. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  441. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  442. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  443. package/dist/types/src/playground/debug/index.d.ts +0 -2
  444. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  445. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  446. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  447. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  448. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  449. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  450. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  451. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  452. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  453. package/dist/types/src/playground/generator/index.d.ts +0 -3
  454. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  455. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  456. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  457. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  458. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  459. package/dist/types/src/playground/layout/index.d.ts +0 -2
  460. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  461. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  462. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  463. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  464. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  465. package/dist/types/src/playground/logger/index.d.ts +0 -2
  466. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  467. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  468. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  469. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  470. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  471. package/dist/types/src/playground/playground.stories.d.ts +0 -10
  472. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  473. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  474. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  475. package/dist/types/src/plugin-intent/actions.d.ts +0 -38
  476. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  477. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  478. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  479. package/dist/types/src/plugin-intent/index.d.ts +0 -5
  480. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  481. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  482. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  483. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  484. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  485. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  486. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  487. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  488. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  489. package/dist/types/src/plugin-settings/actions.d.ts +0 -27
  490. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  491. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  492. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  493. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  494. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  495. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  496. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  497. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  498. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  499. package/dist/types/src/plugin-settings/translations.d.ts +0 -10
  500. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  501. package/dist/types/src/react/ErrorBoundary.d.ts +0 -31
  502. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  503. package/dist/types/src/react/IntentContext.d.ts +0 -8
  504. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  505. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  506. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  507. package/dist/types/src/react/Surface.d.ts +0 -12
  508. package/dist/types/src/react/Surface.d.ts.map +0 -1
  509. package/dist/types/src/react/Surface.stories.d.ts +0 -16
  510. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  511. package/dist/types/src/react/common.d.ts +0 -13
  512. package/dist/types/src/react/common.d.ts.map +0 -1
  513. package/dist/types/src/react/index.d.ts +0 -7
  514. package/dist/types/src/react/index.d.ts.map +0 -1
  515. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  516. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  517. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  518. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  519. package/dist/types/src/worker.d.ts +0 -4
  520. package/dist/types/src/worker.d.ts.map +0 -1
  521. package/src/App.tsx +0 -276
  522. package/src/common/collaboration.ts +0 -21
  523. package/src/common/events.ts +0 -77
  524. package/src/common/file.ts +0 -22
  525. package/src/common/graph.ts +0 -30
  526. package/src/common/layout.ts +0 -278
  527. package/src/common/surface.ts +0 -86
  528. package/src/core/capabilities.test.ts +0 -136
  529. package/src/core/capabilities.ts +0 -254
  530. package/src/core/manager.test.ts +0 -515
  531. package/src/core/manager.ts +0 -519
  532. package/src/playground/debug/Debug.tsx +0 -39
  533. package/src/playground/debug/plugin.ts +0 -17
  534. package/src/playground/generator/Main.tsx +0 -71
  535. package/src/playground/generator/Toolbar.tsx +0 -46
  536. package/src/playground/generator/generator.ts +0 -48
  537. package/src/playground/generator/index.ts +0 -6
  538. package/src/playground/generator/plugin.ts +0 -23
  539. package/src/playground/layout/Layout.tsx +0 -33
  540. package/src/playground/layout/plugin.ts +0 -17
  541. package/src/playground/logger/Toolbar.tsx +0 -29
  542. package/src/playground/logger/plugin.ts +0 -36
  543. package/src/playground/logger/schema.ts +0 -12
  544. package/src/playground/playground.stories.tsx +0 -42
  545. package/src/plugin-intent/IntentPlugin.ts +0 -20
  546. package/src/plugin-intent/actions.ts +0 -33
  547. package/src/plugin-intent/errors.ts +0 -39
  548. package/src/plugin-intent/index.ts +0 -8
  549. package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
  550. package/src/plugin-intent/intent-dispatcher.ts +0 -333
  551. package/src/plugin-intent/intent.ts +0 -154
  552. package/src/plugin-settings/SettingsPlugin.ts +0 -35
  553. package/src/plugin-settings/actions.ts +0 -29
  554. package/src/plugin-settings/app-graph-builder.ts +0 -157
  555. package/src/plugin-settings/index.ts +0 -6
  556. package/src/plugin-settings/intent-resolver.ts +0 -34
  557. package/src/plugin-settings/store.ts +0 -33
  558. package/src/plugin-settings/translations.ts +0 -19
  559. package/src/react/ErrorBoundary.tsx +0 -45
  560. package/src/react/IntentContext.tsx +0 -34
  561. package/src/react/Surface.stories.tsx +0 -96
  562. package/src/react/Surface.tsx +0 -77
  563. package/src/react/common.ts +0 -12
  564. package/src/react/index.ts +0 -10
  565. package/src/react/useCapabilities.ts +0 -30
  566. package/src/react/useIntentResolver.ts +0 -22
  567. package/src/worker.ts +0 -11
  568. /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  569. /package/dist/lib/browser/{worker.mjs.map → common/activation-events.mjs.map} +0 -0
  570. /package/dist/lib/{node-esm/intent-dispatcher-6CYNGPSW.mjs.map → browser/common/capabilities.mjs.map} +0 -0
  571. /package/dist/lib/{node-esm/worker.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,51 @@
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 type * as ActivationEvent from './activation-event';
6
+ import * as Capability from './capability';
7
+ import type * as PluginManager from './plugin-manager';
8
+ declare const Service_base: Context.TagClass<Service, "@dxos/app-framework/PluginManager", PluginManager.PluginManager>;
9
+ /**
10
+ * Effect Context.Tag for accessing PluginManager via the Effect layer system.
11
+ * This allows lifecycle operations to access the plugin manager without having it passed as an argument.
12
+ */
13
+ export declare class Service extends Service_base {
14
+ }
15
+ /**
16
+ * Activates plugins based on the activation event.
17
+ * Accesses the PluginManager via the Effect layer system.
18
+ * @param event The activation event.
19
+ * @returns Whether the activation was successful.
20
+ */
21
+ export declare const activate: (event: ActivationEvent.ActivationEvent) => Effect.Effect<boolean, Error, Service>;
22
+ /**
23
+ * Re-activates the modules that were activated by the event.
24
+ * Accesses the PluginManager via the Effect layer system.
25
+ * @param event The activation event.
26
+ * @returns Whether the reset was successful.
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>;
34
+ /**
35
+ * Identifier denoting a PluginModule.
36
+ */
37
+ export declare const PluginModuleTypeId: unique symbol;
38
+ export type PluginModuleTypeId = typeof PluginModuleTypeId;
39
+ /**
40
+ * Type guard to check if a value is a PluginModule.
41
+ */
42
+ export declare const isPluginModule: (value: unknown) => value is PluginModule;
43
+ /**
44
+ * A unit of containment of modular functionality that can be provided to an application.
45
+ * Activation of a module is async allowing for code to split and loaded lazily.
46
+ */
47
+ export interface PluginModule {
48
+ readonly [PluginModuleTypeId]: PluginModuleTypeId;
5
49
  /**
6
50
  * Unique id of the module.
7
51
  */
@@ -9,47 +53,53 @@ interface PluginModuleInterface {
9
53
  /**
10
54
  * Events for which the module will be activated.
11
55
  */
12
- activatesOn: ActivationEvents;
56
+ activatesOn: ActivationEvent.Events;
13
57
  /**
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.
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".
17
71
  */
18
- activatesBefore?: ActivationEvent[];
72
+ firesBeforeActivation?: ActivationEvent.ActivationEvent[];
19
73
  /**
20
- * 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".
21
82
  */
22
- activatesAfter?: ActivationEvent[];
83
+ firesAfterActivation?: ActivationEvent.ActivationEvent[];
23
84
  /**
24
85
  * Called when the module is activated.
25
- * @param context The plugin context.
86
+ * CapabilityManager is accessed via the Effect layer system (Capability.Service).
87
+ * PluginManager is accessed via Plugin.Service.
88
+ * @param props Optional props passed to the module.
26
89
  * @returns The capabilities of the module.
27
90
  */
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);
91
+ activate: (props?: any) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service | Service | never>;
41
92
  }
42
- /**
43
- * Helper to define a module.
44
- */
45
- export declare const defineModule: (options: PluginModuleInterface) => PluginModule;
46
- export type PluginMeta = {
93
+ export type PluginModuleOptions = Omit<PluginModule, 'id' | typeof PluginModuleTypeId> & {
94
+ id?: string;
95
+ };
96
+ export type Meta = {
47
97
  /**
48
98
  * Globally unique ID.
49
99
  *
50
100
  * Expected to be in the form of a valid URL.
51
101
  *
52
- * @example dxos.org/plugin/example
102
+ * @example org.dxos.plugin.example
53
103
  */
54
104
  id: string;
55
105
  /**
@@ -60,6 +110,10 @@ export type PluginMeta = {
60
110
  * Short description of plugin functionality.
61
111
  */
62
112
  description?: string;
113
+ /**
114
+ * Name of the author or organization that created the plugin.
115
+ */
116
+ author?: string;
63
117
  /**
64
118
  * URL of home page.
65
119
  */
@@ -80,19 +134,193 @@ export type PluginMeta = {
80
134
  * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
81
135
  */
82
136
  icon?: string;
137
+ /**
138
+ * Icon hue (ChromaticPalette).
139
+ */
140
+ iconHue?: string;
141
+ /**
142
+ * IDs of plugins this plugin functionally depends on.
143
+ *
144
+ * Treated as a convenience by the default `PluginManager` flow:
145
+ * - Enabling this plugin auto-enables the transitive closure of `dependsOn`
146
+ * (installing missing entries from the plugin registry when possible).
147
+ * - Disabling a depended-upon plugin surfaces dependents to the caller; the
148
+ * `PluginManager.disable` API supports an opt-in cascade.
149
+ *
150
+ * Not an invariant: low-level `PluginManager` APIs accept opt-outs
151
+ * (`resolveDependencies: false`, `ignoreDependents: true`) so a caller may
152
+ * substitute an alternative implementation that satisfies the dependent's
153
+ * capability needs in its own way.
154
+ */
155
+ dependsOn?: string[];
83
156
  };
157
+ /**
158
+ * Identifier denoting a Plugin.
159
+ */
160
+ export declare const PluginTypeId: unique symbol;
161
+ export type PluginTypeId = typeof PluginTypeId;
162
+ /**
163
+ * Type guard to check if a value is a Plugin.
164
+ */
165
+ export declare const isPlugin: (value: unknown) => value is Plugin;
84
166
  /**
85
167
  * A collection of modules that are be enabled/disabled as a unit.
86
168
  * Plugins provide things such as components, state, actions, etc. to the application.
87
169
  */
88
- export declare class Plugin {
89
- readonly meta: PluginMeta;
90
- readonly modules: PluginModule[];
91
- constructor(meta: PluginMeta, modules: PluginModule[]);
170
+ export interface Plugin {
171
+ readonly [PluginTypeId]: PluginTypeId;
172
+ readonly meta: Readonly<Meta>;
173
+ readonly modules: ReadonlyArray<PluginModule>;
174
+ }
175
+ /**
176
+ * Builder interface for creating plugins incrementally.
177
+ */
178
+ export interface PluginBuilder<T = void> extends Pipeable.Pipeable {
179
+ readonly meta: Meta;
180
+ readonly modules: ReadonlyArray<PluginModuleOptions | ((options: T) => PluginModuleOptions)>;
181
+ addModule(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;
182
+ }
183
+ /**
184
+ * Creates a new PluginBuilder to start building a plugin.
185
+ */
186
+ export declare const define: <T = void>(meta: Meta) => PluginBuilder<T>;
187
+ /**
188
+ * Adds a module to a plugin builder.
189
+ * Supports both pipeline and direct call styles.
190
+ * Modules can be either PluginModuleOptions or functions that receive options.
191
+ */
192
+ export declare function addModule<T>(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): (builder: PluginBuilder<T>) => PluginBuilder<T>;
193
+ export declare function addModule<T>(builder: PluginBuilder<T>, moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;
194
+ export type PluginFactory<T = void> = ((options: T) => Plugin) & {
195
+ meta: Meta;
196
+ };
197
+ /**
198
+ * Creates a Plugin from a builder.
199
+ * Supports both pipeline and direct call styles.
200
+ * Always returns a factory function (options: T) => Plugin.
201
+ * When T is void, the function takes no arguments: () => Plugin.
202
+ */
203
+ export declare function make<T>(builder: PluginBuilder<T>): PluginFactory<T>;
204
+ /**
205
+ * Async loader for a lazy plugin's real implementation.
206
+ * The default export of the loaded module must be a `PluginFactory<T>` —
207
+ * i.e. the same shape `Plugin.make` produces.
208
+ */
209
+ export type LazyLoader<T = void> = () => Promise<{
210
+ default: PluginFactory<T>;
211
+ }>;
212
+ /**
213
+ * Defines a lazy plugin whose body is loaded on first enable.
214
+ *
215
+ * The returned factory produces a stub `Plugin` that exposes `meta`
216
+ * synchronously (so callers can read `Plugin.meta.id` for free) but defers
217
+ * loading the real plugin's modules until the manager calls
218
+ * `Plugin.resolveLazy`. This lets the plugin's main entry point ship as a
219
+ * tiny meta-only chunk — the heavy capabilities, schema, React surfaces,
220
+ * etc. live behind the dynamic `import()` and become a separate Rollup
221
+ * chunk that is only fetched when the plugin is enabled.
222
+ *
223
+ * @example
224
+ * ```ts
225
+ * // plugin-markdown/src/index.ts
226
+ * import { Plugin } from '@dxos/app-framework';
227
+ * import { meta } from './meta';
228
+ *
229
+ * export const MarkdownPlugin = Plugin.lazy(meta, () => import('./MarkdownPlugin'));
230
+ *
231
+ * // plugin-markdown/src/MarkdownPlugin.tsx
232
+ * export const MarkdownPlugin = Plugin.define(meta).pipe(...heavy modules..., Plugin.make);
233
+ * export default MarkdownPlugin;
234
+ * ```
235
+ */
236
+ export declare const lazy: <T = void>(meta: Meta, loader: LazyLoader<T>) => PluginFactory<T>;
237
+ /**
238
+ * Type guard for lazy plugin stubs produced by {@link lazy}.
239
+ */
240
+ export declare const isLazy: (plugin: Plugin) => boolean;
241
+ declare const LazyPluginError_base: {
242
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
243
+ cause?: unknown;
244
+ stack?: string;
245
+ name: "LazyPluginError";
246
+ context: Record<string, unknown>;
247
+ readonly message: string;
248
+ readonly _tag: "LazyPluginError";
249
+ };
250
+ isError(error: unknown): error is Error;
251
+ name: "LazyPluginError";
252
+ is(error: unknown): error is BaseError;
253
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
254
+ ifTypeDiffers?: boolean;
255
+ }): (error: unknown) => {
256
+ cause?: unknown;
257
+ stack?: string;
258
+ name: "LazyPluginError";
259
+ context: Record<string, unknown>;
260
+ readonly message: string;
261
+ readonly _tag: "LazyPluginError";
262
+ };
263
+ extend<Name extends string = string>(name: Name, message?: string): any;
264
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
265
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
266
+ stackTraceLimit: number;
267
+ };
268
+ /**
269
+ * Tagged error for failures during lazy plugin resolution. `context.id` is
270
+ * the lazy plugin's `meta.id`; `context.reason` discriminates the failure
271
+ * mode (`'load-failed' | 'missing-default' | 'invalid-plugin' |
272
+ * 'meta-mismatch'`) so callers can route on it.
273
+ */
274
+ export declare class LazyPluginError extends LazyPluginError_base {
275
+ }
276
+ declare const PluginDependencyError_base: {
277
+ new (options?: import("@dxos/errors").BaseErrorOptions): {
278
+ cause?: unknown;
279
+ stack?: string;
280
+ name: "PluginDependencyError";
281
+ context: Record<string, unknown>;
282
+ readonly message: string;
283
+ readonly _tag: "PluginDependencyError";
284
+ };
285
+ isError(error: unknown): error is Error;
286
+ name: "PluginDependencyError";
287
+ is(error: unknown): error is BaseError;
288
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
289
+ ifTypeDiffers?: boolean;
290
+ }): (error: unknown) => {
291
+ cause?: unknown;
292
+ stack?: string;
293
+ name: "PluginDependencyError";
294
+ context: Record<string, unknown>;
295
+ readonly message: string;
296
+ readonly _tag: "PluginDependencyError";
297
+ };
298
+ extend<Name extends string = string>(name: Name, message?: string): any;
299
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
300
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
301
+ stackTraceLimit: number;
302
+ };
303
+ /**
304
+ * Tagged error for plugin-level dependency resolution failures.
305
+ *
306
+ * `context.id` is the plugin id the manager was acting on. `context.reason`
307
+ * discriminates the failure mode:
308
+ * - `'missing'` — declared dep is neither registered nor in the catalog.
309
+ * `context.missing` lists offending ids.
310
+ * - `'install-failed'` — dep was found in the catalog but `add()` failed.
311
+ * `cause` carries the original error.
312
+ * - `'cycle'` — closure walk detected a cycle. `context.path` is the cycle path.
313
+ * - `'core-dependent'` — cascade-disable would have to disable a core plugin.
314
+ * `context.coreDependent` is the blocking id.
315
+ */
316
+ export declare class PluginDependencyError extends PluginDependencyError_base {
92
317
  }
93
318
  /**
94
- * Helper to define a plugin.
319
+ * Resolves a lazy plugin stub to its real plugin.
320
+ * Returns the plugin unchanged if it is not lazy. Failures surface as
321
+ * {@link LazyPluginError} with `context.reason` indicating the failure mode
322
+ * and (for loader failures) `cause` set to the original error.
95
323
  */
96
- export declare const definePlugin: (meta: PluginMeta, modules: PluginModule[]) => Plugin;
324
+ export declare const resolveLazy: (plugin: Plugin) => Effect.Effect<Plugin, LazyPluginError>;
97
325
  export {};
98
326
  //# 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,KAAK,eAAe,EAAE,KAAK,gBAAgB,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BAG1C;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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC,M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