@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../src/adapter/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE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Aa,GAAG,IAAI,CAAC;CAC9C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC;8EAC0E;IAC1E,QAAQ,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC9C,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,yEAAyE;IACzE,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACrD,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAyCtE"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE ROOT BINDING — a game's declaration of itself, bound, as ONE host-side
|
|
3
|
+
* value.
|
|
4
|
+
*
|
|
5
|
+
* A game is a native program plus a declaration of itself; the editor is a
|
|
6
|
+
* universal client of that declaration; the host must not know what it is
|
|
7
|
+
* hosting. Today that declaration arrives at the host as a scatter — a
|
|
8
|
+
* `RootInstance`, a `MountedRoot`, an `AuthoringAdapter` provider bag, a
|
|
9
|
+
* `SystemAdapters` slot map, a `ResolvedAdapterRoot`, a parsed
|
|
10
|
+
* `AdapterDefinition` — and every consumer re-assembles its own subset by
|
|
11
|
+
* hand. `RootBinding` is that same material REGROUPED under one name, by the
|
|
12
|
+
* FIVE protocol families a host actually talks in.
|
|
13
|
+
*
|
|
14
|
+
* ## This file declares the vocabulary AND performs the regrouping
|
|
15
|
+
*
|
|
16
|
+
* {@link createRootBinding} is the one place the five families are assembled,
|
|
17
|
+
* and it is a pure re-address of values it is HANDED — it loads nothing,
|
|
18
|
+
* fetches nothing, and constructs no provider. The editor's
|
|
19
|
+
* `binding-resolver.ts` (`resolveRootBinding(root, realm, adapterDef)`) is what
|
|
20
|
+
* gathers those values per realm and calls this; `RootInstance.binding`
|
|
21
|
+
* (`runtime/game.ts`) is where the result lives for the life of the mount.
|
|
22
|
+
* Keeping the assembly here rather than in the resolver is what makes the
|
|
23
|
+
* reference-equality rule below checkable in ONE function instead of once per
|
|
24
|
+
* realm.
|
|
25
|
+
*
|
|
26
|
+
* ## The one rule that makes this a regrouping and not an abstraction
|
|
27
|
+
*
|
|
28
|
+
* **Every member is a REFERENCE to the thing that already exists — never a
|
|
29
|
+
* facade, never a copy, never a wrapper.** `substrate.mounted` IS the
|
|
30
|
+
* `MountedRoot` the adapter returned. `observation.debugRegistry` IS the ONE
|
|
31
|
+
* game-scoped registry every root of that game shares (this binding neither
|
|
32
|
+
* owns it nor tears it down). And the providers that are read AND written
|
|
33
|
+
* through — `selection`, `transforms`, `inspector`, `instances`,
|
|
34
|
+
* `spatialHandles`, `boxEdit`, `text` — appear in BOTH
|
|
35
|
+
* {@link ProjectionBinding} and {@link TruthBinding} as literally the same
|
|
36
|
+
* object, so `binding.projection.selection === binding.truth.selection`. A
|
|
37
|
+
* facade at either address would make the two views disagree the first time
|
|
38
|
+
* anything stateful moved through one of them; reference equality is what
|
|
39
|
+
* makes "regrouping" a checkable claim instead of a promise.
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* REGROUP the parts into the five families. No loading, no defaulting, no
|
|
43
|
+
* fabrication: every member of the result is one of `parts`' own values or one
|
|
44
|
+
* of `parts.mounted.authoring`'s own provider objects, read straight off it.
|
|
45
|
+
*
|
|
46
|
+
* The straddlers are read ONCE into locals and written to both bindings, which
|
|
47
|
+
* is what makes `binding.projection.selection === binding.truth.selection` true
|
|
48
|
+
* by construction rather than by care —
|
|
49
|
+
* `adapter-binding-protocol-families.test.ts` asserts it over a value this
|
|
50
|
+
* function built.
|
|
51
|
+
*
|
|
52
|
+
* The two callback members are the one exception to "the same reference", and
|
|
53
|
+
* deliberately: `subscribe`/`observeTransforms` are METHODS on their adapter
|
|
54
|
+
* (`live-three-authoring-adapter` reads `this.store` inside `subscribe`), so a
|
|
55
|
+
* bare property read would hand the caller a function whose `this` is the
|
|
56
|
+
* observation binding. They are bound to the authoring adapter that owns them —
|
|
57
|
+
* the same function over the same receiver, with nothing interposed. They are
|
|
58
|
+
* not straddlers and carry no equality claim.
|
|
59
|
+
*
|
|
60
|
+
* An absent `mounted.authoring` costs this root its `projection` and `truth`
|
|
61
|
+
* and NOTHING ELSE. There is no such thing as an empty `ProjectionBinding` —
|
|
62
|
+
* `capabilities`/`hierarchy` are required — so those two families are simply
|
|
63
|
+
* not there, which is the honest report. The other three are built from the
|
|
64
|
+
* declaration and the mount, neither of which the authoring adapter has
|
|
65
|
+
* anything to do with; refusing them as well would answer "which root is
|
|
66
|
+
* this, what did the project declare, what can be watched" with silence, and
|
|
67
|
+
* that is what made `binding` unreadable for every native TSX root the editor
|
|
68
|
+
* plays (the editor supplies their authoring itself — see
|
|
69
|
+
* {@link RootBinding.projection}).
|
|
70
|
+
*/
|
|
71
|
+
export function createRootBinding(parts) {
|
|
72
|
+
const authoring = parts.mounted.authoring;
|
|
73
|
+
// Read each straddler ONCE — the two bindings below then hold these exact
|
|
74
|
+
// objects, not two reads of the same key.
|
|
75
|
+
const { selection, transforms, inspector, instances, spatialHandles, boxEdit, text } = authoring ?? {};
|
|
76
|
+
return {
|
|
77
|
+
substrate: {
|
|
78
|
+
adapter: parts.adapter,
|
|
79
|
+
mounted: parts.mounted,
|
|
80
|
+
pausable: parts.pausable,
|
|
81
|
+
loop: parts.root.loop,
|
|
82
|
+
},
|
|
83
|
+
...(authoring === undefined
|
|
84
|
+
? {}
|
|
85
|
+
: projectionAndTruth(authoring, {
|
|
86
|
+
selection,
|
|
87
|
+
transforms,
|
|
88
|
+
inspector,
|
|
89
|
+
instances,
|
|
90
|
+
spatialHandles,
|
|
91
|
+
boxEdit,
|
|
92
|
+
text,
|
|
93
|
+
})),
|
|
94
|
+
observation: {
|
|
95
|
+
systems: parts.mounted.systems,
|
|
96
|
+
debugRegistry: parts.debugRegistry,
|
|
97
|
+
observe: parts.mounted.observe,
|
|
98
|
+
subscribe: authoring?.subscribe?.bind(authoring),
|
|
99
|
+
observeTransforms: authoring?.observeTransforms?.bind(authoring),
|
|
100
|
+
entryDebug: parts.entryDebug,
|
|
101
|
+
entrySystems: parts.entrySystems,
|
|
102
|
+
},
|
|
103
|
+
project: {
|
|
104
|
+
root: parts.root,
|
|
105
|
+
definition: parts.definition,
|
|
106
|
+
entry: parts.entry,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** The two authoring-dependent families, built together from the ONE adapter
|
|
111
|
+
* and the straddlers already read off it — so the reference-equality rule is
|
|
112
|
+
* still decided in a single place. */
|
|
113
|
+
function projectionAndTruth(authoring, straddlers) {
|
|
114
|
+
const { selection, transforms, inspector, instances, spatialHandles, boxEdit, text } = straddlers;
|
|
115
|
+
return {
|
|
116
|
+
projection: {
|
|
117
|
+
capabilities: authoring.capabilities,
|
|
118
|
+
hierarchy: authoring.hierarchy,
|
|
119
|
+
provenance: authoring.provenance,
|
|
120
|
+
selection,
|
|
121
|
+
transforms,
|
|
122
|
+
inspector,
|
|
123
|
+
instances,
|
|
124
|
+
spatialHandles,
|
|
125
|
+
boxEdit,
|
|
126
|
+
text,
|
|
127
|
+
assetSubject: authoring.assetSubject,
|
|
128
|
+
related: authoring.related,
|
|
129
|
+
rects: authoring.rects,
|
|
130
|
+
pickable: authoring.pickable,
|
|
131
|
+
stories: authoring.stories,
|
|
132
|
+
colorSample: authoring.colorSample,
|
|
133
|
+
},
|
|
134
|
+
truth: {
|
|
135
|
+
structure: authoring.structure,
|
|
136
|
+
persistence: authoring.persistence,
|
|
137
|
+
truth: authoring.truth,
|
|
138
|
+
assetDrop: authoring.assetDrop,
|
|
139
|
+
selection,
|
|
140
|
+
transforms,
|
|
141
|
+
inspector,
|
|
142
|
+
instances,
|
|
143
|
+
spatialHandles,
|
|
144
|
+
boxEdit,
|
|
145
|
+
text,
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colyseus-networking-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/colyseus-networking-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,cAAc,IAAI,MAAM,GAAG,IAAI,CAAC;IAChC,mCAAmC;IACnC,KAAK,IAAI,OAAO,EAAE,CAAC;IACnB;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC/C,oFAAoF;IACpF,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,4EAA4E;IAC5E,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,6EAA6E;IAC7E,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACjD;;yEAEqE;IACrE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC;yCACqC;IACrC,QAAQ,CAAC,IAAI,QAAQ,GAAG,IAAI,CAAC;IAC7B;iDAC6C;IAC7C,gBAAgB,CAAC,IAAI,gBAAgB,CAAC;IACtC;uDACmD;IACnD,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;IACxC;;;;;kEAK8D;IAC9D,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,qEAAqE;IACrE,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;IACrD,0EAA0E;IAC1E,KAAK,CAAC,IAAI,QAAQ,CAAC;IACnB;4EACwE;IACxE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C;;qEAEiE;IACjE,cAAc,CAAC,IAAI,iBAAiB,GAAG,SAAS,CAAC;IACjD;;;mEAG+D;IAC/D,iBAAiB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,wBAAwB,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"colyseus-networking-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/colyseus-networking-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,cAAc,IAAI,MAAM,GAAG,IAAI,CAAC;IAChC,mCAAmC;IACnC,KAAK,IAAI,OAAO,EAAE,CAAC;IACnB;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC/C,oFAAoF;IACpF,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,4EAA4E;IAC5E,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,6EAA6E;IAC7E,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACjD;;yEAEqE;IACrE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC;yCACqC;IACrC,QAAQ,CAAC,IAAI,QAAQ,GAAG,IAAI,CAAC;IAC7B;iDAC6C;IAC7C,gBAAgB,CAAC,IAAI,gBAAgB,CAAC;IACtC;uDACmD;IACnD,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;IACxC;;;;;kEAK8D;IAC9D,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,qEAAqE;IACrE,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;IACrD,0EAA0E;IAC1E,KAAK,CAAC,IAAI,QAAQ,CAAC;IACnB;4EACwE;IACxE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C;;qEAEiE;IACjE,cAAc,CAAC,IAAI,iBAAiB,GAAG,SAAS,CAAC;IACjD;;;mEAG+D;IAC/D,iBAAiB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,wBAAwB,GAAG,iBAAiB,CAsEhG"}
|
|
@@ -38,11 +38,26 @@ export function createColyseusNetworkingAdapter(cfg) {
|
|
|
38
38
|
return false; // server owns it → inspect-only
|
|
39
39
|
return cfg.ownerId(o) === cfg.localSessionId(); // only your own peer's objects
|
|
40
40
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
// `subscribe` is the one member that still defaults, and honestly: an
|
|
42
|
+
// adapter with nothing to notify about has a real no-op subscription, and
|
|
43
|
+
// the caller's contract ("you will hear about changes") is kept — there are
|
|
44
|
+
// none. Every accessor below ANSWERS A QUESTION, and a default answer to a
|
|
45
|
+
// question nobody implemented is a fabricated measurement.
|
|
44
46
|
subscribe: (cb) => cfg.subscribe?.(cb) ?? (() => { }),
|
|
45
47
|
};
|
|
48
|
+
// The link-state accessors attach ONLY when supplied, exactly like the W3b
|
|
49
|
+
// capabilities below. They used to default — `'disconnected'`, `null`, and
|
|
50
|
+
// all-zero stats — which read as "we looked, and the game is idle and
|
|
51
|
+
// unconnected" for a config that had simply never been taught to look.
|
|
52
|
+
const connectionState = cfg.connectionState?.bind(cfg);
|
|
53
|
+
if (connectionState)
|
|
54
|
+
adapter.getConnectionState = () => connectionState();
|
|
55
|
+
const roomInfo = cfg.roomInfo?.bind(cfg);
|
|
56
|
+
if (roomInfo)
|
|
57
|
+
adapter.getRoomInfo = () => roomInfo();
|
|
58
|
+
const replicationStats = cfg.replicationStats?.bind(cfg);
|
|
59
|
+
if (replicationStats)
|
|
60
|
+
adapter.getReplicationStats = () => replicationStats();
|
|
46
61
|
// The W3b inspector capabilities attach ONLY when supplied: their absence
|
|
47
62
|
// is the editor's degradation signal (`getStateSnapshot` in adapter ⇒ tree,
|
|
48
63
|
// missing ⇒ "not provided by this adapter" — never a fabricated empty).
|
|
@@ -66,7 +81,11 @@ export function createColyseusNetworkingAdapter(cfg) {
|
|
|
66
81
|
// editor shows an editable field only when `setPlayerIdentity` is present.
|
|
67
82
|
const playerIdentity = cfg.playerIdentity?.bind(cfg);
|
|
68
83
|
if (playerIdentity) {
|
|
69
|
-
|
|
84
|
+
// `cfg.playerIdentity` may answer `undefined` — "I read the game's state
|
|
85
|
+
// and it has no seat for this client yet". That is not `{}`, an identity
|
|
86
|
+
// that exists and happens to be blank; it is the reader's real answer, and
|
|
87
|
+
// the seam passes it through.
|
|
88
|
+
adapter.getPlayerIdentity = () => playerIdentity();
|
|
70
89
|
}
|
|
71
90
|
const setPlayerIdentity = cfg.setPlayerIdentity?.bind(cfg);
|
|
72
91
|
if (setPlayerIdentity) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure TS-AST readers over an entrypoint's SELECTION TABLE — shared by the
|
|
3
|
+
* write side (`entrypoint-selection-source.ts`) and the read side
|
|
4
|
+
* (`finders/scenes-from-entrypoint-selection.ts`). These two must agree on
|
|
5
|
+
* what a selection table IS, or play remounts a key the finder never
|
|
6
|
+
* discovered; one spelling here is what makes that agreement structural.
|
|
7
|
+
* (The finder-import boundary bans importing from `finders/` — this sibling
|
|
8
|
+
* sits outside that directory precisely so both sides can share it.)
|
|
9
|
+
*/
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
/** The object literal a module-level `const <name> = { … }` binds. */
|
|
12
|
+
export declare function selectionTable(sf: ts.SourceFile, name: string): ts.ObjectLiteralExpression | undefined;
|
|
13
|
+
/** A property's key when it is a plain identifier or string literal. */
|
|
14
|
+
export declare function propertyKey(property: ts.ObjectLiteralElementLike): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The identifier the entrypoint INDEXES the selection table with — the
|
|
17
|
+
* `activeScene` in `scenes[activeScene]`.
|
|
18
|
+
*
|
|
19
|
+
* `undefined` when the module never indexes the table; `null` when it does
|
|
20
|
+
* but not readably (several identifiers, or a non-identifier index). Both
|
|
21
|
+
* are honest "cannot be read" answers the callers turn into their own notes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function indexingIdentifier(sf: ts.SourceFile, selection: string): string | undefined | null;
|
|
24
|
+
//# sourceMappingURL=entrypoint-selection-readers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoint-selection-readers.d.ts","sourceRoot":"","sources":["../../src/adapter/entrypoint-selection-readers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,sEAAsE;AACtE,wBAAgB,cAAc,CAC5B,EAAE,EAAE,EAAE,CAAC,UAAU,EACjB,IAAI,EAAE,MAAM,GACX,EAAE,CAAC,uBAAuB,GAAG,SAAS,CAUxC;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,wBAAwB,GAAG,MAAM,GAAG,SAAS,CAKrF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,EAAE,CAAC,UAAU,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,GAAG,IAAI,CAkB3B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure TS-AST readers over an entrypoint's SELECTION TABLE — shared by the
|
|
3
|
+
* write side (`entrypoint-selection-source.ts`) and the read side
|
|
4
|
+
* (`finders/scenes-from-entrypoint-selection.ts`). These two must agree on
|
|
5
|
+
* what a selection table IS, or play remounts a key the finder never
|
|
6
|
+
* discovered; one spelling here is what makes that agreement structural.
|
|
7
|
+
* (The finder-import boundary bans importing from `finders/` — this sibling
|
|
8
|
+
* sits outside that directory precisely so both sides can share it.)
|
|
9
|
+
*/
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
/** The object literal a module-level `const <name> = { … }` binds. */
|
|
12
|
+
export function selectionTable(sf, name) {
|
|
13
|
+
for (const statement of sf.statements) {
|
|
14
|
+
if (!ts.isVariableStatement(statement))
|
|
15
|
+
continue;
|
|
16
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
17
|
+
if (!ts.isIdentifier(declaration.name) || declaration.name.text !== name)
|
|
18
|
+
continue;
|
|
19
|
+
const initializer = declaration.initializer;
|
|
20
|
+
if (initializer && ts.isObjectLiteralExpression(initializer))
|
|
21
|
+
return initializer;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
/** A property's key when it is a plain identifier or string literal. */
|
|
27
|
+
export function propertyKey(property) {
|
|
28
|
+
const name = property.name;
|
|
29
|
+
if (!name)
|
|
30
|
+
return undefined;
|
|
31
|
+
if (ts.isIdentifier(name) || ts.isStringLiteral(name))
|
|
32
|
+
return name.text;
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The identifier the entrypoint INDEXES the selection table with — the
|
|
37
|
+
* `activeScene` in `scenes[activeScene]`.
|
|
38
|
+
*
|
|
39
|
+
* `undefined` when the module never indexes the table; `null` when it does
|
|
40
|
+
* but not readably (several identifiers, or a non-identifier index). Both
|
|
41
|
+
* are honest "cannot be read" answers the callers turn into their own notes.
|
|
42
|
+
*/
|
|
43
|
+
export function indexingIdentifier(sf, selection) {
|
|
44
|
+
const names = new Set();
|
|
45
|
+
let unreadable = false;
|
|
46
|
+
const visit = (node) => {
|
|
47
|
+
if (ts.isElementAccessExpression(node) &&
|
|
48
|
+
ts.isIdentifier(node.expression) &&
|
|
49
|
+
node.expression.text === selection) {
|
|
50
|
+
if (ts.isIdentifier(node.argumentExpression))
|
|
51
|
+
names.add(node.argumentExpression.text);
|
|
52
|
+
else
|
|
53
|
+
unreadable = true;
|
|
54
|
+
}
|
|
55
|
+
ts.forEachChild(node, visit);
|
|
56
|
+
};
|
|
57
|
+
ts.forEachChild(sf, visit);
|
|
58
|
+
if (names.size === 0 && !unreadable)
|
|
59
|
+
return undefined;
|
|
60
|
+
if (names.size !== 1 || unreadable)
|
|
61
|
+
return null;
|
|
62
|
+
return [...names][0];
|
|
63
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint-selection-source.d.ts","sourceRoot":"","sources":["../../src/adapter/entrypoint-selection-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"entrypoint-selection-source.d.ts","sourceRoot":"","sources":["../../src/adapter/entrypoint-selection-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,MAAM,0BAA0B,GAClC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACzE;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA6BpD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV,0BAA0B,CAsD5B"}
|
|
@@ -15,31 +15,10 @@
|
|
|
15
15
|
* host-side only — a game's `vgai.adapter.ts` must not import it.
|
|
16
16
|
*/
|
|
17
17
|
import ts from 'typescript';
|
|
18
|
+
import { indexingIdentifier, propertyKey, selectionTable } from './entrypoint-selection-readers';
|
|
18
19
|
function parse(path, source) {
|
|
19
20
|
return ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
|
|
20
21
|
}
|
|
21
|
-
function selectionTable(sf, name) {
|
|
22
|
-
for (const statement of sf.statements) {
|
|
23
|
-
if (!ts.isVariableStatement(statement))
|
|
24
|
-
continue;
|
|
25
|
-
for (const declaration of statement.declarationList.declarations) {
|
|
26
|
-
if (!ts.isIdentifier(declaration.name) || declaration.name.text !== name)
|
|
27
|
-
continue;
|
|
28
|
-
const initializer = declaration.initializer;
|
|
29
|
-
if (initializer && ts.isObjectLiteralExpression(initializer))
|
|
30
|
-
return initializer;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
function propertyKey(property) {
|
|
36
|
-
const name = property.name;
|
|
37
|
-
if (!name)
|
|
38
|
-
return undefined;
|
|
39
|
-
if (ts.isIdentifier(name) || ts.isStringLiteral(name))
|
|
40
|
-
return name.text;
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
22
|
function tableKeys(table) {
|
|
44
23
|
const keys = [];
|
|
45
24
|
for (const property of table.properties) {
|
|
@@ -49,28 +28,6 @@ function tableKeys(table) {
|
|
|
49
28
|
}
|
|
50
29
|
return keys;
|
|
51
30
|
}
|
|
52
|
-
/** The identifier in `scenes[activeScene]`, or a failure to read one. */
|
|
53
|
-
function indexingIdentifier(sf, selection) {
|
|
54
|
-
const names = new Set();
|
|
55
|
-
let unreadable = false;
|
|
56
|
-
const visit = (node) => {
|
|
57
|
-
if (ts.isElementAccessExpression(node) &&
|
|
58
|
-
ts.isIdentifier(node.expression) &&
|
|
59
|
-
node.expression.text === selection) {
|
|
60
|
-
if (ts.isIdentifier(node.argumentExpression))
|
|
61
|
-
names.add(node.argumentExpression.text);
|
|
62
|
-
else
|
|
63
|
-
unreadable = true;
|
|
64
|
-
}
|
|
65
|
-
ts.forEachChild(node, visit);
|
|
66
|
-
};
|
|
67
|
-
ts.forEachChild(sf, visit);
|
|
68
|
-
if (names.size === 0 && !unreadable)
|
|
69
|
-
return undefined;
|
|
70
|
-
if (names.size !== 1 || unreadable)
|
|
71
|
-
return null;
|
|
72
|
-
return [...names][0];
|
|
73
|
-
}
|
|
74
31
|
function moduleLevelStringLiteral(sf, name) {
|
|
75
32
|
for (const statement of sf.statements) {
|
|
76
33
|
if (!ts.isVariableStatement(statement))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes-from-entrypoint-selection.d.ts","sourceRoot":"","sources":["../../../src/adapter/finders/scenes-from-entrypoint-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,KAAK,EAGV,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"scenes-from-entrypoint-selection.d.ts","sourceRoot":"","sources":["../../../src/adapter/finders/scenes-from-entrypoint-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,KAAK,EAGV,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACjF;AA+QD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,mCAAmC,EAC3C,KAAK,EAAE,kCAAkC,GACxC,YAAY,CA8Bd"}
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import ts from 'typescript';
|
|
39
39
|
import { EXPORTED_COMPOSITION_REGIONS } from '../adapter-module';
|
|
40
|
+
import { indexingIdentifier, propertyKey, selectionTable } from '../entrypoint-selection-readers';
|
|
40
41
|
/** Strip the directory and extension from a project-relative path. */
|
|
41
42
|
function basename(path) {
|
|
42
43
|
const file = path.replaceAll('\\', '/').split('/').pop() ?? path;
|
|
@@ -92,58 +93,6 @@ function importedBindings(sf) {
|
|
|
92
93
|
}
|
|
93
94
|
return bindings;
|
|
94
95
|
}
|
|
95
|
-
/** The module-level `const <name> = { … }` initializer, if there is one. */
|
|
96
|
-
function selectionTable(sf, name) {
|
|
97
|
-
for (const statement of sf.statements) {
|
|
98
|
-
if (!ts.isVariableStatement(statement))
|
|
99
|
-
continue;
|
|
100
|
-
for (const declaration of statement.declarationList.declarations) {
|
|
101
|
-
if (!ts.isIdentifier(declaration.name) || declaration.name.text !== name)
|
|
102
|
-
continue;
|
|
103
|
-
const initializer = declaration.initializer;
|
|
104
|
-
if (initializer && ts.isObjectLiteralExpression(initializer))
|
|
105
|
-
return initializer;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
function propertyKey(property) {
|
|
111
|
-
const name = property.name;
|
|
112
|
-
if (!name)
|
|
113
|
-
return undefined;
|
|
114
|
-
if (ts.isIdentifier(name) || ts.isStringLiteral(name))
|
|
115
|
-
return name.text;
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* The identifier the entrypoint INDEXES the selection table with — the
|
|
120
|
-
* `activeScene` in `scenes[activeScene]`.
|
|
121
|
-
*
|
|
122
|
-
* `undefined` when the module never indexes the table, or indexes it with
|
|
123
|
-
* anything other than one single identifier: both are honest "cannot be read",
|
|
124
|
-
* and the caller turns each into its own note.
|
|
125
|
-
*/
|
|
126
|
-
function indexingIdentifier(sf, selection) {
|
|
127
|
-
const names = new Set();
|
|
128
|
-
let unreadable = false;
|
|
129
|
-
const visit = (node) => {
|
|
130
|
-
if (ts.isElementAccessExpression(node) &&
|
|
131
|
-
ts.isIdentifier(node.expression) &&
|
|
132
|
-
node.expression.text === selection) {
|
|
133
|
-
if (ts.isIdentifier(node.argumentExpression))
|
|
134
|
-
names.add(node.argumentExpression.text);
|
|
135
|
-
else
|
|
136
|
-
unreadable = true;
|
|
137
|
-
}
|
|
138
|
-
ts.forEachChild(node, visit);
|
|
139
|
-
};
|
|
140
|
-
ts.forEachChild(sf, visit);
|
|
141
|
-
if (names.size === 0 && !unreadable)
|
|
142
|
-
return undefined; // never indexed at all
|
|
143
|
-
if (names.size !== 1 || unreadable)
|
|
144
|
-
return null; // indexed, but not readably
|
|
145
|
-
return [...names][0];
|
|
146
|
-
}
|
|
147
96
|
/**
|
|
148
97
|
* The string a module-level `const <name> = '…'` binds, or `undefined`.
|
|
149
98
|
*
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host contexts — what the host hands a root when it mounts it, PER SURFACE.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* The host never assumes Rapier/Colyseus; those live behind `SystemAdapters`
|
|
7
|
-
* owned by the first-party implementer.
|
|
4
|
+
* The host never assumes Rapier/Colyseus; system choices live behind
|
|
5
|
+
* `SystemAdapters` owned by each root's own implementation.
|
|
8
6
|
*
|
|
9
7
|
* ## Why this file is a family, not one interface (P-8)
|
|
10
8
|
*
|
|
@@ -71,16 +69,49 @@
|
|
|
71
69
|
* hosts, with no caller anywhere, and its only real effect would have been to
|
|
72
70
|
* re-open the door this interface exists to close: the host handing a game a
|
|
73
71
|
* subsystem it did not build. Deleted rather than kept as a promise.
|
|
74
|
-
*
|
|
75
|
-
* Migration note: `SetupThreeRootAdapter.mount` builds today's `GameContext`
|
|
76
|
-
* (Rapier world, composer, …) internally from a `ThreeHostContext`. New code
|
|
77
|
-
* targets these contexts; `GameContext` is now a first-party implementation
|
|
78
|
-
* detail.
|
|
79
72
|
*/
|
|
80
73
|
import type * as THREE from 'three';
|
|
81
74
|
import type { AssetCache } from '../assets';
|
|
82
|
-
import type { Game
|
|
75
|
+
import type { Game } from '../runtime/game';
|
|
83
76
|
import type { AdapterSurface } from './adapter-surface';
|
|
77
|
+
/**
|
|
78
|
+
* THE FOUR DOORS a mounting root actually opens on the Game — and the whole
|
|
79
|
+
* reason `three`/`canvas` host contexts no longer name `GameInternal`.
|
|
80
|
+
*
|
|
81
|
+
* `GameInternal` is the HOST's own control surface: `runFrame`,
|
|
82
|
+
* `runRenderFrame`, `runTicks`, `registerRoot`, `notifySystemAdaptersChanged`,
|
|
83
|
+
* `dispose`. Handing it to an adapter's `mount()` published the loop driver to
|
|
84
|
+
* the thing being driven — nothing read those members through `host.game`, but
|
|
85
|
+
* the type said they could, so "what may a root do to its Game?" had no
|
|
86
|
+
* answer short of "everything".
|
|
87
|
+
*
|
|
88
|
+
* The four doors, each with its verified consumer:
|
|
89
|
+
*
|
|
90
|
+
* 1. **Input-map load** — `runtime/game-input-seams.ts` calls
|
|
91
|
+
* `game.loadInputMap(path)` (and reads `game.input`/`game.loop.fixedDt`)
|
|
92
|
+
* from every three and canvas mount.
|
|
93
|
+
* 2. **Debug-registry access** — `getDebugRegistry(host.game)`
|
|
94
|
+
* (`r3f-root-factory`, `pixi-react-root-factory`); the registry is keyed by
|
|
95
|
+
* Game IDENTITY, which is why this handle is the Game and not a projection
|
|
96
|
+
* of it.
|
|
97
|
+
* 3. **The Game handed to `<WorldProvider>`** — the react world-state seam
|
|
98
|
+
* (`r3f-root-factory`, `pixi-react-root-factory`, and both react mounts in
|
|
99
|
+
* the editor's resolver). `WorldProvider`'s prop is `Game`.
|
|
100
|
+
* 4. **The profiler toggle** — `host.game.profiler` (`r3f-root-factory`).
|
|
101
|
+
*
|
|
102
|
+
* Doors 2–4 are already on the PUBLIC {@link Game}. `loadInputMap` is the one
|
|
103
|
+
* member that was only on `GameInternal`, and it is explicitly an adapter-mount
|
|
104
|
+
* door (see its own doc comment in `runtime/game.ts`). So this handle is
|
|
105
|
+
* `Game` plus that one method — and a `GameInternal` satisfies it, so every
|
|
106
|
+
* host that already passes one keeps compiling unchanged.
|
|
107
|
+
*/
|
|
108
|
+
export interface HostGameHandle extends Game {
|
|
109
|
+
/** Load the game-owned input map ONCE, however many roots ask. See
|
|
110
|
+
* `GameInternal.loadInputMap` for the load-once/competing-paths contract. */
|
|
111
|
+
loadInputMap(path: string, options?: {
|
|
112
|
+
optional?: boolean;
|
|
113
|
+
}): Promise<void>;
|
|
114
|
+
}
|
|
84
115
|
/** The canvas/container the game renders into, plus its size. */
|
|
85
116
|
export interface HostSurface {
|
|
86
117
|
readonly canvas: HTMLCanvasElement;
|
|
@@ -104,8 +135,8 @@ export interface HostContextBase {
|
|
|
104
135
|
* zero-break guarantee for this slice). Typed as the PUBLIC `Game` shell
|
|
105
136
|
* here because that is the weakest promise any surface makes (a react
|
|
106
137
|
* root's host has always carried a plain `Game`); the three and canvas
|
|
107
|
-
* contexts narrow it to
|
|
108
|
-
* pass.
|
|
138
|
+
* contexts narrow it to {@link HostGameHandle} — the four doors a mounting
|
|
139
|
+
* root actually opens, which is what their hosts really pass.
|
|
109
140
|
*/
|
|
110
141
|
readonly game?: Game | undefined;
|
|
111
142
|
/**
|
|
@@ -130,7 +161,7 @@ export interface ThreeHostContext extends HostContextBase {
|
|
|
130
161
|
readonly renderer: THREE.WebGLRenderer;
|
|
131
162
|
/** Shared GLTF/texture cache — three-flavored today; see the header. */
|
|
132
163
|
readonly assets: AssetCache;
|
|
133
|
-
readonly game?:
|
|
164
|
+
readonly game?: HostGameHandle | undefined;
|
|
134
165
|
}
|
|
135
166
|
/**
|
|
136
167
|
* What a `canvas`-surface root is handed: a raw canvas + its
|
|
@@ -144,7 +175,7 @@ export interface CanvasHostContext extends HostContextBase {
|
|
|
144
175
|
readonly width: number;
|
|
145
176
|
readonly height: number;
|
|
146
177
|
/** Shared Game root when mounted by the universal multi-root host. */
|
|
147
|
-
readonly game?:
|
|
178
|
+
readonly game?: HostGameHandle | undefined;
|
|
148
179
|
/** DPR override (T6.1 slice 1, D5 §3 — "one DPR
|
|
149
180
|
* everywhere"): the roots-path host computes ONE dpr for every stacked
|
|
150
181
|
* surface and passes it here; omitted -> the canvas adapter's own
|
|
@@ -170,7 +201,7 @@ export interface CanvasHostContext extends HostContextBase {
|
|
|
170
201
|
* `game` (inherited, and deliberately still optional): a
|
|
171
202
|
* `default-react` sibling mounted BESIDE an ingest root (`packages/editor/src/
|
|
172
203
|
* ingest-siblings.ts`) has no native `Game` to hand it — there is no
|
|
173
|
-
* first-party
|
|
204
|
+
* first-party loop for the sibling to join, only the ingested
|
|
174
205
|
* root's own foreign runtime — so its host carries no `game` at all rather than
|
|
175
206
|
* fabricating an empty one (anti-shim rule); the sibling mounts its entry
|
|
176
207
|
* component bare, with no `<WorldProvider>` wrap. `mountOneReactRoot`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-context.d.ts","sourceRoot":"","sources":["../../src/adapter/host-context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"host-context.d.ts","sourceRoot":"","sources":["../../src/adapter/host-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI;IAC1C;kFAC8E;IAC9E,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7E;AAED,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACjC;;;;;OAKG;IAC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,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host contexts — what the host hands a root when it mounts it, PER SURFACE.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* The host never assumes Rapier/Colyseus; those live behind `SystemAdapters`
|
|
7
|
-
* owned by the first-party implementer.
|
|
4
|
+
* The host never assumes Rapier/Colyseus; system choices live behind
|
|
5
|
+
* `SystemAdapters` owned by each root's own implementation.
|
|
8
6
|
*
|
|
9
7
|
* ## Why this file is a family, not one interface (P-8)
|
|
10
8
|
*
|
|
@@ -71,10 +69,5 @@
|
|
|
71
69
|
* hosts, with no caller anywhere, and its only real effect would have been to
|
|
72
70
|
* re-open the door this interface exists to close: the host handing a game a
|
|
73
71
|
* subsystem it did not build. Deleted rather than kept as a promise.
|
|
74
|
-
*
|
|
75
|
-
* Migration note: `SetupThreeRootAdapter.mount` builds today's `GameContext`
|
|
76
|
-
* (Rapier world, composer, …) internally from a `ThreeHostContext`. New code
|
|
77
|
-
* targets these contexts; `GameContext` is now a first-party implementation
|
|
78
|
-
* detail.
|
|
79
72
|
*/
|
|
80
73
|
export {};
|
package/dist/adapter/index.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
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
|
|
@@ -26,13 +24,14 @@ export type { AdapterSurface } from './adapter-surface';
|
|
|
26
24
|
export type { AssetDropContext, AssetDropProvider, AssetSubjectProvider, AuthoringAdapter, AuthoringAssetSubject, AuthoringCapabilities, AuthoringProvenance, AuthoringProviderKey, AuthoringTruth, BoxEditProvider, BoxEditReferencePoint, ColorSampleProvider, ComponentInstanceApplyResult, ComponentInstanceDescription, ComponentInstanceOverride, ComponentInstancesProvider, DOMRectLike, EditorNode, EditorNodeRole, HierarchyProvider, InspectorProvider, NodeCreationSite, PersistenceProvider, PickProvider, PropertyDescriptor, RectProvider, RelatedSubjectLink, RelatedSubjectsProvider, SelectionProvider, SelectionResolution, SpatialDragHandle, SpatialHandleGuide, SpatialHandleLayer, SpatialHandlesProvider, SpatialPoint3, StoriesProvider, StoryRef, StructuralClipboardOutcome, StructuralIdsWrite, StructuralIdWrite, StructuralWriteOutcome, StructureProvider, TextProvider, TransformChannel, TransformEditability, TransformObservation, TransformProvider, TransformSourceCommitProvider, TruthProvider, WriteAck, WriteAnchorKind, } from './authoring';
|
|
27
25
|
export { AUTHORING_PROVIDER_KEYS, emptyWriteAnchorKindCounts, measureAuthoringProviders, WRITE_ANCHOR_KINDS, } from './authoring';
|
|
28
26
|
export { AUTHORING_ADAPTER_SHAPE, AUTHORING_PROVIDER_SHAPES, HIERARCHY_PROVIDER_SHAPE, } from './authoring-seam-contract';
|
|
27
|
+
export type { BundledEntrySubset, EntryStaticSurface, ObservationBinding, ProjectBinding, ProjectionBinding, ProtocolFamily, RootBinding, RootBindingParts, RootDeclaration, SubstrateBinding, TruthBinding, } from './binding';
|
|
28
|
+
export { createRootBinding } from './binding';
|
|
29
29
|
export type { ColyseusNetworkingConfig } from './colyseus-networking-adapter';
|
|
30
|
-
export type { CanvasHostContext, DomHostContext, HostContextBase, HostContextFor, HostSurface, ThreeHostContext, } from './host-context';
|
|
30
|
+
export type { CanvasHostContext, DomHostContext, HostContextBase, HostContextFor, HostGameHandle, HostSurface, ThreeHostContext, } from './host-context';
|
|
31
31
|
export type { MountedPixiRoot, MountedReactRoot, MountedRoot, MountedRootBase, MountedThreeRoot, RootAdapter, RootStateObserver, SurfaceAdapter, SurfaceAdapterFor, } from './root-adapter';
|
|
32
32
|
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';
|
|
33
33
|
export type { SeamEvidenceOutcome, SeamEvidenceReceipt, SeamEvidenceSource, SeamEvidenceState, SeamEvidenceVerdict, SeamProofStage, SeamShape, } from './seam-evidence';
|
|
34
34
|
export { defineSeamShape, gradeSeamCarrier, gradeSeamEvidence, inspectSeamShape, SEAM_PROOF_STAGES, SeamEvidenceLedger, seamStageAtLeast, } from './seam-evidence';
|
|
35
|
-
export type { MountedSetupThreeRoot, SetupThreeRootConfig } from './setup-three-root-adapter';
|
|
36
35
|
export type { AudioAdapter, AudioDebugEvent, AudioGraphNode, AudioMeterFrame, AudioMeterHandle, AudioRecordingHandle, AudioTransportState, CameraAdapter, CameraRuntimeCamera, CameraRuntimeSnapshot, CameraRuntimeTransition, ConnectionState, DebugAdapter, NavCrowdAgentState, NavigationAdapter, NavPoint, NetConditioning, NetMessageEvent, NetPeer, NetPlayerIdentity, NetRates, NetServerConfig, NetworkingAdapter, PhysicsAdapter, PhysicsCarrier, PhysicsColliderShape, PhysicsColliderSnapshot, PhysicsJointSnapshot, PhysicsJointType, RenderDebugAdapter, ReplicationStats, RoomInfo, SystemAdapters, Unsubscribe, } from './system-adapter';
|
|
37
36
|
/** The two narrowings of the tagged `SystemAdapters['physics']` union — see
|
|
38
37
|
* `PhysicsAdapter`'s comment for why it is tagged at all. */
|