@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,5 +1,5 @@
1
- import { meterPercent } from '@volter/game-runtime/adapter/audio-meter';
2
- import type { PerformanceFrame } from '@volter/game-runtime/dev/performance-profiler';
1
+ import { meterPercent } from '../../runtime/adapter/audio-meter';
2
+ import type { PerformanceFrame } from '../../runtime/dev/performance-profiler';
3
3
 
4
4
  export const AUDIO_METER_SEGMENTS = 8;
5
5
  export const PERFORMANCE_SPARKLINE_SAMPLES = 24;
@@ -8,43 +8,38 @@
8
8
  * `useCenterDocuments`): it binds the Game document's tab, reports the
9
9
  * live/stopped edge and closes every document on session teardown. What moved
10
10
  * here is only what the kit no longer does — synthesize the Scene document
11
- * the kit still routes every three root's edit document to, and mirror the
12
- * store's `activeViewportTab` into registry activation for the Scene/Game pair.
11
+ * the kit still routes every three root's edit document to.
13
12
  *
14
- * THE INPUT-GATE CONTRACT (CLAUDE.md T6.3): `store.activeViewportTab`
15
- * remains the single source of truth that `play-mode.ts`/`ingest/mount-ingest-root.ts`
16
- * read (`playState === 'playing' && activeViewportTab === 'play'`) — this
17
- * module NEVER replaces that predicate, it mirrors registry activation into
18
- * it (descriptor `onActivate` → `setActiveViewportTab`) and store changes
19
- * back into registry activation (`syncSceneDocument`, run on every store
20
- * notify).
21
- */
13
+ * THE INPUT-GATE CONTRACT (CLAUDE.md T6.3): `play-mode.ts` and the ingest
14
+ * lanes gate game input on `playState === 'playing' && activeViewportTab ===
15
+ * 'play'`. The tab is derived from workspace focus (the Game document is
16
+ * active), so this module never writes it and never mirrors it back into
17
+ * activation. */
22
18
 
23
19
  import {
24
20
  activeDocumentSourcePath,
25
21
  activeSaveDestination,
26
22
  activeSaveState,
27
- } from '@volter/editor-core/authoring/shell-document-ops';
28
- import { Object3DDocumentViewport } from '@volter/editor-core/components/Object3DDocumentViewport';
29
- import type { DocumentPreviewSource } from '@volter/editor-core/document-preview-source';
30
- import { editorConsole } from '@volter/editor-core/editor-console';
31
- import type { EditorShellStore, ViewportTab } from '@volter/editor-core/editor-shell-store';
32
- import { projectAdapterFacet, subscribeProjectAdapter } from '@volter/editor-core/project-adapter';
33
- import { getCurrentProject } from '@volter/editor-core/project-manager';
34
- import { isolationTabsReplaceGenericScene, sceneTabRow } from '@volter/editor-core/scene-document-plan';
23
+ } from '@volter/editor-sdk/kit/authoring/shell-document-ops';
24
+ import { Object3DDocumentViewport } from '@volter/editor-threejs/kit/components/Object3DDocumentViewport';
25
+ import type { DocumentPreviewSource } from '@volter/editor-sdk/kit/document-preview-source';
26
+ import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
27
+ import type { EditorShellStore, ViewportTab } from '@volter/editor-threejs/kit/editor-shell-store';
28
+ import { projectAdapterFacet, subscribeProjectAdapter } from '@volter/editor-sdk/kit/project-adapter';
29
+ import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
30
+ import { isolationTabsReplaceGenericScene, sceneTabRow } from '@volter/editor-sdk/kit/scene-document-plan';
35
31
  import {
36
32
  registerAvailableWorkspaceDocument,
37
33
  unregisterAvailableWorkspaceDocument,
38
- } from '@volter/editor-core/workspace-available-documents';
39
- import { GAME_DOCUMENT_ID, SCENE_DOCUMENT_ID } from '@volter/editor-core/workspace-document-ids';
34
+ } from '@volter/editor-sdk/kit/workspace-available-documents';
35
+ import { SCENE_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
40
36
  import {
41
37
  activateWorkspaceDocument,
42
38
  activeWorkspaceDocumentId,
43
- openWorkspaceDocuments,
44
39
  setWorkspaceDocumentDirty,
45
40
  type WorkspaceDocumentContentProps,
46
41
  type WorkspaceDocumentDescriptor,
47
- } from '@volter/editor-core/workspace-document-registry';
42
+ } from '@volter/editor-sdk/kit/workspace-document-registry';
48
43
  import { Button, themeVars } from '@volter/editor-sdk/widgets';
