@volter/editor-game 0.5.65 → 0.5.67

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 (281) hide show
  1. package/contributions/audio-unlock.service.ts +2 -2
  2. package/contributions/autoplay.service.ts +1 -1
  3. package/contributions/bridge.command.ts +3 -3
  4. package/contributions/canvas/component-board.service.ts +16 -0
  5. package/contributions/canvas/design-time-mount.service.ts +45 -0
  6. package/contributions/canvas-story-capture.service.ts +12 -0
  7. package/contributions/edit-mode-audio.service.ts +2 -2
  8. package/contributions/edit-mode-networking.service.ts +1 -1
  9. package/contributions/gameplay.command.ts +4 -4
  10. package/contributions/generation.service.ts +3 -3
  11. package/contributions/generations.status.tsx +1 -1
  12. package/contributions/godot.palette.json +99 -0
  13. package/contributions/godot.style.ts +82 -0
  14. package/contributions/godot.view.ts +75 -0
  15. package/contributions/ingest.service.ts +4 -4
  16. package/contributions/instances.command.ts +1 -1
  17. package/contributions/navmesh.menu.ts +1 -1
  18. package/contributions/network-observer.service.ts +14 -0
  19. package/contributions/play.command.ts +11 -5
  20. package/contributions/react/component-board.service.ts +1 -1
  21. package/contributions/react/design-time-mount.service.ts +1 -1
  22. package/contributions/react/react-inspector.service.ts +2 -2
  23. package/contributions/scene-document.service.ts +5 -5
  24. package/contributions/state-watch.menu.ts +1 -1
  25. package/contributions/state-watch.utility.tsx +1 -1
  26. package/contributions/team-playtest.service.ts +4 -4
  27. package/contributions/three/component-board.service.ts +1 -1
  28. package/contributions/three/component-verbs.command.ts +8 -8
  29. package/contributions/three/three-authoring.service.ts +8 -5
  30. package/contributions/three-story-capture.service.ts +12 -0
  31. package/contributions/unity.palette.json +102 -0
  32. package/contributions/unity.style.ts +72 -0
  33. package/contributions/unity.view.ts +82 -0
  34. package/contributions/unreal.palette.json +105 -0
  35. package/contributions/unreal.style.ts +66 -0
  36. package/contributions/unreal.view.ts +93 -0
  37. package/dist-node/serving.mjs +16 -0
  38. package/package.json +33 -16
  39. package/serving/index.ts +27 -0
  40. package/src/asset-budget/AssetBudgetPanel.tsx +1 -1
  41. package/src/asset-budget/asset-budget-model.ts +4 -4
  42. package/src/asset-budget/optimize-apply.ts +7 -7
  43. package/src/audio/AudioDebuggerPanel.tsx +1 -1
  44. package/src/bridge/dispatch.ts +16 -16
  45. package/src/bridge/live-frames.ts +1 -1
  46. package/src/bridge/screenshot.ts +6 -6
  47. package/src/build/BuildProfilesPanel.tsx +3 -3
  48. package/src/canvas/canvas-board/CanvasBoardDocument.tsx +676 -0
  49. package/src/canvas/canvas-board/canvas-board-model.ts +407 -0
  50. package/src/canvas/canvas-board/canvas-component-board.ts +56 -0
  51. package/src/canvas/canvas-design-mount.ts +524 -0
  52. package/src/canvas/design-time-canvas-mount.ts +79 -0
  53. package/src/coverage/live-authoring-surface.ts +6 -6
  54. package/src/coverage/live-project-verbs.ts +2 -2
  55. package/src/coverage/native-system-coverage.ts +6 -6
  56. package/src/coverage/root-coverage.ts +1 -1
  57. package/src/coverage/session-coverage.ts +5 -5
  58. package/src/design-system-stories/ApplicationChrome.stories.tsx +5 -5
  59. package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +13 -53
  60. package/src/edit-mode/edit-mode-audio.ts +4 -4
  61. package/src/edit-mode/edit-mode-networking.ts +2 -2
  62. package/src/game-document/GameCaptureFrameButton.tsx +2 -2
  63. package/src/game-document/GameDocument.tsx +2 -2
  64. package/src/game-document/GamePanel.tsx +8 -8
  65. package/src/game-document/InstanceInspectorPicker.tsx +2 -2
  66. package/src/game-document/crowd-debug.ts +1 -1
  67. package/src/game-document/device-preview.ts +10 -11
  68. package/src/game-document/physics-debug.ts +1 -1
  69. package/src/generation/GenerationActivity.tsx +6 -8
  70. package/src/generation/generation-documents.tsx +8 -8
  71. package/src/generation/generation-jobs.ts +2 -2
  72. package/src/generation/generation-presentation.ts +1 -1
  73. package/src/host/adapter-reach.ts +1 -1
  74. package/src/host/adapter-runtime-bindings.ts +97 -6
  75. package/src/host/api/configurations.ts +2 -2
  76. package/src/host/authoring/babylon-authoring-adapter.ts +8 -8
  77. package/src/host/authoring/contract-hierarchy-authoring.ts +1 -1
  78. package/src/host/authoring/contract-scenes-stories.ts +1 -1
  79. package/src/host/authoring/creation-site-related.ts +2 -2
  80. package/src/host/authoring/ephemeral-persistence.ts +1 -1
  81. package/src/host/authoring/gesture-persist.ts +2 -2
  82. package/src/host/authoring/ingest-data-writer.ts +1 -1
  83. package/src/host/authoring/ingest-source-persistence.ts +8 -8
  84. package/src/host/authoring/mount-isolated-pixi-screen.ts +1 -1
  85. package/src/host/authoring/mounted-authoring.ts +4 -4
  86. package/src/host/authoring/phaser-live-authoring-adapter.ts +4 -4
  87. package/src/host/authoring/pixi-authoring-adapter.ts +42 -17
  88. package/src/host/authoring/pixi-creation-site-write-target.ts +2 -2
  89. package/src/host/authoring/pixi-live-write-target.ts +7 -7
  90. package/src/host/authoring/pixi-source-identity.ts +3 -3
  91. package/src/host/authoring/pixi-source-write-target.ts +1614 -0
  92. package/src/host/authoring/pixi-still-presentation.ts +2 -2
  93. package/src/host/authoring/pixi-structure-history.ts +3 -3
  94. package/src/host/authoring/pixi-transform-channels.ts +16 -14
  95. package/src/host/authoring/source-persistence-backend.ts +6 -6
  96. package/src/host/authoring/struct-write-pipe.ts +3 -3
  97. package/src/host/binding-resolver.ts +8 -9
  98. package/src/host/browser-transpile.ts +2 -2
  99. package/src/host/canvas-entry-runtime.ts +59 -48
  100. package/src/host/canvas-preview-frames.ts +482 -0
  101. package/src/host/components/CameraAuthoringOverlay.tsx +1 -1
  102. package/src/host/components/HeaderTelemetry.tsx +9 -16
  103. package/src/host/components/PixiIsolationSceneContent.tsx +17 -16
  104. package/src/host/components/ThreeIsolationSceneContent.tsx +5 -5
  105. package/src/host/components/frame-debugger-model.ts +2 -2
  106. package/src/host/components/header-telemetry-model.ts +2 -2
  107. package/src/host/components/scene-document.tsx +29 -61
  108. package/src/host/components/utility-view-state.ts +1 -1
  109. package/src/host/components/world-root-stage-binding.tsx +17 -26
  110. package/src/host/components/world-root-stage.ts +130 -63
  111. package/src/host/coverage/capability-coverage.ts +13 -1
  112. package/src/host/coverage/game-contract-seam-evidence.ts +1 -1
  113. package/src/host/coverage/project-verb-coverage.ts +2 -17
  114. package/src/host/coverage/system-adapter-coverage.ts +4 -5
  115. package/src/host/design-system-stories/fixtures/editor-runtime.tsx +14 -8
  116. package/src/host/document-preview-three.ts +2 -2
  117. package/src/host/entry-adjudication.ts +6 -6
  118. package/src/host/game-css-scope-transform.ts +4 -0
  119. package/src/host/game-module-access.ts +1 -1
  120. package/src/host/game-realm-page.ts +16 -8
  121. package/src/host/game-realm-reclaim.ts +1 -1
  122. package/src/host/gameplay-export.ts +25 -14
  123. package/src/host/gameplay-recording.ts +5 -5
  124. package/src/host/gated-globals.ts +6 -6
  125. package/src/host/history/json-history-resource.ts +3 -3
  126. package/src/host/instance-extract-actions.ts +1 -1
  127. package/src/host/instance-fork-actions.ts +1 -1
  128. package/src/host/projection/dom.ts +2 -2
  129. package/src/host/projection/pixi.ts +25 -3
  130. package/src/host/r3f-entry-runtime.ts +65 -34
  131. package/src/host/react-mount-runtime.ts +8 -49
  132. package/src/host/realm-services.ts +2 -2
  133. package/src/host/roots/canvas-root.tsx +361 -0
  134. package/src/host/roots/module-root.ts +1 -1
  135. package/src/host/roots/r3f-root.tsx +473 -0
  136. package/src/host/roots/react-root.ts +9 -43
  137. package/src/host/scene-view-drawability.ts +2 -2
  138. package/src/host/served-bundle-runtime-modules.ts +1 -19
  139. package/src/host/server-log-bridge.ts +3 -3
  140. package/src/host/stories/mounted-story-viewport-source.ts +1 -1
  141. package/src/host/stories/pixi-story-model.ts +30 -0
  142. package/src/host/stories/story-media-captures.ts +46 -0
  143. package/src/host/stories/story-media-presence.ts +3 -3
  144. package/src/host/stories/story-pixi-preview.ts +408 -0
  145. package/src/host/stories/story-three-preview.ts +806 -0
  146. package/src/host/stories/three-story-captures.ts +35 -0
  147. package/src/host/story-three-preview-runtime.ts +56 -0
  148. package/src/host/three-ingest-runtime.ts +1 -1
  149. package/src/host/use-active-performance-source.ts +3 -3
  150. package/src/host/viewport-pose-memory.ts +1 -1
  151. package/src/host/viewport-root-presentation.ts +6 -5
  152. package/src/ingest/active-ingest.ts +2 -2
  153. package/src/ingest/authoring/ingest-dom-surface-authoring.ts +4 -4
  154. package/src/ingest/authoring/ingest-root-adapter.ts +13 -13
  155. package/src/ingest/capture-wait-report.ts +1 -1
  156. package/src/ingest/deferred-ingest-play.ts +11 -10
  157. package/src/ingest/discovery-public-ingest.ts +2 -2
  158. package/src/ingest/ingest-boot-viewport.ts +6 -8
  159. package/src/ingest/ingest-canvas-scene-document.tsx +17 -16
  160. package/src/ingest/ingest-canvas-scene.ts +5 -8
  161. package/src/ingest/ingest-evidence-hook.ts +1 -1
  162. package/src/ingest/ingest-frame-snapshot.ts +1 -1
  163. package/src/ingest/ingest-play-control.ts +4 -4
  164. package/src/ingest/ingest-render-debug.ts +11 -11
  165. package/src/ingest/ingest-siblings.ts +16 -28
  166. package/src/ingest/module-mode.ts +18 -19
  167. package/src/ingest/mount-canvas-ingest-root.ts +27 -27
  168. package/src/ingest/mount-coverage.ts +4 -4
  169. package/src/ingest/mount-dom-ingest-root.ts +16 -16
  170. package/src/ingest/mount-ingest-root.ts +14 -14
  171. package/src/ingest/mount-three-ingest-root.ts +12 -12
  172. package/src/ingest/resolve-canvas.ts +1 -1
  173. package/src/ingest/served-html-boot.ts +1 -1
  174. package/src/ingest/surface-canvas.ts +1 -1
  175. package/src/ingest/unmount-ingest-root.ts +7 -7
  176. package/src/navmesh/navmesh-handler.ts +24 -16
  177. package/src/network/NetworkInspectorPanel.tsx +449 -14
  178. package/src/network/network-inspector-model.ts +14 -2
  179. package/src/play/play-log-events.ts +1 -1
  180. package/src/play/play-mode.ts +99 -142
  181. package/src/play/play-recording.ts +2 -2
  182. package/src/play/react-play-live-authoring.ts +3 -3
  183. package/src/play/run-selection.ts +93 -0
  184. package/src/play-bar/PlayBar.tsx +20 -39
  185. package/src/profiler/FrameDebuggerPanel.tsx +1 -1
  186. package/src/profiler/PerformancePanel.tsx +4 -4
  187. package/src/react/design-time-react-mount.ts +37 -85
  188. package/src/react/dom-authoring-adapter.ts +11 -11
  189. package/src/react/react-inspector-section.tsx +13 -13
  190. package/src/react/react-world-authoring-adapter.ts +31 -143
  191. package/src/react/story-documents/story-documents.tsx +18 -22
  192. package/src/react/ui-board-document.tsx +10 -11
  193. package/src/react/ui-component-board.ts +5 -5
  194. package/src/runtime/adapter/audio-meter.ts +21 -0
  195. package/src/runtime/adapter/first-party-audio-system.ts +230 -0
  196. package/src/runtime/adapter/ingest/contract-debug-adapter.ts +114 -0
  197. package/src/runtime/adapter/ingest/contract-system-adapters.ts +256 -0
  198. package/src/runtime/adapter/ingest/merge-debug-adapters.ts +197 -0
  199. package/src/runtime/adapter/ingest/observation-debug-adapter.ts +162 -0
  200. package/src/runtime/adapter/ingest/upstream-pin.ts +51 -0
  201. package/src/runtime/adapter/native-debug-module.ts +498 -0
  202. package/src/runtime/audio/bus-mixer.ts +161 -0
  203. package/src/runtime/audio/pose-guard.ts +80 -0
  204. package/src/runtime/core/frame-pacing.ts +126 -0
  205. package/src/runtime/core/game-loop.ts +225 -0
  206. package/src/runtime/core/game-scoped-slot.ts +28 -0
  207. package/src/runtime/core/seeded-random.ts +162 -0
  208. package/src/runtime/core/sim-clock.ts +391 -0
  209. package/src/runtime/core/system-runner.ts +269 -0
  210. package/src/runtime/core/types.ts +104 -0
  211. package/src/runtime/create-runtime.ts +1128 -0
  212. package/src/runtime/debug-bridge.ts +570 -0
  213. package/src/runtime/debug-registry.ts +899 -0
  214. package/src/runtime/dev/chrome-trace.ts +153 -0
  215. package/src/runtime/dev/instruments.ts +403 -0
  216. package/src/runtime/dev/logger.ts +119 -0
  217. package/src/runtime/dev/performance-profiler.ts +367 -0
  218. package/src/runtime/dev/register-render-vitals.ts +276 -0
  219. package/src/runtime/dev/render-census.ts +354 -0
  220. package/src/runtime/dev/render-debug-adapter.ts +218 -0
  221. package/src/runtime/dev/render-memory.ts +226 -0
  222. package/src/runtime/dev/render-vitals.ts +338 -0
  223. package/src/runtime/dev/static-batch-advisor.ts +188 -0
  224. package/src/runtime/dev/webgl-frame-capture.ts +366 -0
  225. package/src/runtime/dev/webgl-gpu-timer.ts +53 -0
  226. package/src/runtime/dev-build.ts +47 -0
  227. package/src/runtime/game.ts +1636 -0
  228. package/src/runtime/gameplay-rng-trap.ts +135 -0
  229. package/src/runtime/host-context.ts +64 -0
  230. package/src/runtime/input-router.ts +169 -0
  231. package/src/runtime/mount-manifest.ts +480 -0
  232. package/src/runtime/pixi/authoring.ts +706 -0
  233. package/src/runtime/pixi/ingest.ts +116 -0
  234. package/src/runtime/pixi/physics-registry.ts +49 -0
  235. package/src/runtime/pixi/render-pass-bracket.ts +117 -0
  236. package/src/runtime/pixi/scene-capture.ts +179 -0
  237. package/src/runtime/pixi/system-adapters.ts +69 -0
  238. package/src/runtime/playtest.ts +22 -0
  239. package/src/runtime/presentation.ts +141 -0
  240. package/src/runtime/render-control.ts +642 -0
  241. package/src/runtime/render-seed.ts +77 -0
  242. package/src/runtime/run-ticks-settled.ts +73 -0
  243. package/src/runtime/setup/setup-audio.ts +72 -0
  244. package/src/services/audio-pose-guard.ts +2 -2
  245. package/src/services/game-audio.ts +152 -0
  246. package/src/services/game-network.ts +657 -0
  247. package/src/services/game-physics.ts +334 -0
  248. package/src/state-watch/StateWatchPanel.tsx +1 -1
  249. package/src/three/authoring/camera-runtime-inspector-section.tsx +4 -3
  250. package/src/three/authoring/constraint-inspector-section.tsx +8 -7
  251. package/src/three/authoring/model-asset-inspector-section.tsx +14 -17
  252. package/src/three/authoring/oid-source-persistence.ts +13 -13
  253. package/src/three/authoring/r3f-design-session.ts +79 -61
  254. package/src/three/authoring/r3f-source-authoring-adapter.ts +112 -108
  255. package/src/three/authoring/reflection-probe-inspector-section.tsx +5 -4
  256. package/src/three/authoring/spatial-joint-handles.ts +1 -1
  257. package/src/three/authoring/spatial-lod-handles.ts +1 -1
  258. package/src/three/authoring/spatial-particle-handles.ts +1 -1
  259. package/src/three/authoring/three-authoring-adapter.ts +33 -33
  260. package/src/three/component-verbs/extract-menu.ts +8 -7
  261. package/src/three/component-verbs/fork-menu.ts +8 -7
  262. package/src/three/component-verbs/internals-menu.ts +3 -3
  263. package/src/three/drei-asset-caches.ts +13 -0
  264. package/src/three/story-documents/three-story-documents.tsx +24 -34
  265. package/src/three/three-board/ThreeBoardDocument.tsx +25 -25
  266. package/src/three/three-board/board-scene.ts +7 -7
  267. package/src/three/three-board/three-component-board.ts +5 -5
  268. package/contributions/react/pasteboard.action.ts +0 -41
  269. package/contributions/xstate-behavior.action.ts +0 -42
  270. package/contributions/xstate-behavior.document.tsx +0 -73
  271. package/contributions/xstate-behavior.inspector.tsx +0 -28
  272. package/contributions/xstate-behavior.menu.ts +0 -23
  273. package/src/react/pasteboard-materialize.ts +0 -154
  274. package/src/services/game-audio-unlock.ts +0 -48
  275. package/src/xstate/XStateBehaviorSection.tsx +0 -130
  276. package/src/xstate/XStateMachineInspector.tsx +0 -566
  277. package/src/xstate/character-animation-machine.fixture.ts +0 -74
  278. package/src/xstate/live-behaviors.ts +0 -106
  279. package/src/xstate/use-live-actor-state.ts +0 -44
  280. package/src/xstate/xstate-graph.ts +0 -235
  281. package/src/xstate/xstate-layout.ts +0 -76
