@vgai/engine 0.5.0 → 0.5.2
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/package.json +1 -1
- package/schemas/engine-capabilities.json +4 -4
- package/schemas/vgai-game.schema.json +2 -2
- package/src/adapter/authoring.ts +42 -0
- package/src/adapter/index.ts +3 -0
- package/src/adapter/ingest/overlay-apply.ts +50 -6
- package/src/adapter/ingest/scene-capture.ts +51 -2
- package/src/adapter/vgai-scene-game-adapter.ts +24 -0
- package/src/manifest/schema.ts +7 -3
- package/src/runtime/create-runtime.ts +97 -0
- package/src/runtime/game.ts +11 -1
- package/src/scene/asset-ref-check.ts +1 -1
- package/src/scene/scene-loader.ts +2 -2
- package/src/scene/user-data.ts +18 -0
- package/src/world3d-react/behavior.tsx +19 -11
- package/src/world3d-react/r3f-adapter.tsx +8 -0
- package/dist/adapter/adapter-surface.d.ts +0 -30
- package/dist/adapter/adapter-surface.d.ts.map +0 -1
- package/dist/adapter/adapter-surface.js +0 -18
- package/dist/adapter/authoring.d.ts +0 -461
- package/dist/adapter/authoring.d.ts.map +0 -1
- package/dist/adapter/authoring.js +0 -22
- package/dist/adapter/colyseus-networking-adapter.d.ts +0 -43
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +0 -1
- package/dist/adapter/colyseus-networking-adapter.js +0 -38
- package/dist/adapter/first-party-systems.d.ts +0 -38
- package/dist/adapter/first-party-systems.d.ts.map +0 -1
- package/dist/adapter/first-party-systems.js +0 -77
- package/dist/adapter/game-adapter.d.ts +0 -133
- package/dist/adapter/game-adapter.d.ts.map +0 -1
- package/dist/adapter/game-adapter.js +0 -10
- package/dist/adapter/host-context.d.ts +0 -71
- package/dist/adapter/host-context.d.ts.map +0 -1
- package/dist/adapter/host-context.js +0 -16
- package/dist/adapter/index.d.ts +0 -22
- package/dist/adapter/index.d.ts.map +0 -1
- package/dist/adapter/index.js +0 -15
- package/dist/adapter/ingest/game-contract.d.ts +0 -53
- package/dist/adapter/ingest/game-contract.d.ts.map +0 -1
- package/dist/adapter/ingest/game-contract.js +0 -30
- package/dist/adapter/ingest/overlay-applier.d.ts +0 -118
- package/dist/adapter/ingest/overlay-applier.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-applier.js +0 -132
- package/dist/adapter/ingest/overlay-apply.d.ts +0 -60
- package/dist/adapter/ingest/overlay-apply.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-apply.js +0 -101
- package/dist/adapter/ingest/overlay-file.d.ts +0 -79
- package/dist/adapter/ingest/overlay-file.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-file.js +0 -66
- package/dist/adapter/ingest/overlay-report.d.ts +0 -113
- package/dist/adapter/ingest/overlay-report.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-report.js +0 -103
- package/dist/adapter/ingest/scene-capture.d.ts +0 -97
- package/dist/adapter/ingest/scene-capture.d.ts.map +0 -1
- package/dist/adapter/ingest/scene-capture.js +0 -248
- package/dist/adapter/ingest/upstream-pin.d.ts +0 -47
- package/dist/adapter/ingest/upstream-pin.d.ts.map +0 -1
- package/dist/adapter/ingest/upstream-pin.js +0 -50
- package/dist/adapter/loop-gate-report.d.ts +0 -34
- package/dist/adapter/loop-gate-report.d.ts.map +0 -1
- package/dist/adapter/loop-gate-report.js +0 -37
- package/dist/adapter/rapier-physics-adapter.d.ts +0 -12
- package/dist/adapter/rapier-physics-adapter.d.ts.map +0 -1
- package/dist/adapter/rapier-physics-adapter.js +0 -46
- package/dist/adapter/system-adapter.d.ts +0 -206
- package/dist/adapter/system-adapter.d.ts.map +0 -1
- package/dist/adapter/system-adapter.js +0 -13
- package/dist/adapter/transform.d.ts +0 -18
- package/dist/adapter/transform.d.ts.map +0 -1
- package/dist/adapter/transform.js +0 -1
- package/dist/adapter/vgai-scene-game-adapter.d.ts +0 -108
- package/dist/adapter/vgai-scene-game-adapter.d.ts.map +0 -1
- package/dist/adapter/vgai-scene-game-adapter.js +0 -762
- package/dist/ai/navigation.d.ts +0 -64
- package/dist/ai/navigation.d.ts.map +0 -1
- package/dist/ai/navigation.js +0 -133
- package/dist/animation/anim-graph-types.d.ts +0 -25
- package/dist/animation/anim-graph-types.d.ts.map +0 -1
- package/dist/animation/anim-graph-types.js +0 -1
- package/dist/animation/animation-clock.d.ts +0 -213
- package/dist/animation/animation-clock.d.ts.map +0 -1
- package/dist/animation/animation-clock.js +0 -301
- package/dist/animation/blend-node.d.ts +0 -22
- package/dist/animation/blend-node.d.ts.map +0 -1
- package/dist/animation/blend-node.js +0 -97
- package/dist/animation/camera-ownership.d.ts +0 -250
- package/dist/animation/camera-ownership.d.ts.map +0 -1
- package/dist/animation/camera-ownership.js +0 -169
- package/dist/animation/cinematic-cues.d.ts +0 -200
- package/dist/animation/cinematic-cues.d.ts.map +0 -1
- package/dist/animation/cinematic-cues.js +0 -213
- package/dist/animation/clip-map.d.ts +0 -12
- package/dist/animation/clip-map.d.ts.map +0 -1
- package/dist/animation/clip-map.js +0 -37
- package/dist/animation/gsap-registration.d.ts +0 -119
- package/dist/animation/gsap-registration.d.ts.map +0 -1
- package/dist/animation/gsap-registration.js +0 -92
- package/dist/animation/theatre-clock-binding.d.ts +0 -89
- package/dist/animation/theatre-clock-binding.d.ts.map +0 -1
- package/dist/animation/theatre-clock-binding.js +0 -29
- package/dist/animation/theatre-director.d.ts +0 -242
- package/dist/animation/theatre-director.d.ts.map +0 -1
- package/dist/animation/theatre-director.js +0 -235
- package/dist/animation/theatre-object-binding.d.ts +0 -305
- package/dist/animation/theatre-object-binding.d.ts.map +0 -1
- package/dist/animation/theatre-object-binding.js +0 -351
- package/dist/animation/xstate-animation-binding.d.ts +0 -56
- package/dist/animation/xstate-animation-binding.d.ts.map +0 -1
- package/dist/animation/xstate-animation-binding.js +0 -331
- package/dist/animation/xstate-animation-meta.d.ts +0 -266
- package/dist/animation/xstate-animation-meta.d.ts.map +0 -1
- package/dist/animation/xstate-animation-meta.js +0 -252
- package/dist/assets.d.ts +0 -26
- package/dist/assets.d.ts.map +0 -1
- package/dist/assets.js +0 -55
- package/dist/audio/index.d.ts +0 -4
- package/dist/audio/index.d.ts.map +0 -1
- package/dist/audio/index.js +0 -24
- package/dist/audio/tone-clock-binding.d.ts +0 -75
- package/dist/audio/tone-clock-binding.d.ts.map +0 -1
- package/dist/audio/tone-clock-binding.js +0 -29
- package/dist/audio/tone-context.d.ts +0 -114
- package/dist/audio/tone-context.d.ts.map +0 -1
- package/dist/audio/tone-context.js +0 -39
- package/dist/audio/tone-offline-render.d.ts +0 -90
- package/dist/audio/tone-offline-render.d.ts.map +0 -1
- package/dist/audio/tone-offline-render.js +0 -56
- package/dist/audio/wav-encode.d.ts +0 -38
- package/dist/audio/wav-encode.d.ts.map +0 -1
- package/dist/audio/wav-encode.js +0 -97
- package/dist/character/cloth-sim.d.ts +0 -179
- package/dist/character/cloth-sim.d.ts.map +0 -1
- package/dist/character/cloth-sim.js +0 -334
- package/dist/character/spring-chain.d.ts +0 -135
- package/dist/character/spring-chain.d.ts.map +0 -1
- package/dist/character/spring-chain.js +0 -165
- package/dist/core/game-loop.d.ts +0 -42
- package/dist/core/game-loop.d.ts.map +0 -1
- package/dist/core/game-loop.js +0 -167
- package/dist/core/seeded-random.d.ts +0 -69
- package/dist/core/seeded-random.d.ts.map +0 -1
- package/dist/core/seeded-random.js +0 -121
- package/dist/core/system-runner.d.ts +0 -120
- package/dist/core/system-runner.d.ts.map +0 -1
- package/dist/core/system-runner.js +0 -297
- package/dist/core/types.d.ts +0 -92
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -25
- package/dist/data/data-asset.d.ts +0 -101
- package/dist/data/data-asset.d.ts.map +0 -1
- package/dist/data/data-asset.js +0 -122
- package/dist/data/data-check-core.d.ts +0 -110
- package/dist/data/data-check-core.d.ts.map +0 -1
- package/dist/data/data-check-core.js +0 -178
- package/dist/data/data-ref.d.ts +0 -79
- package/dist/data/data-ref.d.ts.map +0 -1
- package/dist/data/data-ref.js +0 -130
- package/dist/data/vite-plugin-data.d.ts +0 -79
- package/dist/data/vite-plugin-data.d.ts.map +0 -1
- package/dist/data/vite-plugin-data.js +0 -217
- package/dist/dev/console-bridge.d.ts +0 -22
- package/dist/dev/console-bridge.d.ts.map +0 -1
- package/dist/dev/console-bridge.js +0 -71
- package/dist/dev/debug-draw.d.ts +0 -24
- package/dist/dev/debug-draw.d.ts.map +0 -1
- package/dist/dev/debug-draw.js +0 -73
- package/dist/dev/logger.d.ts +0 -30
- package/dist/dev/logger.d.ts.map +0 -1
- package/dist/dev/logger.js +0 -90
- package/dist/dev/performance-profiler.d.ts +0 -60
- package/dist/dev/performance-profiler.d.ts.map +0 -1
- package/dist/dev/performance-profiler.js +0 -181
- package/dist/dev/webgl-gpu-timer.d.ts +0 -8
- package/dist/dev/webgl-gpu-timer.d.ts.map +0 -1
- package/dist/dev/webgl-gpu-timer.js +0 -52
- package/dist/ecs/component-manager.d.ts +0 -205
- package/dist/ecs/component-manager.d.ts.map +0 -1
- package/dist/ecs/component-manager.js +0 -706
- package/dist/ecs/game-component.d.ts +0 -146
- package/dist/ecs/game-component.d.ts.map +0 -1
- package/dist/ecs/game-component.js +0 -141
- package/dist/ecs/hmr-swap-report.d.ts +0 -53
- package/dist/ecs/hmr-swap-report.d.ts.map +0 -1
- package/dist/ecs/hmr-swap-report.js +0 -55
- package/dist/humanoid/bake.operation.d.ts +0 -119
- package/dist/humanoid/bake.operation.d.ts.map +0 -1
- package/dist/humanoid/bake.operation.js +0 -228
- package/dist/humanoid/body.d.ts +0 -101
- package/dist/humanoid/body.d.ts.map +0 -1
- package/dist/humanoid/body.js +0 -530
- package/dist/humanoid/clips.d.ts +0 -62
- package/dist/humanoid/clips.d.ts.map +0 -1
- package/dist/humanoid/clips.js +0 -121
- package/dist/humanoid/compose.d.ts +0 -75
- package/dist/humanoid/compose.d.ts.map +0 -1
- package/dist/humanoid/compose.js +0 -176
- package/dist/humanoid/generate.d.ts +0 -92
- package/dist/humanoid/generate.d.ts.map +0 -1
- package/dist/humanoid/generate.js +0 -124
- package/dist/humanoid/index.d.ts +0 -24
- package/dist/humanoid/index.d.ts.map +0 -1
- package/dist/humanoid/index.js +0 -18
- package/dist/humanoid/schema.d.ts +0 -35
- package/dist/humanoid/schema.d.ts.map +0 -1
- package/dist/humanoid/schema.js +0 -87
- package/dist/humanoid/skeleton.d.ts +0 -103
- package/dist/humanoid/skeleton.d.ts.map +0 -1
- package/dist/humanoid/skeleton.js +0 -289
- package/dist/index.d.ts +0 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -30
- package/dist/input/input-manager.d.ts +0 -945
- package/dist/input/input-manager.d.ts.map +0 -1
- package/dist/input/input-manager.js +0 -2207
- package/dist/input/input-types.d.ts +0 -174
- package/dist/input/input-types.d.ts.map +0 -1
- package/dist/input/input-types.js +0 -1
- package/dist/input/prompt-labels.d.ts +0 -21
- package/dist/input/prompt-labels.d.ts.map +0 -1
- package/dist/input/prompt-labels.js +0 -121
- package/dist/input/rebind-controller.d.ts +0 -59
- package/dist/input/rebind-controller.d.ts.map +0 -1
- package/dist/input/rebind-controller.js +0 -85
- package/dist/input/schema.d.ts +0 -16
- package/dist/input/schema.d.ts.map +0 -1
- package/dist/input/schema.js +0 -228
- package/dist/loader.d.ts +0 -43
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -59
- package/dist/manifest/index.d.ts +0 -5
- package/dist/manifest/index.d.ts.map +0 -1
- package/dist/manifest/index.js +0 -8
- package/dist/manifest/load-file.d.ts +0 -4
- package/dist/manifest/load-file.d.ts.map +0 -1
- package/dist/manifest/load-file.js +0 -14
- package/dist/manifest/load.d.ts +0 -144
- package/dist/manifest/load.d.ts.map +0 -1
- package/dist/manifest/load.js +0 -273
- package/dist/manifest/schema.d.ts +0 -230
- package/dist/manifest/schema.d.ts.map +0 -1
- package/dist/manifest/schema.js +0 -394
- package/dist/physics/collision-system.d.ts +0 -41
- package/dist/physics/collision-system.d.ts.map +0 -1
- package/dist/physics/collision-system.js +0 -64
- package/dist/physics/physics-registry.d.ts +0 -45
- package/dist/physics/physics-registry.d.ts.map +0 -1
- package/dist/physics/physics-registry.js +0 -65
- package/dist/physics/transform-writer.d.ts +0 -16
- package/dist/physics/transform-writer.d.ts.map +0 -1
- package/dist/physics/transform-writer.js +0 -38
- package/dist/physics/trigger-dispatch.d.ts +0 -24
- package/dist/physics/trigger-dispatch.d.ts.map +0 -1
- package/dist/physics/trigger-dispatch.js +0 -80
- package/dist/react/game-state.d.ts +0 -156
- package/dist/react/game-state.d.ts.map +0 -1
- package/dist/react/game-state.js +0 -222
- package/dist/react/root-adapter.d.ts +0 -11
- package/dist/react/root-adapter.d.ts.map +0 -1
- package/dist/react/root-adapter.js +0 -41
- package/dist/react/unmanaged-root-detector.d.ts +0 -12
- package/dist/react/unmanaged-root-detector.d.ts.map +0 -1
- package/dist/react/unmanaged-root-detector.js +0 -45
- package/dist/react/use-data.d.ts +0 -60
- package/dist/react/use-data.d.ts.map +0 -1
- package/dist/react/use-data.js +0 -101
- package/dist/react/use-selection.d.ts +0 -75
- package/dist/react/use-selection.d.ts.map +0 -1
- package/dist/react/use-selection.js +0 -90
- package/dist/render/auto-batcher.d.ts +0 -34
- package/dist/render/auto-batcher.d.ts.map +0 -1
- package/dist/render/auto-batcher.js +0 -140
- package/dist/render/render-batch-system.d.ts +0 -33
- package/dist/render/render-batch-system.d.ts.map +0 -1
- package/dist/render/render-batch-system.js +0 -230
- package/dist/render/render-features.d.ts +0 -47
- package/dist/render/render-features.d.ts.map +0 -1
- package/dist/render/render-features.js +0 -105
- package/dist/render/render-settings.d.ts +0 -36
- package/dist/render/render-settings.d.ts.map +0 -1
- package/dist/render/render-settings.js +0 -51
- package/dist/runtime/create-runtime.d.ts +0 -249
- package/dist/runtime/create-runtime.d.ts.map +0 -1
- package/dist/runtime/create-runtime.js +0 -641
- package/dist/runtime/debug-bridge.d.ts +0 -257
- package/dist/runtime/debug-bridge.d.ts.map +0 -1
- package/dist/runtime/debug-bridge.js +0 -224
- package/dist/runtime/debug-registry.d.ts +0 -288
- package/dist/runtime/debug-registry.d.ts.map +0 -1
- package/dist/runtime/debug-registry.js +0 -513
- package/dist/runtime/frame-selector-cache.d.ts +0 -41
- package/dist/runtime/frame-selector-cache.d.ts.map +0 -1
- package/dist/runtime/frame-selector-cache.js +0 -65
- package/dist/runtime/game.d.ts +0 -496
- package/dist/runtime/game.d.ts.map +0 -1
- package/dist/runtime/game.js +0 -741
- package/dist/runtime/gameplay-rng-trap.d.ts +0 -48
- package/dist/runtime/gameplay-rng-trap.d.ts.map +0 -1
- package/dist/runtime/gameplay-rng-trap.js +0 -96
- package/dist/runtime/input-router.d.ts +0 -78
- package/dist/runtime/input-router.d.ts.map +0 -1
- package/dist/runtime/input-router.js +0 -171
- package/dist/runtime/mount-game.d.ts +0 -129
- package/dist/runtime/mount-game.d.ts.map +0 -1
- package/dist/runtime/mount-game.js +0 -152
- package/dist/runtime/mount-manifest.d.ts +0 -173
- package/dist/runtime/mount-manifest.d.ts.map +0 -1
- package/dist/runtime/mount-manifest.js +0 -297
- package/dist/runtime/render-audio-control.d.ts +0 -110
- package/dist/runtime/render-audio-control.d.ts.map +0 -1
- package/dist/runtime/render-audio-control.js +0 -111
- package/dist/runtime/render-control.d.ts +0 -291
- package/dist/runtime/render-control.d.ts.map +0 -1
- package/dist/runtime/render-control.js +0 -264
- package/dist/runtime/render-seed.d.ts +0 -57
- package/dist/runtime/render-seed.d.ts.map +0 -1
- package/dist/runtime/render-seed.js +0 -74
- package/dist/runtime/state-bridge.d.ts +0 -61
- package/dist/runtime/state-bridge.d.ts.map +0 -1
- package/dist/runtime/state-bridge.js +0 -63
- package/dist/runtime/types.d.ts +0 -253
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/types.js +0 -1
- package/dist/scene/asset-loaders.d.ts +0 -79
- package/dist/scene/asset-loaders.d.ts.map +0 -1
- package/dist/scene/asset-loaders.js +0 -141
- package/dist/scene/asset-paths.d.ts +0 -11
- package/dist/scene/asset-paths.d.ts.map +0 -1
- package/dist/scene/asset-paths.js +0 -108
- package/dist/scene/asset-ref-check.d.ts +0 -88
- package/dist/scene/asset-ref-check.d.ts.map +0 -1
- package/dist/scene/asset-ref-check.js +0 -214
- package/dist/scene/asset-registry.d.ts +0 -38
- package/dist/scene/asset-registry.d.ts.map +0 -1
- package/dist/scene/asset-registry.js +0 -66
- package/dist/scene/collider-dimensions.d.ts +0 -63
- package/dist/scene/collider-dimensions.d.ts.map +0 -1
- package/dist/scene/collider-dimensions.js +0 -98
- package/dist/scene/component-registry.d.ts +0 -22
- package/dist/scene/component-registry.d.ts.map +0 -1
- package/dist/scene/component-registry.js +0 -37
- package/dist/scene/defaults.d.ts +0 -252
- package/dist/scene/defaults.d.ts.map +0 -1
- package/dist/scene/defaults.js +0 -151
- package/dist/scene/geometries/index.d.ts +0 -8
- package/dist/scene/geometries/index.d.ts.map +0 -1
- package/dist/scene/geometries/index.js +0 -7
- package/dist/scene/geometries/terrain.d.ts +0 -2
- package/dist/scene/geometries/terrain.d.ts.map +0 -1
- package/dist/scene/geometries/terrain.js +0 -37
- package/dist/scene/geometry-registry.d.ts +0 -24
- package/dist/scene/geometry-registry.d.ts.map +0 -1
- package/dist/scene/geometry-registry.js +0 -20
- package/dist/scene/instance-registry.d.ts +0 -36
- package/dist/scene/instance-registry.d.ts.map +0 -1
- package/dist/scene/instance-registry.js +0 -55
- package/dist/scene/instancers/grid.d.ts +0 -2
- package/dist/scene/instancers/grid.d.ts.map +0 -1
- package/dist/scene/instancers/grid.js +0 -36
- package/dist/scene/instancers/index.d.ts +0 -8
- package/dist/scene/instancers/index.d.ts.map +0 -1
- package/dist/scene/instancers/index.js +0 -7
- package/dist/scene/light-camera-factory.d.ts +0 -23
- package/dist/scene/light-camera-factory.d.ts.map +0 -1
- package/dist/scene/light-camera-factory.js +0 -68
- package/dist/scene/material-factory.d.ts +0 -17
- package/dist/scene/material-factory.d.ts.map +0 -1
- package/dist/scene/material-factory.js +0 -197
- package/dist/scene/material-registry.d.ts +0 -40
- package/dist/scene/material-registry.d.ts.map +0 -1
- package/dist/scene/material-registry.js +0 -44
- package/dist/scene/materials/index.d.ts +0 -8
- package/dist/scene/materials/index.d.ts.map +0 -1
- package/dist/scene/materials/index.js +0 -7
- package/dist/scene/materials/water.d.ts +0 -2
- package/dist/scene/materials/water.d.ts.map +0 -1
- package/dist/scene/materials/water.js +0 -54
- package/dist/scene/parse.d.ts +0 -23
- package/dist/scene/parse.d.ts.map +0 -1
- package/dist/scene/parse.js +0 -179
- package/dist/scene/particles-factory.d.ts +0 -33
- package/dist/scene/particles-factory.d.ts.map +0 -1
- package/dist/scene/particles-factory.js +0 -282
- package/dist/scene/scene-apply.d.ts +0 -109
- package/dist/scene/scene-apply.d.ts.map +0 -1
- package/dist/scene/scene-apply.js +0 -370
- package/dist/scene/scene-diff-schema.d.ts +0 -285
- package/dist/scene/scene-diff-schema.d.ts.map +0 -1
- package/dist/scene/scene-diff-schema.js +0 -92
- package/dist/scene/scene-diff-types.d.ts +0 -40
- package/dist/scene/scene-diff-types.d.ts.map +0 -1
- package/dist/scene/scene-diff-types.js +0 -14
- package/dist/scene/scene-loader.d.ts +0 -167
- package/dist/scene/scene-loader.d.ts.map +0 -1
- package/dist/scene/scene-loader.js +0 -1211
- package/dist/scene/scene-query.d.ts +0 -11
- package/dist/scene/scene-query.d.ts.map +0 -1
- package/dist/scene/scene-query.js +0 -63
- package/dist/scene/scene-types.d.ts +0 -10
- package/dist/scene/scene-types.d.ts.map +0 -1
- package/dist/scene/scene-types.js +0 -8
- package/dist/scene/scene-version.d.ts +0 -26
- package/dist/scene/scene-version.d.ts.map +0 -1
- package/dist/scene/scene-version.js +0 -34
- package/dist/scene/schema/animation.d.ts +0 -8
- package/dist/scene/schema/animation.d.ts.map +0 -1
- package/dist/scene/schema/animation.js +0 -42
- package/dist/scene/schema/audio.d.ts +0 -13
- package/dist/scene/schema/audio.d.ts.map +0 -1
- package/dist/scene/schema/audio.js +0 -22
- package/dist/scene/schema/camera.d.ts +0 -28
- package/dist/scene/schema/camera.d.ts.map +0 -1
- package/dist/scene/schema/camera.js +0 -17
- package/dist/scene/schema/collider.d.ts +0 -40
- package/dist/scene/schema/collider.d.ts.map +0 -1
- package/dist/scene/schema/collider.js +0 -55
- package/dist/scene/schema/entity-ref.d.ts +0 -31
- package/dist/scene/schema/entity-ref.d.ts.map +0 -1
- package/dist/scene/schema/entity-ref.js +0 -61
- package/dist/scene/schema/entity.d.ts +0 -1036
- package/dist/scene/schema/entity.d.ts.map +0 -1
- package/dist/scene/schema/entity.js +0 -153
- package/dist/scene/schema/environment.d.ts +0 -425
- package/dist/scene/schema/environment.d.ts.map +0 -1
- package/dist/scene/schema/environment.js +0 -357
- package/dist/scene/schema/index.d.ts +0 -37
- package/dist/scene/schema/index.d.ts.map +0 -1
- package/dist/scene/schema/index.js +0 -19
- package/dist/scene/schema/instances.d.ts +0 -14
- package/dist/scene/schema/instances.d.ts.map +0 -1
- package/dist/scene/schema/instances.js +0 -28
- package/dist/scene/schema/joint.d.ts +0 -23
- package/dist/scene/schema/joint.d.ts.map +0 -1
- package/dist/scene/schema/joint.js +0 -23
- package/dist/scene/schema/light.d.ts +0 -38
- package/dist/scene/schema/light.d.ts.map +0 -1
- package/dist/scene/schema/light.js +0 -26
- package/dist/scene/schema/material.d.ts +0 -199
- package/dist/scene/schema/material.d.ts.map +0 -1
- package/dist/scene/schema/material.js +0 -103
- package/dist/scene/schema/mesh.d.ts +0 -48
- package/dist/scene/schema/mesh.d.ts.map +0 -1
- package/dist/scene/schema/mesh.js +0 -82
- package/dist/scene/schema/particles.d.ts +0 -2178
- package/dist/scene/schema/particles.d.ts.map +0 -1
- package/dist/scene/schema/particles.js +0 -321
- package/dist/scene/schema/physics.d.ts +0 -56
- package/dist/scene/schema/physics.d.ts.map +0 -1
- package/dist/scene/schema/physics.js +0 -37
- package/dist/scene/schema/scene-file.d.ts +0 -303
- package/dist/scene/schema/scene-file.d.ts.map +0 -1
- package/dist/scene/schema/scene-file.js +0 -256
- package/dist/scene/schema/shadow.d.ts +0 -28
- package/dist/scene/schema/shadow.d.ts.map +0 -1
- package/dist/scene/schema/shadow.js +0 -20
- package/dist/scene/schema/spline.d.ts +0 -25
- package/dist/scene/schema/spline.d.ts.map +0 -1
- package/dist/scene/schema/spline.js +0 -15
- package/dist/scene/schema/tuples.d.ts +0 -12
- package/dist/scene/schema/tuples.d.ts.map +0 -1
- package/dist/scene/schema/tuples.js +0 -14
- package/dist/scene/user-data.d.ts +0 -185
- package/dist/scene/user-data.d.ts.map +0 -1
- package/dist/scene/user-data.js +0 -144
- package/dist/setup/setup-audio.d.ts +0 -20
- package/dist/setup/setup-audio.d.ts.map +0 -1
- package/dist/setup/setup-audio.js +0 -41
- package/dist/setup/setup-particles.d.ts +0 -17
- package/dist/setup/setup-particles.d.ts.map +0 -1
- package/dist/setup/setup-particles.js +0 -16
- package/dist/setup/setup-physics.d.ts +0 -25
- package/dist/setup/setup-physics.d.ts.map +0 -1
- package/dist/setup/setup-physics.js +0 -51
- package/dist/setup/setup-renderer.d.ts +0 -69
- package/dist/setup/setup-renderer.d.ts.map +0 -1
- package/dist/setup/setup-renderer.js +0 -363
- package/dist/tools/define-tool.d.ts +0 -130
- package/dist/tools/define-tool.d.ts.map +0 -1
- package/dist/tools/define-tool.js +0 -96
- package/dist/world2d/authoring-2d.d.ts +0 -80
- package/dist/world2d/authoring-2d.d.ts.map +0 -1
- package/dist/world2d/authoring-2d.js +0 -195
- package/dist/world2d/capture-to-scene2d.d.ts +0 -5
- package/dist/world2d/capture-to-scene2d.d.ts.map +0 -1
- package/dist/world2d/capture-to-scene2d.js +0 -49
- package/dist/world2d/collision-2d.d.ts +0 -52
- package/dist/world2d/collision-2d.d.ts.map +0 -1
- package/dist/world2d/collision-2d.js +0 -70
- package/dist/world2d/components-2d.d.ts +0 -47
- package/dist/world2d/components-2d.d.ts.map +0 -1
- package/dist/world2d/components-2d.js +0 -77
- package/dist/world2d/index.d.ts +0 -34
- package/dist/world2d/index.d.ts.map +0 -1
- package/dist/world2d/index.js +0 -32
- package/dist/world2d/ingest-iframe-2d.d.ts +0 -82
- package/dist/world2d/ingest-iframe-2d.d.ts.map +0 -1
- package/dist/world2d/ingest-iframe-2d.js +0 -166
- package/dist/world2d/ingest2d.d.ts +0 -97
- package/dist/world2d/ingest2d.d.ts.map +0 -1
- package/dist/world2d/ingest2d.js +0 -40
- package/dist/world2d/physics2d-registry.d.ts +0 -24
- package/dist/world2d/physics2d-registry.d.ts.map +0 -1
- package/dist/world2d/physics2d-registry.js +0 -38
- package/dist/world2d/pixi-game-adapter.d.ts +0 -107
- package/dist/world2d/pixi-game-adapter.d.ts.map +0 -1
- package/dist/world2d/pixi-game-adapter.js +0 -210
- package/dist/world2d/pixi-surface.d.ts +0 -39
- package/dist/world2d/pixi-surface.d.ts.map +0 -1
- package/dist/world2d/pixi-surface.js +0 -47
- package/dist/world2d/scene-capture-2d.d.ts +0 -43
- package/dist/world2d/scene-capture-2d.d.ts.map +0 -1
- package/dist/world2d/scene-capture-2d.js +0 -92
- package/dist/world2d/scene2d-loader.d.ts +0 -27
- package/dist/world2d/scene2d-loader.d.ts.map +0 -1
- package/dist/world2d/scene2d-loader.js +0 -275
- package/dist/world2d/schema/entity2d.d.ts +0 -102
- package/dist/world2d/schema/entity2d.d.ts.map +0 -1
- package/dist/world2d/schema/entity2d.js +0 -119
- package/dist/world2d/schema/physics2d.d.ts +0 -46
- package/dist/world2d/schema/physics2d.d.ts.map +0 -1
- package/dist/world2d/schema/physics2d.js +0 -45
- package/dist/world2d/schema/sprite.d.ts +0 -42
- package/dist/world2d/schema/sprite.d.ts.map +0 -1
- package/dist/world2d/schema/sprite.js +0 -63
- package/dist/world2d/schema/tilemap.d.ts +0 -15
- package/dist/world2d/schema/tilemap.d.ts.map +0 -1
- package/dist/world2d/schema/tilemap.js +0 -19
- package/dist/world2d/schema/tuples2d.d.ts +0 -20
- package/dist/world2d/schema/tuples2d.d.ts.map +0 -1
- package/dist/world2d/schema/tuples2d.js +0 -19
- package/dist/world2d/system-adapters-2d.d.ts +0 -16
- package/dist/world2d/system-adapters-2d.d.ts.map +0 -1
- package/dist/world2d/system-adapters-2d.js +0 -37
- package/dist/world2d/transform-writer-2d.d.ts +0 -16
- package/dist/world2d/transform-writer-2d.d.ts.map +0 -1
- package/dist/world2d/transform-writer-2d.js +0 -22
- package/dist/world2d/types.d.ts +0 -59
- package/dist/world2d/types.d.ts.map +0 -1
- package/dist/world2d/types.js +0 -1
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
|
|
3
|
-
* INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
|
|
4
|
-
* "is this object replicated, who owns it, may I edit it" — and, for the network
|
|
5
|
-
* inspector panel, "am I connected, to which room, how much replication activity
|
|
6
|
-
* is happening" — without owning Colyseus.
|
|
7
|
-
*
|
|
8
|
-
* It is parameterized by accessors over the room state (rather than a fixed schema)
|
|
9
|
-
* so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
|
|
10
|
-
* report the local session and peers, and report connection/room/stats for the
|
|
11
|
-
* inspector. The editor uses `authority`/`editable` to keep remote/server-
|
|
12
|
-
* authoritative objects inspect-only (editing a replicated transform locally is
|
|
13
|
-
* meaningless — the server overwrites it next snapshot).
|
|
14
|
-
*/
|
|
15
|
-
export function createColyseusNetworkingAdapter(cfg) {
|
|
16
|
-
return {
|
|
17
|
-
peers: () => cfg.peers(),
|
|
18
|
-
networkId: (o) => cfg.networkId(o),
|
|
19
|
-
authority: (o) => {
|
|
20
|
-
if (cfg.networkId(o) == null)
|
|
21
|
-
return 'local'; // not replicated → local authored
|
|
22
|
-
if (cfg.serverAuthoritative?.(o))
|
|
23
|
-
return 'server';
|
|
24
|
-
return cfg.ownerId(o) === cfg.localSessionId() ? 'local' : 'remote';
|
|
25
|
-
},
|
|
26
|
-
editable: (o) => {
|
|
27
|
-
if (cfg.networkId(o) == null)
|
|
28
|
-
return true; // local authored object
|
|
29
|
-
if (cfg.serverAuthoritative?.(o))
|
|
30
|
-
return false; // server owns it → inspect-only
|
|
31
|
-
return cfg.ownerId(o) === cfg.localSessionId(); // only your own peer's objects
|
|
32
|
-
},
|
|
33
|
-
getConnectionState: () => cfg.connectionState?.() ?? 'disconnected',
|
|
34
|
-
getRoomInfo: () => cfg.roomInfo?.() ?? null,
|
|
35
|
-
getReplicationStats: () => cfg.replicationStats?.() ?? { entities: 0, msgsInPerSec: 0, msgsOutPerSec: 0 },
|
|
36
|
-
subscribe: (cb) => cfg.subscribe?.(cb) ?? (() => { }),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First-party implementations of the remaining `SystemAdapters` — input, assets,
|
|
3
|
-
* navigation — each a thin coordination/introspection boundary over the real
|
|
4
|
-
* engine subsystem (the original vision named these as first-class System
|
|
5
|
-
* adapters; physics + networking shipped earlier). The editor speaks only the
|
|
6
|
-
* interfaces; these wrap `InputManager`, the asset loader, and `NavMeshManager`
|
|
7
|
-
* so an external game could supply its own equivalents. (The former
|
|
8
|
-
* `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
|
|
9
|
-
* removed by E5 — AnimGraph no longer exists; see
|
|
10
|
-
* docs/AI-NATIVE-AUTHORING-IMPLEMENTATION-SPEC.md §3.3/§11 E5.)
|
|
11
|
-
*/
|
|
12
|
-
import type { NavMeshManager } from '../ai/navigation';
|
|
13
|
-
import type { InputManager } from '../input/input-manager';
|
|
14
|
-
import type { AudioContext as GameAudio } from '../setup/setup-audio';
|
|
15
|
-
import type { AssetAdapter, AudioAdapter, InputAdapter, NavigationAdapter } from './system-adapter';
|
|
16
|
-
/** First-party `InputAdapter` over the engine `InputManager`. Reads each action through
|
|
17
|
-
* `InputManager.readAction`, dispatched on that action's OWN declared `valueType`
|
|
18
|
-
* (`getActionValueType`) — never a hardcoded getter — so a scalar/Vector2/pointer action
|
|
19
|
-
* surfaces its real typed value instead of being coerced through `isPressed` (F1-followup;
|
|
20
|
-
* `readAction` on the wrong type would throw, so dispatch must follow the declared type). */
|
|
21
|
-
export declare function createInputManagerAdapter(input: InputManager): InputAdapter;
|
|
22
|
-
/** First-party `AssetAdapter` — resolves URLs through the engine loader (which
|
|
23
|
-
* applies the project base + downloaded-asset remap). External/ingest games can
|
|
24
|
-
* supply their own to redirect relative paths. */
|
|
25
|
-
export declare function createVgaiAssetAdapter(): AssetAdapter;
|
|
26
|
-
/**
|
|
27
|
-
* First-party `AudioAdapter` over the engine's master-gain bus
|
|
28
|
-
* (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
|
|
29
|
-
* (D10, T7.6) calls to silence a first-party world's audio. Restoring after a
|
|
30
|
-
* mute puts the gain back at whatever value it held right before muting (not
|
|
31
|
-
* a hardcoded `1`) — this composes correctly with an independent manual mute
|
|
32
|
-
* (the editor's `MuteButton`, `PlayBar.tsx`): pausing while already
|
|
33
|
-
* user-muted resumes muted, exactly as a user would expect.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createAudioSystemAdapter(audio: GameAudio): AudioAdapter;
|
|
36
|
-
/** First-party `NavigationAdapter` over the engine `NavMeshManager`. */
|
|
37
|
-
export declare function createNavigationAdapter(nav: NavMeshManager): NavigationAdapter;
|
|
38
|
-
//# sourceMappingURL=first-party-systems.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"first-party-systems.d.ts","sourceRoot":"","sources":["../../src/adapter/first-party-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAEV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAE1B;;;;8FAI8F;AAC9F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAiB3E;AAED;;mDAEmD;AACnD,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAgBvE;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,CAM9E"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First-party implementations of the remaining `SystemAdapters` — input, assets,
|
|
3
|
-
* navigation — each a thin coordination/introspection boundary over the real
|
|
4
|
-
* engine subsystem (the original vision named these as first-class System
|
|
5
|
-
* adapters; physics + networking shipped earlier). The editor speaks only the
|
|
6
|
-
* interfaces; these wrap `InputManager`, the asset loader, and `NavMeshManager`
|
|
7
|
-
* so an external game could supply its own equivalents. (The former
|
|
8
|
-
* `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
|
|
9
|
-
* removed by E5 — AnimGraph no longer exists; see
|
|
10
|
-
* docs/AI-NATIVE-AUTHORING-IMPLEMENTATION-SPEC.md §3.3/§11 E5.)
|
|
11
|
-
*/
|
|
12
|
-
import { resolveUrl } from '../loader';
|
|
13
|
-
/** First-party `InputAdapter` over the engine `InputManager`. Reads each action through
|
|
14
|
-
* `InputManager.readAction`, dispatched on that action's OWN declared `valueType`
|
|
15
|
-
* (`getActionValueType`) — never a hardcoded getter — so a scalar/Vector2/pointer action
|
|
16
|
-
* surfaces its real typed value instead of being coerced through `isPressed` (F1-followup;
|
|
17
|
-
* `readAction` on the wrong type would throw, so dispatch must follow the declared type). */
|
|
18
|
-
export function createInputManagerAdapter(input) {
|
|
19
|
-
return {
|
|
20
|
-
poll: () => input.poll(),
|
|
21
|
-
actions: () => {
|
|
22
|
-
const out = {};
|
|
23
|
-
for (const name of input.actionNames()) {
|
|
24
|
-
const type = input.getActionValueType(name);
|
|
25
|
-
// `readAction`'s return type is inferred from a literal `expectedType`; with `type`
|
|
26
|
-
// widened to `ActionValueType` here it collapses to `boolean | number | Vector2`, so
|
|
27
|
-
// digital's `boolean` is normalized to the adapter's 1/0 the same way the old digital-
|
|
28
|
-
// only adapter did — every other value type already reads as `number | Vector2`.
|
|
29
|
-
const raw = input.readAction(name, type);
|
|
30
|
-
out[name] = { type, value: typeof raw === 'boolean' ? (raw ? 1 : 0) : raw };
|
|
31
|
-
}
|
|
32
|
-
return out;
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/** First-party `AssetAdapter` — resolves URLs through the engine loader (which
|
|
37
|
-
* applies the project base + downloaded-asset remap). External/ingest games can
|
|
38
|
-
* supply their own to redirect relative paths. */
|
|
39
|
-
export function createVgaiAssetAdapter() {
|
|
40
|
-
return { resolve: (url) => resolveUrl(url) };
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* First-party `AudioAdapter` over the engine's master-gain bus
|
|
44
|
-
* (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
|
|
45
|
-
* (D10, T7.6) calls to silence a first-party world's audio. Restoring after a
|
|
46
|
-
* mute puts the gain back at whatever value it held right before muting (not
|
|
47
|
-
* a hardcoded `1`) — this composes correctly with an independent manual mute
|
|
48
|
-
* (the editor's `MuteButton`, `PlayBar.tsx`): pausing while already
|
|
49
|
-
* user-muted resumes muted, exactly as a user would expect.
|
|
50
|
-
*/
|
|
51
|
-
export function createAudioSystemAdapter(audio) {
|
|
52
|
-
let muted = false;
|
|
53
|
-
let priorGain = audio.masterGain.gain.value;
|
|
54
|
-
return {
|
|
55
|
-
setMuted(next) {
|
|
56
|
-
if (next === muted)
|
|
57
|
-
return;
|
|
58
|
-
muted = next;
|
|
59
|
-
if (next) {
|
|
60
|
-
priorGain = audio.masterGain.gain.value;
|
|
61
|
-
audio.masterGain.gain.value = 0;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
audio.masterGain.gain.value = priorGain;
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
isMuted: () => muted,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/** First-party `NavigationAdapter` over the engine `NavMeshManager`. */
|
|
71
|
-
export function createNavigationAdapter(nav) {
|
|
72
|
-
return {
|
|
73
|
-
hasNavMesh: () => nav.hasNavMesh(),
|
|
74
|
-
findPath: (start, end) => nav.findPath(start, end),
|
|
75
|
-
debugMesh: (scene) => nav.getDebugMesh(scene),
|
|
76
|
-
};
|
|
77
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameAdapter — the host ⇄ runtime contract. A "game" is *anything that mounts*.
|
|
3
|
-
*
|
|
4
|
-
* This is the interface the HOST depends on. It replaces the old
|
|
5
|
-
* `{ setup, components }` shape: the host no longer knows about `GameSetupFn`,
|
|
6
|
-
* `.vscn`, or `GameComponent` — those are the internals of ONE implementer
|
|
7
|
-
* (`VgaiSceneGameAdapter`). First-party content and an unmodified external game
|
|
8
|
-
* are peer implementers of THIS interface; the host has no branch on which.
|
|
9
|
-
*/
|
|
10
|
-
import type { Container } from 'pixi.js';
|
|
11
|
-
import type * as THREE from 'three';
|
|
12
|
-
import type { AdapterSurface } from './adapter-surface';
|
|
13
|
-
import type { AuthoringAdapter } from './authoring';
|
|
14
|
-
import type { HostContext } from './host-context';
|
|
15
|
-
import type { SystemAdapters } from './system-adapter';
|
|
16
|
-
/**
|
|
17
|
-
* The ingested-world observation contract (T7.4 slice 2 — `docs/
|
|
18
|
-
* REACT-STATE-BRIDGE.md` §4, "the must-answer"). Cross-world data flow with a
|
|
19
|
-
* foreign game is observation via an adapter-provided interface, not ordinary
|
|
20
|
-
* component access (that's D7's answer for first-party↔first-party flow —
|
|
21
|
-
* foreign games host no `GameComponent`s). Optional on {@link MountedGame} —
|
|
22
|
-
* absence means the adapter has nothing genuinely observable to expose (the
|
|
23
|
-
* anti-shim rule: never fabricate state), and the world takes the honest
|
|
24
|
-
* "no state bridge" tier hit (see `Game.registerWorld` in `runtime/game.ts`)
|
|
25
|
-
* rather than silently offering an `undefined`-forever subscription.
|
|
26
|
-
*/
|
|
27
|
-
export interface WorldStateObserver {
|
|
28
|
-
/**
|
|
29
|
-
* Notified at most once per frame IF the adapter can hook the game's own
|
|
30
|
-
* update (`loop: 'gated'` roots, `docs/CAPABILITY-TIERS.md` §(d));
|
|
31
|
-
* self-driven roots (`loop: 'self-driven'`, raw-rAF) may notify on their
|
|
32
|
-
* OWN rAF cadence instead — consumers must not assume our frame timing.
|
|
33
|
-
* Returns an unsubscribe function.
|
|
34
|
-
*/
|
|
35
|
-
subscribe(onChange: () => void): () => void;
|
|
36
|
-
/**
|
|
37
|
-
* A cheap, adapter-chosen snapshot of this world's observable state.
|
|
38
|
-
* Returns a STABLE reference while nothing has changed (so a selector run
|
|
39
|
-
* over it can cheaply bail out by reference, same spirit as
|
|
40
|
-
* `GameStateBridge`'s frame-version cache). Shape is adapter-defined —
|
|
41
|
-
* not centrally schematized in v1 (see `docs/REACT-STATE-BRIDGE.md` §6).
|
|
42
|
-
*/
|
|
43
|
-
snapshot(): unknown;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Everything a mounted world provides EXCEPT its render surface (T7.5,
|
|
47
|
-
* `docs/BACKBONE-TASKS.md`'s D6 row — "replace THREE.Scene/THREE.Camera
|
|
48
|
-
* typing with kind-tagged world surfaces"). Split out of the old flat
|
|
49
|
-
* `MountedGame` so a non-threejs world can carry its own kind-appropriate
|
|
50
|
-
* surface field (a pixi `stage`, a react `container`) instead of being
|
|
51
|
-
* force-fit through THREE `scene`/`camera` fields it doesn't have.
|
|
52
|
-
*/
|
|
53
|
-
export interface MountedWorldBase {
|
|
54
|
-
/**
|
|
55
|
-
* Loop model:
|
|
56
|
-
* - `false` (host-driven): first-party + "clean" externals. The host ticks
|
|
57
|
-
* `update(dt)` in its loop.
|
|
58
|
-
* - `true` (self-driven): an unmodified game that owns its renderer + rAF.
|
|
59
|
-
* The host does NOT tick it. Pause/step control is a DECLARED CAPABILITY,
|
|
60
|
-
* not a promise: implement `setPaused`/`step` only where the game exposes
|
|
61
|
-
* a sanctioned pause/step mechanism. Gating a raw-rAF loop from outside
|
|
62
|
-
* was demonstrated and REJECTED (D5, docs/COMPOSITION-DESIGN.md §5.2 —
|
|
63
|
-
* it halts the loop rather than pausing it); such games are the
|
|
64
|
-
* "composited, unsynchronized" tier: `setPaused` absent, host degrades
|
|
65
|
-
* loudly (T7.6 owns the tier surface).
|
|
66
|
-
*/
|
|
67
|
-
readonly drivesOwnLoop: boolean;
|
|
68
|
-
update?(dt: number): void;
|
|
69
|
-
fixedUpdate?(dt: number): void;
|
|
70
|
-
setPaused?(paused: boolean): void;
|
|
71
|
-
step?(): void;
|
|
72
|
-
resize?(width: number, height: number): void;
|
|
73
|
-
dispose(): void;
|
|
74
|
-
/** Optional capability providers — absence = "not supported", host degrades. */
|
|
75
|
-
readonly authoring?: AuthoringAdapter;
|
|
76
|
-
readonly systems?: SystemAdapters;
|
|
77
|
-
/** Optional state-observation capability (T7.4 slice 2, §4) — absent means
|
|
78
|
-
* "no state bridge"; `Game.registerWorld` reports this loudly, once, for
|
|
79
|
-
* any non-first-party mount. First-party mounts are exempt — their state
|
|
80
|
-
* is observed through `Game.state`/`useGameState` instead (§3), not this
|
|
81
|
-
* field. */
|
|
82
|
-
readonly observe?: WorldStateObserver;
|
|
83
|
-
}
|
|
84
|
-
/** A live, mounted threejs world. The host obtains `scene`/`camera` to
|
|
85
|
-
* render+author. This is what `MountedGame` (the permanent alias every
|
|
86
|
-
* pre-T7.5 threejs-world call site still names) now means. */
|
|
87
|
-
export interface MountedThreeWorld extends MountedWorldBase {
|
|
88
|
-
readonly kind: 'threejs';
|
|
89
|
-
/** The live scene + camera the editor inspects/renders for authoring. */
|
|
90
|
-
readonly scene: THREE.Scene;
|
|
91
|
-
readonly camera: THREE.Camera;
|
|
92
|
-
}
|
|
93
|
-
/** A live, mounted pixijs world (T7.3) — the pixi analog of
|
|
94
|
-
* {@link MountedThreeWorld}. `stage` is the pixi world container the host
|
|
95
|
-
* renders/authors, the surface `WorldInstance.pixiRoot()` returns. */
|
|
96
|
-
export interface MountedPixiWorld extends MountedWorldBase {
|
|
97
|
-
readonly kind: 'pixijs';
|
|
98
|
-
readonly stage: Container;
|
|
99
|
-
}
|
|
100
|
-
/** A live, mounted react world (T6.2) — the react analog of
|
|
101
|
-
* {@link MountedThreeWorld}. `container` is the DOM-root layer the host
|
|
102
|
-
* handed the adapter's `mount` (the SAME element `WorldInstance.reactRoot()`
|
|
103
|
-
* returns) — a react world's tree renders into it via `createRoot`. */
|
|
104
|
-
export interface MountedReactWorld extends MountedWorldBase {
|
|
105
|
-
readonly kind: 'react';
|
|
106
|
-
readonly container: HTMLElement;
|
|
107
|
-
}
|
|
108
|
-
/** Every kind of live, mounted world (T7.5) — the union `WorldInstance.mounted`
|
|
109
|
-
* is typed against now, replacing the THREE-only `MountedGame`. */
|
|
110
|
-
export type MountedWorld = MountedThreeWorld | MountedPixiWorld | MountedReactWorld;
|
|
111
|
-
/** Map a {@link AdapterSurface} to its mounted-world shape (mirrors `NodeOf`/
|
|
112
|
-
* `BodyOf`/`ColliderOf` in `ecs/game-component.ts`) — lets generic code over
|
|
113
|
-
* `K extends AdapterSurface` name the right surface without a manual union. */
|
|
114
|
-
export type MountedWorldFor<K extends AdapterSurface> = K extends 'threejs' ? MountedThreeWorld : K extends 'pixijs' ? MountedPixiWorld : K extends 'react' ? MountedReactWorld : never;
|
|
115
|
-
/**
|
|
116
|
-
* Permanent alias (T7.1 precedent — old names stay valid forever once a
|
|
117
|
-
* generalization lands): `MountedGame` now means "a mounted THREEJS world."
|
|
118
|
-
* Every pre-T7.5 threejs-only call site (`VgaiMountedGame extends MountedGame`,
|
|
119
|
-
* `registerThreeWorld`, ingest adapters, …) keeps compiling unchanged.
|
|
120
|
-
*/
|
|
121
|
-
export type MountedGame = MountedThreeWorld;
|
|
122
|
-
/** The interface every game implements to run on the host. Generic over
|
|
123
|
-
* {@link AdapterSurface} (T7.5) so a non-threejs implementer's `mount` returns its
|
|
124
|
-
* OWN kind-tagged surface instead of being cast through the threejs shape —
|
|
125
|
-
* defaults to `'threejs'` so every pre-T7.5 implementer/call site
|
|
126
|
-
* (`GameAdapter`, unparameterized) keeps compiling unchanged. */
|
|
127
|
-
export interface GameAdapter<K extends AdapterSurface = 'threejs'> {
|
|
128
|
-
/** Stable id (telemetry/registry/conformance). */
|
|
129
|
-
readonly id: string;
|
|
130
|
-
/** Build/start the game against a host-provided context; return the handle. */
|
|
131
|
-
mount(host: HostContext): Promise<MountedWorldFor<K>>;
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=game-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"game-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/game-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAEhC,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,IAAI,IAAI,CAAC;IAEd,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,OAAO,IAAI,IAAI,CAAC;IAEhB,gFAAgF;IAChF,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC;;;;iBAIa;IACb,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;CACvC;AAED;;+DAE+D;AAC/D,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;CAC/B;AAED;;uEAEuE;AACvE,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B;AAED;;;wEAGwE;AACxE,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED;oEACoE;AACpE,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEpF;;gFAEgF;AAChF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,SAAS,SAAS,GACvE,iBAAiB,GACjB,CAAC,SAAS,QAAQ,GAChB,gBAAgB,GAChB,CAAC,SAAS,OAAO,GACf,iBAAiB,GACjB,KAAK,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C;;;;kEAIkE;AAClE,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,SAAS;IAC/D,kDAAkD;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;CACvD"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameAdapter — the host ⇄ runtime contract. A "game" is *anything that mounts*.
|
|
3
|
-
*
|
|
4
|
-
* This is the interface the HOST depends on. It replaces the old
|
|
5
|
-
* `{ setup, components }` shape: the host no longer knows about `GameSetupFn`,
|
|
6
|
-
* `.vscn`, or `GameComponent` — those are the internals of ONE implementer
|
|
7
|
-
* (`VgaiSceneGameAdapter`). First-party content and an unmodified external game
|
|
8
|
-
* are peer implementers of THIS interface; the host has no branch on which.
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HostContext — the NEUTRAL primitives the host hands a game when mounting it.
|
|
3
|
-
*
|
|
4
|
-
* This generalizes the old `GameContext`, which baked in first-party system
|
|
5
|
-
* choices (a Rapier world, the postprocessing composer, the InputManager, …).
|
|
6
|
-
* `HostContext` provides only what ANY game needs — the shared three instance, a
|
|
7
|
-
* surface, a renderer, a loop, and assets — and lets a game *ask* for
|
|
8
|
-
* a first-party subsystem via `requestSystem`, which the host may or may not
|
|
9
|
-
* supply. The host never assumes Rapier/Colyseus; those live behind
|
|
10
|
-
* `SystemAdapters` owned by the first-party implementer.
|
|
11
|
-
*
|
|
12
|
-
* Migration note: `VgaiSceneGameAdapter.mount` builds today's `GameContext`
|
|
13
|
-
* (Rapier world, composer, …) internally from a `HostContext`. New code targets
|
|
14
|
-
* `HostContext`; `GameContext` is now a first-party implementation detail.
|
|
15
|
-
*/
|
|
16
|
-
import type * as THREE from 'three';
|
|
17
|
-
import type { AssetCache } from '../assets';
|
|
18
|
-
import type { GameInternal } from '../runtime/game';
|
|
19
|
-
/** The canvas/container the game renders into, plus its size. */
|
|
20
|
-
export interface HostSurface {
|
|
21
|
-
readonly canvas: HTMLCanvasElement;
|
|
22
|
-
readonly width: number;
|
|
23
|
-
readonly height: number;
|
|
24
|
-
}
|
|
25
|
-
/** Host-owned scheduling. A game may register extra per-frame callbacks; the
|
|
26
|
-
* host owns when they run. (First-party ticks its own system runner inside
|
|
27
|
-
* `MountedGame.update`, so it does not need this — it exists for games that
|
|
28
|
-
* want to hook the host loop directly.) */
|
|
29
|
-
export interface LoopHandle {
|
|
30
|
-
/** Register a per-frame callback; returns an unregister fn. */
|
|
31
|
-
onUpdate(fn: (dt: number) => void): () => void;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* First-party subsystems a game MAY request from the host. The host returns
|
|
35
|
-
* `null` when it does not provide the kind, so a game must tolerate absence —
|
|
36
|
-
* the host never forces a subsystem on a game. Extended as new first-party
|
|
37
|
-
* systems become host-provisioned.
|
|
38
|
-
*/
|
|
39
|
-
export interface SystemRegistry {
|
|
40
|
-
}
|
|
41
|
-
export interface HostContext {
|
|
42
|
-
/** The ONE shared three instance — identity matters for capture (see ingest). */
|
|
43
|
-
readonly three: typeof THREE;
|
|
44
|
-
/** Canvas/container + size; a self-driven game may take the surface over. */
|
|
45
|
-
readonly surface: HostSurface;
|
|
46
|
-
/** Host renderer — host-driven games render through it. */
|
|
47
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
48
|
-
/** Host-owned loop scheduling. */
|
|
49
|
-
readonly loop: LoopHandle;
|
|
50
|
-
/** Shared GLTF/texture cache. */
|
|
51
|
-
readonly assets: AssetCache;
|
|
52
|
-
/**
|
|
53
|
-
* No GPU/DOM/audio available (Node conformance tests). A first-party adapter
|
|
54
|
-
* skips postprocessing/render/audio/input-map loading but still builds the
|
|
55
|
-
* scene + Rapier + components, so its scene/authoring/physics can be exercised
|
|
56
|
-
* headlessly. Browser hosts leave this false/undefined → full behavior.
|
|
57
|
-
*/
|
|
58
|
-
readonly headless?: boolean;
|
|
59
|
-
/** Ask the host for a first-party subsystem; `null` if not provided. */
|
|
60
|
-
requestSystem<T extends keyof SystemRegistry>(kind: T): SystemRegistry[T] | null;
|
|
61
|
-
/**
|
|
62
|
-
* The Game root (T7.1 slice 1 — GAME-ROOT-DESIGN.md D6). The host
|
|
63
|
-
* constructs the Game shell BEFORE mounting a `GameAdapter` and hands it
|
|
64
|
-
* down here so an adapter can expose `ctx.game`/`ctx.roots` to the game it
|
|
65
|
-
* mounts. Absent in headless harnesses and foreign hosts that predate the
|
|
66
|
-
* Game root — everything must keep working when this is undefined (the
|
|
67
|
-
* zero-break guarantee for this slice).
|
|
68
|
-
*/
|
|
69
|
-
readonly game?: GameInternal | undefined;
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=host-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-context.d.ts","sourceRoot":"","sources":["../../src/adapter/host-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;4CAG4C;AAC5C,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAChD;AAED;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,wEAAwE;IACxE,aAAa,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACjF;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CAC1C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HostContext — the NEUTRAL primitives the host hands a game when mounting it.
|
|
3
|
-
*
|
|
4
|
-
* This generalizes the old `GameContext`, which baked in first-party system
|
|
5
|
-
* choices (a Rapier world, the postprocessing composer, the InputManager, …).
|
|
6
|
-
* `HostContext` provides only what ANY game needs — the shared three instance, a
|
|
7
|
-
* surface, a renderer, a loop, and assets — and lets a game *ask* for
|
|
8
|
-
* a first-party subsystem via `requestSystem`, which the host may or may not
|
|
9
|
-
* supply. The host never assumes Rapier/Colyseus; those live behind
|
|
10
|
-
* `SystemAdapters` owned by the first-party implementer.
|
|
11
|
-
*
|
|
12
|
-
* Migration note: `VgaiSceneGameAdapter.mount` builds today's `GameContext`
|
|
13
|
-
* (Rapier world, composer, …) internally from a `HostContext`. New code targets
|
|
14
|
-
* `HostContext`; `GameContext` is now a first-party implementation detail.
|
|
15
|
-
*/
|
|
16
|
-
export {};
|
package/dist/adapter/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter interfaces — the seams the engine host and the editor DEPEND ON.
|
|
3
|
-
*
|
|
4
|
-
* host → GameAdapter ← { VgaiSceneGameAdapter, IngestGameAdapter, … }
|
|
5
|
-
* editor → AuthoringAdapter ← { VgaiSceneAuthoringAdapter, IngestAuthoringAdapter, … }
|
|
6
|
-
* game → SystemAdapters (physics/networking/input/assets)
|
|
7
|
-
*
|
|
8
|
-
* The first-party `.vscn`/`GameComponent`/Rapier/Colyseus stack is ONE
|
|
9
|
-
* implementer of these interfaces, not the engine's vocabulary. See
|
|
10
|
-
* docs/ADAPTER-ARCHITECTURE.md.
|
|
11
|
-
*/
|
|
12
|
-
export type { AdapterSurface } from './adapter-surface';
|
|
13
|
-
export type { AssetDropProvider, AuthoringAdapter, AuthoringCapabilities, AuthoringProvenance, BoxEditProvider, ColorSampleProvider, ComponentsProvider, DOMRectLike, EditorNode, EditorNodeRole, FileMapProvider, HierarchyProvider, InspectorProvider, LayoutProvider, PersistenceProvider, PickProvider, PropertyDescriptor, RectProvider, RootGroup, RootGroupsProvider, SelectionProvider, StoriesProvider, StoryRef, StructureProvider, TextProvider, TransformProvider, } from './authoring';
|
|
14
|
-
export { type ColyseusNetworkingConfig, createColyseusNetworkingAdapter, } from './colyseus-networking-adapter';
|
|
15
|
-
export { createInputManagerAdapter, createNavigationAdapter, createVgaiAssetAdapter, } from './first-party-systems';
|
|
16
|
-
export type { GameAdapter, MountedGame, MountedPixiWorld, MountedReactWorld, MountedThreeWorld, MountedWorld, MountedWorldBase, MountedWorldFor, WorldStateObserver, } from './game-adapter';
|
|
17
|
-
export type { HostContext, HostSurface, LoopHandle, SystemRegistry } from './host-context';
|
|
18
|
-
export { createRapierPhysicsAdapter } from './rapier-physics-adapter';
|
|
19
|
-
export type { ActionValueSnapshot, AssetAdapter, ConnectionState, InputAdapter, NavigationAdapter, NavPoint, NetPeer, NetworkingAdapter, PhysicsAdapter, ReplicationStats, RoomInfo, SystemAdapters, Unsubscribe, } from './system-adapter';
|
|
20
|
-
export type { Transform, TransformOwner } from './transform';
|
|
21
|
-
export { fromSetup, type VgaiMountedGame, type VgaiSceneConfig, VgaiSceneGameAdapter, } from './vgai-scene-game-adapter';
|
|
22
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,wBAAwB,EAC7B,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
|
package/dist/adapter/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter interfaces — the seams the engine host and the editor DEPEND ON.
|
|
3
|
-
*
|
|
4
|
-
* host → GameAdapter ← { VgaiSceneGameAdapter, IngestGameAdapter, … }
|
|
5
|
-
* editor → AuthoringAdapter ← { VgaiSceneAuthoringAdapter, IngestAuthoringAdapter, … }
|
|
6
|
-
* game → SystemAdapters (physics/networking/input/assets)
|
|
7
|
-
*
|
|
8
|
-
* The first-party `.vscn`/`GameComponent`/Rapier/Colyseus stack is ONE
|
|
9
|
-
* implementer of these interfaces, not the engine's vocabulary. See
|
|
10
|
-
* docs/ADAPTER-ARCHITECTURE.md.
|
|
11
|
-
*/
|
|
12
|
-
export { createColyseusNetworkingAdapter, } from './colyseus-networking-adapter';
|
|
13
|
-
export { createInputManagerAdapter, createNavigationAdapter, createVgaiAssetAdapter, } from './first-party-systems';
|
|
14
|
-
export { createRapierPhysicsAdapter } from './rapier-physics-adapter';
|
|
15
|
-
export { fromSetup, VgaiSceneGameAdapter, } from './vgai-scene-game-adapter';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The game→host contract: ONE pre-defined interface an external game may
|
|
3
|
-
* declare on `window.vgaiGame` to let the editor work with it like native
|
|
4
|
-
* content. Capabilities are by PRESENCE — every field is optional, and a game
|
|
5
|
-
* that declares nothing runs exactly as before (doctrine: adaptation enables
|
|
6
|
-
* editor features; it never bends a game around host internals). This file is
|
|
7
|
-
* the single source of truth for the contract's shape — host code reads it
|
|
8
|
-
* through {@link readGameContract} instead of ad-hoc `window` casts, so the
|
|
9
|
-
* spec and the implementation cannot drift apart.
|
|
10
|
-
*
|
|
11
|
-
* Relationship to the native engine: first-party content implements the SAME
|
|
12
|
-
* conceptual surface (mount root, lifecycle, loop gating) through
|
|
13
|
-
* `GameAdapter`/`MountedGame` — the native engine is the premade 100%
|
|
14
|
-
* implementation of this contract. An ingested game climbs the same ladder
|
|
15
|
-
* endpoint by endpoint: capture infers what it can (the scene), the game
|
|
16
|
-
* declares what inference can't reach (its DOM root, its session lifecycle).
|
|
17
|
-
*
|
|
18
|
-
* Origin: docs/FTUE-EXTERNAL-R3F-GAME.md F16 (root), F17+F21 (lifecycle).
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Session lifecycle endpoints. Declaring `start` means "I support cold
|
|
22
|
-
* mount": when the host sets `window.__vgaiMountCold` before the game's entry
|
|
23
|
-
* executes, the game may defer its session side-effects (backend connections,
|
|
24
|
-
* narrative, audio) and render a quiet, inspectable scene; the host calls
|
|
25
|
-
* `start()` — at most once per mount — when the user presses ▶. Declaring
|
|
26
|
-
* `pause`/`resume` means the game can genuinely freeze/unfreeze itself; the
|
|
27
|
-
* host prefers these over its outside-in loop gate (which cannot gate a raw
|
|
28
|
-
* requestAnimationFrame loop at all — R3F games, notably).
|
|
29
|
-
*/
|
|
30
|
-
export interface VgaiGameLifecycle {
|
|
31
|
-
start?(): void;
|
|
32
|
-
pause?(): void;
|
|
33
|
-
resume?(): void;
|
|
34
|
-
}
|
|
35
|
-
export interface VgaiGameContract {
|
|
36
|
-
/** Bump only on breaking shape changes; additive endpoints keep version 1. */
|
|
37
|
-
contractVersion: 1;
|
|
38
|
-
/**
|
|
39
|
-
* The element that OWNS the game's whole DOM (canvas + HUD + overlay
|
|
40
|
-
* portals). The host adopts it wholesale into the game pane, so DOM-hybrid
|
|
41
|
-
* games keep their UI instead of stranding it at page level. The host
|
|
42
|
-
* verifies it actually contains the captured canvas before adopting.
|
|
43
|
-
*/
|
|
44
|
-
root?: HTMLElement;
|
|
45
|
-
lifecycle?: VgaiGameLifecycle;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Read the declared contract, if any. The `contractVersion` gate is the
|
|
49
|
-
* forward-compatibility hinge: a future v2 game on a v1 host is ignored
|
|
50
|
-
* (pre-contract fallbacks apply) rather than half-interpreted.
|
|
51
|
-
*/
|
|
52
|
-
export declare function readGameContract(): VgaiGameContract | null;
|
|
53
|
-
//# sourceMappingURL=game-contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"game-contract.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/game-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,MAAM,CAAC,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,eAAe,EAAE,CAAC,CAAC;IACnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,gBAAgB,GAAG,IAAI,CAI1D"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The game→host contract: ONE pre-defined interface an external game may
|
|
3
|
-
* declare on `window.vgaiGame` to let the editor work with it like native
|
|
4
|
-
* content. Capabilities are by PRESENCE — every field is optional, and a game
|
|
5
|
-
* that declares nothing runs exactly as before (doctrine: adaptation enables
|
|
6
|
-
* editor features; it never bends a game around host internals). This file is
|
|
7
|
-
* the single source of truth for the contract's shape — host code reads it
|
|
8
|
-
* through {@link readGameContract} instead of ad-hoc `window` casts, so the
|
|
9
|
-
* spec and the implementation cannot drift apart.
|
|
10
|
-
*
|
|
11
|
-
* Relationship to the native engine: first-party content implements the SAME
|
|
12
|
-
* conceptual surface (mount root, lifecycle, loop gating) through
|
|
13
|
-
* `GameAdapter`/`MountedGame` — the native engine is the premade 100%
|
|
14
|
-
* implementation of this contract. An ingested game climbs the same ladder
|
|
15
|
-
* endpoint by endpoint: capture infers what it can (the scene), the game
|
|
16
|
-
* declares what inference can't reach (its DOM root, its session lifecycle).
|
|
17
|
-
*
|
|
18
|
-
* Origin: docs/FTUE-EXTERNAL-R3F-GAME.md F16 (root), F17+F21 (lifecycle).
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Read the declared contract, if any. The `contractVersion` gate is the
|
|
22
|
-
* forward-compatibility hinge: a future v2 game on a v1 host is ignored
|
|
23
|
-
* (pre-contract fallbacks apply) rather than half-interpreted.
|
|
24
|
-
*/
|
|
25
|
-
export function readGameContract() {
|
|
26
|
-
const declared = window.vgaiGame;
|
|
27
|
-
if (!declared || declared.contractVersion !== 1)
|
|
28
|
-
return null;
|
|
29
|
-
return declared;
|
|
30
|
-
}
|