49
44
  import { Component, type ErrorInfo, type ReactNode, useEffect, useState } from 'react';
50
45
  import { scheduleAfterPaint } from '../after-paint';
@@ -74,7 +69,6 @@ export interface CenterDocumentsStore {
74
69
  readonly sourcePath?: string | null;
75
70
  /** Whether the active authoring adapter has unsaved edits. */
76
71
  readonly isDirty: boolean;
77
- setActiveViewportTab(tab: ViewportTab): void;
78
72
  }
79
73
 
80
74
  /** The root Scene's preview stays available after its tab closes. Its source
@@ -322,35 +316,24 @@ export function createCenterDocumentDescriptors(store: CenterDocumentsStore): {
322
316
  store.savePath
323
317
  ? { kind: 'scene', path: store.savePath }
324
318
  : { kind: 'workspace', id: SCENE_DOCUMENT_ID },
325
- onActivate: () => store.setActiveViewportTab('edit'),
326
319
  };
327
320
  return { scene };
328
321
  }
329
322
 
330
323
  /**
331
- * The store→registry half of the bridge for the Scene/Game pair. Idempotent —
332
- * safe (and designed) to run on EVERY store notify; re-entrant calls triggered
333
- * by its own `onActivate` → `setActiveViewportTab` → notify chain settle as
334
- * no-ops. The Game document's live/stopped edge is the kit's
335
- * (`useCenterDocuments`), not repeated here.
324
+ * Keeps the Scene document in step with the session. Idempotent — safe (and
325
+ * designed) to run on EVERY store notify. The Game document's live/stopped edge
326
+ * is the kit's (`useCenterDocuments`), not repeated here.
336
327
  *
337
328
  * 1. the scene document is available when the manifest has a Three root;
338
329
  * 2. its tab's dirty dot tracks `isDirty` live (the title is fixed);
339
- * 3. the active document mirrors `activeViewportTab` (auto-switch on
340
- * play/stop, `set-viewport-tab` control commands, the ingest mount lane's
341
- * direct writes). A `play` tab value with no Game document open (stopped,
342
- * or a transient store state) activates the scene if its tab is open.
330
+ * 3. with no document active at all (a first run), the scene document is.
343
331
  */