@@ -1,4 +1,4 @@
1
- import { onAssetReload } from '@volter/editor-core/project-asset-refresh';
1
+ import { onAssetReload } from '@volter/editor-sdk/kit/project-asset-refresh';
2
2
 
3
3
  /**
4
4
  * R3F design session (W4) — mounts an entry-based R3F three world at DESIGN
@@ -61,31 +61,39 @@ import { onAssetReload } from '@volter/editor-core/project-asset-refresh';
61
61
  * published), and the returned disposer.
62
62
  */
63
63
 
64
- import { setActiveSystems, updateInstanceSystems } from '@volter/editor-core/authoring/active-systems';
64
+ import { setActiveSystems, updateInstanceSystems } from '@volter/editor-sdk/kit/authoring/active-systems';
65
65
  import {
66
66
  BoundaryAuthoringAdapter,
67
67
  type BoundaryRootInfo,
68
- } from '@volter/editor-core/authoring/boundary-authoring-adapter';
69
- import type { CompositeAuthoringAdapter } from '@volter/editor-core/authoring/composite-authoring-adapter';
68
+ } from '@volter/editor-sdk/kit/authoring/boundary-authoring-adapter';
69
+ import type { CompositeAuthoringAdapter } from '@volter/editor-sdk/kit/authoring/composite-authoring-adapter';
70
70
  import {
71
71
  collaborationSnapshot,
72
72
  subscribeCollaborationRevision,
73
- } from '@volter/editor-core/collaboration-client';
74
- import { editorConsole } from '@volter/editor-core/editor-console';
75
- import type { EditorShellStore } from '@volter/editor-core/editor-shell-store';
73
+ } from '@volter/editor-sdk/kit/collaboration-client';
74
+ import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
75
+ import {
76
+ describeModuleFetch,
77
+ diagnoseModuleFetch,
78
+ failedImportEntry,
79
+ } from '@volter/editor-sdk/kit/module-fetch-diagnosis';
80
+ import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
81
+ import { withObservedPhysics } from '../../host/adapter-runtime-bindings';
82
+ import { whenRapierWorldMounts } from '../../services/game-physics';
76
83
  import { adjudicateThreeEntry } from '../../host/entry-adjudication';
