@volter/editor-game 0.5.66 → 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 (236) 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 +1 -1
  11. package/contributions/godot.style.ts +26 -6
  12. package/contributions/godot.view.ts +6 -0
  13. package/contributions/ingest.service.ts +2 -2
  14. package/contributions/instances.command.ts +1 -1
  15. package/contributions/navmesh.menu.ts +1 -1
  16. package/contributions/network-observer.service.ts +14 -0
  17. package/contributions/play.command.ts +10 -4
  18. package/contributions/react/component-board.service.ts +1 -1
  19. package/contributions/react/design-time-mount.service.ts +1 -1
  20. package/contributions/scene-document.service.ts +3 -3
  21. package/contributions/state-watch.menu.ts +1 -1
  22. package/contributions/state-watch.utility.tsx +1 -1
  23. package/contributions/team-playtest.service.ts +4 -4
  24. package/contributions/three/component-board.service.ts +1 -1
  25. package/contributions/three/component-verbs.command.ts +6 -6
  26. package/contributions/three/three-authoring.service.ts +8 -5
  27. package/contributions/three-story-capture.service.ts +12 -0
  28. package/contributions/unity.style.ts +17 -7
  29. package/contributions/unity.view.ts +6 -0
  30. package/contributions/unreal.style.ts +10 -2
  31. package/contributions/unreal.view.ts +5 -0
  32. package/package.json +20 -10
  33. package/src/asset-budget/AssetBudgetPanel.tsx +1 -1
  34. package/src/asset-budget/asset-budget-model.ts +1 -1
  35. package/src/audio/AudioDebuggerPanel.tsx +1 -1
  36. package/src/bridge/dispatch.ts +14 -14
  37. package/src/bridge/live-frames.ts +1 -1
  38. package/src/bridge/screenshot.ts +3 -3
  39. package/src/build/BuildProfilesPanel.tsx +3 -3
  40. package/src/canvas/canvas-board/CanvasBoardDocument.tsx +676 -0
  41. package/src/canvas/canvas-board/canvas-board-model.ts +407 -0
  42. package/src/canvas/canvas-board/canvas-component-board.ts +56 -0
  43. package/src/canvas/canvas-design-mount.ts +524 -0
  44. package/src/canvas/design-time-canvas-mount.ts +79 -0
  45. package/src/coverage/live-authoring-surface.ts +5 -5
  46. package/src/coverage/live-project-verbs.ts +1 -1
  47. package/src/coverage/native-system-coverage.ts +5 -5
  48. package/src/coverage/root-coverage.ts +1 -1
  49. package/src/coverage/session-coverage.ts +3 -3
  50. package/src/design-system-stories/ApplicationChrome.stories.tsx +5 -5
  51. package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +7 -7
  52. package/src/edit-mode/edit-mode-audio.ts +4 -4
  53. package/src/edit-mode/edit-mode-networking.ts +2 -2
  54. package/src/game-document/GameCaptureFrameButton.tsx +1 -1
  55. package/src/game-document/GameDocument.tsx +2 -2
  56. package/src/game-document/GamePanel.tsx +4 -4
  57. package/src/game-document/InstanceInspectorPicker.tsx +2 -2
  58. package/src/game-document/crowd-debug.ts +1 -1
  59. package/src/game-document/device-preview.ts +10 -11
  60. package/src/game-document/physics-debug.ts +1 -1
  61. package/src/generation/GenerationActivity.tsx +3 -3
  62. package/src/generation/generation-documents.tsx +5 -5
  63. package/src/generation/generation-jobs.ts +1 -1
  64. package/src/host/adapter-runtime-bindings.ts +96 -5
  65. package/src/host/authoring/babylon-authoring-adapter.ts +6 -6
  66. package/src/host/authoring/gesture-persist.ts +1 -1
  67. package/src/host/authoring/ingest-data-writer.ts +1 -1
  68. package/src/host/authoring/ingest-source-persistence.ts +4 -4
  69. package/src/host/authoring/mounted-authoring.ts +4 -4
  70. package/src/host/authoring/phaser-live-authoring-adapter.ts +4 -4
  71. package/src/host/authoring/pixi-authoring-adapter.ts +40 -15
  72. package/src/host/authoring/pixi-creation-site-write-target.ts +2 -2
  73. package/src/host/authoring/pixi-live-write-target.ts +4 -4
  74. package/src/host/authoring/pixi-source-identity.ts +3 -3
  75. package/src/host/authoring/pixi-source-write-target.ts +1614 -0
  76. package/src/host/authoring/pixi-still-presentation.ts +1 -1
  77. package/src/host/authoring/pixi-structure-history.ts +2 -2
  78. package/src/host/authoring/pixi-transform-channels.ts +16 -14
  79. package/src/host/authoring/source-persistence-backend.ts +3 -3
  80. package/src/host/authoring/struct-write-pipe.ts +1 -1
  81. package/src/host/binding-resolver.ts +8 -9
  82. package/src/host/browser-transpile.ts +1 -1
  83. package/src/host/canvas-entry-runtime.ts +58 -47
  84. package/src/host/canvas-preview-frames.ts +482 -0
  85. package/src/host/components/CameraAuthoringOverlay.tsx +1 -1
  86. package/src/host/components/HeaderTelemetry.tsx +4 -4
  87. package/src/host/components/PixiIsolationSceneContent.tsx +10 -10
  88. package/src/host/components/ThreeIsolationSceneContent.tsx +3 -3
  89. package/src/host/components/frame-debugger-model.ts +2 -2
  90. package/src/host/components/header-telemetry-model.ts +2 -2
  91. package/src/host/components/scene-document.tsx +14 -14
  92. package/src/host/components/utility-view-state.ts +1 -1
  93. package/src/host/components/world-root-stage-binding.tsx +12 -12
  94. package/src/host/components/world-root-stage.ts +70 -49
  95. package/src/host/coverage/system-adapter-coverage.ts +3 -4
  96. package/src/host/design-system-stories/fixtures/editor-runtime.tsx +9 -11
  97. package/src/host/document-preview-three.ts +1 -1
  98. package/src/host/entry-adjudication.ts +6 -6
  99. package/src/host/game-css-scope-transform.ts +4 -0
  100. package/src/host/game-realm-page.ts +1 -1
  101. package/src/host/gameplay-export.ts +25 -14
  102. package/src/host/gameplay-recording.ts +5 -5
  103. package/src/host/gated-globals.ts +2 -2
  104. package/src/host/history/json-history-resource.ts +1 -1
  105. package/src/host/projection/pixi.ts +24 -2
  106. package/src/host/r3f-entry-runtime.ts +65 -34
  107. package/src/host/react-mount-runtime.ts +7 -48
  108. package/src/host/realm-services.ts +1 -1
  109. package/src/host/roots/canvas-root.tsx +361 -0
  110. package/src/host/roots/r3f-root.tsx +473 -0
  111. package/src/host/roots/react-root.ts +9 -43
  112. package/src/host/served-bundle-runtime-modules.ts +1 -19
  113. package/src/host/server-log-bridge.ts +2 -2
  114. package/src/host/stories/mounted-story-viewport-source.ts +1 -1
  115. package/src/host/stories/pixi-story-model.ts +30 -0
  116. package/src/host/stories/story-media-captures.ts +46 -0
  117. package/src/host/stories/story-media-presence.ts +3 -3
  118. package/src/host/stories/story-pixi-preview.ts +408 -0
  119. package/src/host/stories/story-three-preview.ts +806 -0
  120. package/src/host/stories/three-story-captures.ts +35 -0
  121. package/src/host/story-three-preview-runtime.ts +56 -0
  122. package/src/host/use-active-performance-source.ts +2 -2
  123. package/src/host/viewport-pose-memory.ts +1 -1
  124. package/src/host/viewport-root-presentation.ts +6 -5
  125. package/src/ingest/active-ingest.ts +1 -1
  126. package/src/ingest/authoring/ingest-dom-surface-authoring.ts +4 -4
  127. package/src/ingest/authoring/ingest-root-adapter.ts +8 -8
  128. package/src/ingest/deferred-ingest-play.ts +6 -6
  129. package/src/ingest/discovery-public-ingest.ts +2 -2
  130. package/src/ingest/ingest-boot-viewport.ts +2 -2
  131. package/src/ingest/ingest-canvas-scene-document.tsx +8 -8
  132. package/src/ingest/ingest-canvas-scene.ts +3 -3
  133. package/src/ingest/ingest-evidence-hook.ts +1 -1
  134. package/src/ingest/ingest-frame-snapshot.ts +1 -1
  135. package/src/ingest/ingest-play-control.ts +1 -1
  136. package/src/ingest/ingest-render-debug.ts +10 -10
  137. package/src/ingest/ingest-siblings.ts +13 -25
  138. package/src/ingest/module-mode.ts +14 -14
  139. package/src/ingest/mount-canvas-ingest-root.ts +21 -21
  140. package/src/ingest/mount-coverage.ts +2 -2
  141. package/src/ingest/mount-dom-ingest-root.ts +11 -11
  142. package/src/ingest/mount-ingest-root.ts +8 -8
  143. package/src/ingest/mount-three-ingest-root.ts +8 -8
  144. package/src/ingest/resolve-canvas.ts +1 -1
  145. package/src/ingest/served-html-boot.ts +1 -1
  146. package/src/ingest/surface-canvas.ts +1 -1
  147. package/src/ingest/unmount-ingest-root.ts +5 -5
  148. package/src/navmesh/navmesh-handler.ts +24 -16
  149. package/src/network/NetworkInspectorPanel.tsx +449 -14
  150. package/src/network/network-inspector-model.ts +14 -2
  151. package/src/play/play-log-events.ts +1 -1
  152. package/src/play/play-mode.ts +76 -133
  153. package/src/play/play-recording.ts +1 -1
  154. package/src/play/react-play-live-authoring.ts +3 -3
  155. package/src/play/run-selection.ts +93 -0
  156. package/src/play-bar/PlayBar.tsx +20 -39
  157. package/src/profiler/FrameDebuggerPanel.tsx +1 -1
  158. package/src/profiler/PerformancePanel.tsx +3 -3
  159. package/src/react/design-time-react-mount.ts +23 -65
  160. package/src/react/dom-authoring-adapter.ts +9 -9
  161. package/src/react/react-inspector-section.tsx +5 -5
  162. package/src/react/react-world-authoring-adapter.ts +11 -11
  163. package/src/react/story-documents/story-documents.tsx +9 -9
  164. package/src/react/ui-board-document.tsx +7 -7
  165. package/src/react/ui-component-board.ts +2 -2
  166. package/src/runtime/adapter/audio-meter.ts +21 -0
  167. package/src/runtime/adapter/first-party-audio-system.ts +230 -0
  168. package/src/runtime/adapter/ingest/contract-debug-adapter.ts +114 -0
  169. package/src/runtime/adapter/ingest/contract-system-adapters.ts +256 -0
  170. package/src/runtime/adapter/ingest/merge-debug-adapters.ts +197 -0
  171. package/src/runtime/adapter/ingest/observation-debug-adapter.ts +162 -0
  172. package/src/runtime/adapter/ingest/upstream-pin.ts +51 -0
  173. package/src/runtime/adapter/native-debug-module.ts +498 -0
  174. package/src/runtime/audio/bus-mixer.ts +161 -0
  175. package/src/runtime/audio/pose-guard.ts +80 -0
  176. package/src/runtime/core/frame-pacing.ts +126 -0
  177. package/src/runtime/core/game-loop.ts +225 -0
  178. package/src/runtime/core/game-scoped-slot.ts +28 -0
  179. package/src/runtime/core/seeded-random.ts +162 -0
  180. package/src/runtime/core/sim-clock.ts +391 -0
  181. package/src/runtime/core/system-runner.ts +269 -0
  182. package/src/runtime/core/types.ts +104 -0
  183. package/src/runtime/create-runtime.ts +1128 -0
  184. package/src/runtime/debug-bridge.ts +570 -0
  185. package/src/runtime/debug-registry.ts +899 -0
  186. package/src/runtime/dev/chrome-trace.ts +153 -0
  187. package/src/runtime/dev/instruments.ts +403 -0
  188. package/src/runtime/dev/logger.ts +119 -0
  189. package/src/runtime/dev/performance-profiler.ts +367 -0
  190. package/src/runtime/dev/register-render-vitals.ts +276 -0
  191. package/src/runtime/dev/render-census.ts +354 -0
  192. package/src/runtime/dev/render-debug-adapter.ts +218 -0
  193. package/src/runtime/dev/render-memory.ts +226 -0
  194. package/src/runtime/dev/render-vitals.ts +338 -0
  195. package/src/runtime/dev/static-batch-advisor.ts +188 -0
  196. package/src/runtime/dev/webgl-frame-capture.ts +366 -0
  197. package/src/runtime/dev/webgl-gpu-timer.ts +53 -0
  198. package/src/runtime/dev-build.ts +47 -0
  199. package/src/runtime/game.ts +1636 -0
  200. package/src/runtime/gameplay-rng-trap.ts +135 -0
  201. package/src/runtime/host-context.ts +64 -0
  202. package/src/runtime/input-router.ts +169 -0
  203. package/src/runtime/mount-manifest.ts +480 -0
  204. package/src/runtime/pixi/authoring.ts +706 -0
  205. package/src/runtime/pixi/ingest.ts +116 -0
  206. package/src/runtime/pixi/physics-registry.ts +49 -0
  207. package/src/runtime/pixi/render-pass-bracket.ts +117 -0
  208. package/src/runtime/pixi/scene-capture.ts +179 -0
  209. package/src/runtime/pixi/system-adapters.ts +69 -0
  210. package/src/runtime/playtest.ts +22 -0
  211. package/src/runtime/presentation.ts +141 -0
  212. package/src/runtime/render-control.ts +642 -0
  213. package/src/runtime/render-seed.ts +77 -0
  214. package/src/runtime/run-ticks-settled.ts +73 -0
  215. package/src/runtime/setup/setup-audio.ts +72 -0
  216. package/src/services/audio-pose-guard.ts +2 -2
  217. package/src/services/game-audio.ts +152 -0
  218. package/src/services/game-network.ts +657 -0
  219. package/src/services/game-physics.ts +334 -0
  220. package/src/state-watch/StateWatchPanel.tsx +1 -1
  221. package/src/three/authoring/camera-runtime-inspector-section.tsx +3 -2
  222. package/src/three/authoring/constraint-inspector-section.tsx +6 -5
  223. package/src/three/authoring/model-asset-inspector-section.tsx +7 -6
  224. package/src/three/authoring/oid-source-persistence.ts +7 -7
  225. package/src/three/authoring/r3f-design-session.ts +58 -54
  226. package/src/three/authoring/r3f-source-authoring-adapter.ts +95 -91
  227. package/src/three/authoring/reflection-probe-inspector-section.tsx +3 -2
  228. package/src/three/authoring/three-authoring-adapter.ts +29 -29
  229. package/src/three/component-verbs/extract-menu.ts +7 -6
  230. package/src/three/component-verbs/fork-menu.ts +7 -6
  231. package/src/three/component-verbs/internals-menu.ts +2 -2
  232. package/src/three/story-documents/three-story-documents.tsx +13 -13
  233. package/src/three/three-board/ThreeBoardDocument.tsx +13 -12
  234. package/src/three/three-board/board-scene.ts +6 -6
  235. package/src/three/three-board/three-component-board.ts +2 -2
  236. package/src/services/game-audio-unlock.ts +0 -48
