@vgai/engine 0.5.21 → 0.5.23
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 +6 -3
- package/dist/adapter/adapter-module.d.ts.map +1 -1
- package/dist/adapter/adapter-module.js +2 -4
- package/dist/adapter/adapter-surface.d.ts +1 -1
- package/dist/adapter/adapter-surface.js +1 -1
- package/dist/adapter/authoring.d.ts +19 -21
- package/dist/adapter/authoring.d.ts.map +1 -1
- package/dist/adapter/authoring.js +2 -2
- package/dist/adapter/binding.d.ts +341 -0
- package/dist/adapter/binding.d.ts.map +1 -0
- package/dist/adapter/binding.js +148 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -1
- package/dist/adapter/colyseus-networking-adapter.js +23 -4
- package/dist/adapter/entrypoint-selection-readers.d.ts +24 -0
- package/dist/adapter/entrypoint-selection-readers.d.ts.map +1 -0
- package/dist/adapter/entrypoint-selection-readers.js +63 -0
- package/dist/adapter/entrypoint-selection-source.d.ts.map +1 -1
- package/dist/adapter/entrypoint-selection-source.js +1 -44
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +1 -52
- package/dist/adapter/host-context.d.ts +46 -15
- package/dist/adapter/host-context.d.ts.map +1 -1
- package/dist/adapter/host-context.js +2 -9
- package/dist/adapter/index.d.ts +11 -12
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter/index.js +9 -10
- package/dist/adapter/ingest/game-contract.d.ts +0 -3
- package/dist/adapter/ingest/game-contract.d.ts.map +1 -1
- package/dist/adapter/ingest/game-contract.js +0 -3
- package/dist/adapter/ingest/scene-capture.d.ts +19 -23
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -1
- package/dist/adapter/ingest/scene-capture.js +143 -17
- package/dist/adapter/ingest/visible-capture-window.d.ts +34 -0
- package/dist/adapter/ingest/visible-capture-window.d.ts.map +1 -1
- package/dist/adapter/manifest-interpreter.d.ts +59 -0
- package/dist/adapter/manifest-interpreter.d.ts.map +1 -0
- package/dist/adapter/manifest-interpreter.js +50 -0
- package/dist/adapter/native-debug-module.d.ts +71 -3
- package/dist/adapter/native-debug-module.d.ts.map +1 -1
- package/dist/adapter/native-debug-module.js +146 -10
- package/dist/adapter/rapier-physics-adapter.d.ts +31 -1
- package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -1
- package/dist/adapter/rapier-physics-adapter.js +50 -36
- package/dist/adapter/renderer-config.d.ts +3 -3
- package/dist/adapter/renderer-config.js +3 -3
- package/dist/adapter/root-adapter.d.ts +7 -7
- package/dist/adapter/root-adapter.js +4 -4
- package/dist/adapter/system-adapter.d.ts +45 -7
- package/dist/adapter/system-adapter.d.ts.map +1 -1
- package/dist/adapter/system-seam-contract.d.ts +3 -3
- package/dist/adapter/system-seam-contract.js +3 -3
- package/dist/adapter/system-slot.d.ts +168 -0
- package/dist/adapter/system-slot.d.ts.map +1 -0
- package/dist/adapter/system-slot.js +229 -0
- package/dist/adapter/transform.d.ts +11 -1
- package/dist/adapter/transform.d.ts.map +1 -1
- package/dist/ai/navigation.d.ts +17 -1
- package/dist/ai/navigation.d.ts.map +1 -1
- package/dist/ai/navigation.js +26 -5
- package/dist/animation/anim-graph-types.d.ts +11 -3
- package/dist/animation/anim-graph-types.d.ts.map +1 -1
- package/dist/animation/theatre-clock-binding.d.ts +4 -4
- package/dist/animation/theatre-clock-binding.js +4 -4
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -1
- package/dist/animation/xstate-animation-binding.js +2 -2
- package/dist/animation/xstate-animation-meta.d.ts +13 -0
- package/dist/animation/xstate-animation-meta.d.ts.map +1 -1
- package/dist/animation/xstate-animation-meta.js +14 -0
- package/dist/asset-formats/index.d.ts +4 -7
- package/dist/asset-formats/index.d.ts.map +1 -1
- package/dist/asset-formats/index.js +4 -7
- package/dist/asset-formats/render-env.d.ts +5 -8
- package/dist/asset-formats/render-env.d.ts.map +1 -1
- package/dist/asset-formats/render-env.js +3 -6
- package/dist/asset-parse-error.d.ts +2 -5
- package/dist/asset-parse-error.d.ts.map +1 -1
- package/dist/asset-parse-error.js +2 -5
- package/dist/audio/bus-mixer.d.ts +101 -0
- package/dist/audio/bus-mixer.d.ts.map +1 -0
- package/dist/audio/bus-mixer.js +115 -0
- package/dist/canvas-react/index.d.ts +5 -12
- package/dist/canvas-react/index.d.ts.map +1 -1
- package/dist/canvas-react/index.js +5 -12
- package/dist/canvas-react/pixi-react-root-factory.d.ts +34 -21
- package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-root-factory.js +274 -36
- package/dist/core/countdown-timer.d.ts +118 -0
- package/dist/core/countdown-timer.d.ts.map +1 -0
- package/dist/core/countdown-timer.js +137 -0
- package/dist/core/deferred-commands.d.ts +127 -0
- package/dist/core/deferred-commands.d.ts.map +1 -0
- package/dist/core/deferred-commands.js +132 -0
- package/dist/core/frame-pacing.d.ts +1 -1
- package/dist/core/frame-pacing.js +2 -2
- package/dist/core/game-loop.d.ts +1 -3
- package/dist/core/game-loop.d.ts.map +1 -1
- package/dist/core/game-loop.js +1 -3
- package/dist/core/seeded-random.d.ts +1 -1
- package/dist/core/sim-clock.d.ts +19 -8
- package/dist/core/sim-clock.d.ts.map +1 -1
- package/dist/core/sim-clock.js +18 -7
- package/dist/core/types.d.ts +1 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/defaults.d.ts +6 -14
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +6 -14
- package/dist/dev/instruments.d.ts +38 -11
- package/dist/dev/instruments.d.ts.map +1 -1
- package/dist/dev/instruments.js +81 -11
- package/dist/dev/register-render-vitals.d.ts +1 -4
- package/dist/dev/register-render-vitals.d.ts.map +1 -1
- package/dist/dev/register-render-vitals.js +1 -4
- package/dist/dev/render-debug-adapter.d.ts +2 -3
- package/dist/dev/render-debug-adapter.d.ts.map +1 -1
- package/dist/dev/render-debug-adapter.js +2 -3
- package/dist/dev/render-vitals.d.ts +3 -3
- package/dist/dev/render-vitals.js +3 -3
- package/dist/dev/webgl-frame-capture.d.ts +1 -1
- package/dist/dev/webgl-frame-capture.js +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/input/host-pointer.d.ts +122 -0
- package/dist/input/host-pointer.d.ts.map +1 -0
- package/dist/input/host-pointer.js +160 -0
- package/dist/input/input-manager.d.ts +33 -5
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +48 -13
- package/dist/input/rebind-controller.d.ts.map +1 -1
- package/dist/input/rebind-controller.js +6 -8
- package/dist/input/schema.d.ts.map +1 -1
- package/dist/input/schema.js +56 -28
- package/dist/manifest/filename.d.ts.map +1 -1
- package/dist/manifest/filename.js +8 -12
- package/dist/manifest/load.d.ts +10 -10
- package/dist/manifest/load.d.ts.map +1 -1
- package/dist/manifest/load.js +9 -6
- package/dist/manifest/schema.d.ts +17 -21
- package/dist/manifest/schema.d.ts.map +1 -1
- package/dist/manifest/schema.js +45 -35
- package/dist/physics/collider-dimensions.d.ts +8 -12
- package/dist/physics/collider-dimensions.d.ts.map +1 -1
- package/dist/physics/collider-dimensions.js +8 -12
- package/dist/pixi/scene-capture.d.ts +11 -13
- package/dist/pixi/scene-capture.d.ts.map +1 -1
- package/dist/react/world-state.d.ts +1 -1
- package/dist/react/world-state.d.ts.map +1 -1
- package/dist/render/directional-shadow-fit.d.ts +88 -0
- package/dist/render/directional-shadow-fit.d.ts.map +1 -0
- package/dist/render/directional-shadow-fit.js +133 -0
- package/dist/render/environment-capture.d.ts +68 -0
- package/dist/render/environment-capture.d.ts.map +1 -0
- package/dist/render/environment-capture.js +90 -0
- package/dist/render/ibl-override-material.d.ts +97 -0
- package/dist/render/ibl-override-material.d.ts.map +1 -0
- package/dist/render/ibl-override-material.js +114 -0
- package/dist/render/light-camera-factory.d.ts +5 -7
- package/dist/render/light-camera-factory.d.ts.map +1 -1
- package/dist/render/light-camera-factory.js +8 -11
- package/dist/render/material-factory.js +1 -1
- package/dist/render/render-batch-system.d.ts.map +1 -1
- package/dist/render/render-features.d.ts +17 -6
- package/dist/render/render-features.d.ts.map +1 -1
- package/dist/render/render-features.js +0 -28
- package/dist/runtime/create-runtime.d.ts +34 -25
- package/dist/runtime/create-runtime.d.ts.map +1 -1
- package/dist/runtime/create-runtime.js +218 -93
- package/dist/runtime/debug-registry.d.ts +77 -8
- package/dist/runtime/debug-registry.d.ts.map +1 -1
- package/dist/runtime/debug-registry.js +3 -3
- package/dist/runtime/dev-build.d.ts +2 -2
- package/dist/runtime/dev-build.js +2 -2
- package/dist/runtime/game-input-seams.d.ts +51 -0
- package/dist/runtime/game-input-seams.d.ts.map +1 -0
- package/dist/runtime/game-input-seams.js +86 -0
- package/dist/runtime/game.d.ts +104 -40
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +119 -61
- package/dist/runtime/mount-game.d.ts +0 -16
- package/dist/runtime/mount-game.d.ts.map +1 -1
- package/dist/runtime/mount-game.js +26 -41
- package/dist/runtime/mount-manifest.d.ts +22 -14
- package/dist/runtime/mount-manifest.d.ts.map +1 -1
- package/dist/runtime/mount-manifest.js +22 -20
- package/dist/runtime/playtest.d.ts +22 -0
- package/dist/runtime/playtest.d.ts.map +1 -0
- package/dist/runtime/playtest.js +12 -0
- package/dist/runtime/state-bridge.d.ts +2 -3
- package/dist/runtime/state-bridge.d.ts.map +1 -1
- package/dist/runtime/state-bridge.js +1 -0
- package/dist/setup/setup-audio.d.ts +12 -0
- package/dist/setup/setup-audio.d.ts.map +1 -1
- package/dist/setup/setup-audio.js +9 -10
- package/dist/setup/setup-renderer.d.ts +2 -25
- package/dist/setup/setup-renderer.d.ts.map +1 -1
- package/dist/setup/setup-renderer.js +2 -31
- package/dist/world3d-react/index.d.ts +15 -25
- package/dist/world3d-react/index.d.ts.map +1 -1
- package/dist/world3d-react/index.js +15 -25
- package/dist/world3d-react/r3f-root-factory.d.ts +28 -34
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
- package/dist/world3d-react/r3f-root-factory.js +403 -57
- package/dist/world3d-react/rapier-physics-bridge.d.ts +30 -17
- package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -1
- package/dist/world3d-react/rapier-physics-bridge.js +143 -58
- package/package.json +1 -1
- package/schemas/engine-capabilities.json +16 -14
- package/schemas/vgai-project.schema.json +35 -26
- package/src/adapter/adapter-module.ts +2 -4
- package/src/adapter/adapter-surface.ts +1 -1
- package/src/adapter/authoring.ts +19 -21
- package/src/adapter/binding.ts +468 -0
- package/src/adapter/colyseus-networking-adapter.ts +20 -5
- package/src/adapter/entrypoint-selection-readers.ts +66 -0
- package/src/adapter/entrypoint-selection-source.ts +1 -40
- package/src/adapter/finders/scenes-from-entrypoint-selection.ts +1 -48
- package/src/adapter/host-context.ts +45 -15
- package/src/adapter/index.ts +23 -11
- package/src/adapter/ingest/game-contract.ts +0 -3
- package/src/adapter/ingest/scene-capture.ts +190 -39
- package/src/adapter/ingest/visible-capture-window.ts +35 -0
- package/src/adapter/manifest-interpreter.ts +64 -0
- package/src/adapter/native-debug-module.ts +248 -15
- package/src/adapter/rapier-physics-adapter.ts +76 -20
- package/src/adapter/renderer-config.ts +3 -3
- package/src/adapter/root-adapter.ts +7 -7
- package/src/adapter/system-adapter.ts +43 -8
- package/src/adapter/system-seam-contract.ts +3 -3
- package/src/adapter/system-slot.ts +291 -0
- package/src/adapter/transform.ts +18 -1
- package/src/ai/navigation.ts +30 -3
- package/src/animation/anim-graph-types.ts +11 -3
- package/src/animation/theatre-clock-binding.ts +4 -4
- package/src/animation/xstate-animation-binding.ts +2 -2
- package/src/animation/xstate-animation-meta.ts +16 -0
- package/src/asset-formats/index.ts +4 -7
- package/src/asset-formats/render-env.ts +3 -6
- package/src/asset-parse-error.ts +2 -5
- package/src/audio/bus-mixer.ts +161 -0
- package/src/canvas-react/index.ts +5 -21
- package/src/canvas-react/pixi-react-root-factory.tsx +301 -39
- package/src/core/countdown-timer.ts +188 -0
- package/src/core/deferred-commands.ts +174 -0
- package/src/core/frame-pacing.ts +2 -2
- package/src/core/game-loop.ts +1 -3
- package/src/core/seeded-random.ts +1 -1
- package/src/core/sim-clock.ts +19 -8
- package/src/core/types.ts +1 -3
- package/src/defaults.ts +6 -14
- package/src/dev/instruments.ts +108 -11
- package/src/dev/register-render-vitals.ts +1 -4
- package/src/dev/render-debug-adapter.ts +2 -3
- package/src/dev/render-vitals.ts +3 -3
- package/src/dev/webgl-frame-capture.ts +1 -1
- package/src/index.ts +2 -5
- package/src/input/host-pointer.ts +230 -0
- package/src/input/input-manager.ts +49 -13
- package/src/input/input-types.ts +1 -1
- package/src/input/rebind-controller.ts +6 -8
- package/src/input/schema.ts +216 -188
- package/src/manifest/filename.ts +8 -12
- package/src/manifest/load.ts +17 -13
- package/src/manifest/schema.ts +55 -47
- package/src/physics/collider-dimensions.ts +8 -12
- package/src/pixi/scene-capture.ts +12 -15
- package/src/react/world-state.tsx +1 -1
- package/src/render/directional-shadow-fit.ts +156 -0
- package/src/render/environment-capture.ts +102 -0
- package/src/render/ibl-override-material.ts +170 -0
- package/src/render/light-camera-factory.ts +8 -11
- package/src/render/material-factory.ts +1 -1
- package/src/render/render-batch-system.ts +14 -6
- package/src/render/render-features.ts +17 -35
- package/src/runtime/create-runtime.ts +270 -108
- package/src/runtime/debug-registry.ts +84 -8
- package/src/runtime/dev-build.ts +2 -2
- package/src/runtime/game-input-seams.ts +108 -0
- package/src/runtime/game.ts +231 -85
- package/src/runtime/mount-game.ts +31 -57
- package/src/runtime/mount-manifest.ts +47 -36
- package/src/runtime/playtest.ts +22 -0
- package/src/runtime/state-bridge.ts +3 -3
- package/src/setup/setup-audio.ts +21 -11
- package/src/setup/setup-renderer.ts +2 -61
- package/src/world3d-react/index.ts +15 -31
- package/src/world3d-react/r3f-root-factory.tsx +451 -60
- package/src/world3d-react/rapier-physics-bridge.tsx +154 -58
- package/dist/adapter/setup-three-root-adapter.d.ts +0 -86
- package/dist/adapter/setup-three-root-adapter.d.ts.map +0 -1
- package/dist/adapter/setup-three-root-adapter.js +0 -908
- 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 -31
- package/dist/asset-registry.d.ts +0 -38
- package/dist/asset-registry.d.ts.map +0 -1
- package/dist/asset-registry.js +0 -66
- package/dist/canvas-react/engine-bridge.d.ts +0 -45
- package/dist/canvas-react/engine-bridge.d.ts.map +0 -1
- package/dist/canvas-react/engine-bridge.js +0 -45
- package/dist/canvas-react/pixi-react-adapter.d.ts +0 -77
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +0 -1
- package/dist/canvas-react/pixi-react-adapter.js +0 -294
- package/dist/canvas-react/world-context.d.ts +0 -98
- package/dist/canvas-react/world-context.d.ts.map +0 -1
- package/dist/canvas-react/world-context.js +0 -173
- 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/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/lod.d.ts +0 -13
- package/dist/render/lod.d.ts.map +0 -1
- package/dist/render/lod.js +0 -16
- package/dist/runtime/types.d.ts +0 -303
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/types.js +0 -1
- package/dist/world3d-react/engine-bridge.d.ts +0 -47
- package/dist/world3d-react/engine-bridge.d.ts.map +0 -1
- package/dist/world3d-react/engine-bridge.js +0 -73
- package/dist/world3d-react/r3f-adapter.d.ts +0 -58
- package/dist/world3d-react/r3f-adapter.d.ts.map +0 -1
- package/dist/world3d-react/r3f-adapter.js +0 -634
- package/dist/world3d-react/world-context.d.ts +0 -182
- package/dist/world3d-react/world-context.d.ts.map +0 -1
- package/dist/world3d-react/world-context.js +0 -235
- package/src/adapter/setup-three-root-adapter.ts +0 -1032
- package/src/animation/clip-map.ts +0 -34
- package/src/asset-registry.ts +0 -89
- package/src/canvas-react/engine-bridge.ts +0 -59
- package/src/canvas-react/pixi-react-adapter.tsx +0 -356
- package/src/canvas-react/world-context.ts +0 -253
- package/src/dev/debug-draw.ts +0 -80
- package/src/render/auto-batcher.ts +0 -168
- package/src/render/lod.ts +0 -17
- package/src/runtime/types.ts +0 -328
- package/src/world3d-react/engine-bridge.ts +0 -86
- package/src/world3d-react/r3f-adapter.tsx +0 -717
- package/src/world3d-react/world-context.ts +0 -358
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,WAAW,EACX,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,gBAAg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B,CAAC;AACzB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B;8DAC8D;AAC9D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/adapter/index.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter interfaces — the seams the engine host and the editor DEPEND ON.
|
|
3
3
|
*
|
|
4
|
-
* host → RootAdapter ← {
|
|
4
|
+
* host → RootAdapter ← { r3fRootFactory-built adapters, IngestRootAdapter, … }
|
|
5
5
|
* editor → AuthoringAdapter ← { LiveThreeAuthoringAdapter, ReactRootAuthoringAdapter, … }
|
|
6
6
|
* game → SystemAdapters (physics/networking/navigation/audio/camera/debug)
|
|
7
7
|
*
|
|
8
8
|
* The first-party Rapier/Colyseus stack is ONE implementer of these
|
|
9
|
-
* interfaces, not the engine's vocabulary
|
|
9
|
+
* interfaces, not the engine's vocabulary.
|
|
10
10
|
*
|
|
11
11
|
* **This module is TYPE-ONLY, and must stay that way (P-6).** It used to
|
|
12
|
-
* value-export its own implementers — `
|
|
13
|
-
* `
|
|
14
|
-
* `
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* path instead:
|
|
12
|
+
* value-export its own implementers — `createRapierPhysicsAdapter`,
|
|
13
|
+
* `createColyseusNetworkingAdapter`, `createNavigationAdapter` — so
|
|
14
|
+
* `import type { AuthoringAdapter } from '@engine/adapter'` was the only
|
|
15
|
+
* thing keeping the three/Rapier/Colyseus stack out of a Pixi or React
|
|
16
|
+
* consumer's module graph. A seam that ships its implementers is not a
|
|
17
|
+
* seam. Import an implementer from its OWN path instead:
|
|
19
18
|
*
|
|
20
|
-
* `@engine/adapter/setup-three-root-adapter` SetupThreeRootAdapter, fromSetup
|
|
21
19
|
* `@engine/adapter/rapier-physics-adapter` createRapierPhysicsAdapter
|
|
22
20
|
* `@engine/adapter/colyseus-networking-adapter` createColyseusNetworkingAdapter
|
|
23
21
|
* `@engine/adapter/first-party-systems` createNavigationAdapter
|
|
24
22
|
*/
|
|
25
23
|
export { AUTHORING_PROVIDER_KEYS, emptyWriteAnchorKindCounts, measureAuthoringProviders, WRITE_ANCHOR_KINDS, } from './authoring';
|
|
26
24
|
export { AUTHORING_ADAPTER_SHAPE, AUTHORING_PROVIDER_SHAPES, HIERARCHY_PROVIDER_SHAPE, } from './authoring-seam-contract';
|
|
25
|
+
export { createRootBinding } from './binding';
|
|
27
26
|
export { MOUNTED_CANVAS_SURFACE_SHAPE, MOUNTED_DOM_SURFACE_SHAPE, MOUNTED_ROOT_BASE_SHAPE, MOUNTED_THREE_SURFACE_SHAPE, ROOT_ADAPTER_SHAPE, ROOT_STATE_OBSERVER_SHAPE, } from './root-seam-contract';
|
|
28
27
|
export { defineSeamShape, gradeSeamCarrier, gradeSeamEvidence, inspectSeamShape, SEAM_PROOF_STAGES, SeamEvidenceLedger, seamStageAtLeast, } from './seam-evidence';
|
|
29
28
|
/** The two narrowings of the tagged `SystemAdapters['physics']` union — see
|
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
* implementation of this contract. An ingested game climbs the same ladder
|
|
15
15
|
* endpoint by endpoint: capture infers what it can (the scene), the game
|
|
16
16
|
* declares what inference can't reach (its DOM root, its session lifecycle).
|
|
17
|
-
*
|
|
18
|
-
* Origin (root), F17+F21 (lifecycle), WO-SYS1 (systems), WO-SYS2
|
|
19
|
-
* (`systems.systemAdapters`).
|
|
20
17
|
*/
|
|
21
18
|
import type { AudioAdapter, CameraAdapter, NavigationAdapter, NetworkingAdapter, PhysicsCarrier, RenderDebugAdapter } from '../system-adapter';
|
|
22
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game-contract.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/game-contract.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"game-contract.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/game-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,MAAM,CAAC,IAAI,IAAI,CAAC;CACjB;AAED;;kDAEkD;AAClD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,IAAI,IAAI,aAAa,EAAE,CAAC;IACxB;;qBAEiB;IACj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: capture infers what it can (the scene), the game
|
|
16
16
|
* declares what inference can't reach (its DOM root, its session lifecycle).
|
|
17
|
-
*
|
|
18
|
-
* Origin (root), F17+F21 (lifecycle), WO-SYS1 (systems), WO-SYS2
|
|
19
|
-
* (`systems.systemAdapters`).
|
|
20
17
|
*/
|
|
21
18
|
import { GAME_SCENES_SHAPE } from './game-contract-seams';
|
|
22
19
|
/**
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* classes. A game that bundles its own copy cannot be captured this way (the
|
|
32
32
|
* module-identity gatekeeper).
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* There is an OPTIONAL, ADDITIVE composer capture: a game rendering through
|
|
35
35
|
* its own three.js addon `EffectComposer`
|
|
36
36
|
* (`three/examples/jsm/postprocessing/EffectComposer.js`) still trips the `render`
|
|
37
37
|
* trap above (its `RenderPass` calls `renderer.render(scene,camera)` internally),
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
* (`docs/f13-bloom-composer-proof/record-fixed.mjs`).
|
|
54
54
|
*/
|
|
55
55
|
import type * as THREE from 'three';
|
|
56
|
-
import { type
|
|
56
|
+
import { type CaptureWaitOptions } from './visible-capture-window';
|
|
57
57
|
/** The renderer operations the ingest host may lawfully use after capture.
|
|
58
58
|
* WebGLRenderer supplies every member; DOM-backed Three addon renderers such as
|
|
59
59
|
* CSS3DRenderer deliberately omit the WebGL-only lifecycle operations. */
|
|
@@ -184,30 +184,26 @@ export interface RenderPassHooks {
|
|
|
184
184
|
after(): void;
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
|
-
* Options for {@link SceneCaptureHandle.waitForCapture}
|
|
188
|
-
*
|
|
187
|
+
* Options for {@link SceneCaptureHandle.waitForCapture} — declared with the
|
|
188
|
+
* window they configure (`visible-capture-window.ts`), because they configure
|
|
189
|
+
* the WAIT and not this surface, and re-exported here for the callers that
|
|
190
|
+
* look for them beside `waitForCapture`.
|
|
189
191
|
*/
|
|
190
|
-
export
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
* A wait parked on a hidden tab is otherwise indistinguishable from a hung
|
|
200
|
-
* mount: nothing renders, nothing fails, and every door reports silence.
|
|
201
|
-
* This is the seam the editor publishes to `vgai status` so the answer is
|
|
202
|
-
* "waiting for the first visible frame — the tab is hidden", not a
|
|
203
|
-
* countdown that is not running.
|
|
204
|
-
*/
|
|
205
|
-
onWait?: ((wait: VisibleCaptureWindow | null) => void) | undefined;
|
|
206
|
-
}
|
|
192
|
+
export type { CaptureWaitOptions };
|
|
193
|
+
/**
|
|
194
|
+
* WHICH interception yielded the captured renderer. Not decoration: every
|
|
195
|
+
* coverage row the host prints names the mechanism it reached the game
|
|
196
|
+
* through, and the two are materially different — a `shared-three` game runs
|
|
197
|
+
* on the host's very `three` instance, while a `devtools-observer` game runs
|
|
198
|
+
* its OWN pinned revision and only its renderer is shared.
|
|
199
|
+
*/
|
|
200
|
+
export type CaptureMechanism = 'shared-three' | 'devtools-observer';
|
|
207
201
|
/** Handle returned by {@link installSceneCapture}. */
|
|
208
202
|
export interface SceneCaptureHandle {
|
|
209
203
|
/** The captured runtime, or null until the game renders its first frame. */
|
|
210
204
|
readonly captured: CapturedRuntime | null;
|
|
205
|
+
/** How {@link captured} was reached; `null` while nothing is captured. */
|
|
206
|
+
readonly capturedVia: CaptureMechanism | null;
|
|
211
207
|
/**
|
|
212
208
|
* Install (or clear, with `null`) hooks bracketing every `render()` the
|
|
213
209
|
* CAPTURED renderer makes. Set AFTER capture, because the consumer
|
|
@@ -233,7 +229,7 @@ export interface SceneCaptureHandle {
|
|
|
233
229
|
* host can pause (set null) and resume (re-set it) the game's own loop. */
|
|
234
230
|
getAnimationLoop(renderer: CapturedThreeRenderer): ((time: number) => void) | null;
|
|
235
231
|
/**
|
|
236
|
-
*
|
|
232
|
+
* Resize every captured `EffectComposer` that renders
|
|
237
233
|
* through the captured renderer to `w`×`h`, matching its pixel ratio to
|
|
238
234
|
* `renderer.getPixelRatio()` — the composer tracks whatever DPR policy the
|
|
239
235
|
* host already applies to the renderer; no separate knob. A no-op when no
|
|
@@ -249,7 +245,7 @@ export interface SceneCaptureHandle {
|
|
|
249
245
|
* Install the render accessor trap on `threeNamespace.WebGLRenderer.prototype`.
|
|
250
246
|
* Pass the host's `three` module so the game (which shares it) is trapped.
|
|
251
247
|
*
|
|
252
|
-
* `effectComposerCtor` is OPTIONAL
|
|
248
|
+
* `effectComposerCtor` is OPTIONAL: pass the host's
|
|
253
249
|
* `EffectComposer` class (`three/examples/jsm/postprocessing/EffectComposer.js`)
|
|
254
250
|
* to also trap composer construction/rendering on that shared addon, so
|
|
255
251
|
* `resizeComposers()` can reach it. Omitting it (or a game never constructing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-capture.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/scene-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"scene-capture.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/scene-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAElC;;0EAE0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5C,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,E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C,yEAAyE;IACzE,SAAS,IAAI,IAAI,CAAC;CACnB;AA+ID;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,OAAO,EACvB,kBAAkB,CAAC,EAAE,OAAO,EAC5B,IAAI,CAAC,EAAE,mBAAmB,GACzB,kBAAkB,CAsZpB"}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* classes. A game that bundles its own copy cannot be captured this way (the
|
|
32
32
|
* module-identity gatekeeper).
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* There is an OPTIONAL, ADDITIVE composer capture: a game rendering through
|
|
35
35
|
* its own three.js addon `EffectComposer`
|
|
36
36
|
* (`three/examples/jsm/postprocessing/EffectComposer.js`) still trips the `render`
|
|
37
37
|
* trap above (its `RenderPass` calls `renderer.render(scene,camera)` internally),
|
|
@@ -71,11 +71,105 @@ function objectId(value) {
|
|
|
71
71
|
const uuid = typeof obj?.uuid === 'string' ? obj.uuid : '(no uuid)';
|
|
72
72
|
return `${type}:${uuid}`;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* FOREIGN-INSTANCE CAPTURE — through three's own `__THREE_DEVTOOLS__` seam.
|
|
76
|
+
*
|
|
77
|
+
* The prototype trap above can only reach a game that resolves `three` to the
|
|
78
|
+
* host's instance ("the module-identity gatekeeper" in this file's header). A
|
|
79
|
+
* game vendored as a BUILT BUNDLE routinely does not: a webpack/CRA build
|
|
80
|
+
* inlines three outright, and a Vite build externalized to the game's own
|
|
81
|
+
* pinned `three-rNNN.module.js` loads a second ES module. Those games rendered
|
|
82
|
+
* a real picture the host could not see, and the mount failed by name.
|
|
83
|
+
*
|
|
84
|
+
* The canvas lane already answers this exact question and answers it the same
|
|
85
|
+
* way: `authoring/canvas-runtime-recognition.ts` recognizes Phaser and Babylon
|
|
86
|
+
* through THEIR OWN documented public registries (`Phaser.GAMES`,
|
|
87
|
+
* `BABYLON.Engine.Instances`) rather than by sharing a module instance. three's
|
|
88
|
+
* equivalent public registry is `__THREE_DEVTOOLS__`: every `WebGLRenderer`
|
|
89
|
+
* constructor since r118 ends with
|
|
90
|
+
*
|
|
91
|
+
* if ( typeof __THREE_DEVTOOLS__ !== 'undefined' )
|
|
92
|
+
* __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
|
|
93
|
+
*
|
|
94
|
+
* — a bare global lookup, so it is not affected by the game-globals lexical
|
|
95
|
+
* shadow, and it is present in every revision this repo vendors (r129, r155,
|
|
96
|
+
* r170) as well as the host's own r180. Setting that global before the game's
|
|
97
|
+
* modules evaluate therefore hands the host the game's renderer INSTANCE, and
|
|
98
|
+
* an own-property wrapper on that instance's `render` yields the identical
|
|
99
|
+
* `(scene, camera, renderer)` triple the prototype trap yields.
|
|
100
|
+
*
|
|
101
|
+
* This never changes what happens for a deduped game: such a renderer's own
|
|
102
|
+
* `render` assignment was already intercepted by the prototype setter, so
|
|
103
|
+
* `alreadyTrapped` skips it and there is exactly one interception per renderer.
|
|
104
|
+
*
|
|
105
|
+
* Returns its own teardown. If something else already installed
|
|
106
|
+
* `__THREE_DEVTOOLS__` (the real three.js devtools extension), we listen on it
|
|
107
|
+
* and leave it in place.
|
|
108
|
+
*/
|
|
109
|
+
function observeForeignThreeRenderers(ports) {
|
|
110
|
+
const host = globalThis;
|
|
111
|
+
if (typeof EventTarget !== 'function')
|
|
112
|
+
return () => undefined;
|
|
113
|
+
const weInstalled = host.__THREE_DEVTOOLS__ === undefined;
|
|
114
|
+
if (weInstalled)
|
|
115
|
+
host.__THREE_DEVTOOLS__ = new EventTarget();
|
|
116
|
+
const target = host.__THREE_DEVTOOLS__;
|
|
117
|
+
if (!target)
|
|
118
|
+
return () => undefined;
|
|
119
|
+
const restores = [];
|
|
120
|
+
function wrapOwn(instance, key, value) {
|
|
121
|
+
const prior = instance[key];
|
|
122
|
+
Object.defineProperty(instance, key, {
|
|
123
|
+
configurable: true,
|
|
124
|
+
writable: true,
|
|
125
|
+
value,
|
|
126
|
+
});
|
|
127
|
+
restores.push(() => {
|
|
128
|
+
Object.defineProperty(instance, key, { configurable: true, writable: true, value: prior });
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
const listener = (event) => {
|
|
132
|
+
const detail = event.detail;
|
|
133
|
+
// `observe` also carries Scenes (r129/r155/r170 dispatch from the `Scene`
|
|
134
|
+
// constructor too). A renderer is the one that owns a canvas and a render
|
|
135
|
+
// method; anything else is not this observer's subject.
|
|
136
|
+
if (!detail || typeof detail !== 'object')
|
|
137
|
+
return;
|
|
138
|
+
if (typeof detail.render !== 'function' || !detail.domElement)
|
|
139
|
+
return;
|
|
140
|
+
if (ports.alreadyTrapped(detail))
|
|
141
|
+
return;
|
|
142
|
+
if (ports.isHostRenderer(detail))
|
|
143
|
+
return;
|
|
144
|
+
const realRender = detail.render;
|
|
145
|
+
wrapOwn(detail, 'render', function (...args) {
|
|
146
|
+
return ports.observeRender(detail, realRender, args);
|
|
147
|
+
});
|
|
148
|
+
const realSal = detail.setAnimationLoop;
|
|
149
|
+
if (typeof realSal === 'function') {
|
|
150
|
+
const sal = realSal;
|
|
151
|
+
wrapOwn(detail, 'setAnimationLoop', function (callback) {
|
|
152
|
+
if (typeof callback === 'function') {
|
|
153
|
+
ports.recordLoop(detail, callback);
|
|
154
|
+
}
|
|
155
|
+
return sal.call(detail, callback);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
target.addEventListener('observe', listener);
|
|
160
|
+
return () => {
|
|
161
|
+
target.removeEventListener('observe', listener);
|
|
162
|
+
for (const restore of restores.splice(0))
|
|
163
|
+
restore();
|
|
164
|
+
if (weInstalled)
|
|
165
|
+
delete host.__THREE_DEVTOOLS__;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
74
168
|
/**
|
|
75
169
|
* Install the render accessor trap on `threeNamespace.WebGLRenderer.prototype`.
|
|
76
170
|
* Pass the host's `three` module so the game (which shares it) is trapped.
|
|
77
171
|
*
|
|
78
|
-
* `effectComposerCtor` is OPTIONAL
|
|
172
|
+
* `effectComposerCtor` is OPTIONAL: pass the host's
|
|
79
173
|
* `EffectComposer` class (`three/examples/jsm/postprocessing/EffectComposer.js`)
|
|
80
174
|
* to also trap composer construction/rendering on that shared addon, so
|
|
81
175
|
* `resizeComposers()` can reach it. Omitting it (or a game never constructing
|
|
@@ -145,14 +239,8 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
145
239
|
get() {
|
|
146
240
|
const self = this;
|
|
147
241
|
return function setAnimationLoop(cb) {
|
|
148
|
-
if (cb)
|
|
149
|
-
|
|
150
|
-
loopedRenderers.add(self);
|
|
151
|
-
// Hidden tabs park rAF. Play/eval still need a first frame, so when
|
|
152
|
-
// a waiter is parked we drive the game's own loop once — the same
|
|
153
|
-
// class of tick `waitSimTime` already uses for a hidden document.
|
|
154
|
-
queueMicrotask(pumpHiddenLoops);
|
|
155
|
-
}
|
|
242
|
+
if (cb)
|
|
243
|
+
recordAnimationLoop(self, cb);
|
|
156
244
|
const real = self[REAL_SAL];
|
|
157
245
|
return typeof real === 'function'
|
|
158
246
|
? real.call(self, cb)
|
|
@@ -166,8 +254,7 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
166
254
|
* `after` runs in a `finally`, so a throwing game frame still restores
|
|
167
255
|
* whatever the hook armed.
|
|
168
256
|
*/
|
|
169
|
-
function
|
|
170
|
-
const real = self[REAL];
|
|
257
|
+
function bracketedRender(self, real, args) {
|
|
171
258
|
const hooks = renderPassHooks;
|
|
172
259
|
if (hooks === null || !captured || self !== captured.renderer) {
|
|
173
260
|
return real.apply(self, args);
|
|
@@ -180,6 +267,18 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
180
267
|
hooks.after();
|
|
181
268
|
}
|
|
182
269
|
}
|
|
270
|
+
function forwardRender(self, args) {
|
|
271
|
+
return bracketedRender(self, self[REAL], args);
|
|
272
|
+
}
|
|
273
|
+
/** Register a game's animation-loop callback, whichever trap saw it. */
|
|
274
|
+
function recordAnimationLoop(renderer, callback) {
|
|
275
|
+
loopCallbacks.set(renderer, callback);
|
|
276
|
+
loopedRenderers.add(renderer);
|
|
277
|
+
// Hidden tabs park rAF. Play/eval still need a first frame, so when a
|
|
278
|
+
// waiter is parked we drive the game's own loop once — the same class of
|
|
279
|
+
// tick `waitSimTime` already uses for a hidden document.
|
|
280
|
+
queueMicrotask(pumpHiddenLoops);
|
|
281
|
+
}
|
|
183
282
|
/**
|
|
184
283
|
* Commit to a world, DECLARATION FIRST.
|
|
185
284
|
*
|
|
@@ -281,6 +380,20 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
281
380
|
};
|
|
282
381
|
},
|
|
283
382
|
});
|
|
383
|
+
// A game that does NOT share the host's `three` never reaches the prototype
|
|
384
|
+
// trap above. three's own devtools seam reaches it anyway — see
|
|
385
|
+
// {@link observeForeignThreeRenderers}.
|
|
386
|
+
const foreignRenderers = new WeakSet();
|
|
387
|
+
const stopForeignObserver = observeForeignThreeRenderers({
|
|
388
|
+
alreadyTrapped: (renderer) => renderer[REAL] !== undefined,
|
|
389
|
+
isHostRenderer: (renderer) => opts?.isHostRenderer?.(renderer) === true,
|
|
390
|
+
observeRender: (self, real, args) => {
|
|
391
|
+
foreignRenderers.add(self);
|
|
392
|
+
observeRendererRender(self, args[0], args[1]);
|
|
393
|
+
return bracketedRender(self, real, args);
|
|
394
|
+
},
|
|
395
|
+
recordLoop: recordAnimationLoop,
|
|
396
|
+
});
|
|
284
397
|
// DOM-backed Three renderers (CSS3DRenderer is the first) use a normal
|
|
285
398
|
// prototype method rather than WebGLRenderer's constructor assignment. Trap
|
|
286
399
|
// only classes explicitly supplied by the host, and restore each byte-for-byte.
|
|
@@ -309,7 +422,7 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
309
422
|
rendererProto.render = priorRender;
|
|
310
423
|
});
|
|
311
424
|
}
|
|
312
|
-
// ----
|
|
425
|
+
// ---- (D-C2): additive composer capture, only when a composer ctor
|
|
313
426
|
// was passed. `EffectComposer` methods (including `render`) live on the
|
|
314
427
|
// PROTOTYPE (a plain ES class — the constructor never does `this.render =
|
|
315
428
|
// …`), so a direct method-wrapper suffices — no getter/setter indirection
|
|
@@ -334,7 +447,7 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
334
447
|
};
|
|
335
448
|
}
|
|
336
449
|
// Extracted so `uninstall()`'s own cognitive complexity doesn't grow with
|
|
337
|
-
// this additive
|
|
450
|
+
// this additive restore step (biome's noExcessiveCognitiveComplexity).
|
|
338
451
|
function restoreComposerTrap() {
|
|
339
452
|
if (!composerProto)
|
|
340
453
|
return;
|
|
@@ -347,6 +460,13 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
347
460
|
get captured() {
|
|
348
461
|
return captured;
|
|
349
462
|
},
|
|
463
|
+
get capturedVia() {
|
|
464
|
+
if (!captured)
|
|
465
|
+
return null;
|
|
466
|
+
return foreignRenderers.has(captured.renderer)
|
|
467
|
+
? 'devtools-observer'
|
|
468
|
+
: 'shared-three';
|
|
469
|
+
},
|
|
350
470
|
getDrawCount() {
|
|
351
471
|
return drawCount;
|
|
352
472
|
},
|
|
@@ -392,8 +512,11 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
392
512
|
opts.onWait?.(null);
|
|
393
513
|
reject(new Error(`Scene capture timed out after ${timeoutMs}ms of VISIBLE time ` +
|
|
394
514
|
`(${Math.round(captureWindow.elapsedHiddenMs())}ms browser-suspended, which is ` +
|
|
395
|
-
'not counted because no frame can be presented) —
|
|
396
|
-
|
|
515
|
+
'not counted because no frame can be presented) — no three renderer of ANY ' +
|
|
516
|
+
"instance drew a scene: neither the host's own `three` (the shared prototype " +
|
|
517
|
+
"trap) nor a renderer announcing itself on three's `__THREE_DEVTOOLS__` seam, " +
|
|
518
|
+
'which is what reaches a game that bundles its own copy. The game never ' +
|
|
519
|
+
'rendered.'));
|
|
397
520
|
},
|
|
398
521
|
});
|
|
399
522
|
const wrapped = (rt) => {
|
|
@@ -450,10 +573,13 @@ export function installSceneCapture(threeNamespace, effectComposerCtor, opts) {
|
|
|
450
573
|
Object.defineProperty(proto, 'setAnimationLoop', priorSAL);
|
|
451
574
|
else
|
|
452
575
|
delete proto['setAnimationLoop'];
|
|
453
|
-
//
|
|
576
|
+
// Fully restore the composer addon's `render` (a plain
|
|
454
577
|
// prototype method — no per-instance own-property to restore, unlike
|
|
455
578
|
// the renderer/loop traps above).
|
|
456
579
|
restoreComposerTrap();
|
|
580
|
+
// Stop listening on three's devtools seam and give every foreign
|
|
581
|
+
// renderer instance its own `render`/`setAnimationLoop` back.
|
|
582
|
+
stopForeignObserver();
|
|
457
583
|
for (const restore of additionalRendererRestores)
|
|
458
584
|
restore();
|
|
459
585
|
},
|
|
@@ -115,6 +115,40 @@ export interface VisibleCaptureWindow {
|
|
|
115
115
|
/** Stop the timer and drop the visibility listener. Idempotent. */
|
|
116
116
|
cancel(): void;
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* How a caller configures ONE such wait — the options both `waitForCapture`s
|
|
120
|
+
* take (`adapter/ingest/scene-capture.ts` on the three surface,
|
|
121
|
+
* `pixi/scene-capture.ts` on the canvas surface). Passing a bare number
|
|
122
|
+
* instead is `{ timeoutMs }`, the shape every existing caller uses.
|
|
123
|
+
*
|
|
124
|
+
* It lives HERE, with the window, rather than once per lane, because every
|
|
125
|
+
* field is a parameter of the mechanism above and none of them is a parameter
|
|
126
|
+
* of a surface: `timeoutMs` is {@link startVisibleCaptureWindow}'s `budgetMs`,
|
|
127
|
+
* `visibility` is its {@link VisibilityClock}, and `onWait` hands out the
|
|
128
|
+
* {@link VisibleCaptureWindow} it returns. The two lanes had identical copies
|
|
129
|
+
* of this — which is what a shape with no lane-specific field looks like when
|
|
130
|
+
* it is declared per lane — while both already imported those three names from
|
|
131
|
+
* this module. Genuinely per-surface shapes (`CapturedRuntime` vs
|
|
132
|
+
* `CapturedRuntime2D`: a three scene/renderer against a Pixi stage/app) stay in
|
|
133
|
+
* their own lanes and keep their own names.
|
|
134
|
+
*/
|
|
135
|
+
export interface CaptureWaitOptions {
|
|
136
|
+
/** The capture window, in VISIBLE milliseconds (default 10s). */
|
|
137
|
+
timeoutMs?: number | undefined;
|
|
138
|
+
/** Injected in tests; defaults to the document's own visibility. */
|
|
139
|
+
visibility?: VisibilityClock | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Called with a LIVE view of the wait when it begins, and with `null` the
|
|
142
|
+
* moment it ends (captured, expired, or the window was cancelled).
|
|
143
|
+
*
|
|
144
|
+
* A wait parked on a hidden tab is otherwise indistinguishable from a hung
|
|
145
|
+
* mount: nothing renders, nothing fails, and every door reports silence.
|
|
146
|
+
* This is the seam the editor publishes to `vgai status` so the answer is
|
|
147
|
+
* "waiting for the first visible frame — the tab is hidden", not a countdown
|
|
148
|
+
* that is not running.
|
|
149
|
+
*/
|
|
150
|
+
onWait?: ((wait: VisibleCaptureWindow | null) => void) | undefined;
|
|
151
|
+
}
|
|
118
152
|
/**
|
|
119
153
|
* Start a window that calls `onExpire` after `budgetMs` of VISIBLE time.
|
|
120
154
|
* While browser frame presentation is suspended the timer is disarmed entirely
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visible-capture-window.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/visible-capture-window.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,GAAG,IAAI,MAAM,CAAC;IACd,+EAA+E;IAC/E,MAAM,IAAI,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC;IACtB,6DAA6D;IAC7D,gBAAgB,CAAC,IAAI,QAAQ,GAAG,WAAW,GAAG,gBAAgB,GAAG,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B,0EAA0E;IAC1E,eAAe,IAAI,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC;IACpB,wFAAwF;IACxF,WAAW,IAAI,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,IAAI,QAAQ,GAAG,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACrE,mEAAmE;IACnE,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iDAAiD;IACjD,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,GAAG,oBAAoB,CAuDvB"}
|
|
1
|
+
{"version":3,"file":"visible-capture-window.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/visible-capture-window.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,GAAG,IAAI,MAAM,CAAC;IACd,+EAA+E;IAC/E,MAAM,IAAI,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC;IACtB,6DAA6D;IAC7D,gBAAgB,CAAC,IAAI,QAAQ,GAAG,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACtE,oEAAoE;IACpE,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;AAED;;yEAEyE;AACzE,wBAAgB,uBAAuB,IAAI,eAAe,CA4CzD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gB,IAAI,QAAQ,GAAG,WAAW,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACrE,mEAAmE;IACnE,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,oEAAoE;IACpE,UAAU,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACpE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iDAAiD;IACjD,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,GAAG,oBAAoB,CAuDvB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The manifest's SOLE INTERPRETER (owner ruling, 2026-08-20 — see
|
|
3
|
+
* docs/ARCHITECTURE-CORE.md §adapter). `vgai.project.json` is static
|
|
4
|
+
* inventory; the adapter seam is the ONE layer that turns it into execution
|
|
5
|
+
* bindings, and host code consumes the manifest through THESE derivations —
|
|
6
|
+
* never by reading `manifest.roots` directly (the guard is
|
|
7
|
+
* `packages/engine/test/manifest-sole-interpreter.test.ts`).
|
|
8
|
+
*
|
|
9
|
+
* Why a doorway and not a convention: one deriver means one direction of
|
|
10
|
+
* truth (manifest → adapter → host). When the project's own `vgai.adapter.ts`
|
|
11
|
+
* later interposes on a derivation, every host path that asked the
|
|
12
|
+
* interpreter gets the project's answer for free; a path that read the raw
|
|
13
|
+
* field would silently keep the mechanical one.
|
|
14
|
+
*
|
|
15
|
+
* The module-free audiences named by the ruling (a bundled CLI's raw
|
|
16
|
+
* discovery over unvalidated files, Vite config time, synchronous
|
|
17
|
+
* dep-optimization, and the loader that CONSTRUCTS the resolution) remain
|
|
18
|
+
* direct readers by design; everything else asks here.
|
|
19
|
+
*
|
|
20
|
+
* These functions are pure and synchronous over an already-loaded manifest —
|
|
21
|
+
* interpreting inventory never evaluates project modules, so any host realm
|
|
22
|
+
* may import this. They are structurally generic so both the loader's
|
|
23
|
+
* `ResolvedGameManifest` and the editor's lenient `EditModeManifest` view
|
|
24
|
+
* flow through the same doorway.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The declared adapter roots, in mount order (the loader already sorted by
|
|
28
|
+
* `zOrder`, ties by declaration order). This is the mount plan, the readiness
|
|
29
|
+
* roster, and the enumeration every other derivation composes from.
|
|
30
|
+
*/
|
|
31
|
+
export declare function declaredRoots<Root>(manifest: {
|
|
32
|
+
readonly roots: readonly Root[];
|
|
33
|
+
}): readonly Root[];
|
|
34
|
+
/** The root declaring `id`, or undefined — never a silent first-wins pick. */
|
|
35
|
+
export declare function rootById<Root extends {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
}>(manifest: {
|
|
38
|
+
readonly roots: readonly Root[];
|
|
39
|
+
}, id: string): Root | undefined;
|
|
40
|
+
/** Whether any declared root mounts on `surface` (e.g. the editor's
|
|
41
|
+
* "does this project have a Three world" gates). The parameter is the closed
|
|
42
|
+
* surface union, not `string` — a typo'd literal must stay a compile error,
|
|
43
|
+
* not a silent forever-false. */
|
|
44
|
+
export declare function hasRootOnSurface(manifest: {
|
|
45
|
+
readonly roots: readonly {
|
|
46
|
+
readonly surface: string;
|
|
47
|
+
}[];
|
|
48
|
+
}, surface: 'three' | 'canvas' | 'dom'): boolean;
|
|
49
|
+
/** The declared ingest roots (`adapter.type === 'ingest'`), in mount order.
|
|
50
|
+
* Composite-manifest rules (exactly one, ≥2 is a loud named error) belong to
|
|
51
|
+
* the call sites that state them. */
|
|
52
|
+
export declare function ingestRoots<Root extends {
|
|
53
|
+
readonly adapter: {
|
|
54
|
+
readonly type: string;
|
|
55
|
+
};
|
|
56
|
+
}>(manifest: {
|
|
57
|
+
readonly roots: readonly Root[];
|
|
58
|
+
}): Root[];
|
|
59
|
+
//# sourceMappingURL=manifest-interpreter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-interpreter.d.ts","sourceRoot":"","sources":["../../src/adapter/manifest-interpreter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE;IAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;CACjC,GAAG,SAAS,IAAI,EAAE,CAElB;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,IAAI,SAAS;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAC3D,QAAQ,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;CAAE,EAC7C,EAAE,EAAE,MAAM,GACT,IAAI,GAAG,SAAS,CAElB;AAED;;;kCAGkC;AAClC,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,EACrE,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAClC,OAAO,CAET;AAED;;sCAEsC;AACtC,wBAAgB,WAAW,CACzB,IAAI,SAAS;IAAE,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAC5D,QAAQ,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;CAAE,GAAG,IAAI,EAAE,CAEvD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The manifest's SOLE INTERPRETER (owner ruling, 2026-08-20 — see
|
|
3
|
+
* docs/ARCHITECTURE-CORE.md §adapter). `vgai.project.json` is static
|
|
4
|
+
* inventory; the adapter seam is the ONE layer that turns it into execution
|
|
5
|
+
* bindings, and host code consumes the manifest through THESE derivations —
|
|
6
|
+
* never by reading `manifest.roots` directly (the guard is
|
|
7
|
+
* `packages/engine/test/manifest-sole-interpreter.test.ts`).
|
|
8
|
+
*
|
|
9
|
+
* Why a doorway and not a convention: one deriver means one direction of
|
|
10
|
+
* truth (manifest → adapter → host). When the project's own `vgai.adapter.ts`
|
|
11
|
+
* later interposes on a derivation, every host path that asked the
|
|
12
|
+
* interpreter gets the project's answer for free; a path that read the raw
|
|
13
|
+
* field would silently keep the mechanical one.
|
|
14
|
+
*
|
|
15
|
+
* The module-free audiences named by the ruling (a bundled CLI's raw
|
|
16
|
+
* discovery over unvalidated files, Vite config time, synchronous
|
|
17
|
+
* dep-optimization, and the loader that CONSTRUCTS the resolution) remain
|
|
18
|
+
* direct readers by design; everything else asks here.
|
|
19
|
+
*
|
|
20
|
+
* These functions are pure and synchronous over an already-loaded manifest —
|
|
21
|
+
* interpreting inventory never evaluates project modules, so any host realm
|
|
22
|
+
* may import this. They are structurally generic so both the loader's
|
|
23
|
+
* `ResolvedGameManifest` and the editor's lenient `EditModeManifest` view
|
|
24
|
+
* flow through the same doorway.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The declared adapter roots, in mount order (the loader already sorted by
|
|
28
|
+
* `zOrder`, ties by declaration order). This is the mount plan, the readiness
|
|
29
|
+
* roster, and the enumeration every other derivation composes from.
|
|
30
|
+
*/
|
|
31
|
+
export function declaredRoots(manifest) {
|
|
32
|
+
return manifest.roots;
|
|
33
|
+
}
|
|
34
|
+
/** The root declaring `id`, or undefined — never a silent first-wins pick. */
|
|
35
|
+
export function rootById(manifest, id) {
|
|
36
|
+
return manifest.roots.find((root) => root.id === id);
|
|
37
|
+
}
|
|
38
|
+
/** Whether any declared root mounts on `surface` (e.g. the editor's
|
|
39
|
+
* "does this project have a Three world" gates). The parameter is the closed
|
|
40
|
+
* surface union, not `string` — a typo'd literal must stay a compile error,
|
|
41
|
+
* not a silent forever-false. */
|
|
42
|
+
export function hasRootOnSurface(manifest, surface) {
|
|
43
|
+
return manifest.roots.some((root) => root.surface === surface);
|
|
44
|
+
}
|
|
45
|
+
/** The declared ingest roots (`adapter.type === 'ingest'`), in mount order.
|
|
46
|
+
* Composite-manifest rules (exactly one, ≥2 is a loud named error) belong to
|
|
47
|
+
* the call sites that state them. */
|
|
48
|
+
export function ingestRoots(manifest) {
|
|
49
|
+
return manifest.roots.filter((root) => root.adapter.type === 'ingest');
|
|
50
|
+
}
|