77
- import { onPlayTransitionSettled } from '@volter/editor-core/live-transition';
78
- import { fetchRawGameManifest } from '@volter/editor-core/manifest-project';
79
- import { getCurrentProject } from '@volter/editor-core/project-manager';
84
+ import { onPlayTransitionSettled } from '@volter/editor-sdk/kit/live-transition';
85
+ import { fetchRawGameManifest } from '@volter/editor-sdk/kit/manifest-project';
86
+ import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
80
87
  import { activeRealmServices } from '../../host/realm-services';
81
- import { pickGameCamera } from '@volter/editor-core/scene-framing';
82
- import { tierSourceWriteBackend } from '@volter/editor-core/ui-source/tier-source-write-backend';
88
+ import { pickGameCamera } from '@volter/editor-threejs/kit/scene-framing';
89
+ import { tierSourceWriteBackend } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
83
90
  import type {
84
91
  MountedThreeRoot,
85
92
  RootAdapter,
86
93
  SystemAdapters,
87
94
  } from '@volter/editor-project/adapter';
88
- import type { GameThreeHostContext } from '@volter/game-runtime/runtime/host-context';
95
+ import type { GameThreeHostContext } from '../../runtime/host-context';
96
+ import type { ThreeMountedRoot } from '@volter/editor-threejs/adapter/three-contract';
89
97
  import { nodeKeyedPhysics } from '@volter/editor-project/adapter';