@@ -1,10 +1,13 @@
1
+ import { type ConfigurationStatus, listConfigurations } from '../host/api/configurations';
1
2
  import {
2
- type ConfigurationStatus,
3
- listConfigurations,
4
- startConfiguration,
5
- stopConfiguration,
6
- } from '../host/api/configurations';
7
- import { isGameplayExportActive, subscribeGameplayExport } from '@volter/editor-core/gameplay-export-state';
3
+ chooseRunConfiguration,
4
+ chosenRunConfiguration,
5
+ PLAY_CONFIGURATION,
6
+ selectedRunConfiguration,
7
+ startSelectedRunConfiguration,
8
+ stopStartedRunConfiguration,
9
+ } from '../play/run-selection';
10
+ import { isGameplayExportActive, subscribeGameplayExport } from '@volter/editor-sdk/kit/gameplay-export-state';
8
11
  import { PLAY_CONTROL_TEST_ID } from '../host/play-control-hook';
9
12
  import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
10
13
  import { faChevronDown } from '@fortawesome/free-solid-svg-icons';
@@ -31,7 +34,6 @@ import {
31
34
  getRestartRequiredReason,
32
35
  pausePlayMode,
33
36
  resumePlayMode,
34
- setDesiredExtraInstances,
35
37
  stepPlayMode,
36
38
  subscribeRestartRequired,
37
39
  } from '../play/play-mode';
