@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.
- package/.storybook/main.mts +9 -0
- package/.storybook/preview.mts +8 -0
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/capability-HRFPP52W.mjs +35 -0
- package/dist/lib/browser/capability-HRFPP52W.mjs.map +7 -0
- package/dist/lib/browser/capability-VQ236TY5.mjs +38 -0
- package/dist/lib/browser/capability-VQ236TY5.mjs.map +7 -0
- package/dist/lib/browser/chunk-23D4SJUE.mjs +42 -0
- package/dist/lib/browser/chunk-23D4SJUE.mjs.map +7 -0
- package/dist/lib/browser/chunk-3JWJXGLK.mjs +79 -0
- package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +7 -0
- package/dist/lib/browser/chunk-45CHLTBV.mjs +34 -0
- package/dist/lib/browser/chunk-45CHLTBV.mjs.map +7 -0
- package/dist/lib/browser/chunk-66IXTIVK.mjs +48 -0
- package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
- package/dist/lib/browser/chunk-6GZYCP73.mjs +422 -0
- package/dist/lib/browser/chunk-6GZYCP73.mjs.map +7 -0
- package/dist/lib/browser/chunk-7VZJR2OA.mjs +581 -0
- package/dist/lib/browser/chunk-7VZJR2OA.mjs.map +7 -0
- package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
- package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
- package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
- package/dist/lib/browser/chunk-G6Q2M2M5.mjs +218 -0
- package/dist/lib/browser/chunk-G6Q2M2M5.mjs.map +7 -0
- package/dist/lib/browser/chunk-J43JDWAV.mjs +1445 -0
- package/dist/lib/browser/chunk-J43JDWAV.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-WBHCSOBW.mjs +80 -0
- package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +7 -0
- package/dist/lib/browser/chunk-XLYULXAO.mjs +469 -0
- package/dist/lib/browser/chunk-XLYULXAO.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZGJAZSNE.mjs +142 -0
- package/dist/lib/browser/chunk-ZGJAZSNE.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +76 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +24 -0
- package/dist/lib/browser/common/capabilities.mjs +46 -0
- package/dist/lib/browser/core/activation-event.mjs +20 -0
- package/dist/lib/browser/core/capability.mjs +30 -0
- package/dist/lib/browser/core/capability.mjs.map +7 -0
- package/dist/lib/browser/core/plugin-manager.mjs +19 -0
- package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/browser/core/plugin.mjs +39 -0
- package/dist/lib/browser/core/plugin.mjs.map +7 -0
- package/dist/lib/browser/core/url-loader.mjs +24 -0
- package/dist/lib/browser/core/url-loader.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +108 -156
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invoker-capability-CEL2L6GX.mjs +44 -0
- package/dist/lib/browser/invoker-capability-CEL2L6GX.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +236 -51
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/browser/testing/react.mjs +78 -0
- package/dist/lib/browser/testing/react.mjs.map +7 -0
- package/dist/lib/browser/ui/index.mjs +48 -0
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/capability-GS3XJH74.mjs +39 -0
- package/dist/lib/node-esm/capability-GS3XJH74.mjs.map +7 -0
- package/dist/lib/node-esm/capability-I5P7ACFL.mjs +36 -0
- package/dist/lib/node-esm/capability-I5P7ACFL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
- package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4RJL37GN.mjs +423 -0
- package/dist/lib/node-esm/chunk-4RJL37GN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs +35 -0
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-D347W3KO.mjs +143 -0
- package/dist/lib/node-esm/chunk-D347W3KO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DW45NFLW.mjs +1446 -0
- package/dist/lib/node-esm/chunk-DW45NFLW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-EI4LYXFY.mjs +470 -0
- package/dist/lib/node-esm/chunk-EI4LYXFY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KIFOQXD4.mjs +219 -0
- package/dist/lib/node-esm/chunk-KIFOQXD4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SBS2YMPT.mjs +43 -0
- package/dist/lib/node-esm/chunk-SBS2YMPT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs +80 -0
- package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-V24UWT36.mjs +582 -0
- package/dist/lib/node-esm/chunk-V24UWT36.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs +81 -0
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
- package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
- package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +77 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +25 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +47 -0
- package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
- package/dist/lib/node-esm/core/activation-event.mjs +21 -0
- package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
- package/dist/lib/node-esm/core/capability.mjs +31 -0
- package/dist/lib/node-esm/core/capability.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
- package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
- package/dist/lib/node-esm/core/plugin.mjs +40 -0
- package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
- package/dist/lib/node-esm/core/url-loader.mjs +25 -0
- package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +108 -156
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invoker-capability-QKUKN2MF.mjs +45 -0
- package/dist/lib/node-esm/invoker-capability-QKUKN2MF.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +236 -51
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/testing/react.mjs +79 -0
- package/dist/lib/node-esm/testing/react.mjs.map +7 -0
- package/dist/lib/node-esm/ui/index.mjs +49 -0
- package/dist/lib/node-esm/ui/index.mjs.map +7 -0
- package/dist/plugin/node-esm/index.mjs +893 -0
- package/dist/plugin/node-esm/index.mjs.map +7 -0
- package/dist/plugin/node-esm/meta.json +1 -0
- package/dist/types/src/cli/cli.d.ts +39 -0
- package/dist/types/src/cli/cli.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/common/activation-events.d.ts +27 -0
- package/dist/types/src/common/activation-events.d.ts.map +1 -0
- package/dist/types/src/common/annotations.d.ts +1 -0
- package/dist/types/src/common/annotations.d.ts.map +1 -0
- package/dist/types/src/common/capabilities.d.ts +110 -123
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +4 -8
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/operations.d.ts +19 -0
- package/dist/types/src/common/operations.d.ts.map +1 -0
- package/dist/types/src/common/translations.d.ts +8 -8
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/context.d.ts +5 -0
- package/dist/types/src/context.d.ts.map +1 -0
- package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
- package/dist/types/src/core/activation-event.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.d.ts +48 -0
- package/dist/types/src/core/capability-manager.d.ts.map +1 -0
- package/dist/types/src/core/capability-manager.test.d.ts +2 -0
- package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/capability.d.ts +156 -0
- package/dist/types/src/core/capability.d.ts.map +1 -0
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
- package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +11 -4
- package/dist/types/src/core/index.d.ts.map +1 -1
- package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
- package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.d.ts +298 -0
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manifest.d.ts +101 -0
- package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
- package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
- package/dist/types/src/core/plugin.d.ts +265 -37
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +107 -0
- package/dist/types/src/core/registry.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.d.ts +127 -0
- package/dist/types/src/core/url-loader.d.ts.map +1 -0
- package/dist/types/src/core/url-loader.test.d.ts +2 -0
- package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts +32 -0
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
- package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
- package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/index.d.ts +3 -0
- package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/meta.d.ts +3 -0
- package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-operation/testing.d.ts +59 -0
- package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
- package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/index.d.ts +2 -0
- package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
- package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
- package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +67 -0
- package/dist/types/src/testing/harness.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/react.d.ts +27 -0
- package/dist/types/src/testing/react.d.ts.map +1 -0
- package/dist/types/src/testing/react.test.d.ts +2 -0
- package/dist/types/src/testing/react.test.d.ts.map +1 -0
- package/dist/types/src/testing/service.d.ts +8 -0
- package/dist/types/src/testing/service.d.ts.map +1 -0
- package/dist/types/src/testing/withPluginManager.d.ts +11 -10
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts +9 -3
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.d.ts +9 -0
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/index.d.ts +2 -0
- package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts +64 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts +19 -0
- package/dist/types/src/ui/components/Placeholder/Placeholder.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts +2 -0
- package/dist/types/src/ui/components/Placeholder/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts +13 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
- package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
- package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts +14 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
- package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
- package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
- package/dist/types/src/ui/components/index.d.ts +5 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/index.d.ts +6 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.d.ts +89 -0
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
- package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
- package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useLoading.d.ts +18 -0
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
- package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
- package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
- package/dist/types/src/ui/index.d.ts +3 -0
- package/dist/types/src/ui/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts +34 -0
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
- package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/index.d.ts +5 -0
- package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
- package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
- package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/packages.d.ts +13 -0
- package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +26 -3
- package/package.json +117 -53
- package/src/cli/cli.ts +107 -0
- package/src/{playground/layout → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +44 -0
- package/src/{playground/debug/index.ts → common/annotations.ts} +0 -2
- package/src/common/capabilities.ts +169 -114
- package/src/common/index.ts +4 -8
- package/src/common/operations.ts +35 -0
- package/src/common/translations.ts +18 -10
- package/src/context.ts +9 -0
- package/src/core/{events.ts → activation-event.ts} +10 -7
- package/src/core/capability-manager.test.ts +151 -0
- package/src/core/capability-manager.ts +192 -0
- package/src/core/capability.ts +247 -0
- package/src/core/edge-registry-plugin-provider.ts +92 -0
- package/src/core/index.ts +11 -4
- package/src/core/plugin-asset-cache.ts +60 -0
- package/src/core/plugin-manager.test.ts +1899 -0
- package/src/core/plugin-manager.ts +1685 -0
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +404 -43
- package/src/core/registry.ts +163 -0
- package/src/core/url-loader.test.ts +221 -0
- package/src/core/url-loader.ts +388 -0
- package/src/helpers.test.ts +1 -1
- package/src/index.ts +3 -4
- package/src/plugin-operation/OperationPlugin.ts +24 -0
- package/src/plugin-operation/history/capability.ts +36 -0
- package/src/plugin-operation/history/errors.ts +7 -0
- package/src/plugin-operation/history/history-tracker.test.ts +374 -0
- package/src/plugin-operation/history/history-tracker.ts +128 -0
- package/src/plugin-operation/history/index.ts +9 -0
- package/src/plugin-operation/history/types.ts +17 -0
- package/src/plugin-operation/history/undo-mapping.ts +135 -0
- package/src/plugin-operation/history/undo-registry.test.ts +72 -0
- package/src/plugin-operation/history/undo-registry.ts +54 -0
- package/src/plugin-operation/index.ts +6 -0
- package/src/plugin-operation/invoker-capability.ts +55 -0
- package/src/plugin-operation/meta.ts +12 -0
- package/src/plugin-operation/testing.ts +155 -0
- package/src/plugin-runtime/RuntimePlugin.ts +19 -0
- package/src/plugin-runtime/capability.ts +53 -0
- package/src/plugin-runtime/index.ts +5 -0
- package/src/plugin-runtime/meta.ts +12 -0
- package/src/testing/harness.ts +229 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/react.test.tsx +48 -0
- package/src/testing/react.tsx +113 -0
- package/src/testing/service.ts +52 -0
- package/src/testing/withPluginManager.stories.tsx +15 -12
- package/src/testing/withPluginManager.tsx +78 -54
- package/src/ui/components/App/App.stories.tsx +88 -0
- package/src/ui/components/App/App.tsx +81 -0
- package/src/{playground/logger → ui/components/App}/index.ts +1 -1
- package/src/ui/components/Placeholder/Placeholder.stories.tsx +77 -0
- package/src/ui/components/Placeholder/Placeholder.tsx +155 -0
- package/src/ui/components/Placeholder/index.ts +5 -0
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +185 -0
- package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
- package/src/ui/components/PluginManager/index.ts +5 -0
- package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
- package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
- package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
- package/src/ui/components/Surface/context.ts +12 -0
- package/src/ui/components/Surface/index.ts +54 -0
- package/src/ui/components/Surface/types.test.ts +126 -0
- package/src/ui/components/Surface/types.ts +269 -0
- package/src/ui/components/index.ts +8 -0
- package/src/ui/hooks/index.ts +9 -0
- package/src/ui/hooks/useApp.test.tsx +159 -0
- package/src/ui/hooks/useApp.tsx +424 -0
- package/src/ui/hooks/useCapabilities.ts +67 -0
- package/src/ui/hooks/useLoading.tsx +76 -0
- package/src/ui/hooks/useSettingsState.ts +26 -0
- package/src/ui/hooks/useSurface.ts +13 -0
- package/src/ui/index.ts +6 -0
- package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +270 -0
- package/src/vite-plugin/boot-loader/boot-loader.css +320 -0
- package/src/vite-plugin/boot-loader/boot-loader.js +325 -0
- package/src/vite-plugin/boot-loader/index.ts +5 -0
- package/src/vite-plugin/boot-loader/loader.ts +123 -0
- package/src/vite-plugin/composer/index.ts +306 -0
- package/src/vite-plugin/import-map/index.ts +527 -0
- package/src/vite-plugin/index.ts +10 -0
- package/src/vite-plugin/manifest.test.ts +46 -0
- package/src/vite-plugin/manifest.ts +57 -0
- package/src/vite-plugin/packages.ts +187 -0
- package/tsconfig.json +25 -23
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +8 -6
- package/.swc/plugins/v7_linux_x86_64_13.0.0/f45bdff002284d9e8f9ef3f0be909de12da36c049cbcf261ac78fc00abb09a2d +0 -0
- package/.swc/plugins/v7_linux_x86_64_13.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429 +0 -0
- package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs +0 -137
- package/dist/lib/browser/app-graph-builder-LYF7EKNN.mjs.map +0 -7
- package/dist/lib/browser/chunk-FMN65HSW.mjs +0 -1519
- package/dist/lib/browser/chunk-FMN65HSW.mjs.map +0 -7
- package/dist/lib/browser/chunk-FO2PH7M3.mjs +0 -415
- package/dist/lib/browser/chunk-FO2PH7M3.mjs.map +0 -7
- package/dist/lib/browser/chunk-ORWHM7CO.mjs +0 -32
- package/dist/lib/browser/chunk-ORWHM7CO.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-LSYQZSEB.mjs +0 -11
- package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs +0 -39
- package/dist/lib/browser/intent-resolver-ZTNOSO3A.mjs.map +0 -7
- package/dist/lib/browser/store-KML2R4IE.mjs +0 -30
- package/dist/lib/browser/store-KML2R4IE.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -79
- package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs +0 -138
- package/dist/lib/node-esm/app-graph-builder-SAOWGJDK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-73HGSHKE.mjs +0 -416
- package/dist/lib/node-esm/chunk-73HGSHKE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs +0 -34
- package/dist/lib/node-esm/chunk-UMZQERLE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs +0 -1521
- package/dist/lib/node-esm/chunk-ZEZ4FVEU.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-6CYNGPSW.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-W7Z7WFFM.mjs.map +0 -7
- package/dist/lib/node-esm/store-QEXGXLWZ.mjs +0 -31
- package/dist/lib/node-esm/store-QEXGXLWZ.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -80
- package/dist/types/src/App.d.ts +0 -43
- package/dist/types/src/App.d.ts.map +0 -1
- package/dist/types/src/common/collaboration.d.ts +0 -19
- package/dist/types/src/common/collaboration.d.ts.map +0 -1
- package/dist/types/src/common/events.d.ts +0 -52
- package/dist/types/src/common/events.d.ts.map +0 -1
- package/dist/types/src/common/file.d.ts +0 -14
- package/dist/types/src/common/file.d.ts.map +0 -1
- package/dist/types/src/common/graph.d.ts +0 -21
- package/dist/types/src/common/graph.d.ts.map +0 -1
- package/dist/types/src/common/layout.d.ts +0 -281
- package/dist/types/src/common/layout.d.ts.map +0 -1
- package/dist/types/src/common/surface.d.ts +0 -65
- package/dist/types/src/common/surface.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.d.ts +0 -114
- package/dist/types/src/core/capabilities.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.test.d.ts +0 -2
- package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
- package/dist/types/src/core/events.d.ts.map +0 -1
- package/dist/types/src/core/manager.d.ts +0 -122
- package/dist/types/src/core/manager.d.ts.map +0 -1
- package/dist/types/src/core/manager.test.d.ts +0 -2
- package/dist/types/src/core/manager.test.d.ts.map +0 -1
- package/dist/types/src/playground/debug/Debug.d.ts +0 -6
- package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
- package/dist/types/src/playground/debug/index.d.ts +0 -2
- package/dist/types/src/playground/debug/index.d.ts.map +0 -1
- package/dist/types/src/playground/debug/plugin.d.ts +0 -2
- package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Main.d.ts +0 -6
- package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/generator/generator.d.ts +0 -7
- package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
- package/dist/types/src/playground/generator/index.d.ts +0 -3
- package/dist/types/src/playground/generator/index.d.ts.map +0 -1
- package/dist/types/src/playground/generator/plugin.d.ts +0 -2
- package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/layout/Layout.d.ts +0 -8
- package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
- package/dist/types/src/playground/layout/index.d.ts +0 -2
- package/dist/types/src/playground/layout/index.d.ts.map +0 -1
- package/dist/types/src/playground/layout/plugin.d.ts +0 -2
- package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
- package/dist/types/src/playground/logger/index.d.ts +0 -2
- package/dist/types/src/playground/logger/index.d.ts.map +0 -1
- package/dist/types/src/playground/logger/plugin.d.ts +0 -2
- package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
- package/dist/types/src/playground/logger/schema.d.ts +0 -13
- package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
- package/dist/types/src/playground/playground.stories.d.ts +0 -10
- package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/actions.d.ts +0 -38
- package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/errors.d.ts +0 -16
- package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/index.d.ts +0 -5
- package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
- package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/plugin-intent/intent.d.ts +0 -63
- package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/actions.d.ts +0 -27
- package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/index.d.ts +0 -3
- package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/store.d.ts +0 -5
- package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/translations.d.ts +0 -10
- package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +0 -31
- package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
- package/dist/types/src/react/IntentContext.d.ts +0 -8
- package/dist/types/src/react/IntentContext.d.ts.map +0 -1
- package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
- package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
- package/dist/types/src/react/Surface.d.ts +0 -12
- package/dist/types/src/react/Surface.d.ts.map +0 -1
- package/dist/types/src/react/Surface.stories.d.ts +0 -16
- package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
- package/dist/types/src/react/common.d.ts +0 -13
- package/dist/types/src/react/common.d.ts.map +0 -1
- package/dist/types/src/react/index.d.ts +0 -7
- package/dist/types/src/react/index.d.ts.map +0 -1
- package/dist/types/src/react/useCapabilities.d.ts +0 -13
- package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
- package/dist/types/src/react/useIntentResolver.d.ts +0 -3
- package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/App.tsx +0 -276
- package/src/common/collaboration.ts +0 -21
- package/src/common/events.ts +0 -77
- package/src/common/file.ts +0 -22
- package/src/common/graph.ts +0 -30
- package/src/common/layout.ts +0 -278
- package/src/common/surface.ts +0 -86
- package/src/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -254
- package/src/core/manager.test.ts +0 -515
- package/src/core/manager.ts +0 -519
- package/src/playground/debug/Debug.tsx +0 -39
- package/src/playground/debug/plugin.ts +0 -17
- package/src/playground/generator/Main.tsx +0 -71
- package/src/playground/generator/Toolbar.tsx +0 -46
- package/src/playground/generator/generator.ts +0 -48
- package/src/playground/generator/index.ts +0 -6
- package/src/playground/generator/plugin.ts +0 -23
- package/src/playground/layout/Layout.tsx +0 -33
- package/src/playground/layout/plugin.ts +0 -17
- package/src/playground/logger/Toolbar.tsx +0 -29
- package/src/playground/logger/plugin.ts +0 -36
- package/src/playground/logger/schema.ts +0 -12
- package/src/playground/playground.stories.tsx +0 -42
- package/src/plugin-intent/IntentPlugin.ts +0 -20
- package/src/plugin-intent/actions.ts +0 -33
- package/src/plugin-intent/errors.ts +0 -39
- package/src/plugin-intent/index.ts +0 -8
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -279
- package/src/plugin-intent/intent-dispatcher.ts +0 -333
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-settings/SettingsPlugin.ts +0 -35
- package/src/plugin-settings/actions.ts +0 -29
- package/src/plugin-settings/app-graph-builder.ts +0 -157
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/intent-resolver.ts +0 -34
- package/src/plugin-settings/store.ts +0 -33
- package/src/plugin-settings/translations.ts +0 -19
- package/src/react/ErrorBoundary.tsx +0 -45
- package/src/react/IntentContext.tsx +0 -34
- package/src/react/Surface.stories.tsx +0 -96
- package/src/react/Surface.tsx +0 -77
- package/src/react/common.ts +0 -12
- package/src/react/index.ts +0 -10
- package/src/react/useCapabilities.ts +0 -30
- package/src/react/useIntentResolver.ts +0 -22
- package/src/worker.ts +0 -11
- /package/dist/lib/browser/{intent-dispatcher-LSYQZSEB.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{worker.mjs.map → common/activation-events.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-6CYNGPSW.mjs.map → browser/common/capabilities.mjs.map} +0 -0
- /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 @@
|
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
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:
|
|
56
|
+
activatesOn: ActivationEvent.Events;
|
|
13
57
|
/**
|
|
14
|
-
* Events
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
-
|
|
72
|
+
firesBeforeActivation?: ActivationEvent.ActivationEvent[];
|
|
19
73
|
/**
|
|
20
|
-
* Events
|
|
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
|
-
|
|
83
|
+
firesAfterActivation?: ActivationEvent.ActivationEvent[];
|
|
23
84
|
/**
|
|
24
85
|
* Called when the module is activated.
|
|
25
|
-
*
|
|
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: (
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
export
|
|
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.
|
|
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
|
|
89
|
-
readonly
|
|
90
|
-
readonly
|
|
91
|
-
|
|
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
|
-
*
|
|
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
|
|
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,
|
|
1
|
+
{"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AAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAwBhF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAwBrE;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAC;AAKhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,GAAG,IAAI,QAAQ,IAAI,UAAU,UAAU,CAAC,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAUjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,OAA4B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErE;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,oBAAoE;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5G;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,SAAQ,0BAG1C;CAAG;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,WAAW,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAwB9E,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Atom, type Registry as AtomRegistry } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
/**
|
|
4
|
+
* A registry plugin entry as seen by the plugin manager layer.
|
|
5
|
+
* Populated from the registry catalog; represents the latest available version of a plugin.
|
|
6
|
+
*
|
|
7
|
+
* Independently defined from @dxos/protocols PluginEntry — similar shape but not the same type.
|
|
8
|
+
* Implementations of {@link PluginProvider} (e.g. {@link EdgeRegistryPluginProvider})
|
|
9
|
+
* are responsible for mapping their wire-format entries to this shape.
|
|
10
|
+
*/
|
|
11
|
+
export type Plugin = {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
homePage?: string;
|
|
16
|
+
source?: string;
|
|
17
|
+
screenshots?: string[];
|
|
18
|
+
tags?: string[];
|
|
19
|
+
icon?: string;
|
|
20
|
+
iconHue?: string;
|
|
21
|
+
/**
|
|
22
|
+
* IDs of plugins this entry declares as runtime dependencies. Mirrors
|
|
23
|
+
* {@link Plugin.Meta.dependsOn}. Surfaced in the catalog so the manager can
|
|
24
|
+
* resolve and auto-install transitive deps before they are first loaded.
|
|
25
|
+
*/
|
|
26
|
+
dependsOn?: string[];
|
|
27
|
+
/** URL to dynamic-import the latest version of this plugin module. */
|
|
28
|
+
moduleUrl: string;
|
|
29
|
+
/** GitHub repository slug, e.g. `owner/name`. Used to fetch version history. */
|
|
30
|
+
repo: string;
|
|
31
|
+
/**
|
|
32
|
+
* Latest known version string, e.g. `v1.2.0`.
|
|
33
|
+
* Corresponds to releaseTag in the wire-format PluginEntry; named `version` here
|
|
34
|
+
* because the plugin manager layer speaks versions, not release tags.
|
|
35
|
+
*/
|
|
36
|
+
version: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A single installable version of a registry plugin.
|
|
40
|
+
*/
|
|
41
|
+
export type PluginVersion = {
|
|
42
|
+
/** Version string, e.g. `v1.2.0`. */
|
|
43
|
+
tag: string;
|
|
44
|
+
/** URL to dynamic-import this specific version of the plugin module. */
|
|
45
|
+
moduleUrl: string;
|
|
46
|
+
/** Unix ms of when this version was published (optional; omitted when unknown). */
|
|
47
|
+
releasedAt?: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Abstraction over the plugin registry catalog backend.
|
|
51
|
+
* Implementations may call Edge, a local cache, or a stub.
|
|
52
|
+
*
|
|
53
|
+
* The interface itself is transport-agnostic; concrete implementations live
|
|
54
|
+
* alongside it in this package (see {@link EdgeRegistryPluginProvider}) so we
|
|
55
|
+
* avoid `app-framework ↔ edge-client` cycles, but they only need to satisfy
|
|
56
|
+
* this shape — callers can substitute their own.
|
|
57
|
+
*/
|
|
58
|
+
export interface PluginProvider {
|
|
59
|
+
/**
|
|
60
|
+
* Returns all healthy registry plugins (latest version of each).
|
|
61
|
+
*/
|
|
62
|
+
listPlugins(): Effect.Effect<readonly Plugin[], Error>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns all known versions of a plugin identified by its GitHub repo slug.
|
|
65
|
+
* Until the backend implements a versions endpoint, implementations MUST
|
|
66
|
+
* return at least one entry representing the current/latest release.
|
|
67
|
+
*/
|
|
68
|
+
listVersions(repo: string): Effect.Effect<readonly PluginVersion[], Error>;
|
|
69
|
+
/**
|
|
70
|
+
* Returns a single plugin entry for the given repo.
|
|
71
|
+
* If `version` is omitted, returns the latest.
|
|
72
|
+
* Fails if the specified version is not found.
|
|
73
|
+
*/
|
|
74
|
+
getPlugin(repo: string, version?: string): Effect.Effect<Plugin, Error>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Atomic snapshot of the registry catalog as observed by the host.
|
|
78
|
+
* Exposed via {@link Manager.plugins} so consumers can subscribe reactively
|
|
79
|
+
* (loading state, list contents, last error).
|
|
80
|
+
*/
|
|
81
|
+
export type PluginsState = {
|
|
82
|
+
entries: readonly Plugin[];
|
|
83
|
+
loading: boolean;
|
|
84
|
+
error: Error | null;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Owns the cached registry catalog state and forwards `listVersions` / `getPlugin`
|
|
88
|
+
* calls to the underlying {@link PluginProvider}. Lives on the `PluginManager`
|
|
89
|
+
* (as `manager.pluginRegistry`) so consumers can reach it through the manager
|
|
90
|
+
* without a separate capability lookup.
|
|
91
|
+
*
|
|
92
|
+
* On construction the manager kicks off a background fetch via `provider.listPlugins()`
|
|
93
|
+
* and writes the result into the {@link plugins} atom. Subscribers see `loading: true`
|
|
94
|
+
* during the fetch and `loading: false` once it settles.
|
|
95
|
+
*/
|
|
96
|
+
export declare class Manager {
|
|
97
|
+
#private;
|
|
98
|
+
readonly plugins: Atom.Writable<PluginsState>;
|
|
99
|
+
constructor(provider: PluginProvider | undefined, atomRegistry: AtomRegistry.Registry);
|
|
100
|
+
/** Forwards to the underlying provider. */
|
|
101
|
+
listPlugins(): Effect.Effect<readonly Plugin[], Error>;
|
|
102
|
+
/** Forwards to the underlying provider. */
|
|
103
|
+
listVersions(repo: string): Effect.Effect<readonly PluginVersion[], Error>;
|
|
104
|
+
/** Forwards to the underlying provider. */
|
|
105
|
+
getPlugin(repo: string, version?: string): Effect.Effect<Plugin, Error>;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/core/registry.ts"],"names":[],"mappings":"AAIA,OAAO,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,EAA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