90
98
  import { declaredRoots, rootById } from '@volter/editor-project/adapter/manifest-interpreter';
91
99
  import {
@@ -95,11 +103,11 @@ import {
95
103
  type NativeSystemsBinding,
96
104
  nativeDebugBindingFromEntryModule,
97
105
  nativeSystemsBindingFromEntryModule,
98
- } from '@volter/game-runtime/adapter/native-debug-module';
106
+ } from '../../runtime/adapter/native-debug-module';
99
107
  import { createAssetCache } from '@volter/threejs-runtime/assets';
100
- import { createGameLoop } from '@volter/game-runtime/core/game-loop';
101
- import { registerThreeRoot } from '@volter/game-runtime/runtime/create-runtime';
102
- import { createGame, type GameInternal } from '@volter/game-runtime/runtime/game';
108
+ import { createGameLoop } from '../../runtime/core/game-loop';
109
+ import { registerThreeRoot } from '../../runtime/create-runtime';
110
+ import { createGame, type GameInternal } from '../../runtime/game';
103
111
  import {
104
112
  beginProjectMountEpoch,
105
113
  viteUpdateImportPath,
@@ -131,13 +139,13 @@ import {
131
139
  type EditModeRootSpec,
132
140
  parseEditModeManifest,
133
141
  queueEditModeRebuild,
134
- } from '@volter/editor-core/authoring/edit-mode-authoring';
135
- import { liveGestureActive, whenLiveGestureIdle } from '@volter/editor-core/authoring/live-gesture-lock';
142
+ } from '@volter/editor-sdk/kit/authoring/edit-mode-authoring';
143
+ import { liveGestureActive, whenLiveGestureIdle } from '@volter/editor-sdk/kit/live-gesture-lock';
136
144
  import {
137
145
  addMountFailureReport,
138
146
  clearMountFailureReport,
139
147
  formatMountFailureMessage,
140
- } from '@volter/editor-core/authoring/mount-failure-report';
148
+ } from '@volter/editor-sdk/kit/mount-failure-report';
141
149
  import { SelectionRemountHandoff } from '../../host/authoring/selection-remount-handoff';
