@vgai/engine 0.2.0 → 0.3.0
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/README.md +3 -1
- package/dist/adapter/authoring.d.ts +404 -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 +43 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
- package/dist/adapter/colyseus-networking-adapter.js +38 -0
- package/dist/adapter/first-party-systems.d.ts +38 -0
- package/dist/adapter/first-party-systems.d.ts.map +1 -0
- package/dist/adapter/first-party-systems.js +77 -0
- package/dist/adapter/game-adapter.d.ts +133 -0
- package/dist/adapter/game-adapter.d.ts.map +1 -0
- package/dist/adapter/game-adapter.js +10 -0
- package/dist/adapter/host-context.d.ts +73 -0
- package/dist/adapter/host-context.d.ts.map +1 -0
- package/dist/adapter/host-context.js +16 -0
- package/dist/adapter/index.d.ts +22 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +15 -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/overlay-applier.d.ts +118 -0
- package/dist/adapter/ingest/overlay-applier.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-applier.js +132 -0
- package/dist/adapter/ingest/overlay-apply.d.ts +60 -0
- package/dist/adapter/ingest/overlay-apply.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-apply.js +101 -0
- package/dist/adapter/ingest/overlay-file.d.ts +79 -0
- package/dist/adapter/ingest/overlay-file.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-file.js +66 -0
- package/dist/adapter/ingest/overlay-report.d.ts +113 -0
- package/dist/adapter/ingest/overlay-report.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-report.js +103 -0
- package/dist/adapter/ingest/scene-capture.d.ts +97 -0
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
- package/dist/adapter/ingest/scene-capture.js +248 -0
- package/dist/adapter/ingest/upstream-pin.d.ts +47 -0
- package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
- package/dist/adapter/ingest/upstream-pin.js +50 -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 +12 -0
- package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
- package/dist/adapter/rapier-physics-adapter.js +46 -0
- package/dist/adapter/system-adapter.d.ts +133 -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/adapter/vgai-scene-game-adapter.d.ts +116 -0
- package/dist/adapter/vgai-scene-game-adapter.d.ts.map +1 -0
- package/dist/adapter/vgai-scene-game-adapter.js +714 -0
- package/dist/adapter/world-kind.d.ts +30 -0
- package/dist/adapter/world-kind.d.ts.map +1 -0
- package/dist/adapter/world-kind.js +18 -0
- package/dist/ai/navigation.d.ts +64 -0
- package/dist/ai/navigation.d.ts.map +1 -0
- package/dist/ai/navigation.js +133 -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 +250 -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 +37 -0
- package/dist/animation/gsap-registration.d.ts +119 -0
- package/dist/animation/gsap-registration.d.ts.map +1 -0
- package/dist/animation/gsap-registration.js +92 -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 +242 -0
- package/dist/animation/theatre-director.d.ts.map +1 -0
- package/dist/animation/theatre-director.js +235 -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 +111 -0
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
- package/dist/animation/xstate-animation-binding.js +307 -0
- package/dist/animation/xstate-animation-meta.d.ts +228 -0
- package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
- package/dist/animation/xstate-animation-meta.js +221 -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/index.d.ts +4 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +24 -0
- package/dist/audio/tone-clock-binding.d.ts +75 -0
- package/dist/audio/tone-clock-binding.d.ts.map +1 -0
- package/dist/audio/tone-clock-binding.js +29 -0
- package/dist/audio/tone-context.d.ts +114 -0
- package/dist/audio/tone-context.d.ts.map +1 -0
- package/dist/audio/tone-context.js +39 -0
- package/dist/audio/tone-offline-render.d.ts +90 -0
- package/dist/audio/tone-offline-render.d.ts.map +1 -0
- package/dist/audio/tone-offline-render.js +56 -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/core/game-loop.d.ts +21 -0
- package/dist/core/game-loop.d.ts.map +1 -0
- package/dist/core/game-loop.js +130 -0
- package/dist/core/system-runner.d.ts +120 -0
- package/dist/core/system-runner.d.ts.map +1 -0
- package/dist/core/system-runner.js +286 -0
- package/dist/core/types.d.ts +58 -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 +110 -0
- package/dist/data/data-check-core.d.ts.map +1 -0
- package/dist/data/data-check-core.js +178 -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/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/logger.d.ts +30 -0
- package/dist/dev/logger.d.ts.map +1 -0
- package/dist/dev/logger.js +90 -0
- package/dist/ecs/component-manager.d.ts +189 -0
- package/dist/ecs/component-manager.d.ts.map +1 -0
- package/dist/ecs/component-manager.js +676 -0
- package/dist/ecs/game-component.d.ts +97 -0
- package/dist/ecs/game-component.d.ts.map +1 -0
- package/dist/ecs/game-component.js +80 -0
- package/dist/ecs/hmr-swap-report.d.ts +53 -0
- package/dist/ecs/hmr-swap-report.d.ts.map +1 -0
- package/dist/ecs/hmr-swap-report.js +55 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/input/input-manager.d.ts +596 -0
- package/dist/input/input-manager.d.ts.map +1 -0
- package/dist/input/input-manager.js +1564 -0
- package/dist/input/input-types.d.ts +171 -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 +43 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +59 -0
- package/dist/manifest/index.d.ts +5 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +8 -0
- package/dist/manifest/load-file.d.ts +4 -0
- package/dist/manifest/load-file.d.ts.map +1 -0
- package/dist/manifest/load-file.js +14 -0
- package/dist/manifest/load.d.ts +117 -0
- package/dist/manifest/load.d.ts.map +1 -0
- package/dist/manifest/load.js +255 -0
- package/dist/manifest/schema.d.ts +173 -0
- package/dist/manifest/schema.d.ts.map +1 -0
- package/dist/manifest/schema.js +302 -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/physics/trigger-dispatch.d.ts +24 -0
- package/dist/physics/trigger-dispatch.d.ts.map +1 -0
- package/dist/physics/trigger-dispatch.js +80 -0
- package/dist/react/game-state.d.ts +105 -0
- package/dist/react/game-state.d.ts.map +1 -0
- package/dist/react/game-state.js +144 -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 +96 -0
- package/dist/react/use-selection.d.ts +75 -0
- package/dist/react/use-selection.d.ts.map +1 -0
- package/dist/react/use-selection.js +90 -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/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 +230 -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 +36 -0
- package/dist/render/render-settings.d.ts.map +1 -0
- package/dist/render/render-settings.js +51 -0
- package/dist/runtime/create-runtime.d.ts +280 -0
- package/dist/runtime/create-runtime.d.ts.map +1 -0
- package/dist/runtime/create-runtime.js +795 -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 +433 -0
- package/dist/runtime/game.d.ts.map +1 -0
- package/dist/runtime/game.js +569 -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 +129 -0
- package/dist/runtime/mount-game.d.ts.map +1 -0
- package/dist/runtime/mount-game.js +152 -0
- package/dist/runtime/mount-manifest.d.ts +119 -0
- package/dist/runtime/mount-manifest.d.ts.map +1 -0
- package/dist/runtime/mount-manifest.js +204 -0
- package/dist/runtime/render-audio-control.d.ts +110 -0
- package/dist/runtime/render-audio-control.d.ts.map +1 -0
- package/dist/runtime/render-audio-control.js +111 -0
- package/dist/runtime/render-control.d.ts +291 -0
- package/dist/runtime/render-control.d.ts.map +1 -0
- package/dist/runtime/render-control.js +264 -0
- package/dist/runtime/render-seed.d.ts +57 -0
- package/dist/runtime/render-seed.d.ts.map +1 -0
- package/dist/runtime/render-seed.js +74 -0
- package/dist/runtime/scene-ui-bridge.d.ts +69 -0
- package/dist/runtime/scene-ui-bridge.d.ts.map +1 -0
- package/dist/runtime/scene-ui-bridge.js +23 -0
- package/dist/runtime/scene-ui-data.d.ts +13 -0
- package/dist/runtime/scene-ui-data.d.ts.map +1 -0
- package/dist/runtime/scene-ui-data.js +92 -0
- package/dist/runtime/state-bridge.d.ts +47 -0
- package/dist/runtime/state-bridge.d.ts.map +1 -0
- package/dist/runtime/state-bridge.js +53 -0
- package/dist/runtime/types.d.ts +179 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +1 -0
- package/dist/scene/asset-loaders.d.ts +79 -0
- package/dist/scene/asset-loaders.d.ts.map +1 -0
- package/dist/scene/asset-loaders.js +141 -0
- package/dist/scene/asset-paths.d.ts +11 -0
- package/dist/scene/asset-paths.d.ts.map +1 -0
- package/dist/scene/asset-paths.js +108 -0
- package/dist/scene/asset-ref-check.d.ts +88 -0
- package/dist/scene/asset-ref-check.d.ts.map +1 -0
- package/dist/scene/asset-ref-check.js +214 -0
- package/dist/scene/asset-registry.d.ts +30 -0
- package/dist/scene/asset-registry.d.ts.map +1 -0
- package/dist/scene/asset-registry.js +50 -0
- package/dist/scene/collider-dimensions.d.ts +63 -0
- package/dist/scene/collider-dimensions.d.ts.map +1 -0
- package/dist/scene/collider-dimensions.js +98 -0
- package/dist/scene/component-registry.d.ts +17 -0
- package/dist/scene/component-registry.d.ts.map +1 -0
- package/dist/scene/component-registry.js +28 -0
- package/dist/scene/defaults.d.ts +252 -0
- package/dist/scene/defaults.d.ts.map +1 -0
- package/dist/scene/defaults.js +151 -0
- package/dist/scene/geometries/index.d.ts +8 -0
- package/dist/scene/geometries/index.d.ts.map +1 -0
- package/dist/scene/geometries/index.js +7 -0
- package/dist/scene/geometries/terrain.d.ts +2 -0
- package/dist/scene/geometries/terrain.d.ts.map +1 -0
- package/dist/scene/geometries/terrain.js +37 -0
- package/dist/scene/geometry-registry.d.ts +24 -0
- package/dist/scene/geometry-registry.d.ts.map +1 -0
- package/dist/scene/geometry-registry.js +20 -0
- package/dist/scene/instance-registry.d.ts +36 -0
- package/dist/scene/instance-registry.d.ts.map +1 -0
- package/dist/scene/instance-registry.js +55 -0
- package/dist/scene/instancers/grid.d.ts +2 -0
- package/dist/scene/instancers/grid.d.ts.map +1 -0
- package/dist/scene/instancers/grid.js +36 -0
- package/dist/scene/instancers/index.d.ts +8 -0
- package/dist/scene/instancers/index.d.ts.map +1 -0
- package/dist/scene/instancers/index.js +7 -0
- package/dist/scene/light-camera-factory.d.ts +23 -0
- package/dist/scene/light-camera-factory.d.ts.map +1 -0
- package/dist/scene/light-camera-factory.js +68 -0
- package/dist/scene/material-factory.d.ts +17 -0
- package/dist/scene/material-factory.d.ts.map +1 -0
- package/dist/scene/material-factory.js +197 -0
- package/dist/scene/material-registry.d.ts +40 -0
- package/dist/scene/material-registry.d.ts.map +1 -0
- package/dist/scene/material-registry.js +44 -0
- package/dist/scene/materials/index.d.ts +8 -0
- package/dist/scene/materials/index.d.ts.map +1 -0
- package/dist/scene/materials/index.js +7 -0
- package/dist/scene/materials/water.d.ts +2 -0
- package/dist/scene/materials/water.d.ts.map +1 -0
- package/dist/scene/materials/water.js +54 -0
- package/dist/scene/parse.d.ts +23 -0
- package/dist/scene/parse.d.ts.map +1 -0
- package/dist/scene/parse.js +179 -0
- package/dist/scene/particles-factory.d.ts +33 -0
- package/dist/scene/particles-factory.d.ts.map +1 -0
- package/dist/scene/particles-factory.js +282 -0
- package/dist/scene/scene-apply.d.ts +109 -0
- package/dist/scene/scene-apply.d.ts.map +1 -0
- package/dist/scene/scene-apply.js +326 -0
- package/dist/scene/scene-diff-schema.d.ts +285 -0
- package/dist/scene/scene-diff-schema.d.ts.map +1 -0
- package/dist/scene/scene-diff-schema.js +92 -0
- package/dist/scene/scene-diff-types.d.ts +40 -0
- package/dist/scene/scene-diff-types.d.ts.map +1 -0
- package/dist/scene/scene-diff-types.js +14 -0
- package/dist/scene/scene-loader.d.ts +177 -0
- package/dist/scene/scene-loader.d.ts.map +1 -0
- package/dist/scene/scene-loader.js +1213 -0
- package/dist/scene/scene-query.d.ts +11 -0
- package/dist/scene/scene-query.d.ts.map +1 -0
- package/dist/scene/scene-query.js +63 -0
- package/dist/scene/scene-types.d.ts +10 -0
- package/dist/scene/scene-types.d.ts.map +1 -0
- package/dist/scene/scene-types.js +8 -0
- package/dist/scene/scene-version.d.ts +26 -0
- package/dist/scene/scene-version.d.ts.map +1 -0
- package/dist/scene/scene-version.js +34 -0
- package/dist/scene/schema/animation.d.ts +8 -0
- package/dist/scene/schema/animation.d.ts.map +1 -0
- package/dist/scene/schema/animation.js +42 -0
- package/dist/scene/schema/audio.d.ts +13 -0
- package/dist/scene/schema/audio.d.ts.map +1 -0
- package/dist/scene/schema/audio.js +22 -0
- package/dist/scene/schema/camera.d.ts +28 -0
- package/dist/scene/schema/camera.d.ts.map +1 -0
- package/dist/scene/schema/camera.js +17 -0
- package/dist/scene/schema/collider.d.ts +40 -0
- package/dist/scene/schema/collider.d.ts.map +1 -0
- package/dist/scene/schema/collider.js +55 -0
- package/dist/scene/schema/entity-ref.d.ts +31 -0
- package/dist/scene/schema/entity-ref.d.ts.map +1 -0
- package/dist/scene/schema/entity-ref.js +61 -0
- package/dist/scene/schema/entity.d.ts +1036 -0
- package/dist/scene/schema/entity.d.ts.map +1 -0
- package/dist/scene/schema/entity.js +153 -0
- package/dist/scene/schema/environment.d.ts +425 -0
- package/dist/scene/schema/environment.d.ts.map +1 -0
- package/dist/scene/schema/environment.js +357 -0
- package/dist/scene/schema/index.d.ts +39 -0
- package/dist/scene/schema/index.d.ts.map +1 -0
- package/dist/scene/schema/index.js +20 -0
- package/dist/scene/schema/instances.d.ts +14 -0
- package/dist/scene/schema/instances.d.ts.map +1 -0
- package/dist/scene/schema/instances.js +28 -0
- package/dist/scene/schema/joint.d.ts +23 -0
- package/dist/scene/schema/joint.d.ts.map +1 -0
- package/dist/scene/schema/joint.js +23 -0
- package/dist/scene/schema/light.d.ts +38 -0
- package/dist/scene/schema/light.d.ts.map +1 -0
- package/dist/scene/schema/light.js +26 -0
- package/dist/scene/schema/material.d.ts +199 -0
- package/dist/scene/schema/material.d.ts.map +1 -0
- package/dist/scene/schema/material.js +99 -0
- package/dist/scene/schema/mesh.d.ts +48 -0
- package/dist/scene/schema/mesh.d.ts.map +1 -0
- package/dist/scene/schema/mesh.js +82 -0
- package/dist/scene/schema/particles.d.ts +2178 -0
- package/dist/scene/schema/particles.d.ts.map +1 -0
- package/dist/scene/schema/particles.js +321 -0
- package/dist/scene/schema/physics.d.ts +56 -0
- package/dist/scene/schema/physics.d.ts.map +1 -0
- package/dist/scene/schema/physics.js +37 -0
- package/dist/scene/schema/scene-file.d.ts +304 -0
- package/dist/scene/schema/scene-file.d.ts.map +1 -0
- package/dist/scene/schema/scene-file.js +262 -0
- package/dist/scene/schema/shadow.d.ts +28 -0
- package/dist/scene/schema/shadow.d.ts.map +1 -0
- package/dist/scene/schema/shadow.js +20 -0
- package/dist/scene/schema/spline.d.ts +25 -0
- package/dist/scene/schema/spline.d.ts.map +1 -0
- package/dist/scene/schema/spline.js +15 -0
- package/dist/scene/schema/tuples.d.ts +12 -0
- package/dist/scene/schema/tuples.d.ts.map +1 -0
- package/dist/scene/schema/tuples.js +14 -0
- package/dist/scene/schema/ui.d.ts +880 -0
- package/dist/scene/schema/ui.d.ts.map +1 -0
- package/dist/scene/schema/ui.js +506 -0
- package/dist/scene/user-data.d.ts +171 -0
- package/dist/scene/user-data.d.ts.map +1 -0
- package/dist/scene/user-data.js +137 -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 +69 -0
- package/dist/setup/setup-renderer.d.ts.map +1 -0
- package/dist/setup/setup-renderer.js +363 -0
- package/dist/tools/define-tool.d.ts +105 -0
- package/dist/tools/define-tool.d.ts.map +1 -0
- package/dist/tools/define-tool.js +82 -0
- package/dist/world2d/authoring-2d.d.ts +76 -0
- package/dist/world2d/authoring-2d.d.ts.map +1 -0
- package/dist/world2d/authoring-2d.js +176 -0
- package/dist/world2d/capture-to-scene2d.d.ts +5 -0
- package/dist/world2d/capture-to-scene2d.d.ts.map +1 -0
- package/dist/world2d/capture-to-scene2d.js +49 -0
- package/dist/world2d/collision-2d.d.ts +52 -0
- package/dist/world2d/collision-2d.d.ts.map +1 -0
- package/dist/world2d/collision-2d.js +70 -0
- package/dist/world2d/components-2d.d.ts +47 -0
- package/dist/world2d/components-2d.d.ts.map +1 -0
- package/dist/world2d/components-2d.js +77 -0
- package/dist/world2d/index.d.ts +34 -0
- package/dist/world2d/index.d.ts.map +1 -0
- package/dist/world2d/index.js +32 -0
- package/dist/world2d/ingest-iframe-2d.d.ts +82 -0
- package/dist/world2d/ingest-iframe-2d.d.ts.map +1 -0
- package/dist/world2d/ingest-iframe-2d.js +166 -0
- package/dist/world2d/ingest2d.d.ts +97 -0
- package/dist/world2d/ingest2d.d.ts.map +1 -0
- package/dist/world2d/ingest2d.js +40 -0
- package/dist/world2d/physics2d-registry.d.ts +24 -0
- package/dist/world2d/physics2d-registry.d.ts.map +1 -0
- package/dist/world2d/physics2d-registry.js +38 -0
- package/dist/world2d/pixi-game-adapter.d.ts +107 -0
- package/dist/world2d/pixi-game-adapter.d.ts.map +1 -0
- package/dist/world2d/pixi-game-adapter.js +211 -0
- package/dist/world2d/pixi-surface.d.ts +39 -0
- package/dist/world2d/pixi-surface.d.ts.map +1 -0
- package/dist/world2d/pixi-surface.js +47 -0
- package/dist/world2d/scene-capture-2d.d.ts +43 -0
- package/dist/world2d/scene-capture-2d.d.ts.map +1 -0
- package/dist/world2d/scene-capture-2d.js +92 -0
- package/dist/world2d/scene2d-loader.d.ts +27 -0
- package/dist/world2d/scene2d-loader.d.ts.map +1 -0
- package/dist/world2d/scene2d-loader.js +274 -0
- package/dist/world2d/schema/entity2d.d.ts +102 -0
- package/dist/world2d/schema/entity2d.d.ts.map +1 -0
- package/dist/world2d/schema/entity2d.js +119 -0
- package/dist/world2d/schema/physics2d.d.ts +46 -0
- package/dist/world2d/schema/physics2d.d.ts.map +1 -0
- package/dist/world2d/schema/physics2d.js +45 -0
- package/dist/world2d/schema/sprite.d.ts +42 -0
- package/dist/world2d/schema/sprite.d.ts.map +1 -0
- package/dist/world2d/schema/sprite.js +63 -0
- package/dist/world2d/schema/tilemap.d.ts +15 -0
- package/dist/world2d/schema/tilemap.d.ts.map +1 -0
- package/dist/world2d/schema/tilemap.js +19 -0
- package/dist/world2d/schema/tuples2d.d.ts +20 -0
- package/dist/world2d/schema/tuples2d.d.ts.map +1 -0
- package/dist/world2d/schema/tuples2d.js +19 -0
- package/dist/world2d/system-adapters-2d.d.ts +16 -0
- package/dist/world2d/system-adapters-2d.d.ts.map +1 -0
- package/dist/world2d/system-adapters-2d.js +37 -0
- package/dist/world2d/transform-writer-2d.d.ts +16 -0
- package/dist/world2d/transform-writer-2d.d.ts.map +1 -0
- package/dist/world2d/transform-writer-2d.js +22 -0
- package/dist/world2d/types.d.ts +53 -0
- package/dist/world2d/types.d.ts.map +1 -0
- package/dist/world2d/types.js +1 -0
- package/package.json +18 -4
- package/src/adapter/authoring.ts +10 -0
- package/src/adapter/first-party-systems.ts +23 -34
- package/src/adapter/index.ts +1 -3
- package/src/adapter/system-adapter.ts +15 -22
- package/src/adapter/vgai-scene-game-adapter.ts +5 -14
- package/src/animation/anim-graph-types.ts +12 -43
- package/src/animation/animation-clock.ts +479 -0
- package/src/animation/camera-ownership.ts +467 -0
- package/src/animation/cinematic-cues.ts +451 -0
- package/src/animation/clip-map.ts +41 -0
- package/src/animation/gsap-registration.ts +184 -0
- package/src/animation/theatre-clock-binding.ts +111 -0
- package/src/animation/theatre-director.ts +347 -0
- package/src/animation/theatre-object-binding.ts +661 -0
- package/src/animation/xstate-animation-binding.ts +398 -0
- package/src/animation/xstate-animation-meta.ts +282 -0
- package/src/audio/index.ts +39 -7
- package/src/audio/tone-clock-binding.ts +98 -0
- package/src/audio/tone-context.ts +129 -0
- package/src/audio/tone-offline-render.ts +167 -0
- package/src/audio/wav-encode.ts +119 -0
- package/src/core/game-loop.ts +17 -0
- package/src/core/types.ts +13 -0
- package/src/data/data-asset.ts +167 -0
- package/src/data/data-check-core.ts +242 -0
- package/src/data/data-ref.ts +145 -0
- package/src/data/vite-plugin-data.ts +290 -0
- package/src/index.ts +48 -0
- package/src/input/input-manager.ts +1206 -32
- package/src/input/input-types.ts +155 -3
- package/src/input/prompt-labels.ts +122 -0
- package/src/input/rebind-controller.ts +105 -0
- package/src/input/schema.ts +206 -52
- package/src/react/use-data.ts +114 -0
- package/src/react/use-selection.tsx +135 -0
- package/src/runtime/create-runtime.ts +30 -9
- package/src/runtime/render-audio-control.ts +168 -0
- package/src/runtime/render-control.ts +522 -0
- package/src/runtime/render-seed.ts +79 -0
- package/src/runtime/types.ts +0 -5
- package/src/scene/asset-loaders.ts +10 -36
- package/src/scene/asset-paths.ts +0 -2
- package/src/scene/asset-ref-check.ts +248 -0
- package/src/scene/parse.ts +133 -0
- package/src/scene/scene-loader.ts +81 -96
- package/src/scene/schema/animation.ts +30 -79
- package/src/scene/schema/entity.ts +20 -0
- package/src/scene/schema/index.ts +2 -12
- package/src/scene/user-data.ts +8 -9
- package/src/setup/setup-renderer.ts +9 -2
- package/src/tools/define-tool.ts +152 -0
- package/src/animation/anim-graph.ts +0 -406
- package/src/animation/anim-system.ts +0 -28
- package/src/animation/property-track.ts +0 -178
- package/src/animation/schema.ts +0 -204
- package/src/audio/ambient.ts +0 -300
- package/src/audio/impacts.ts +0 -212
- package/src/audio/movement.ts +0 -140
- package/src/audio/musical.ts +0 -200
- package/src/audio/ui-sounds.ts +0 -171
- package/src/audio/vehicle.ts +0 -235
- package/src/audio/weapons.ts +0 -152
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type RAPIER2D from '@dimforge/rapier2d-compat';
|
|
2
|
+
import type RAPIER3D from '@dimforge/rapier3d-compat';
|
|
3
|
+
import type * as PIXI from 'pixi.js';
|
|
4
|
+
import type * as THREE from 'three';
|
|
5
|
+
import type { z } from 'zod';
|
|
6
|
+
import type { SystemPhaseName } from '../core/types';
|
|
7
|
+
import type { WorldInstance, WorldKind } from '../runtime/game';
|
|
8
|
+
import type { GameContext } from '../runtime/types';
|
|
9
|
+
/**
|
|
10
|
+
* Map a {@link WorldKind} to its native world node type (T7.2, D8 —
|
|
11
|
+
* `docs/GAME-COMPONENT-GENERALIZATION.md` §2). `react` maps to `never`: react
|
|
12
|
+
* entities host no GameComponents (they render from game state via the T7.4
|
|
13
|
+
* state bridge instead).
|
|
14
|
+
*/
|
|
15
|
+
export type NodeOf<K extends WorldKind> = K extends 'threejs' ? THREE.Object3D : K extends 'pixijs' ? PIXI.Container : never;
|
|
16
|
+
/** Map a {@link WorldKind} to its native Rapier rigid-body type. */
|
|
17
|
+
export type BodyOf<K extends WorldKind> = K extends 'threejs' ? RAPIER3D.RigidBody : K extends 'pixijs' ? RAPIER2D.RigidBody : never;
|
|
18
|
+
/** Map a {@link WorldKind} to its native Rapier collider type. */
|
|
19
|
+
export type ColliderOf<K extends WorldKind> = K extends 'threejs' ? RAPIER3D.Collider : K extends 'pixijs' ? RAPIER2D.Collider : never;
|
|
20
|
+
/**
|
|
21
|
+
* Base class for game components attached to entities.
|
|
22
|
+
*
|
|
23
|
+
* Generalized (T7.2, D8 — `docs/GAME-COMPONENT-GENERALIZATION.md`) over the
|
|
24
|
+
* world kind `K` (default `'threejs'`, so every existing component — all of
|
|
25
|
+
* which extend the bare `GameComponent` — compiles and runs unchanged). The
|
|
26
|
+
* world's native node IS the entity — there is no separate entity id and no
|
|
27
|
+
* mirror/sync layer (Track A). Each component instance holds a direct
|
|
28
|
+
* reference to its node and (if any) its Rapier rigid body/collider. The
|
|
29
|
+
* ComponentManager wires these up in `attach()`.
|
|
30
|
+
*
|
|
31
|
+
* Similar to Unity's MonoBehaviour or Godot's Node scripts:
|
|
32
|
+
* - `init()` — called once after the entity is fully constructed
|
|
33
|
+
* - `update(dt, ctx)` — called every fixed timestep, in the component's phase
|
|
34
|
+
* - `dispose(ctx)` — called when the entity is destroyed
|
|
35
|
+
* - `onTriggerEnter/onTriggerExit` — called when a sensor collider overlap
|
|
36
|
+
* starts/stops, with the other party's native node
|
|
37
|
+
*
|
|
38
|
+
* State lives on `this` (instance properties). On HMR, the engine swaps the
|
|
39
|
+
* prototype via Object.setPrototypeOf — instance state survives, method bodies
|
|
40
|
+
* update to the new code.
|
|
41
|
+
*/
|
|
42
|
+
export declare abstract class GameComponent<K extends WorldKind = 'threejs'> {
|
|
43
|
+
/** Which phase this component's update runs in. Override in subclasses. */
|
|
44
|
+
static phase: SystemPhaseName;
|
|
45
|
+
/**
|
|
46
|
+
* Runtime-checkable declaration of which {@link WorldKind} this component
|
|
47
|
+
* is written for (T7.2, D8 §3 — `docs/GAME-COMPONENT-GENERALIZATION.md`).
|
|
48
|
+
* TS's `K` type parameter is erased at runtime, so this static is what the
|
|
49
|
+
* ComponentManager checks at attach time: a node whose world's kind
|
|
50
|
+
* doesn't match `declaredKind` THROWS at attach (a `GameComponent<'pixijs'>`
|
|
51
|
+
* attached to a threejs entity, or vice versa). Kind-agnostic components —
|
|
52
|
+
* written only against `node`/`this.world`, never the typed `object3D`
|
|
53
|
+
* accessor or a kind-specific field — may declare `'any'` and attach in
|
|
54
|
+
* any world components are legal in (every world except `'react'`, which
|
|
55
|
+
* always throws regardless of `declaredKind` — see the ComponentManager).
|
|
56
|
+
*/
|
|
57
|
+
static declaredKind: WorldKind | 'any';
|
|
58
|
+
/**
|
|
59
|
+
* Optional Zod object schema for this component's authored fields. When set,
|
|
60
|
+
* scene data is validated + defaulted through `schema.parse(data)` before being
|
|
61
|
+
* assigned onto the instance. Also powers (later) the editor's schema-driven
|
|
62
|
+
* inspector and HMR defaults.
|
|
63
|
+
*/
|
|
64
|
+
static schema?: z.ZodObject<z.ZodRawShape>;
|
|
65
|
+
/** The native world node. The node IS the entity. */
|
|
66
|
+
node: NodeOf<K>;
|
|
67
|
+
/** The world instance this component's entity lives in (wired at attach). */
|
|
68
|
+
world: WorldInstance;
|
|
69
|
+
/**
|
|
70
|
+
* Typed accessor, threejs worlds only — kept for compatibility. On a
|
|
71
|
+
* `GameComponent` (default `K`) this types as `THREE.Object3D`, so every
|
|
72
|
+
* existing component compiles unchanged. On a non-threejs instance it
|
|
73
|
+
* THROWS a descriptive error rather than ever returning a wrong-kind node —
|
|
74
|
+
* use `this.node` (or `this.world.kind` to check first) instead.
|
|
75
|
+
*/
|
|
76
|
+
get object3D(): THREE.Object3D;
|
|
77
|
+
/** The entity's native rigid body, if it has physics. */
|
|
78
|
+
rigidBody: BodyOf<K> | null;
|
|
79
|
+
/** The entity's native collider, if it has physics. */
|
|
80
|
+
collider: ColliderOf<K> | null;
|
|
81
|
+
/** Called once after the entity is fully constructed (node, physics, etc.). */
|
|
82
|
+
init?(ctx: GameContext): void | Promise<void>;
|
|
83
|
+
/** Called every fixed timestep. */
|
|
84
|
+
abstract update(dt: number, ctx: GameContext): void;
|
|
85
|
+
/** Called when the entity is destroyed or the component is removed. */
|
|
86
|
+
dispose?(ctx: GameContext): void;
|
|
87
|
+
/** Called when a sensor overlap with `other` begins. */
|
|
88
|
+
onTriggerEnter?(other: NodeOf<K>, ctx: GameContext): void;
|
|
89
|
+
/** Called when a sensor overlap with `other` ends. */
|
|
90
|
+
onTriggerExit?(other: NodeOf<K>, ctx: GameContext): void;
|
|
91
|
+
}
|
|
92
|
+
/** Constructor type for GameComponent subclasses (carries static phase/schema). */
|
|
93
|
+
export type GameComponentClass = (new () => GameComponent) & {
|
|
94
|
+
phase?: SystemPhaseName;
|
|
95
|
+
schema?: z.ZodObject<z.ZodRawShape>;
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=game-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-component.d.ts","sourceRoot":"","sources":["../../src/ecs/game-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,SAAS,SAAS,GACzD,KAAK,CAAC,QAAQ,GACd,CAAC,SAAS,QAAQ,GAChB,IAAI,CAAC,SAAS,GACd,KAAK,CAAC;AAEZ,oEAAoE;AACpE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,SAAS,SAAS,GACzD,QAAQ,CAAC,SAAS,GAClB,CAAC,SAAS,QAAQ,GAChB,QAAQ,CAAC,SAAS,GAClB,KAAK,CAAC;AAEZ,kEAAkE;AAClE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,SAAS,SAAS,GAC7D,QAAQ,CAAC,QAAQ,GACjB,CAAC,SAAS,QAAQ,GAChB,QAAQ,CAAC,QAAQ,GACjB,KAAK,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,aAAa,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACjE,2EAA2E;IAC3E,MAAM,CAAC,KAAK,EAAE,eAAe,CAAe;IAE5C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,CAAa;IAEnD;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAE3C,qDAAqD;IACrD,IAAI,EAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAEjB,6EAA6E;IAC7E,KAAK,EAAG,aAAa,CAAC;IAEtB;;;;;;OAMG;IACH,IAAI,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAsB7B;IAED,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;IAEnC,uDAAuD;IACvD,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;IAEtC,+EAA+E;IAC/E,IAAI,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAE7C,mCAAmC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI;IAEnD,uEAAuE;IACvE,OAAO,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAEhC,wDAAwD;IACxD,cAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI;IAEzD,sDAAsD;IACtD,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI;CACzD;AAED,mFAAmF;AACnF,MAAM,MAAM,kBAAkB,GAAG,CAAC,UAAU,aAAa,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;CACrC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for game components attached to entities.
|
|
3
|
+
*
|
|
4
|
+
* Generalized (T7.2, D8 — `docs/GAME-COMPONENT-GENERALIZATION.md`) over the
|
|
5
|
+
* world kind `K` (default `'threejs'`, so every existing component — all of
|
|
6
|
+
* which extend the bare `GameComponent` — compiles and runs unchanged). The
|
|
7
|
+
* world's native node IS the entity — there is no separate entity id and no
|
|
8
|
+
* mirror/sync layer (Track A). Each component instance holds a direct
|
|
9
|
+
* reference to its node and (if any) its Rapier rigid body/collider. The
|
|
10
|
+
* ComponentManager wires these up in `attach()`.
|
|
11
|
+
*
|
|
12
|
+
* Similar to Unity's MonoBehaviour or Godot's Node scripts:
|
|
13
|
+
* - `init()` — called once after the entity is fully constructed
|
|
14
|
+
* - `update(dt, ctx)` — called every fixed timestep, in the component's phase
|
|
15
|
+
* - `dispose(ctx)` — called when the entity is destroyed
|
|
16
|
+
* - `onTriggerEnter/onTriggerExit` — called when a sensor collider overlap
|
|
17
|
+
* starts/stops, with the other party's native node
|
|
18
|
+
*
|
|
19
|
+
* State lives on `this` (instance properties). On HMR, the engine swaps the
|
|
20
|
+
* prototype via Object.setPrototypeOf — instance state survives, method bodies
|
|
21
|
+
* update to the new code.
|
|
22
|
+
*/
|
|
23
|
+
export class GameComponent {
|
|
24
|
+
/** Which phase this component's update runs in. Override in subclasses. */
|
|
25
|
+
static phase = 'gameLogic';
|
|
26
|
+
/**
|
|
27
|
+
* Runtime-checkable declaration of which {@link WorldKind} this component
|
|
28
|
+
* is written for (T7.2, D8 §3 — `docs/GAME-COMPONENT-GENERALIZATION.md`).
|
|
29
|
+
* TS's `K` type parameter is erased at runtime, so this static is what the
|
|
30
|
+
* ComponentManager checks at attach time: a node whose world's kind
|
|
31
|
+
* doesn't match `declaredKind` THROWS at attach (a `GameComponent<'pixijs'>`
|
|
32
|
+
* attached to a threejs entity, or vice versa). Kind-agnostic components —
|
|
33
|
+
* written only against `node`/`this.world`, never the typed `object3D`
|
|
34
|
+
* accessor or a kind-specific field — may declare `'any'` and attach in
|
|
35
|
+
* any world components are legal in (every world except `'react'`, which
|
|
36
|
+
* always throws regardless of `declaredKind` — see the ComponentManager).
|
|
37
|
+
*/
|
|
38
|
+
static declaredKind = 'threejs';
|
|
39
|
+
/**
|
|
40
|
+
* Optional Zod object schema for this component's authored fields. When set,
|
|
41
|
+
* scene data is validated + defaulted through `schema.parse(data)` before being
|
|
42
|
+
* assigned onto the instance. Also powers (later) the editor's schema-driven
|
|
43
|
+
* inspector and HMR defaults.
|
|
44
|
+
*/
|
|
45
|
+
static schema;
|
|
46
|
+
/** The native world node. The node IS the entity. */
|
|
47
|
+
node;
|
|
48
|
+
/** The world instance this component's entity lives in (wired at attach). */
|
|
49
|
+
world;
|
|
50
|
+
/**
|
|
51
|
+
* Typed accessor, threejs worlds only — kept for compatibility. On a
|
|
52
|
+
* `GameComponent` (default `K`) this types as `THREE.Object3D`, so every
|
|
53
|
+
* existing component compiles unchanged. On a non-threejs instance it
|
|
54
|
+
* THROWS a descriptive error rather than ever returning a wrong-kind node —
|
|
55
|
+
* use `this.node` (or `this.world.kind` to check first) instead.
|
|
56
|
+
*/
|
|
57
|
+
get object3D() {
|
|
58
|
+
const kind = this.world?.kind;
|
|
59
|
+
if (kind !== undefined && kind !== 'threejs') {
|
|
60
|
+
throw new Error(`${this.constructor.name}.object3D: this component's world (kind: "${kind}") is not a ` +
|
|
61
|
+
'threejs world — `object3D` only ever returns a THREE.Object3D; use `this.node` instead.');
|
|
62
|
+
}
|
|
63
|
+
// When the world isn't wired yet (silo-attached 2D components until
|
|
64
|
+
// T7.3; bare instances), fall back to the static declaration so a
|
|
65
|
+
// GameComponent<'pixijs'> can never silently hand out its Container
|
|
66
|
+
// typed as an Object3D.
|
|
67
|
+
if (kind === undefined) {
|
|
68
|
+
const declared = this.constructor.declaredKind;
|
|
69
|
+
if (declared !== 'threejs' && declared !== 'any') {
|
|
70
|
+
throw new Error(`${this.constructor.name}.object3D: this component declares kind "${declared}" — ` +
|
|
71
|
+
'`object3D` only ever returns a THREE.Object3D; use `this.node` instead.');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return this.node;
|
|
75
|
+
}
|
|
76
|
+
/** The entity's native rigid body, if it has physics. */
|
|
77
|
+
rigidBody = null;
|
|
78
|
+
/** The entity's native collider, if it has physics. */
|
|
79
|
+
collider = null;
|
|
80
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HMR swap-miss report — T5.4 (docs/BACKBONE-TASKS.md's Track 5 table:
|
|
3
|
+
* "Deterministic HMR: registry-keyed hotSwap (not `constructor.name`), schema
|
|
4
|
+
* re-parse on swap, loud swap-miss warnings"). `ComponentManager.hotSwap` keys
|
|
5
|
+
* live instances by the `componentRegistry` name recorded on them at attach
|
|
6
|
+
* (see `component-manager.ts`'s `attach`/`hotSwap`), NOT the live
|
|
7
|
+
* `constructor.name` — fragile under minification, class renames, or two
|
|
8
|
+
* classes sharing one name. This module is the structured, greppable
|
|
9
|
+
* `console.warn` a swap-miss warrants, mirrored on the established
|
|
10
|
+
* prefix + JSON-payload pattern (`packages/editor/src/achieved-tier.ts`'s
|
|
11
|
+
* `TIER_SHORTFALL_PREFIX`, `packages/editor/src/authoring/overlay-report.ts`'s
|
|
12
|
+
* `OVERLAY_REPORT_PREFIX`) — kept dependency-free (no `window`/editor-console
|
|
13
|
+
* import) so it stays importable from a headless engine/runtime context,
|
|
14
|
+
* same discipline as those two files.
|
|
15
|
+
*
|
|
16
|
+
* Two independent miss reasons, per the BACKBONE-TASKS detail note:
|
|
17
|
+
* - `'no-live-instance'` — the incoming hot update's key (the
|
|
18
|
+
* `componentRegistry` name the recompiled module was re-exported under)
|
|
19
|
+
* matches no currently-attached instance's recorded registry key (nor,
|
|
20
|
+
* for an instance attached WITHOUT a registry key — an ad-hoc,
|
|
21
|
+
* code-attached component — its `constructor.name`). This is the
|
|
22
|
+
* "renamed class → loud miss" case: a class rename changes the export
|
|
23
|
+
* key a hot update arrives under, so no live instance is found under the
|
|
24
|
+
* NEW key — the OLD prototype is simply left in place (never silently
|
|
25
|
+
* dropped, never crashed).
|
|
26
|
+
* - `'schema-reparse-failed'` — at least one matched instance's swap
|
|
27
|
+
* succeeded (prototype replaced), but re-validating its authored props
|
|
28
|
+
* against the NEW class's `static schema` threw; that instance's fields
|
|
29
|
+
* are left exactly as they were (last-good props), never partially or
|
|
30
|
+
* invalidly overwritten.
|
|
31
|
+
*/
|
|
32
|
+
/** Greppable prefix shared by every swap-miss log line this module produces. */
|
|
33
|
+
export declare const HMR_SWAP_MISS_PREFIX = "hmr-swap-miss";
|
|
34
|
+
export type HmrSwapMissReport = {
|
|
35
|
+
key: string;
|
|
36
|
+
reason: 'no-live-instance';
|
|
37
|
+
} | {
|
|
38
|
+
key: string;
|
|
39
|
+
reason: 'schema-reparse-failed';
|
|
40
|
+
error: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The one shared message shape — greppable on the prefix, JSON-parseable on
|
|
44
|
+
* the trailing payload (the LAST `{...}` in the string — the human-readable
|
|
45
|
+
* `detail` clause never itself contains a brace, even for the
|
|
46
|
+
* `'schema-reparse-failed'` reason, whose full Zod error text — itself a
|
|
47
|
+
* JSON-issues blob, braces included — is carried only in `report.error`
|
|
48
|
+
* inside that trailing payload, never inlined into `detail`).
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatHmrSwapMissMessage(report: HmrSwapMissReport): string;
|
|
51
|
+
/** Emit the ONE structured `console.warn` a swap-miss warrants — never a silent no-op. */
|
|
52
|
+
export declare function logHmrSwapMiss(report: HmrSwapMissReport): void;
|
|
53
|
+
//# sourceMappingURL=hmr-swap-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-swap-report.d.ts","sourceRoot":"","sources":["../../src/ecs/hmr-swap-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GACzB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,GAC3C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAW1E;AAED,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAG9D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HMR swap-miss report — T5.4 (docs/BACKBONE-TASKS.md's Track 5 table:
|
|
3
|
+
* "Deterministic HMR: registry-keyed hotSwap (not `constructor.name`), schema
|
|
4
|
+
* re-parse on swap, loud swap-miss warnings"). `ComponentManager.hotSwap` keys
|
|
5
|
+
* live instances by the `componentRegistry` name recorded on them at attach
|
|
6
|
+
* (see `component-manager.ts`'s `attach`/`hotSwap`), NOT the live
|
|
7
|
+
* `constructor.name` — fragile under minification, class renames, or two
|
|
8
|
+
* classes sharing one name. This module is the structured, greppable
|
|
9
|
+
* `console.warn` a swap-miss warrants, mirrored on the established
|
|
10
|
+
* prefix + JSON-payload pattern (`packages/editor/src/achieved-tier.ts`'s
|
|
11
|
+
* `TIER_SHORTFALL_PREFIX`, `packages/editor/src/authoring/overlay-report.ts`'s
|
|
12
|
+
* `OVERLAY_REPORT_PREFIX`) — kept dependency-free (no `window`/editor-console
|
|
13
|
+
* import) so it stays importable from a headless engine/runtime context,
|
|
14
|
+
* same discipline as those two files.
|
|
15
|
+
*
|
|
16
|
+
* Two independent miss reasons, per the BACKBONE-TASKS detail note:
|
|
17
|
+
* - `'no-live-instance'` — the incoming hot update's key (the
|
|
18
|
+
* `componentRegistry` name the recompiled module was re-exported under)
|
|
19
|
+
* matches no currently-attached instance's recorded registry key (nor,
|
|
20
|
+
* for an instance attached WITHOUT a registry key — an ad-hoc,
|
|
21
|
+
* code-attached component — its `constructor.name`). This is the
|
|
22
|
+
* "renamed class → loud miss" case: a class rename changes the export
|
|
23
|
+
* key a hot update arrives under, so no live instance is found under the
|
|
24
|
+
* NEW key — the OLD prototype is simply left in place (never silently
|
|
25
|
+
* dropped, never crashed).
|
|
26
|
+
* - `'schema-reparse-failed'` — at least one matched instance's swap
|
|
27
|
+
* succeeded (prototype replaced), but re-validating its authored props
|
|
28
|
+
* against the NEW class's `static schema` threw; that instance's fields
|
|
29
|
+
* are left exactly as they were (last-good props), never partially or
|
|
30
|
+
* invalidly overwritten.
|
|
31
|
+
*/
|
|
32
|
+
/** Greppable prefix shared by every swap-miss log line this module produces. */
|
|
33
|
+
export const HMR_SWAP_MISS_PREFIX = 'hmr-swap-miss';
|
|
34
|
+
/**
|
|
35
|
+
* The one shared message shape — greppable on the prefix, JSON-parseable on
|
|
36
|
+
* the trailing payload (the LAST `{...}` in the string — the human-readable
|
|
37
|
+
* `detail` clause never itself contains a brace, even for the
|
|
38
|
+
* `'schema-reparse-failed'` reason, whose full Zod error text — itself a
|
|
39
|
+
* JSON-issues blob, braces included — is carried only in `report.error`
|
|
40
|
+
* inside that trailing payload, never inlined into `detail`).
|
|
41
|
+
*/
|
|
42
|
+
export function formatHmrSwapMissMessage(report) {
|
|
43
|
+
const detail = report.reason === 'no-live-instance'
|
|
44
|
+
? `no live instance's registry key (or, for an ad-hoc/unregistered instance, its class name) ` +
|
|
45
|
+
`matches "${report.key}" — the hot update had nothing to swap (old class, if any, left in place)`
|
|
46
|
+
: `schema re-parse failed for "${report.key}" after swap — keeping the instance's last-good ` +
|
|
47
|
+
`props (Zod error in the trailing payload's "error" field)`;
|
|
48
|
+
return (`${HMR_SWAP_MISS_PREFIX} ${detail} (T5.4, docs/BACKBONE-TASKS.md). ` +
|
|
49
|
+
`${HMR_SWAP_MISS_PREFIX} ${JSON.stringify(report)}`);
|
|
50
|
+
}
|
|
51
|
+
/** Emit the ONE structured `console.warn` a swap-miss warrants — never a silent no-op. */
|
|
52
|
+
export function logHmrSwapMiss(report) {
|
|
53
|
+
// biome-ignore lint/suspicious/noConsole: structured, greppable swap-miss warning (T5.4) — mirrors achieved-tier.ts/overlay-report.ts's deliberate direct console.warn
|
|
54
|
+
console.warn(formatHmrSwapMissMessage(report));
|
|
55
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@vgai/engine`'s package `"."` entry — what `import '@vgai/engine'`
|
|
3
|
+
* resolves to.
|
|
4
|
+
*
|
|
5
|
+
* This is a SMALL, CURATED barrel, not a re-export-everything convenience
|
|
6
|
+
* import. The engine's own doctrine (CLAUDE.md: "the engine code in
|
|
7
|
+
* `packages/engine/src/` is meant to be read and edited directly — it is
|
|
8
|
+
* not a black-box library") means subpath imports
|
|
9
|
+
* (`@vgai/engine/<path>`, matching this package's `"./*"` exports entry)
|
|
10
|
+
* remain the primary way to reach engine internals — reach for a subpath
|
|
11
|
+
* first. This barrel exists only so the package's bare-name entry point is
|
|
12
|
+
* HONEST (resolves to something real and useful) instead of dangling; it
|
|
13
|
+
* covers just the handful of symbols a game/consumer needs to author a
|
|
14
|
+
* first-party `setup()` and mount it, plus the scene/manifest file
|
|
15
|
+
* entry points. Keep it small when extending it — prefer a new subpath
|
|
16
|
+
* export over growing this file into a firehose.
|
|
17
|
+
*
|
|
18
|
+
* Groups (import order below is alphabetical-by-specifier, per the repo's
|
|
19
|
+
* biome `organizeImports` rule, not by group — see this list instead):
|
|
20
|
+
* - game setup contract: `GameContext`/`GameCleanup`/`GameSetupFn`, `fromSetup`
|
|
21
|
+
* - component model: `GameComponent`, `WorldKind`
|
|
22
|
+
* - manifest-driven mount: `mountManifestWorlds` + its option/result types
|
|
23
|
+
* - scene file entry point: `parseSceneFile`/`parsePrefabFile`
|
|
24
|
+
* - game manifest (vgai.game.json) entry point: `loadGameManifest`
|
|
25
|
+
*/
|
|
26
|
+
export { fromSetup } from './adapter/vgai-scene-game-adapter';
|
|
27
|
+
export type { WorldKind } from './adapter/world-kind';
|
|
28
|
+
export { GameComponent } from './ecs/game-component';
|
|
29
|
+
export type { GameManifest, ResolvedAdapter, ResolvedGameManifest, ResolvedWorldEntry, WorldAdapter, WorldEntry, } from './manifest';
|
|
30
|
+
export { CAPABILITY_CEILINGS, DEFAULT_SERVER_MODULE, loadGameManifest } from './manifest';
|
|
31
|
+
export type { GameSession } from './runtime/create-runtime';
|
|
32
|
+
export type { MountEntry, MountedManifestSession, MountManifestOptions, } from './runtime/mount-manifest';
|
|
33
|
+
export { mountManifestWorlds } from './runtime/mount-manifest';
|
|
34
|
+
export type { GameCleanup, GameContext, GameSetupFn } from './runtime/types';
|
|
35
|
+
export { parsePrefabFile, parseSceneFile, SceneParseError } from './scene/parse';
|
|
36
|
+
export type { PrefabFile, SceneFile } from './scene/schema';
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EACV,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC1F,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EACV,UAAU,EACV,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACjF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@vgai/engine`'s package `"."` entry — what `import '@vgai/engine'`
|
|
3
|
+
* resolves to.
|
|
4
|
+
*
|
|
5
|
+
* This is a SMALL, CURATED barrel, not a re-export-everything convenience
|
|
6
|
+
* import. The engine's own doctrine (CLAUDE.md: "the engine code in
|
|
7
|
+
* `packages/engine/src/` is meant to be read and edited directly — it is
|
|
8
|
+
* not a black-box library") means subpath imports
|
|
9
|
+
* (`@vgai/engine/<path>`, matching this package's `"./*"` exports entry)
|
|
10
|
+
* remain the primary way to reach engine internals — reach for a subpath
|
|
11
|
+
* first. This barrel exists only so the package's bare-name entry point is
|
|
12
|
+
* HONEST (resolves to something real and useful) instead of dangling; it
|
|
13
|
+
* covers just the handful of symbols a game/consumer needs to author a
|
|
14
|
+
* first-party `setup()` and mount it, plus the scene/manifest file
|
|
15
|
+
* entry points. Keep it small when extending it — prefer a new subpath
|
|
16
|
+
* export over growing this file into a firehose.
|
|
17
|
+
*
|
|
18
|
+
* Groups (import order below is alphabetical-by-specifier, per the repo's
|
|
19
|
+
* biome `organizeImports` rule, not by group — see this list instead):
|
|
20
|
+
* - game setup contract: `GameContext`/`GameCleanup`/`GameSetupFn`, `fromSetup`
|
|
21
|
+
* - component model: `GameComponent`, `WorldKind`
|
|
22
|
+
* - manifest-driven mount: `mountManifestWorlds` + its option/result types
|
|
23
|
+
* - scene file entry point: `parseSceneFile`/`parsePrefabFile`
|
|
24
|
+
* - game manifest (vgai.game.json) entry point: `loadGameManifest`
|
|
25
|
+
*/
|
|
26
|
+
export { fromSetup } from './adapter/vgai-scene-game-adapter';
|
|
27
|
+
export { GameComponent } from './ecs/game-component';
|
|
28
|
+
export { CAPABILITY_CEILINGS, DEFAULT_SERVER_MODULE, loadGameManifest } from './manifest';
|
|
29
|
+
export { mountManifestWorlds } from './runtime/mount-manifest';
|
|
30
|
+
export { parsePrefabFile, parseSceneFile, SceneParseError } from './scene/parse';
|