@dxos/app-framework 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.mts +1 -1
- package/.storybook/preview.mts +2 -2
- package/CHANGELOG.md +93 -0
- package/TASKS.md +11 -0
- package/dist/lib/chunk-SurfaceManager.mjs +960 -0
- package/dist/lib/chunk-SurfaceManager.mjs.map +1 -0
- package/dist/lib/chunk-capability.mjs +15 -0
- package/dist/lib/chunk-capability.mjs.map +1 -0
- package/dist/lib/{browser/chunk-FJ4765WW.mjs → chunk-context.mjs} +4 -5
- package/dist/lib/chunk-context.mjs.map +1 -0
- package/dist/lib/chunk-history-tracker.mjs +160 -0
- package/dist/lib/chunk-history-tracker.mjs.map +1 -0
- package/dist/lib/chunk-plugin-manager.mjs +1390 -0
- package/dist/lib/chunk-plugin-manager.mjs.map +1 -0
- package/dist/lib/chunk-plugin-manifest.mjs +125 -0
- package/dist/lib/chunk-plugin-manifest.mjs.map +1 -0
- package/dist/lib/chunk-process-manager-capability.mjs +126 -0
- package/dist/lib/chunk-process-manager-capability.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-url-loader.mjs +347 -0
- package/dist/lib/chunk-url-loader.mjs.map +1 -0
- package/dist/lib/cli.mjs +78 -0
- package/dist/lib/cli.mjs.map +1 -0
- package/dist/lib/common/activation-events.mjs +35 -0
- package/dist/lib/common/activation-events.mjs.map +1 -0
- package/dist/lib/common/capabilities.mjs +184 -0
- package/dist/lib/common/capabilities.mjs.map +1 -0
- package/dist/lib/config.mjs +2 -0
- package/dist/lib/core/activation-event.mjs +55 -0
- package/dist/lib/core/activation-event.mjs.map +1 -0
- package/dist/lib/core/capability.mjs +189 -0
- package/dist/lib/core/capability.mjs.map +1 -0
- package/dist/lib/core/plugin-manager.mjs +2 -0
- package/dist/lib/core/plugin.mjs +340 -0
- package/dist/lib/core/plugin.mjs.map +1 -0
- package/dist/lib/core/url-loader.mjs +2 -0
- package/dist/lib/index.mjs +134 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/testing/react.mjs +70 -0
- package/dist/lib/testing/react.mjs.map +1 -0
- package/dist/lib/testing.mjs +399 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/ui.mjs +636 -0
- package/dist/lib/ui.mjs.map +1 -0
- package/dist/lib/vite-plugin.mjs +986 -0
- package/dist/lib/vite-plugin.mjs.map +1 -0
- package/dist/plugin/node-esm/index.mjs +4 -3
- package/dist/plugin/node-esm/index.mjs.map +3 -3
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/types/src/common/Role.d.ts +31 -0
- package/dist/types/src/common/Role.d.ts.map +1 -0
- package/dist/types/src/common/Role.test.d.ts +2 -0
- package/dist/types/src/common/Role.test.d.ts.map +1 -0
- package/dist/types/src/common/capabilities.d.ts +11 -2
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +1 -0
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/core/capability-manager.d.ts +1 -1
- package/dist/types/src/core/capability-manager.d.ts.map +1 -1
- package/dist/types/src/core/capability.d.ts +38 -5
- package/dist/types/src/core/capability.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts +1 -1
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +14 -1
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +1 -1
- package/dist/types/src/core/registry.d.ts.map +1 -1
- package/dist/types/src/plugin-process-manager/history/capability.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +1 -1
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -1
- package/dist/types/src/testing/StorybookErrorFallback.d.ts +15 -0
- package/dist/types/src/testing/StorybookErrorFallback.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +1 -1
- package/dist/types/src/testing/harness.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/react.d.ts +4 -4
- package/dist/types/src/testing/react.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.stories.d.ts +6 -0
- package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
- package/dist/types/src/testing/withSurfaceDebug.d.ts +10 -0
- package/dist/types/src/testing/withSurfaceDebug.d.ts.map +1 -0
- package/dist/types/src/ui/components/App/App.d.ts +0 -32
- package/dist/types/src/ui/components/App/App.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/index.d.ts +1 -0
- package/dist/types/src/ui/components/App/index.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/loader.d.ts +35 -0
- package/dist/types/src/ui/components/App/loader.d.ts.map +1 -0
- package/dist/types/src/ui/components/HomeSection/HomeSection.d.ts +26 -0
- package/dist/types/src/ui/components/HomeSection/HomeSection.d.ts.map +1 -0
- package/dist/types/src/ui/components/HomeSection/HomeSection.stories.d.ts +15 -0
- package/dist/types/src/ui/components/HomeSection/HomeSection.stories.d.ts.map +1 -0
- package/dist/types/src/ui/components/HomeSection/index.d.ts +2 -0
- package/dist/types/src/ui/components/HomeSection/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/NamePopover/NamePopover.d.ts +14 -0
- package/dist/types/src/ui/components/NamePopover/NamePopover.d.ts.map +1 -0
- package/dist/types/src/ui/components/NamePopover/index.d.ts +2 -0
- package/dist/types/src/ui/components/NamePopover/index.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +21 -9
- package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts +4 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceComponent.test.d.ts +2 -0
- package/dist/types/src/ui/components/Surface/SurfaceComponent.test.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceDebug.d.ts +40 -0
- package/dist/types/src/ui/components/Surface/SurfaceDebug.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceManager.d.ts +23 -0
- package/dist/types/src/ui/components/Surface/SurfaceManager.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceManagerContext.d.ts +11 -0
- package/dist/types/src/ui/components/Surface/SurfaceManagerContext.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceMetrics.d.ts +72 -0
- package/dist/types/src/ui/components/Surface/SurfaceMetrics.d.ts.map +1 -0
- package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/index.d.ts +20 -25
- package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/types.d.ts +56 -52
- package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
- package/dist/types/src/ui/components/index.d.ts +2 -0
- package/dist/types/src/ui/components/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/moon.yml +25 -18
- package/package.json +58 -73
- package/src/common/Role.test.ts +41 -0
- package/src/common/Role.ts +54 -0
- package/src/common/capabilities.ts +17 -2
- package/src/common/index.ts +1 -0
- package/src/core/capability-manager.test.ts +1 -1
- package/src/core/capability-manager.ts +1 -1
- package/src/core/capability.ts +45 -6
- package/src/core/plugin-manager.test.ts +38 -3
- package/src/core/plugin-manager.ts +18 -1
- package/src/core/plugin.ts +16 -1
- package/src/core/registry.ts +1 -1
- package/src/plugin-process-manager/process-manager-capability.ts +25 -2
- package/src/testing/StorybookErrorFallback.tsx +40 -0
- package/src/testing/harness.ts +1 -1
- package/src/testing/index.ts +2 -0
- package/src/testing/react.test.tsx +2 -1
- package/src/testing/react.tsx +14 -8
- package/src/testing/withPluginManager.stories.tsx +16 -1
- package/src/testing/withPluginManager.tsx +13 -2
- package/src/testing/withSurfaceDebug.tsx +22 -0
- package/src/ui/components/App/App.tsx +7 -35
- package/src/ui/components/App/index.ts +1 -0
- package/src/ui/components/App/loader.ts +39 -0
- package/src/ui/components/HomeSection/HomeSection.stories.tsx +43 -0
- package/src/ui/components/HomeSection/HomeSection.tsx +69 -0
- package/src/ui/components/HomeSection/index.ts +5 -0
- package/src/ui/components/NamePopover/NamePopover.tsx +70 -0
- package/src/ui/components/NamePopover/index.ts +5 -0
- package/src/ui/components/Surface/DESIGN.md +136 -0
- package/src/ui/components/Surface/SurfaceComponent.stories.tsx +70 -41
- package/src/ui/components/Surface/SurfaceComponent.test.tsx +403 -0
- package/src/ui/components/Surface/SurfaceComponent.tsx +209 -189
- package/src/ui/components/Surface/SurfaceDebug.tsx +435 -0
- package/src/ui/components/Surface/SurfaceManager.ts +95 -0
- package/src/ui/components/Surface/SurfaceManagerContext.ts +23 -0
- package/src/ui/components/Surface/SurfaceMetrics.ts +202 -0
- package/src/ui/components/Surface/SurfaceProfilerContext.tsx +12 -2
- package/src/ui/components/Surface/index.ts +24 -22
- package/src/ui/components/Surface/types.test.ts +47 -54
- package/src/ui/components/Surface/types.ts +66 -91
- package/src/ui/components/index.ts +2 -0
- package/src/ui/hooks/useApp.tsx +7 -3
- package/src/vite-plugin/boot-loader/loader-app/boot-loader.css +1 -1
- package/tsconfig.json +3 -0
- package/vite.config.ts +26 -0
- package/dist/lib/browser/capability-S44TE2H7.mjs +0 -35
- package/dist/lib/browser/capability-S44TE2H7.mjs.map +0 -7
- package/dist/lib/browser/chunk-3NQLTQCP.mjs +0 -47
- package/dist/lib/browser/chunk-3NQLTQCP.mjs.map +0 -7
- package/dist/lib/browser/chunk-53HJHMS5.mjs +0 -7
- package/dist/lib/browser/chunk-53HJHMS5.mjs.map +0 -7
- package/dist/lib/browser/chunk-FJ4765WW.mjs.map +0 -7
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-KRJ4KK2W.mjs +0 -505
- package/dist/lib/browser/chunk-KRJ4KK2W.mjs.map +0 -7
- package/dist/lib/browser/chunk-LUH4Y5F2.mjs +0 -430
- package/dist/lib/browser/chunk-LUH4Y5F2.mjs.map +0 -7
- package/dist/lib/browser/chunk-NKVRSMFN.mjs +0 -95
- package/dist/lib/browser/chunk-NKVRSMFN.mjs.map +0 -7
- package/dist/lib/browser/chunk-OO53M5UK.mjs +0 -260
- package/dist/lib/browser/chunk-OO53M5UK.mjs.map +0 -7
- package/dist/lib/browser/chunk-OPTS3ZSN.mjs +0 -83
- package/dist/lib/browser/chunk-OPTS3ZSN.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q2GLJTVV.mjs +0 -12
- package/dist/lib/browser/chunk-Q2GLJTVV.mjs.map +0 -7
- package/dist/lib/browser/chunk-SYXIYT6T.mjs +0 -143
- package/dist/lib/browser/chunk-SYXIYT6T.mjs.map +0 -7
- package/dist/lib/browser/chunk-U5MESPM5.mjs +0 -603
- package/dist/lib/browser/chunk-U5MESPM5.mjs.map +0 -7
- package/dist/lib/browser/chunk-UGYCLOXE.mjs +0 -1471
- package/dist/lib/browser/chunk-UGYCLOXE.mjs.map +0 -7
- package/dist/lib/browser/chunk-VF37YTXJ.mjs +0 -28
- package/dist/lib/browser/chunk-VF37YTXJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-YUVQIOTB.mjs +0 -60
- package/dist/lib/browser/chunk-YUVQIOTB.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs +0 -74
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/common/activation-events.mjs +0 -20
- package/dist/lib/browser/common/activation-events.mjs.map +0 -7
- package/dist/lib/browser/common/capabilities.mjs +0 -56
- package/dist/lib/browser/common/capabilities.mjs.map +0 -7
- package/dist/lib/browser/config/index.mjs +0 -8
- package/dist/lib/browser/config/index.mjs.map +0 -7
- package/dist/lib/browser/core/activation-event.mjs +0 -20
- package/dist/lib/browser/core/activation-event.mjs.map +0 -7
- package/dist/lib/browser/core/capability.mjs +0 -32
- package/dist/lib/browser/core/capability.mjs.map +0 -7
- package/dist/lib/browser/core/plugin-manager.mjs +0 -19
- package/dist/lib/browser/core/plugin-manager.mjs.map +0 -7
- package/dist/lib/browser/core/plugin.mjs +0 -51
- package/dist/lib/browser/core/plugin.mjs.map +0 -7
- package/dist/lib/browser/core/url-loader.mjs +0 -24
- package/dist/lib/browser/core/url-loader.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -98
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/process-manager-capability-QK4BMKMN.mjs +0 -132
- package/dist/lib/browser/process-manager-capability-QK4BMKMN.mjs.map +0 -7
- package/dist/lib/browser/testing/index.mjs +0 -359
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/browser/testing/react.mjs +0 -78
- package/dist/lib/browser/testing/react.mjs.map +0 -7
- package/dist/lib/browser/ui/index.mjs +0 -60
- package/dist/lib/browser/ui/index.mjs.map +0 -7
- package/dist/lib/node-esm/capability-3YRF77LV.mjs +0 -36
- package/dist/lib/node-esm/capability-3YRF77LV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2UPUZXGU.mjs +0 -9
- package/dist/lib/node-esm/chunk-2UPUZXGU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +0 -10
- package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4SE7SX7N.mjs +0 -261
- package/dist/lib/node-esm/chunk-4SE7SX7N.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BMW6P6QA.mjs +0 -48
- package/dist/lib/node-esm/chunk-BMW6P6QA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-COHOWGGJ.mjs +0 -144
- package/dist/lib/node-esm/chunk-COHOWGGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DRT75WGD.mjs +0 -604
- package/dist/lib/node-esm/chunk-DRT75WGD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FKMVORZN.mjs +0 -431
- package/dist/lib/node-esm/chunk-FKMVORZN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FPW45EZH.mjs +0 -14
- package/dist/lib/node-esm/chunk-FPW45EZH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GLH4LGHZ.mjs +0 -84
- package/dist/lib/node-esm/chunk-GLH4LGHZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IL7O7IRX.mjs +0 -1472
- package/dist/lib/node-esm/chunk-IL7O7IRX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ND2HETHD.mjs +0 -506
- package/dist/lib/node-esm/chunk-ND2HETHD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TLKYZKPW.mjs +0 -29
- package/dist/lib/node-esm/chunk-TLKYZKPW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VCPGX7WN.mjs +0 -62
- package/dist/lib/node-esm/chunk-VCPGX7WN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XSZMX53L.mjs +0 -96
- package/dist/lib/node-esm/chunk-XSZMX53L.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -75
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/common/activation-events.mjs +0 -21
- package/dist/lib/node-esm/common/activation-events.mjs.map +0 -7
- package/dist/lib/node-esm/common/capabilities.mjs +0 -57
- package/dist/lib/node-esm/common/capabilities.mjs.map +0 -7
- package/dist/lib/node-esm/config/index.mjs +0 -9
- package/dist/lib/node-esm/config/index.mjs.map +0 -7
- package/dist/lib/node-esm/core/activation-event.mjs +0 -21
- package/dist/lib/node-esm/core/activation-event.mjs.map +0 -7
- package/dist/lib/node-esm/core/capability.mjs +0 -33
- package/dist/lib/node-esm/core/capability.mjs.map +0 -7
- package/dist/lib/node-esm/core/plugin-manager.mjs +0 -20
- package/dist/lib/node-esm/core/plugin-manager.mjs.map +0 -7
- package/dist/lib/node-esm/core/plugin.mjs +0 -52
- package/dist/lib/node-esm/core/plugin.mjs.map +0 -7
- package/dist/lib/node-esm/core/url-loader.mjs +0 -25
- package/dist/lib/node-esm/core/url-loader.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -99
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/process-manager-capability-5S7WZ2JR.mjs +0 -133
- package/dist/lib/node-esm/process-manager-capability-5S7WZ2JR.mjs.map +0 -7
- package/dist/lib/node-esm/testing/index.mjs +0 -360
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/testing/react.mjs +0 -79
- package/dist/lib/node-esm/testing/react.mjs.map +0 -7
- package/dist/lib/node-esm/ui/index.mjs +0 -61
- package/dist/lib/node-esm/ui/index.mjs.map +0 -7
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +0 -11
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +0 -1
- package/src/ui/components/Surface/SurfaceInfo.tsx +0 -106
- package/vitest.config.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin.mjs","names":[],"sources":["../../src/vite-plugin/boot-loader/loader.ts","../../src/vite-plugin/load.ts","../../src/vite-plugin/manifest.ts","../../src/vite-plugin/packages.ts","../../src/vite-plugin/composer/index.ts","../../src/vite-plugin/import-map/index.ts"],"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 { type Plugin as EsbuildPlugin, build } 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// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport { build } from 'esbuild';\nimport { randomUUID } from 'node:crypto';\nimport { existsSync } from 'node:fs';\nimport { rm, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { Config2 } from '@dxos/protocols';\n\nconst CONFIG_BASENAMES = ['dx.config.ts', 'dx.config.mjs', 'dx.config.js'];\n\nconst decodeConfig2 = Schema.decodeUnknownSync(Config2.Config);\n\n/**\n * Resolves the first `dx.config.{ts,mjs,js}` found under `dir`, or `undefined` if none exist.\n * Pass the result to {@link loadDxConfig}.\n */\nexport const findDxConfigFile = (dir: string): string | undefined =>\n CONFIG_BASENAMES.map((basename) => join(dir, basename)).find((candidate) => existsSync(candidate));\n\n/**\n * Loads and validates a `dx.config.ts` (or `.mjs`/`.js`) file at the given `filePath`.\n *\n * Transpiles the file with esbuild — leaving its bare imports (`@dxos/protocols`, `@dxos/app-framework`, …)\n * external so they resolve from the project's `node_modules` — imports the result, then decodes the\n * default export against the `Config2` schema (a malformed config throws a `Schema` parse error).\n * Node-only (esbuild + filesystem); used by `composerPlugin` and `dx registry publish`.\n */\nexport const loadDxConfig = async (filePath: string): Promise<Config2.Config> => {\n const result = await build({\n entryPoints: [filePath],\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n // Leave node_modules (incl. @dxos/*) as runtime imports so the temp module below resolves them\n // from the project's node_modules rather than inlining heavy deps (effect, etc.) on every load.\n packages: 'external',\n logLevel: 'silent',\n });\n\n // Import via a temp file so its externalized bare specifiers resolve against the project's\n // node_modules (a data-URL import cannot resolve bare specifiers).\n const tempPath = join(filePath, '..', `.dx.config.${randomUUID()}.mjs`);\n try {\n await writeFile(tempPath, result.outputFiles[0].text, 'utf-8');\n const module = await import(pathToFileURL(tempPath).href);\n return decodeConfig2(module.default);\n } finally {\n await rm(tempPath, { force: true });\n }\n};\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 * Flat plugin metadata emitted into `manifest.json` at build time (the shape validated by\n * `@dxos/protocols` `PluginManifestSchema`).\n *\n * The runtime {@link Plugin.Meta} nests its display/identity fields under `profile`; the build\n * manifest is intentionally flat, so this is the {@link Plugin.Profile} content plus build-time fields:\n * the package `version`, and a `dependencies` snapshot (every declared dependency resolved to its\n * concrete installed version). The host derives SDK compatibility from the subset of `dependencies`\n * it shares with the plugin (the externalized `@dxos/*` packages); the rest are recorded for transparency.\n */\nexport type BuildMeta = Plugin.Profile & { version: string; dependencies?: Record<string, string> };\n\n/**\n * Flattens a runtime {@link Plugin.Meta}'s `profile` and augments it with the build-time fields\n * needed to emit `manifest.json`: the package `version` (from the publishing project's `package.json`)\n * and an optional resolved `dependencies` snapshot. Produces the {@link BuildMeta} that `composerPlugin`\n * serializes.\n */\nexport const toBuildMeta = (meta: Plugin.Meta, version: string, dependencies?: Record<string, string>): BuildMeta => ({\n ...meta.profile,\n version,\n ...(dependencies ? { dependencies } : {}),\n});\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 return JSON.stringify(\n {\n ...meta,\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-syntax-highlighter',\n '@dxos/react-ui-table',\n '@dxos/react-ui-tabs',\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 { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { type Plugin as VitePlugin } from 'vite';\n\nimport { Plugin, PLUGIN_DEV_SERVER_PORT } from '../../core';\nimport { findDxConfigFile, loadDxConfig } from '../load';\nimport { type BuildMeta, ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest, toBuildMeta } 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/** Reads `version` from the project's `package.json`; falls back to `0.0.0`. */\nconst readPackageVersion = (dir: string): string => {\n try {\n return JSON.parse(readFileSync(join(dir, 'package.json'), 'utf-8')).version ?? '0.0.0';\n } catch {\n return '0.0.0';\n }\n};\n\n/**\n * Snapshot the project's declared `dependencies`, resolving each to its concrete\n * installed version (read from `node_modules/<name>/package.json`) so the manifest\n * records exactly what the plugin was built against — the host derives SDK\n * compatibility from the `@dxos/*` subset. Falls back to the declared spec when a\n * dependency can't be resolved on disk.\n */\nconst readResolvedDependencies = (dir: string): Record<string, string> | undefined => {\n try {\n const declared = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf-8')).dependencies as\n | Record<string, string>\n | undefined;\n if (!declared) {\n return undefined;\n }\n const resolved: Record<string, string> = {};\n for (const name of Object.keys(declared)) {\n try {\n const version = JSON.parse(readFileSync(join(dir, 'node_modules', name, 'package.json'), 'utf-8')).version;\n resolved[name] = typeof version === 'string' ? version : declared[name];\n } catch {\n resolved[name] = declared[name];\n }\n }\n return Object.keys(resolved).length > 0 ? resolved : undefined;\n } catch {\n return undefined;\n }\n};\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 * Path to the project's `dx.config.ts`. Defaults to auto-discovery in the project root\n * (`dx.config.{ts,mjs,js}`). Used only to derive the manifest metadata.\n */\n config?: string;\n /**\n * Plugin metadata. Optional — when omitted it is derived from the project's `dx.config.ts`\n * (`@dxos/protocols` `Config2.Config`) plus the `package.json` version and resolved dependencies. When\n * present (explicitly or derived), a `manifest.json` asset is emitted alongside the bundle listing\n * every emitted file. The host fetches this manifest at install time and persists the declared\n * assets in its offline cache so the plugin works without network. The bundle's entry module is\n * 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 projectRoot = process.cwd();\n\n // Plugin metadata source of truth is `dx.config.ts` (`@dxos/protocols` `Config2.Config`). When the caller\n // doesn't pass `meta` explicitly, load + validate the config and derive a `BuildMeta` from it\n // (augmented with the package `version` and a resolved dependency snapshot). Resolved once,\n // lazily, so the synchronous plugin factory stays sync; the manifest hooks await it.\n const metaPromise: Promise<BuildMeta | undefined> = options?.meta\n ? Promise.resolve(options.meta)\n : Promise.resolve(options?.config ?? findDxConfigFile(projectRoot)).then((configFile) =>\n configFile\n ? loadDxConfig(configFile).then((config) =>\n toBuildMeta(\n Plugin.getMetaFromConfig(config),\n readPackageVersion(projectRoot),\n readResolvedDependencies(projectRoot),\n ),\n )\n : undefined,\n );\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 // 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. No-ops when no `dx.config.ts`/`meta` resolves.\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 async generateBundle(_options, bundle) {\n const meta = await metaPromise;\n if (!meta) {\n return;\n }\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 async configureServer(server) {\n const meta = await metaPromise;\n if (!meta) {\n return;\n }\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 return plugins;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { init as initCjsLexer, parse as parseCjs } from 'cjs-module-lexer';\nimport { existsSync, readdirSync, readFileSync, 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-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 let root = process.cwd();\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 root = config.root;\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 // Resolve with a host-rooted importer (not a bare importer-less resolve). The host's\n // `importSource` plugin — which routes `@dxos/*` to the `source` (TypeScript) export\n // instead of the published `dist/` — bails out when `importer` is undefined, so an\n // importer-less `this.resolve(specifier)` falls through to the `default`/dist export.\n // That made wrapper chunks evaluate `dist/` while the host app evaluated `src/`,\n // duplicating module-local identity (the private `ProxyHandlerSlot` class, `Ref`\n // brand symbols, React contexts) and breaking `instanceof` across the host↔plugin\n // boundary. Passing a host-rooted importer makes `importSource` resolve these\n // wrappers to the exact same source module the host app uses.\n const resolved = await this.resolve(specifier, path.join(root, 'index.html'));\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 // Re-export from the resolved absolute path, not the bare specifier. A bare re-export\n // would let Rolldown resolve `@dxos/echo` a second way (the host app reaches it via the\n // `source` export, this virtual module via the published `dist/`), evaluating the same\n // source twice and duplicating module-local identity — the private `ProxyHandlerSlot`\n // class, `Ref` brand symbols, React contexts — which breaks `instanceof` and context\n // lookups across the host↔remote-plugin boundary. The resolved id (see the importer\n // passed to `this.resolve` above) already points at the host's module.\n const filePath = trimQueryString(resolvedId);\n const isCjs = filePath.endsWith('.cjs') || (!filePath.endsWith('.mjs') && !resolvedIdIsEsmModule(filePath));\n if (isCjs) {\n const named = getCjsNamedExports(filePath);\n if (named.length > 0) {\n return `export { default, ${named.join(', ')} } from ${JSON.stringify(filePath)};\\n${keepalive}\\n`;\n }\n }\n return `export * from ${JSON.stringify(filePath)};\\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,IAAM,aAAa;AAMnB,IAAM,UAA8D;CAClE,OAAO;EAAE,UAAU;EAAU,KAAK;CAAK;CACvC,OAAO;EAAE,UAAU;EAAU,KAAK;CAAK;CACvC,QAAQ;EAAE,UAAU;EAAW,KAAK;CAAK;CACzC,QAAQ;EAAE,UAAU;EAAW,KAAK;CAAM;CAC1C,OAAO;EAAE,UAAU;EAAU,KAAK;CAAM;CACxC,OAAO;EAAE,UAAU;EAAU,KAAK;CAAM;AAC1C;AAIA,IAAM,aAAa,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC;;;;;;;AAQzD,IAAM,sBAAsB,YAA6B;CACvD,MAAM,sBAAqC;EACzC,MAAM;EACN,QAAQ,YAAY;GAClB,QAAQ,UAAU,EAAE,QAAQ,QAAQ,IAAI,SAAS;IAC/C,MAAM,OAAO,KAAK,KAAK,QAAQ,SAAS,EAAE,CAAC,CAAC,QAAQ,kBAAkB,EAAE;IACxE,OAAO,QAAQ,UAA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;EACE,GAAG;EACH;EACA,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;CAC/C,GACA,MACA,CACF;AACF;AChCA,IAAa,mBAAmB;CAE9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA,GAAG;EA3IH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAoIG;AACL;;;;;;;;;;;AAYA,IAAa,mBAAmB,OAC9B,iBAAiB,MAAM,QAAQ,OAAO,OAAO,GAAG,WAAW,GAAG,IAAI,EAAE,CAAC;;;ACxKvE,IAAM,kBAAkB;;AAGxB,IAAM,sBAAsB,QAAwB;CAClD,IAAI;EACF,OAAO,KAAK,MAAM,aAAa,KAAK,KAAK,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW;CACjF,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,IAAM,4BAA4B,QAAoD;CACpF,IAAI;EACF,MAAM,WAAW,KAAK,MAAM,aAAa,KAAK,KAAK,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;EAG9E,IAAI,CAAC,UACH;EAEF,MAAM,WAAmC,CAAC;EAC1C,KAAK,MAAM,QAAQ,OAAO,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S,SAAS,MAAM,KAAM,CAAC,SAAS,SAAS,MAAM,KAAK,CAAC,sBAAsB,QAAQ,GAC9F;IACT,MAAM,QAAQ,mBAAmB,QAAQ;IACzC,IAAI,MAAM,SAAS,GACjB,OAAO,qBAAqB,MAAM,KAAK,IAAI,EAAE,UAAU,KAAK,UAAU,QAAQ,EAAE,KAAK,UAAU;GAEnG;GACA,OAAO,iBAAiB,KAAK,UAAU,QAAQ,EAAE,KAAK,UAAU;EAClE;EAKA,iBAAiB;GACf,IAAI,gBACF;GAGF,UAAU;IACR,GAAG;IACH,GAAG,OAAO,YACR,QACG,QAAQ,cAAc,YAAY,eAAe,KAAA,CAAS,CAAA,CAC1D,KAAK,cAAc,CAAC,WAAW,GAAG,OAAO,KAAK,YAAY,YAAY,UAAU,GAAG,CAAC,CACzF;GACF;EACF;CACF,GAGA;EACE,MAAM;EACN,OAAO;EACP,SAAS;EACT,mBAAmB,MAAc;GAW/B,OAAO;IACL;IACA,MAAA,CAXA;KACE,KAAK;KACL,OAAO,EACL,MAAM,YACR;KACA,UAAU,KAAK,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC/C,CAKA;GACF;EACF;CACF,CACF;AACF"}
|
|
@@ -14,7 +14,7 @@ import { basename, dirname } from "node:path";
|
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
|
|
16
16
|
// raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/boot-loader.css
|
|
17
|
-
var boot_loader_default = "/*\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";
|
|
17
|
+
var boot_loader_default = "/*\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/surfaces.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";
|
|
18
18
|
|
|
19
19
|
// raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/bridge.ts
|
|
20
20
|
var bridge_default = "//\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";
|
|
@@ -194,6 +194,7 @@ import { join as join2 } from "node:path";
|
|
|
194
194
|
import * as Context from "effect/Context";
|
|
195
195
|
import * as Effect from "effect/Effect";
|
|
196
196
|
import * as Layer from "effect/Layer";
|
|
197
|
+
import * as Option from "effect/Option";
|
|
197
198
|
var Service = class extends Context.Tag("@dxos/app-framework/CapabilityManager")() {
|
|
198
199
|
};
|
|
199
200
|
var ModuleTag = /* @__PURE__ */ Symbol.for("@dxos/app-framework/ModuleTag");
|
|
@@ -229,7 +230,7 @@ __export(plugin_exports, {
|
|
|
229
230
|
});
|
|
230
231
|
import * as Context2 from "effect/Context";
|
|
231
232
|
import * as Effect2 from "effect/Effect";
|
|
232
|
-
import * as
|
|
233
|
+
import * as Option2 from "effect/Option";
|
|
233
234
|
import * as Pipeable from "effect/Pipeable";
|
|
234
235
|
import * as Schema from "effect/Schema";
|
|
235
236
|
import { BaseError } from "@dxos/errors";
|
|
@@ -337,7 +338,7 @@ function addModule(moduleOptionsOrBuilder, moduleOptions) {
|
|
|
337
338
|
var resolveModule = (meta, module, options) => {
|
|
338
339
|
const moduleOptions = typeof module === "function" ? module(options) : module;
|
|
339
340
|
const pluginName = meta.profile.key;
|
|
340
|
-
const id =
|
|
341
|
+
const id = Option2.fromNullable(moduleOptions.id).pipe(Option2.match({
|
|
341
342
|
onNone: () => {
|
|
342
343
|
const exportName = getModuleTag(moduleOptions.activate);
|
|
343
344
|
invariant(exportName, `Plugin module missing name. Plugin: ${meta.profile.key}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 174, S: void 0, A: ["exportName", "`Plugin module missing name. Plugin: ${meta.profile.key}`"] });
|