142
150
  import {
143
151
  type RefreshSource,
@@ -145,6 +153,7 @@ import {
145
153
  } from '../../host/authoring/source-refresh-revisions';
146
154
  import type { R3fSourceAuthoringAdapter } from './r3f-source-authoring-adapter';
147
155
  import { isThreeScene } from './three-scene-identity';
156
+ import { evictDreiCaches } from '../drei-asset-caches';
148
157
 
149
158
  // The world root's stage is recreated when the workspace changes.
150
159
  // The outgoing panel restores the editor scene and the incoming panel loads
@@ -178,6 +187,12 @@ export function unresolvedDesignEntryError(
178
187
  export function reportDesignMountFailure(worldId: string, err: unknown): string {
179
188
  const message = formatMountFailureMessage(err);
180
189
  editorConsole.error(`[r3f-design] world "${worldId}" failed to mount: ${message}`, 'authoring');
190
+ const entry = failedImportEntry(message);
191
+ if (entry) {
192
+ void diagnoseModuleFetch(entry).then((diagnosis) =>
193
+ editorConsole.error(`[r3f-design] world "${worldId}": ${describeModuleFetch(diagnosis)}`, 'authoring'),
194
+ );
195
+ }
181
196
  addMountFailureReport({
182
197
  worldId,
183
198
  kind: 'three',
@@ -222,7 +237,8 @@ export function registerR3FDesignRoot(
222
237
  ): void {
223
238
  registerThreeRoot(game, adapter, mounted, { id: worldId });
224
239
  installNativeDebugBindings(game, entryDebug ? [entryDebug] : []);
225
- installNativeSystemsBindings(game, entrySystems ? [entrySystems] : []);
240
+ // The design world's own `@react-three/rapier` world is observed the way Play's is.
241
+ installNativeSystemsBindings(game, withObservedPhysics(game, entrySystems ? [entrySystems] : []));
226
242
  }
227
243
 
228
244
  /**
@@ -241,10 +257,6 @@ export function registerR3FDesignRoot(
241
257
  * promises. It also gets its OWN debug registry (registries are game-scoped),
242
258
  * so design-time providers can't collide with the play game's.
243
259
  *
244
- * Input is explicitly DISABLED: `new InputManager()` binds window-level
245
- * keyboard/mouse listeners in its constructor, and design time is not play
246
- * (T6.3's invariant). `dispose()` unbinds them — the caller must call it.
247
- *
248
260
  * Its renderer is `createDesignTimeRenderer`, which isolates Fiber configuration
249
261
  * and permits real offscreen work without transferring canvas ownership.
250
262
  */
@@ -257,7 +269,6 @@ function createDesignHost(renderer: THREE.WebGLRenderer): {
257
269
  const borrowedRenderer = createDesignTimeRenderer(canvas, renderer);
258
270
  const assets = createAssetCache();
259
271
  const game = createGame({ loop: createGameLoop({ update: () => {} }), assets });
260
- game.input.setEnabled(false);
261
272
  return {
262
273
  game,
263
274
  host: {
@@ -287,11 +298,11 @@ function rebuildWhenPlayStops(store: EditorShellStore): () => void {
287
298
  let disposed = false;
288
299
  let requested = false;
289
300
  const request = () => {
290
- if (disposed || requested || store.playState !== 'stopped') return;
301
+ if (disposed || requested || store.shell.playState !== 'stopped') return;
291
302
  requested = true;
292
303
  queueEditModeRebuild();
293
304
  };
294
- const unsubscribe = store.subscribe(request);
305
+ const unsubscribe = store.shell.subscribe(request);
295
306
  request();
296
307
  return () => {
297
308
  disposed = true;
@@ -328,7 +339,7 @@ export async function mountR3FDesignSession(
328
339
 
329
340
  // Mirror design-time-layers' entry guard: while play is already running,
330
341
  // mount nothing and wait for Stop's rebuild.
331
- if (store.playState !== 'stopped') {
342
+ if (store.shell.playState !== 'stopped') {
332
343
  return rebuildWhenPlayStops(store);
333
344
  }
334
345
 
@@ -391,7 +402,7 @@ export async function mountR3FDesignSession(
391
402
  * design world is mounted, this session is live, and play is stopped. */
392
403
  const publishPlane = (): void => {
393
404
  if (publishedSystems || !designGame) return;
394
- if (torndown || suspended || store.playState !== 'stopped') return;
405
+ if (torndown || suspended || store.shell.playState !== 'stopped') return;
395
406
  publishedSystems = designGame.systemAdapters;
396
407
  setActiveSystems(publishedSystems);
397
408
  };
@@ -467,7 +478,7 @@ export async function mountR3FDesignSession(
467
478
  * Ownership is `adoptMount`'s, and only after `disposeMounted`.
468
479
  */
469
480
  interface DesignMount {
470
- root: MountedThreeRoot;
481
+ root: ThreeMountedRoot;
471
482
  game: GameInternal;
472
483
  disposeHost: () => void;
473
484
  }
@@ -496,7 +507,7 @@ export async function mountR3FDesignSession(
496
507
  // (Rapier, game debug providers, and future native systems) on
497
508
  // `mounted.systems` even though the component registered successfully.
498
509
  registerR3FDesignRoot(hostGame, adapterExport, result, worldId, entryDebug, entrySystems);
499
- return { root: result, game: hostGame, disposeHost };
510
+ return { root: result as ThreeMountedRoot, game: hostGame, disposeHost };
500
511
  };
501
512
 
502
513
  /** Install a freshly-mounted design world as THE live one. The previous one
@@ -518,7 +529,7 @@ export async function mountR3FDesignSession(
518
529
  publishedSystems = systems;
519
530
  updateInstanceSystems(systems);
520
531
  }
521
- store.notifyIngestEdit();
532
+ store.shell.notifyIngestEdit();
522
533
  });
523
534
  // The design Game outlives `mount()` (the world holds its ctx) and must go
524
535
  // down with the mount, or every HMR remount leaks another window-listener
@@ -568,21 +579,21 @@ export async function mountR3FDesignSession(
568
579
  composite.replaceChild(
569
580
  worldId,
570
581
  new BoundaryAuthoringAdapter(
571
- store,
582
+ store.shell,
572
583
  boundaryInfo(world),
573
584
  'R3F design session suspended by play mode — Stop restores it.',
574
585
  ),
575
586
  );
576
- store.notifyIngestEdit();
587
+ store.shell.notifyIngestEdit();
577
588
  };
578
589
 
579
590
  const failToBoundary = (err: unknown): void => {
580
591
  const message = reportDesignMountFailure(worldId, err);
581
592
  composite.replaceChild(
582
593
  worldId,
583
- new BoundaryAuthoringAdapter(store, boundaryInfo(world), message),
594
+ new BoundaryAuthoringAdapter(store.shell, boundaryInfo(world), message),
584
595
  );
585
- store.notifyIngestEdit();
596
+ store.shell.notifyIngestEdit();
586
597
  };
587
598
 
588
599
  // ---------------------------------------------------------- initial mount
@@ -617,10 +628,10 @@ export async function mountR3FDesignSession(
617
628
  }
618
629
  if (torndown) return () => {};
619
630
  // Restart can enter Play while this design import is in flight.
620
- if (store.playState !== 'stopped') return rebuildWhenPlayStops(store);
631
+ if (store.shell.playState !== 'stopped') return rebuildWhenPlayStops(store);
621
632
  const first = await mountRoot(loaded.adapter, loaded.entryDebug, loaded.entrySystems);
622
633
  adoptMount(first);
623
- if (torndown || store.playState !== 'stopped') {
634
+ if (torndown || store.shell.playState !== 'stopped') {
624
635
  disposeMounted();
625
636
  return torndown ? () => {} : rebuildWhenPlayStops(store);
626
637
  }
@@ -631,12 +642,17 @@ export async function mountR3FDesignSession(
631
642
  physics: () => nodeKeyedPhysics(designGame?.systemAdapters.physics),
632
643
  });
633
644
  composite.replaceChild(worldId, adapter);
645
+ // A body's colliders appear once the world's `<Physics>` has loaded Rapier;
646
+ // panels that already read it are told to read again.
647
+ void whenRapierWorldMounts(first.root.scene as THREE.Object3D).then((mounted) => {
648
+ if (mounted && !torndown) store.shell.notifyIngestEdit();
649
+ });
634
650
  // The hierarchy can become interactive as soon as the composite child is
635
651
  // replaced, while this async mount is still completing. Preserve a user
636
652
  // selection made in that window across enterPlayScene(), which clears the
637
653
  // store selection while adopting the mounted scene. OID-signature ids are
638
654
  // stable across the boundary, so only restore ids the new composite owns.
639
- const selectedIds = selectionRemountHandoff.take(store, store.selectedEntityIds);
655
+ const selectedIds = selectionRemountHandoff.take(store, store.shell.selectedEntityIds);
640
656
  // The world's own colour pipeline travels WITH the adoption: this session
641
657
  // mounted it against a renderer that draws nothing, so the declaration has
642
658
  // to reach the viewport's renderer through the adoption instead (see
@@ -669,10 +685,10 @@ export async function mountR3FDesignSession(
669
685
  // from under them on every save. A first look is opened once.
670
686
  store.focusOnScene(() => pickGameCamera(null, first.root.scene));
671
687
  const alive = selectedIds.filter((id) => composite.hierarchy.node(id) !== null);
672
- if (alive.length > 0) store.selectMultiple(alive);
688
+ if (alive.length > 0) store.shell.selectMultiple(alive);
673
689
  clearMountFailureReport(worldId);
674
690
  publishPlane();
675
- store.notifyIngestEdit();
691
+ store.shell.notifyIngestEdit();
676
692
  editorConsole.log(
677
693
  `[r3f-design] world "${worldId}" mounted for design-time authoring (${entry})`,
678
694
  'authoring',
@@ -738,12 +754,12 @@ export async function mountR3FDesignSession(
738
754
  // ---------------------------------------------------------------- remount
739
755
  const remount = async (): Promise<void> => {
740
756
  if (torndown || suspended) return;
741
- const selectedIds = [...store.selectedEntityIds];
757
+ const selectedIds = [...store.shell.selectedEntityIds];
742
758
  // Same stall watchdog as the initial mount, per stage: after a crashed
743
759
  // mount the NEXT remount was observed to hang silently — no "mounted", no
744
760
  // "failed" — leaving the world Unavailable with a clean console.
745
761
  const startedAtWriteStamp = writeStamp;
746
- const historyBusyAtStart = store.projectHistory?.getSnapshot().busy === true;
762
+ const historyBusyAtStart = store.shell.projectHistory?.getSnapshot().busy === true;
747
763
  let stage: 'importing' | 'mounting' = 'importing';
748
764
  const stallTimer = setTimeout(() => {
749
765
  editorConsole.warn(
@@ -786,7 +802,7 @@ export async function mountR3FDesignSession(
786
802
  for (let settle = 0; settle < 50; settle += 1) {
787
803
  await whenLiveGestureIdle();
788
804
  await whenProjectHistoryIdle();
789
- if (!liveGestureActive() && store.projectHistory?.getSnapshot().busy !== true) break;
805
+ if (!liveGestureActive() && store.shell.projectHistory?.getSnapshot().busy !== true) break;
790
806
  }
791
807
  settledAt = performance.now();
792
808
  if (!torndown && !suspended && writeStamp !== startedAtWriteStamp) {
@@ -822,7 +838,7 @@ export async function mountR3FDesignSession(
822
838
  // selection snapped back to A 255 ms after the adopt (Opus
823
839
  // reproduction on preview-b53, 2/2 with a non-reverting control; the
824
840
  // human typed their Position X into the wrong tree — runhuman pass 128).
825
- const selectionAtSwap = new Set(store.selectedEntityIds);
841
+ const selectionAtSwap = new Set(store.shell.selectedEntityIds);
826
842
  restoreEditorScene();
827
843
  // The OUTGOING world goes down first, with its OWN host — then the
828
844
  // incoming one is adopted. Reversing these disposes the incoming Game.
@@ -883,7 +899,7 @@ export async function mountR3FDesignSession(
883
899
  // objects (exitPlayScene cleared the store selection; restore it).
884
900
  const restoreIds = selectionChangedMidRemount ? [...selectionAtSwap] : selectedIds;
885
901
  const alive = restoreIds.filter((id) => adapter?.hierarchy.node(id) !== null);
886
- if (alive.length > 0) store.selectMultiple(alive);
902
+ if (alive.length > 0) store.shell.selectMultiple(alive);
887
903
  // PD-1: this world is mounted again — retract its failure report so the
888
904
  // status item (and `vgai status`) can go back to healthy.
889
905
  clearMountFailureReport(worldId);
@@ -891,7 +907,7 @@ export async function mountR3FDesignSession(
891
907
  // one's), so a stat added by the edit that triggered this remount is
892
908
  // readable without entering play.
893
909
  publishPlane();
894
- store.notifyIngestEdit();
910
+ store.shell.notifyIngestEdit();
895
911
  reportSlowRemount(worldId, remountStartedAt, importedAt, mountedAt, settledAt);
896
912
  refreshRevisions.mounted();
897
913
  clearTimeout(revisionFallback);
@@ -938,7 +954,7 @@ export async function mountR3FDesignSession(
938
954
  * in-flight work — bounded, so a wedged pipeline degrades to the stale-drop
939
955
  * guard instead of holding the swap forever. */
940
956
  const whenProjectHistoryIdle = async (): Promise<void> => {
941
- const history = store.projectHistory;
957
+ const history = store.shell.projectHistory;
942
958
  if (!history) return;
943
959
  const deadline = Date.now() + 10_000;
944
960
  while (history.getSnapshot().busy && Date.now() < deadline) {
@@ -988,7 +1004,7 @@ export async function mountR3FDesignSession(
988
1004
  );
989
1005
  return;
990
1006
  }
991
- const history = store.projectHistory;
1007
+ const history = store.shell.projectHistory;
992
1008
  if (!history) return;
993
1009
  const snapshot = history.getSnapshot();
994
1010
  const last = snapshot.canUndo ? snapshot.transactions[snapshot.cursor - 1] : undefined;
@@ -1042,9 +1058,11 @@ export async function mountR3FDesignSession(
1042
1058
  }, 80);
1043
1059
  };
1044
1060
 
1045
- const stopAssetReload = onAssetReload(() => {
1046
- writeStamp += 1;
1047
- scheduleRemount();
1061
+ const stopAssetReload = onAssetReload((paths) => {
1062
+ void evictDreiCaches(paths).then(() => {
1063
+ writeStamp += 1;
1064
+ scheduleRemount();
1065
+ });
1048
1066
  });
1049
1067
 
1050
1068
  const hot = import.meta.hot;
@@ -1081,7 +1099,7 @@ export async function mountR3FDesignSession(
1081
1099
  if (!refreshRevisions.needsRemount()) clearTimeout(revisionFallback);
1082
1100
  // The native adapter observes child additions/removals. Property-only
1083
1101
  // refreshes still need an inspector/viewport notification.
1084
- store.notifyIngestEdit();
1102
+ store.shell.notifyIngestEdit();
1085
1103
  };
1086
1104
  hot.on('vgai:r3f-entry-update', onUpdate);
1087
1105
  hot.on('vgai:r3f-refresh-source', onSource);
@@ -1119,16 +1137,16 @@ export async function mountR3FDesignSession(
1119
1137
  // ------------------------------------------------------------ play handoff
1120
1138
  let stopRebuildRequested = false;
1121
1139
  let suspendQueued = false;
1122
- unsubStore = store.subscribe(() => {
1140
+ unsubStore = store.shell.subscribe(() => {
1123
1141
  if (torndown) return;
1124
1142
  // Seat handover, BEFORE the deferred visual suspend below: play mode
1125
1143
  // registers under its own mount id, so holding both seats would make an
1126
1144
  // unaddressed `vgai eval` ambiguous. This fires at
1127
1145
  // `store.setPlayState('playing')`, which precedes play's own
1128
1146
  // `setActiveSystems` — so the two never overlap in either direction.
1129
- if (store.playState === 'stopped') publishPlane();
1147
+ if (store.shell.playState === 'stopped') publishPlane();
1130
1148
  else withdrawPlane();
1131
- if (!suspended && !suspendQueued && store.playState !== 'stopped') {
1149
+ if (!suspended && !suspendQueued && store.shell.playState !== 'stopped') {
1132
1150
  // Keep the adopted design scene alive UNDER the play-entry transition.
1133
1151
  // Suspending at the playState flip swapped the viewport back to the
1134
1152
  // placeholder editor scene mid-flight — the whole screen flashed the
@@ -1140,12 +1158,12 @@ export async function mountR3FDesignSession(
1140
1158
  suspendQueued = true;
1141
1159
  onPlayTransitionSettled(() => {
1142
1160
  suspendQueued = false;
1143
- if (torndown || suspended || store.playState === 'stopped') return;
1161
+ if (torndown || suspended || store.shell.playState === 'stopped') return;
1144
1162
  suspendForPlay();
1145
1163
  });
1146
1164
  return;
1147
1165
  }
1148
- if (suspended && !stopRebuildRequested && store.playState === 'stopped') {
1166
+ if (suspended && !stopRebuildRequested && store.shell.playState === 'stopped') {
1149
1167
  stopRebuildRequested = true;
1150
1168
  queueEditModeRebuild();
1151
1169
  }
@@ -1165,8 +1183,8 @@ export async function mountR3FDesignSession(
1165
1183
  // changes) should preserve editor-global selection. Play suspension is a
1166
1184
  // different scene lifecycle and deliberately keeps exitPlayScene's normal
1167
1185
  // clearing semantics.
1168
- if (!suspended && store.playState === 'stopped' && store.selectedEntityIds.size > 0) {
1169
- selectionRemountHandoff.remember(store, store.selectedEntityIds);
1186
+ if (!suspended && store.shell.playState === 'stopped' && store.shell.selectedEntityIds.size > 0) {
1187
+ selectionRemountHandoff.remember(store, store.shell.selectedEntityIds);
1170
1188
  }
1171
1189
  restoreEditorScene();
1172
1190
  disposeMounted();