@vgai/engine 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/adapter-surface.d.ts +30 -0
- package/dist/adapter/adapter-surface.d.ts.map +1 -0
- package/dist/adapter/adapter-surface.js +18 -0
- package/dist/adapter/authoring.d.ts +597 -0
- package/dist/adapter/authoring.d.ts.map +1 -0
- package/dist/adapter/authoring.js +22 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts +77 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
- package/dist/adapter/colyseus-networking-adapter.js +76 -0
- package/dist/adapter/first-party-systems.d.ts +23 -0
- package/dist/adapter/first-party-systems.d.ts.map +1 -0
- package/dist/adapter/first-party-systems.js +196 -0
- package/dist/adapter/host-context.d.ts +194 -0
- package/dist/adapter/host-context.d.ts.map +1 -0
- package/dist/adapter/host-context.js +80 -0
- package/dist/adapter/index.d.ts +33 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +25 -0
- package/dist/adapter/ingest/game-contract.d.ts +53 -0
- package/dist/adapter/ingest/game-contract.d.ts.map +1 -0
- package/dist/adapter/ingest/game-contract.js +30 -0
- package/dist/adapter/ingest/scene-capture.d.ts +121 -0
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
- package/dist/adapter/ingest/scene-capture.js +270 -0
- package/dist/adapter/ingest/structural-ids.d.ts +64 -0
- package/dist/adapter/ingest/structural-ids.d.ts.map +1 -0
- package/dist/adapter/ingest/structural-ids.js +110 -0
- package/dist/adapter/ingest/upstream-pin.d.ts +44 -0
- package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
- package/dist/adapter/ingest/upstream-pin.js +47 -0
- package/dist/adapter/loop-gate-report.d.ts +34 -0
- package/dist/adapter/loop-gate-report.d.ts.map +1 -0
- package/dist/adapter/loop-gate-report.js +37 -0
- package/dist/adapter/rapier-physics-adapter.d.ts +69 -0
- package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
- package/dist/adapter/rapier-physics-adapter.js +135 -0
- package/dist/adapter/root-adapter.d.ts +195 -0
- package/dist/adapter/root-adapter.d.ts.map +1 -0
- package/dist/adapter/root-adapter.js +25 -0
- package/dist/adapter/setup-three-root-adapter.d.ts +87 -0
- package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -0
- package/dist/adapter/setup-three-root-adapter.js +791 -0
- package/dist/adapter/system-adapter.d.ts +453 -0
- package/dist/adapter/system-adapter.d.ts.map +1 -0
- package/dist/adapter/system-adapter.js +13 -0
- package/dist/adapter/transform.d.ts +18 -0
- package/dist/adapter/transform.d.ts.map +1 -0
- package/dist/adapter/transform.js +1 -0
- package/dist/ai/navigation.d.ts +78 -0
- package/dist/ai/navigation.d.ts.map +1 -0
- package/dist/ai/navigation.js +152 -0
- package/dist/animation/anim-graph-types.d.ts +25 -0
- package/dist/animation/anim-graph-types.d.ts.map +1 -0
- package/dist/animation/anim-graph-types.js +1 -0
- package/dist/animation/animation-clock.d.ts +213 -0
- package/dist/animation/animation-clock.d.ts.map +1 -0
- package/dist/animation/animation-clock.js +301 -0
- package/dist/animation/blend-node.d.ts +22 -0
- package/dist/animation/blend-node.d.ts.map +1 -0
- package/dist/animation/blend-node.js +97 -0
- package/dist/animation/camera-ownership.d.ts +249 -0
- package/dist/animation/camera-ownership.d.ts.map +1 -0
- package/dist/animation/camera-ownership.js +169 -0
- package/dist/animation/cinematic-cues.d.ts +200 -0
- package/dist/animation/cinematic-cues.d.ts.map +1 -0
- package/dist/animation/cinematic-cues.js +213 -0
- package/dist/animation/clip-map.d.ts +12 -0
- package/dist/animation/clip-map.d.ts.map +1 -0
- package/dist/animation/clip-map.js +31 -0
- package/dist/animation/cubic-spline-interpolant.d.ts +54 -0
- package/dist/animation/cubic-spline-interpolant.d.ts.map +1 -0
- package/dist/animation/cubic-spline-interpolant.js +111 -0
- package/dist/animation/theatre-clock-binding.d.ts +89 -0
- package/dist/animation/theatre-clock-binding.d.ts.map +1 -0
- package/dist/animation/theatre-clock-binding.js +29 -0
- package/dist/animation/theatre-director.d.ts +277 -0
- package/dist/animation/theatre-director.d.ts.map +1 -0
- package/dist/animation/theatre-director.js +248 -0
- package/dist/animation/theatre-object-binding.d.ts +305 -0
- package/dist/animation/theatre-object-binding.d.ts.map +1 -0
- package/dist/animation/theatre-object-binding.js +351 -0
- package/dist/animation/xstate-animation-binding.d.ts +119 -0
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
- package/dist/animation/xstate-animation-binding.js +349 -0
- package/dist/animation/xstate-animation-meta.d.ts +266 -0
- package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
- package/dist/animation/xstate-animation-meta.js +252 -0
- package/dist/asset-formats/camera.d.ts +15 -0
- package/dist/asset-formats/camera.d.ts.map +1 -0
- package/dist/asset-formats/camera.js +15 -0
- package/dist/asset-formats/collider.d.ts +21 -0
- package/dist/asset-formats/collider.d.ts.map +1 -0
- package/dist/asset-formats/collider.js +53 -0
- package/dist/asset-formats/index.d.ts +46 -0
- package/dist/asset-formats/index.d.ts.map +1 -0
- package/dist/asset-formats/index.js +36 -0
- package/dist/asset-formats/instances.d.ts +17 -0
- package/dist/asset-formats/instances.d.ts.map +1 -0
- package/dist/asset-formats/instances.js +31 -0
- package/dist/asset-formats/light.d.ts +21 -0
- package/dist/asset-formats/light.d.ts.map +1 -0
- package/dist/asset-formats/light.js +35 -0
- package/dist/asset-formats/material.d.ts +129 -0
- package/dist/asset-formats/material.d.ts.map +1 -0
- package/dist/asset-formats/material.js +88 -0
- package/dist/asset-formats/mesh.d.ts +22 -0
- package/dist/asset-formats/mesh.d.ts.map +1 -0
- package/dist/asset-formats/mesh.js +64 -0
- package/dist/asset-formats/parse.d.ts +20 -0
- package/dist/asset-formats/parse.d.ts.map +1 -0
- package/dist/asset-formats/parse.js +34 -0
- package/dist/asset-formats/particles.d.ts +1390 -0
- package/dist/asset-formats/particles.d.ts.map +1 -0
- package/dist/asset-formats/particles.js +319 -0
- package/dist/asset-formats/render-env.d.ts +387 -0
- package/dist/asset-formats/render-env.d.ts.map +1 -0
- package/dist/asset-formats/render-env.js +300 -0
- package/dist/asset-formats/tuples.d.ts +12 -0
- package/dist/asset-formats/tuples.d.ts.map +1 -0
- package/dist/asset-formats/tuples.js +14 -0
- package/dist/asset-loaders.d.ts +97 -0
- package/dist/asset-loaders.d.ts.map +1 -0
- package/dist/asset-loaders.js +209 -0
- package/dist/asset-parse-error.d.ts +24 -0
- package/dist/asset-parse-error.d.ts.map +1 -0
- package/dist/asset-parse-error.js +29 -0
- package/dist/asset-registry.d.ts +38 -0
- package/dist/asset-registry.d.ts.map +1 -0
- package/dist/asset-registry.js +66 -0
- package/dist/assets.d.ts +26 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +55 -0
- package/dist/audio/wav-encode.d.ts +38 -0
- package/dist/audio/wav-encode.d.ts.map +1 -0
- package/dist/audio/wav-encode.js +97 -0
- package/dist/canvas-react/engine-bridge.d.ts +45 -0
- package/dist/canvas-react/engine-bridge.d.ts.map +1 -0
- package/dist/canvas-react/engine-bridge.js +45 -0
- package/dist/canvas-react/index.d.ts +42 -0
- package/dist/canvas-react/index.d.ts.map +1 -0
- package/dist/canvas-react/index.js +41 -0
- package/dist/canvas-react/pixi-primitive.d.ts +85 -0
- package/dist/canvas-react/pixi-primitive.d.ts.map +1 -0
- package/dist/canvas-react/pixi-primitive.js +181 -0
- package/dist/canvas-react/pixi-react-adapter.d.ts +71 -0
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -0
- package/dist/canvas-react/pixi-react-adapter.js +229 -0
- package/dist/canvas-react/pixi-react-root-factory.d.ts +56 -0
- package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -0
- package/dist/canvas-react/pixi-react-root-factory.js +73 -0
- package/dist/canvas-react/world-context.d.ts +88 -0
- package/dist/canvas-react/world-context.d.ts.map +1 -0
- package/dist/canvas-react/world-context.js +212 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +8 -0
- package/dist/core/frame-pacing.d.ts +90 -0
- package/dist/core/frame-pacing.d.ts.map +1 -0
- package/dist/core/frame-pacing.js +89 -0
- package/dist/core/game-loop.d.ts +62 -0
- package/dist/core/game-loop.d.ts.map +1 -0
- package/dist/core/game-loop.js +189 -0
- package/dist/core/seeded-random.d.ts +69 -0
- package/dist/core/seeded-random.d.ts.map +1 -0
- package/dist/core/seeded-random.js +121 -0
- package/dist/core/sim-clock.d.ts +199 -0
- package/dist/core/sim-clock.d.ts.map +1 -0
- package/dist/core/sim-clock.js +291 -0
- package/dist/core/system-runner.d.ts +96 -0
- package/dist/core/system-runner.d.ts.map +1 -0
- package/dist/core/system-runner.js +253 -0
- package/dist/core/types.d.ts +111 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +25 -0
- package/dist/data/data-asset.d.ts +101 -0
- package/dist/data/data-asset.d.ts.map +1 -0
- package/dist/data/data-asset.js +122 -0
- package/dist/data/data-check-core.d.ts +109 -0
- package/dist/data/data-check-core.d.ts.map +1 -0
- package/dist/data/data-check-core.js +177 -0
- package/dist/data/data-ref.d.ts +79 -0
- package/dist/data/data-ref.d.ts.map +1 -0
- package/dist/data/data-ref.js +130 -0
- package/dist/data/vite-plugin-data.d.ts +79 -0
- package/dist/data/vite-plugin-data.d.ts.map +1 -0
- package/dist/data/vite-plugin-data.js +217 -0
- package/dist/defaults.d.ts +233 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +137 -0
- package/dist/dev/chrome-trace.d.ts +45 -0
- package/dist/dev/chrome-trace.d.ts.map +1 -0
- package/dist/dev/chrome-trace.js +114 -0
- package/dist/dev/console-bridge.d.ts +22 -0
- package/dist/dev/console-bridge.d.ts.map +1 -0
- package/dist/dev/console-bridge.js +71 -0
- package/dist/dev/debug-draw.d.ts +24 -0
- package/dist/dev/debug-draw.d.ts.map +1 -0
- package/dist/dev/debug-draw.js +73 -0
- package/dist/dev/instruments.d.ts +133 -0
- package/dist/dev/instruments.d.ts.map +1 -0
- package/dist/dev/instruments.js +231 -0
- package/dist/dev/logger.d.ts +30 -0
- package/dist/dev/logger.d.ts.map +1 -0
- package/dist/dev/logger.js +90 -0
- package/dist/dev/performance-profiler.d.ts +111 -0
- package/dist/dev/performance-profiler.d.ts.map +1 -0
- package/dist/dev/performance-profiler.js +215 -0
- package/dist/dev/render-debug-adapter.d.ts +57 -0
- package/dist/dev/render-debug-adapter.d.ts.map +1 -0
- package/dist/dev/render-debug-adapter.js +141 -0
- package/dist/dev/render-memory.d.ts +53 -0
- package/dist/dev/render-memory.d.ts.map +1 -0
- package/dist/dev/render-memory.js +190 -0
- package/dist/dev/webgl-frame-capture.d.ts +134 -0
- package/dist/dev/webgl-frame-capture.d.ts.map +1 -0
- package/dist/dev/webgl-frame-capture.js +270 -0
- package/dist/dev/webgl-gpu-timer.d.ts +8 -0
- package/dist/dev/webgl-gpu-timer.d.ts.map +1 -0
- package/dist/dev/webgl-gpu-timer.js +52 -0
- package/dist/ecs/scene-index.d.ts +179 -0
- package/dist/ecs/scene-index.d.ts.map +1 -0
- package/dist/ecs/scene-index.js +331 -0
- package/dist/ecs/scene-query.d.ts +6 -0
- package/dist/ecs/scene-query.d.ts.map +1 -0
- package/dist/ecs/scene-query.js +40 -0
- package/dist/ecs/user-data.d.ts +193 -0
- package/dist/ecs/user-data.d.ts.map +1 -0
- package/dist/ecs/user-data.js +145 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/input/input-manager.d.ts +944 -0
- package/dist/input/input-manager.d.ts.map +1 -0
- package/dist/input/input-manager.js +2209 -0
- package/dist/input/input-types.d.ts +174 -0
- package/dist/input/input-types.d.ts.map +1 -0
- package/dist/input/input-types.js +1 -0
- package/dist/input/prompt-labels.d.ts +21 -0
- package/dist/input/prompt-labels.d.ts.map +1 -0
- package/dist/input/prompt-labels.js +121 -0
- package/dist/input/rebind-controller.d.ts +59 -0
- package/dist/input/rebind-controller.d.ts.map +1 -0
- package/dist/input/rebind-controller.js +85 -0
- package/dist/input/schema.d.ts +16 -0
- package/dist/input/schema.d.ts.map +1 -0
- package/dist/input/schema.js +228 -0
- package/dist/loader.d.ts +76 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +114 -0
- package/dist/manifest/editor-port.d.ts +53 -0
- package/dist/manifest/editor-port.d.ts.map +1 -0
- package/dist/manifest/editor-port.js +67 -0
- package/dist/manifest/filename.d.ts +14 -0
- package/dist/manifest/filename.d.ts.map +1 -0
- package/dist/manifest/filename.js +43 -0
- package/dist/manifest/index.d.ts +6 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +9 -0
- package/dist/manifest/load-file.d.ts +7 -0
- package/dist/manifest/load-file.d.ts.map +1 -0
- package/dist/manifest/load-file.js +23 -0
- package/dist/manifest/load.d.ts +161 -0
- package/dist/manifest/load.d.ts.map +1 -0
- package/dist/manifest/load.js +269 -0
- package/dist/manifest/locate.d.ts +24 -0
- package/dist/manifest/locate.d.ts.map +1 -0
- package/dist/manifest/locate.js +48 -0
- package/dist/manifest/schema.d.ts +293 -0
- package/dist/manifest/schema.d.ts.map +1 -0
- package/dist/manifest/schema.js +633 -0
- package/dist/physics/collider-dimensions.d.ts +63 -0
- package/dist/physics/collider-dimensions.d.ts.map +1 -0
- package/dist/physics/collider-dimensions.js +98 -0
- package/dist/physics/collision-system.d.ts +41 -0
- package/dist/physics/collision-system.d.ts.map +1 -0
- package/dist/physics/collision-system.js +64 -0
- package/dist/physics/physics-registry.d.ts +45 -0
- package/dist/physics/physics-registry.d.ts.map +1 -0
- package/dist/physics/physics-registry.js +65 -0
- package/dist/physics/transform-writer.d.ts +16 -0
- package/dist/physics/transform-writer.d.ts.map +1 -0
- package/dist/physics/transform-writer.js +38 -0
- package/dist/pixi/authoring.d.ts +93 -0
- package/dist/pixi/authoring.d.ts.map +1 -0
- package/dist/pixi/authoring.js +207 -0
- package/dist/pixi/index.d.ts +16 -0
- package/dist/pixi/index.d.ts.map +1 -0
- package/dist/pixi/index.js +15 -0
- package/dist/pixi/ingest-iframe.d.ts +82 -0
- package/dist/pixi/ingest-iframe.d.ts.map +1 -0
- package/dist/pixi/ingest-iframe.js +166 -0
- package/dist/pixi/ingest.d.ts +97 -0
- package/dist/pixi/ingest.d.ts.map +1 -0
- package/dist/pixi/ingest.js +40 -0
- package/dist/pixi/physics-registry.d.ts +24 -0
- package/dist/pixi/physics-registry.d.ts.map +1 -0
- package/dist/pixi/physics-registry.js +38 -0
- package/dist/pixi/scene-capture.d.ts +43 -0
- package/dist/pixi/scene-capture.d.ts.map +1 -0
- package/dist/pixi/scene-capture.js +92 -0
- package/dist/pixi/system-adapters.d.ts +16 -0
- package/dist/pixi/system-adapters.d.ts.map +1 -0
- package/dist/pixi/system-adapters.js +37 -0
- package/dist/react/unmanaged-root-detector.d.ts +18 -0
- package/dist/react/unmanaged-root-detector.d.ts.map +1 -0
- package/dist/react/unmanaged-root-detector.js +70 -0
- package/dist/react/use-data.d.ts +60 -0
- package/dist/react/use-data.d.ts.map +1 -0
- package/dist/react/use-data.js +101 -0
- package/dist/react/use-selection.d.ts +54 -0
- package/dist/react/use-selection.d.ts.map +1 -0
- package/dist/react/use-selection.js +71 -0
- package/dist/react/world-state.d.ts +154 -0
- package/dist/react/world-state.d.ts.map +1 -0
- package/dist/react/world-state.js +220 -0
- package/dist/render/auto-batcher.d.ts +34 -0
- package/dist/render/auto-batcher.d.ts.map +1 -0
- package/dist/render/auto-batcher.js +140 -0
- package/dist/render/instance-mesh.d.ts +5 -0
- package/dist/render/instance-mesh.d.ts.map +1 -0
- package/dist/render/instance-mesh.js +19 -0
- package/dist/render/light-camera-factory.d.ts +24 -0
- package/dist/render/light-camera-factory.d.ts.map +1 -0
- package/dist/render/light-camera-factory.js +71 -0
- package/dist/render/lod.d.ts +13 -0
- package/dist/render/lod.d.ts.map +1 -0
- package/dist/render/lod.js +16 -0
- package/dist/render/material-factory.d.ts +15 -0
- package/dist/render/material-factory.d.ts.map +1 -0
- package/dist/render/material-factory.js +186 -0
- package/dist/render/mesh-shadow.d.ts +11 -0
- package/dist/render/mesh-shadow.d.ts.map +1 -0
- package/dist/render/mesh-shadow.js +19 -0
- package/dist/render/particles-factory.d.ts +99 -0
- package/dist/render/particles-factory.d.ts.map +1 -0
- package/dist/render/particles-factory.js +361 -0
- package/dist/render/render-batch-system.d.ts +33 -0
- package/dist/render/render-batch-system.d.ts.map +1 -0
- package/dist/render/render-batch-system.js +223 -0
- package/dist/render/render-features.d.ts +47 -0
- package/dist/render/render-features.d.ts.map +1 -0
- package/dist/render/render-features.js +105 -0
- package/dist/render/render-settings.d.ts +35 -0
- package/dist/render/render-settings.d.ts.map +1 -0
- package/dist/render/render-settings.js +51 -0
- package/dist/render/spark-renderer-lifecycle.d.ts +18 -0
- package/dist/render/spark-renderer-lifecycle.d.ts.map +1 -0
- package/dist/render/spark-renderer-lifecycle.js +57 -0
- package/dist/render/viewport-shading.d.ts +17 -0
- package/dist/render/viewport-shading.d.ts.map +1 -0
- package/dist/render/viewport-shading.js +87 -0
- package/dist/runtime/create-runtime.d.ts +259 -0
- package/dist/runtime/create-runtime.d.ts.map +1 -0
- package/dist/runtime/create-runtime.js +666 -0
- package/dist/runtime/debug-bridge.d.ts +288 -0
- package/dist/runtime/debug-bridge.d.ts.map +1 -0
- package/dist/runtime/debug-bridge.js +277 -0
- package/dist/runtime/debug-registry.d.ts +287 -0
- package/dist/runtime/debug-registry.d.ts.map +1 -0
- package/dist/runtime/debug-registry.js +528 -0
- package/dist/runtime/dev-layers.d.ts +34 -0
- package/dist/runtime/dev-layers.d.ts.map +1 -0
- package/dist/runtime/dev-layers.js +40 -0
- package/dist/runtime/frame-selector-cache.d.ts +41 -0
- package/dist/runtime/frame-selector-cache.d.ts.map +1 -0
- package/dist/runtime/frame-selector-cache.js +65 -0
- package/dist/runtime/game.d.ts +576 -0
- package/dist/runtime/game.d.ts.map +1 -0
- package/dist/runtime/game.js +1003 -0
- package/dist/runtime/gameplay-rng-trap.d.ts +47 -0
- package/dist/runtime/gameplay-rng-trap.d.ts.map +1 -0
- package/dist/runtime/gameplay-rng-trap.js +95 -0
- package/dist/runtime/input-router.d.ts +78 -0
- package/dist/runtime/input-router.d.ts.map +1 -0
- package/dist/runtime/input-router.js +171 -0
- package/dist/runtime/mount-game.d.ts +126 -0
- package/dist/runtime/mount-game.d.ts.map +1 -0
- package/dist/runtime/mount-game.js +159 -0
- package/dist/runtime/mount-manifest.d.ts +174 -0
- package/dist/runtime/mount-manifest.d.ts.map +1 -0
- package/dist/runtime/mount-manifest.js +304 -0
- package/dist/runtime/presentation.d.ts +85 -0
- package/dist/runtime/presentation.d.ts.map +1 -0
- package/dist/runtime/presentation.js +92 -0
- package/dist/runtime/render-audio-control.d.ts +126 -0
- package/dist/runtime/render-audio-control.d.ts.map +1 -0
- package/dist/runtime/render-audio-control.js +116 -0
- package/dist/runtime/render-control.d.ts +347 -0
- package/dist/runtime/render-control.d.ts.map +1 -0
- package/dist/runtime/render-control.js +317 -0
- package/dist/runtime/render-seed.d.ts +56 -0
- package/dist/runtime/render-seed.d.ts.map +1 -0
- package/dist/runtime/render-seed.js +73 -0
- package/dist/runtime/state-bridge.d.ts +60 -0
- package/dist/runtime/state-bridge.d.ts.map +1 -0
- package/dist/runtime/state-bridge.js +62 -0
- package/dist/runtime/types.d.ts +285 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/unexported-game-trap.d.ts +36 -0
- package/dist/runtime/unexported-game-trap.d.ts.map +1 -0
- package/dist/runtime/unexported-game-trap.js +80 -0
- package/dist/setup/setup-audio.d.ts +20 -0
- package/dist/setup/setup-audio.d.ts.map +1 -0
- package/dist/setup/setup-audio.js +41 -0
- package/dist/setup/setup-particles.d.ts +17 -0
- package/dist/setup/setup-particles.d.ts.map +1 -0
- package/dist/setup/setup-particles.js +16 -0
- package/dist/setup/setup-physics.d.ts +25 -0
- package/dist/setup/setup-physics.d.ts.map +1 -0
- package/dist/setup/setup-physics.js +51 -0
- package/dist/setup/setup-renderer.d.ts +82 -0
- package/dist/setup/setup-renderer.d.ts.map +1 -0
- package/dist/setup/setup-renderer.js +381 -0
- package/dist/world3d-react/engine-bridge.d.ts +47 -0
- package/dist/world3d-react/engine-bridge.d.ts.map +1 -0
- package/dist/world3d-react/engine-bridge.js +48 -0
- package/dist/world3d-react/index.d.ts +47 -0
- package/dist/world3d-react/index.d.ts.map +1 -0
- package/dist/world3d-react/index.js +46 -0
- package/dist/world3d-react/r3f-adapter.d.ts +51 -0
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -0
- package/dist/world3d-react/r3f-adapter.js +368 -0
- package/dist/world3d-react/r3f-root-factory.d.ts +62 -0
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -0
- package/dist/world3d-react/r3f-root-factory.js +79 -0
- package/dist/world3d-react/rapier-physics-bridge.d.ts +76 -0
- package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -0
- package/dist/world3d-react/rapier-physics-bridge.js +120 -0
- package/dist/world3d-react/renderer-config.d.ts +58 -0
- package/dist/world3d-react/renderer-config.d.ts.map +1 -0
- package/dist/world3d-react/renderer-config.js +96 -0
- package/dist/world3d-react/world-context.d.ts +123 -0
- package/dist/world3d-react/world-context.d.ts.map +1 -0
- package/dist/world3d-react/world-context.js +204 -0
- package/dist-config/config.js +303 -0
- package/dist-config/config.js.map +7 -0
- package/package.json +14 -3
- package/src/adapter/rapier-physics-adapter.ts +77 -34
- package/src/config.ts +8 -0
- package/src/core/frame-pacing.ts +26 -0
- package/src/core/game-loop.ts +4 -3
- package/src/dev/instruments.ts +302 -0
- package/src/runtime/mount-game.ts +6 -0
- package/src/runtime/unexported-game-trap.ts +82 -0
- package/src/setup/setup-renderer.ts +2 -0
- package/src/world3d-react/index.ts +9 -0
- package/src/world3d-react/rapier-physics-bridge.ts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* AuthoringAdapter — the editor's authoring contract. The editor talks to THIS,
|
|
3
|
+
* keyed by opaque string node ids, instead of to a concrete document format.
|
|
4
|
+
*
|
|
5
|
+
* `.vscn` / `SceneEntity` is the private model of ONE implementer
|
|
6
|
+
* (`VgaiSceneAuthoringAdapter`); an ingested game's adapter implements the same
|
|
7
|
+
* providers directly over its live `Object3D` tree. The editor sees only the
|
|
8
|
+
* interface and the advertised `capabilities` — it never branches on which
|
|
9
|
+
* implementer it is talking to.
|
|
10
|
+
*
|
|
11
|
+
* The interface lives in the engine (not the editor) so `MountedThreeRoot.authoring`
|
|
12
|
+
* can reference it without the engine depending on the editor; implementers live
|
|
13
|
+
* in `packages/editor/src/authoring/`.
|
|
14
|
+
*
|
|
15
|
+
* **Reserved inspector paths convention:** the property paths `name`, `visible`,
|
|
16
|
+
* and `locked` are reserved — an adapter that supports them exposes them through
|
|
17
|
+
* the ordinary `InspectorProvider.get`/`set` (no separate provider). The shell
|
|
18
|
+
* renders the hierarchy panel's rename field, eye (visibility) toggle, and lock
|
|
19
|
+
* toggle against these three paths, generically, for any adapter that reports
|
|
20
|
+
* them via `InspectorProvider.properties`.
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
|
|
3
|
+
* INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
|
|
4
|
+
* "is this object replicated, who owns it, may I edit it" — and, for the network
|
|
5
|
+
* inspector panel, "am I connected, to which room, how much replication activity
|
|
6
|
+
* is happening" — without owning Colyseus.
|
|
7
|
+
*
|
|
8
|
+
* It is parameterized by accessors over the room state (rather than a fixed schema)
|
|
9
|
+
* so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
|
|
10
|
+
* report the local session and peers, and report connection/room/stats for the
|
|
11
|
+
* inspector. The editor uses `authority`/`editable` to keep remote/server-
|
|
12
|
+
* authoritative objects inspect-only (editing a replicated transform locally is
|
|
13
|
+
* meaningless — the server overwrites it next snapshot).
|
|
14
|
+
*/
|
|
15
|
+
import type * as THREE from 'three';
|
|
16
|
+
import type { ConnectionState, NetConditioning, NetMessageEvent, NetPeer, NetPlayerIdentity, NetRates, NetworkingAdapter, ReplicationStats, RoomInfo, Unsubscribe } from './system-adapter';
|
|
17
|
+
export interface ColyseusNetworkingConfig {
|
|
18
|
+
/** The local peer's session id (objects it owns are editable). */
|
|
19
|
+
localSessionId(): string | null;
|
|
20
|
+
/** Peers currently in the room. */
|
|
21
|
+
peers(): NetPeer[];
|
|
22
|
+
/**
|
|
23
|
+
* The game's own `id → Object3D` map (P-4). The SEAM
|
|
24
|
+
* (`NetworkingAdapter`) is keyed by node id so a non-three world can
|
|
25
|
+
* implement it at all; the accessors below stay `Object3D`-keyed because a
|
|
26
|
+
* three game already thinks in objects. This one member is the bridge, and
|
|
27
|
+
* it is the game's to declare — the engine never guesses an identity
|
|
28
|
+
* convention on a game's behalf. Returning `null` means "no such node here",
|
|
29
|
+
* and every accessor degrades exactly as it does for an unreplicated object.
|
|
30
|
+
*/
|
|
31
|
+
resolve(nodeId: string): THREE.Object3D | null;
|
|
32
|
+
/** Network id for an object, or null if it is not replicated (→ local authored). */
|
|
33
|
+
networkId(o: THREE.Object3D): string | null;
|
|
34
|
+
/** Owning peer/session id for a replicated object (null = server-owned). */
|
|
35
|
+
ownerId(o: THREE.Object3D): string | null;
|
|
36
|
+
/** True if the server is authoritative over this object (→ inspect-only). */
|
|
37
|
+
serverAuthoritative?(o: THREE.Object3D): boolean;
|
|
38
|
+
/** Current connection lifecycle state, for the network inspector panel.
|
|
39
|
+
* Optional — defaults to `'disconnected'` for implementers that only need
|
|
40
|
+
* object authority/editability (the pre-inspector config shape). */
|
|
41
|
+
connectionState?(): ConnectionState;
|
|
42
|
+
/** The active room's identity, or `null` when not connected to a room.
|
|
43
|
+
* Optional — defaults to `null`. */
|
|
44
|
+
roomInfo?(): RoomInfo | null;
|
|
45
|
+
/** Replication activity snapshot (entity count + msg rates), for the inspector.
|
|
46
|
+
* Optional — defaults to all-zero stats. */
|
|
47
|
+
replicationStats?(): ReplicationStats;
|
|
48
|
+
/** Subscribe to changes in connection state / room / replication stats.
|
|
49
|
+
* Optional — defaults to a no-op subscription. */
|
|
50
|
+
subscribe?(cb: () => void): Unsubscribe;
|
|
51
|
+
/** Optional CAPABILITY: plain-data replicated-state snapshot (Colyseus
|
|
52
|
+
* `state.toJSON()`), for the inspector's state tree (W3b). Unlike the
|
|
53
|
+
* defaulted accessors above, this and the remaining optional accessors
|
|
54
|
+
* propagate their ABSENCE to the built adapter — a config that omits one
|
|
55
|
+
* yields an adapter without that method, so the inspector marks the
|
|
56
|
+
* section absent instead of rendering fabricated empties. */
|
|
57
|
+
stateSnapshot?(): unknown;
|
|
58
|
+
/** Optional capability: message-log events with `seq > sinceSeq`. */
|
|
59
|
+
messageEvents?(sinceSeq?: number): NetMessageEvent[];
|
|
60
|
+
/** Optional capability: msg + byte rates for the inspector sparklines. */
|
|
61
|
+
rates?(): NetRates;
|
|
62
|
+
/** Optional capability pair: link conditioning at the adapter seam. Both
|
|
63
|
+
* must be supplied together for the inspector to show the controls. */
|
|
64
|
+
getConditioning?(): NetConditioning;
|
|
65
|
+
setConditioning?(c: NetConditioning): void;
|
|
66
|
+
/** Optional capability: read the local player's identity off the game's own
|
|
67
|
+
* room state (→ adapter `getPlayerIdentity`, a seat label). Independent of
|
|
68
|
+
* the setter below — a game can expose a read-only identity. */
|
|
69
|
+
playerIdentity?(): NetPlayerIdentity | undefined;
|
|
70
|
+
/** Optional capability: set the local player's identity through the game's own
|
|
71
|
+
* mechanism (→ adapter `setPlayerIdentity`, an editable name field). Present
|
|
72
|
+
* only when the game supports a settable name; drives the game's real path
|
|
73
|
+
* (a join option the server honours, a rename message, …). */
|
|
74
|
+
setPlayerIdentity?(identity: NetPlayerIdentity): void | Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
export declare function createColyseusNetworkingAdapter(cfg: ColyseusNetworkingConfig): NetworkingAdapter;
|
|
77
|
+
//# sourceMappingURL=colyseus-networking-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colyseus-networking-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/colyseus-networking-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,cAAc,IAAI,MAAM,GAAG,IAAI,CAAC;IAChC,mCAAmC;IACnC,KAAK,IAAI,OAAO,EAAE,CAAC;IACnB;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC/C,oFAAoF;IACpF,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,4EAA4E;IAC5E,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,6EAA6E;IAC7E,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACjD;;yEAEqE;IACrE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC;yCACqC;IACrC,QAAQ,CAAC,IAAI,QAAQ,GAAG,IAAI,CAAC;IAC7B;iDAC6C;IAC7C,gBAAgB,CAAC,IAAI,gBAAgB,CAAC;IACtC;uDACmD;IACnD,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;IACxC;;;;;kEAK8D;IAC9D,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,qEAAqE;IACrE,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;IACrD,0EAA0E;IAC1E,KAAK,CAAC,IAAI,QAAQ,CAAC;IACnB;4EACwE;IACxE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C;;qEAEiE;IACjE,cAAc,CAAC,IAAI,iBAAiB,GAAG,SAAS,CAAC;IACjD;;;mEAG+D;IAC/D,iBAAiB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,wBAAwB,GAAG,iBAAiB,CAuDhG"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
|
|
3
|
+
* INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
|
|
4
|
+
* "is this object replicated, who owns it, may I edit it" — and, for the network
|
|
5
|
+
* inspector panel, "am I connected, to which room, how much replication activity
|
|
6
|
+
* is happening" — without owning Colyseus.
|
|
7
|
+
*
|
|
8
|
+
* It is parameterized by accessors over the room state (rather than a fixed schema)
|
|
9
|
+
* so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
|
|
10
|
+
* report the local session and peers, and report connection/room/stats for the
|
|
11
|
+
* inspector. The editor uses `authority`/`editable` to keep remote/server-
|
|
12
|
+
* authoritative objects inspect-only (editing a replicated transform locally is
|
|
13
|
+
* meaningless — the server overwrites it next snapshot).
|
|
14
|
+
*/
|
|
15
|
+
export function createColyseusNetworkingAdapter(cfg) {
|
|
16
|
+
const adapter = {
|
|
17
|
+
peers: () => cfg.peers(),
|
|
18
|
+
// The seam speaks node ids; `cfg.resolve` is the one crossing into Three's
|
|
19
|
+
// vocabulary. An unresolvable id behaves exactly like an unreplicated
|
|
20
|
+
// object — local authority, editable — rather than throwing or fabricating.
|
|
21
|
+
networkId: (nodeId) => {
|
|
22
|
+
const o = cfg.resolve(nodeId);
|
|
23
|
+
return o ? cfg.networkId(o) : null;
|
|
24
|
+
},
|
|
25
|
+
authority: (nodeId) => {
|
|
26
|
+
const o = cfg.resolve(nodeId);
|
|
27
|
+
if (!o || cfg.networkId(o) == null)
|
|
28
|
+
return 'local'; // not replicated → local authored
|
|
29
|
+
if (cfg.serverAuthoritative?.(o))
|
|
30
|
+
return 'server';
|
|
31
|
+
return cfg.ownerId(o) === cfg.localSessionId() ? 'local' : 'remote';
|
|
32
|
+
},
|
|
33
|
+
editable: (nodeId) => {
|
|
34
|
+
const o = cfg.resolve(nodeId);
|
|
35
|
+
if (!o || cfg.networkId(o) == null)
|
|
36
|
+
return true; // local authored object
|
|
37
|
+
if (cfg.serverAuthoritative?.(o))
|
|
38
|
+
return false; // server owns it → inspect-only
|
|
39
|
+
return cfg.ownerId(o) === cfg.localSessionId(); // only your own peer's objects
|
|
40
|
+
},
|
|
41
|
+
getConnectionState: () => cfg.connectionState?.() ?? 'disconnected',
|
|
42
|
+
getRoomInfo: () => cfg.roomInfo?.() ?? null,
|
|
43
|
+
getReplicationStats: () => cfg.replicationStats?.() ?? { entities: 0, msgsInPerSec: 0, msgsOutPerSec: 0 },
|
|
44
|
+
subscribe: (cb) => cfg.subscribe?.(cb) ?? (() => { }),
|
|
45
|
+
};
|
|
46
|
+
// The W3b inspector capabilities attach ONLY when supplied: their absence
|
|
47
|
+
// is the editor's degradation signal (`getStateSnapshot` in adapter ⇒ tree,
|
|
48
|
+
// missing ⇒ "not provided by this adapter" — never a fabricated empty).
|
|
49
|
+
const stateSnapshot = cfg.stateSnapshot?.bind(cfg);
|
|
50
|
+
if (stateSnapshot)
|
|
51
|
+
adapter.getStateSnapshot = () => stateSnapshot();
|
|
52
|
+
const messageEvents = cfg.messageEvents?.bind(cfg);
|
|
53
|
+
if (messageEvents)
|
|
54
|
+
adapter.messageEvents = (sinceSeq) => messageEvents(sinceSeq);
|
|
55
|
+
const rates = cfg.rates?.bind(cfg);
|
|
56
|
+
if (rates)
|
|
57
|
+
adapter.getRates = () => rates();
|
|
58
|
+
const getConditioning = cfg.getConditioning?.bind(cfg);
|
|
59
|
+
const setConditioning = cfg.setConditioning?.bind(cfg);
|
|
60
|
+
if (getConditioning && setConditioning) {
|
|
61
|
+
adapter.getConditioning = () => getConditioning();
|
|
62
|
+
adapter.setConditioning = (c) => setConditioning(c);
|
|
63
|
+
}
|
|
64
|
+
// Identity read and write are INDEPENDENTLY optional: a game may expose a
|
|
65
|
+
// read-only seat label (identity, no setter) or a settable name (both). The
|
|
66
|
+
// editor shows an editable field only when `setPlayerIdentity` is present.
|
|
67
|
+
const playerIdentity = cfg.playerIdentity?.bind(cfg);
|
|
68
|
+
if (playerIdentity) {
|
|
69
|
+
adapter.getPlayerIdentity = () => playerIdentity() ?? {};
|
|
70
|
+
}
|
|
71
|
+
const setPlayerIdentity = cfg.setPlayerIdentity?.bind(cfg);
|
|
72
|
+
if (setPlayerIdentity) {
|
|
73
|
+
adapter.setPlayerIdentity = (id) => setPlayerIdentity(id);
|
|
74
|
+
}
|
|
75
|
+
return adapter;
|
|
76
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party implementations of the remaining `SystemAdapters` — audio and
|
|
3
|
+
* navigation — each a thin coordination/introspection boundary over the real
|
|
4
|
+
* engine subsystem (the original vision named these as first-class System
|
|
5
|
+
* adapters; physics + networking shipped earlier). The editor speaks only the
|
|
6
|
+
* interfaces; these wrap the engine audio bus and `NavMeshManager` so an
|
|
7
|
+
* external game could supply its own equivalents. (The former
|
|
8
|
+
* `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
|
|
9
|
+
* removed by E5 — AnimGraph no longer exists. The former
|
|
10
|
+
* `createInputManagerAdapter`/`createVgaiAssetAdapter` went with
|
|
11
|
+
* `SystemAdapters.input`/`.assets` — registered, never read by anything.)
|
|
12
|
+
*/
|
|
13
|
+
import type { NavMeshManager } from '../ai/navigation';
|
|
14
|
+
import type { AudioContext as GameAudio } from '../setup/setup-audio';
|
|
15
|
+
import type { AudioAdapter, NavigationAdapter } from './system-adapter';
|
|
16
|
+
/** Release every meter tap still open on `adapter` (world stop / teardown). */
|
|
17
|
+
export declare function releaseAudioMeters(adapter: AudioAdapter): void;
|
|
18
|
+
export declare function createAudioSystemAdapter(audio: GameAudio): AudioAdapter;
|
|
19
|
+
/** First-party `NavigationAdapter` over the engine `NavMeshManager` — the
|
|
20
|
+
* blessed recast implementation, including the optional bake/export/crowd
|
|
21
|
+
* capabilities the editor's Navigation panel binds through. */
|
|
22
|
+
export declare function createNavigationAdapter(nav: NavMeshManager): NavigationAdapter;
|
|
23
|
+
//# sourceMappingURL=first-party-systems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-party-systems.d.ts","sourceRoot":"","sources":["../../src/adapter/first-party-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EACV,YAAY,EAIZ,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAmC1B,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAI9D;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAoIvE;AAED;;gEAEgE;AAChE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,CAS9E"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party implementations of the remaining `SystemAdapters` — audio and
|
|
3
|
+
* navigation — each a thin coordination/introspection boundary over the real
|
|
4
|
+
* engine subsystem (the original vision named these as first-class System
|
|
5
|
+
* adapters; physics + networking shipped earlier). The editor speaks only the
|
|
6
|
+
* interfaces; these wrap the engine audio bus and `NavMeshManager` so an
|
|
7
|
+
* external game could supply its own equivalents. (The former
|
|
8
|
+
* `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
|
|
9
|
+
* removed by E5 — AnimGraph no longer exists. The former
|
|
10
|
+
* `createInputManagerAdapter`/`createVgaiAssetAdapter` went with
|
|
11
|
+
* `SystemAdapters.input`/`.assets` — registered, never read by anything.)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* First-party `AudioAdapter` over the engine's master-gain bus
|
|
15
|
+
* (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
|
|
16
|
+
* (D10, T7.6) calls to silence a first-party world's audio. Restoring after a
|
|
17
|
+
* mute puts the gain back at whatever value it held right before muting (not
|
|
18
|
+
* a hardcoded `1`) — this composes correctly with an independent manual mute
|
|
19
|
+
* (the editor's `MuteButton`, `PlayBar.tsx`): pausing while already
|
|
20
|
+
* user-muted resumes muted, exactly as a user would expect.
|
|
21
|
+
*/
|
|
22
|
+
function audioNodeTypeName(value) {
|
|
23
|
+
const name = value.constructor?.name;
|
|
24
|
+
return name && name !== 'Object' ? name : 'AudioNode';
|
|
25
|
+
}
|
|
26
|
+
/** This world's real native context, when it has one (headless worlds do not). */
|
|
27
|
+
function nativeAudioContext(audio) {
|
|
28
|
+
const context = audio.listener?.context;
|
|
29
|
+
return context && typeof context.state === 'string'
|
|
30
|
+
? context
|
|
31
|
+
: null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Live meter handles per adapter, so a world teardown can release analyser
|
|
35
|
+
* taps a consumer forgot to dispose.
|
|
36
|
+
*
|
|
37
|
+
* This registry follows `acquireMeters` out of `audio-introspection.ts`: the
|
|
38
|
+
* safety net has to live wherever the taps are created, and they are created
|
|
39
|
+
* here now. Keyed weakly so an adapter that is simply dropped takes its entry
|
|
40
|
+
* with it.
|
|
41
|
+
*/
|
|
42
|
+
const meterHandlesByAdapter = new WeakMap();
|
|
43
|
+
/** Release every meter tap still open on `adapter` (world stop / teardown). */
|
|
44
|
+
export function releaseAudioMeters(adapter) {
|
|
45
|
+
const handles = meterHandlesByAdapter.get(adapter);
|
|
46
|
+
if (!handles)
|
|
47
|
+
return;
|
|
48
|
+
for (const handle of [...handles])
|
|
49
|
+
handle.dispose();
|
|
50
|
+
}
|
|
51
|
+
export function createAudioSystemAdapter(audio) {
|
|
52
|
+
let muted = false;
|
|
53
|
+
let priorGain = audio.masterGain.gain.value;
|
|
54
|
+
const liveMeterHandles = new Set();
|
|
55
|
+
const adapter = {
|
|
56
|
+
resume: () => audio.resume(),
|
|
57
|
+
setMuted(next) {
|
|
58
|
+
if (next === muted)
|
|
59
|
+
return;
|
|
60
|
+
muted = next;
|
|
61
|
+
if (next) {
|
|
62
|
+
priorGain = audio.masterGain.gain.value;
|
|
63
|
+
audio.masterGain.gain.value = 0;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
audio.masterGain.gain.value = priorGain;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
isMuted: () => muted,
|
|
70
|
+
/**
|
|
71
|
+
* The engine's own bus hierarchy.
|
|
72
|
+
*
|
|
73
|
+
* This lived in `audio-introspection.ts` — the Tone-backed module — which
|
|
74
|
+
* meant the editor could only ever show an audio graph for a game that had
|
|
75
|
+
* loaded Tone. Nothing here needs Tone: it is the destination, the master
|
|
76
|
+
* gain, the three engine buses and the THREE listener. The Tone half (nodes
|
|
77
|
+
* a game routed through `connectToneBusToMasterGain`) is APPENDED by that
|
|
78
|
+
* module when it attaches, which is the honest split — Tone routes are
|
|
79
|
+
* Tone's to report.
|
|
80
|
+
*/
|
|
81
|
+
graphSnapshot() {
|
|
82
|
+
const contextState = nativeAudioContext(audio)?.state;
|
|
83
|
+
const destination = {
|
|
84
|
+
id: 'destination',
|
|
85
|
+
type: 'AudioDestinationNode',
|
|
86
|
+
label: 'Output',
|
|
87
|
+
outputs: [],
|
|
88
|
+
};
|
|
89
|
+
if (contextState !== undefined)
|
|
90
|
+
destination.state = contextState;
|
|
91
|
+
const nodes = [
|
|
92
|
+
destination,
|
|
93
|
+
{
|
|
94
|
+
id: 'master',
|
|
95
|
+
type: audioNodeTypeName(audio.masterGain),
|
|
96
|
+
label: 'Master',
|
|
97
|
+
outputs: ['destination'],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'bus-music',
|
|
101
|
+
type: audioNodeTypeName(audio.buses.music),
|
|
102
|
+
label: 'Music bus',
|
|
103
|
+
outputs: ['master'],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'bus-sfx',
|
|
107
|
+
type: audioNodeTypeName(audio.buses.sfx),
|
|
108
|
+
label: 'SFX bus',
|
|
109
|
+
outputs: ['master'],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'bus-voice',
|
|
113
|
+
type: audioNodeTypeName(audio.buses.voice),
|
|
114
|
+
label: 'Voice bus',
|
|
115
|
+
outputs: ['master'],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
if (audio.listener) {
|
|
119
|
+
nodes.push({
|
|
120
|
+
id: 'listener',
|
|
121
|
+
type: audioNodeTypeName(audio.listener),
|
|
122
|
+
label: '3D listener (THREE)',
|
|
123
|
+
outputs: ['master'],
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return nodes;
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* Per-bus linear-RMS levels, via native `AnalyserNode` taps.
|
|
130
|
+
*
|
|
131
|
+
* Zero Tone — analysers work identically whether or not Tone is bridged,
|
|
132
|
+
* and disposal is a plain disconnect. It was in the Tone module purely by
|
|
133
|
+
* where it was written, so a game that never touches Tone had no meters.
|
|
134
|
+
*/
|
|
135
|
+
acquireMeters() {
|
|
136
|
+
const meterContext = nativeAudioContext(audio);
|
|
137
|
+
if (!meterContext || typeof meterContext.createAnalyser !== 'function') {
|
|
138
|
+
return null; // headless world — metering is impossible, and says so
|
|
139
|
+
}
|
|
140
|
+
const taps = [
|
|
141
|
+
['master', 'Master', audio.masterGain],
|
|
142
|
+
['bus-music', 'Music', audio.buses.music],
|
|
143
|
+
['bus-sfx', 'SFX', audio.buses.sfx],
|
|
144
|
+
['bus-voice', 'Voice', audio.buses.voice],
|
|
145
|
+
].map(([id, label, gain]) => {
|
|
146
|
+
const analyser = meterContext.createAnalyser();
|
|
147
|
+
analyser.fftSize = 1024;
|
|
148
|
+
gain.connect(analyser); // a TAP (analyser is a sink), not an insert
|
|
149
|
+
return { id, label, gain, analyser, buffer: new Float32Array(analyser.fftSize) };
|
|
150
|
+
});
|
|
151
|
+
let disposed = false;
|
|
152
|
+
const handle = {
|
|
153
|
+
read: () => taps.map(({ id, label, analyser, buffer }) => {
|
|
154
|
+
analyser.getFloatTimeDomainData(buffer);
|
|
155
|
+
let sum = 0;
|
|
156
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
157
|
+
const sample = buffer[i];
|
|
158
|
+
sum += sample * sample;
|
|
159
|
+
}
|
|
160
|
+
return { id, label, level: Math.sqrt(sum / buffer.length) };
|
|
161
|
+
}),
|
|
162
|
+
dispose: () => {
|
|
163
|
+
if (disposed)
|
|
164
|
+
return;
|
|
165
|
+
disposed = true;
|
|
166
|
+
for (const tap of taps) {
|
|
167
|
+
try {
|
|
168
|
+
tap.gain.disconnect(tap.analyser);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// already torn down with the context — nothing to release
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
liveMeterHandles.delete(handle);
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
liveMeterHandles.add(handle);
|
|
178
|
+
return handle;
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
meterHandlesByAdapter.set(adapter, liveMeterHandles);
|
|
182
|
+
return adapter;
|
|
183
|
+
}
|
|
184
|
+
/** First-party `NavigationAdapter` over the engine `NavMeshManager` — the
|
|
185
|
+
* blessed recast implementation, including the optional bake/export/crowd
|
|
186
|
+
* capabilities the editor's Navigation panel binds through. */
|
|
187
|
+
export function createNavigationAdapter(nav) {
|
|
188
|
+
return {
|
|
189
|
+
hasNavMesh: () => nav.hasNavMesh(),
|
|
190
|
+
findPath: (start, end) => nav.findPath(start, end),
|
|
191
|
+
debugMesh: (scene) => nav.getDebugMesh(scene),
|
|
192
|
+
bake: (meshes, params) => nav.buildFromMeshes(meshes, params),
|
|
193
|
+
exportData: () => nav.exportData(),
|
|
194
|
+
crowdAgents: () => nav.getCrowdAgents(),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host contexts — what the host hands a root when it mounts it, PER SURFACE.
|
|
3
|
+
*
|
|
4
|
+
* This generalizes the old `GameContext`, which baked in first-party system
|
|
5
|
+
* choices (a Rapier world, the postprocessing composer, the InputManager, …).
|
|
6
|
+
* The host never assumes Rapier/Colyseus; those live behind `SystemAdapters`
|
|
7
|
+
* owned by the first-party implementer.
|
|
8
|
+
*
|
|
9
|
+
* ## Why this file is a family, not one interface (P-8)
|
|
10
|
+
*
|
|
11
|
+
* There used to be a single "neutral" `HostContext` interface handed to EVERY
|
|
12
|
+
* root, with a NON-OPTIONAL `three: typeof THREE` and `renderer:
|
|
13
|
+
* THREE.WebGLRenderer` on it. That made the neutral layer three-LOCKED rather
|
|
14
|
+
* than merely three-named: a Pixi or React root would have been handed a WebGL
|
|
15
|
+
* renderer it cannot use. In practice nobody did hand it one — the production
|
|
16
|
+
* Pixi and React hosts have always built their own canvas/dom-shaped contexts
|
|
17
|
+
* instead — so the "one context for every surface"
|
|
18
|
+
* claim was already false in the tree; it just wasn't expressed in the types,
|
|
19
|
+
* which is why `RootAdapter<K>` could only parameterize its RETURN type and
|
|
20
|
+
* the Pixi/React adapters lived outside `RootAdapter` entirely.
|
|
21
|
+
*
|
|
22
|
+
* The split (ratified, docs/ARCHITECTURE-CORE.md "Seam"):
|
|
23
|
+
*
|
|
24
|
+
* {@link HostContextBase} what EVERY surface genuinely gets
|
|
25
|
+
* ├─ {@link ThreeHostContext} + `three` · `renderer` · `surface` · `assets`
|
|
26
|
+
* ├─ {@link CanvasHostContext} + `canvas`/`width`/`height` (+ dpr/compositing hints)
|
|
27
|
+
* └─ {@link DomHostContext} + `container`
|
|
28
|
+
*
|
|
29
|
+
* and {@link HostContextFor} maps an `AdapterSurface` to its context, so
|
|
30
|
+
* `RootAdapter<K>.mount`'s PARAMETER is K-typed too — the surface tag now
|
|
31
|
+
* picks the context type, which is the whole point of the tag.
|
|
32
|
+
*
|
|
33
|
+
* ### Where the line was drawn, and why
|
|
34
|
+
*
|
|
35
|
+
* The base holds exactly the members all three surfaces ALREADY carry today —
|
|
36
|
+
* nothing was invented to make the base look richer:
|
|
37
|
+
*
|
|
38
|
+
* - `game` — the root handle. Every surface has one (three: `ThreeHostContext.game`,
|
|
39
|
+
* canvas: `CanvasHostContext.game`, dom: `DomHostContext.game`), and it is the one
|
|
40
|
+
* genuinely surface-independent thing a host can hand any root.
|
|
41
|
+
* - `headless` — a property of the ENVIRONMENT (no GPU/DOM/audio), not of the
|
|
42
|
+
* render surface.
|
|
43
|
+
*
|
|
44
|
+
* Deliberately NOT in the base:
|
|
45
|
+
*
|
|
46
|
+
* - `renderer`/`three` — three's own objects; the defect this split exists to
|
|
47
|
+
* fix.
|
|
48
|
+
* - the render surface — its SHAPE is surface-specific and there is no honest
|
|
49
|
+
* common denominator: three nests `{canvas,width,height}` under `surface`,
|
|
50
|
+
* canvas passes those three flat (plus its own compositing hints), and a DOM
|
|
51
|
+
* root gets an `HTMLElement` container and no canvas at all. A shared
|
|
52
|
+
* `surface` field would have to be a union nobody can consume without
|
|
53
|
+
* re-branching on kind — i.e. the same three-shaped promise, one level down.
|
|
54
|
+
* - `assets` — `AssetCache`'s SIGNATURE reads neutral (`load<T>(url)`), but its
|
|
55
|
+
* one implementation is a GLTF/texture loader (`assets.ts` branches on
|
|
56
|
+
* `.glb`/`.gltf` and resolves THREE objects), and neither the canvas nor the
|
|
57
|
+
* dom host has ever been handed one: a canvas adapter builds its own
|
|
58
|
+
* cache inside `mount`. Promoting it to the base would be the anti-shim rule
|
|
59
|
+
* in miniature — a host promise nothing keeps. It stays on
|
|
60
|
+
* {@link ThreeHostContext} until a second surface genuinely receives one.
|
|
61
|
+
*
|
|
62
|
+
* These three names are the ONLY names for these shapes. The transitional
|
|
63
|
+
* aliases that carried the pre-split spellings were deleted; every implementer
|
|
64
|
+
* and call site names the surface it actually mounts on.
|
|
65
|
+
*
|
|
66
|
+
* It also used to carry `requestSystem<T extends keyof SystemRegistry>()` — an
|
|
67
|
+
* "ask the host for a first-party subsystem" hook — over an EMPTY
|
|
68
|
+
* `SystemRegistry`. That made `keyof SystemRegistry` = `never`, so no argument
|
|
69
|
+
* could legally be passed and the method was uncallable by construction. In
|
|
70
|
+
* practice it existed as 28 copies of `requestSystem: () => null` in tests and
|
|
71
|
+
* hosts, with no caller anywhere, and its only real effect would have been to
|
|
72
|
+
* re-open the door this interface exists to close: the host handing a game a
|
|
73
|
+
* subsystem it did not build. Deleted rather than kept as a promise.
|
|
74
|
+
*
|
|
75
|
+
* Migration note: `SetupThreeRootAdapter.mount` builds today's `GameContext`
|
|
76
|
+
* (Rapier world, composer, …) internally from a `ThreeHostContext`. New code
|
|
77
|
+
* targets these contexts; `GameContext` is now a first-party implementation
|
|
78
|
+
* detail.
|
|
79
|
+
*/
|
|
80
|
+
import type * as THREE from 'three';
|
|
81
|
+
import type { AssetCache } from '../assets';
|
|
82
|
+
import type { Game, GameInternal } from '../runtime/game';
|
|
83
|
+
import type { AdapterSurface } from './adapter-surface';
|
|
84
|
+
/** The canvas/container the game renders into, plus its size. */
|
|
85
|
+
export interface HostSurface {
|
|
86
|
+
readonly canvas: HTMLCanvasElement;
|
|
87
|
+
readonly width: number;
|
|
88
|
+
readonly height: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The surface-INDEPENDENT half of every host context — see this file's header
|
|
92
|
+
* for why only these two members earned a place here. Generic host code (a
|
|
93
|
+
* harness, a tier report, anything that must not care what it is mounting) can
|
|
94
|
+
* type against this; a real adapter always receives one of the per-surface
|
|
95
|
+
* contexts below.
|
|
96
|
+
*/
|
|
97
|
+
export interface HostContextBase {
|
|
98
|
+
/**
|
|
99
|
+
* The Game root (T7.1 slice 1 — D6). The host
|
|
100
|
+
* constructs the Game shell BEFORE mounting an adapter and hands it down
|
|
101
|
+
* here so an adapter can expose `ctx.game`/`ctx.roots` to the game it
|
|
102
|
+
* mounts. Absent in headless harnesses and foreign hosts that predate the
|
|
103
|
+
* Game root — everything must keep working when this is undefined (the
|
|
104
|
+
* zero-break guarantee for this slice). Typed as the PUBLIC `Game` shell
|
|
105
|
+
* here because that is the weakest promise any surface makes (a react
|
|
106
|
+
* root's host has always carried a plain `Game`); the three and canvas
|
|
107
|
+
* contexts narrow it to `GameInternal`, which is what their hosts really
|
|
108
|
+
* pass.
|
|
109
|
+
*/
|
|
110
|
+
readonly game?: Game | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* No GPU/DOM/audio available (Node conformance tests). A first-party adapter
|
|
113
|
+
* skips postprocessing/render/audio/input-map loading but still builds the
|
|
114
|
+
* scene + Rapier + components, so its scene/authoring/physics can be exercised
|
|
115
|
+
* headlessly. Browser hosts leave this false/undefined → full behavior.
|
|
116
|
+
*/
|
|
117
|
+
readonly headless?: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* What a `three`-surface root is handed. This is the ONLY context carrying
|
|
121
|
+
* three's own objects — the split's entire point (see the header): a Pixi or
|
|
122
|
+
* React root is never handed a `WebGLRenderer` it cannot use.
|
|
123
|
+
*/
|
|
124
|
+
export interface ThreeHostContext extends HostContextBase {
|
|
125
|
+
/** The ONE shared three instance — identity matters for capture (see ingest). */
|
|
126
|
+
readonly three: typeof THREE;
|
|
127
|
+
/** Canvas/container + size; a self-driven game may take the surface over. */
|
|
128
|
+
readonly surface: HostSurface;
|
|
129
|
+
/** Host renderer — host-driven games render through it. */
|
|
130
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
131
|
+
/** Shared GLTF/texture cache — three-flavored today; see the header. */
|
|
132
|
+
readonly assets: AssetCache;
|
|
133
|
+
readonly game?: GameInternal | undefined;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* What a `canvas`-surface root is handed: a raw canvas + its
|
|
137
|
+
* logical size, plus the
|
|
138
|
+
* compositing hints the multi-root host computes once for every stacked
|
|
139
|
+
* surface. No `three`, no `renderer`, no `assets` — a Pixi root builds its own
|
|
140
|
+
* `PIXI.Application` and its own asset cache from this.
|
|
141
|
+
*/
|
|
142
|
+
export interface CanvasHostContext extends HostContextBase {
|
|
143
|
+
readonly canvas: HTMLCanvasElement;
|
|
144
|
+
readonly width: number;
|
|
145
|
+
readonly height: number;
|
|
146
|
+
/** Shared Game root when mounted by the universal multi-root host. */
|
|
147
|
+
readonly game?: GameInternal | undefined;
|
|
148
|
+
/** DPR override (T6.1 slice 1, D5 §3 — "one DPR
|
|
149
|
+
* everywhere"): the roots-path host computes ONE dpr for every stacked
|
|
150
|
+
* surface and passes it here; omitted -> the canvas adapter's own
|
|
151
|
+
* default (`window.devicePixelRatio`, uncapped). */
|
|
152
|
+
readonly dpr?: number;
|
|
153
|
+
/** This root is stacked ABOVE another root (D5 §1): clear with alpha 0
|
|
154
|
+
* instead of an opaque background so the layer below shows through. */
|
|
155
|
+
readonly transparent?: boolean;
|
|
156
|
+
/** Capture tier cost (D5 §4) — the renderer's `preserveDrawingBuffer`. */
|
|
157
|
+
readonly preserveDrawingBuffer?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* What a `dom`-surface root is handed (the shape `runtime/create-runtime.ts`
|
|
161
|
+
* used to spell `ReactRootHost`).
|
|
162
|
+
*
|
|
163
|
+
* `container` is the absolutely-positioned, z-ordered DOM-root layer `<div>`
|
|
164
|
+
* the host already created and stacked (same box/z-order rules as a canvas per
|
|
165
|
+
* D5 §1) — the adapter's `mount` renders its react tree INTO
|
|
166
|
+
* this exact element via `createRoot`; it must never create its own root
|
|
167
|
+
* element (the DOM analog of three's "the root's runtime renders into the
|
|
168
|
+
* surface it is handed" rule).
|
|
169
|
+
*
|
|
170
|
+
* `game` (inherited, and deliberately still optional): a
|
|
171
|
+
* `default-react` sibling mounted BESIDE an ingest root (`packages/editor/src/
|
|
172
|
+
* ingest-siblings.ts`) has no native `Game` to hand it — there is no
|
|
173
|
+
* first-party `GameContext`/loop for the sibling to join, only the ingested
|
|
174
|
+
* root's own foreign runtime — so its host carries no `game` at all rather than
|
|
175
|
+
* fabricating an empty one (anti-shim rule); the sibling mounts its entry
|
|
176
|
+
* component bare, with no `<WorldProvider>` wrap. `mountOneReactRoot`
|
|
177
|
+
* (`runtime/create-runtime.ts`, the NATIVE multi-root runtime path) still
|
|
178
|
+
* ALWAYS supplies a real `game` — this optionality is reached only by the
|
|
179
|
+
* composite sibling's own hand-built host, never by weakening the native path's
|
|
180
|
+
* guarantee.
|
|
181
|
+
*/
|
|
182
|
+
export interface DomHostContext extends HostContextBase {
|
|
183
|
+
readonly container: HTMLElement;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Map an {@link AdapterSurface} to the host context that surface's roots are
|
|
187
|
+
* handed — the mirror image of `MountedRootFor<K>` (`root-adapter.ts`), and
|
|
188
|
+
* what makes `RootAdapter<K>.mount`'s PARAMETER K-typed. A hypothetical 4th
|
|
189
|
+
* surface resolves to `never` here, so it cannot be mounted until it declares
|
|
190
|
+
* its own context (the same fail-to-compile discipline `assertNever` gives the
|
|
191
|
+
* dispatch sites).
|
|
192
|
+
*/
|
|
193
|
+
export type HostContextFor<K extends AdapterSurface> = K extends 'three' ? ThreeHostContext : K extends 'canvas' ? CanvasHostContext : K extends 'dom' ? DomHostContext : never;
|
|
194
|
+
//# sourceMappingURL=host-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-context.d.ts","sourceRoot":"","sources":["../../src/adapter/host-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,UAAU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