@@ -288,36 +290,17 @@ export function PlayBar({ placement = 'launcher' }: { placement?: 'launcher' | '
288
290
  const selected = run.configurations.find((c) => c.id === run.selectedId) ?? null;
289
291
  const instances = selected?.kind === 'compound' ? (selected.instances ?? null) : null;
290
292
  const play = async () => {
291
- if (selected && selected.kind !== PLAY_ID) {
292
- const outcome = await startConfiguration(selected.id).catch((error: unknown) => {
293
- editorHost().notify({
294
- tone: 'error',
295
- title: `Run "${selected.id}"`,
296
- detail: error instanceof Error ? error.message : String(error),
297
- });
298
- return null;
299
- });
300
- if (!outcome) return;
301
- if (!outcome.ready) {
302
- editorHost().notify({
303
- tone: 'error',
304
- title: `Run "${selected.id}" is not ready`,
305
- detail: Object.entries(outcome.logs)
306
- .map(([id, lines]) => `${id}: ${lines.slice(-3).join(' | ') || 'no output'}`)
307
- .join('\n'),
308
- });
309
- return;
310
- }
311
- if (instances !== null) setDesiredExtraInstances(Math.max(0, instances - 1));
312
- void run.refresh();
293
+ const start = await startSelectedRunConfiguration();
294
+ if (!start.ok) {
295
+ editorHost().notify({ tone: 'error', title: start.title, detail: start.detail });
296
+ return;
313
297
  }
298
+ if (start.started) void run.refresh();
314
299
  await enterPlayMode();
315
300
  };
316
301
  const stop = () => {
317
302
  exitPlayMode();
318
- if (selected && selected.kind !== PLAY_ID) {
319
- void stopConfiguration(selected.id).then(() => run.refresh());
320
- }
303
+ void stopStartedRunConfiguration().then(() => run.refresh());
321
304
  };
322
305
  return (
323
306
  <PlayBarView
@@ -388,8 +371,7 @@ function PlayOptions() {
388
371
  }
389
372
 
390
373
  /** The implicit configuration: mount every root in the host. */
391
- const PLAY_ID = 'play';
392
- const RUN_SELECTION_SECTION = 'runSelection';
374
+ const PLAY_ID = PLAY_CONFIGURATION;
393
375
 
394
376
  interface RunState {
395
377
  readonly configurations: readonly ConfigurationStatus[];
@@ -403,9 +385,7 @@ interface RunState {
403
385
  * document, the way an IDE remembers the chosen launch configuration. */
404
386
  function useRunConfigurations(): RunState {
405
387
  const [declared, setDeclared] = useState<readonly ConfigurationStatus[]>([]);
406
- const [selectedId, setSelectedId] = useState<string>(
407
- () => editorHost().projectLocalState.read<string>(RUN_SELECTION_SECTION) ?? PLAY_ID,
408
- );
388
+ const [chosenId, setChosenId] = useState<string | null>(chosenRunConfiguration);
409
389
  const refresh = useCallback(async () => {
410
390
  const list = await listConfigurations().catch(() => []);
411
391
  setDeclared(list);
@@ -426,9 +406,10 @@ function useRunConfigurations(): RunState {
426
406
  ],
427
407
  [declared],
428
408
  );
409
+ const selectedId = selectedRunConfiguration(declared, chosenId);
429
410
  const select = useCallback((id: string) => {
430
- setSelectedId(id);
431
- editorHost().projectLocalState.write(RUN_SELECTION_SECTION, id);
411
+ setChosenId(id);
412
+ chooseRunConfiguration(id);
432
413
  }, []);
433
414
  return { configurations, selectedId, select, refresh };
434
415
  }
@@ -32,7 +32,7 @@ import { Button, themeVars } from '@volter/editor-sdk/widgets';
32
32
  import type {
33
33
  FrameCapture,
34
34
  FrameCaptureDrawCall,
35
- } from '@volter/game-runtime/dev/webgl-frame-capture';
35
+ } from '../runtime/dev/webgl-frame-capture';
36
36
  import { useEffect, useState, useSyncExternalStore } from 'react';
37
37
  import {
38
38
  captureFrame,
@@ -30,13 +30,13 @@ import {
30
30
  spaceVar,
31
31
  themeVars,
32
32
  } from '@volter/editor-sdk/widgets';
33
- import { buildChromeTrace } from '@volter/game-runtime/dev/chrome-trace';
33
+ import { buildChromeTrace } from '../runtime/dev/chrome-trace';
34
34
  import type {
35
35
  PerformanceFrame,
36
36
  PerformanceProfiler,
37
37
  PerformanceSnapshot,
38
- } from '@volter/game-runtime/dev/performance-profiler';
39
- import type { RenderMemorySnapshot } from '@volter/game-runtime/dev/render-memory';
38
+ } from '../runtime/dev/performance-profiler';
39
+ import type { RenderMemorySnapshot } from '../runtime/dev/render-memory';
40
40
  import { useEffect, useRef, useState } from 'react';
41
41
  import { createMainThreadBusySampler, type MainThreadBusySampler } from './main-thread-busy';
42
42
 
@@ -4,8 +4,7 @@
4
4
  * composed story of the project laid out as an isolated, labeled frame, with
5
5
  * the root entry's own story (derived, never labeled — the story whose CSF
6
6
  * `meta.component` is the entry's default export) as the frame it opens on.
7
- * A project with no stories falls back to mounting the entry once against an
8
- * inert Game.
7
+ * A project with no stories falls back to mounting the entry once, bare.
9
8
  *
10
9
  * ## Why this is a package and not the host's
11
10
  *
@@ -58,36 +57,33 @@
58
57
  import type {
59
58
  DesignTimeRootDescriptor,
60
59
  LayerMountResult,
61
- } from '@volter/editor-core/authoring/design-time-layers';
60
+ } from '@volter/editor-sdk/kit/authoring/design-time-layers';
62
61
  import {
63
62
  rememberedPortableStory,
64
63
  rememberPortableStory,
65
- } from '@volter/editor-core/authoring/design-time-layers';
66
- import type { DesignTimeMountContext } from '@volter/editor-core/authoring/design-time-mount-registry';
64
+ } from '@volter/editor-sdk/kit/authoring/design-time-layers';
65
+ import type { DesignTimeMountContext } from '@volter/editor-sdk/kit/authoring/design-time-mount-registry';
67
66
  import { formatMountFailureMessage } from '@volter/editor-sdk/kit/mount-failure-report';
68
- import type { ReactStoryBoardSelectionIntent } from '@volter/editor-core/authoring/react-story-board';
69
- import { createReactStoryBoard } from '@volter/editor-core/authoring/react-story-board';
67
+ import type { ReactStoryBoardSelectionIntent } from '@volter/editor-sdk/kit/authoring/react-story-board';
68
+ import { createReactStoryBoard } from '@volter/editor-sdk/kit/authoring/react-story-board';
70
69
  import {
71
70
  getRootCanvasViewport,
72
71
  setRootCanvasViewport,
73
72
  } from '@volter/editor-sdk/kit/world-canvas-viewport-state';
74
73
  import { recordAuthoringConsumerUse } from '@volter/editor-sdk/kit/authoring-seam-evidence';
75
74
  import { CrashNullBoundary } from '@volter/editor-sdk/kit/crash-null-boundary';
76
- import { readProjectTextFile } from '@volter/editor-core/editor-api';
75
+ import { readProjectTextFile } from '@volter/editor-sdk/kit/editor-api';
77
76
  import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
78
- import {
79
- resolveReactRootMountRuntime,
80
- resolveWorldProviderForProject,
81
- } from '../host/react-mount-runtime';
77
+ import { resolveReactRootMountRuntime } from '../host/react-mount-runtime';
82
78
  import { activeRealmServices } from '../host/realm-services';
83
79
  import { resolveReactAdapterRootComponent } from '../host/roots/react-root';
84
- import { scopedGameStylesState } from '@volter/editor-core/scoped-game-css';
85
- import { componentIdentityName } from '@volter/editor-core/stories/compose-project-stories';
86
- import { mountIsolatedStory } from '@volter/editor-core/stories/StoryPreviewMount';
80
+ import { scopedGameStylesState } from '@volter/editor-sdk/kit/scoped-game-css';
81
+ import { componentIdentityName } from '@volter/editor-sdk/kit/stories/compose-project-stories';
82
+ import { mountIsolatedStory } from '@volter/editor-sdk/kit/stories/StoryPreviewMount';
87
83
  import {
88
84
  createStoryPresentationIndex,
89
85
  storyBoardPresentation,
90
- } from '@volter/editor-core/stories/story-presentation';
86
+ } from '@volter/editor-sdk/kit/stories/story-presentation';
91
87
  import {
92
88
  getComponentPreviewStory,
93
89
  getProjectPreviewStories,
@@ -96,15 +92,12 @@ import {
96
92
  projectStoriesReady,
97
93
  refreshProjectStories,
98
94
  subscribeProjectStoryModules,
99
- } from '@volter/editor-core/stories/story-registry';
100
- import { domStoryBoardMembers } from '@volter/editor-core/stories/three-story-model';
101
- import { getDesignTokens } from '@volter/editor-core/ui-source/inspect';
102
- import { tierSourceWriteBackend } from '@volter/editor-core/ui-source/tier-source-write-backend';
95
+ } from '@volter/editor-sdk/kit/stories/story-registry';
96
+ import { domStoryBoardMembers } from '@volter/editor-threejs/kit/stories/three-story-model';
97
+ import { getDesignTokens } from '@volter/editor-sdk/kit/ui-source/inspect';
98
+ import { tierSourceWriteBackend } from '@volter/editor-sdk/kit/ui-source/tier-source-write-backend';
103
99
  import { recordViewportFirstFrame } from '@volter/editor-sdk/kit/viewport-activation-timings';
104
- import { createAssetCache } from '@volter/threejs-runtime/assets';
105
- import { createGameLoop } from '@volter/game-runtime/core/game-loop';
106
100
  import type { ResolvedAdapterRoot } from '@volter/editor-project/manifest/load';
107
- import { createGame, type GameInternal } from '@volter/game-runtime/runtime/game';
108
101
  import { beginProjectMountEpoch } from '@volter/editor-sdk/session/project-module-url';
109
102
  import type { ComponentType } from 'react';
110
103
  import { type OidElementLike, ReactRootAuthoringAdapter } from './react-world-authoring-adapter';
@@ -167,35 +160,6 @@ async function seedRootViewportFromManifest(): Promise<void> {
167
160
  // An unreadable manifest declares nothing; Fill stands.
168
161
  }
169
162
  }
170
- /**
171
- * The inert design-time Game stand-in (B1's one genuine design
172
- * decision). A REAL `Game` — never a hand-typed duck-typed literal, mirroring
173
- * this repo's own test convention (`packages/editor/test/adapter-conformance-kit.ts`'s
174
- * `headlessGame()`) — built with a loop that is constructed but NEVER
175
- * started/ticked, and with NO roots ever registered. This satisfies
176
- * `useGame`/`useWorldState` (`@volter/game-runtime/react/world-state`, and any project's own
177
- * re-export of it) without throwing, genuinely inertly:
178
- * - `state.subscribe` never fires — nothing ever calls
179
- * `GameStateBridgeInternal.bump()` (only `GameInternal.runFrame` does, and
180
- * this Game's loop never runs a frame);
181
- * - `state.frameVersion` stays `0` forever;
182
- * - `queryByComponent`/`world()`/`roots` are empty/`null` because `roots`
183
- * stays `[]` (nothing ever calls `registerRoot`).
184
- * `defaultRoot`/`components`/`input`/`audio` throw descriptively if touched
185
- * (same as any fresh `createGame()` before a world registers) — a HUD that
186
- * reaches for those is out of scope for a design-time stand-in and SHOULD
187
- * throw loudly, caught by the crash-null boundary below, degrading to the
188
- * #18 error node rather than silently faking a value.
189
- *
190
- * B2 swaps this stand-in's DATA for story-sourced data (a `data`/services
191
- * seam) — this function is the seam B2 replaces/extends, not a permanent
192
- * fixture; it never constructs a live Game/sockets.
193
- */
194
- function createDesignTimeGame(): GameInternal {
195
- const loop = createGameLoop({ fixedTimestep: 1 / 60, maxSubSteps: 8, update: () => {} });
196
- return createGame({ loop, assets: createAssetCache() });
197
- }
198
-
199
163
  /**
200
164
  * A minimal `ResolvedAdapterRoot` satisfying `resolveReactAdapterRootComponent`
201
165
  * (`../binding-resolver.ts`, which reads only `id`/`kind`/`entry` off
@@ -231,7 +195,7 @@ type EntryResolution = { ok: true; Entry: ComponentType } | { ok: false; error:
231
195
  /**
232
196
  * Load a React root's entry component ONCE per layer mount, without throwing.
233
197
  * Both of this layer's paths need it: the derived default story is joined
234
- * against this component's identity, and the inert-Game fallback renders it.
198
+ * against this component's identity, and the no-story fallback renders it.
235
199
  * A failure is carried rather than thrown so the story board can still open
236
200
  * over a project whose entry is broken; only the fallback (which has nothing
237
201
  * else to render) rethrows it.
@@ -254,16 +218,14 @@ async function resolveEntryComponent(
254
218
  /**
255
219
  * React design-time mount — the entry
256
220
  * via the EXISTING #31 loader (`resolveReactAdapterRootComponent`, reused
257
- * verbatim), wrapped in the canonical engine `WorldProvider`
258
- * (`resolveWorldProviderForProject`) around the inert
259
- * `createDesignTimeGame()` stand-in and a React error boundary.
221
+ * verbatim), rendered inside a React error boundary.
260
222
  * `flushSync` forces the initial render/commit/error-boundary-recovery to
261
223
  * finish before this call returns (mirrors `ingest-siblings.ts`'s
262
224
  * `mountDefaultReactSibling`), so a throwing entry is caught HERE —
263
225
  * synchronously — rather than discovered later on react's own schedule.
264
226
  *
265
227
  * Portable CSF stories take the board path above. This branch is only the
266
- * explicit no-story fallback and mounts the entry once against the inert Game.
228
+ * explicit no-story fallback and mounts the entry once.
267
229
  * On success, it mints the world's live `ReactRootAuthoringAdapter` over this
268
230
  * layer's now-mounted DOM — the adapter reflects
269
231
  * an already-mounted root, it never mounts one itself; this function is the
@@ -297,8 +259,7 @@ export async function mountReactDesignLayer(
297
259
  // Edit mode lays EVERY composed story of the project out as an isolated,
298
260
  // labeled frame on one editor-only board — board membership is
299
261
  // project-global, the project's own component gallery. Play still tears
300
- // this entire surface down and mounts only the manifest entry against the
301
- // real Game.
262
+ // this entire surface down and mounts only the manifest entry.
302
263
  //
303
264
  // A remount that the registry's own publish requested already has fresh
304
265
  // stories: refreshing again would reload every story module in parallel —
@@ -315,7 +276,7 @@ export async function mountReactDesignLayer(
315
276
 
316
277
  // The root's composed default preview is DERIVED, never labeled: it is the
317
278
  // story whose CSF `meta.component` is this root entry's default-exported
318
- // component. Resolve that component first (the same loader the inert-Game
279
+ // component. Resolve that component first (the same loader the no-story
319
280
  // fallback below reuses), then ask the registry for its story.
320
281
  //
321
282
  // The join is by component NAME, not function identity, and that is
@@ -615,12 +576,11 @@ export async function mountReactDesignLayer(
615
576
  `[design-time-layers] React root "${candidate.worldId}" has no portable CSF preview — the ` +
616
577
  'project declares no UI stories. Add a *.stories.tsx; give it a `meta.component` of ' +
617
578
  `this root's entry component${entryComponentName ? ` (${entryComponentName}, ${candidate.path})` : ''} ` +
618
- 'to make it this root’s default preview. Falling back to the inert-Game preview.',
579
+ 'to make it this root’s default preview. Falling back to rendering the entry bare.',
619
580
  'authoring',
620
581
  );
621
582
 
622
583
  const Entry = entry.Entry;
623
- const WorldProvider = await resolveWorldProviderForProject();
624
584
  // C1 (phase-b/c1-react-mount): this layer's own react-world mount is a
625
585
  // SECOND call site with the identical packaged-runtime dual-React-instance
626
586
  // exposure `binding-resolver.ts`'s `ReactRootAdapter.mount()` has — under
@@ -628,14 +588,13 @@ export async function mountReactDesignLayer(
628
588
  // from the PROJECT's own react, not this module's (removed) static
629
589
  // imports. See `resolveReactRootMountRuntime`'s doc comment.
630
590
  const { createElement, createRoot, flushSync } = await resolveReactRootMountRuntime();
631
- const game = createDesignTimeGame();
632
591
  const root = createRoot(layer);
633
592
  const render = (onCaught: (error: unknown) => void): void => {
634
593
  root.render(
635
594
  createElement(CrashNullBoundary, {
636
595
  key: '__entry__',
637
596
  onCaught,
638
- children: createElement(WorldProvider, { game }, createElement(Entry)),
597
+ children: createElement(Entry),
639
598
  }),
640
599
  );
641
600
  };
@@ -668,7 +627,6 @@ export async function mountReactDesignLayer(
668
627
  // but this keeps teardown clean).
669
628
  adapter.disposeReactRootAdapter();
670
629
  root.unmount();
671
- game.dispose();
672
630
  },
673
631
  };
674
632
  }
@@ -46,10 +46,10 @@
46
46
  import { numericStyleValue } from '@volter/editor-sdk/css-numeric-style';
47
47
  import { createEphemeralPersistence } from '../host/authoring/ephemeral-persistence';
48
48
  import { LIVE_ONLY_DESTINATION } from '@volter/editor-sdk/kit/write-pipe';
49
- import type { EditorShellStore } from '@volter/editor-core/editor-shell-store';
49
+ import type { EditorShellStore } from '@volter/editor-threejs/kit/editor-shell-store';
50
50
  import { type JournalSubject, JsonHistoryResource } from '../host/history/json-history-resource';
51
51
  import { DomProjector, structuralDomIdentity } from '../host/projection/dom';
52
- import { browserOrInlineResolver, getComputedStyleValue } from '@volter/editor-core/ui-source/inspect';
52
+ import { browserOrInlineResolver, getComputedStyleValue } from '@volter/editor-sdk/kit/ui-source/inspect';
53
53
  import type {
54
54
  AssetSubjectProvider,
55
55
  AuthoringAdapter,
@@ -271,7 +271,7 @@ export class DomAuthoringAdapter implements AuthoringAdapter {
271
271
  private readonly store: EditorShellStore,
272
272
  opts: DomAuthoringOptions,
273
273
  ) {
274
- const history = store.projectHistory;
274
+ const history = store.shell.projectHistory;
275
275
  this.historyResource = history
276
276
  ? new JsonHistoryResource({
277
277
  history,
@@ -372,8 +372,8 @@ export class DomAuthoringAdapter implements AuthoringAdapter {
372
372
  };
373
373
 
374
374
  readonly selection: SelectionProvider = {
375
- get: () => [...this.store.selectedEntityIds],
376
- set: (ids) => this.store.selectMultiple(ids),
375
+ get: () => [...this.store.shell.selectedEntityIds],
376
+ set: (ids) => this.store.shell.selectMultiple(ids),
377
377
  };
378
378
 
379
379
  /**
@@ -650,7 +650,7 @@ export class DomAuthoringAdapter implements AuthoringAdapter {
650
650
  if (path === 'locked') {
651
651
  if (value) this.lockedIds.add(id);
652
652
  else this.lockedIds.delete(id);
653
- this.store.notifyIngestEdit();
653
+ this.store.shell.notifyIngestEdit();
654
654
  return;
655
655
  }
656
656
  if (path === 'visible') {
@@ -700,7 +700,7 @@ export class DomAuthoringAdapter implements AuthoringAdapter {
700
700
 
701
701
  this.applyStyleToElement(n.el, prop, value);
702
702
  this.recordStyleEdit(id, prop, value);
703
- this.store.notifyIngestEdit();
703
+ this.store.shell.notifyIngestEdit();
704
704
 
705
705
  return true;
706
706
  }
@@ -747,11 +747,11 @@ export class DomAuthoringAdapter implements AuthoringAdapter {
747
747
  this.applyStyleToElement(node.el, prop, values[prop] ?? '');
748
748
  }
749
749
  }
750
- this.store.notifyIngestEdit();
750
+ this.store.shell.notifyIngestEdit();
751
751
  }
752
752
 
753
753
  subscribe(listener: () => void): () => void {
754
- return this.store.subscribe(listener);
754
+ return this.store.shell.subscribe(listener);
755
755
  }
756
756
 
757
757
  /**
@@ -1,4 +1,4 @@
1
- import { setAuthoringSelection } from '@volter/editor-core/authoring/consumer-actions';
1
+ import { setAuthoringSelection } from '@volter/editor-sdk/kit/authoring/consumer-actions';
2
2
  import { faBookBookmark, faCode, faPalette } from '@fortawesome/free-solid-svg-icons';
3
3
  import {
4
4
  Button,
@@ -53,13 +53,13 @@ import {
53
53
  setActiveBreakpoint,
54
54
  subscribeBreakpoint,
55
55
  } from '@volter/editor-sdk/kit/breakpoint-state';
56
- import { CompositeAuthoringAdapter } from '@volter/editor-core/authoring/composite-authoring-adapter';
56
+ import { CompositeAuthoringAdapter } from '@volter/editor-sdk/kit/authoring/composite-authoring-adapter';
57
57
  import { numericStyleValue, UNITLESS_NUMBER_PROPS } from '@volter/editor-sdk/css-numeric-style';
58
58
  import { beginEyedropperSession } from '@volter/editor-sdk/kit/eyedropper-session';
59
59
  import { groupProperties } from '@volter/editor-sdk/kit/inspector-property-grouping';
60
- import { useEditorStore } from '@volter/editor-core/editor-runtime';
60
+ import { useEditorStore } from '@volter/editor-sdk/kit/editor-runtime';
61
61
  import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
62
- import { groupIcon } from '@volter/editor-core/inspection/compose';
62
+ import { groupIcon } from '@volter/editor-sdk/kit/inspection/compose';
63
63
  import {
64
64
  GROUP_SECTION_ORDER,
65
65
  groupSectionId,
@@ -68,7 +68,7 @@ import {
68
68
  PROPERTIES_SECTION_ORDER,
69
69
  } from '@volter/editor-sdk/kit/inspection-model';
70
70
  import { registerInspectorSections } from '@volter/editor-sdk/kit/inspector-section-registry';
71
- import { effectiveColorFromChain, getAvailableFonts } from '@volter/editor-core/ui-source/inspect';
71
+ import { effectiveColorFromChain, getAvailableFonts } from '@volter/editor-sdk/kit/ui-source/inspect';
72
72
  import type { OidEntry } from '@volter/editor-react/source/oid-transform';
73
73
  import type { AuthoringAdapter, EditorNode, PropertyDescriptor } from '@volter/editor-project/adapter';
74
74
  import {
@@ -42,16 +42,16 @@ import {
42
42
  type WriteAck,
43
43
  type WriteResolution,
44
44
  } from '@volter/editor-sdk/kit/write-pipe';
45
- import { guideClientEdges } from '@volter/editor-core/components/board-guides';
45
+ import { guideClientEdges } from '@volter/editor-sdk/kit/components/board-guides';
46
46
  import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
47
- import type { EditorShellStore } from '@volter/editor-core/editor-shell-store';
48
- import { withProjectSourceHistory } from '@volter/editor-core/history/source-history-backend';
47
+ import type { ShellStore } from '@volter/editor-sdk/kit/shell-store';
48
+ import { withProjectSourceHistory } from '@volter/editor-sdk/kit/history/source-history-backend';
49
49
  import { DomProjector, oidDomIdentity, projectOidDom } from '../host/projection/dom';
50
50
  import { storyArgPropertyDescriptors } from '../host/stories/story-arg-descriptors';
51
- import { storyDiscoveryUnavailable } from '@volter/editor-core/stories/story-discovery';
52
- import { deriveStoryGroupPath, formatStoryGroupPath } from '@volter/editor-core/stories/story-grouping';
53
- import type { StoryPresentationIndex } from '@volter/editor-core/stories/story-presentation';
54
- import { subscribeProjectStoryModules } from '@volter/editor-core/stories/story-registry';
51
+ import { storyDiscoveryUnavailable } from '@volter/editor-sdk/kit/stories/story-discovery';
52
+ import { deriveStoryGroupPath, formatStoryGroupPath } from '@volter/editor-sdk/kit/stories/story-grouping';
53
+ import type { StoryPresentationIndex } from '@volter/editor-sdk/kit/stories/story-presentation';
54
+ import { subscribeProjectStoryModules } from '@volter/editor-sdk/kit/stories/story-registry';
55
55
  import { showTransientHint } from '@volter/editor-sdk/kit/transient-hint';
56
56
  import {
57
57
  browserOrInlineResolver,
@@ -68,11 +68,11 @@ import {
68
68
  getMatchedCssRules,
69
69
  getReactComponentName,
70
70
  type MatchableElement,
71
- } from '@volter/editor-core/ui-source/inspect';
71
+ } from '@volter/editor-sdk/kit/ui-source/inspect';
72
72
  import type { ComponentPropSpec, OidEntry } from '@volter/editor-react/source/oid-transform';
73
73
  import { relativeImportSpecifier } from '@volter/editor-react/source/relative-import-specifier';
74
- import type { SourceWriteBackend } from '@volter/editor-core/ui-source/source-write-backend';
75
- import { writeCsfStory, writeNamedStyle } from '@volter/editor-core/ui-source/source-write-backend';
74
+ import type { SourceWriteBackend } from '@volter/editor-sdk/kit/ui-source/source-write-backend';
75
+ import { writeCsfStory, writeNamedStyle } from '@volter/editor-sdk/kit/ui-source/source-write-backend';
76
76
  import {
77
77
  type CssRuleTarget,
78
78
  namedStyleRuleFor,
@@ -1042,7 +1042,7 @@ export class ReactRootAuthoringAdapter implements AuthoringAdapter {
1042
1042
 
1043
1043
  constructor(
1044
1044
  private readonly root: OidElementLike,
1045
- private readonly store: EditorShellStore,
1045
+ private readonly store: ShellStore,
1046
1046
  opts: ReactRootAuthoringOptions = {},
1047
1047
  ) {
1048
1048
  this.assetRoot = opts.assetRoot ?? root;
@@ -42,8 +42,8 @@ import { Checkbox, TextInput, themeVars } from '@volter/editor-sdk/widgets';
42
42
  // estate into this package's program.
43
43
  import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
44
44
  import { type Resolution, ResolutionPicker } from '../../host/components/ResolutionPicker';
45
- import { SurfaceStateOverlay } from '@volter/editor-core/components/SurfaceStateOverlay';
46
- import { registerDocumentOpener } from '@volter/editor-core/document-open-registry';
45
+ import { SurfaceStateOverlay } from '@volter/editor-sdk/kit/components/SurfaceStateOverlay';
46
+ import { registerDocumentOpener } from '@volter/editor-sdk/kit/document-open-registry';
47
47
  import { createHmrRegistrationGroup } from '@volter/editor-sdk/kit/hmr-registration-group';
48
48
  import {
49
49
  CONTRIBUTED_SECTION_ORDER,
@@ -51,10 +51,10 @@ import {
51
51
  STORY_ARGS_SECTION_TITLE,
52
52
  } from '@volter/editor-sdk/kit/inspection-model';
53
53
  import { registerInspectorSections } from '@volter/editor-sdk/kit/inspector-section-registry';
54
- import type { ComposedProjectStory } from '@volter/editor-core/stories/compose-project-stories';
55
- import { getProjectStoryRegions } from '@volter/editor-core/stories/project-story-regions';
56
- import { mountIsolatedStory, runStoryPlay } from '@volter/editor-core/stories/StoryPreviewMount';
57
- import { declaredStoryMedium } from '@volter/editor-core/stories/story-declared-medium';
54
+ import type { ComposedProjectStory } from '@volter/editor-sdk/kit/stories/compose-project-stories';
55
+ import { getProjectStoryRegions } from '@volter/editor-sdk/kit/stories/project-story-regions';
56
+ import { mountIsolatedStory, runStoryPlay } from '@volter/editor-sdk/kit/stories/StoryPreviewMount';
57
+ import { declaredStoryMedium } from '@volter/editor-sdk/kit/stories/story-declared-medium';
58
58
  import {
59
59
  ISOLATED_STORY_DOCUMENT_OPENER,
60
60
  STORY_DOCS_DOCUMENT_OPENER,
@@ -65,7 +65,7 @@ import {
65
65
  refreshProjectStories,
66
66
  subscribeProjectStoryModules,
67
67
  whenProjectStoriesReady,
68
- } from '@volter/editor-core/stories/story-registry';
68
+ } from '@volter/editor-sdk/kit/stories/story-registry';
69
69
  import { domHasRenderableContent } from '../../host/surface-content';
70
70
  import { explainSurface, type SurfaceContentState } from '@volter/editor-sdk/kit/surface-state';
71
71
  import { CONTRIBUTED_WORKSPACE_UTILITIES } from '@volter/editor-sdk/kit/workspace-core-utilities';
@@ -74,9 +74,9 @@ import {
74
74
  openWorkspaceDocument,
75
75
  type WorkspaceDocumentContentProps,
76
76
  } from '@volter/editor-sdk/kit/workspace-document-registry';
77
- import { registerWorkspaceDocumentRestorer } from '@volter/editor-core/workspace-document-restore';
77
+ import { registerWorkspaceDocumentRestorer } from '@volter/editor-sdk/kit/workspace-document-restore';
78
78
  import { registerWorkspaceUtility } from '@volter/editor-sdk/kit/workspace-utility-registry';
79
- import { fitPresentation } from '@volter/game-runtime/runtime/presentation';
79
+ import { fitPresentation } from '../../runtime/presentation';
80
80
  import { Button, fontMono, fontSizeVar, spaceVar } from '@volter/editor-sdk/widgets';
81
81
  import { useEffect, useRef, useState, useSyncExternalStore } from 'react';
82
82
  import { STORY_ARGS_SECTION_ICON } from './story-args-section';
@@ -1,4 +1,4 @@
1
- import { registerAvailableWorkspaceDocument } from '@volter/editor-core/workspace-available-documents';
1
+ import { registerAvailableWorkspaceDocument } from '@volter/editor-sdk/kit/workspace-available-documents';
2
2
  /**
3
3
  * THE `UI` BOARD's DOCUMENT — what `ui-component-board.ts` installs, kept in
4
4
  * its own module so the registration's eager closure is the verdict and
@@ -29,15 +29,15 @@ import {
29
29
  designTimeRootDescriptors,
30
30
  projectStoryBoardDescriptor,
31
31
  rememberedPortableStory,
32
- } from '@volter/editor-core/authoring/design-time-layers';
33
- import type { ComponentBoardContext } from '@volter/editor-core/component-board-registry';
34
- import { RootDocumentContent } from '@volter/editor-core/components/world-documents';
32
+ } from '@volter/editor-sdk/kit/authoring/design-time-layers';
33
+ import type { ComponentBoardContext } from '@volter/editor-sdk/kit/component-board-registry';
34
+ import { RootDocumentContent } from '@volter/editor-sdk/kit/components/world-documents';
35
35
  import type { DocumentPreviewSource } from '@volter/editor-sdk/kit/document-preview-source';
36
- import { getCurrentProject } from '@volter/editor-core/project-manager';
36
+ import { getCurrentProject } from '@volter/editor-sdk/kit/active-project';
37
37
  import {
38
38
  getProjectPreviewStories,
39
39
  subscribeProjectStoryModules,
40
- } from '@volter/editor-core/stories/story-registry';
40
+ } from '@volter/editor-sdk/kit/stories/story-registry';
41
41
  import { UI_COMPONENTS_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
42
42
  import type { WorkspaceDocumentContentProps } from '@volter/editor-sdk/kit/workspace-document-registry';
43
43
 
@@ -48,7 +48,7 @@ const uiCanvasPreview: DocumentPreviewSource = {
48
48
  JSON.stringify(getProjectPreviewStories().map(({ id, modulePath }) => [id, modulePath])),
49
49
  subscribe: subscribeProjectStoryModules,
50
50
  capture: async ({ width, height }) => {
51
- const { captureDomStoryBoardPreview } = await import('@volter/editor-core/stories/story-capture');
51
+ const { captureDomStoryBoardPreview } = await import('@volter/editor-sdk/kit/stories/story-capture');
52
52
  return captureDomStoryBoardPreview(width, height);
53
53
  },
54
54
  };
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  import { commandLine } from '@volter/editor-sdk/kit/product-command';
16
- import type { ComponentBoard, ComponentBoardContext } from '@volter/editor-core/component-board-registry';
16
+ import type { ComponentBoard, ComponentBoardContext } from '@volter/editor-sdk/kit/component-board-registry';
17
17
  import { editorConsole } from '@volter/editor-sdk/kit/editor-console';
18
18
  import {
19
19
  getStoryMediaPresence,
20
20
  subscribeStoryMediaPresence,
21
21
  } from '../host/stories/story-media-presence';
22
- import { projectStoriesReady, subscribeProjectStoryModules } from '@volter/editor-core/stories/story-registry';
22
+ import { projectStoriesReady, subscribeProjectStoryModules } from '@volter/editor-sdk/kit/stories/story-registry';
23
23
  import { UI_COMPONENTS_DOCUMENT_ID } from '@volter/editor-sdk/kit/workspace-document-ids';
24
24
  import { UI_COMPONENTS_TITLE } from './ui-board-title';
25
25
 
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Meter arithmetic over an `AudioAdapter`'s `AudioMeterFrame.level` — the one
3
+ * place a linear RMS level becomes dBFS and a bar fill. Lives beside the
4
+ * adapter because both readers of a level (the editor's header meter and the
5
+ * `@vgai/game` audio debugger) are consumers of the adapter, and neither may
6
+ * import the other.
7
+ */
8
+
9
+ /** Linear RMS level → dBFS. Silence clamps to `floorDb` (log of 0 is -∞). */
10
+ export function levelToDb(level: number, floorDb = -60): number {
11
+ if (!(level > 0)) return floorDb;
12
+ return Math.max(floorDb, 20 * Math.log10(level));
13
+ }
14
+
15
+ /** Meter-bar fill percentage: dB-scaled from a -60 dBFS floor (a linear
16
+ * scale would pin every real-world level into the bottom pixels). 0 for
17
+ * silence, 100 at/above full scale. */
18
+ export function meterPercent(level: number, floorDb = -60): number {
19
+ const db = levelToDb(level, floorDb);
20
+ return Math.round(((db - floorDb) / -floorDb) * 100);
21
+ }