@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.tsx +137 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// T3.1 slice 1 — Node-only path wrapper around `loadGameManifest` (§5).
|
|
2
|
+
//
|
|
3
|
+
// Kept in its own module (rather than folded into `load.ts`) so that
|
|
4
|
+
// `loadGameManifest` itself stays free of `node:fs` — anything that only
|
|
5
|
+
// needs the pure parse/resolve function (e.g. a future browser/hosted-editor
|
|
6
|
+
// caller) can import `./load` without pulling a Node-only module into its
|
|
7
|
+
// bundle.
|
|
8
|
+
import { readFileSync } from 'node:fs';
|
|
9
|
+
import { loadGameManifest } from './load';
|
|
10
|
+
import { resolveManifestPath } from './locate';
|
|
11
|
+
// The dual-name filesystem lookup lives in `./locate` (Zod-free on purpose);
|
|
12
|
+
// re-exported here so the common "load a project's manifest" import is one
|
|
13
|
+
// module.
|
|
14
|
+
export { hasManifest, manifestWritePath, resolveManifestPath } from './locate';
|
|
15
|
+
/** Read + JSON.parse `path`, then resolve it via `loadGameManifest`. Node-only. */
|
|
16
|
+
export function loadGameManifestFile(path) {
|
|
17
|
+
const raw = JSON.parse(readFileSync(path, 'utf-8'));
|
|
18
|
+
return loadGameManifest(raw);
|
|
19
|
+
}
|
|
20
|
+
/** {@link loadGameManifestFile} against `dir`'s `vgai.project.json`. */
|
|
21
|
+
export function loadGameManifestDir(dir) {
|
|
22
|
+
return loadGameManifestFile(resolveManifestPath(dir));
|
|
23
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type IngestStrategy, type LearnMetadata, type Tier } from './schema';
|
|
2
|
+
/** D6's resolved adapter identities. */
|
|
3
|
+
export type ResolvedAdapter = {
|
|
4
|
+
readonly type: 'builtin';
|
|
5
|
+
readonly identity: 'three' | 'canvas' | 'dom';
|
|
6
|
+
readonly surface: 'three' | 'canvas' | 'dom';
|
|
7
|
+
} | {
|
|
8
|
+
readonly type: 'module';
|
|
9
|
+
readonly identity: 'module';
|
|
10
|
+
readonly module: string;
|
|
11
|
+
readonly surface: 'three' | 'canvas' | 'dom';
|
|
12
|
+
} | {
|
|
13
|
+
readonly type: 'ingest';
|
|
14
|
+
readonly identity: 'ingest-three' | 'ingest-pixi' | 'ingest-react';
|
|
15
|
+
readonly surface: 'three' | 'canvas' | 'dom';
|
|
16
|
+
readonly strategy: IngestStrategy;
|
|
17
|
+
readonly entryHtml: string | undefined;
|
|
18
|
+
readonly assets: Record<string, string> | undefined;
|
|
19
|
+
readonly domStubs: string[] | undefined;
|
|
20
|
+
readonly captureTimeoutMs: number | undefined;
|
|
21
|
+
/** Iframe-reachable-multi mount fields. */
|
|
22
|
+
readonly bundleUrl: string | undefined;
|
|
23
|
+
readonly baseHref: string | undefined;
|
|
24
|
+
readonly assetBaseUrl: string | undefined;
|
|
25
|
+
readonly extraDeps: string[] | undefined;
|
|
26
|
+
readonly pixiModuleUrl: string | undefined;
|
|
27
|
+
readonly bodyHtml: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
export interface ResolvedAdapterRoot {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly surface: ResolvedAdapter['surface'];
|
|
32
|
+
readonly description: string | undefined;
|
|
33
|
+
readonly adapter: ResolvedAdapter;
|
|
34
|
+
readonly entry: string | undefined;
|
|
35
|
+
readonly zOrder: number;
|
|
36
|
+
readonly pausable: boolean;
|
|
37
|
+
/** `dev: true` — this root is a DEV LAYER, not shipped game content. See
|
|
38
|
+
* `manifest/schema.ts`'s `dev` field for the four readers. */
|
|
39
|
+
readonly dev: boolean;
|
|
40
|
+
readonly loop: 'gated' | 'self-driven';
|
|
41
|
+
/** Every optional resolved: both contexts always present (§4/§5). */
|
|
42
|
+
readonly capabilities: {
|
|
43
|
+
readonly local: Tier;
|
|
44
|
+
readonly hosted: Tier;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface ResolvedGameManifest {
|
|
48
|
+
readonly manifestVersion: 2;
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly appId: string | undefined;
|
|
51
|
+
readonly version: string;
|
|
52
|
+
readonly engine: {
|
|
53
|
+
readonly version: string;
|
|
54
|
+
};
|
|
55
|
+
/** Sorted by zOrder; ties broken by original array order (§3). */
|
|
56
|
+
readonly roots: readonly ResolvedAdapterRoot[];
|
|
57
|
+
readonly server: {
|
|
58
|
+
readonly room: string;
|
|
59
|
+
readonly module: string;
|
|
60
|
+
} | undefined;
|
|
61
|
+
readonly resolution: {
|
|
62
|
+
readonly width: number;
|
|
63
|
+
readonly height: number;
|
|
64
|
+
} | undefined;
|
|
65
|
+
readonly authoring: {
|
|
66
|
+
readonly hierarchy?: {
|
|
67
|
+
readonly rootLabels?: Readonly<Record<string, string>> | undefined;
|
|
68
|
+
readonly groups?: readonly {
|
|
69
|
+
readonly id: string;
|
|
70
|
+
readonly label: string;
|
|
71
|
+
readonly roots: readonly string[];
|
|
72
|
+
}[] | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
/** D18 — read by the debug-bridge installer to gate `?vgai-debug=1` in production builds. */
|
|
76
|
+
readonly debug: {
|
|
77
|
+
readonly allowInProduction: boolean;
|
|
78
|
+
} | undefined;
|
|
79
|
+
/** D15 — read by `mount-manifest.ts`'s boot-time seeding reader (gates
|
|
80
|
+
* whether `ctx.random` is seeded from `defaultSeed`/`?vgai-seed=`), the
|
|
81
|
+
* gameplay-rng-ban burn-down scan, and the dev-mode Math.random phase
|
|
82
|
+
* trap.. */
|
|
83
|
+
readonly determinism: {
|
|
84
|
+
readonly seededRandom: boolean;
|
|
85
|
+
readonly defaultSeed?: number | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
/** W3d (F11 perf gates) — read by `vgai perf --assert-budget`
|
|
88
|
+
* (packages/vgai-cli/src/perf.ts, assertBudget): each set metric is
|
|
89
|
+
* compared against the seeded headless perf run's measured value and any
|
|
90
|
+
* exceedance fails the gate with a per-metric table + nonzero exit. */
|
|
91
|
+
readonly budget: {
|
|
92
|
+
readonly frameCpuMsP95?: number | undefined;
|
|
93
|
+
readonly physicsMsP95?: number | undefined;
|
|
94
|
+
readonly maxEntities?: number | undefined;
|
|
95
|
+
readonly maxDrawCalls?: number | undefined;
|
|
96
|
+
readonly maxTriangles?: number | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
/** Learner-facing metadata on shipped example projects; read by the editor
|
|
99
|
+
* server's registry surface (`GET /__editor/examples`,
|
|
100
|
+
* packages/editor/server/editor-server.ts) to generate the
|
|
101
|
+
* gallery/wizard/Learn-catalog registries. */
|
|
102
|
+
readonly learn: LearnMetadata | undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Ceiling (maximum legal declared `Tier`) per adapter type and delivery
|
|
106
|
+
* context. `default` roots are always first-party in both contexts (D6/§2 —
|
|
107
|
+
* a first-party root is fully vgai-native everywhere). `ingest` roots are
|
|
108
|
+
* ceilinged by their own capture `strategy`: locally the local CLI's Vite
|
|
109
|
+
* pipeline gives bundler dedupe, so every strategy reaches its own natural
|
|
110
|
+
* rung; hosted has no bundler (esbuild-wasm + externals only), and a
|
|
111
|
+
* `deduped` root is DEFINED by being source built through our pipeline — no
|
|
112
|
+
* prebuilt bundle exists to fall back to an iframe rung, and nothing
|
|
113
|
+
* implements a hosted build for it, so hosted is `unsupported` (honesty over
|
|
114
|
+
* optimism; if the hosted esbuild-wasm path ever proves capable, raising
|
|
115
|
+
* this ceiling is a non-breaking widening). `shared`/`iframe-reachable`/
|
|
116
|
+
* `opaque-embed` don't depend on a bundler either way, so they carry through
|
|
117
|
+
* unchanged. `module` adapters have no derivable ceiling ("a custom
|
|
118
|
+
* adapter's reach is not derivable", §4) — modeled here as `first-party`
|
|
119
|
+
* (the top rank), i.e. no ceiling actually constrains a module adapter's
|
|
120
|
+
* declared tier; the loader instead requires the tier to be declared
|
|
121
|
+
* explicitly for module roots (see `resolveCapabilities`), since there is no
|
|
122
|
+
* default to derive.
|
|
123
|
+
*/
|
|
124
|
+
export declare const CAPABILITY_CEILINGS: {
|
|
125
|
+
readonly builtin: {
|
|
126
|
+
readonly local: "first-party";
|
|
127
|
+
readonly hosted: "first-party";
|
|
128
|
+
};
|
|
129
|
+
readonly ingest: {
|
|
130
|
+
readonly shared: {
|
|
131
|
+
readonly local: "shared";
|
|
132
|
+
readonly hosted: "shared";
|
|
133
|
+
};
|
|
134
|
+
readonly deduped: {
|
|
135
|
+
readonly local: "deduped";
|
|
136
|
+
readonly hosted: "unsupported";
|
|
137
|
+
};
|
|
138
|
+
readonly 'iframe-reachable': {
|
|
139
|
+
readonly local: "iframe-reachable";
|
|
140
|
+
readonly hosted: "iframe-reachable";
|
|
141
|
+
};
|
|
142
|
+
readonly 'opaque-embed': {
|
|
143
|
+
readonly local: "opaque-embed";
|
|
144
|
+
readonly hosted: "opaque-embed";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
readonly module: {
|
|
148
|
+
readonly local: "first-party";
|
|
149
|
+
readonly hosted: "first-party";
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
/** Default relative path for `server.module` when omitted (§3) — the scaffolded Colyseus bootstrap. */
|
|
153
|
+
export declare const DEFAULT_SERVER_MODULE = "server/colyseus-setup.ts";
|
|
154
|
+
/**
|
|
155
|
+
* Parse + validate + resolve a raw manifest value into a `ResolvedGameManifest`.
|
|
156
|
+
* Pure data-in/data-out (no `fs`) — see `load-file.ts` for the Node path-based
|
|
157
|
+
* wrapper. Throws a descriptive `Error` (naming the offending root/field) on
|
|
158
|
+
* any Zod validation failure or cross-field rule violation.
|
|
159
|
+
*/
|
|
160
|
+
export declare function loadGameManifest(raw: unknown): ResolvedGameManifest;
|
|
161
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/manifest/load.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,IAAI,EACV,MAAM,UAAU,CAAC;AAMlB,wCAAwC;AACxC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IACd;;;mDAG+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;CAC3C;AAOD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAY/B,CAAC;AAYF,uGAAuG;AACvG,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAyLhE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAwDnE"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
// The game manifest loader/validator.
|
|
2
|
+
//
|
|
3
|
+
// Pure data-in/data-out: `loadGameManifest(raw)` parses `raw` against
|
|
4
|
+
// `GameManifestSchema`, runs the cross-field checks §3 promises beyond what
|
|
5
|
+
// Zod alone can express, resolves every optional/derivable field, and
|
|
6
|
+
// returns a `ResolvedGameManifest` with nothing left implicit. This is the
|
|
7
|
+
// schema's runtime reader (T4.1 policy) — every described field in
|
|
8
|
+
// `schema.ts` either drives a check here or is carried into the resolved
|
|
9
|
+
// output explicitly (see the per-field comments below and
|
|
10
|
+
// `packages/engine/test/schema-consumption-map.ts`'s `manifest.*` entries).
|
|
11
|
+
//
|
|
12
|
+
// No `fs` import here on purpose — `load-file.ts` is the thin Node-only
|
|
13
|
+
// wrapper that reads a path and calls this function, so browser bundles that
|
|
14
|
+
// only need `loadGameManifest` never pull in `node:fs`.
|
|
15
|
+
import { GameManifestSchema, } from './schema';
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// §4 — the per-context ceiling table (named + exported so the tier-table test
|
|
18
|
+
// can pin its rows against this).
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
/**
|
|
21
|
+
* Ceiling (maximum legal declared `Tier`) per adapter type and delivery
|
|
22
|
+
* context. `default` roots are always first-party in both contexts (D6/§2 —
|
|
23
|
+
* a first-party root is fully vgai-native everywhere). `ingest` roots are
|
|
24
|
+
* ceilinged by their own capture `strategy`: locally the local CLI's Vite
|
|
25
|
+
* pipeline gives bundler dedupe, so every strategy reaches its own natural
|
|
26
|
+
* rung; hosted has no bundler (esbuild-wasm + externals only), and a
|
|
27
|
+
* `deduped` root is DEFINED by being source built through our pipeline — no
|
|
28
|
+
* prebuilt bundle exists to fall back to an iframe rung, and nothing
|
|
29
|
+
* implements a hosted build for it, so hosted is `unsupported` (honesty over
|
|
30
|
+
* optimism; if the hosted esbuild-wasm path ever proves capable, raising
|
|
31
|
+
* this ceiling is a non-breaking widening). `shared`/`iframe-reachable`/
|
|
32
|
+
* `opaque-embed` don't depend on a bundler either way, so they carry through
|
|
33
|
+
* unchanged. `module` adapters have no derivable ceiling ("a custom
|
|
34
|
+
* adapter's reach is not derivable", §4) — modeled here as `first-party`
|
|
35
|
+
* (the top rank), i.e. no ceiling actually constrains a module adapter's
|
|
36
|
+
* declared tier; the loader instead requires the tier to be declared
|
|
37
|
+
* explicitly for module roots (see `resolveCapabilities`), since there is no
|
|
38
|
+
* default to derive.
|
|
39
|
+
*/
|
|
40
|
+
export const CAPABILITY_CEILINGS = {
|
|
41
|
+
builtin: { local: 'first-party', hosted: 'first-party' },
|
|
42
|
+
ingest: {
|
|
43
|
+
shared: { local: 'shared', hosted: 'shared' },
|
|
44
|
+
deduped: { local: 'deduped', hosted: 'unsupported' },
|
|
45
|
+
'iframe-reachable': { local: 'iframe-reachable', hosted: 'iframe-reachable' },
|
|
46
|
+
'opaque-embed': { local: 'opaque-embed', hosted: 'opaque-embed' },
|
|
47
|
+
},
|
|
48
|
+
module: { local: 'first-party', hosted: 'first-party' },
|
|
49
|
+
};
|
|
50
|
+
/** Total order over `Tier` (§4: `first-party > shared ≈ deduped > iframe-reachable > opaque-embed > unsupported`). */
|
|
51
|
+
const TIER_RANK = {
|
|
52
|
+
'first-party': 5,
|
|
53
|
+
shared: 4,
|
|
54
|
+
deduped: 4,
|
|
55
|
+
'iframe-reachable': 3,
|
|
56
|
+
'opaque-embed': 2,
|
|
57
|
+
unsupported: 1,
|
|
58
|
+
};
|
|
59
|
+
/** Default relative path for `server.module` when omitted (§3) — the scaffolded Colyseus bootstrap. */
|
|
60
|
+
export const DEFAULT_SERVER_MODULE = 'server/colyseus-setup.ts';
|
|
61
|
+
const SEMVER_RE = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?(?:\+[0-9A-Za-z-.]+)?$/;
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// Adapter shape guards
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
function isModuleAdapter(adapter) {
|
|
66
|
+
return typeof adapter === 'object' && 'module' in adapter;
|
|
67
|
+
}
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// Cross-field checks (§3 — beyond what Zod alone enforces)
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
//
|
|
72
|
+
// Root-id uniqueness used to be a cross-field check HERE
|
|
73
|
+
// (`checkUniqueRootIds`, removed) — it moved INTO `GameManifestSchema`'s
|
|
74
|
+
// `roots` `superRefine` (schema.ts) instead, so the generated JSON Schema and
|
|
75
|
+
// any other schema consumer see the same constraint the loader always
|
|
76
|
+
// enforced. `parseManifest` below catches that one recognizable schema-level
|
|
77
|
+
// issue and rethrows it as a clean, single `Error` — the exact message shape
|
|
78
|
+
// `checkUniqueRootIds` used to throw directly — rather than a raw multi-issue
|
|
79
|
+
// `ZodError` dump, so existing callers/tests that pattern-match the message
|
|
80
|
+
// text are unaffected by the enforcement moving one layer down.
|
|
81
|
+
function checkAdapterEntryRules(root) {
|
|
82
|
+
const { adapter } = root;
|
|
83
|
+
if (typeof adapter === 'string' && !root.entry) {
|
|
84
|
+
throw new Error(`Game manifest: root "${root.id}" uses the '${adapter}' adapter but declares no ` +
|
|
85
|
+
'`entry` — a built-in adapter root is authored as an entry module.');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Historical note (Track N, N1): this file used to reject EVERY `kind:
|
|
89
|
+
// 'react'` + `{ ingest }` root outright here (`checkReactAdapterRestriction`,
|
|
90
|
+
// citing "no react ingest program is un-parked"). Track N un-parks exactly
|
|
91
|
+
// that program — react+ingest is now a structurally legal combination,
|
|
92
|
+
// resolved to the `'ingest-react'` identity by `resolveAdapter` below like
|
|
93
|
+
// any other ingest root. There is nothing left to reject at THIS layer: the
|
|
94
|
+
// v1 "deduped strategy only" restriction is an editor-resolver concern (D-N3),
|
|
95
|
+
// not a manifest-shape concern — see the `ResolvedAdapter` type's comment
|
|
96
|
+
// above.
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Resolution (§5)
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
function resolveAdapter(root) {
|
|
101
|
+
const { adapter } = root;
|
|
102
|
+
if (typeof adapter === 'string') {
|
|
103
|
+
return { type: 'builtin', identity: adapter, surface: adapter };
|
|
104
|
+
}
|
|
105
|
+
if (isModuleAdapter(adapter)) {
|
|
106
|
+
return {
|
|
107
|
+
type: 'module',
|
|
108
|
+
identity: 'module',
|
|
109
|
+
module: adapter.module,
|
|
110
|
+
surface: adapter.surface,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// isIngestAdapter (Track N, N1: 'ingest-react' joins 'ingest-three'/
|
|
114
|
+
// 'ingest-pixi' — see the `ResolvedAdapter` type's comment above for why
|
|
115
|
+
// this stays strategy-agnostic here).
|
|
116
|
+
const identity = adapter.surface === 'three'
|
|
117
|
+
? 'ingest-three'
|
|
118
|
+
: adapter.surface === 'canvas'
|
|
119
|
+
? 'ingest-pixi'
|
|
120
|
+
: 'ingest-react';
|
|
121
|
+
const ingest = adapter.ingest;
|
|
122
|
+
return {
|
|
123
|
+
type: 'ingest',
|
|
124
|
+
identity,
|
|
125
|
+
surface: adapter.surface,
|
|
126
|
+
strategy: ingest.strategy,
|
|
127
|
+
entryHtml: ingest.entryHtml,
|
|
128
|
+
assets: ingest.assets,
|
|
129
|
+
domStubs: ingest.domStubs,
|
|
130
|
+
captureTimeoutMs: ingest.captureTimeoutMs,
|
|
131
|
+
bundleUrl: ingest.bundleUrl,
|
|
132
|
+
baseHref: ingest.baseHref,
|
|
133
|
+
assetBaseUrl: ingest.assetBaseUrl,
|
|
134
|
+
extraDeps: ingest.extraDeps,
|
|
135
|
+
pixiModuleUrl: ingest.pixiModuleUrl,
|
|
136
|
+
bodyHtml: ingest.bodyHtml,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function ceilingFor(adapter, context) {
|
|
140
|
+
if (typeof adapter === 'string')
|
|
141
|
+
return CAPABILITY_CEILINGS.builtin[context];
|
|
142
|
+
if (isModuleAdapter(adapter))
|
|
143
|
+
return CAPABILITY_CEILINGS.module[context];
|
|
144
|
+
return CAPABILITY_CEILINGS.ingest[adapter.ingest.strategy][context];
|
|
145
|
+
}
|
|
146
|
+
function resolveCapabilities(root) {
|
|
147
|
+
const contexts = ['local', 'hosted'];
|
|
148
|
+
const result = {};
|
|
149
|
+
for (const context of contexts) {
|
|
150
|
+
const declared = root.capabilities?.[context];
|
|
151
|
+
if (declared !== undefined) {
|
|
152
|
+
const ceiling = ceilingFor(root.adapter, context);
|
|
153
|
+
if (TIER_RANK[declared] > TIER_RANK[ceiling]) {
|
|
154
|
+
throw new Error(`Game manifest: root "${root.id}": declared capabilities.${context} tier "${declared}" ` +
|
|
155
|
+
`exceeds the "${ceiling}" ceiling for this adapter in the ${context} context (§4). ` +
|
|
156
|
+
'Under-claiming (including `unsupported`) is legal; over-claiming is not.');
|
|
157
|
+
}
|
|
158
|
+
result[context] = declared;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
// Omitted -> derive.
|
|
162
|
+
if (typeof root.adapter === 'string') {
|
|
163
|
+
result[context] = 'first-party';
|
|
164
|
+
}
|
|
165
|
+
else if (isModuleAdapter(root.adapter)) {
|
|
166
|
+
throw new Error(`Game manifest: root "${root.id}": { module } adapter requires an explicit ` +
|
|
167
|
+
`capabilities.${context} declaration — a custom adapter's reach is not derivable (§4).`);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
result[context] = CAPABILITY_CEILINGS.ingest[root.adapter.ingest.strategy][context];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
175
|
+
function checkEngineVersionPin(version) {
|
|
176
|
+
if (!SEMVER_RE.test(version)) {
|
|
177
|
+
throw new Error(`Game manifest: engine.version "${version}" is not a valid exact semver string (e.g. ` +
|
|
178
|
+
'"0.1.0") — §1.5 requires an exact identity pin, not a range.');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Resolve one already-Zod-validated root entry into its `ResolvedAdapterRoot`
|
|
183
|
+
* (adapter identity, capabilities, and a pass-through of every other field).
|
|
184
|
+
* Every `AdapterRoot` field participates here or in a check above:
|
|
185
|
+
* `id` drives uniqueness; `adapter` (incl. its surface and
|
|
186
|
+
* `module`/`ingest.*` sub-fields) drives identity + capability-ceiling
|
|
187
|
+
* resolution; `entry` drives the entry cross-field rule and is
|
|
188
|
+
* carried through; `zOrder` drives the final sort; `pausable`/`loop` are
|
|
189
|
+
* carried through as-is (their consumers are the runtime/CLI, T3.2/T3.3);
|
|
190
|
+
* `dev` is carried through for the four dev-layer readers (`mountManifestRoots`'s
|
|
191
|
+
* ship gate, the host's topmost stacking pass, the play compositor's capture
|
|
192
|
+
* exclusion, and the editor's chrome-not-content seam);
|
|
193
|
+
* `capabilities.{local,hosted}` drive tier resolution; `description` (T3.3
|
|
194
|
+
* slice 3) is carried through as-is — its consumer today is
|
|
195
|
+
* `resolveIngestDescriptor` (packages/editor/src/adapter-resolver.ts), which
|
|
196
|
+
* threads an ingest-three root's description into `IngestGame.description`.
|
|
197
|
+
*/
|
|
198
|
+
function resolveRoot(root) {
|
|
199
|
+
checkAdapterEntryRules(root);
|
|
200
|
+
const adapter = resolveAdapter(root);
|
|
201
|
+
return {
|
|
202
|
+
id: root.id,
|
|
203
|
+
surface: adapter.surface,
|
|
204
|
+
description: root.description,
|
|
205
|
+
adapter,
|
|
206
|
+
entry: root.entry,
|
|
207
|
+
zOrder: root.zOrder,
|
|
208
|
+
pausable: root.pausable,
|
|
209
|
+
dev: root.dev,
|
|
210
|
+
loop: root.loop,
|
|
211
|
+
capabilities: resolveCapabilities(root),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
// Entry point
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
217
|
+
/**
|
|
218
|
+
* Parse + validate + resolve a raw manifest value into a `ResolvedGameManifest`.
|
|
219
|
+
* Pure data-in/data-out (no `fs`) — see `load-file.ts` for the Node path-based
|
|
220
|
+
* wrapper. Throws a descriptive `Error` (naming the offending root/field) on
|
|
221
|
+
* any Zod validation failure or cross-field rule violation.
|
|
222
|
+
*/
|
|
223
|
+
export function loadGameManifest(raw) {
|
|
224
|
+
// Removed-format guard FIRST, on the raw value: a legacy `.vscn.json` root
|
|
225
|
+
// would otherwise fail Zod's `roots` discriminated union with a confusing
|
|
226
|
+
// shape error instead of a migration message (WO-8).
|
|
227
|
+
const parsed = GameManifestSchema.safeParse(raw);
|
|
228
|
+
if (!parsed.success) {
|
|
229
|
+
// D-V6: the `roots` `superRefine`'s composition issues — a duplicate root
|
|
230
|
+
// id, or more than one world root of the same medium — are the
|
|
231
|
+
// schema-level violations this loader surfaces as a clean, single `Error`
|
|
232
|
+
// (matching `checkUniqueRootIds`'s pre-D-V6 message shape) rather than a
|
|
233
|
+
// raw multi-issue dump, because each one already reads as a finished
|
|
234
|
+
// sentence naming the offending ids. Every other schema violation keeps
|
|
235
|
+
// propagating as the raw `ZodError` it always has (unchanged behavior,
|
|
236
|
+
// e.g. the iframe-reachable field-exclusivity / manifestVersion checks).
|
|
237
|
+
const compositionIssue = parsed.error.issues.find((issue) => issue.message.startsWith('Game manifest: duplicate root id') ||
|
|
238
|
+
issue.message.startsWith('Game manifest: a project has at most one'));
|
|
239
|
+
if (compositionIssue)
|
|
240
|
+
throw new Error(compositionIssue.message);
|
|
241
|
+
throw parsed.error;
|
|
242
|
+
}
|
|
243
|
+
const manifest = parsed.data;
|
|
244
|
+
checkEngineVersionPin(manifest.engine.version);
|
|
245
|
+
const resolvedWithIndex = manifest.roots.map((root, index) => ({
|
|
246
|
+
root: resolveRoot(root),
|
|
247
|
+
index,
|
|
248
|
+
}));
|
|
249
|
+
resolvedWithIndex.sort((a, b) => a.root.zOrder - b.root.zOrder || a.index - b.index);
|
|
250
|
+
const roots = resolvedWithIndex.map(({ root }) => root);
|
|
251
|
+
const server = manifest.server
|
|
252
|
+
? { room: manifest.server.room, module: manifest.server.module ?? DEFAULT_SERVER_MODULE }
|
|
253
|
+
: undefined;
|
|
254
|
+
return {
|
|
255
|
+
manifestVersion: manifest.manifestVersion,
|
|
256
|
+
name: manifest.name,
|
|
257
|
+
appId: manifest.appId,
|
|
258
|
+
version: manifest.version,
|
|
259
|
+
engine: { version: manifest.engine.version },
|
|
260
|
+
roots,
|
|
261
|
+
server,
|
|
262
|
+
resolution: manifest.resolution,
|
|
263
|
+
authoring: manifest.authoring,
|
|
264
|
+
debug: manifest.debug,
|
|
265
|
+
determinism: manifest.determinism,
|
|
266
|
+
budget: manifest.budget,
|
|
267
|
+
learn: manifest.learn,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throw the rename instruction if `dir` carries only the REMOVED manifest
|
|
3
|
+
* filename. The `assertNoRemoved*` shape: a removed thing must reject loudly
|
|
4
|
+
* naming the exact fix, never be silently ignored (which would present as
|
|
5
|
+
* "this folder is not a project" — a diagnosis pointing nowhere).
|
|
6
|
+
*
|
|
7
|
+
* Returns normally when `dir` holds the current manifest, or neither file.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertNoRemovedManifestFilename(dir: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* The manifest path inside `dir`. Always `vgai.project.json` — so a "not
|
|
12
|
+
* found" message names the filename a project must be using — except that a
|
|
13
|
+
* directory carrying only the removed `vgai.game.json` THROWS the rename
|
|
14
|
+
* instruction instead of reporting a phantom path.
|
|
15
|
+
*
|
|
16
|
+
* This is the drop-in replacement for a hand-written `join(dir, …)` everywhere
|
|
17
|
+
* a manifest is READ. Writers want {@link manifestWritePath}.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveManifestPath(dir: string): string;
|
|
20
|
+
/** True when `dir` holds a manifest. A lone `vgai.game.json` throws. */
|
|
21
|
+
export declare function hasManifest(dir: string): boolean;
|
|
22
|
+
/** Where a manifest gets WRITTEN in `dir`. There is one answer. */
|
|
23
|
+
export declare function manifestWritePath(dir: string): string;
|
|
24
|
+
//# sourceMappingURL=locate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../src/manifest/locate.ts"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAIjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Finding the project manifest ON DISK. There is ONE filename — see
|
|
2
|
+
// `./filename.ts` for why the old one was removed rather than kept readable.
|
|
3
|
+
//
|
|
4
|
+
// Deliberately dependency-light — `node:fs` + `node:path` + `./filename` and
|
|
5
|
+
// NOTHING else (no Zod, no `./load`). Several callers are explicitly
|
|
6
|
+
// schema-free by design (`packages/editor/server/project-root-surface.ts`,
|
|
7
|
+
// `packages/editor/vite-plugin-ui-oid.ts`) and must be able to locate a
|
|
8
|
+
// manifest without dragging the validator in.
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { MANIFEST_FILENAME, REMOVED_MANIFEST_FILENAME, removedManifestFilenameMessage, } from './filename';
|
|
12
|
+
/**
|
|
13
|
+
* Throw the rename instruction if `dir` carries only the REMOVED manifest
|
|
14
|
+
* filename. The `assertNoRemoved*` shape: a removed thing must reject loudly
|
|
15
|
+
* naming the exact fix, never be silently ignored (which would present as
|
|
16
|
+
* "this folder is not a project" — a diagnosis pointing nowhere).
|
|
17
|
+
*
|
|
18
|
+
* Returns normally when `dir` holds the current manifest, or neither file.
|
|
19
|
+
*/
|
|
20
|
+
export function assertNoRemovedManifestFilename(dir) {
|
|
21
|
+
if (existsSync(join(dir, MANIFEST_FILENAME)))
|
|
22
|
+
return;
|
|
23
|
+
if (!existsSync(join(dir, REMOVED_MANIFEST_FILENAME)))
|
|
24
|
+
return;
|
|
25
|
+
throw new Error(removedManifestFilenameMessage(join(dir, REMOVED_MANIFEST_FILENAME)));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The manifest path inside `dir`. Always `vgai.project.json` — so a "not
|
|
29
|
+
* found" message names the filename a project must be using — except that a
|
|
30
|
+
* directory carrying only the removed `vgai.game.json` THROWS the rename
|
|
31
|
+
* instruction instead of reporting a phantom path.
|
|
32
|
+
*
|
|
33
|
+
* This is the drop-in replacement for a hand-written `join(dir, …)` everywhere
|
|
34
|
+
* a manifest is READ. Writers want {@link manifestWritePath}.
|
|
35
|
+
*/
|
|
36
|
+
export function resolveManifestPath(dir) {
|
|
37
|
+
assertNoRemovedManifestFilename(dir);
|
|
38
|
+
return join(dir, MANIFEST_FILENAME);
|
|
39
|
+
}
|
|
40
|
+
/** True when `dir` holds a manifest. A lone `vgai.game.json` throws. */
|
|
41
|
+
export function hasManifest(dir) {
|
|
42
|
+
assertNoRemovedManifestFilename(dir);
|
|
43
|
+
return existsSync(join(dir, MANIFEST_FILENAME));
|
|
44
|
+
}
|
|
45
|
+
/** Where a manifest gets WRITTEN in `dir`. There is one answer. */
|
|
46
|
+
export function manifestWritePath(dir) {
|
|
47
|
+
return join(dir, MANIFEST_FILENAME);
|
|
48
|
+
}
|