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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (569) hide show
  1. package/.storybook/main.mts +2 -4
  2. package/.storybook/preview.mts +2 -2
  3. package/LICENSE +102 -5
  4. package/README.md +1 -1
  5. package/dist/lib/browser/capability-BOPAKKWG.mjs +35 -0
  6. package/dist/lib/browser/capability-BOPAKKWG.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
  8. package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-66IXTIVK.mjs +48 -0
  10. package/dist/lib/browser/chunk-66IXTIVK.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-CO3XLNUX.mjs +95 -0
  12. package/dist/lib/browser/chunk-CO3XLNUX.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-DC3WRPBV.mjs +227 -0
  14. package/dist/lib/browser/chunk-DC3WRPBV.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-FJ4765WW.mjs +8 -0
  16. package/dist/lib/browser/chunk-FJ4765WW.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-FO3IYSLV.mjs +68 -0
  18. package/dist/lib/browser/chunk-FO3IYSLV.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-HFLKXMT7.mjs +587 -0
  20. package/dist/lib/browser/chunk-HFLKXMT7.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-IW44C7UL.mjs +83 -0
  22. package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  24. package/dist/lib/browser/chunk-KZUDO43J.mjs +422 -0
  25. package/dist/lib/browser/chunk-KZUDO43J.mjs.map +7 -0
  26. package/dist/lib/browser/chunk-Q2GLJTVV.mjs +12 -0
  27. package/dist/lib/browser/chunk-Q2GLJTVV.mjs.map +7 -0
  28. package/dist/lib/browser/chunk-SYXIYT6T.mjs +143 -0
  29. package/dist/lib/browser/chunk-SYXIYT6T.mjs.map +7 -0
  30. package/dist/lib/browser/chunk-XHS5KDNX.mjs +1471 -0
  31. package/dist/lib/browser/chunk-XHS5KDNX.mjs.map +7 -0
  32. package/dist/lib/browser/chunk-Y66ELD4U.mjs +476 -0
  33. package/dist/lib/browser/chunk-Y66ELD4U.mjs.map +7 -0
  34. package/dist/lib/browser/cli/index.mjs +74 -0
  35. package/dist/lib/browser/cli/index.mjs.map +7 -0
  36. package/dist/lib/browser/common/activation-events.mjs +20 -0
  37. package/dist/lib/browser/common/capabilities.mjs +56 -0
  38. package/dist/lib/browser/core/activation-event.mjs +20 -0
  39. package/dist/lib/browser/core/capability.mjs +32 -0
  40. package/dist/lib/browser/core/capability.mjs.map +7 -0
  41. package/dist/lib/browser/core/plugin-manager.mjs +19 -0
  42. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  43. package/dist/lib/browser/core/plugin.mjs +41 -0
  44. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  45. package/dist/lib/browser/core/url-loader.mjs +24 -0
  46. package/dist/lib/browser/core/url-loader.mjs.map +7 -0
  47. package/dist/lib/browser/index.mjs +86 -122
  48. package/dist/lib/browser/index.mjs.map +4 -4
  49. package/dist/lib/browser/meta.json +1 -1
  50. package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs +132 -0
  51. package/dist/lib/browser/process-manager-capability-GXNUO7AR.mjs.map +7 -0
  52. package/dist/lib/browser/testing/index.mjs +316 -47
  53. package/dist/lib/browser/testing/index.mjs.map +4 -4
  54. package/dist/lib/browser/testing/react.mjs +78 -0
  55. package/dist/lib/browser/testing/react.mjs.map +7 -0
  56. package/dist/lib/browser/ui/index.mjs +52 -0
  57. package/dist/lib/browser/ui/index.mjs.map +7 -0
  58. package/dist/lib/node-esm/capability-KZWRTX7R.mjs +36 -0
  59. package/dist/lib/node-esm/capability-KZWRTX7R.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs +10 -0
  61. package/dist/lib/node-esm/chunk-37Z53PXZ.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs +588 -0
  63. package/dist/lib/node-esm/chunk-A5CHGAZE.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-COHOWGGJ.mjs +144 -0
  65. package/dist/lib/node-esm/chunk-COHOWGGJ.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs +84 -0
  67. package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-FPW45EZH.mjs +14 -0
  69. package/dist/lib/node-esm/chunk-FPW45EZH.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs +477 -0
  71. package/dist/lib/node-esm/chunk-FSVGKTF6.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  73. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
  75. package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-NULBHQYS.mjs +96 -0
  77. package/dist/lib/node-esm/chunk-NULBHQYS.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-SX5NVETP.mjs +1472 -0
  79. package/dist/lib/node-esm/chunk-SX5NVETP.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs +70 -0
  81. package/dist/lib/node-esm/chunk-WK7OIQKI.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs +423 -0
  83. package/dist/lib/node-esm/chunk-XGBUKRCK.mjs.map +7 -0
  84. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs +228 -0
  85. package/dist/lib/node-esm/chunk-XIGPWXCQ.mjs.map +7 -0
  86. package/dist/lib/node-esm/chunk-XOCUANHO.mjs +49 -0
  87. package/dist/lib/node-esm/chunk-XOCUANHO.mjs.map +7 -0
  88. package/dist/lib/node-esm/cli/index.mjs +75 -0
  89. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  90. package/dist/lib/node-esm/common/activation-events.mjs +21 -0
  91. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  92. package/dist/lib/node-esm/common/capabilities.mjs +57 -0
  93. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  94. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  95. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  96. package/dist/lib/node-esm/core/capability.mjs +33 -0
  97. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  98. package/dist/lib/node-esm/core/plugin-manager.mjs +20 -0
  99. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  100. package/dist/lib/node-esm/core/plugin.mjs +42 -0
  101. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  102. package/dist/lib/node-esm/core/url-loader.mjs +25 -0
  103. package/dist/lib/node-esm/core/url-loader.mjs.map +7 -0
  104. package/dist/lib/node-esm/index.mjs +86 -122
  105. package/dist/lib/node-esm/index.mjs.map +4 -4
  106. package/dist/lib/node-esm/meta.json +1 -1
  107. package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs +133 -0
  108. package/dist/lib/node-esm/process-manager-capability-TX5TA6YN.mjs.map +7 -0
  109. package/dist/lib/node-esm/testing/index.mjs +316 -47
  110. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  111. package/dist/lib/node-esm/testing/react.mjs +79 -0
  112. package/dist/lib/node-esm/testing/react.mjs.map +7 -0
  113. package/dist/lib/node-esm/ui/index.mjs +53 -0
  114. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  115. package/dist/plugin/node-esm/index.mjs +977 -0
  116. package/dist/plugin/node-esm/index.mjs.map +7 -0
  117. package/dist/plugin/node-esm/meta.json +1 -0
  118. package/dist/types/src/cli/cli.d.ts +37 -0
  119. package/dist/types/src/cli/cli.d.ts.map +1 -0
  120. package/dist/types/src/cli/index.d.ts +2 -0
  121. package/dist/types/src/cli/index.d.ts.map +1 -0
  122. package/dist/types/src/common/activation-events.d.ts +24 -0
  123. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  124. package/dist/types/src/common/annotations.d.ts +1 -0
  125. package/dist/types/src/common/annotations.d.ts.map +1 -0
  126. package/dist/types/src/common/capabilities.d.ts +214 -193
  127. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  128. package/dist/types/src/common/index.d.ts +3 -8
  129. package/dist/types/src/common/index.d.ts.map +1 -1
  130. package/dist/types/src/common/translations.d.ts +7 -7
  131. package/dist/types/src/common/translations.d.ts.map +1 -1
  132. package/dist/types/src/context.d.ts +5 -0
  133. package/dist/types/src/context.d.ts.map +1 -0
  134. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +11 -11
  135. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  136. package/dist/types/src/core/capability-manager.d.ts +52 -0
  137. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  138. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  139. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  140. package/dist/types/src/core/capability.d.ts +161 -0
  141. package/dist/types/src/core/capability.d.ts.map +1 -0
  142. package/dist/types/src/core/edge-registry-plugin-provider.d.ts +30 -0
  143. package/dist/types/src/core/edge-registry-plugin-provider.d.ts.map +1 -0
  144. package/dist/types/src/core/index.d.ts +11 -4
  145. package/dist/types/src/core/index.d.ts.map +1 -1
  146. package/dist/types/src/core/plugin-asset-cache.d.ts +71 -0
  147. package/dist/types/src/core/plugin-asset-cache.d.ts.map +1 -0
  148. package/dist/types/src/core/plugin-manager.d.ts +297 -0
  149. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  150. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  151. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  152. package/dist/types/src/core/plugin-manifest.d.ts +101 -0
  153. package/dist/types/src/core/plugin-manifest.d.ts.map +1 -0
  154. package/dist/types/src/core/plugin-manifest.test.d.ts +2 -0
  155. package/dist/types/src/core/plugin-manifest.test.d.ts.map +1 -0
  156. package/dist/types/src/core/plugin.d.ts +303 -43
  157. package/dist/types/src/core/plugin.d.ts.map +1 -1
  158. package/dist/types/src/core/registry.d.ts +107 -0
  159. package/dist/types/src/core/registry.d.ts.map +1 -0
  160. package/dist/types/src/core/url-loader.d.ts +127 -0
  161. package/dist/types/src/core/url-loader.d.ts.map +1 -0
  162. package/dist/types/src/core/url-loader.test.d.ts +2 -0
  163. package/dist/types/src/core/url-loader.test.d.ts.map +1 -0
  164. package/dist/types/src/helpers.d.ts.map +1 -1
  165. package/dist/types/src/index.d.ts +2 -2
  166. package/dist/types/src/index.d.ts.map +1 -1
  167. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
  168. package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
  169. package/dist/types/src/plugin-process-manager/history/capability.d.ts +7 -0
  170. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
  171. package/dist/types/src/plugin-process-manager/history/errors.d.ts +32 -0
  172. package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
  173. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts +32 -0
  174. package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
  175. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts +2 -0
  176. package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
  177. package/dist/types/src/plugin-process-manager/history/index.d.ts +6 -0
  178. package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
  179. package/dist/types/src/plugin-process-manager/history/types.d.ts +13 -0
  180. package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
  181. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts +101 -0
  182. package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
  183. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts +23 -0
  184. package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
  185. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts +2 -0
  186. package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
  187. package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts +10 -0
  188. package/dist/types/src/plugin-process-manager/idb-key-value-store.d.ts.map +1 -0
  189. package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
  190. package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
  191. package/dist/types/src/plugin-process-manager/meta.d.ts +3 -0
  192. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
  193. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
  194. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
  195. package/dist/types/src/plugin-process-manager/testing.d.ts +59 -0
  196. package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
  197. package/dist/types/src/testing/harness.d.ts +79 -0
  198. package/dist/types/src/testing/harness.d.ts.map +1 -0
  199. package/dist/types/src/testing/index.d.ts +3 -0
  200. package/dist/types/src/testing/index.d.ts.map +1 -1
  201. package/dist/types/src/testing/operationCapture.d.ts +64 -0
  202. package/dist/types/src/testing/operationCapture.d.ts.map +1 -0
  203. package/dist/types/src/testing/react.d.ts +27 -0
  204. package/dist/types/src/testing/react.d.ts.map +1 -0
  205. package/dist/types/src/testing/react.test.d.ts +2 -0
  206. package/dist/types/src/testing/react.test.d.ts.map +1 -0
  207. package/dist/types/src/testing/service.d.ts +8 -0
  208. package/dist/types/src/testing/service.d.ts.map +1 -0
  209. package/dist/types/src/testing/withPluginManager.d.ts +4 -4
  210. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  211. package/dist/types/src/testing/withPluginManager.stories.d.ts.map +1 -1
  212. package/dist/types/src/ui/components/App/App.d.ts +41 -0
  213. package/dist/types/src/ui/components/App/App.d.ts.map +1 -0
  214. package/dist/types/src/ui/components/App/App.stories.d.ts +19 -0
  215. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -0
  216. package/dist/types/src/ui/components/App/index.d.ts +2 -0
  217. package/dist/types/src/ui/components/App/index.d.ts.map +1 -0
  218. package/dist/types/src/{react/Surface.stories.d.ts → ui/components/PluginManager/PluginManagerContext.stories.d.ts} +2 -3
  219. package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -0
  220. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts +10 -0
  221. package/dist/types/src/ui/components/PluginManager/PluginManagerProvider.d.ts.map +1 -0
  222. package/dist/types/src/ui/components/PluginManager/index.d.ts +2 -0
  223. package/dist/types/src/ui/components/PluginManager/index.d.ts.map +1 -0
  224. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts +24 -0
  225. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -0
  226. package/dist/types/src/{react/App.stories.d.ts → ui/components/Surface/SurfaceComponent.stories.d.ts} +1 -1
  227. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -0
  228. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts +11 -0
  229. package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -0
  230. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +48 -0
  231. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -0
  232. package/dist/types/src/ui/components/Surface/context.d.ts +5 -0
  233. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -0
  234. package/dist/types/src/ui/components/Surface/index.d.ts +36 -0
  235. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -0
  236. package/dist/types/src/ui/components/Surface/types.d.ts +197 -0
  237. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -0
  238. package/dist/types/src/ui/components/Surface/types.test.d.ts +2 -0
  239. package/dist/types/src/ui/components/Surface/types.test.d.ts.map +1 -0
  240. package/dist/types/src/ui/components/index.d.ts +4 -0
  241. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  242. package/dist/types/src/ui/hooks/index.d.ts +7 -0
  243. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  244. package/dist/types/src/ui/hooks/useApp.d.ts +80 -0
  245. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  246. package/dist/types/src/ui/hooks/useApp.test.d.ts +2 -0
  247. package/dist/types/src/ui/hooks/useApp.test.d.ts.map +1 -0
  248. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  249. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  250. package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +1 -2
  251. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  252. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +30 -0
  253. package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
  254. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  255. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  256. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  257. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  258. package/dist/types/src/ui/index.d.ts +3 -0
  259. package/dist/types/src/ui/index.d.ts.map +1 -0
  260. package/dist/types/src/vite-plugin/boot-loader/index.d.ts +2 -0
  261. package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -0
  262. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +59 -0
  263. package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
  264. package/dist/types/src/vite-plugin/composer/index.d.ts +34 -0
  265. package/dist/types/src/vite-plugin/composer/index.d.ts.map +1 -0
  266. package/dist/types/src/vite-plugin/import-map/index.d.ts +28 -0
  267. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -0
  268. package/dist/types/src/vite-plugin/index.d.ts +5 -0
  269. package/dist/types/src/vite-plugin/index.d.ts.map +1 -0
  270. package/dist/types/src/vite-plugin/manifest.d.ts +41 -0
  271. package/dist/types/src/vite-plugin/manifest.d.ts.map +1 -0
  272. package/dist/types/src/vite-plugin/manifest.test.d.ts +2 -0
  273. package/dist/types/src/vite-plugin/manifest.test.d.ts.map +1 -0
  274. package/dist/types/src/vite-plugin/packages.d.ts +13 -0
  275. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -0
  276. package/dist/types/tsconfig.tsbuildinfo +1 -1
  277. package/moon.yml +25 -6
  278. package/package.json +125 -59
  279. package/src/cli/cli.ts +102 -0
  280. package/src/{playground/debug → cli}/index.ts +1 -1
  281. package/src/common/activation-events.ts +39 -0
  282. package/src/{playground/logger/index.ts → common/annotations.ts} +0 -2
  283. package/src/common/capabilities.ts +287 -192
  284. package/src/common/index.ts +3 -8
  285. package/src/common/translations.ts +17 -9
  286. package/src/context.ts +9 -0
  287. package/src/core/{events.ts → activation-event.ts} +10 -7
  288. package/src/core/capability-manager.test.ts +154 -0
  289. package/src/core/capability-manager.ts +213 -0
  290. package/src/core/capability.ts +254 -0
  291. package/src/core/edge-registry-plugin-provider.ts +92 -0
  292. package/src/core/index.ts +11 -4
  293. package/src/core/plugin-asset-cache.ts +60 -0
  294. package/src/core/plugin-manager.test.ts +1929 -0
  295. package/src/core/plugin-manager.ts +1696 -0
  296. package/src/core/plugin-manifest.test.ts +75 -0
  297. package/src/core/plugin-manifest.ts +134 -0
  298. package/src/core/plugin.ts +449 -48
  299. package/src/core/registry.ts +163 -0
  300. package/src/core/url-loader.test.ts +222 -0
  301. package/src/core/url-loader.ts +388 -0
  302. package/src/index.ts +2 -2
  303. package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
  304. package/src/plugin-process-manager/history/capability.ts +36 -0
  305. package/src/plugin-process-manager/history/errors.ts +7 -0
  306. package/src/plugin-process-manager/history/history-tracker.test.ts +353 -0
  307. package/src/plugin-process-manager/history/history-tracker.ts +144 -0
  308. package/src/plugin-process-manager/history/index.ts +9 -0
  309. package/src/plugin-process-manager/history/types.ts +17 -0
  310. package/src/plugin-process-manager/history/undo-mapping.ts +135 -0
  311. package/src/plugin-process-manager/history/undo-registry.test.ts +74 -0
  312. package/src/plugin-process-manager/history/undo-registry.ts +54 -0
  313. package/src/plugin-process-manager/idb-key-value-store.ts +64 -0
  314. package/src/plugin-process-manager/index.ts +6 -0
  315. package/src/plugin-process-manager/meta.ts +16 -0
  316. package/src/plugin-process-manager/process-manager-capability.ts +178 -0
  317. package/src/plugin-process-manager/testing.ts +156 -0
  318. package/src/testing/harness.ts +247 -0
  319. package/src/testing/index.ts +3 -0
  320. package/src/testing/operationCapture.ts +144 -0
  321. package/src/testing/react.test.tsx +50 -0
  322. package/src/testing/react.tsx +113 -0
  323. package/src/testing/service.ts +52 -0
  324. package/src/testing/withPluginManager.stories.tsx +8 -9
  325. package/src/testing/withPluginManager.tsx +69 -42
  326. package/src/ui/components/App/App.stories.tsx +84 -0
  327. package/src/ui/components/App/App.tsx +144 -0
  328. package/src/{playground/layout → ui/components/App}/index.ts +1 -1
  329. package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +179 -0
  330. package/src/{react → ui/components/PluginManager}/PluginManagerProvider.ts +3 -3
  331. package/src/ui/components/PluginManager/index.ts +5 -0
  332. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +144 -0
  333. package/src/ui/components/Surface/SurfaceComponent.tsx +303 -0
  334. package/src/ui/components/Surface/SurfaceInfo.tsx +106 -0
  335. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +207 -0
  336. package/src/ui/components/Surface/context.ts +12 -0
  337. package/src/ui/components/Surface/index.ts +54 -0
  338. package/src/ui/components/Surface/types.test.ts +126 -0
  339. package/src/ui/components/Surface/types.ts +290 -0
  340. package/src/ui/components/index.ts +7 -0
  341. package/src/ui/hooks/index.ts +10 -0
  342. package/src/ui/hooks/useApp.test.tsx +161 -0
  343. package/src/ui/hooks/useApp.tsx +404 -0
  344. package/src/ui/hooks/useCapabilities.ts +68 -0
  345. package/src/{react → ui/hooks}/useLoading.tsx +16 -10
  346. package/src/ui/hooks/useProcessManagerRuntime.ts +78 -0
  347. package/src/ui/hooks/useSettingsState.ts +26 -0
  348. package/src/ui/hooks/useSurface.ts +13 -0
  349. package/src/ui/index.ts +6 -0
  350. package/src/vite-plugin/boot-loader/BootLoader.solid-stories.tsx +198 -0
  351. package/src/vite-plugin/boot-loader/index.ts +5 -0
  352. package/src/vite-plugin/boot-loader/loader-app/Loader.tsx +166 -0
  353. package/src/vite-plugin/boot-loader/loader-app/boot-loader.css +311 -0
  354. package/src/vite-plugin/boot-loader/loader-app/bridge.ts +25 -0
  355. package/src/vite-plugin/boot-loader/loader-app/entry.tsx +21 -0
  356. package/src/vite-plugin/boot-loader/loader-app/mount.tsx +70 -0
  357. package/src/vite-plugin/boot-loader/loader-app/store.test.ts +137 -0
  358. package/src/vite-plugin/boot-loader/loader-app/store.ts +149 -0
  359. package/src/vite-plugin/boot-loader/loader-app/tsconfig.json +11 -0
  360. package/src/vite-plugin/boot-loader/loader-app/types.ts +78 -0
  361. package/src/vite-plugin/boot-loader/loader.ts +204 -0
  362. package/src/vite-plugin/composer/index.ts +306 -0
  363. package/src/vite-plugin/import-map/index.ts +527 -0
  364. package/src/vite-plugin/index.ts +10 -0
  365. package/src/vite-plugin/manifest.test.ts +55 -0
  366. package/src/vite-plugin/manifest.ts +63 -0
  367. package/src/vite-plugin/packages.ts +187 -0
  368. package/tsconfig.json +27 -22
  369. package/tsconfig.node.json +2 -4
  370. package/typedoc.json +2 -4
  371. package/vitest.config.ts +1 -1
  372. package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
  373. package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
  374. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs +0 -138
  375. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +0 -7
  376. package/dist/lib/browser/chunk-6XKO24JP.mjs +0 -483
  377. package/dist/lib/browser/chunk-6XKO24JP.mjs.map +0 -7
  378. package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
  379. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
  380. package/dist/lib/browser/chunk-WPW5VVAX.mjs +0 -1651
  381. package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +0 -7
  382. package/dist/lib/browser/intent-dispatcher-LZ4AE66E.mjs +0 -11
  383. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs +0 -39
  384. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +0 -7
  385. package/dist/lib/browser/react/index.mjs +0 -34
  386. package/dist/lib/browser/store-CNPHOYTJ.mjs +0 -30
  387. package/dist/lib/browser/store-CNPHOYTJ.mjs.map +0 -7
  388. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs +0 -139
  389. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +0 -7
  390. package/dist/lib/node-esm/chunk-3UPX5OIS.mjs +0 -484
  391. package/dist/lib/node-esm/chunk-3UPX5OIS.mjs.map +0 -7
  392. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs +0 -1653
  393. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +0 -7
  394. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
  395. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
  396. package/dist/lib/node-esm/intent-dispatcher-MGOJ3CHD.mjs +0 -12
  397. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs +0 -40
  398. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +0 -7
  399. package/dist/lib/node-esm/react/index.mjs +0 -35
  400. package/dist/lib/node-esm/store-RK5B4XEL.mjs +0 -31
  401. package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +0 -7
  402. package/dist/types/src/common/collaboration.d.ts +0 -20
  403. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  404. package/dist/types/src/common/events.d.ts +0 -52
  405. package/dist/types/src/common/events.d.ts.map +0 -1
  406. package/dist/types/src/common/file.d.ts +0 -14
  407. package/dist/types/src/common/file.d.ts.map +0 -1
  408. package/dist/types/src/common/graph.d.ts +0 -21
  409. package/dist/types/src/common/graph.d.ts.map +0 -1
  410. package/dist/types/src/common/layout.d.ts +0 -279
  411. package/dist/types/src/common/layout.d.ts.map +0 -1
  412. package/dist/types/src/common/surface.d.ts +0 -68
  413. package/dist/types/src/common/surface.d.ts.map +0 -1
  414. package/dist/types/src/core/capabilities.d.ts +0 -117
  415. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  416. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  417. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  418. package/dist/types/src/core/events.d.ts.map +0 -1
  419. package/dist/types/src/core/manager.d.ts +0 -126
  420. package/dist/types/src/core/manager.d.ts.map +0 -1
  421. package/dist/types/src/core/manager.test.d.ts +0 -2
  422. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  423. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  424. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  425. package/dist/types/src/playground/debug/index.d.ts +0 -2
  426. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  427. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  428. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  429. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  430. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  431. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  432. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  433. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  434. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  435. package/dist/types/src/playground/generator/index.d.ts +0 -3
  436. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  437. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  438. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  439. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  440. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  441. package/dist/types/src/playground/layout/index.d.ts +0 -2
  442. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  443. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  444. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  445. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  446. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  447. package/dist/types/src/playground/logger/index.d.ts +0 -2
  448. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  449. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  450. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  451. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  452. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  453. package/dist/types/src/playground/playground.stories.d.ts +0 -11
  454. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  455. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  456. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  457. package/dist/types/src/plugin-intent/actions.d.ts +0 -36
  458. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  459. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  460. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  461. package/dist/types/src/plugin-intent/index.d.ts +0 -6
  462. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  463. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  464. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  465. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  466. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  467. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  468. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  469. package/dist/types/src/plugin-intent/meta.d.ts +0 -3
  470. package/dist/types/src/plugin-intent/meta.d.ts.map +0 -1
  471. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  472. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  473. package/dist/types/src/plugin-settings/actions.d.ts +0 -25
  474. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  475. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  476. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  477. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  478. package/dist/types/src/plugin-settings/index.d.ts.map +0 -1
  479. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  480. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  481. package/dist/types/src/plugin-settings/meta.d.ts +0 -3
  482. package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
  483. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  484. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  485. package/dist/types/src/plugin-settings/translations.d.ts +0 -11
  486. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  487. package/dist/types/src/react/App.d.ts +0 -10
  488. package/dist/types/src/react/App.d.ts.map +0 -1
  489. package/dist/types/src/react/App.stories.d.ts.map +0 -1
  490. package/dist/types/src/react/DefaultFallback.d.ts +0 -8
  491. package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
  492. package/dist/types/src/react/ErrorBoundary.d.ts +0 -30
  493. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  494. package/dist/types/src/react/IntentContext.d.ts +0 -8
  495. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  496. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  497. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  498. package/dist/types/src/react/Surface.d.ts +0 -12
  499. package/dist/types/src/react/Surface.d.ts.map +0 -1
  500. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  501. package/dist/types/src/react/common.d.ts +0 -13
  502. package/dist/types/src/react/common.d.ts.map +0 -1
  503. package/dist/types/src/react/index.d.ts +0 -9
  504. package/dist/types/src/react/index.d.ts.map +0 -1
  505. package/dist/types/src/react/types.d.ts +0 -14
  506. package/dist/types/src/react/types.d.ts.map +0 -1
  507. package/dist/types/src/react/useApp.d.ts +0 -44
  508. package/dist/types/src/react/useApp.d.ts.map +0 -1
  509. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  510. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  511. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  512. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  513. package/dist/types/src/react/useLoading.d.ts.map +0 -1
  514. package/src/common/collaboration.ts +0 -18
  515. package/src/common/events.ts +0 -79
  516. package/src/common/file.ts +0 -22
  517. package/src/common/graph.ts +0 -30
  518. package/src/common/layout.ts +0 -277
  519. package/src/common/surface.ts +0 -88
  520. package/src/core/capabilities.test.ts +0 -136
  521. package/src/core/capabilities.ts +0 -263
  522. package/src/core/manager.test.ts +0 -516
  523. package/src/core/manager.ts +0 -604
  524. package/src/playground/debug/Debug.tsx +0 -39
  525. package/src/playground/debug/plugin.ts +0 -16
  526. package/src/playground/generator/Main.tsx +0 -70
  527. package/src/playground/generator/Toolbar.tsx +0 -47
  528. package/src/playground/generator/generator.ts +0 -48
  529. package/src/playground/generator/index.ts +0 -6
  530. package/src/playground/generator/plugin.ts +0 -22
  531. package/src/playground/layout/Layout.tsx +0 -33
  532. package/src/playground/layout/plugin.ts +0 -18
  533. package/src/playground/logger/Toolbar.tsx +0 -30
  534. package/src/playground/logger/plugin.ts +0 -41
  535. package/src/playground/logger/schema.ts +0 -12
  536. package/src/playground/playground.stories.tsx +0 -46
  537. package/src/plugin-intent/IntentPlugin.ts +0 -20
  538. package/src/plugin-intent/actions.ts +0 -31
  539. package/src/plugin-intent/errors.ts +0 -40
  540. package/src/plugin-intent/index.ts +0 -9
  541. package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
  542. package/src/plugin-intent/intent-dispatcher.ts +0 -342
  543. package/src/plugin-intent/intent.ts +0 -154
  544. package/src/plugin-intent/meta.ts +0 -10
  545. package/src/plugin-settings/SettingsPlugin.ts +0 -34
  546. package/src/plugin-settings/actions.ts +0 -25
  547. package/src/plugin-settings/app-graph-builder.ts +0 -160
  548. package/src/plugin-settings/index.ts +0 -6
  549. package/src/plugin-settings/intent-resolver.ts +0 -35
  550. package/src/plugin-settings/meta.ts +0 -10
  551. package/src/plugin-settings/store.ts +0 -33
  552. package/src/plugin-settings/translations.ts +0 -19
  553. package/src/react/App.stories.tsx +0 -33
  554. package/src/react/App.tsx +0 -59
  555. package/src/react/DefaultFallback.tsx +0 -26
  556. package/src/react/ErrorBoundary.tsx +0 -56
  557. package/src/react/IntentContext.tsx +0 -35
  558. package/src/react/Surface.stories.tsx +0 -125
  559. package/src/react/Surface.tsx +0 -109
  560. package/src/react/common.ts +0 -13
  561. package/src/react/index.ts +0 -14
  562. package/src/react/types.ts +0 -38
  563. package/src/react/useApp.tsx +0 -165
  564. package/src/react/useCapabilities.ts +0 -31
  565. package/src/react/useIntentResolver.ts +0 -22
  566. /package/dist/lib/browser/{intent-dispatcher-LZ4AE66E.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  567. /package/dist/lib/browser/{react/index.mjs.map → common/activation-events.mjs.map} +0 -0
  568. /package/dist/lib/{node-esm/intent-dispatcher-MGOJ3CHD.mjs.map → browser/common/capabilities.mjs.map} +0 -0
  569. /package/dist/lib/{node-esm/react/index.mjs.map → browser/core/activation-event.mjs.map} +0 -0
@@ -0,0 +1,977 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/vite-plugin/boot-loader/loader.ts
4
+ import * as babel from "@babel/core";
5
+ import babelPresetTypeScript from "@babel/preset-typescript";
6
+ import babelPresetSolid from "babel-preset-solid";
7
+ import { build } from "esbuild";
8
+ import { basename, dirname } from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+
11
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/boot-loader.css?raw
12
+ 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";
13
+
14
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/bridge.ts?raw
15
+ 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";
16
+
17
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/entry.tsx?raw
18
+ var entry_default = "//\n// Copyright 2026 DXOS.org\n//\n\nimport { mountLoader } from './mount';\nimport { DEFAULT_ROOT_ID } from './types';\n\n//\n// Production entry \u2014 bundled to a self-contained IIFE by `bootLoaderPlugin` and\n// inlined into `index.html` ahead of the app bundle. Mounts the loader into the\n// static backdrop using the config the plugin baked in just before this script\n// (including the backdrop id, so the id has a single source). The storybook\n// does NOT use this entry; it imports `mountLoader` directly so Vite compiles\n// the Solid source with HMR.\n//\n\nconst config = window.__BOOT_LOADER_CONFIG__ ?? {};\nconst el = document.getElementById(config.rootId ?? DEFAULT_ROOT_ID);\nif (el) {\n mountLoader(el, config);\n}\n";
19
+
20
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/Loader.tsx?raw
21
+ var Loader_default = "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Component, For, createEffect, createSignal, onCleanup, onMount } from 'solid-js';\n\nimport { type LoaderStore } from './store';\n\n// Ring geometry in the SVG's `0 0 100 100` viewBox. The radius leaves a couple\n// of units of padding so the stroke, its round cap, and the end marker aren't\n// clipped at the viewBox edge.\nconst RING_RADIUS = 48;\nconst RING_CENTER = 50;\n// Leading-edge marker: a small dot drawn at the arc's head in an unmasked layer.\nconst MARKER_RADIUS = 1; // viewBox units \u2192 ~3.8px on the 384px disc\n\n/**\n * Read an element's *current animated* translateY (px) from its live transform\n * matrix \u2014 the interpolated value mid-transition, not the last-written property.\n * Used by the status FLIP so successive appends chain off the in-flight position\n * instead of yanking the track back to a fixed invert target.\n */\nconst readTranslateY = (element: HTMLElement): number => {\n const computed = getComputedStyle(element).transform;\n if (!computed || computed === 'none') {\n return 0;\n }\n const match = computed.match(/matrix.*\\(([^)]+)\\)/);\n if (!match) {\n return 0;\n }\n const values = match[1].split(',');\n // 2D `matrix(a, b, c, d, tx, ty)` \u2192 ty at index 5; 3D `matrix3d(...)` \u2192 ty at 13.\n if (values.length === 6) {\n return Number.parseFloat(values[5]) || 0;\n }\n if (values.length === 16) {\n return Number.parseFloat(values[13]) || 0;\n }\n return 0;\n};\n\nexport type LoaderProps = {\n /** Reactive source of truth for progress, status lines, and lifecycle phase. */\n store: LoaderStore;\n /** Inline SVG markup for the brand mark rendered inside the ring. */\n markSvg?: string;\n};\n\n/**\n * The boot loader, authored as a single Solid component \u2014 the one source of\n * truth for the loader DOM. `bootLoaderPlugin` bundles this (Solid runtime\n * inlined) into `index.html`; the storybook mounts the very same component, so\n * the two can no longer drift. The DOM structure, ids, and classes mirror\n * `boot-loader.css`.\n *\n * The full-screen backdrop (`#boot-loader`) is injected as static markup so it\n * paints from CSS before this bundle executes; this component renders the disc\n * and status log *into* that backdrop. The dismissal outro (fading `#boot-loader`)\n * and its teardown are owned by {@link mountLoader}, which has the host element.\n */\nexport const Loader: Component<LoaderProps> = (props) => {\n let trackRef: HTMLDivElement | undefined;\n let previousCount = props.store.lines().length;\n\n // FLIP-style slide on each appended line: snap the track down by one\n // line-height (chained off any in-flight translate) with no transition, force\n // a reflow, then animate back to translateY(0) so the new entry rises from\n // below the bottom-anchored viewport. Range ticks (length unchanged) skip it.\n createEffect(() => {\n const count = props.store.lines().length;\n const track = trackRef;\n if (track && count > previousCount) {\n const currentY = readTranslateY(track);\n const lineHeight = track.lastElementChild?.getBoundingClientRect().height ?? 0;\n track.style.transition = 'none';\n track.style.transform = `translateY(${currentY + lineHeight}px)`;\n void track.offsetHeight;\n track.style.transition = '';\n track.style.transform = 'translateY(0)';\n }\n previousCount = count;\n });\n\n // Eased display progress. A `<path>`'s `d` can't be CSS-transitioned, so the\n // arc would snap on every store tick; instead we ease a displayed value toward\n // the store's progress with a requestAnimationFrame loop (~per-frame lerp) and\n // recompute the path each frame. This restores the compositor-smooth growth\n // the old `transition: stroke-dashoffset` gave, while keeping the path +\n // `marker-end` (the marker rides the arc's recomputed end automatically).\n const [shown, setShown] = createSignal(props.store.progress());\n let raf: number | undefined;\n const animate = () => {\n const target = props.store.progress();\n const current = shown();\n // Snap when within a hair to settle; otherwise lerp ~18% of the gap/frame.\n const next = Math.abs(target - current) < 0.05 ? target : current + (target - current) * 0.18;\n if (next !== current) {\n setShown(next);\n }\n raf = requestAnimationFrame(animate);\n };\n\n onMount(() => {\n raf = requestAnimationFrame(animate);\n });\n\n onCleanup(() => {\n if (raf != null) {\n cancelAnimationFrame(raf);\n }\n });\n\n // Determinate ring as an SVG `<path>` arc: an anticlockwise sweep starting at\n // 12 o'clock whose angle grows with the eased `shown()` progress. The sweep is\n // capped just shy of a full turn so the single arc command never degenerates at\n // 100%. The leading-edge dot is its `head` point, rendered separately (below) in\n // an *unmasked* layer \u2014 drawing it via `marker-end` on this path would put it\n // under the ring's conic fade mask, whose hard edge bisects the dot into a\n // half-circle.\n const arc = () => {\n const fraction = Math.min(shown() / 100, 0.9999);\n const sweep = fraction * 2 * Math.PI;\n const start = -Math.PI / 2; // 12 o'clock\n const end = start - sweep; // anticlockwise (decreasing angle)\n const x0 = RING_CENTER + RING_RADIUS * Math.cos(start);\n const y0 = RING_CENTER + RING_RADIUS * Math.sin(start);\n const headX = RING_CENTER + RING_RADIUS * Math.cos(end);\n const headY = RING_CENTER + RING_RADIUS * Math.sin(end);\n const largeArc = sweep > Math.PI ? 1 : 0;\n // sweep-flag 0 = anticlockwise (negative-angle) direction.\n return { d: `M ${x0} ${y0} A ${RING_RADIUS} ${RING_RADIUS} 0 ${largeArc} 0 ${headX} ${headY}`, headX, headY };\n };\n\n // Once host-driven, the brand mark eases grayscale \u2192 colour and stays there.\n const isHostDriven = () => props.store.phase() !== 'creep';\n\n return (\n <>\n <div id='boot-loader-disc' data-host-driven={isHostDriven() ? '' : undefined}>\n <svg\n id='boot-loader-ring'\n viewBox='0 0 100 100'\n aria-hidden='true'\n style={{ '--boot-loader-arc': String(shown()) }}\n >\n {shown() > 0 ? <path class='boot-loader-ring-progress' d={arc().d} /> : null}\n </svg>\n {/* Leading-edge dot in its own unmasked layer (see `arc()`), so the ring's fade mask\n never clips it. Stacked over `#boot-loader-ring` via the disc grid. */}\n {shown() > 0 ? (\n <svg id='boot-loader-ring-head' viewBox='0 0 100 100' aria-hidden='true'>\n <circle class='boot-loader-ring-marker' cx={arc().headX} cy={arc().headY} r={MARKER_RADIUS} />\n </svg>\n ) : null}\n {props.markSvg ? <div id='boot-loader-mark' innerHTML={props.markSvg} /> : null}\n </div>\n <div id='boot-loader-status'>\n <div id='boot-loader-status-fade' />\n <div id='boot-loader-status-track' ref={trackRef}>\n <For each={props.store.lines()}>{(line) => <div class='boot-loader-status-line'>{line.text}</div>}</For>\n </div>\n </div>\n </>\n );\n};\n";
22
+
23
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/mount.tsx?raw
24
+ var mount_default = "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createEffect } from 'solid-js';\nimport { render } from 'solid-js/web';\n\nimport { createBridge } from './bridge';\nimport { Loader } from './Loader';\nimport { createLoaderStore } from './store';\nimport { type BootLoaderConfig } from './types';\n\n/** Fallback teardown if the outro's `transitionend` never fires (e.g. no opacity transition). */\nconst OUTRO_FALLBACK_MS = 800;\n\n/**\n * Mount the boot loader into a host element (`#boot-loader`, the static backdrop\n * the plugin injects \u2014 or any container in the storybook) and install the\n * `window.__bootLoader` facade. Renders the disc + status into the host, toggles\n * `data-dismissing` on it for the outro, and removes everything once the outro\n * completes.\n *\n * Returns a disposer that tears the loader down immediately (idempotent).\n */\nexport const mountLoader = (el: HTMLElement, config: BootLoaderConfig = {}): (() => void) => {\n const store = createLoaderStore(config.status);\n\n let removed = false;\n // Forward-declared so `remove` can dispose the Solid render created below.\n let disposeRender: (() => void) | undefined;\n\n const remove = (): void => {\n if (removed) {\n return;\n }\n removed = true;\n el.removeEventListener('transitionend', handleTransitionEnd);\n store.dispose();\n disposeRender?.();\n el.remove();\n if (window.__bootLoader === api) {\n delete window.__bootLoader;\n }\n };\n\n const handleTransitionEnd = (event: TransitionEvent): void => {\n if (event.propertyName === 'opacity' && store.phase() === 'dismissing') {\n remove();\n }\n };\n el.addEventListener('transitionend', handleTransitionEnd);\n\n disposeRender = render(() => {\n // Drive the backdrop's outro from the host element (Solid owns the host's\n // children; the host attribute is toggled imperatively within this owner).\n createEffect(() => {\n const dismissing = store.phase() === 'dismissing';\n el.toggleAttribute('data-dismissing', dismissing);\n if (dismissing) {\n setTimeout(remove, OUTRO_FALLBACK_MS);\n }\n });\n return <Loader store={store} markSvg={config.markSvg} />;\n }, el);\n\n const api = createBridge(store, remove);\n window.__bootLoader = api;\n\n return remove;\n};\n";
25
+
26
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/store.ts?raw
27
+ var store_default = "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Accessor, createSignal } from 'solid-js';\n\nimport { type StatusPayload } from './types';\n\n//\n// Creep tuning. The ring auto-creeps toward a moving ceiling so a long\n// activation silence never reads as a frozen disc. See the original\n// hand-written driver for the rationale behind each constant.\n//\n\n/** Creep timer cadence, in milliseconds. */\nexport const CREEP_TICK_MS = 100;\n/** State-1 ease rate \u2014 a gentle \"we're alive\" hint before real progress lands. */\nexport const STATE_1_RATE = 0.05;\n/** State-1 asymptote (percent) the creep eases toward before host progress. */\nexport const STATE_1_ASYMPTOTE = 40;\n/** State-2 ease rate \u2014 bridges the gap between sparse host `progress()` calls. */\nexport const STATE_2_RATE = 0.05;\n/** State-2 lead (percent) the ceiling sits ahead of the last host value. */\nexport const STATE_2_BUMP = 15;\n/** Hard ceiling the auto-creep never crosses (host must drive the rest). */\nexport const ABSOLUTE_CEILING = 90;\n\n/** Loader lifecycle phase. */\nexport type Phase = 'creep' | 'host' | 'dismissing';\n\n/** A single rendered status line; `id` keys the `<For>` and survives in-place range ticks. */\nexport type StatusLine = {\n id: number;\n text: string;\n event?: string;\n module?: string;\n};\n\n/**\n * Asymptotic ease \u2014 `next = raw + (ceiling - raw) * rate`, clamped so it never\n * overshoots (or regresses past) the ceiling. Pure; unit-tested.\n */\nexport const easeToward = (raw: number, ceiling: number, rate: number): number =>\n raw >= ceiling - 0.1 ? raw : raw + (ceiling - raw) * rate;\n\n/**\n * Clamp a host-supplied fraction to a percent in [0, 100]. Invalid / negative /\n * non-finite values collapse to 0 rather than poisoning the CSS var. Pure;\n * unit-tested.\n */\nexport const clampPercent = (fraction?: number): number =>\n typeof fraction !== 'number' || !Number.isFinite(fraction) || fraction < 0 ? 0 : Math.min(1, fraction) * 100;\n\n/** Display text for a payload \u2014 appends the `(index/total)` suffix when a range is present. */\nexport const displayText = (payload: StatusPayload): string =>\n payload.range ? `${payload.humanized} (${payload.range.index}/${payload.range.total})` : payload.humanized;\n\n/**\n * Reactive loader store \u2014 owns the progress percent, the status-line log, and\n * the lifecycle phase, plus the auto-creep timer. All DOM-free, so the creep\n * math and status reduction are testable as plain functions; `Loader.tsx` binds\n * the accessors to the DOM and `bridge.ts` wraps the mutators as the imperative\n * `window.__bootLoader` facade.\n */\nexport type LoaderStore = {\n /** Progress as a percent in [0, 100] (the CSS `--boot-loader-bar-progress` value). */\n progress: Accessor<number>;\n /** Appended status lines, newest last. */\n lines: Accessor<StatusLine[]>;\n /** Current lifecycle phase. */\n phase: Accessor<Phase>;\n /** Apply a status update (append, or replace-in-place for range ticks). */\n pushStatus: (payload: StatusPayload) => void;\n /** Enter host-driven progress with `fraction` \u2208 [0, 1]; never regresses. */\n setProgress: (fraction?: number) => void;\n /** Snap to 100%, stop the creep, and enter the dismissing phase. */\n ready: () => void;\n /** Stop the creep timer (call on teardown). */\n dispose: () => void;\n};\n\nexport const createLoaderStore = (initialStatus?: string): LoaderStore => {\n const [progress, setProgressPct] = createSignal(0);\n const [lines, setLines] = createSignal<StatusLine[]>(initialStatus ? [{ id: 0, text: initialStatus }] : []);\n const [phase, setPhase] = createSignal<Phase>('creep');\n\n let creepCeiling = STATE_1_ASYMPTOTE;\n let creepRate = STATE_1_RATE;\n let nextId = initialStatus ? 1 : 0;\n let timer: ReturnType<typeof setInterval> | null = null;\n\n const startCreep = (): void => {\n if (timer == null) {\n timer = setInterval(() => setProgressPct((raw) => easeToward(raw, creepCeiling, creepRate)), CREEP_TICK_MS);\n }\n };\n\n const stopCreep = (): void => {\n if (timer != null) {\n clearInterval(timer);\n timer = null;\n }\n };\n\n const pushStatus = (payload: StatusPayload): void => {\n const text = displayText(payload);\n setLines((current) => {\n const previous = current.at(-1);\n // Dedup back-to-back identical transitions (same text + structured fields).\n if (\n previous &&\n previous.text === text &&\n (previous.event ?? null) === (payload.event ?? null) &&\n (previous.module ?? null) === (payload.module ?? null)\n ) {\n return current;\n }\n // Range tick \u2014 replace the current line in place rather than appending,\n // so a counted phase produces one entry with an updating suffix.\n if (payload.range && previous) {\n return [...current.slice(0, -1), { ...previous, text }];\n }\n return [...current, { id: nextId++, text, event: payload.event, module: payload.module }];\n });\n };\n\n const setProgress = (fraction?: number): void => {\n setPhase('host');\n const pct = clampPercent(fraction);\n // The ring never regresses: hold the current value if the host reports lower.\n setProgressPct((current) => Math.max(current, pct));\n // Switch the creep to its state-2 cadence and lead the host value by a bump.\n creepRate = STATE_2_RATE;\n creepCeiling = Math.min(Math.max(creepCeiling, pct + STATE_2_BUMP), ABSOLUTE_CEILING);\n startCreep();\n };\n\n const ready = (): void => {\n stopCreep();\n setProgressPct(100);\n setPhase('dismissing');\n };\n\n const dispose = (): void => stopCreep();\n\n startCreep();\n\n return { progress, lines, phase, pushStatus, setProgress, ready, dispose };\n};\n";
28
+
29
+ // raw-loader:/__w/dxos/dxos/packages/sdk/app-framework/src/vite-plugin/boot-loader/loader-app/types.ts?raw
30
+ var types_default = "//\n// Copyright 2026 DXOS.org\n//\n\n/**\n * Status payload accepted by `window.__bootLoader.status(...)`. The caller owns\n * formatting \u2014 `humanized` is the exact text rendered \u2014 while `event` / `module`\n * carry the structured activation ids for the boot trace, and `range` drives an\n * in-place `(index/total)` counter for long counted phases.\n */\nexport type StatusPayload = {\n /**\n * Raw activation event key (e.g. `dxos.org/plugin/observability/activate`)\n * when the transition is event-level.\n */\n event?: string;\n\n /**\n * Raw module id (e.g. `org.dxos.plugin.observability.module.ReactSurface`)\n * when the transition is module-level.\n */\n module?: string;\n\n /** Exact text to display (e.g. \"Activating Observability: react-surface\"). */\n humanized: string;\n\n /**\n * Optional `(index/total)` tick. When present the loader replaces the current\n * line in place (\"Loading plugins (12/80)\") instead of appending a new entry \u2014\n * keeps the visible log compact during long counted phases.\n */\n range?: { index: number; total: number };\n};\n\n/**\n * Imperative facade exposed on `window.__bootLoader`, installed by the inlined\n * loader bundle and driven by the host app (the React relay forwards `useApp`'s\n * startup progress through it).\n */\nexport type BootLoaderApi = {\n /** Update the visible status line. */\n status: (payload: StatusPayload) => void;\n /** Enter host-driven progress \u2014 `fraction` \u2208 [0, 1]. */\n progress: (fraction?: number) => void;\n /** Play the dismissal outro, then remove the loader DOM (graceful path). */\n ready: () => void;\n /** Remove the loader DOM immediately (fast-load backstop / terminal). */\n dismiss: () => void;\n};\n\n/**\n * Config baked into `index.html` by `bootLoaderPlugin` ahead of the loader\n * bundle, so the compiled app stays static (compiled once, independent of the\n * host's brand mark / initial status).\n */\nexport type BootLoaderConfig = {\n /**\n * Id of the static backdrop element the plugin injects and the loader mounts\n * into \u2014 the single coupling between `transformIndexHtml` and the app. The\n * plugin owns the authoritative value and passes it here so `entry.tsx` reads\n * it rather than hardcoding (the CSS selector mirrors it \u2014 see `boot-loader.css`).\n */\n rootId?: string;\n /** Inline SVG markup for the brand mark rendered inside the ring. */\n markSvg?: string;\n /** Initial status text rendered before the host fires its first `status(...)`. */\n status?: string;\n};\n\n/** Fallback backdrop id when no config is present (kept in sync with `loader.ts` + the CSS). */\nexport const DEFAULT_ROOT_ID = 'boot-loader';\n\ndeclare global {\n interface Window {\n __bootLoader?: BootLoaderApi;\n __BOOT_LOADER_CONFIG__?: BootLoaderConfig;\n }\n}\n";
31
+
32
+ // src/vite-plugin/boot-loader/loader.ts
33
+ var VIRTUAL_NS = "boot-loader-app";
34
+ var MODULES = {
35
+ entry: {
36
+ contents: entry_default,
37
+ tsx: true
38
+ },
39
+ mount: {
40
+ contents: mount_default,
41
+ tsx: true
42
+ },
43
+ Loader: {
44
+ contents: Loader_default,
45
+ tsx: true
46
+ },
47
+ bridge: {
48
+ contents: bridge_default,
49
+ tsx: false
50
+ },
51
+ store: {
52
+ contents: store_default,
53
+ tsx: false
54
+ },
55
+ types: {
56
+ contents: types_default,
57
+ tsx: false
58
+ }
59
+ };
60
+ var resolveDir = dirname(fileURLToPath(import.meta.url));
61
+ var compileLoaderBundle = async () => {
62
+ const virtualSolid = () => ({
63
+ name: "boot-loader-app-virtual",
64
+ setup: (esbuild) => {
65
+ esbuild.onResolve({
66
+ filter: /^\.\//
67
+ }, (args) => {
68
+ const name = args.path.replace(/^\.\//, "").replace(/\.(tsx?|jsx?)$/, "");
69
+ return name in MODULES ? {
70
+ path: name,
71
+ namespace: VIRTUAL_NS
72
+ } : void 0;
73
+ });
74
+ esbuild.onLoad({
75
+ filter: /.*/,
76
+ namespace: VIRTUAL_NS
77
+ }, async (args) => {
78
+ const module = MODULES[args.path];
79
+ const result2 = await babel.transformAsync(module.contents, {
80
+ filename: `${args.path}.${module.tsx ? "tsx" : "ts"}`,
81
+ babelrc: false,
82
+ configFile: false,
83
+ // Presets run last-to-first: TS strips first, then Solid sees plain JSX.
84
+ presets: [
85
+ [
86
+ babelPresetSolid,
87
+ {
88
+ generate: "dom",
89
+ hydratable: false
90
+ }
91
+ ],
92
+ [
93
+ babelPresetTypeScript,
94
+ {
95
+ allowDeclareFields: true
96
+ }
97
+ ]
98
+ ]
99
+ });
100
+ if (!result2?.code) {
101
+ throw new Error(`babel-preset-solid returned no code for ${args.path}`);
102
+ }
103
+ return {
104
+ contents: result2.code,
105
+ loader: "js",
106
+ resolveDir
107
+ };
108
+ });
109
+ }
110
+ });
111
+ const result = await build({
112
+ stdin: {
113
+ contents: "import './entry';",
114
+ loader: "ts",
115
+ resolveDir,
116
+ sourcefile: "boot-loader-entry.ts"
117
+ },
118
+ bundle: true,
119
+ format: "iife",
120
+ platform: "browser",
121
+ target: "es2020",
122
+ minify: true,
123
+ write: false,
124
+ legalComments: "none",
125
+ define: {
126
+ "process.env.NODE_ENV": '"production"'
127
+ },
128
+ plugins: [
129
+ virtualSolid()
130
+ ]
131
+ });
132
+ return result.outputFiles[0].text;
133
+ };
134
+ var bundlePromise;
135
+ var getLoaderBundle = () => bundlePromise ??= compileLoaderBundle();
136
+ var bootLoaderPlugin = ({ status, markSvg, include = [
137
+ "index.html"
138
+ ] } = {}) => {
139
+ return {
140
+ name: "app-framework:boot-loader",
141
+ async transformIndexHtml(_html, ctx) {
142
+ const filename = basename(ctx.filename ?? "index.html");
143
+ if (!include.includes(filename)) {
144
+ return;
145
+ }
146
+ const bundle = await getLoaderBundle();
147
+ const rootId = "boot-loader";
148
+ return [
149
+ {
150
+ tag: "style",
151
+ injectTo: "head",
152
+ children: boot_loader_default
153
+ },
154
+ {
155
+ tag: "div",
156
+ injectTo: "body-prepend",
157
+ attrs: {
158
+ id: rootId,
159
+ role: "status",
160
+ "aria-live": "polite",
161
+ "aria-label": "Initializing"
162
+ },
163
+ children: ""
164
+ },
165
+ {
166
+ tag: "script",
167
+ injectTo: "body-prepend",
168
+ children: `window.__BOOT_LOADER_CONFIG__=${JSON.stringify({
169
+ rootId,
170
+ markSvg,
171
+ status
172
+ })};`
173
+ },
174
+ {
175
+ tag: "script",
176
+ injectTo: "body-prepend",
177
+ children: bundle
178
+ }
179
+ ];
180
+ }
181
+ };
182
+ };
183
+
184
+ // src/core/plugin-manifest.ts
185
+ import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
186
+ import * as HttpClient from "@effect/platform/HttpClient";
187
+ import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
188
+ import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
189
+ import * as Effect from "effect/Effect";
190
+ import * as Schema from "effect/Schema";
191
+ import { BaseError } from "@dxos/errors";
192
+ import { PLUGIN_ENTRY_FILENAME } from "@dxos/protocols";
193
+ var PLUGIN_DEV_SERVER_PORT = 3967;
194
+ var PluginManifestError = class extends BaseError.extend("PluginManifestError", "Plugin manifest is invalid") {
195
+ };
196
+ var Manifest = Schema.Struct({
197
+ id: Schema.String,
198
+ name: Schema.String,
199
+ version: Schema.String,
200
+ assets: Schema.Array(Schema.String),
201
+ devEntry: Schema.String.pipe(Schema.optional)
202
+ });
203
+
204
+ // src/vite-plugin/manifest.ts
205
+ import { PLUGIN_ENTRY_FILENAME as PLUGIN_ENTRY_FILENAME2 } from "@dxos/protocols";
206
+ var MANIFEST_ASSET_NAME = "manifest.json";
207
+ var ENTRY_FILENAME = PLUGIN_ENTRY_FILENAME2;
208
+ var serializeManifest = (meta, { assets, devEntry }) => {
209
+ const { key: _key, ...rest } = meta;
210
+ return JSON.stringify({
211
+ ...rest,
212
+ assets,
213
+ ...devEntry !== void 0 ? {
214
+ devEntry
215
+ } : {}
216
+ }, null, 2);
217
+ };
218
+
219
+ // src/vite-plugin/packages.ts
220
+ var THIRD_PARTY_SHARED_PACKAGES = [
221
+ "@effect-atom/atom",
222
+ "@effect-atom/atom-react",
223
+ "@effect/platform",
224
+ "effect",
225
+ "lit",
226
+ "react",
227
+ "react-dom",
228
+ "solid-js"
229
+ ];
230
+ var DEFAULT_PACKAGES = [
231
+ // packages/common
232
+ "@dxos/async",
233
+ "@dxos/codec-protobuf",
234
+ "@dxos/context",
235
+ "@dxos/crypto",
236
+ "@dxos/debug",
237
+ "@dxos/display-name",
238
+ "@dxos/effect",
239
+ "@dxos/effect-atom-solid",
240
+ "@dxos/errors",
241
+ "@dxos/feed-store",
242
+ "@dxos/graph",
243
+ "@dxos/hypercore",
244
+ "@dxos/invariant",
245
+ "@dxos/keyboard",
246
+ "@dxos/keys",
247
+ "@dxos/kv-store",
248
+ "@dxos/log",
249
+ "@dxos/merkle-search-tree",
250
+ "@dxos/random",
251
+ "@dxos/random-access-storage",
252
+ "@dxos/timeframe",
253
+ "@dxos/tracing",
254
+ "@dxos/util",
255
+ "@dxos/web-context",
256
+ "@dxos/web-context-react",
257
+ "@dxos/web-context-solid",
258
+ // packages/core/echo
259
+ "@dxos/echo",
260
+ "@dxos/echo-client",
261
+ "@dxos/echo-host",
262
+ "@dxos/echo-protocol",
263
+ "@dxos/echo-query",
264
+ "@dxos/echo-react",
265
+ "@dxos/echo-solid",
266
+ "@dxos/feed",
267
+ "@dxos/index-core",
268
+ // packages/core/halo
269
+ "@dxos/credentials",
270
+ "@dxos/keyring",
271
+ // packages/core/mesh
272
+ "@dxos/edge-client",
273
+ "@dxos/messaging",
274
+ "@dxos/network-manager",
275
+ "@dxos/rpc",
276
+ "@dxos/rpc-tunnel",
277
+ "@dxos/teleport",
278
+ "@dxos/teleport-extension-automerge-replicator",
279
+ "@dxos/teleport-extension-gossip",
280
+ "@dxos/teleport-extension-object-sync",
281
+ "@dxos/teleport-extension-replicator",
282
+ "@dxos/websocket-rpc",
283
+ // packages/core
284
+ "@dxos/ai",
285
+ "@dxos/assistant",
286
+ "@dxos/assistant-toolkit",
287
+ "@dxos/compute",
288
+ "@dxos/conductor",
289
+ "@dxos/functions",
290
+ "@dxos/functions-runtime",
291
+ "@dxos/mcp-client",
292
+ "@dxos/operation",
293
+ "@dxos/protocols",
294
+ // packages/devtools
295
+ "@dxos/devtools",
296
+ // packages/sdk
297
+ "@dxos/app-framework",
298
+ "@dxos/app-graph",
299
+ "@dxos/app-solid",
300
+ "@dxos/app-toolkit",
301
+ "@dxos/client",
302
+ "@dxos/client-protocol",
303
+ "@dxos/client-services",
304
+ "@dxos/config",
305
+ "@dxos/migrations",
306
+ "@dxos/observability",
307
+ "@dxos/react-client",
308
+ "@dxos/react-edge-client",
309
+ "@dxos/schema",
310
+ "@dxos/types",
311
+ // packages/ui
312
+ "@dxos/lit-grid",
313
+ "@dxos/lit-ui",
314
+ "@dxos/react-hooks",
315
+ "@dxos/react-ui",
316
+ "@dxos/react-ui-attention",
317
+ "@dxos/react-ui-audio",
318
+ "@dxos/react-ui-board",
319
+ "@dxos/react-ui-calendar",
320
+ "@dxos/react-ui-canvas",
321
+ "@dxos/react-ui-canvas-compute",
322
+ "@dxos/react-ui-canvas-editor",
323
+ "@dxos/react-ui-chat",
324
+ "@dxos/react-ui-components",
325
+ "@dxos/react-ui-dnd",
326
+ "@dxos/react-ui-editor",
327
+ "@dxos/react-ui-experimental",
328
+ "@dxos/react-ui-form",
329
+ "@dxos/react-ui-gameboard",
330
+ "@dxos/react-ui-geo",
331
+ "@dxos/react-ui-graph",
332
+ "@dxos/react-ui-grid",
333
+ "@dxos/react-ui-list",
334
+ "@dxos/react-ui-markdown",
335
+ "@dxos/react-ui-masonry",
336
+ "@dxos/react-ui-menu",
337
+ "@dxos/react-ui-mosaic",
338
+ "@dxos/react-ui-pickers",
339
+ "@dxos/react-ui-list",
340
+ "@dxos/react-ui-stack",
341
+ "@dxos/react-ui-syntax-highlighter",
342
+ "@dxos/react-ui-table",
343
+ "@dxos/react-ui-tabs",
344
+ "@dxos/react-ui-text-tooltip",
345
+ "@dxos/react-ui-thread",
346
+ "@dxos/solid-ui",
347
+ "@dxos/solid-ui-geo",
348
+ "@dxos/ui",
349
+ "@dxos/ui-editor",
350
+ "@dxos/ui-theme",
351
+ "@dxos/ui-types",
352
+ // third-party
353
+ ...THIRD_PARTY_SHARED_PACKAGES
354
+ ];
355
+ var isSharedPackage = (id) => DEFAULT_PACKAGES.some((pkg) => id === pkg || id.startsWith(`${pkg}/`));
356
+
357
+ // src/vite-plugin/composer/index.ts
358
+ var JSX_DEV_RUNTIME = "react/jsx-dev-runtime";
359
+ var isExternal = (id) => id !== JSX_DEV_RUNTIME && isSharedPackage(id);
360
+ var REQUIRE_SHIM_BANNER = [
361
+ "// --- composer-plugin: CJS require shim ---",
362
+ "// See @dxos/app-framework/vite-plugin/composer-plugin.ts for rationale.",
363
+ "import * as __composerReact from 'react';",
364
+ "import * as __composerReactDom from 'react-dom';",
365
+ "import * as __composerReactJsxRuntime from 'react/jsx-runtime';",
366
+ "const __composerRequireShim = new Map([",
367
+ " ['react', __composerReact.default ?? __composerReact],",
368
+ " ['react-dom', __composerReactDom.default ?? __composerReactDom],",
369
+ " ['react/jsx-runtime', __composerReactJsxRuntime],",
370
+ "]);",
371
+ "// Module-local binding: rolldown's CJS fallback does a `typeof require` check",
372
+ "// and uses whichever `require` is in lexical scope. Declaring this as `const`",
373
+ "// (instead of `globalThis.require ??=`) keeps each bundle's shim isolated from",
374
+ "// the host page and from other plugins sharing the window.",
375
+ "const require = (id) => {",
376
+ " if (__composerRequireShim.has(id)) return __composerRequireShim.get(id);",
377
+ " throw new Error('composer-plugin: unsupported CJS require at runtime: ' + id);",
378
+ "};",
379
+ "// --- end CJS require shim ---"
380
+ ].join("\n");
381
+ var composerPlugin = (options) => {
382
+ const entry = options?.entry ?? "src/plugin.tsx";
383
+ const port = options?.port ?? PLUGIN_DEV_SERVER_PORT;
384
+ const meta = options?.meta;
385
+ const resolved = /* @__PURE__ */ new Set();
386
+ let base = "/";
387
+ const plugins = [
388
+ // Configure vite for library-mode builds with externalized deps.
389
+ {
390
+ name: "composer-plugin",
391
+ config: () => ({
392
+ server: {
393
+ port,
394
+ // Allow the Composer host (different origin) to dynamically import plugin modules.
395
+ cors: true
396
+ },
397
+ preview: {
398
+ port
399
+ },
400
+ build: {
401
+ sourcemap: true,
402
+ // Transitively-bundled WASM modules (automerge, tiktoken, …) emit top-level
403
+ // await; `esnext` lets rolldown pass that through without an explicit polyfill.
404
+ target: "esnext",
405
+ lib: {
406
+ entry,
407
+ formats: [
408
+ "es"
409
+ ],
410
+ fileName: () => ENTRY_FILENAME
411
+ },
412
+ rolldownOptions: {
413
+ external: (id) => isExternal(id),
414
+ output: {
415
+ chunkFileNames: "chunks/[name]-[hash].js",
416
+ assetFileNames: "assets/[name]-[hash][extname]",
417
+ // Install the CJS require shim at the top of plugin.mjs so transitively
418
+ // bundled CJS helpers (that call `require('react')` et al. at runtime) can
419
+ // resolve against the host-provided externals instead of throwing.
420
+ banner: REQUIRE_SHIM_BANNER
421
+ }
422
+ }
423
+ }
424
+ })
425
+ },
426
+ // Dev-time externalization.
427
+ // Vite's dev server doesn't use rollup externals, so we need to handle it manually.
428
+ // We intercept imports of shared deps at resolve time, mark them external, and then
429
+ // strip the `/@id/` prefix that Vite's import analysis injects for external modules.
430
+ {
431
+ name: "composer-plugin:externalize",
432
+ enforce: "pre",
433
+ apply: "serve",
434
+ // Exclude shared packages from Vite's dependency pre-bundling.
435
+ config: () => ({
436
+ optimizeDeps: {
437
+ exclude: DEFAULT_PACKAGES
438
+ }
439
+ }),
440
+ // Mark shared deps as external so Vite doesn't try to bundle them.
441
+ resolveId: (id) => {
442
+ if (isExternal(id)) {
443
+ resolved.add(id);
444
+ return {
445
+ id,
446
+ external: true
447
+ };
448
+ }
449
+ },
450
+ // Return a stub for any externalized module that Vite tries to load directly.
451
+ load: (id) => {
452
+ if (resolved.has(id)) {
453
+ return {
454
+ code: "export default {};"
455
+ };
456
+ }
457
+ },
458
+ // After all plugins are resolved, inject a late-stage transform plugin that strips
459
+ // the `/@id/` prefix from externalized bare specifiers in the output.
460
+ // This must run after Vite's internal import analysis which rewrites bare specifiers.
461
+ configResolved: (config) => {
462
+ base = config.base ?? "/";
463
+ config.plugins.push({
464
+ name: "composer-plugin:strip-prefix",
465
+ transform: (code) => {
466
+ if (resolved.size === 0) {
467
+ return;
468
+ }
469
+ const escaped = [
470
+ ...resolved
471
+ ].map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
472
+ const pattern = new RegExp(`${base}@id/(${escaped})`, "g");
473
+ if (pattern.test(code)) {
474
+ return code.replace(pattern, (_, dep) => dep);
475
+ }
476
+ }
477
+ });
478
+ }
479
+ },
480
+ // JSX dev runtime shim.
481
+ // React refresh (used by @vitejs/plugin-react) imports from `react/jsx-dev-runtime`,
482
+ // but the externalized React only exposes `react/jsx-runtime`. This virtual module
483
+ // bridges the gap by re-exporting jsx-runtime's functions under jsx-dev-runtime's API.
484
+ {
485
+ name: "composer-plugin:jsx-dev-shim",
486
+ enforce: "pre",
487
+ apply: "serve",
488
+ resolveId: (id) => id === JSX_DEV_RUNTIME ? `\0${JSX_DEV_RUNTIME}` : void 0,
489
+ load: (id) => id === `\0${JSX_DEV_RUNTIME}` ? [
490
+ 'import { jsx, jsxs, Fragment } from "react/jsx-runtime";',
491
+ "export { Fragment };",
492
+ "export function jsxDEV(type, props, key, isStaticChildren) {",
493
+ " return isStaticChildren ? jsxs(type, props, key) : jsx(type, props, key);",
494
+ "}"
495
+ ].join("\n") : void 0
496
+ },
497
+ // React Refresh preamble stub.
498
+ //
499
+ // @vitejs/plugin-react's JSX transform prepends a runtime check to every module:
500
+ // if (!window.$RefreshReg$) throw new Error("@vitejs/plugin-react can't detect preamble…");
501
+ // In a normal single-origin app, vite injects a `<script type="module">` preamble
502
+ // into `index.html` that sets up `$RefreshReg$` / `$RefreshSig$` on `window` before any
503
+ // app code runs. When a community plugin is dev-served at its own origin and then
504
+ // dynamic-imported into the Composer host at a different origin, the host's window
505
+ // never receives that preamble, so every JSX module throws on first import.
506
+ //
507
+ // Inject a no-op refresh shim on the host's window from the plugin's entrypoint: fast-
508
+ // refresh itself doesn't work cross-origin anyway, so silencing the check lets the
509
+ // plugin load and ordinary page reloads take care of picking up edits. Production
510
+ // builds are untouched (`apply: 'serve'`).
511
+ {
512
+ name: "composer-plugin:react-refresh-shim",
513
+ enforce: "pre",
514
+ apply: "serve",
515
+ transform(code, id) {
516
+ if (!id.endsWith(entry.replace(/^\.?\//, "/"))) {
517
+ return;
518
+ }
519
+ const shim = [
520
+ "// composer-plugin: no-op React Refresh shim so cross-origin plugin modules",
521
+ "// don't throw the @vitejs/plugin-react preamble check at dynamic-import time.",
522
+ 'if (typeof window !== "undefined") {',
523
+ " window.$RefreshReg$ = window.$RefreshReg$ || (() => {});",
524
+ " window.$RefreshSig$ = window.$RefreshSig$ || (() => (type) => type);",
525
+ " window.__vite_plugin_react_preamble_installed__ = true;",
526
+ "}",
527
+ ""
528
+ ].join("\n");
529
+ return {
530
+ code: shim + code,
531
+ map: null
532
+ };
533
+ }
534
+ }
535
+ ];
536
+ if (meta) {
537
+ plugins.push({
538
+ name: "composer-plugin:emit-manifest",
539
+ apply: "build",
540
+ // `enforce: 'post'` is load-bearing: vite's CSS extraction plugin emits sibling
541
+ // `.css` assets in its own `generateBundle` hook. Without `post`, ours runs first
542
+ // and sees only the JS chunks — the manifest then omits CSS, so the host can't
543
+ // inject `<link>` tags for the plugin's stylesheet at install time.
544
+ enforce: "post",
545
+ generateBundle(_options, bundle) {
546
+ const assets = Object.keys(bundle).filter((name) => name !== MANIFEST_ASSET_NAME && !name.endsWith(".map")).sort();
547
+ this.emitFile({
548
+ type: "asset",
549
+ fileName: MANIFEST_ASSET_NAME,
550
+ source: serializeManifest(meta, {
551
+ assets
552
+ })
553
+ });
554
+ }
555
+ });
556
+ plugins.push({
557
+ name: "composer-plugin:serve-manifest",
558
+ apply: "serve",
559
+ configureServer(server) {
560
+ const body = serializeManifest(meta, {
561
+ assets: [],
562
+ devEntry: entry.replace(/^\.?\//, "")
563
+ });
564
+ server.middlewares.use(`/${MANIFEST_ASSET_NAME}`, (req, res, next) => {
565
+ if (req.url && req.url !== "/" && req.url !== "") {
566
+ return next();
567
+ }
568
+ res.setHeader("Access-Control-Allow-Origin", "*");
569
+ res.setHeader("Content-Type", "application/json");
570
+ res.setHeader("Cache-Control", "no-store");
571
+ res.statusCode = 200;
572
+ res.end(body);
573
+ });
574
+ }
575
+ });
576
+ }
577
+ return plugins;
578
+ };
579
+
580
+ // src/vite-plugin/import-map/index.ts
581
+ import { init as initCjsLexer, parse as parseCjs } from "cjs-module-lexer";
582
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
583
+ import { createRequire as nodeCreateRequire } from "node:module";
584
+ import path from "node:path";
585
+ var require2 = nodeCreateRequire(import.meta.url);
586
+ var trimQueryString = (id) => id.replace(/\?.*$/, "");
587
+ var resolvedIdIsEsmModule = (resolvedId) => {
588
+ const file = trimQueryString(resolvedId);
589
+ if (file.endsWith(".mjs") || file.endsWith(".mts")) {
590
+ return true;
591
+ }
592
+ if (file.endsWith(".cjs") || file.endsWith(".cts")) {
593
+ return false;
594
+ }
595
+ let directory = path.dirname(file);
596
+ while (directory !== path.dirname(directory)) {
597
+ const packageJsonPath = path.join(directory, "package.json");
598
+ if (existsSync(packageJsonPath)) {
599
+ try {
600
+ const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
601
+ return pkg.type === "module";
602
+ } catch {
603
+ return false;
604
+ }
605
+ }
606
+ directory = path.dirname(directory);
607
+ }
608
+ return false;
609
+ };
610
+ var findPackageJsonPath = (resolvedId, packageName) => {
611
+ let directory = path.dirname(trimQueryString(resolvedId));
612
+ while (directory !== path.dirname(directory)) {
613
+ const packageJsonPath = path.join(directory, "package.json");
614
+ if (existsSync(packageJsonPath)) {
615
+ try {
616
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
617
+ if (packageJson.name === packageName) {
618
+ return packageJsonPath;
619
+ }
620
+ } catch {
621
+ }
622
+ }
623
+ directory = path.dirname(directory);
624
+ }
625
+ return void 0;
626
+ };
627
+ var resolvePackageJsonPath = (packageName) => {
628
+ try {
629
+ return findPackageJsonPath(require2.resolve(packageName), packageName);
630
+ } catch {
631
+ return void 0;
632
+ }
633
+ };
634
+ var resolvePackageJsonPathViaContext = async (ctx, packageName) => {
635
+ try {
636
+ const resolved = await ctx.resolve(packageName);
637
+ if (resolved) {
638
+ const viaResolved = findPackageJsonPath(resolved.id, packageName);
639
+ if (viaResolved) {
640
+ return viaResolved;
641
+ }
642
+ }
643
+ } catch {
644
+ }
645
+ return resolvePackageJsonPath(packageName);
646
+ };
647
+ var importMapExcludedSubpaths = {
648
+ "@dxos/app-framework": /* @__PURE__ */ new Set([
649
+ "vite-plugin"
650
+ ]),
651
+ // `@dxos/lit-grid/testing` re-exports a playwright page-object manager and pulls
652
+ // `@playwright/test` (and transitive playwright-core) into the browser bundle.
653
+ "@dxos/lit-grid": /* @__PURE__ */ new Set([
654
+ "testing"
655
+ ]),
656
+ "@dxos/react-ui-mosaic": /* @__PURE__ */ new Set([
657
+ "playwright"
658
+ ]),
659
+ "@dxos/react-ui-stack": /* @__PURE__ */ new Set([
660
+ "playwright"
661
+ ]),
662
+ "@dxos/react-ui-table": /* @__PURE__ */ new Set([
663
+ "playwright"
664
+ ]),
665
+ "@dxos/ui-theme": /* @__PURE__ */ new Set([
666
+ "plugin"
667
+ ]),
668
+ // `solid-js/web/storage` is a server-only helper that pulls
669
+ // `node:async_hooks` (AsyncLocalStorage) and has no browser shim. Client
670
+ // code imports `solid-js`, `solid-js/store`, and `solid-js/web` only.
671
+ "solid-js": /* @__PURE__ */ new Set([
672
+ "web/storage"
673
+ ]),
674
+ // `effect` publishes `./.index` for bundler internals — maps to `effect/.index`, which Vite
675
+ // often cannot resolve for the import map and is not part of the plugin-facing surface.
676
+ effect: /* @__PURE__ */ new Set([
677
+ ".index"
678
+ ])
679
+ };
680
+ var GLOBALLY_EXCLUDED_SUBPATHS = /* @__PURE__ */ new Set([
681
+ "playwright",
682
+ "testing"
683
+ ]);
684
+ var BUILD_TOOL_SUBPATH = /^(vite-plugin|esbuild-plugin|rollup-plugin|plugin)$/;
685
+ var ASSET_SUBPATH = /\.(css|pcss|scss|sass|less|json|node|wasm|html|svg|png|jpe?g|gif|webp|ico)$/;
686
+ var isAssetSubpath = (specifier) => ASSET_SUBPATH.test(specifier);
687
+ var walkDirectoryForExtension = (baseDir, extension) => {
688
+ if (!existsSync(baseDir)) {
689
+ return [];
690
+ }
691
+ const results = [];
692
+ const walk = (dir) => {
693
+ let entries;
694
+ try {
695
+ entries = readdirSync(dir);
696
+ } catch {
697
+ return;
698
+ }
699
+ for (const entry of entries) {
700
+ const full = path.join(dir, entry);
701
+ let stat;
702
+ try {
703
+ stat = statSync(full);
704
+ } catch {
705
+ continue;
706
+ }
707
+ if (stat.isDirectory()) {
708
+ walk(full);
709
+ } else if (entry.endsWith(extension)) {
710
+ results.push(path.relative(baseDir, full).slice(0, -extension.length));
711
+ }
712
+ }
713
+ };
714
+ walk(baseDir);
715
+ return results;
716
+ };
717
+ var pickPatternTarget = (value) => {
718
+ if (typeof value === "string") {
719
+ return value;
720
+ }
721
+ if (value && typeof value === "object") {
722
+ const obj = value;
723
+ const preferred = obj.browser ?? obj.import ?? obj.default ?? obj.module;
724
+ return typeof preferred === "string" ? preferred : void 0;
725
+ }
726
+ return void 0;
727
+ };
728
+ var expandWildcardExport = (packageName, packageJsonDir, exportKey, exportValue) => {
729
+ const target = pickPatternTarget(exportValue);
730
+ if (!target || !target.includes("*")) {
731
+ return [];
732
+ }
733
+ const keyStarIndex = exportKey.indexOf("*");
734
+ const targetStarIndex = target.indexOf("*");
735
+ if (keyStarIndex === -1 || targetStarIndex === -1) {
736
+ return [];
737
+ }
738
+ const keyPrefix = exportKey.slice(2, keyStarIndex);
739
+ const targetPrefix = target.slice(2, targetStarIndex);
740
+ const targetSuffix = target.slice(targetStarIndex + 1);
741
+ const baseDir = path.resolve(packageJsonDir, targetPrefix);
742
+ const files = walkDirectoryForExtension(baseDir, targetSuffix || ".js");
743
+ return files.map((relativeNoExt) => `${packageName}/${keyPrefix}${relativeNoExt}`);
744
+ };
745
+ var getPackageEntrypoints = (packageName, packageJsonPath) => {
746
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
747
+ const exportsField = packageJson.exports;
748
+ if (!exportsField || typeof exportsField === "string" || Array.isArray(exportsField)) {
749
+ return [
750
+ packageName
751
+ ];
752
+ }
753
+ const exportKeys = Object.keys(exportsField);
754
+ if (!exportKeys.some((key) => key.startsWith("."))) {
755
+ return [
756
+ packageName
757
+ ];
758
+ }
759
+ const excluded = importMapExcludedSubpaths[packageName];
760
+ const packageJsonDir = path.dirname(packageJsonPath);
761
+ const modules = exportKeys.flatMap((key) => {
762
+ if (key === ".") {
763
+ return [
764
+ packageName
765
+ ];
766
+ }
767
+ if (!key.startsWith("./") || key === "./package.json") {
768
+ return [];
769
+ }
770
+ if (key.endsWith(".d.ts")) {
771
+ return [];
772
+ }
773
+ if (key.includes("*")) {
774
+ return expandWildcardExport(packageName, packageJsonDir, key, exportsField[key]);
775
+ }
776
+ const subpath = key.slice(2);
777
+ if (excluded?.has(subpath) || GLOBALLY_EXCLUDED_SUBPATHS.has(subpath) || BUILD_TOOL_SUBPATH.test(subpath)) {
778
+ return [];
779
+ }
780
+ return [
781
+ `${packageName}/${subpath}`
782
+ ];
783
+ });
784
+ return modules.length > 0 ? modules : [
785
+ packageName
786
+ ];
787
+ };
788
+ var getCjsNamedExports = (filePath, seen = /* @__PURE__ */ new Set()) => {
789
+ const normalized = trimQueryString(filePath);
790
+ if (seen.has(normalized)) {
791
+ return [];
792
+ }
793
+ seen.add(normalized);
794
+ try {
795
+ const source = readFileSync(normalized, "utf8");
796
+ const { exports: directExports, reexports } = parseCjs(source);
797
+ const reexportedNames = reexports.flatMap((reexport) => {
798
+ const resolved = path.resolve(path.dirname(normalized), reexport);
799
+ const candidates = [
800
+ resolved,
801
+ `${resolved}.js`,
802
+ `${resolved}.cjs`
803
+ ];
804
+ const found = candidates.find((candidate) => existsSync(candidate));
805
+ return found ? getCjsNamedExports(found, seen) : [];
806
+ });
807
+ return [
808
+ .../* @__PURE__ */ new Set([
809
+ ...directExports,
810
+ ...reexportedNames
811
+ ])
812
+ ].filter((name) => name !== "default" && name !== "__esModule");
813
+ } catch {
814
+ return [];
815
+ }
816
+ };
817
+ var importMapPlugin = (options) => {
818
+ const packages = options?.packages ?? DEFAULT_PACKAGES;
819
+ const WRAPPER_PREFIX = "\0import-map:";
820
+ const chunkRefIds = {};
821
+ const resolvedIds = {};
822
+ let imports = {};
823
+ let modules = [];
824
+ let importMapIsDev = false;
825
+ let base = "/";
826
+ return [
827
+ // Phase 1: Resolve all package entrypoints and emit chunks.
828
+ //
829
+ // Build-only. The dev-mode path (recording absolute `/@fs/` paths in
830
+ // `imports[]`) is non-functional today and was actively harmful: calling
831
+ // `this.resolve()` for every shared package's subpath entrypoints during
832
+ // `buildStart` races with Vite's optimize-deps static scan, producing
833
+ // non-deterministic chunk content (~34 drifting chunks per warm-start) and
834
+ // triggering Vite 8.0.10's `runOptimizer` / `commitProcessing` crashes
835
+ // (`fileHash` / `browserHash` undefined on partial-discovery batches) when
836
+ // the resolved set doesn't match the optimizer's metadata. The importmap
837
+ // is only meaningful for production builds where remote plugins consume
838
+ // the emitted wrapper chunks.
839
+ {
840
+ name: "import-map:get-chunk-ref-ids",
841
+ apply: "build",
842
+ configResolved(config) {
843
+ base = config.base ?? "/";
844
+ },
845
+ async buildStart() {
846
+ importMapIsDev = this.environment.mode === "dev";
847
+ await initCjsLexer();
848
+ modules = [
849
+ ...new Set((await Promise.all(packages.map(async (packageName) => {
850
+ const packageJsonPath = await resolvePackageJsonPathViaContext(this, packageName);
851
+ if (!packageJsonPath) {
852
+ this.warn(`Unable to locate package.json for import map package: ${packageName}`);
853
+ return [
854
+ packageName
855
+ ];
856
+ }
857
+ return getPackageEntrypoints(packageName, packageJsonPath);
858
+ }))).flat())
859
+ ];
860
+ for (const specifier of modules) {
861
+ if (isAssetSubpath(specifier)) {
862
+ imports[specifier] = "data:text/javascript;charset=utf-8,export%20%7B%7D%3B";
863
+ continue;
864
+ }
865
+ const resolved = await this.resolve(specifier);
866
+ if (!resolved) {
867
+ this.warn(`Import map: unable to resolve "${specifier}"; omitting from import map.`);
868
+ continue;
869
+ }
870
+ if (importMapIsDev) {
871
+ const filePath = trimQueryString(resolved.id);
872
+ imports[specifier] = filePath.startsWith("/") ? `/@fs${filePath}` : filePath;
873
+ } else {
874
+ resolvedIds[specifier] = resolved.id;
875
+ chunkRefIds[specifier] = this.emitFile({
876
+ type: "chunk",
877
+ id: `${WRAPPER_PREFIX}${specifier}`,
878
+ preserveSignature: "strict"
879
+ });
880
+ }
881
+ }
882
+ },
883
+ // Intercept virtual wrapper IDs so Rollup doesn't try to resolve them as files.
884
+ resolveId(id) {
885
+ if (id.startsWith(WRAPPER_PREFIX)) {
886
+ return id;
887
+ }
888
+ },
889
+ // Generate the source for each virtual wrapper module.
890
+ // For CJS packages, explicitly re-export named exports (discovered via static analysis)
891
+ // because Rollup's `export *` interop doesn't preserve them for CJS.
892
+ //
893
+ // Each wrapper also emits a local `__keepalive` export. Without this, Rolldown
894
+ // (Vite 8) tree-shakes wrappers whose `export *` re-exports happen to coincide
895
+ // with another already-emitted chunk's exports — typical for umbrella packages
896
+ // (e.g. `@dxos/compute` re-exports from `@dxos/operation`, so the operation
897
+ // wrapper looks "redundant" to Rolldown and gets merged away). A local const
898
+ // export has no upstream source for Rolldown to dedupe against, so the chunk
899
+ // is always preserved and the import-map entry resolves at runtime.
900
+ load(id) {
901
+ if (!id.startsWith(WRAPPER_PREFIX)) {
902
+ return;
903
+ }
904
+ const specifier = id.slice(WRAPPER_PREFIX.length);
905
+ const keepalive = `export const __dxosImportMapKeepalive = ${JSON.stringify(specifier)};`;
906
+ const resolvedId = resolvedIds[specifier];
907
+ if (!resolvedId) {
908
+ return `export * from ${JSON.stringify(specifier)};
909
+ ${keepalive}
910
+ `;
911
+ }
912
+ const filePath = trimQueryString(resolvedId);
913
+ const isCjs = filePath.endsWith(".cjs") || !filePath.endsWith(".mjs") && !resolvedIdIsEsmModule(filePath);
914
+ if (isCjs) {
915
+ const named = getCjsNamedExports(filePath);
916
+ if (named.length > 0) {
917
+ return `export { default, ${named.join(", ")} } from ${JSON.stringify(specifier)};
918
+ ${keepalive}
919
+ `;
920
+ }
921
+ }
922
+ return `export * from ${JSON.stringify(specifier)};
923
+ ${keepalive}
924
+ `;
925
+ },
926
+ // After bundling, map each specifier to the URL of its emitted chunk. Preserves
927
+ // asset-subpath entries already written to `imports` during `buildStart` (those
928
+ // use an inline data URL rather than an emitted chunk).
929
+ generateBundle() {
930
+ if (importMapIsDev) {
931
+ return;
932
+ }
933
+ imports = {
934
+ ...imports,
935
+ ...Object.fromEntries(modules.filter((specifier) => chunkRefIds[specifier] !== void 0).map((specifier) => [
936
+ specifier,
937
+ `${base}${this.getFileName(chunkRefIds[specifier])}`
938
+ ]))
939
+ };
940
+ }
941
+ },
942
+ // Phase 2: Inject the import map into the HTML as a <script type="importmap"> tag.
943
+ {
944
+ name: "import-map:transform-index-html",
945
+ apply: "build",
946
+ enforce: "post",
947
+ transformIndexHtml(html) {
948
+ const tags = [
949
+ {
950
+ tag: "script",
951
+ attrs: {
952
+ type: "importmap"
953
+ },
954
+ children: JSON.stringify({
955
+ imports
956
+ }, null, 2)
957
+ }
958
+ ];
959
+ return {
960
+ html,
961
+ tags
962
+ };
963
+ }
964
+ }
965
+ ];
966
+ };
967
+ export {
968
+ DEFAULT_PACKAGES,
969
+ ENTRY_FILENAME,
970
+ MANIFEST_ASSET_NAME,
971
+ bootLoaderPlugin,
972
+ composerPlugin,
973
+ importMapPlugin,
974
+ isSharedPackage,
975
+ serializeManifest
976
+ };
977
+ //# sourceMappingURL=index.mjs.map