344
332
  export function syncCenterDocuments(
345
333
  store: CenterDocumentsStore,
346
334
  docs: { scene: WorkspaceDocumentDescriptor },
347
335
  hasThreeRoot = true,
348
336
  ): void {
349
- const isOpen = (id: string) => openWorkspaceDocuments().some((d) => d.descriptor.id === id);
350
- // Opening a registry document activates it. Capture the caller's requested
351
- // viewport before touching the open set, then restore that intent below.
352
- const requestedViewportTab = store.activeViewportTab;
353
-
354
337
  const table = projectAdapterFacet()?.scenes;
355
338
  if (hasThreeRoot && !(table && isolationTabsReplaceGenericScene(table))) {
356
339
  const row = table
@@ -377,21 +360,7 @@ export function syncCenterDocuments(
377
360
  unregisterAvailableWorkspaceDocument(SCENE_DOCUMENT_ID);
378
361
  }
379
362
 
380
- // Mirror the store tab into registry activation. A THIRD-party document
381
- // being active is a legitimate state (its own onActivate already asserted
382
- // the store's tab, so the T6.3 gate is off). The mirror therefore only
383
- // corrects genuine disagreements about the SCENE/GAME pair:
384
- // - tab says 'play' (play auto-switch, `set-viewport-tab play`) → the
385
- // Game document must be active;
386
- // - tab says 'edit' while the GAME document is active (external
387
- // `set-viewport-tab edit` during play) → back to the scene document;
388
- // - no active document at all (first run) → the scene document.
389
- // An 'edit' tab with an asset/story document active is CONSISTENT and must
390
- // not be "corrected".
391
- const activeId = activeWorkspaceDocumentId();
392
- if (requestedViewportTab === 'play' && isOpen(GAME_DOCUMENT_ID)) {
393
- if (activeId !== GAME_DOCUMENT_ID) activateWorkspaceDocument(GAME_DOCUMENT_ID);
394
- } else if (hasThreeRoot && (activeId === GAME_DOCUMENT_ID || activeId === null)) {
363
+ if (hasThreeRoot && activeWorkspaceDocumentId() === null) {
395
364
  activateWorkspaceDocument(SCENE_DOCUMENT_ID);
396
365
  }
397
366
  }
@@ -409,25 +378,24 @@ export function bindSceneDocument(store: EditorShellStore): () => void {
409
378
  // tab still represents the same authored TSX document.
410
379
  let lastSourcePath: string | null = null;
411
380
  const view: CenterDocumentsStore = {
412
- subscribe: (listener) => store.subscribe(listener),
381
+ subscribe: (listener) => store.shell.subscribe(listener),
413
382
  get playState() {
414
- return store.playState;
383
+ return store.shell.playState;
415
384
  },
416
385
  get activeViewportTab() {
417
- return store.activeViewportTab;
386
+ return store.shell.activeViewportTab;
418
387
  },
419
388
  get savePath() {
420
- return activeSaveDestination(store);
389
+ return activeSaveDestination(store.shell);
421
390
  },
422
391
  get sourcePath() {
423
- const current = activeDocumentSourcePath(store);
392
+ const current = activeDocumentSourcePath(store.shell);
424
393
  if (current) lastSourcePath = current;
425
394
  return lastSourcePath;
426
395
  },
427
396
  get isDirty() {
428
- return activeSaveState(store) === 'unsaved';
397
+ return activeSaveState(store.shell) === 'unsaved';
429
398
  },
430
- setActiveViewportTab: (tab) => store.setActiveViewportTab(tab),
431
399
  };
432
400
  const docs = createCenterDocumentDescriptors(view);
433
401
  // Missing is the legacy-safe default: manifests read by current editor
@@ -435,7 +403,7 @@ export function bindSceneDocument(store: EditorShellStore): () => void {
435
403
  const run = () =>
436
404
  syncCenterDocuments(view, docs, getCurrentProject()?.config.hasThreeRoot !== false);
437
405
  run();
438
- const unsubscribe = store.subscribe(run);
406
+ const unsubscribe = store.shell.subscribe(run);
439
407
  const unsubscribeAdapter = subscribeProjectAdapter(run);
440
408
  // Unbinding follows the session's store and leaves the document registered:
441
409
  // a store arriving again at boot must not close a restored Scene tab. The
@@ -16,7 +16,7 @@
16
16
  * button both select a view of a bench that now ships in `@volter/editor-game`.
17
17
  */
18
18
 
19
- import { showWorkspaceUtility } from '@volter/editor-core/workspace-host-commands';
19
+ import { showWorkspaceUtility } from '@volter/editor-sdk/kit/workspace-host-commands';
20
20
 
21
21
  export type ProfilerViewId = 'profiler' | 'frame';
22
22
 
@@ -1,39 +1,38 @@
1
1
  /**
2
2
  * THE GAME'S WORLD-ROOT BINDING for the kit's stage host
3
- * (`@volter/editor-core/components/world-root-binding`): the world's surface,
3
+ * (`@volter/editor-threejs/kit/components/world-root-binding`): the world's surface,
4
4
  * its stage, and the overlays the stage shows only over a world.
5
5
  *
6
6
  * `Overlays` is the world-root half of vgai's `stage-overlay-set.tsx` — every
7
7
  * part it rendered only when `worldRoot` held (the root selection layer, the
8
- * camera-authoring pin, the controls hint while the world mounts, the scene's
8
+ * camera-authoring pin, the scene's
9
9
  * surface-state card). The rest of that overlay set is the kit's
10
10
  * `StageOverlays`, which the host renders beside this.
11
11
  */
12
12
  import { EDITOR_LAYER } from '@volter/editor-threejs/viewport/editor-layers';
13
- import { activeAuthoringVersion, subscribeActiveAuthoring } from '@volter/editor-core/authoring/active-adapter';
13
+ import { activeAuthoringVersion, subscribeActiveAuthoring } from '@volter/editor-sdk/kit/authoring/active-adapter';
14
14
  import {
15
15
  getMountFailureReports,
16
16
  subscribeToMountFailures,
17
- } from '@volter/editor-core/authoring/mount-failure-report';
17
+ } from '@volter/editor-sdk/kit/mount-failure-report';
18
18
  import {
19
19
  object3DDocumentSessionsVersion,
20
20
  subscribeObject3DDocumentSessions,
21
- } from '@volter/editor-core/authoring/object3d-document-session-registry';
22
- import { RootSelectionOverlay } from '@volter/editor-core/components/RootSelectionOverlay';
23
- import { SurfaceStateOverlay } from '@volter/editor-core/components/SurfaceStateOverlay';
24
- import { ViewportControlsHint } from '@volter/editor-core/components/ViewportControlsHint';
21
+ } from '@volter/editor-threejs/kit/authoring/object3d-document-session-registry';
22
+ import { RootSelectionOverlay } from '@volter/editor-sdk/kit/components/RootSelectionOverlay';
23
+ import { SurfaceStateOverlay } from '@volter/editor-sdk/kit/components/SurfaceStateOverlay';
25
24
  import type {
26
25
  WorldRootOverlayProps,
27
26
  WorldRootStageBinding,
28
- } from '@volter/editor-core/components/world-root-binding';
29
- import type { EditorShellStore } from '@volter/editor-core/editor-shell-store';
30
- import { readinessFacet, subscribeRootReadiness } from '@volter/editor-core/readiness';
31
- import { documentStageContext, threeSelectionToolsApply } from '@volter/editor-core/stage-context';
32
- import { explainSurface } from '@volter/editor-core/surface-state';
27
+ } from '@volter/editor-threejs/kit/components/world-root-binding';
28
+ import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
29
+ import { readinessFacet, subscribeRootReadiness } from '@volter/editor-sdk/kit/readiness';
30
+ import { documentStageContext } from '@volter/editor-sdk/kit/stage-context';
31
+ import { explainSurface } from '@volter/editor-sdk/kit/surface-state';
33
32
  import {
34
33
  subscribeWorkspaceDocuments,
35
34
  workspaceDocumentRegistryVersion,
36
- } from '@volter/editor-core/workspace-document-registry';
35
+ } from '@volter/editor-sdk/kit/workspace-document-registry';
37
36
  import { useMemo, useSyncExternalStore } from 'react';
