@dxos/app-framework 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8
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 +2 -4
- package/.storybook/preview.mts +2 -2
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/capability-BOPAKKWG.mjs +35 -0
- package/dist/lib/browser/capability-BOPAKKWG.mjs.map +7 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
- package/dist/lib/browser/chunk-5GY3YOEL.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-CO3XLNUX.mjs +95 -0
- package/dist/lib/browser/chunk-CO3XLNUX.mjs.map +7 -0
- package/dist/lib/browser/chunk-DC3WRPBV.mjs +227 -0
- package/dist/lib/browser/chunk-DC3WRPBV.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-HFLKXMT7.mjs +587 -0
- package/dist/lib/browser/chunk-HFLKXMT7.mjs.map +7 -0
- package/dist/lib/browser/chunk-IW44C7UL.mjs +83 -0
- package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-KZUDO43J.mjs +422 -0
- package/dist/lib/browser/chunk-KZUDO43J.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q2GLJTVV.mjs +12 -0
- package/dist/lib/browser/chunk-Q2GLJTVV.mjs.map +7 -0
- package/dist/lib/browser/chunk-SYXIYT6T.mjs +143 -0
- package/dist/lib/browser/chunk-SYXIYT6T.mjs.map +7 -0
- package/dist/lib/browser/chunk-XHS5KDNX.mjs +1471 -0
- package/dist/lib/browser/chunk-XHS5KDNX.mjs.map +7 -0
- package/dist/lib/browser/chunk-Y66ELD4U.mjs +476 -0
- package/dist/lib/browser/chunk-Y66ELD4U.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +74 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/common/activation-events.mjs +20 -0
- package/dist/lib/browser/common/capabilities.mjs +56 -0
- package/dist/lib/browser/core/activation-event.mjs +20 -0
- package/dist/lib/browser/core/capability.mjs +32 -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 +41 -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 +86 -122
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs +132 -0
- package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +316 -47
- 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 +52 -0
- package/dist/lib/browser/ui/index.mjs.map +7 -0
- package/dist/lib/node-esm/capability-KZWRTX7R.mjs +36 -0
- package/dist/lib/node-esm/capability-KZWRTX7R.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-A5CHGAZE.mjs +588 -0
- package/dist/lib/node-esm/chunk-A5CHGAZE.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-COHOWGGJ.mjs +144 -0
- package/dist/lib/node-esm/chunk-COHOWGGJ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs +84 -0
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FPW45EZH.mjs +14 -0
- package/dist/lib/node-esm/chunk-FPW45EZH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FSVGKTF6.mjs +477 -0
- package/dist/lib/node-esm/chunk-FSVGKTF6.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-KFZEB6BV.mjs +29 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NULBHQYS.mjs +96 -0
- package/dist/lib/node-esm/chunk-NULBHQYS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SX5NVETP.mjs +1472 -0
- package/dist/lib/node-esm/chunk-SX5NVETP.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-XGBUKRCK.mjs +423 -0
- package/dist/lib/node-esm/chunk-XGBUKRCK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs +228 -0
- package/dist/lib/node-esm/chunk-XIGPWXCQ.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 +75 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/common/activation-events.mjs +21 -0
- package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
- package/dist/lib/node-esm/common/capabilities.mjs +57 -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 +33 -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 +42 -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 +86 -122
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs +133 -0
- package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +316 -47
- 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 +53 -0
- package/dist/lib/node-esm/ui/index.mjs.map +7 -0
- package/dist/plugin/node-esm/index.mjs +977 -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 +37 -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 +24 -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 +214 -193
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +3 -8
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +7 -7
- 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 +52 -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 +161 -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 +297 -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 +303 -43
- 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 +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/capability.d.ts +7 -0
- package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts +32 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts +2 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts +6 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/types.d.ts +13 -0
- package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts +101 -0
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts +23 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts +2 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts +10 -0
- package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/meta.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +79 -0
- package/dist/types/src/testing/harness.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/operationCapture.d.ts +64 -0
- package/dist/types/src/testing/operationCapture.d.ts.map +1 -0
- 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 +4 -4
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.d.ts +41 -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/{react/Surface.stories.d.ts → ui/components/PluginManager/PluginManagerContext.stories.d.ts} +2 -3
- 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/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
- 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 +4 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/index.d.ts +7 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useApp.d.ts +80 -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/{react → ui/hooks}/useLoading.d.ts +1 -2
- package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +30 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.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/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 +59 -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 +25 -6
- package/package.json +125 -59
- package/src/cli/cli.ts +102 -0
- package/src/{playground/debug → cli}/index.ts +1 -1
- package/src/common/activation-events.ts +39 -0
- package/src/{playground/logger/index.ts → common/annotations.ts} +0 -2
- package/src/common/capabilities.ts +287 -192
- package/src/common/index.ts +3 -8
- package/src/common/translations.ts +17 -9
- package/src/context.ts +9 -0
- package/src/core/{events.ts → activation-event.ts} +10 -7
- package/src/core/capability-manager.test.ts +154 -0
- package/src/core/capability-manager.ts +213 -0
- package/src/core/capability.ts +254 -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 +1929 -0
- package/src/core/plugin-manager.ts +1696 -0
- package/src/core/plugin-manifest.test.ts +75 -0
- package/src/core/plugin-manifest.ts +134 -0
- package/src/core/plugin.ts +449 -48
- package/src/core/registry.ts +163 -0
- package/src/core/url-loader.test.ts +222 -0
- package/src/core/url-loader.ts +388 -0
- package/src/index.ts +2 -2
- package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
- package/src/plugin-process-manager/history/capability.ts +36 -0
- package/src/plugin-process-manager/history/errors.ts +7 -0
- package/src/plugin-process-manager/history/history-tracker.test.ts +353 -0
- package/src/plugin-process-manager/history/history-tracker.ts +144 -0
- package/src/plugin-process-manager/history/index.ts +9 -0
- package/src/plugin-process-manager/history/types.ts +17 -0
- package/src/plugin-process-manager/history/undo-mapping.ts +135 -0
- package/src/plugin-process-manager/history/undo-registry.test.ts +74 -0
- package/src/plugin-process-manager/history/undo-registry.ts +54 -0
- package/src/plugin-process-manager/idb-key-value-store.ts +64 -0
- package/src/plugin-process-manager/index.ts +6 -0
- package/src/plugin-process-manager/meta.ts +16 -0
- package/src/plugin-process-manager/process-manager-capability.ts +178 -0
- package/src/plugin-process-manager/testing.ts +156 -0
- package/src/testing/harness.ts +247 -0
- package/src/testing/index.ts +3 -0
- package/src/testing/operationCapture.ts +144 -0
- package/src/testing/react.test.tsx +50 -0
- package/src/testing/react.tsx +113 -0
- package/src/testing/service.ts +52 -0
- package/src/testing/withPluginManager.stories.tsx +8 -9
- package/src/testing/withPluginManager.tsx +69 -42
- package/src/ui/components/App/App.stories.tsx +84 -0
- package/src/ui/components/App/App.tsx +144 -0
- package/src/{playground/layout → ui/components/App}/index.ts +1 -1
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +179 -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 +290 -0
- package/src/ui/components/index.ts +7 -0
- package/src/ui/hooks/index.ts +10 -0
- package/src/ui/hooks/useApp.test.tsx +161 -0
- package/src/ui/hooks/useApp.tsx +404 -0
- package/src/ui/hooks/useCapabilities.ts +68 -0
- package/src/{react → ui/hooks}/useLoading.tsx +16 -10
- package/src/ui/hooks/useProcessManagerRuntime.ts +78 -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.solid-stories.tsx +198 -0
- package/src/vite-plugin/boot-loader/index.ts +5 -0
- package/src/vite-plugin/boot-loader/loader-app/Loader.tsx +166 -0
- package/src/vite-plugin/boot-loader/loader-app/boot-loader.css +311 -0
- package/src/vite-plugin/boot-loader/loader-app/bridge.ts +25 -0
- package/src/vite-plugin/boot-loader/loader-app/entry.tsx +21 -0
- package/src/vite-plugin/boot-loader/loader-app/mount.tsx +70 -0
- package/src/vite-plugin/boot-loader/loader-app/store.test.ts +137 -0
- package/src/vite-plugin/boot-loader/loader-app/store.ts +149 -0
- package/src/vite-plugin/boot-loader/loader-app/tsconfig.json +11 -0
- package/src/vite-plugin/boot-loader/loader-app/types.ts +78 -0
- package/src/vite-plugin/boot-loader/loader.ts +204 -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 +55 -0
- package/src/vite-plugin/manifest.ts +63 -0
- package/src/vite-plugin/packages.ts +187 -0
- package/tsconfig.json +27 -22
- package/tsconfig.node.json +2 -4
- package/typedoc.json +2 -4
- package/vitest.config.ts +1 -1
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
- package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs +0 -138
- package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +0 -7
- package/dist/lib/browser/chunk-6XKO24JP.mjs +0 -483
- package/dist/lib/browser/chunk-6XKO24JP.mjs.map +0 -7
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
- package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
- package/dist/lib/browser/chunk-WPW5VVAX.mjs +0 -1651
- package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-LZ4AE66E.mjs +0 -11
- package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs +0 -39
- package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +0 -7
- package/dist/lib/browser/react/index.mjs +0 -34
- package/dist/lib/browser/store-CNPHOYTJ.mjs +0 -30
- package/dist/lib/browser/store-CNPHOYTJ.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs +0 -139
- package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3UPX5OIS.mjs +0 -484
- package/dist/lib/node-esm/chunk-3UPX5OIS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs +0 -1653
- package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
- package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-MGOJ3CHD.mjs +0 -12
- package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs +0 -40
- package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +0 -7
- package/dist/lib/node-esm/react/index.mjs +0 -35
- package/dist/lib/node-esm/store-RK5B4XEL.mjs +0 -31
- package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +0 -7
- package/dist/types/src/common/collaboration.d.ts +0 -20
- 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 -279
- package/dist/types/src/common/layout.d.ts.map +0 -1
- package/dist/types/src/common/surface.d.ts +0 -68
- package/dist/types/src/common/surface.d.ts.map +0 -1
- package/dist/types/src/core/capabilities.d.ts +0 -117
- 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 -126
- 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 -11
- 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 -36
- 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 -6
- 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-intent/meta.d.ts +0 -3
- package/dist/types/src/plugin-intent/meta.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 -25
- 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/meta.d.ts +0 -3
- package/dist/types/src/plugin-settings/meta.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 -11
- package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
- package/dist/types/src/react/App.d.ts +0 -10
- package/dist/types/src/react/App.d.ts.map +0 -1
- package/dist/types/src/react/App.stories.d.ts.map +0 -1
- package/dist/types/src/react/DefaultFallback.d.ts +0 -8
- package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
- package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
- 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.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 -9
- package/dist/types/src/react/index.d.ts.map +0 -1
- package/dist/types/src/react/types.d.ts +0 -14
- package/dist/types/src/react/types.d.ts.map +0 -1
- package/dist/types/src/react/useApp.d.ts +0 -44
- package/dist/types/src/react/useApp.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/react/useLoading.d.ts.map +0 -1
- package/src/common/collaboration.ts +0 -18
- package/src/common/events.ts +0 -79
- package/src/common/file.ts +0 -22
- package/src/common/graph.ts +0 -30
- package/src/common/layout.ts +0 -277
- package/src/common/surface.ts +0 -88
- package/src/core/capabilities.test.ts +0 -136
- package/src/core/capabilities.ts +0 -263
- package/src/core/manager.test.ts +0 -516
- package/src/core/manager.ts +0 -604
- package/src/playground/debug/Debug.tsx +0 -39
- package/src/playground/debug/plugin.ts +0 -16
- package/src/playground/generator/Main.tsx +0 -70
- package/src/playground/generator/Toolbar.tsx +0 -47
- package/src/playground/generator/generator.ts +0 -48
- package/src/playground/generator/index.ts +0 -6
- package/src/playground/generator/plugin.ts +0 -22
- package/src/playground/layout/Layout.tsx +0 -33
- package/src/playground/layout/plugin.ts +0 -18
- package/src/playground/logger/Toolbar.tsx +0 -30
- package/src/playground/logger/plugin.ts +0 -41
- package/src/playground/logger/schema.ts +0 -12
- package/src/playground/playground.stories.tsx +0 -46
- package/src/plugin-intent/IntentPlugin.ts +0 -20
- package/src/plugin-intent/actions.ts +0 -31
- package/src/plugin-intent/errors.ts +0 -40
- package/src/plugin-intent/index.ts +0 -9
- package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
- package/src/plugin-intent/intent-dispatcher.ts +0 -342
- package/src/plugin-intent/intent.ts +0 -154
- package/src/plugin-intent/meta.ts +0 -10
- package/src/plugin-settings/SettingsPlugin.ts +0 -34
- package/src/plugin-settings/actions.ts +0 -25
- package/src/plugin-settings/app-graph-builder.ts +0 -160
- package/src/plugin-settings/index.ts +0 -6
- package/src/plugin-settings/intent-resolver.ts +0 -35
- package/src/plugin-settings/meta.ts +0 -10
- package/src/plugin-settings/store.ts +0 -33
- package/src/plugin-settings/translations.ts +0 -19
- package/src/react/App.stories.tsx +0 -33
- package/src/react/App.tsx +0 -59
- package/src/react/DefaultFallback.tsx +0 -26
- package/src/react/ErrorBoundary.tsx +0 -56
- package/src/react/IntentContext.tsx +0 -35
- package/src/react/Surface.stories.tsx +0 -125
- package/src/react/Surface.tsx +0 -109
- package/src/react/common.ts +0 -13
- package/src/react/index.ts +0 -14
- package/src/react/types.ts +0 -38
- package/src/react/useApp.tsx +0 -165
- package/src/react/useCapabilities.ts +0 -31
- package/src/react/useIntentResolver.ts +0 -22
- /package/dist/lib/browser/{intent-dispatcher-LZ4AE66E.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/browser/{react/index.mjs.map → common/activation-events.mjs.map} +0 -0
- /package/dist/lib/{node-esm/intent-dispatcher-MGOJ3CHD.mjs.map → browser/common/capabilities.mjs.map} +0 -0
- /package/dist/lib/{node-esm/react/index.mjs.map → browser/core/activation-event.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/vite-plugin/boot-loader/loader.ts", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/boot-loader.css?raw", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/bridge.ts?raw", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/entry.tsx?raw", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/Loader.tsx?raw", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/mount.tsx?raw", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/store.ts?raw", "raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/types.ts?raw", "../../../src/core/plugin-manifest.ts", "../../../src/vite-plugin/manifest.ts", "../../../src/vite-plugin/packages.ts", "../../../src/vite-plugin/composer/index.ts", "../../../src/vite-plugin/import-map/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\n// @ts-ignore — @types/babel__core present transitively but not declared here.\nimport * as babel from '@babel/core';\n// @ts-ignore — @babel/preset-typescript ships no .d.ts.\nimport babelPresetTypeScript from '@babel/preset-typescript';\n// @ts-ignore — babel-preset-solid ships no .d.ts.\nimport babelPresetSolid from 'babel-preset-solid';\nimport { build, type Plugin as EsbuildPlugin } from 'esbuild';\nimport { basename, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { type Plugin } from 'vite';\n\nimport css from './loader-app/boot-loader.css?raw';\n// The loader-app Solid sources are inlined as raw text (never parsed by\n// dx-compile — app-framework is a React package, so its build can't compile\n// Solid JSX). They are compiled to a self-contained browser IIFE at the\n// consuming app's build time by {@link compileLoaderBundle} below.\nimport bridgeSrc from './loader-app/bridge.ts?raw';\nimport entrySrc from './loader-app/entry.tsx?raw';\nimport loaderSrc from './loader-app/Loader.tsx?raw';\nimport mountSrc from './loader-app/mount.tsx?raw';\nimport storeSrc from './loader-app/store.ts?raw';\nimport typesSrc from './loader-app/types.ts?raw';\n\n/**\n * Options for {@link bootLoaderPlugin}.\n */\nexport type BootLoaderOptions = {\n /**\n * Initial status text rendered by the loader (replaced via\n * `window.__bootLoader.status(...)` once the host starts firing phase callbacks).\n */\n status?: string;\n\n /**\n * Inline SVG markup for an optional brand mark rendered inside the progress\n * ring. The mark renders at full opacity with whatever fills the SVG declares,\n * so pass a colour-palette logo for the strongest visual identity. SVGs that\n * use `fill=\"currentColor\"` still inherit the loader's `prefers-color-scheme`\n * text colour. Leave empty/undefined to render only the ring.\n */\n markSvg?: string;\n\n /**\n * HTML entry filenames to inject the loader into. Defaults to `index.html` only\n * so auxiliary pages (`recovery.html`, `reset.html`, etc.) stay unobstructed.\n */\n include?: string[];\n};\n\nconst VIRTUAL_NS = 'boot-loader-app';\n\n// Relative-import graph of the loader-app, keyed by module name (no extension).\n// `tsx` modules carry JSX (compiled via `babel-preset-solid`); `ts` modules are\n// type-stripped only. `solid-js` imports introduced by the Solid transform\n// resolve from `node_modules` against `resolveDir`.\nconst MODULES: Record<string, { contents: string; tsx: boolean }> = {\n entry: { contents: entrySrc, tsx: true },\n mount: { contents: mountSrc, tsx: true },\n Loader: { contents: loaderSrc, tsx: true },\n bridge: { contents: bridgeSrc, tsx: false },\n store: { contents: storeSrc, tsx: false },\n types: { contents: typesSrc, tsx: false },\n};\n\n// Walk up from the compiled plugin to find a `node_modules` containing\n// `solid-js` (a dependency of this package). Used as esbuild's `resolveDir`.\nconst resolveDir = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Compile the loader-app from its inlined raw sources into a single\n * self-contained IIFE (Solid runtime bundled in) suitable for inlining into\n * `index.html`. Mirrors dx-compile's Solid pipeline: `@babel/preset-typescript`\n * strips types, then `babel-preset-solid` compiles JSX into reactive primitives.\n */\nconst compileLoaderBundle = async (): Promise<string> => {\n const virtualSolid = (): EsbuildPlugin => ({\n name: 'boot-loader-app-virtual',\n setup: (esbuild) => {\n esbuild.onResolve({ filter: /^\\.\\// }, (args) => {\n const name = args.path.replace(/^\\.\\//, '').replace(/\\.(tsx?|jsx?)$/, '');\n return name in MODULES ? { path: name, namespace: VIRTUAL_NS } : undefined;\n });\n\n esbuild.onLoad({ filter: /.*/, namespace: VIRTUAL_NS }, async (args) => {\n const module = MODULES[args.path];\n const result = await babel.transformAsync(module.contents, {\n filename: `${args.path}.${module.tsx ? 'tsx' : 'ts'}`,\n babelrc: false,\n configFile: false,\n // Presets run last-to-first: TS strips first, then Solid sees plain JSX.\n presets: [\n [babelPresetSolid, { generate: 'dom', hydratable: false }],\n [babelPresetTypeScript, { allowDeclareFields: true }],\n ],\n });\n if (!result?.code) {\n throw new Error(`babel-preset-solid returned no code for ${args.path}`);\n }\n return { contents: result.code, loader: 'js', resolveDir };\n });\n },\n });\n\n const result = await build({\n stdin: { contents: \"import './entry';\", loader: 'ts', resolveDir, sourcefile: 'boot-loader-entry.ts' },\n bundle: true,\n format: 'iife',\n platform: 'browser',\n target: 'es2020',\n minify: true,\n write: false,\n legalComments: 'none',\n define: { 'process.env.NODE_ENV': '\"production\"' },\n plugins: [virtualSolid()],\n });\n\n return result.outputFiles[0].text;\n};\n\nlet bundlePromise: Promise<string> | undefined;\nconst getLoaderBundle = (): Promise<string> => (bundlePromise ??= compileLoaderBundle());\n\n/**\n * Vite plugin that injects a Solid \"boot loader\" app into the host app's\n * `index.html`.\n *\n * The full-screen backdrop paints on the very first frame from an inline\n * `<style>` (before any JS bundle is fetched), so the user sees the loading\n * surface immediately on cold load instead of a blank document. A compiled,\n * self-contained Solid IIFE — inlined ahead of the app bundle — then renders\n * the determinate progress ring + status log into that backdrop and exposes the\n * host-facing driver on `window.__bootLoader`.\n *\n * The host app drives the loader (the React relay forwards `useApp`'s startup\n * progress):\n * - `window.__bootLoader.status(payload)` updates the status line per phase.\n * - `window.__bootLoader.progress(fraction)` grows the determinate ring (0–1).\n * - `window.__bootLoader.ready()` plays the dismissal outro, then self-removes.\n * - `window.__bootLoader.dismiss()` removes the loader immediately (fast path).\n *\n * Inject order (all at the start of `<body>`, except the stylesheet):\n * - `<style>` → `<head>` (parses before any bundled stylesheet).\n * - `<div id=\"boot-loader\">` → the static backdrop the CSS styles instantly.\n * - inline `<script>` config (`window.__BOOT_LOADER_CONFIG__`) → before the bundle.\n * - inline `<script>` loader bundle → renders the Solid app into the backdrop.\n *\n * Keeping the loader a sibling of `#root` (rather than a child) means\n * `createRoot(document.getElementById('root')).render(...)` does not fight the\n * loader for ownership; the framework explicitly dismisses after the first\n * React commit for a deterministic handoff.\n *\n * Color tokens are exposed as CSS custom properties (`--boot-loader-bg-light`,\n * etc.) in `boot-loader.css`, so consumers can override them at the document\n * level without re-parameterizing this plugin.\n */\nexport const bootLoaderPlugin = ({ status, markSvg, include = ['index.html'] }: BootLoaderOptions = {}): Plugin => {\n return {\n name: 'app-framework:boot-loader',\n async transformIndexHtml(_html, ctx) {\n const filename = basename(ctx.filename ?? 'index.html');\n if (!include.includes(filename)) {\n return;\n }\n\n const bundle = await getLoaderBundle();\n // Authoritative backdrop id: injected here, passed to the bundle via\n // config (so `entry.tsx` reads it), and mirrored by the CSS selector in\n // `boot-loader.css`. The inner DOM ↔ CSS contract is guarded by the story.\n const rootId = 'boot-loader';\n return [\n {\n tag: 'style',\n injectTo: 'head',\n children: css,\n },\n {\n tag: 'div',\n injectTo: 'body-prepend',\n attrs: {\n id: rootId,\n role: 'status',\n 'aria-live': 'polite',\n 'aria-label': 'Initializing',\n },\n children: '',\n },\n {\n tag: 'script',\n injectTo: 'body-prepend',\n children: `window.__BOOT_LOADER_CONFIG__=${JSON.stringify({ rootId, markSvg, status })};`,\n },\n {\n tag: 'script',\n injectTo: 'body-prepend',\n children: bundle,\n },\n ];\n },\n };\n};\n", "/*\n * Boot loader stylesheet \u2014 injected into the host's `<head>` by `bootLoaderPlugin`\n * so the full-screen backdrop paints before any JS bundle is fetched. The Solid\n * `Loader` renders the ring + status into the `#boot-loader` backdrop; this\n * sheet styles both. Class/id names here form a contract with `Loader.tsx`,\n * guarded by `BootLoader.solid-stories.tsx` (it mounts the real component).\n */\n\nbody {\n margin: 0;\n overflow: hidden;\n}\n\n/*\n * Defaults match `@dxos/ui-theme`'s `--color-base-surface`, which resolves to\n * Tailwind's `neutral-50` / `neutral-950` in light / dark mode respectively\n * (see `packages/ui/ui-theme/src/css/theme/semantic.css`). Hosts can override\n * with the `--boot-loader-bg-*` / `--boot-loader-fg-*` custom properties on\n * `:root` if they need a different palette. Keeping the boot loader's\n * background identical to the app's `body` eliminates the flash on handoff\n * to the rendered React shell.\n */\n#boot-loader {\n --color-composer-100: rgb(5 40 61);\n --color-composer-200: rgb(10 75 105);\n --color-composer-300: rgb(1 122 183);\n --color-composer-400: rgb(6 197 253);\n\n /*\n * Caps the disc / mark at the design pixel sizes on roomy viewports while\n * shrinking proportionally on narrow ones (`vmin` follows the smaller of\n * width / height) so neither the ring nor the mark crops on phones.\n */\n --boot-loader-disc-size: min(384px, 80vmin);\n /*\n * Match the React `Placeholder`'s logo box (`h-[300px] w-[300px]` at the\n * `stage >= 1` keyframe) so the brand mark doesn't visibly jump size when\n * the loader hands off \u2014 the responsive cap keeps the same 300/384 ratio\n * (\u224878%) at any viewport width.\n */\n --boot-loader-mark-size: min(300px, 62.5vmin);\n --boot-loader-status-gap: 32px;\n\n position: fixed;\n inset: 0;\n z-index: 10;\n font-size: 13px;\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n sans-serif;\n /*\n * Dismissal outro \u2014 `mountLoader` toggles `data-dismissing` on this element\n * when the host calls `__bootLoader.ready()`; the loader cross-fades out over\n * the real app shell rendering beneath it, and removes itself once this\n * opacity transition completes (a fallback timer covers reduced-motion).\n */\n transition: opacity 500ms ease-out;\n}\n\n#boot-loader {\n background: var(--boot-loader-bg-light, #fafafa);\n color: var(--boot-loader-fg-light, #0a0a0a);\n --boot-loader-accent: var(--boot-loader-accent-light, var(--color-composer-200));\n}\n\n@media (prefers-color-scheme: dark) {\n #boot-loader {\n background: var(--boot-loader-bg-dark, #0a0a0a);\n color: var(--boot-loader-fg-dark, #f0f0f0);\n --boot-loader-accent: var(--boot-loader-accent-dark, var(--color-composer-300));\n }\n}\n\n#boot-loader[data-dismissing] {\n opacity: 0;\n}\n\n/* Gently shrink the disc + mark as the loader fades, echoing the prior handoff. */\n#boot-loader[data-dismissing] #boot-loader-disc {\n transform: translate(-50%, -50%) scale(0.92);\n transition: transform 500ms ease-out;\n}\n\n/*\n * Stack the ring (the SVG `#boot-loader-ring`) and the brand mark in the same\n * grid cell so the mark sits centered inside the circle.\n */\n#boot-loader-disc {\n position: absolute;\n top: 50%;\n left: 50%;\n display: grid;\n place-items: center;\n width: var(--boot-loader-disc-size);\n height: var(--boot-loader-disc-size);\n transform: translate(-50%, -50%);\n}\n\n#boot-loader-disc > * {\n grid-column: 1;\n grid-row: 1;\n}\n\n/*\n * Default to grayscale so the mark reads as a quiet monochrome silhouette\n * before any host-driven progress lands; the brand palette swaps in once\n * `Loader.tsx` sets `data-host-driven` on the disc (the first\n * `__bootLoader.progress()` call). Hover keeps a parallel reveal affordance\n * for inspection in the storybook. The 1000ms ease lets the grayscale \u2192 color\n * transition play through the activation phase rather than snapping.\n */\n#boot-loader-mark {\n width: var(--boot-loader-mark-size);\n height: var(--boot-loader-mark-size);\n display: flex;\n align-items: center;\n justify-content: center;\n filter: grayscale(100%);\n transition: filter 1000ms ease-out;\n}\n\n/*\n * `grayscale(0%)` (identity) rather than `none` \u2014 `filter: none` changes\n * the filter function list and most engines treat that as a discrete\n * transition (snap, not ease). Keeping `grayscale(...)` on both sides of\n * the rule lets the browser interpolate the percentage smoothly.\n */\n#boot-loader-disc[data-host-driven] #boot-loader-mark,\n#boot-loader-mark:hover {\n filter: grayscale(0%);\n}\n\n#boot-loader-mark svg {\n width: 100%;\n height: 100%;\n /*\n * The host SVG carries its own brand-palette fills, so we don't apply a\n * `color` cascade here. SVGs that intentionally use `fill=\"currentColor\"`\n * still pick up the loader's text colour via `#boot-loader`'s `color`.\n */\n}\n\n/*\n * Circular determinate progress \u2014 a single SVG `<path>` arc that sweeps\n * anticlockwise from 12 o'clock, its angle growing with progress (the `d` is\n * recomputed by the component each tick). There is no static track;\n * `stroke-linecap: round` rounds the trailing edge, and `marker-end` paints the\n * leading-edge dot. Stroke width is in viewBox units so it scales with the disc.\n */\n#boot-loader-ring {\n width: var(--boot-loader-disc-size);\n height: var(--boot-loader-disc-size);\n overflow: visible;\n /*\n * Fade the arc linearly from the head (the marker, fully opaque) back to the\n * tail (12 o'clock, transparent). A conic-gradient mask does this along the\n * curve \u2014 `Loader.tsx` writes the eased progress into `--boot-loader-arc`\n * (0\u2013100), and the arc occupies the conic range `(100 - arc)%`\u2026`100%`, so the\n * head sits at `(100 - arc)%` (opaque) and the tail at `100%` (transparent).\n * NOTE: We start at -1.16deg so that we don't mask the marker.\n */\n --boot-loader-arc: 0;\n mask: conic-gradient(\n from -1.16deg at 50% 50%,\n transparent 0,\n transparent calc((100 - var(--boot-loader-arc)) * 1%),\n #000 calc((100 - var(--boot-loader-arc)) * 1%),\n transparent 100%\n );\n -webkit-mask: conic-gradient(\n from -1.16deg at 50% 50%,\n transparent 0,\n transparent calc((100 - var(--boot-loader-arc)) * 1%),\n #000 calc((100 - var(--boot-loader-arc)) * 1%),\n transparent 100%\n );\n}\n\n/*\n * The leading-edge dot's layer \u2014 same geometry as `#boot-loader-ring` but with no\n * mask, so the dot renders as a full circle (the ring's conic fade mask would\n * otherwise bisect it where it sits on the mask's transparent\u2192opaque edge).\n */\n#boot-loader-ring-head {\n width: var(--boot-loader-disc-size);\n height: var(--boot-loader-disc-size);\n overflow: visible;\n}\n\n.boot-loader-ring-progress {\n fill: none;\n stroke: var(--boot-loader-accent);\n /* viewBox units: ~1.9px on the 384px disc, scaling down on smaller viewports. */\n stroke-width: 0.5;\n opacity: 0.5;\n stroke-linecap: butt;\n overflow: visible;\n /* Dashed line: dash + gap lengths in viewBox units (~2 units \u2248 7.7px @384px). */\n /* stroke-dasharray: 2 1; */\n}\n\n/* The `marker-end` dot at the arc's leading edge. */\n.boot-loader-ring-marker {\n fill: var(--boot-loader-accent);\n stroke: none;\n overflow: visible;\n /* opacity: 0.5; */\n}\n\n#boot-loader-status {\n position: absolute;\n top: 50%;\n left: 0;\n right: 0;\n /* \n * Sit just below the centered disc \u2014 half the disc plus the configured gap.\n */\n transform: translate(0, calc(var(--boot-loader-disc-size) / 2 + var(--boot-loader-status-gap)));\n /*\n * Slightly de-emphasised vs body text so the brand mark + ring stay the\n * dominant focus, but high enough to remain legible on both light and dark\n * backgrounds without a custom palette.\n */\n opacity: 0.5;\n /*\n * Terminal-style log viewport (3 rows at the default `line-height`) over\n * a vertically-stacked track of every status the driver has emitted. The\n * track is bottom-anchored via `justify-content: flex-end` so the newest\n * line always sits on the last visible row, older lines stack above it,\n * and anything that doesn't fit is clipped at the top by\n * `overflow: hidden`. The driver runs a FLIP-style transform animation\n * per append so each new line slides up from below the bottom edge \u2014\n * independent of any `scroll-behavior` smooth-scroll support, which\n * Playwright/headless Chrome strips even from spec-compliant\n * `scrollTo({ behavior: 'smooth' })` calls.\n */\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n height: 4.5em;\n line-height: 1.5;\n letter-spacing: 0.01em;\n /* \n * Fixed-width digits so the `(i/n)` counter on range-bearing status\n * updates (\"Loading plugins (12/80)\") doesn't jitter as the index\n * ticks through different glyph widths. \n */\n font-variant-numeric: tabular-nums;\n text-align: center;\n overflow: hidden;\n}\n\n#boot-loader-status-fade {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 32px;\n background: linear-gradient(to bottom, var(--boot-loader-bg-light, #fafafa), transparent);\n z-index: 1;\n}\n@media (prefers-color-scheme: dark) {\n #boot-loader-status-fade {\n background: linear-gradient(to bottom, var(--boot-loader-bg-dark, #0a0a0a), transparent);\n }\n}\n\n#boot-loader-rss {\n background: var(--boot-loader-bg-light, #fafafa);\n text-wrap: balance;\n}\n@media (prefers-color-scheme: dark) {\n #boot-loader-rss {\n background: var(--boot-loader-bg-dark, #0a0a0a);\n }\n}\n\n/*\n * Track of every appended `.boot-loader-status-line`.\n */\n#boot-loader-status-track {\n display: flex;\n flex-direction: column;\n /*\n * Resting transform is `translateY(0)` \u2014 the bottom-anchored flex parent\n * already positions the newest line on the last visible row. On each append\n * `Loader.tsx` runs a one-shot FLIP: snap to `translateY(<lineHeight>px)` with\n * no transition (placing the new line just below the viewport), force a\n * reflow, then animate back to 0 so the track rises by one line-height and the\n * new entry slides up into the bottom row.\n */\n transform: translateY(0);\n transition: transform 500ms ease-out;\n}\n\n/* Honour reduced-motion preferences explicitly \u2014 `transition` doesn't auto-respect it. */\n@media (prefers-reduced-motion: reduce) {\n #boot-loader-status-track {\n transition: none;\n }\n}\n\n.boot-loader-status-line {\n flex: 0 0 auto;\n height: 1.5em;\n white-space: nowrap;\n}\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type LoaderStore } from './store';\nimport { type BootLoaderApi } from './types';\n\n/**\n * Wrap a reactive {@link LoaderStore} as the imperative `window.__bootLoader`\n * facade the host app drives. `status` / `progress` write into the store;\n * `ready` plays the graceful dismissal outro; `dismiss` is the immediate-remove\n * backstop for the fast-load path (and a no-op once an outro is already in\n * flight, so a late `dismiss()` from the framework never cuts the animation).\n */\nexport const createBridge = (store: LoaderStore, dismissNow: () => void): BootLoaderApi => ({\n status: (payload) => store.pushStatus(payload),\n progress: (fraction) => store.setProgress(fraction),\n ready: () => store.ready(),\n dismiss: () => {\n if (store.phase() === 'dismissing') {\n return;\n }\n dismissNow();\n },\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { mountLoader } from './mount';\nimport { DEFAULT_ROOT_ID } from './types';\n\n//\n// Production entry \u2014 bundled to a self-contained IIFE by `bootLoaderPlugin` and\n// inlined into `index.html` ahead of the app bundle. Mounts the loader into the\n// static backdrop using the config the plugin baked in just before this script\n// (including the backdrop id, so the id has a single source). The storybook\n// does NOT use this entry; it imports `mountLoader` directly so Vite compiles\n// the Solid source with HMR.\n//\n\nconst config = window.__BOOT_LOADER_CONFIG__ ?? {};\nconst el = document.getElementById(config.rootId ?? DEFAULT_ROOT_ID);\nif (el) {\n mountLoader(el, config);\n}\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Component, For, createEffect, createSignal, onCleanup, onMount } from 'solid-js';\n\nimport { type LoaderStore } from './store';\n\n// Ring geometry in the SVG's `0 0 100 100` viewBox. The radius leaves a couple\n// of units of padding so the stroke, its round cap, and the end marker aren't\n// clipped at the viewBox edge.\nconst RING_RADIUS = 48;\nconst RING_CENTER = 50;\n// Leading-edge marker: a small dot drawn at the arc's head in an unmasked layer.\nconst MARKER_RADIUS = 1; // viewBox units \u2192 ~3.8px on the 384px disc\n\n/**\n * Read an element's *current animated* translateY (px) from its live transform\n * matrix \u2014 the interpolated value mid-transition, not the last-written property.\n * Used by the status FLIP so successive appends chain off the in-flight position\n * instead of yanking the track back to a fixed invert target.\n */\nconst readTranslateY = (element: HTMLElement): number => {\n const computed = getComputedStyle(element).transform;\n if (!computed || computed === 'none') {\n return 0;\n }\n const match = computed.match(/matrix.*\\(([^)]+)\\)/);\n if (!match) {\n return 0;\n }\n const values = match[1].split(',');\n // 2D `matrix(a, b, c, d, tx, ty)` \u2192 ty at index 5; 3D `matrix3d(...)` \u2192 ty at 13.\n if (values.length === 6) {\n return Number.parseFloat(values[5]) || 0;\n }\n if (values.length === 16) {\n return Number.parseFloat(values[13]) || 0;\n }\n return 0;\n};\n\nexport type LoaderProps = {\n /** Reactive source of truth for progress, status lines, and lifecycle phase. */\n store: LoaderStore;\n /** Inline SVG markup for the brand mark rendered inside the ring. */\n markSvg?: string;\n};\n\n/**\n * The boot loader, authored as a single Solid component \u2014 the one source of\n * truth for the loader DOM. `bootLoaderPlugin` bundles this (Solid runtime\n * inlined) into `index.html`; the storybook mounts the very same component, so\n * the two can no longer drift. The DOM structure, ids, and classes mirror\n * `boot-loader.css`.\n *\n * The full-screen backdrop (`#boot-loader`) is injected as static markup so it\n * paints from CSS before this bundle executes; this component renders the disc\n * and status log *into* that backdrop. The dismissal outro (fading `#boot-loader`)\n * and its teardown are owned by {@link mountLoader}, which has the host element.\n */\nexport const Loader: Component<LoaderProps> = (props) => {\n let trackRef: HTMLDivElement | undefined;\n let previousCount = props.store.lines().length;\n\n // FLIP-style slide on each appended line: snap the track down by one\n // line-height (chained off any in-flight translate) with no transition, force\n // a reflow, then animate back to translateY(0) so the new entry rises from\n // below the bottom-anchored viewport. Range ticks (length unchanged) skip it.\n createEffect(() => {\n const count = props.store.lines().length;\n const track = trackRef;\n if (track && count > previousCount) {\n const currentY = readTranslateY(track);\n const lineHeight = track.lastElementChild?.getBoundingClientRect().height ?? 0;\n track.style.transition = 'none';\n track.style.transform = `translateY(${currentY + lineHeight}px)`;\n void track.offsetHeight;\n track.style.transition = '';\n track.style.transform = 'translateY(0)';\n }\n previousCount = count;\n });\n\n // Eased display progress. A `<path>`'s `d` can't be CSS-transitioned, so the\n // arc would snap on every store tick; instead we ease a displayed value toward\n // the store's progress with a requestAnimationFrame loop (~per-frame lerp) and\n // recompute the path each frame. This restores the compositor-smooth growth\n // the old `transition: stroke-dashoffset` gave, while keeping the path +\n // `marker-end` (the marker rides the arc's recomputed end automatically).\n const [shown, setShown] = createSignal(props.store.progress());\n let raf: number | undefined;\n const animate = () => {\n const target = props.store.progress();\n const current = shown();\n // Snap when within a hair to settle; otherwise lerp ~18% of the gap/frame.\n const next = Math.abs(target - current) < 0.05 ? target : current + (target - current) * 0.18;\n if (next !== current) {\n setShown(next);\n }\n raf = requestAnimationFrame(animate);\n };\n\n onMount(() => {\n raf = requestAnimationFrame(animate);\n });\n\n onCleanup(() => {\n if (raf != null) {\n cancelAnimationFrame(raf);\n }\n });\n\n // Determinate ring as an SVG `<path>` arc: an anticlockwise sweep starting at\n // 12 o'clock whose angle grows with the eased `shown()` progress. The sweep is\n // capped just shy of a full turn so the single arc command never degenerates at\n // 100%. The leading-edge dot is its `head` point, rendered separately (below) in\n // an *unmasked* layer \u2014 drawing it via `marker-end` on this path would put it\n // under the ring's conic fade mask, whose hard edge bisects the dot into a\n // half-circle.\n const arc = () => {\n const fraction = Math.min(shown() / 100, 0.9999);\n const sweep = fraction * 2 * Math.PI;\n const start = -Math.PI / 2; // 12 o'clock\n const end = start - sweep; // anticlockwise (decreasing angle)\n const x0 = RING_CENTER + RING_RADIUS * Math.cos(start);\n const y0 = RING_CENTER + RING_RADIUS * Math.sin(start);\n const headX = RING_CENTER + RING_RADIUS * Math.cos(end);\n const headY = RING_CENTER + RING_RADIUS * Math.sin(end);\n const largeArc = sweep > Math.PI ? 1 : 0;\n // sweep-flag 0 = anticlockwise (negative-angle) direction.\n return { d: `M ${x0} ${y0} A ${RING_RADIUS} ${RING_RADIUS} 0 ${largeArc} 0 ${headX} ${headY}`, headX, headY };\n };\n\n // Once host-driven, the brand mark eases grayscale \u2192 colour and stays there.\n const isHostDriven = () => props.store.phase() !== 'creep';\n\n return (\n <>\n <div id='boot-loader-disc' data-host-driven={isHostDriven() ? '' : undefined}>\n <svg\n id='boot-loader-ring'\n viewBox='0 0 100 100'\n aria-hidden='true'\n style={{ '--boot-loader-arc': String(shown()) }}\n >\n {shown() > 0 ? <path class='boot-loader-ring-progress' d={arc().d} /> : null}\n </svg>\n {/* Leading-edge dot in its own unmasked layer (see `arc()`), so the ring's fade mask\n never clips it. Stacked over `#boot-loader-ring` via the disc grid. */}\n {shown() > 0 ? (\n <svg id='boot-loader-ring-head' viewBox='0 0 100 100' aria-hidden='true'>\n <circle class='boot-loader-ring-marker' cx={arc().headX} cy={arc().headY} r={MARKER_RADIUS} />\n </svg>\n ) : null}\n {props.markSvg ? <div id='boot-loader-mark' innerHTML={props.markSvg} /> : null}\n </div>\n <div id='boot-loader-status'>\n <div id='boot-loader-status-fade' />\n <div id='boot-loader-status-track' ref={trackRef}>\n <For each={props.store.lines()}>{(line) => <div class='boot-loader-status-line'>{line.text}</div>}</For>\n </div>\n </div>\n </>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createEffect } from 'solid-js';\nimport { render } from 'solid-js/web';\n\nimport { createBridge } from './bridge';\nimport { Loader } from './Loader';\nimport { createLoaderStore } from './store';\nimport { type BootLoaderConfig } from './types';\n\n/** Fallback teardown if the outro's `transitionend` never fires (e.g. no opacity transition). */\nconst OUTRO_FALLBACK_MS = 800;\n\n/**\n * Mount the boot loader into a host element (`#boot-loader`, the static backdrop\n * the plugin injects \u2014 or any container in the storybook) and install the\n * `window.__bootLoader` facade. Renders the disc + status into the host, toggles\n * `data-dismissing` on it for the outro, and removes everything once the outro\n * completes.\n *\n * Returns a disposer that tears the loader down immediately (idempotent).\n */\nexport const mountLoader = (el: HTMLElement, config: BootLoaderConfig = {}): (() => void) => {\n const store = createLoaderStore(config.status);\n\n let removed = false;\n // Forward-declared so `remove` can dispose the Solid render created below.\n let disposeRender: (() => void) | undefined;\n\n const remove = (): void => {\n if (removed) {\n return;\n }\n removed = true;\n el.removeEventListener('transitionend', handleTransitionEnd);\n store.dispose();\n disposeRender?.();\n el.remove();\n if (window.__bootLoader === api) {\n delete window.__bootLoader;\n }\n };\n\n const handleTransitionEnd = (event: TransitionEvent): void => {\n if (event.propertyName === 'opacity' && store.phase() === 'dismissing') {\n remove();\n }\n };\n el.addEventListener('transitionend', handleTransitionEnd);\n\n disposeRender = render(() => {\n // Drive the backdrop's outro from the host element (Solid owns the host's\n // children; the host attribute is toggled imperatively within this owner).\n createEffect(() => {\n const dismissing = store.phase() === 'dismissing';\n el.toggleAttribute('data-dismissing', dismissing);\n if (dismissing) {\n setTimeout(remove, OUTRO_FALLBACK_MS);\n }\n });\n return <Loader store={store} markSvg={config.markSvg} />;\n }, el);\n\n const api = createBridge(store, remove);\n window.__bootLoader = api;\n\n return remove;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Accessor, createSignal } from 'solid-js';\n\nimport { type StatusPayload } from './types';\n\n//\n// Creep tuning. The ring auto-creeps toward a moving ceiling so a long\n// activation silence never reads as a frozen disc. See the original\n// hand-written driver for the rationale behind each constant.\n//\n\n/** Creep timer cadence, in milliseconds. */\nexport const CREEP_TICK_MS = 100;\n/** State-1 ease rate \u2014 a gentle \"we're alive\" hint before real progress lands. */\nexport const STATE_1_RATE = 0.05;\n/** State-1 asymptote (percent) the creep eases toward before host progress. */\nexport const STATE_1_ASYMPTOTE = 40;\n/** State-2 ease rate \u2014 bridges the gap between sparse host `progress()` calls. */\nexport const STATE_2_RATE = 0.05;\n/** State-2 lead (percent) the ceiling sits ahead of the last host value. */\nexport const STATE_2_BUMP = 15;\n/** Hard ceiling the auto-creep never crosses (host must drive the rest). */\nexport const ABSOLUTE_CEILING = 90;\n\n/** Loader lifecycle phase. */\nexport type Phase = 'creep' | 'host' | 'dismissing';\n\n/** A single rendered status line; `id` keys the `<For>` and survives in-place range ticks. */\nexport type StatusLine = {\n id: number;\n text: string;\n event?: string;\n module?: string;\n};\n\n/**\n * Asymptotic ease \u2014 `next = raw + (ceiling - raw) * rate`, clamped so it never\n * overshoots (or regresses past) the ceiling. Pure; unit-tested.\n */\nexport const easeToward = (raw: number, ceiling: number, rate: number): number =>\n raw >= ceiling - 0.1 ? raw : raw + (ceiling - raw) * rate;\n\n/**\n * Clamp a host-supplied fraction to a percent in [0, 100]. Invalid / negative /\n * non-finite values collapse to 0 rather than poisoning the CSS var. Pure;\n * unit-tested.\n */\nexport const clampPercent = (fraction?: number): number =>\n typeof fraction !== 'number' || !Number.isFinite(fraction) || fraction < 0 ? 0 : Math.min(1, fraction) * 100;\n\n/** Display text for a payload \u2014 appends the `(index/total)` suffix when a range is present. */\nexport const displayText = (payload: StatusPayload): string =>\n payload.range ? `${payload.humanized} (${payload.range.index}/${payload.range.total})` : payload.humanized;\n\n/**\n * Reactive loader store \u2014 owns the progress percent, the status-line log, and\n * the lifecycle phase, plus the auto-creep timer. All DOM-free, so the creep\n * math and status reduction are testable as plain functions; `Loader.tsx` binds\n * the accessors to the DOM and `bridge.ts` wraps the mutators as the imperative\n * `window.__bootLoader` facade.\n */\nexport type LoaderStore = {\n /** Progress as a percent in [0, 100] (the CSS `--boot-loader-bar-progress` value). */\n progress: Accessor<number>;\n /** Appended status lines, newest last. */\n lines: Accessor<StatusLine[]>;\n /** Current lifecycle phase. */\n phase: Accessor<Phase>;\n /** Apply a status update (append, or replace-in-place for range ticks). */\n pushStatus: (payload: StatusPayload) => void;\n /** Enter host-driven progress with `fraction` \u2208 [0, 1]; never regresses. */\n setProgress: (fraction?: number) => void;\n /** Snap to 100%, stop the creep, and enter the dismissing phase. */\n ready: () => void;\n /** Stop the creep timer (call on teardown). */\n dispose: () => void;\n};\n\nexport const createLoaderStore = (initialStatus?: string): LoaderStore => {\n const [progress, setProgressPct] = createSignal(0);\n const [lines, setLines] = createSignal<StatusLine[]>(initialStatus ? [{ id: 0, text: initialStatus }] : []);\n const [phase, setPhase] = createSignal<Phase>('creep');\n\n let creepCeiling = STATE_1_ASYMPTOTE;\n let creepRate = STATE_1_RATE;\n let nextId = initialStatus ? 1 : 0;\n let timer: ReturnType<typeof setInterval> | null = null;\n\n const startCreep = (): void => {\n if (timer == null) {\n timer = setInterval(() => setProgressPct((raw) => easeToward(raw, creepCeiling, creepRate)), CREEP_TICK_MS);\n }\n };\n\n const stopCreep = (): void => {\n if (timer != null) {\n clearInterval(timer);\n timer = null;\n }\n };\n\n const pushStatus = (payload: StatusPayload): void => {\n const text = displayText(payload);\n setLines((current) => {\n const previous = current.at(-1);\n // Dedup back-to-back identical transitions (same text + structured fields).\n if (\n previous &&\n previous.text === text &&\n (previous.event ?? null) === (payload.event ?? null) &&\n (previous.module ?? null) === (payload.module ?? null)\n ) {\n return current;\n }\n // Range tick \u2014 replace the current line in place rather than appending,\n // so a counted phase produces one entry with an updating suffix.\n if (payload.range && previous) {\n return [...current.slice(0, -1), { ...previous, text }];\n }\n return [...current, { id: nextId++, text, event: payload.event, module: payload.module }];\n });\n };\n\n const setProgress = (fraction?: number): void => {\n setPhase('host');\n const pct = clampPercent(fraction);\n // The ring never regresses: hold the current value if the host reports lower.\n setProgressPct((current) => Math.max(current, pct));\n // Switch the creep to its state-2 cadence and lead the host value by a bump.\n creepRate = STATE_2_RATE;\n creepCeiling = Math.min(Math.max(creepCeiling, pct + STATE_2_BUMP), ABSOLUTE_CEILING);\n startCreep();\n };\n\n const ready = (): void => {\n stopCreep();\n setProgressPct(100);\n setPhase('dismissing');\n };\n\n const dispose = (): void => stopCreep();\n\n startCreep();\n\n return { progress, lines, phase, pushStatus, setProgress, ready, dispose };\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n/**\n * Status payload accepted by `window.__bootLoader.status(...)`. The caller owns\n * formatting \u2014 `humanized` is the exact text rendered \u2014 while `event` / `module`\n * carry the structured activation ids for the boot trace, and `range` drives an\n * in-place `(index/total)` counter for long counted phases.\n */\nexport type StatusPayload = {\n /**\n * Raw activation event key (e.g. `dxos.org/plugin/observability/activate`)\n * when the transition is event-level.\n */\n event?: string;\n\n /**\n * Raw module id (e.g. `org.dxos.plugin.observability.module.ReactSurface`)\n * when the transition is module-level.\n */\n module?: string;\n\n /** Exact text to display (e.g. \"Activating Observability: react-surface\"). */\n humanized: string;\n\n /**\n * Optional `(index/total)` tick. When present the loader replaces the current\n * line in place (\"Loading plugins (12/80)\") instead of appending a new entry \u2014\n * keeps the visible log compact during long counted phases.\n */\n range?: { index: number; total: number };\n};\n\n/**\n * Imperative facade exposed on `window.__bootLoader`, installed by the inlined\n * loader bundle and driven by the host app (the React relay forwards `useApp`'s\n * startup progress through it).\n */\nexport type BootLoaderApi = {\n /** Update the visible status line. */\n status: (payload: StatusPayload) => void;\n /** Enter host-driven progress \u2014 `fraction` \u2208 [0, 1]. */\n progress: (fraction?: number) => void;\n /** Play the dismissal outro, then remove the loader DOM (graceful path). */\n ready: () => void;\n /** Remove the loader DOM immediately (fast-load backstop / terminal). */\n dismiss: () => void;\n};\n\n/**\n * Config baked into `index.html` by `bootLoaderPlugin` ahead of the loader\n * bundle, so the compiled app stays static (compiled once, independent of the\n * host's brand mark / initial status).\n */\nexport type BootLoaderConfig = {\n /**\n * Id of the static backdrop element the plugin injects and the loader mounts\n * into \u2014 the single coupling between `transformIndexHtml` and the app. The\n * plugin owns the authoritative value and passes it here so `entry.tsx` reads\n * it rather than hardcoding (the CSS selector mirrors it \u2014 see `boot-loader.css`).\n */\n rootId?: string;\n /** Inline SVG markup for the brand mark rendered inside the ring. */\n markSvg?: string;\n /** Initial status text rendered before the host fires its first `status(...)`. */\n status?: string;\n};\n\n/** Fallback backdrop id when no config is present (kept in sync with `loader.ts` + the CSS). */\nexport const DEFAULT_ROOT_ID = 'boot-loader';\n\ndeclare global {\n interface Window {\n __bootLoader?: BootLoaderApi;\n __BOOT_LOADER_CONFIG__?: BootLoaderConfig;\n }\n}\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as FetchHttpClient from '@effect/platform/FetchHttpClient';\nimport * as HttpClient from '@effect/platform/HttpClient';\nimport * as HttpClientRequest from '@effect/platform/HttpClientRequest';\nimport * as HttpClientResponse from '@effect/platform/HttpClientResponse';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { BaseError } from '@dxos/errors';\nimport { PLUGIN_ENTRY_FILENAME } from '@dxos/protocols';\n\n/**\n * Default port the Vite plugin (`composerPlugin`) binds the dev server to.\n *\n * Shared single source of truth — `composerPlugin` reads it as the default\n * port, and the host's \"Load Dev Plugin\" affordance pre-fills the manifest URL\n * with `http://localhost:${PLUGIN_DEV_SERVER_PORT}/manifest.json`. Lives in\n * app-framework rather than `@dxos/protocols` because the constant is a\n * client-side convention (host loader + Vite plugin) rather than a wire-level\n * protocol.\n */\nexport const PLUGIN_DEV_SERVER_PORT = 3967;\n\n/**\n * Tagged error for manifest fetch / parse failures. Construction sites set\n * `context.manifestUrl` and `context.reason` (one of `'fetch-failed' |\n * 'http-error' | 'parse-failed' | 'invalid'`) so handlers can route on the\n * specific failure mode.\n */\nexport class PluginManifestError extends BaseError.extend('PluginManifestError', 'Plugin manifest is invalid') {}\n\n/**\n * Schema for a third-party plugin manifest.\n *\n * Production manifests are published as a sibling of the plugin's entry module\n * ({@link PLUGIN_ENTRY_FILENAME}) and advertise every file the plugin needs at\n * runtime so the host can eagerly cache them for offline use.\n *\n * Dev manifests (served by `vite dev` via {@link composerPlugin}) set `devEntry`\n * to point at the unbundled source entry. The host's loader treats the presence\n * of `devEntry` as the dev-mode signal: it imports the entry directly from the\n * dev server, skips eager asset caching, and skips static stylesheet injection\n * (Vite handles CSS via runtime `<style>` injection during HMR). `assets` is not\n * required to enumerate every file in dev mode — chunks and styles flow through\n * the dev server on demand.\n */\nexport const Manifest = Schema.Struct({\n id: Schema.String,\n name: Schema.String,\n version: Schema.String,\n assets: Schema.Array(Schema.String),\n devEntry: Schema.String.pipe(Schema.optional),\n});\n\nexport type Manifest = Schema.Schema.Type<typeof Manifest>;\n\n/**\n * Resolved manifest with all asset paths converted to absolute URLs.\n *\n * `dev` reflects whether the source manifest declared a `devEntry`. Loaders branch\n * on this to skip offline caching and stylesheet injection — both are no-ops (or\n * actively wrong) when the plugin is being served by a Vite dev server.\n */\nexport type ResolvedManifest = {\n id: string;\n name: string;\n version: string;\n entryUrl: string;\n assetUrls: readonly string[];\n dev: boolean;\n};\n\n/**\n * Resolves a parsed manifest's relative asset paths against the manifest's URL.\n * In dev mode the entry comes from `devEntry`; otherwise it's the canonical\n * {@link PLUGIN_ENTRY_FILENAME} sitting next to the manifest.\n */\nconst resolve = (manifestUrl: string, manifest: Manifest): ResolvedManifest => {\n const dev = manifest.devEntry !== undefined;\n return {\n id: manifest.id,\n name: manifest.name,\n version: manifest.version,\n entryUrl: new URL(dev ? manifest.devEntry! : PLUGIN_ENTRY_FILENAME, manifestUrl).toString(),\n assetUrls: manifest.assets.map((asset) => new URL(asset, manifestUrl).toString()),\n dev,\n };\n};\n\n/**\n * Synchronous decode + validate + resolve for an in-memory manifest payload. Used\n * by tests and tooling that have the manifest body already loaded; the runtime\n * path goes through {@link fetchManifest}.\n */\nexport const parse = (manifestUrl: string, payload: unknown): ResolvedManifest => {\n const manifest = Schema.decodeUnknownSync(Manifest)(payload);\n if (manifest.devEntry === undefined && !manifest.assets.includes(PLUGIN_ENTRY_FILENAME)) {\n throw new Error(`Manifest at ${manifestUrl} does not list ${PLUGIN_ENTRY_FILENAME} in assets.`);\n }\n return resolve(manifestUrl, manifest);\n};\n\n/**\n * Fetches and parses a manifest from the given URL via Effect's HTTP client and\n * Schema-driven JSON decoding. All failure modes surface as a single tagged\n * {@link PluginManifestError}; callers route on `error.context.reason`.\n */\nexport const fetchManifest = (manifestUrl: string): Effect.Effect<ResolvedManifest, PluginManifestError> =>\n Effect.gen(function* () {\n const response = yield* HttpClientRequest.get(manifestUrl).pipe(\n HttpClient.execute,\n Effect.mapError((cause) => new PluginManifestError({ context: { manifestUrl, reason: 'fetch-failed' }, cause })),\n );\n if (response.status >= 400) {\n return yield* Effect.fail(\n new PluginManifestError({ context: { manifestUrl, reason: 'http-error', status: response.status } }),\n );\n }\n const manifest = yield* HttpClientResponse.schemaBodyJson(Manifest)(response).pipe(\n Effect.mapError((cause) => new PluginManifestError({ context: { manifestUrl, reason: 'parse-failed' }, cause })),\n );\n if (manifest.devEntry === undefined && !manifest.assets.includes(PLUGIN_ENTRY_FILENAME)) {\n return yield* Effect.fail(\n new PluginManifestError({\n context: { manifestUrl, reason: 'invalid' },\n cause: `assets does not include ${PLUGIN_ENTRY_FILENAME}`,\n }),\n );\n }\n return resolve(manifestUrl, manifest);\n }).pipe(Effect.scoped, Effect.provide(FetchHttpClient.layer));\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { PLUGIN_ENTRY_FILENAME } from '@dxos/protocols';\n\nimport { type Plugin } from '../core';\n\n/**\n * Name of the asset written alongside the built module bundle.\n * The DXOS community registry resolves each published plugin by fetching this file\n * from the repo's latest GitHub Release, so authors should not rename it.\n */\nexport const MANIFEST_ASSET_NAME = 'manifest.json';\n\n/**\n * Canonical entry filename (re-exported from `@dxos/protocols`) so vite-plugin\n * consumers don't have to reach into the protocols package directly.\n */\nexport const ENTRY_FILENAME = PLUGIN_ENTRY_FILENAME;\n\n/**\n * Plugin metadata required to emit a manifest at build time.\n *\n * Extends `Plugin.Meta` with a build-time `version` field that is not\n * relevant to the runtime plugin definition itself.\n */\nexport type BuildMeta = Plugin.Meta & { version: string };\n\n/**\n * Serializes a plugin's public metadata + bundle layout into the format consumed\n * by the host loader (see `UrlLoader.make` and `PluginManifest.parse`).\n *\n * The host fetches this manifest, resolves every entry in `assets` against the\n * manifest URL, and persists them via the platform `PluginAssetCache` so the\n * plugin works offline. For production builds the entry module is always\n * {@link ENTRY_FILENAME} and must appear in `assets`. For dev-server manifests\n * pass `devEntry` (a path relative to the manifest URL) — the host then imports\n * the entry directly from the dev server and skips offline caching, since the\n * full asset graph isn't enumerable until build time.\n *\n * Exported from a vite-free module so tests and tooling can validate manifests\n * without paying the cost of loading vite + esbuild.\n */\nexport const serializeManifest = (\n meta: BuildMeta,\n { assets, devEntry }: { assets: readonly string[]; devEntry?: string },\n): string => {\n // The published manifest is keyed by the bare NSID `id`; the `key` DXN is an\n // in-process convenience and is intentionally omitted to keep the registry\n // wire-format stable. `version` is the build-time package version (may be a\n // non-semver dev tag), carried by `BuildMeta` rather than derived from `key`.\n const { key: _key, ...rest } = meta;\n return JSON.stringify(\n {\n ...rest,\n assets,\n ...(devEntry !== undefined ? { devEntry } : {}),\n },\n null,\n 2,\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n/**\n * Packages shared between the Composer host app and remote plugins.\n *\n * {@link DEFAULT_PACKAGES} is the single source of truth: `importMapPlugin` emits\n * one wrapper chunk per entry so the host serves it at runtime, and `composerPlugin`\n * (via {@link isSharedPackage}) externalizes the same set from plugin bundles.\n * Adding a new `@dxos/*` (or third-party) package that plugins may depend on means\n * adding it here — in one place — so the externalization contract stays in sync\n * with what the host actually provides.\n *\n * Every entry must also be a **direct** dependency of composer-app's `package.json`,\n * including packages that are only re-exported by an umbrella (e.g. via subpath\n * re-exports from another listed package). pnpm doesn't symlink transitive deps\n * into a package's own `node_modules`, so the import-map plugin's `this.resolve`\n * call fails for transitive-only entries and the importmap silently drops them —\n * leaving plugins with bare specifiers the host can't satisfy at install time.\n *\n * Plugin packages (`@dxos/plugin-*`) are intentionally NOT listed: community plugins\n * bundle their own copy of any plugin-subpath import, which is safe because those\n * exports are limited to lightweight types/operation defs.\n */\n\n/**\n * Non-`@dxos/*` packages the Composer host provides to plugins via import map.\n * Spread into {@link DEFAULT_PACKAGES} so the third-party set lives in one place.\n */\nconst THIRD_PARTY_SHARED_PACKAGES = [\n '@effect-atom/atom',\n '@effect-atom/atom-react',\n '@effect/platform',\n 'effect',\n 'lit',\n 'react',\n 'react-dom',\n 'solid-js',\n];\n\nexport const DEFAULT_PACKAGES = [\n // packages/common\n '@dxos/async',\n '@dxos/codec-protobuf',\n '@dxos/context',\n '@dxos/crypto',\n '@dxos/debug',\n '@dxos/display-name',\n '@dxos/effect',\n '@dxos/effect-atom-solid',\n '@dxos/errors',\n '@dxos/feed-store',\n '@dxos/graph',\n '@dxos/hypercore',\n '@dxos/invariant',\n '@dxos/keyboard',\n '@dxos/keys',\n '@dxos/kv-store',\n '@dxos/log',\n '@dxos/merkle-search-tree',\n '@dxos/random',\n '@dxos/random-access-storage',\n '@dxos/timeframe',\n '@dxos/tracing',\n '@dxos/util',\n '@dxos/web-context',\n '@dxos/web-context-react',\n '@dxos/web-context-solid',\n\n // packages/core/echo\n '@dxos/echo',\n '@dxos/echo-client',\n '@dxos/echo-host',\n '@dxos/echo-protocol',\n '@dxos/echo-query',\n '@dxos/echo-react',\n '@dxos/echo-solid',\n '@dxos/feed',\n '@dxos/index-core',\n\n // packages/core/halo\n '@dxos/credentials',\n '@dxos/keyring',\n\n // packages/core/mesh\n '@dxos/edge-client',\n '@dxos/messaging',\n '@dxos/network-manager',\n '@dxos/rpc',\n '@dxos/rpc-tunnel',\n '@dxos/teleport',\n '@dxos/teleport-extension-automerge-replicator',\n '@dxos/teleport-extension-gossip',\n '@dxos/teleport-extension-object-sync',\n '@dxos/teleport-extension-replicator',\n '@dxos/websocket-rpc',\n\n // packages/core\n '@dxos/ai',\n '@dxos/assistant',\n '@dxos/assistant-toolkit',\n '@dxos/compute',\n '@dxos/conductor',\n '@dxos/functions',\n '@dxos/functions-runtime',\n '@dxos/mcp-client',\n '@dxos/operation',\n '@dxos/protocols',\n\n // packages/devtools\n '@dxos/devtools',\n\n // packages/sdk\n '@dxos/app-framework',\n '@dxos/app-graph',\n '@dxos/app-solid',\n '@dxos/app-toolkit',\n '@dxos/client',\n '@dxos/client-protocol',\n '@dxos/client-services',\n '@dxos/config',\n '@dxos/migrations',\n '@dxos/observability',\n '@dxos/react-client',\n '@dxos/react-edge-client',\n '@dxos/schema',\n '@dxos/types',\n\n // packages/ui\n '@dxos/lit-grid',\n '@dxos/lit-ui',\n '@dxos/react-hooks',\n '@dxos/react-ui',\n '@dxos/react-ui-attention',\n '@dxos/react-ui-audio',\n '@dxos/react-ui-board',\n '@dxos/react-ui-calendar',\n '@dxos/react-ui-canvas',\n '@dxos/react-ui-canvas-compute',\n '@dxos/react-ui-canvas-editor',\n '@dxos/react-ui-chat',\n '@dxos/react-ui-components',\n '@dxos/react-ui-dnd',\n '@dxos/react-ui-editor',\n '@dxos/react-ui-experimental',\n '@dxos/react-ui-form',\n '@dxos/react-ui-gameboard',\n '@dxos/react-ui-geo',\n '@dxos/react-ui-graph',\n '@dxos/react-ui-grid',\n '@dxos/react-ui-list',\n '@dxos/react-ui-markdown',\n '@dxos/react-ui-masonry',\n '@dxos/react-ui-menu',\n '@dxos/react-ui-mosaic',\n '@dxos/react-ui-pickers',\n '@dxos/react-ui-list',\n '@dxos/react-ui-stack',\n '@dxos/react-ui-syntax-highlighter',\n '@dxos/react-ui-table',\n '@dxos/react-ui-tabs',\n '@dxos/react-ui-text-tooltip',\n '@dxos/react-ui-thread',\n '@dxos/solid-ui',\n '@dxos/solid-ui-geo',\n '@dxos/ui',\n '@dxos/ui-editor',\n '@dxos/ui-theme',\n '@dxos/ui-types',\n\n // third-party\n ...THIRD_PARTY_SHARED_PACKAGES,\n];\n\n/**\n * True when the given bare specifier (or one of its subpaths) is provided by the\n * Composer host at runtime and must not be re-bundled by a plugin.\n *\n * Matches only packages listed in {@link DEFAULT_PACKAGES} — the same list\n * {@link importMapPlugin} consumes — so externalization cannot claim a package\n * the host isn't actually mapping. Unknown `@dxos/*` packages fall through to\n * normal bundling, which is the correct default for plugin-owned or yet-to-be\n * shared workspace packages.\n */\nexport const isSharedPackage = (id: string): boolean =>\n DEFAULT_PACKAGES.some((pkg) => id === pkg || id.startsWith(`${pkg}/`));\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Plugin as VitePlugin } from 'vite';\n\nimport { PLUGIN_DEV_SERVER_PORT } from '../../core';\nimport { type BuildMeta, ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest } from '../manifest';\nimport { DEFAULT_PACKAGES, isSharedPackage } from '../packages';\n\nexport { ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest };\nexport type { BuildMeta };\n\nconst JSX_DEV_RUNTIME = 'react/jsx-dev-runtime';\n\n/**\n * Whether an import should be externalized by the plugin bundle.\n * Uses the shared-package predicate directly so plugins automatically pick up any\n * new `@dxos/*` (non-plugin) package the host provides, without a code change here.\n */\nconst isExternal = (id: string) => id !== JSX_DEV_RUNTIME && isSharedPackage(id);\n\n/**\n * Banner injected at the top of every plugin bundle.\n *\n * Why: rolldown emits ESM `import` for externalized deps, but when a *bundled* module\n * is CJS and contains `require('react')` (or any other external), rolldown keeps the\n * `require(...)` call in the output and relies on a runtime `require` function. The\n * browser doesn't have `require`, so rolldown's fallback shim throws:\n * `Calling `require` for \"react\" in an environment that doesn't expose the `require`\n * function`.\n *\n * The full dependency graphs of non-trivial plugins unavoidably drag in CJS-only\n * helpers (`use-sync-external-store` via xstate / zustand / preact-signals / … ),\n * and waiting for every one of those packages to ship ESM isn't realistic. Instead\n * we install a tiny module-local `require` at the top of the bundle that looks up\n * a handful of well-known host-provided modules by name and returns their already\n * ESM-imported namespaces. Rolldown's own shim honours an existing `require`\n * before falling through to the throw path, so this entirely removes the runtime\n * error without changing how externalization itself works.\n *\n * Keep the list aligned with the externals that CJS code actually reaches for;\n * adding entries here is safe (unused imports get tree-shaken), but the list is\n * deliberately small to keep the banner noise-free.\n */\nconst REQUIRE_SHIM_BANNER = [\n '// --- composer-plugin: CJS require shim ---',\n '// See @dxos/app-framework/vite-plugin/composer-plugin.ts for rationale.',\n \"import * as __composerReact from 'react';\",\n \"import * as __composerReactDom from 'react-dom';\",\n \"import * as __composerReactJsxRuntime from 'react/jsx-runtime';\",\n 'const __composerRequireShim = new Map([',\n \" ['react', __composerReact.default ?? __composerReact],\",\n \" ['react-dom', __composerReactDom.default ?? __composerReactDom],\",\n \" ['react/jsx-runtime', __composerReactJsxRuntime],\",\n ']);',\n \"// Module-local binding: rolldown's CJS fallback does a `typeof require` check\",\n '// and uses whichever `require` is in lexical scope. Declaring this as `const`',\n \"// (instead of `globalThis.require ??=`) keeps each bundle's shim isolated from\",\n '// the host page and from other plugins sharing the window.',\n 'const require = (id) => {',\n ' if (__composerRequireShim.has(id)) return __composerRequireShim.get(id);',\n \" throw new Error('composer-plugin: unsupported CJS require at runtime: ' + id);\",\n '};',\n '// --- end CJS require shim ---',\n].join('\\n');\n\nexport type ComposerPluginOptions = {\n /** Entry point for the plugin bundle. Defaults to `src/plugin.tsx`. */\n entry?: string;\n /** Dev server port. Defaults to {@link PLUGIN_DEV_SERVER_PORT}. */\n port?: number;\n /**\n * Plugin metadata. When provided, a `manifest.json` asset is emitted alongside the bundle\n * listing every emitted file. The host fetches this manifest at install time and persists\n * the declared assets in its offline cache so the plugin works without network. The bundle's\n * entry module is always written as {@link ENTRY_FILENAME} (`index.mjs`).\n */\n meta?: BuildMeta;\n};\n\n/**\n * Vite plugin for **external Composer plugin projects**. Configures the build to produce\n * an ESM bundle that externalizes all framework dependencies, which the Composer host app\n * provides at runtime via import map.\n *\n * Handles:\n * 1. Build config — lib mode entry point, ES format output, rollup externals, code-split chunks.\n * 2. Dev externalization — marks shared deps as external during `vite serve` and strips\n * the `/@id/` prefix that Vite's import analysis adds to external bare specifiers.\n * 3. JSX dev runtime shim — bridges `react/jsx-dev-runtime` (used by React refresh in dev)\n * to `react/jsx-runtime` (which is what the externalized React provides).\n * 4. Manifest emit — when `meta` is supplied, writes `manifest.json` next to the bundled\n * module listing every emitted asset (entry, CSS, chunks, etc.) so the host can eagerly\n * cache them for offline use.\n */\nexport const composerPlugin = (options?: ComposerPluginOptions): VitePlugin[] => {\n const entry = options?.entry ?? 'src/plugin.tsx';\n const port = options?.port ?? PLUGIN_DEV_SERVER_PORT;\n const meta = options?.meta;\n const resolved = new Set<string>();\n let base = '/';\n\n const plugins: VitePlugin[] = [\n // Configure vite for library-mode builds with externalized deps.\n {\n name: 'composer-plugin',\n config: () => ({\n server: {\n port,\n // Allow the Composer host (different origin) to dynamically import plugin modules.\n cors: true,\n },\n preview: { port },\n build: {\n sourcemap: true,\n // Transitively-bundled WASM modules (automerge, tiktoken, …) emit top-level\n // await; `esnext` lets rolldown pass that through without an explicit polyfill.\n target: 'esnext',\n lib: {\n entry,\n formats: ['es'],\n fileName: () => ENTRY_FILENAME,\n },\n rolldownOptions: {\n external: (id: string) => isExternal(id),\n output: {\n chunkFileNames: 'chunks/[name]-[hash].js',\n assetFileNames: 'assets/[name]-[hash][extname]',\n // Install the CJS require shim at the top of plugin.mjs so transitively\n // bundled CJS helpers (that call `require('react')` et al. at runtime) can\n // resolve against the host-provided externals instead of throwing.\n banner: REQUIRE_SHIM_BANNER,\n },\n },\n },\n }),\n },\n\n // Dev-time externalization.\n // Vite's dev server doesn't use rollup externals, so we need to handle it manually.\n // We intercept imports of shared deps at resolve time, mark them external, and then\n // strip the `/@id/` prefix that Vite's import analysis injects for external modules.\n {\n name: 'composer-plugin:externalize',\n enforce: 'pre',\n apply: 'serve',\n // Exclude shared packages from Vite's dependency pre-bundling.\n config: () => ({\n optimizeDeps: {\n exclude: DEFAULT_PACKAGES,\n },\n }),\n // Mark shared deps as external so Vite doesn't try to bundle them.\n resolveId: (id) => {\n if (isExternal(id)) {\n resolved.add(id);\n return { id, external: true };\n }\n },\n // Return a stub for any externalized module that Vite tries to load directly.\n load: (id) => {\n if (resolved.has(id)) {\n return { code: 'export default {};' };\n }\n },\n // After all plugins are resolved, inject a late-stage transform plugin that strips\n // the `/@id/` prefix from externalized bare specifiers in the output.\n // This must run after Vite's internal import analysis which rewrites bare specifiers.\n configResolved: (config) => {\n base = config.base ?? '/';\n (config.plugins as VitePlugin[]).push({\n name: 'composer-plugin:strip-prefix',\n transform: (code: string) => {\n if (resolved.size === 0) {\n return;\n }\n const escaped = [...resolved].map((s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|');\n const pattern = new RegExp(`${base}@id/(${escaped})`, 'g');\n if (pattern.test(code)) {\n return code.replace(pattern, (_: string, dep: string) => dep);\n }\n },\n });\n },\n },\n\n // JSX dev runtime shim.\n // React refresh (used by @vitejs/plugin-react) imports from `react/jsx-dev-runtime`,\n // but the externalized React only exposes `react/jsx-runtime`. This virtual module\n // bridges the gap by re-exporting jsx-runtime's functions under jsx-dev-runtime's API.\n {\n name: 'composer-plugin:jsx-dev-shim',\n enforce: 'pre',\n apply: 'serve',\n resolveId: (id) => (id === JSX_DEV_RUNTIME ? `\\0${JSX_DEV_RUNTIME}` : undefined),\n load: (id) =>\n id === `\\0${JSX_DEV_RUNTIME}`\n ? [\n 'import { jsx, jsxs, Fragment } from \"react/jsx-runtime\";',\n 'export { Fragment };',\n 'export function jsxDEV(type, props, key, isStaticChildren) {',\n ' return isStaticChildren ? jsxs(type, props, key) : jsx(type, props, key);',\n '}',\n ].join('\\n')\n : undefined,\n },\n\n // React Refresh preamble stub.\n //\n // @vitejs/plugin-react's JSX transform prepends a runtime check to every module:\n // if (!window.$RefreshReg$) throw new Error(\"@vitejs/plugin-react can't detect preamble…\");\n // In a normal single-origin app, vite injects a `<script type=\"module\">` preamble\n // into `index.html` that sets up `$RefreshReg$` / `$RefreshSig$` on `window` before any\n // app code runs. When a community plugin is dev-served at its own origin and then\n // dynamic-imported into the Composer host at a different origin, the host's window\n // never receives that preamble, so every JSX module throws on first import.\n //\n // Inject a no-op refresh shim on the host's window from the plugin's entrypoint: fast-\n // refresh itself doesn't work cross-origin anyway, so silencing the check lets the\n // plugin load and ordinary page reloads take care of picking up edits. Production\n // builds are untouched (`apply: 'serve'`).\n {\n name: 'composer-plugin:react-refresh-shim',\n enforce: 'pre',\n apply: 'serve',\n transform(code, id) {\n // Only patch the plugin entrypoint (an absolute path ending in the configured entry).\n // Matching by suffix keeps us from prepending the shim to every transformed module,\n // which would both bloat the output and defeat vite's caching.\n if (!id.endsWith(entry.replace(/^\\.?\\//, '/'))) {\n return;\n }\n const shim = [\n '// composer-plugin: no-op React Refresh shim so cross-origin plugin modules',\n \"// don't throw the @vitejs/plugin-react preamble check at dynamic-import time.\",\n 'if (typeof window !== \"undefined\") {',\n ' window.$RefreshReg$ = window.$RefreshReg$ || (() => {});',\n ' window.$RefreshSig$ = window.$RefreshSig$ || (() => (type) => type);',\n ' window.__vite_plugin_react_preamble_installed__ = true;',\n '}',\n '',\n ].join('\\n');\n return { code: shim + code, map: null };\n },\n },\n ];\n\n if (meta) {\n // Emit `manifest.json` alongside the built module listing every emitted asset, so the\n // dist directory can be uploaded as-is to a GitHub Release for the DXOS community\n // registry to pick up. The host loader fetches this file at install time and eagerly\n // caches every listed asset for offline use.\n plugins.push({\n name: 'composer-plugin:emit-manifest',\n apply: 'build',\n // `enforce: 'post'` is load-bearing: vite's CSS extraction plugin emits sibling\n // `.css` assets in its own `generateBundle` hook. Without `post`, ours runs first\n // and sees only the JS chunks — the manifest then omits CSS, so the host can't\n // inject `<link>` tags for the plugin's stylesheet at install time.\n enforce: 'post',\n generateBundle(_options, bundle) {\n // Source maps are large and only fetched when devtools opens — exclude them\n // from the manifest so the host doesn't precache megabytes of debug data.\n const assets = Object.keys(bundle)\n .filter((name) => name !== MANIFEST_ASSET_NAME && !name.endsWith('.map'))\n .sort();\n this.emitFile({\n type: 'asset',\n fileName: MANIFEST_ASSET_NAME,\n source: serializeManifest(meta, { assets }),\n });\n },\n });\n\n // Dev-server manifest. `vite dev` can't enumerate transitive chunks/CSS up front\n // (they resolve on demand), so we serve a `devEntry`-flavored manifest at the dev\n // root and let the host loader skip eager caching + static stylesheet injection.\n // The host imports `entry` directly from the dev server, where Vite handles\n // JSX transforms, externalization, and runtime CSS injection.\n plugins.push({\n name: 'composer-plugin:serve-manifest',\n apply: 'serve',\n configureServer(server) {\n const body = serializeManifest(meta, { assets: [], devEntry: entry.replace(/^\\.?\\//, '') });\n server.middlewares.use(`/${MANIFEST_ASSET_NAME}`, (req, res, next) => {\n // Only intercept the bare manifest URL — let any sub-paths fall through.\n if (req.url && req.url !== '/' && req.url !== '') {\n return next();\n }\n // CORS mirrors `server.cors: true` (see plugin config above) so the host\n // app at a different origin can read the manifest. Vite's built-in CORS\n // covers most paths but middlewares mounted before its `cors` middleware\n // need to set the header themselves.\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Content-Type', 'application/json');\n res.setHeader('Cache-Control', 'no-store');\n res.statusCode = 200;\n res.end(body);\n });\n },\n });\n }\n\n return plugins;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { init as initCjsLexer, parse as parseCjs } from 'cjs-module-lexer';\nimport { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';\nimport { createRequire as nodeCreateRequire } from 'node:module';\nimport path from 'node:path';\nimport { type Plugin } from 'vite';\n\nimport { DEFAULT_PACKAGES } from '../packages';\n\nconst require = nodeCreateRequire(import.meta.url);\n\n//\n// Import map helpers.\n// These utilities support `importMapPlugin` by resolving package entrypoints,\n// detecting module formats (ESM vs CJS), and extracting named exports from CJS bundles.\n//\n\n/** Strips vite query strings (e.g. `?v=123`) from resolved module IDs. */\nconst trimQueryString = (id: string) => id.replace(/\\?.*$/, '');\n\n/**\n * Determines whether a resolved file is an ESM module by checking file extension\n * first (.mjs/.cjs), then walking up to the nearest package.json for `\"type\": \"module\"`.\n */\nconst resolvedIdIsEsmModule = (resolvedId: string): boolean => {\n const file = trimQueryString(resolvedId);\n if (file.endsWith('.mjs') || file.endsWith('.mts')) {\n return true;\n }\n if (file.endsWith('.cjs') || file.endsWith('.cts')) {\n return false;\n }\n\n let directory = path.dirname(file);\n while (directory !== path.dirname(directory)) {\n const packageJsonPath = path.join(directory, 'package.json');\n if (existsSync(packageJsonPath)) {\n try {\n const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as { type?: string };\n return pkg.type === 'module';\n } catch {\n return false;\n }\n }\n directory = path.dirname(directory);\n }\n\n return false;\n};\n\n/**\n * Walks up from a resolved file path to find the package.json whose `\"name\"` matches\n * the given package name. Returns the path to that package.json, or undefined.\n */\nconst findPackageJsonPath = (resolvedId: string, packageName: string): string | undefined => {\n let directory = path.dirname(trimQueryString(resolvedId));\n\n while (directory !== path.dirname(directory)) {\n const packageJsonPath = path.join(directory, 'package.json');\n if (existsSync(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as { name?: string };\n if (packageJson.name === packageName) {\n return packageJsonPath;\n }\n } catch {}\n }\n\n directory = path.dirname(directory);\n }\n\n return undefined;\n};\n\n/** Resolves a package name to its package.json path using Node's require.resolve. */\nconst resolvePackageJsonPath = (packageName: string): string | undefined => {\n try {\n return findPackageJsonPath(require.resolve(packageName), packageName);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Resolves a package name to its package.json via vite's own resolver, which handles\n * workspace-linked packages whose `exports` field omits `./package.json` (so\n * `require.resolve` can't find it). Falls back to `require.resolve`.\n */\nconst resolvePackageJsonPathViaContext = async (\n ctx: { resolve: (id: string) => Promise<{ id: string } | null> },\n packageName: string,\n): Promise<string | undefined> => {\n try {\n const resolved = await ctx.resolve(packageName);\n if (resolved) {\n const viaResolved = findPackageJsonPath(resolved.id, packageName);\n if (viaResolved) {\n return viaResolved;\n }\n }\n } catch {\n // fall through\n }\n return resolvePackageJsonPath(packageName);\n};\n\n/**\n * Subpath exports that should be excluded from the import map.\n * These are node-only entrypoints (vite plugins, native addons) that shouldn't be pre-bundled for the browser.\n *\n * TODO(wittjosiah): Replace these hand-maintained lists (plus {@link GLOBALLY_EXCLUDED_SUBPATHS}\n * and {@link BUILD_TOOL_SUBPATH}) with a structural check — e.g. honour an `agent`/`node`-only\n * export condition in package.json, or probe each subpath's resolved file for `node:*` imports\n * at build time — so every new server-only entrypoint doesn't require a code change here.\n */\nconst importMapExcludedSubpaths: Readonly<Record<string, ReadonlySet<string>>> = {\n '@dxos/app-framework': new Set(['vite-plugin']),\n // `@dxos/lit-grid/testing` re-exports a playwright page-object manager and pulls\n // `@playwright/test` (and transitive playwright-core) into the browser bundle.\n '@dxos/lit-grid': new Set(['testing']),\n '@dxos/react-ui-mosaic': new Set(['playwright']),\n '@dxos/react-ui-stack': new Set(['playwright']),\n '@dxos/react-ui-table': new Set(['playwright']),\n '@dxos/ui-theme': new Set(['plugin']),\n // `solid-js/web/storage` is a server-only helper that pulls\n // `node:async_hooks` (AsyncLocalStorage) and has no browser shim. Client\n // code imports `solid-js`, `solid-js/store`, and `solid-js/web` only.\n 'solid-js': new Set(['web/storage']),\n // `effect` publishes `./.index` for bundler internals — maps to `effect/.index`, which Vite\n // often cannot resolve for the import map and is not part of the plugin-facing surface.\n effect: new Set(['.index']),\n};\n\n/**\n * Subpaths common to many packages that should always be excluded.\n * `./playwright` subdirectories house e2e test harnesses that pull in\n * `@playwright/test` (a node-only package that breaks the browser bundle).\n * `./testing` subpaths similarly expose node-only test helpers (e.g.\n * `@dxos/edge-client/testing` pulls `@dxos/node-std/http` which has no\n * browser analogue) and aren't part of the plugin-facing surface.\n */\nconst GLOBALLY_EXCLUDED_SUBPATHS = new Set(['playwright', 'testing']);\n\n/**\n * Regex for subpaths that are always node-only build tooling — vite, esbuild, and\n * rollup plugins. These use `node:*` imports and will blow up the browser bundle if\n * they end up in the import map.\n */\nconst BUILD_TOOL_SUBPATH = /^(vite-plugin|esbuild-plugin|rollup-plugin|plugin)$/;\n\n/**\n * Asset subpaths (CSS, PCSS, images, etc.) that the host already loads via its own\n * bundle — for example `@dxos/react-ui-form` pulls in `@dxos/lit-ui/dx-tag-picker.pcss`\n * on startup, so the stylesheet is already attached to the DOM by the time a remote\n * plugin runs. Community plugins should still be able to _import_ those specifiers\n * (rolldown leaves the `import \"…\"` statements in the output when the package is\n * externalized), so the import map maps them to a no-op empty ES module. The\n * resulting browser fetch is a cheap no-op; the styles are never re-downloaded\n * and never re-injected.\n */\nconst ASSET_SUBPATH = /\\.(css|pcss|scss|sass|less|json|node|wasm|html|svg|png|jpe?g|gif|webp|ico)$/;\nconst isAssetSubpath = (specifier: string) => ASSET_SUBPATH.test(specifier);\n\n/**\n * Walks `baseDir` and returns every file that matches the pattern `${baseDir}/<rest>${extension}`.\n * Used to expand wildcard exports like `./proto/*` → `./dist/src/proto/gen/*.js` into their\n * full set of bare specifiers.\n */\nconst walkDirectoryForExtension = (baseDir: string, extension: string): string[] => {\n if (!existsSync(baseDir)) {\n return [];\n }\n const results: string[] = [];\n const walk = (dir: string) => {\n let entries: string[];\n try {\n entries = readdirSync(dir);\n } catch {\n return;\n }\n for (const entry of entries) {\n const full = path.join(dir, entry);\n let stat;\n try {\n stat = statSync(full);\n } catch {\n continue;\n }\n if (stat.isDirectory()) {\n walk(full);\n } else if (entry.endsWith(extension)) {\n results.push(path.relative(baseDir, full).slice(0, -extension.length));\n }\n }\n };\n walk(baseDir);\n return results;\n};\n\n/** Resolves an `exports` value to a single target path for pattern expansion. */\nconst pickPatternTarget = (value: unknown): string | undefined => {\n if (typeof value === 'string') {\n return value;\n }\n if (value && typeof value === 'object') {\n const obj = value as Record<string, unknown>;\n const preferred = obj.browser ?? obj.import ?? obj.default ?? obj.module;\n return typeof preferred === 'string' ? preferred : undefined;\n }\n return undefined;\n};\n\n/**\n * Expands a wildcard export like `./proto/*` into concrete subpath specifiers by walking\n * the target directory. Returns `<packageName>/<subpath>` strings.\n */\nconst expandWildcardExport = (\n packageName: string,\n packageJsonDir: string,\n exportKey: string,\n exportValue: unknown,\n): string[] => {\n const target = pickPatternTarget(exportValue);\n if (!target || !target.includes('*')) {\n return [];\n }\n // Split on `*` — at most one supported (node's exports pattern semantics).\n const keyStarIndex = exportKey.indexOf('*');\n const targetStarIndex = target.indexOf('*');\n if (keyStarIndex === -1 || targetStarIndex === -1) {\n return [];\n }\n const keyPrefix = exportKey.slice(2, keyStarIndex); // drop leading './'\n const targetPrefix = target.slice(2, targetStarIndex); // drop leading './'\n const targetSuffix = target.slice(targetStarIndex + 1);\n const baseDir = path.resolve(packageJsonDir, targetPrefix);\n const files = walkDirectoryForExtension(baseDir, targetSuffix || '.js');\n return files.map((relativeNoExt) => `${packageName}/${keyPrefix}${relativeNoExt}`);\n};\n\n/**\n * Reads a package's `exports` field and returns all subpath entrypoints as bare specifiers\n * (e.g. `@dxos/client`, `@dxos/client/echo`, `@dxos/lit-ui/dx-tag-picker.pcss`,\n * `@dxos/protocols/proto/dxos/echo/metadata`). Wildcard patterns are expanded by walking\n * the corresponding output directory. Falls back to just the package name if exports is\n * absent or simple.\n */\nconst getPackageEntrypoints = (packageName: string, packageJsonPath: string): string[] => {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as {\n exports?: Record<string, unknown> | string | string[];\n };\n const exportsField = packageJson.exports;\n\n if (!exportsField || typeof exportsField === 'string' || Array.isArray(exportsField)) {\n return [packageName];\n }\n\n const exportKeys = Object.keys(exportsField);\n if (!exportKeys.some((key) => key.startsWith('.'))) {\n return [packageName];\n }\n\n const excluded = importMapExcludedSubpaths[packageName];\n const packageJsonDir = path.dirname(packageJsonPath);\n const modules = exportKeys.flatMap((key) => {\n if (key === '.') {\n return [packageName];\n }\n\n if (!key.startsWith('./') || key === './package.json') {\n return [];\n }\n\n // Skip `.d.ts` subpath exports — these are meant to be imported as raw text\n // (e.g. `@dxos/echo-query/api.d.ts?raw` for in-editor type hints), not as\n // ES modules. Enumerating them here would have vite try to bundle the\n // declaration file's imports (protobufjs, effect, etc.), which breaks.\n if (key.endsWith('.d.ts')) {\n return [];\n }\n\n if (key.includes('*')) {\n // Expand wildcard patterns like `./proto/*` into concrete specifiers.\n return expandWildcardExport(packageName, packageJsonDir, key, (exportsField as Record<string, unknown>)[key]);\n }\n\n const subpath = key.slice(2);\n if (excluded?.has(subpath) || GLOBALLY_EXCLUDED_SUBPATHS.has(subpath) || BUILD_TOOL_SUBPATH.test(subpath)) {\n return [];\n }\n\n return [`${packageName}/${subpath}`];\n });\n\n return modules.length > 0 ? modules : [packageName];\n};\n\n/**\n * Statically analyzes a CJS file to extract named exports using cjs-module-lexer.\n * Follows re-exports (e.g. react's index.js re-exports from cjs/react.development.js)\n * and deduplicates. Filters out `default` and `__esModule` pseudo-exports.\n */\nconst getCjsNamedExports = (filePath: string, seen = new Set<string>()): string[] => {\n const normalized = trimQueryString(filePath);\n if (seen.has(normalized)) {\n return [];\n }\n seen.add(normalized);\n\n try {\n const source = readFileSync(normalized, 'utf8');\n const { exports: directExports, reexports } = parseCjs(source);\n\n const reexportedNames = reexports.flatMap((reexport) => {\n const resolved = path.resolve(path.dirname(normalized), reexport);\n const candidates = [resolved, `${resolved}.js`, `${resolved}.cjs`];\n const found = candidates.find((candidate) => existsSync(candidate));\n return found ? getCjsNamedExports(found, seen) : [];\n });\n\n return [...new Set([...directExports, ...reexportedNames])].filter(\n (name) => name !== 'default' && name !== '__esModule',\n );\n } catch {\n return [];\n }\n};\n\n/**\n * Vite plugin for the **host app** (Composer). Generates a browser import map so that\n * shared packages are loaded once and reused by both the host and any remote plugins.\n *\n * In production, emits a dedicated chunk per specifier via virtual wrapper modules,\n * then injects a `<script type=\"importmap\">` tag into the HTML with the chunk URLs.\n *\n * Virtual wrappers are needed because directly emitting chunks for CJS packages loses\n * their named exports due to Rollup's interop. The wrapper re-exports them explicitly.\n *\n * TODO: Restore dev-mode support. The previous dev path mapped each bare specifier to\n * its absolute `/@fs/` file path during `buildStart`, which forced `this.resolve()` for\n * hundreds of subpath entrypoints and raced with Vite's optimize-deps static scan —\n * producing non-deterministic chunk content (~34 chunks drifting per warm-start) and\n * triggering Vite 8.0.10's `runOptimizer` / `commitProcessing` crashes (`fileHash` /\n * `browserHash` undefined on partial-discovery batches). Plugin is currently gated to\n * `apply: 'build'` to avoid both. A working dev-mode implementation would need to\n * resolve specifiers without participating in the optimize-deps phase — candidates:\n * - defer resolution to `transformIndexHtml` (after the optimizer settles)\n * - read resolved paths from `environment.depsOptimizer.metadata` rather than calling\n * `this.resolve()` ourselves\n * - resolve via `require.resolve` directly, bypassing the Vite plugin pipeline entirely\n */\nexport const importMapPlugin = (options?: { packages?: string[] }): Plugin[] => {\n const packages = options?.packages ?? DEFAULT_PACKAGES;\n const WRAPPER_PREFIX = '\\0import-map:';\n const chunkRefIds: Record<string, string> = {};\n const resolvedIds: Record<string, string> = {};\n let imports: Record<string, string> = {};\n let modules: string[] = [];\n let importMapIsDev = false;\n let base = '/';\n\n return [\n // Phase 1: Resolve all package entrypoints and emit chunks.\n //\n // Build-only. The dev-mode path (recording absolute `/@fs/` paths in\n // `imports[]`) is non-functional today and was actively harmful: calling\n // `this.resolve()` for every shared package's subpath entrypoints during\n // `buildStart` races with Vite's optimize-deps static scan, producing\n // non-deterministic chunk content (~34 drifting chunks per warm-start) and\n // triggering Vite 8.0.10's `runOptimizer` / `commitProcessing` crashes\n // (`fileHash` / `browserHash` undefined on partial-discovery batches) when\n // the resolved set doesn't match the optimizer's metadata. The importmap\n // is only meaningful for production builds where remote plugins consume\n // the emitted wrapper chunks.\n {\n name: 'import-map:get-chunk-ref-ids',\n apply: 'build',\n configResolved(config) {\n base = config.base ?? '/';\n },\n async buildStart() {\n importMapIsDev = this.environment.mode === 'dev';\n await initCjsLexer();\n\n // Expand each package name into its full set of subpath entrypoints\n // (e.g. '@dxos/client' -> ['@dxos/client', '@dxos/client/echo', ...]).\n modules = [\n ...new Set(\n (\n await Promise.all(\n packages.map(async (packageName) => {\n const packageJsonPath = await resolvePackageJsonPathViaContext(this, packageName);\n if (!packageJsonPath) {\n this.warn(`Unable to locate package.json for import map package: ${packageName}`);\n return [packageName];\n }\n\n return getPackageEntrypoints(packageName, packageJsonPath);\n }),\n )\n ).flat(),\n ),\n ];\n\n for (const specifier of modules) {\n if (isAssetSubpath(specifier)) {\n // Host already loaded the real asset; remote plugins need the specifier to\n // resolve to *something* that behaves as an ES module. A data URL is the\n // cheapest option — no chunk to emit (rolldown tree-shakes an empty wrapper\n // even with `preserveSignature: 'strict'`, so the referenced file wouldn't\n // exist at runtime), no extra network request, and the same path in dev and prod.\n imports[specifier] = 'data:text/javascript;charset=utf-8,export%20%7B%7D%3B';\n continue;\n }\n\n const resolved = await this.resolve(specifier);\n if (!resolved) {\n this.warn(`Import map: unable to resolve \"${specifier}\"; omitting from import map.`);\n continue;\n }\n\n if (importMapIsDev) {\n // Dev: map bare specifier to the resolved file path, prefixed with vite's\n // `/@fs/` escape hatch so absolute node_modules paths (including\n // `.vite/deps/*` pre-bundled chunks) round-trip through the dev server\n // instead of being resolved against the document origin as a 404.\n const filePath = trimQueryString(resolved.id);\n imports[specifier] = filePath.startsWith('/') ? `/@fs${filePath}` : filePath;\n } else {\n // Prod: emit a virtual wrapper chunk that re-exports from the real module.\n resolvedIds[specifier] = resolved.id;\n chunkRefIds[specifier] = this.emitFile({\n type: 'chunk',\n id: `${WRAPPER_PREFIX}${specifier}`,\n preserveSignature: 'strict',\n });\n }\n }\n },\n\n // Intercept virtual wrapper IDs so Rollup doesn't try to resolve them as files.\n resolveId(id) {\n if (id.startsWith(WRAPPER_PREFIX)) {\n return id;\n }\n },\n\n // Generate the source for each virtual wrapper module.\n // For CJS packages, explicitly re-export named exports (discovered via static analysis)\n // because Rollup's `export *` interop doesn't preserve them for CJS.\n //\n // Each wrapper also emits a local `__keepalive` export. Without this, Rolldown\n // (Vite 8) tree-shakes wrappers whose `export *` re-exports happen to coincide\n // with another already-emitted chunk's exports — typical for umbrella packages\n // (e.g. `@dxos/compute` re-exports from `@dxos/operation`, so the operation\n // wrapper looks \"redundant\" to Rolldown and gets merged away). A local const\n // export has no upstream source for Rolldown to dedupe against, so the chunk\n // is always preserved and the import-map entry resolves at runtime.\n load(id) {\n if (!id.startsWith(WRAPPER_PREFIX)) {\n return;\n }\n const specifier = id.slice(WRAPPER_PREFIX.length);\n const keepalive = `export const __dxosImportMapKeepalive = ${JSON.stringify(specifier)};`;\n const resolvedId = resolvedIds[specifier];\n if (!resolvedId) {\n return `export * from ${JSON.stringify(specifier)};\\n${keepalive}\\n`;\n }\n\n const filePath = trimQueryString(resolvedId);\n const isCjs = filePath.endsWith('.cjs') || (!filePath.endsWith('.mjs') && !resolvedIdIsEsmModule(filePath));\n\n if (isCjs) {\n const named = getCjsNamedExports(filePath);\n if (named.length > 0) {\n return `export { default, ${named.join(', ')} } from ${JSON.stringify(specifier)};\\n${keepalive}\\n`;\n }\n }\n return `export * from ${JSON.stringify(specifier)};\\n${keepalive}\\n`;\n },\n\n // After bundling, map each specifier to the URL of its emitted chunk. Preserves\n // asset-subpath entries already written to `imports` during `buildStart` (those\n // use an inline data URL rather than an emitted chunk).\n generateBundle() {\n if (importMapIsDev) {\n return;\n }\n\n imports = {\n ...imports,\n ...Object.fromEntries(\n modules\n .filter((specifier) => chunkRefIds[specifier] !== undefined)\n .map((specifier) => [specifier, `${base}${this.getFileName(chunkRefIds[specifier])}`]),\n ),\n };\n },\n },\n\n // Phase 2: Inject the import map into the HTML as a <script type=\"importmap\"> tag.\n {\n name: 'import-map:transform-index-html',\n apply: 'build',\n enforce: 'post',\n transformIndexHtml(html: string) {\n const tags = [\n {\n tag: 'script',\n attrs: {\n type: 'importmap',\n },\n children: JSON.stringify({ imports }, null, 2),\n },\n ];\n\n return {\n html,\n tags,\n };\n },\n },\n ];\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,YAAYA,WAAW;AAEvB,OAAOC,2BAA2B;AAElC,OAAOC,sBAAsB;AAC7B,SAASC,aAA2C;AACpD,SAASC,UAAUC,eAAe;AAClC,SAASC,qBAAqB;;;ACZ9B;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;ACAA;;;APqDA,IAAMC,aAAa;AAMnB,IAAMC,UAA8D;EAClEC,OAAO;IAAEC,UAAUC;IAAUC,KAAK;EAAK;EACvCC,OAAO;IAAEH,UAAUI;IAAUF,KAAK;EAAK;EACvCG,QAAQ;IAAEL,UAAUM;IAAWJ,KAAK;EAAK;EACzCK,QAAQ;IAAEP,UAAUQ;IAAWN,KAAK;EAAM;EAC1CO,OAAO;IAAET,UAAUU;IAAUR,KAAK;EAAM;EACxCS,OAAO;IAAEX,UAAUY;IAAUV,KAAK;EAAM;AAC1C;AAIA,IAAMW,aAAaC,QAAQC,cAAc,YAAYC,GAAG,CAAA;AAQxD,IAAMC,sBAAsB,YAAA;AAC1B,QAAMC,eAAe,OAAsB;IACzCC,MAAM;IACNC,OAAO,CAACC,YAAAA;AACNA,cAAQC,UAAU;QAAEC,QAAQ;MAAQ,GAAG,CAACC,SAAAA;AACtC,cAAML,OAAOK,KAAKC,KAAKC,QAAQ,SAAS,EAAA,EAAIA,QAAQ,kBAAkB,EAAA;AACtE,eAAOP,QAAQrB,UAAU;UAAE2B,MAAMN;UAAMQ,WAAW9B;QAAW,IAAI+B;MACnE,CAAA;AAEAP,cAAQQ,OAAO;QAAEN,QAAQ;QAAMI,WAAW9B;MAAW,GAAG,OAAO2B,SAAAA;AAC7D,cAAMM,SAASh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;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGGD;;AAaE,IAAME,kBAAkB,CAACC,OAC9BF,iBAAiBG,KAAK,CAACC,QAAQF,OAAOE,OAAOF,GAAGG,WAAW,GAAGD,GAAAA,GAAM,CAAA;;;AC7KtE,IAAME,kBAAkB;AAOxB,IAAMC,aAAa,CAACC,OAAeA,OAAOF,mBAAmBG,gBAAgBD,EAAAA;AAyB7E,IAAME,sBAAsB;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACAC,KAAK,IAAA;AA+BA,IAAMC,iBAAiB,CAACC,YAAAA;AAC7B,QAAMC,QAAQD,SAASC,SAAS;AAChC,QAAMC,OAAOF,SAASE,QAAQC;AAC9B,QAAMC,OAAOJ,SAASI;AACtB,QAAMC,WAAW,oBAAIC,IAAAA;AACrB,MAAIC,OAAO;AAEX,QAAMC,UAAwB;;IAE5B;MACEC,MAAM;MACNC,QAAQ,OAAO;QACbC,QAAQ;UACNT;;UAEAU,MAAM;QACR;QACAC,SAAS;UAAEX;QAAK;QAChBY,OAAO;UACLC,WAAW;;;UAGXC,QAAQ;UACRC,KAAK;YACHhB;YACAiB,SAAS;cAAC;;YACVC,UAAU,MAAMC;UAClB;UACA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
|
6
|
+
"names": ["babel", "babelPresetTypeScript", "babelPresetSolid", "build", "basename", "dirname", "fileURLToPath", "VIRTUAL_NS", "MODULES", "entry", "contents", "entrySrc", "tsx", "mount", "mountSrc", "Loader", "loaderSrc", "bridge", "bridgeSrc", "store", "storeSrc", "types", "typesSrc", "resolveDir", "dirname", "fileURLToPath", "url", "compileLoaderBundle", "virtualSolid", "name", "setup", "esbuild", "onResolve", "filter", "args", "path", "replace", "namespace", "undefined", "onLoad", "module", "result", "transformAsync", "filename", "babelrc", "configFile", "presets", "babelPresetSolid", "generate", "hydratable", "babelPresetTypeScript", "allowDeclareFields", "code", "Error", "loader", "build", "stdin", "sourcefile", "bundle", "format", "platform", "target", "minify", "write", "legalComments", "define", "plugins", "outputFiles", "text", "bundlePromise", "getLoaderBundle", "bootLoaderPlugin", "status", "markSvg", "include", "transformIndexHtml", "_html", "ctx", "basename", "includes", "rootId", "tag", "injectTo", "children", "css", "attrs", "id", "role", "JSON", "stringify", "FetchHttpClient", "HttpClient", "HttpClientRequest", "HttpClientResponse", "Effect", "Schema", "BaseError", "PLUGIN_ENTRY_FILENAME", "PLUGIN_DEV_SERVER_PORT", "PluginManifestError", "extend", "Manifest", "Struct", "id", "String", "name", "version", "assets", "Array", "devEntry", "pipe", "optional", "PLUGIN_ENTRY_FILENAME", "MANIFEST_ASSET_NAME", "ENTRY_FILENAME", "serializeManifest", "meta", "assets", "devEntry", "key", "_key", "rest", "JSON", "stringify", "undefined", "THIRD_PARTY_SHARED_PACKAGES", "DEFAULT_PACKAGES", "isSharedPackage", "id", "some", "pkg", "startsWith", "JSX_DEV_RUNTIME", "isExternal", "id", "isSharedPackage", "REQUIRE_SHIM_BANNER", "join", "composerPlugin", "options", "entry", "port", "PLUGIN_DEV_SERVER_PORT", "meta", "resolved", "Set", "base", "plugins", "name", "config", "server", "cors", "preview", "build", "sourcemap", "target", "lib", "formats", "fileName", "ENTRY_FILENAME", "rolldownOptions", "external", "output", "chunkFileNames", "assetFileNames", "banner", "enforce", "apply", "optimizeDeps", "exclude", "DEFAULT_PACKAGES", "resolveId", "add", "load", "has", "code", "configResolved", "push", "transform", "size", "escaped", "map", "s", "replace", "pattern", "RegExp", "test", "_", "dep", "undefined", "endsWith", "shim", "generateBundle", "_options", "bundle", "assets", "Object", "keys", "filter", "MANIFEST_ASSET_NAME", "sort", "emitFile", "type", "source", "serializeManifest", "configureServer", "body", "devEntry", "middlewares", "use", "req", "res", "next", "url", "setHeader", "statusCode", "end", "init", "initCjsLexer", "parse", "parseCjs", "existsSync", "readFileSync", "readdirSync", "statSync", "createRequire", "nodeCreateRequire", "path", "require", "nodeCreateRequire", "url", "trimQueryString", "id", "replace", "resolvedIdIsEsmModule", "resolvedId", "file", "endsWith", "directory", "path", "dirname", "packageJsonPath", "join", "existsSync", "pkg", "JSON", "parse", "readFileSync", "type", "findPackageJsonPath", "packageName", "packageJson", "name", "undefined", "resolvePackageJsonPath", "resolve", "resolvePackageJsonPathViaContext", "ctx", "resolved", "viaResolved", "importMapExcludedSubpaths", "Set", "effect", "GLOBALLY_EXCLUDED_SUBPATHS", "BUILD_TOOL_SUBPATH", "ASSET_SUBPATH", "isAssetSubpath", "specifier", "test", "walkDirectoryForExtension", "baseDir", "extension", "results", "walk", "dir", "entries", "readdirSync", "entry", "full", "stat", "statSync", "isDirectory", "push", "relative", "slice", "length", "pickPatternTarget", "value", "obj", "preferred", "browser", "import", "default", "module", "expandWildcardExport", "packageJsonDir", "exportKey", "exportValue", "target", "includes", "keyStarIndex", "indexOf", "targetStarIndex", "keyPrefix", "targetPrefix", "targetSuffix", "files", "map", "relativeNoExt", "getPackageEntrypoints", "exportsField", "exports", "Array", "isArray", "exportKeys", "Object", "keys", "some", "key", "startsWith", "excluded", "modules", "flatMap", "subpath", "has", "getCjsNamedExports", "filePath", "seen", "normalized", "add", "source", "directExports", "reexports", "parseCjs", "reexportedNames", "reexport", "candidates", "found", "find", "candidate", "filter", "importMapPlugin", "options", "packages", "DEFAULT_PACKAGES", "WRAPPER_PREFIX", "chunkRefIds", "resolvedIds", "imports", "importMapIsDev", "base", "apply", "configResolved", "config", "buildStart", "environment", "mode", "initCjsLexer", "Promise", "all", "warn", "flat", "emitFile", "preserveSignature", "resolveId", "load", "keepalive", "stringify", "isCjs", "named", "generateBundle", "fromEntries", "getFileName", "enforce", "transformIndexHtml", "html", "tags", "tag", "attrs", "children"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/boot-loader.css?raw":{"bytes":10361,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/bridge.ts?raw":{"bytes":860,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/entry.tsx?raw":{"bytes":715,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/Loader.tsx?raw":{"bytes":7031,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/mount.tsx?raw":{"bytes":2251,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/store.ts?raw":{"bytes":5638,"imports":[]},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/types.ts?raw":{"bytes":2763,"imports":[]},"src/vite-plugin/boot-loader/loader.ts":{"bytes":25144,"imports":[{"path":"@babel/core","kind":"import-statement","external":true},{"path":"@babel/preset-typescript","kind":"import-statement","external":true},{"path":"babel-preset-solid","kind":"import-statement","external":true},{"path":"esbuild","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/boot-loader.css?raw","kind":"import-statement","original":"./loader-app/boot-loader.css?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/bridge.ts?raw","kind":"import-statement","original":"./loader-app/bridge.ts?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/entry.tsx?raw","kind":"import-statement","original":"./loader-app/entry.tsx?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/Loader.tsx?raw","kind":"import-statement","original":"./loader-app/Loader.tsx?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/mount.tsx?raw","kind":"import-statement","original":"./loader-app/mount.tsx?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/store.ts?raw","kind":"import-statement","original":"./loader-app/store.ts?raw"},{"path":"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/types.ts?raw","kind":"import-statement","original":"./loader-app/types.ts?raw"}],"format":"esm"},"src/vite-plugin/boot-loader/index.ts":{"bytes":370,"imports":[{"path":"src/vite-plugin/boot-loader/loader.ts","kind":"import-statement","original":"./loader"}],"format":"esm"},"src/core/activation-event.ts":{"bytes":5125,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/core/capability.ts":{"bytes":22195,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Layer","kind":"import-statement","external":true}],"format":"esm"},"src/core/capability-manager.ts":{"bytes":21066,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Deferred","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/core/plugin.ts":{"bytes":44629,"imports":[{"path":"effect/Context","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"effect/Pipeable","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"src/core/capability.ts","kind":"import-statement","original":"./capability"}],"format":"esm"},"src/core/plugin-asset-cache.ts":{"bytes":4505,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true}],"format":"esm"},"src/core/registry.ts":{"bytes":13496,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/core/plugin-manager.ts":{"bytes":201125,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Array","kind":"import-statement","external":true},{"path":"effect/Cause","kind":"import-statement","external":true},{"path":"effect/Deferred","kind":"import-statement","external":true},{"path":"effect/Duration","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Fiber","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"effect/HashSet","kind":"import-statement","external":true},{"path":"effect/PubSub","kind":"import-statement","external":true},{"path":"effect/Ref","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/core/activation-event.ts","kind":"import-statement","original":"./activation-event"},{"path":"src/core/capability.ts","kind":"import-statement","original":"./capability"},{"path":"src/core/capability-manager.ts","kind":"import-statement","original":"./capability-manager"},{"path":"src/core/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"src/core/registry.ts","kind":"import-statement","original":"./registry"}],"format":"esm"},"src/core/plugin-manifest.ts":{"bytes":16742,"imports":[{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientRequest","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientResponse","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"src/core/edge-registry-plugin-provider.ts":{"bytes":12425,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true}],"format":"esm"},"src/core/url-loader.ts":{"bytes":48854,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/core/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"src/core/plugin-asset-cache.ts","kind":"import-statement","original":"./plugin-asset-cache"},{"path":"src/core/plugin-manifest.ts","kind":"import-statement","original":"./plugin-manifest"}],"format":"esm"},"src/core/index.ts":{"bytes":2385,"imports":[{"path":"src/core/activation-event.ts","kind":"import-statement","original":"./activation-event"},{"path":"src/core/capability.ts","kind":"import-statement","original":"./capability"},{"path":"src/core/capability-manager.ts","kind":"import-statement","original":"./capability-manager"},{"path":"src/core/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"src/core/plugin-asset-cache.ts","kind":"import-statement","original":"./plugin-asset-cache"},{"path":"src/core/plugin-manager.ts","kind":"import-statement","original":"./plugin-manager"},{"path":"src/core/plugin-manifest.ts","kind":"import-statement","original":"./plugin-manifest"},{"path":"src/core/plugin-manifest.ts","kind":"import-statement","original":"./plugin-manifest"},{"path":"src/core/registry.ts","kind":"import-statement","original":"./registry"},{"path":"src/core/edge-registry-plugin-provider.ts","kind":"import-statement","original":"./edge-registry-plugin-provider"},{"path":"src/core/url-loader.ts","kind":"import-statement","original":"./url-loader"}],"format":"esm"},"src/vite-plugin/manifest.ts":{"bytes":6238,"imports":[{"path":"@dxos/protocols","kind":"import-statement","external":true}],"format":"esm"},"src/vite-plugin/packages.ts":{"bytes":14365,"imports":[],"format":"esm"},"src/vite-plugin/composer/index.ts":{"bytes":40886,"imports":[{"path":"src/core/index.ts","kind":"import-statement","original":"../../core"},{"path":"src/vite-plugin/manifest.ts","kind":"import-statement","original":"../manifest"},{"path":"src/vite-plugin/packages.ts","kind":"import-statement","original":"../packages"}],"format":"esm"},"src/vite-plugin/import-map/index.ts":{"bytes":65305,"imports":[{"path":"cjs-module-lexer","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/vite-plugin/packages.ts","kind":"import-statement","original":"../packages"}],"format":"esm"},"src/vite-plugin/index.ts":{"bytes":1044,"imports":[{"path":"src/vite-plugin/boot-loader/index.ts","kind":"import-statement","original":"./boot-loader"},{"path":"src/vite-plugin/composer/index.ts","kind":"import-statement","original":"./composer"},{"path":"src/vite-plugin/import-map/index.ts","kind":"import-statement","original":"./import-map"},{"path":"src/vite-plugin/packages.ts","kind":"import-statement","original":"./packages"}],"format":"esm"}},"outputs":{"dist/plugin/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":108275},"dist/plugin/node-esm/index.mjs":{"imports":[{"path":"@babel/core","kind":"import-statement","external":true},{"path":"@babel/preset-typescript","kind":"import-statement","external":true},{"path":"babel-preset-solid","kind":"import-statement","external":true},{"path":"esbuild","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"@effect/platform/FetchHttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClient","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientRequest","kind":"import-statement","external":true},{"path":"@effect/platform/HttpClientResponse","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/errors","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"cjs-module-lexer","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"exports":["DEFAULT_PACKAGES","ENTRY_FILENAME","MANIFEST_ASSET_NAME","bootLoaderPlugin","composerPlugin","importMapPlugin","isSharedPackage","serializeManifest"],"entryPoint":"src/vite-plugin/index.ts","inputs":{"src/vite-plugin/boot-loader/loader.ts":{"bytesInOutput":3862},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/boot-loader.css?raw":{"bytesInOutput":10757},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/bridge.ts?raw":{"bytesInOutput":910},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/entry.tsx?raw":{"bytesInOutput":763},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/Loader.tsx?raw":{"bytesInOutput":7245},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/mount.tsx?raw":{"bytesInOutput":2348},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/store.ts?raw":{"bytesInOutput":5834},"raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/types.ts?raw":{"bytesInOutput":2890},"src/vite-plugin/index.ts":{"bytesInOutput":0},"src/core/index.ts":{"bytesInOutput":0},"src/core/plugin-manifest.ts":{"bytesInOutput":799},"src/vite-plugin/manifest.ts":{"bytesInOutput":394},"src/vite-plugin/packages.ts":{"bytesInOutput":3227},"src/vite-plugin/composer/index.ts":{"bytesInOutput":8952},"src/vite-plugin/import-map/index.ts":{"bytesInOutput":13362}},"bytes":62672}}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as Command from '@effect/cli/Command';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import { Plugin, PluginManager } from '../core';
|
|
5
|
+
type SubCommands = [Command.Command<any, any, any, any>, ...Array<Command.Command<any, any, any, any>>];
|
|
6
|
+
export type CreateCliAppOptions = {
|
|
7
|
+
rootCommand: Command.Command<any, any, any, any>;
|
|
8
|
+
subCommands?: SubCommands;
|
|
9
|
+
pluginManager?: PluginManager.PluginManager;
|
|
10
|
+
pluginLoader?: PluginManager.ManagerOptions['pluginLoader'];
|
|
11
|
+
plugins?: Plugin.Plugin[];
|
|
12
|
+
enabled?: string[];
|
|
13
|
+
safeMode?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Creates a CLI application with plugin support.
|
|
17
|
+
* Similar to useApp but for CLI environments.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const plugins = [ClientPluginCLI()];
|
|
21
|
+
* const manager = await createCliApp({ plugins });
|
|
22
|
+
* const commands = manager.capabilities.getAll(Capabilities.Command);
|
|
23
|
+
*
|
|
24
|
+
* @param options.pluginManager Optional existing PluginManager instance.
|
|
25
|
+
* @param options.pluginLoader Function to load plugins by ID.
|
|
26
|
+
* @param options.plugins All plugins available to the application. Plugins whose `meta.tags` includes `'system'` are treated as core.
|
|
27
|
+
* @param options.enabled Enabled plugins.
|
|
28
|
+
* @param options.safeMode Whether to enable safe mode, which disables optional plugins.
|
|
29
|
+
*/
|
|
30
|
+
export declare const createCliApp: (args_0: CreateCliAppOptions) => Effect.Effect<{
|
|
31
|
+
command: Command.Command<any, any, any, {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
}>;
|
|
34
|
+
layer: Layer.Layer<any, any, never>;
|
|
35
|
+
}, Error, never>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/cli/cli.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAKtC,OAAO,EAAc,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW5D,KAAK,WAAW,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAExG,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC;IAC5C,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY;;;;;gBAoDvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActivationEvent as ActivationEvent$ } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* Fired when the app is started.
|
|
4
|
+
*/
|
|
5
|
+
export declare const Startup: ActivationEvent$.ActivationEvent;
|
|
6
|
+
/**
|
|
7
|
+
* Fired to load any newly available surfaces.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SetupReactSurface: ActivationEvent$.ActivationEvent;
|
|
10
|
+
/**
|
|
11
|
+
* Fired before the process manager is created.
|
|
12
|
+
* Plugins should contribute their {@link Capabilities.LayerSpec} entries and
|
|
13
|
+
* {@link Capabilities.OperationHandler} sets before this event fires so the
|
|
14
|
+
* process manager's {@link ServiceResolver} and {@link OperationInvoker} pick
|
|
15
|
+
* them up at construction time.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SetupProcessManager: ActivationEvent$.ActivationEvent;
|
|
18
|
+
/**
|
|
19
|
+
* Fired after the process manager runtime is ready and its derived capabilities
|
|
20
|
+
* (`ProcessManagerRuntime`, `ServiceResolver`, `ProcessMonitor`, `OperationInvoker`)
|
|
21
|
+
* have been contributed.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ProcessManagerReady: ActivationEvent$.ActivationEvent;
|
|
24
|
+
//# sourceMappingURL=activation-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation-events.d.ts","sourceRoot":"","sources":["../../../../src/common/activation-events.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,IAAI,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,OAAO,kCAAgE,CAAC;AAMrF;;GAEG;AACH,eAAO,MAAM,iBAAiB,kCAA4E,CAAC;AAE3G;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,kCAA8E,CAAC;AAM/G;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,kCAA8E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../../src/common/annotations.ts"],"names":[],"mappings":""}
|