38
37
  import type * as THREE from 'three';
39
38
  import { threeSceneHasRenderableContent } from '../surface-content';
@@ -55,7 +54,7 @@ function SceneViewportStateOverlay({
55
54
  rootIds: readonly string[];
56
55
  mountStatus: 'mounting' | 'ready';
57
56
  }) {
58
- useSyncExternalStore(store.subscribe, store.getSnapshot);
57
+ useSyncExternalStore(store.shell.subscribe, store.shell.getSnapshot);
59
58
  const rootReadiness = useSyncExternalStore(subscribeRootReadiness, readinessFacet);
60
59
  const mountFailures = useSyncExternalStore(subscribeToMountFailures, getMountFailureReports);
61
60
  const sceneBackground = store.scene?.background as THREE.Color | null | undefined;
@@ -71,7 +70,7 @@ function SceneViewportStateOverlay({
71
70
  ignoredLayer: EDITOR_LAYER,
72
71
  }),
73
72
  ),
74
- [store.scene, store.contentVersion],
73
+ [store.scene, store.shell.contentVersion],
75
74
  );
76
75
  const sceneHasContent = Boolean(
77
76
  store.scene && (sceneBackgroundIsAuthored || sceneHasRenderableObjects),
@@ -94,14 +93,13 @@ function WorldRootOverlays({
94
93
  mountStatus,
95
94
  rootIds,
96
95
  }: WorldRootOverlayProps) {
97
- useSyncExternalStore(store.subscribe, store.getShellSnapshot ?? store.getSnapshot);
96
+ useSyncExternalStore(store.shell.subscribe, store.shell.getShellSnapshot ?? store.shell.getSnapshot);
98
97
  useSyncExternalStore(subscribeActiveAuthoring, activeAuthoringVersion);
99
98
  useSyncExternalStore(subscribeObject3DDocumentSessions, object3DDocumentSessionsVersion);
100
99
  useSyncExternalStore(subscribeWorkspaceDocuments, workspaceDocumentRegistryVersion);
101
100
  // The world root's stage is the Scene document's: the kit's overlay props
102
101
  // carry no document id, and the Scene document is the one world-root stage.
103
- const ctx = documentStageContext(store, documentId, 'document');
104
- const showsSelectionTools = threeSelectionToolsApply(ctx);
102
+ const ctx = documentStageContext(store.shell, documentId, 'document');
105
103
  return (
106
104
  <>
107
105
  {/* Three-scene selection overlay. React/Pixi documents mount their own
@@ -114,13 +112,6 @@ function WorldRootOverlays({
114
112
  (`world-root-stage.ts`), so the pin belongs to the stage that
115
113
  installed it. */}
116
114
  {ctx.surface === 'three' ? <CameraAuthoringOverlay previewRef={cameraPreviewRef} /> : null}
117
- {/* The hint also shows WHILE the world is still mounting: a new user
118
- reads the screen during those boot seconds and looks for the camera
119
- controls exactly then. The kit's overlay set shows it on a three
120
- surface; this adds only the mounting case it does not cover. */}
121
- {!showsSelectionTools && ctx.surface !== 'three' && mountStatus === 'mounting' ? (
122
- <ViewportControlsHint />
123
- ) : null}
124
115
  <SceneViewportStateOverlay store={store} rootIds={rootIds} mountStatus={mountStatus} />
125
116
  </>
126
117
  );