@vgai/engine 0.5.21 → 0.5.22

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.
Files changed (87) hide show
  1. package/dist/adapter/manifest-interpreter.d.ts +59 -0
  2. package/dist/adapter/manifest-interpreter.d.ts.map +1 -0
  3. package/dist/adapter/manifest-interpreter.js +50 -0
  4. package/dist/adapter/native-debug-module.d.ts +45 -3
  5. package/dist/adapter/native-debug-module.d.ts.map +1 -1
  6. package/dist/adapter/native-debug-module.js +128 -10
  7. package/dist/adapter/renderer-config.d.ts +1 -1
  8. package/dist/adapter/renderer-config.js +1 -1
  9. package/dist/canvas-react/index.d.ts +5 -12
  10. package/dist/canvas-react/index.d.ts.map +1 -1
  11. package/dist/canvas-react/index.js +5 -12
  12. package/dist/canvas-react/pixi-react-root-factory.d.ts +34 -21
  13. package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -1
  14. package/dist/canvas-react/pixi-react-root-factory.js +274 -36
  15. package/dist/core/countdown-timer.d.ts +118 -0
  16. package/dist/core/countdown-timer.d.ts.map +1 -0
  17. package/dist/core/countdown-timer.js +137 -0
  18. package/dist/core/deferred-commands.d.ts +127 -0
  19. package/dist/core/deferred-commands.d.ts.map +1 -0
  20. package/dist/core/deferred-commands.js +132 -0
  21. package/dist/core/sim-clock.d.ts +14 -2
  22. package/dist/core/sim-clock.d.ts.map +1 -1
  23. package/dist/core/sim-clock.js +14 -2
  24. package/dist/dev/instruments.d.ts +38 -11
  25. package/dist/dev/instruments.d.ts.map +1 -1
  26. package/dist/dev/instruments.js +81 -11
  27. package/dist/input/input-manager.d.ts +15 -0
  28. package/dist/input/input-manager.d.ts.map +1 -1
  29. package/dist/input/input-manager.js +15 -0
  30. package/dist/render/directional-shadow-fit.d.ts +88 -0
  31. package/dist/render/directional-shadow-fit.d.ts.map +1 -0
  32. package/dist/render/directional-shadow-fit.js +133 -0
  33. package/dist/render/environment-capture.d.ts +68 -0
  34. package/dist/render/environment-capture.d.ts.map +1 -0
  35. package/dist/render/environment-capture.js +90 -0
  36. package/dist/render/ibl-override-material.d.ts +97 -0
  37. package/dist/render/ibl-override-material.d.ts.map +1 -0
  38. package/dist/render/ibl-override-material.js +114 -0
  39. package/dist/runtime/game-input-seams.d.ts +51 -0
  40. package/dist/runtime/game-input-seams.d.ts.map +1 -0
  41. package/dist/runtime/game-input-seams.js +86 -0
  42. package/dist/runtime/game.d.ts +15 -0
  43. package/dist/runtime/game.d.ts.map +1 -1
  44. package/dist/runtime/game.js +40 -8
  45. package/dist/runtime/mount-game.d.ts.map +1 -1
  46. package/dist/runtime/mount-game.js +18 -2
  47. package/dist/runtime/mount-manifest.d.ts.map +1 -1
  48. package/dist/runtime/mount-manifest.js +4 -2
  49. package/dist/runtime/types.d.ts +1 -1
  50. package/dist/world3d-react/index.d.ts +15 -25
  51. package/dist/world3d-react/index.d.ts.map +1 -1
  52. package/dist/world3d-react/index.js +15 -25
  53. package/dist/world3d-react/r3f-root-factory.d.ts +19 -25
  54. package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
  55. package/dist/world3d-react/r3f-root-factory.js +396 -50
  56. package/dist/world3d-react/rapier-physics-bridge.d.ts +24 -12
  57. package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -1
  58. package/dist/world3d-react/rapier-physics-bridge.js +82 -49
  59. package/package.json +1 -1
  60. package/schemas/engine-capabilities.json +3 -3
  61. package/src/adapter/manifest-interpreter.ts +64 -0
  62. package/src/adapter/native-debug-module.ts +212 -15
  63. package/src/adapter/renderer-config.ts +1 -1
  64. package/src/canvas-react/index.ts +5 -21
  65. package/src/canvas-react/pixi-react-root-factory.tsx +301 -39
  66. package/src/core/countdown-timer.ts +188 -0
  67. package/src/core/deferred-commands.ts +174 -0
  68. package/src/core/sim-clock.ts +14 -2
  69. package/src/dev/instruments.ts +108 -11
  70. package/src/input/input-manager.ts +15 -0
  71. package/src/render/directional-shadow-fit.ts +156 -0
  72. package/src/render/environment-capture.ts +102 -0
  73. package/src/render/ibl-override-material.ts +170 -0
  74. package/src/runtime/game-input-seams.ts +108 -0
  75. package/src/runtime/game.ts +65 -7
  76. package/src/runtime/mount-game.ts +23 -1
  77. package/src/runtime/mount-manifest.ts +4 -2
  78. package/src/runtime/types.ts +1 -1
  79. package/src/world3d-react/index.ts +15 -31
  80. package/src/world3d-react/r3f-root-factory.tsx +444 -53
  81. package/src/world3d-react/rapier-physics-bridge.tsx +88 -49
  82. package/src/canvas-react/engine-bridge.ts +0 -59
  83. package/src/canvas-react/pixi-react-adapter.tsx +0 -356
  84. package/src/canvas-react/world-context.ts +0 -253
  85. package/src/world3d-react/engine-bridge.ts +0 -86
  86. package/src/world3d-react/r3f-adapter.tsx +0 -717
  87. package/src/world3d-react/world-context.ts +0 -358
@@ -0,0 +1,127 @@
1
+ /**
2
+ * `DeferredCommands` — work the caller runs at ONE point it chooses, plus the
3
+ * subject-keyed disposal that has to land after it.
4
+ *
5
+ * The hazard is not exotic and it is not a foreign engine's: it is what a
6
+ * Rapier world does to anything that mutates it from inside a callback. Disable
7
+ * a collider while the solver is iterating, or free the node a collision
8
+ * handler was dispatched ON, and the failure is either a corrupt step or
9
+ * Rapier's own "recursive use of an object ... unsafe aliasing in rust". The
10
+ * remedy is always the same shape — write down WHAT to do, do it once the frame
11
+ * is out of anybody's way — and every caller that needs it was previously
12
+ * hand-rolling an array.
13
+ *
14
+ * ## The one point is the CALLER's, deliberately
15
+ *
16
+ * There is no `queueMicrotask`, no `setTimeout(0)`, no `requestAnimationFrame`
17
+ * and no subscription anywhere in this module. Whoever builds the queue decides
18
+ * where {@link DeferredCommands.drain} runs — after physics, at the tail of a
19
+ * world's update, wherever the frame's quiet moment actually is. A queue nobody
20
+ * drains simply does not run its work, which is a visible failure rather than a
21
+ * silent reordering onto a timeline the game does not control.
22
+ *
23
+ * ## This is NOT `SimClock`, and `after(0)` is not a substitute
24
+ *
25
+ * `core/sim-clock.ts` schedules on SIM TIME: `after(0, fn)` scheduled mid-frame
26
+ * does land in that frame's tail flush (`runtime/game.ts` calls `flush(simT)`
27
+ * after every phase of every world), so the resemblance is real and worth
28
+ * naming. Three things make it the wrong tool for deferral:
29
+ *
30
+ * - **A paused world never flushes.** `flush` is inside `runFrameImpl`'s
31
+ * `advanced` guard, so a game that pauses between the defer and the drain
32
+ * holds the work forever. End-of-frame deferral has to run on the frame,
33
+ * not on the clock.
34
+ * - **No subject identity.** Deferring destruction needs "this object, once",
35
+ * and needs the two questions that fall out of it —
36
+ * {@link DeferredCommands.isDisposePending} (a handler must be able to skip
37
+ * a subject that is already going away) and
38
+ * {@link DeferredCommands.wasDisposed} (an owner sweeping its own indexes
39
+ * after the drain). A time-ordered timer set answers neither.
40
+ * - **No same-drain re-entry.** A sim timer scheduled during a flush is
41
+ * deliberately never due in that flush; a deferred command that defers one
42
+ * more command must still land this frame, or the second write arrives a
43
+ * frame after the first and the two are no longer atomic.
44
+ *
45
+ * ## Ordering, and why disposal goes last
46
+ *
47
+ * {@link DeferredCommands.drain} runs every deferred command first, re-draining
48
+ * until the queue is empty, and only then disposes every pending subject. That
49
+ * order is not cosmetic: a deferred write to a subject that is ALSO queued for
50
+ * disposal must still happen — it is what the caller asked for — and disposing
51
+ * first would make that write operate on a freed handle. A subject queued twice
52
+ * is disposed once, and the FIRST thunk wins (every caller for one subject
53
+ * passes the same one).
54
+ *
55
+ * The re-drain is bounded by {@link MAX_DRAIN_PASSES}. A command that defers
56
+ * itself forever is a bug in the caller, and a bounded loop names it in a
57
+ * millisecond instead of hanging the frame.
58
+ *
59
+ * ## Why disposal carries its own thunk
60
+ *
61
+ * Disposal is the one thing here that is not surface-neutral. A `PIXI.Container`
62
+ * ends with `removeFromParent()` + `destroy({ children })`; a `THREE.Object3D`
63
+ * ends by detaching and disposing the geometries and materials underneath it;
64
+ * a physics-backed entity has a Rapier body to pull first. This queue does none
65
+ * of that — it takes the thunk from whoever owns the surface and runs it at the
66
+ * drain. So the ORDERING lives here once and the surface knowledge stays where
67
+ * the surface is, which is what lets one queue serve a 2D world and a 3D one.
68
+ *
69
+ * ## Resource ownership
70
+ *
71
+ * **Owner:** whoever calls {@link createDeferredCommands}, and that owner is
72
+ * also the only caller of `drain()` — a queue is per-DRAINER, not per-process,
73
+ * so two mounted games are two queues and neither can see the other's work.
74
+ * This module registers nothing anywhere: there is no game-scoped slot (unlike
75
+ * `sim-clock.ts`, which needs one because every world on a Game shares one
76
+ * clock) and no module-level state at all.
77
+ * **Sharers:** the queued subjects, by reference, and only until the drain that
78
+ * disposes them.
79
+ * **Teardown:** dropping the queue. There is deliberately no `dispose()` —
80
+ * nothing here holds a handle, a listener or a timer, and a queue dropped with
81
+ * work still in it has simply not run that work, which is what discarding a
82
+ * frame means.
83
+ */
84
+ /**
85
+ * How many times {@link DeferredCommands.drain} re-drains a queue that keeps
86
+ * refilling itself before declaring the caller's own logic non-terminating.
87
+ *
88
+ * A bound that correct code cannot reach (a deferred command that defers one
89
+ * more, ten deep) while catching the infinite case immediately.
90
+ */
91
+ export declare const MAX_DRAIN_PASSES = 16;
92
+ /** The queue. Build one per drainer with {@link createDeferredCommands}. */
93
+ export interface DeferredCommands {
94
+ /**
95
+ * Run `command` at the next {@link DeferredCommands.drain}.
96
+ *
97
+ * ```ts
98
+ * // inside a collision handler, where the solver still owns the world:
99
+ * frame.defer(() => collider.setSensor(true));
100
+ * ```
101
+ */
102
+ defer(command: () => void): void;
103
+ /**
104
+ * Dispose `subject` at the next drain, after every deferred command has run.
105
+ * Queuing the same subject twice disposes it once — the first `dispose`
106
+ * thunk wins.
107
+ */
108
+ deferDispose(subject: object, dispose: () => void): void;
109
+ /**
110
+ * Is `subject` queued for disposal and not yet disposed? Read by a handler
111
+ * that must skip a subject already on its way out.
112
+ */
113
+ isDisposePending(subject: object): boolean;
114
+ /**
115
+ * Has THIS queue already disposed `subject`? Read after a drain by an owner
116
+ * sweeping its own indexes (a group, a registry, a spatial bucket) — "am I
117
+ * destroyed" is a surface-specific question that a plain `Object3D` has no
118
+ * answer to, so the queue is asked instead.
119
+ */
120
+ wasDisposed(subject: object): boolean;
121
+ /** Run every deferred command (re-draining), then dispose every pending
122
+ * subject. Called once per frame, by the owner, at the point it chose. */
123
+ drain(): void;
124
+ }
125
+ /** Build one queue. See the module header for who owns it and who drains it. */
126
+ export declare function createDeferredCommands(): DeferredCommands;
127
+ //# sourceMappingURL=deferred-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deferred-commands.d.ts","sourceRoot":"","sources":["../../src/core/deferred-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,4EAA4E;AAC5E,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACzD;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3C;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC;+EAC2E;IAC3E,KAAK,IAAI,IAAI,CAAC;CACf;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,IAAI,gBAAgB,CA6CzD"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * `DeferredCommands` — work the caller runs at ONE point it chooses, plus the
3
+ * subject-keyed disposal that has to land after it.
4
+ *
5
+ * The hazard is not exotic and it is not a foreign engine's: it is what a
6
+ * Rapier world does to anything that mutates it from inside a callback. Disable
7
+ * a collider while the solver is iterating, or free the node a collision
8
+ * handler was dispatched ON, and the failure is either a corrupt step or
9
+ * Rapier's own "recursive use of an object ... unsafe aliasing in rust". The
10
+ * remedy is always the same shape — write down WHAT to do, do it once the frame
11
+ * is out of anybody's way — and every caller that needs it was previously
12
+ * hand-rolling an array.
13
+ *
14
+ * ## The one point is the CALLER's, deliberately
15
+ *
16
+ * There is no `queueMicrotask`, no `setTimeout(0)`, no `requestAnimationFrame`
17
+ * and no subscription anywhere in this module. Whoever builds the queue decides
18
+ * where {@link DeferredCommands.drain} runs — after physics, at the tail of a
19
+ * world's update, wherever the frame's quiet moment actually is. A queue nobody
20
+ * drains simply does not run its work, which is a visible failure rather than a
21
+ * silent reordering onto a timeline the game does not control.
22
+ *
23
+ * ## This is NOT `SimClock`, and `after(0)` is not a substitute
24
+ *
25
+ * `core/sim-clock.ts` schedules on SIM TIME: `after(0, fn)` scheduled mid-frame
26
+ * does land in that frame's tail flush (`runtime/game.ts` calls `flush(simT)`
27
+ * after every phase of every world), so the resemblance is real and worth
28
+ * naming. Three things make it the wrong tool for deferral:
29
+ *
30
+ * - **A paused world never flushes.** `flush` is inside `runFrameImpl`'s
31
+ * `advanced` guard, so a game that pauses between the defer and the drain
32
+ * holds the work forever. End-of-frame deferral has to run on the frame,
33
+ * not on the clock.
34
+ * - **No subject identity.** Deferring destruction needs "this object, once",
35
+ * and needs the two questions that fall out of it —
36
+ * {@link DeferredCommands.isDisposePending} (a handler must be able to skip
37
+ * a subject that is already going away) and
38
+ * {@link DeferredCommands.wasDisposed} (an owner sweeping its own indexes
39
+ * after the drain). A time-ordered timer set answers neither.
40
+ * - **No same-drain re-entry.** A sim timer scheduled during a flush is
41
+ * deliberately never due in that flush; a deferred command that defers one
42
+ * more command must still land this frame, or the second write arrives a
43
+ * frame after the first and the two are no longer atomic.
44
+ *
45
+ * ## Ordering, and why disposal goes last
46
+ *
47
+ * {@link DeferredCommands.drain} runs every deferred command first, re-draining
48
+ * until the queue is empty, and only then disposes every pending subject. That
49
+ * order is not cosmetic: a deferred write to a subject that is ALSO queued for
50
+ * disposal must still happen — it is what the caller asked for — and disposing
51
+ * first would make that write operate on a freed handle. A subject queued twice
52
+ * is disposed once, and the FIRST thunk wins (every caller for one subject
53
+ * passes the same one).
54
+ *
55
+ * The re-drain is bounded by {@link MAX_DRAIN_PASSES}. A command that defers
56
+ * itself forever is a bug in the caller, and a bounded loop names it in a
57
+ * millisecond instead of hanging the frame.
58
+ *
59
+ * ## Why disposal carries its own thunk
60
+ *
61
+ * Disposal is the one thing here that is not surface-neutral. A `PIXI.Container`
62
+ * ends with `removeFromParent()` + `destroy({ children })`; a `THREE.Object3D`
63
+ * ends by detaching and disposing the geometries and materials underneath it;
64
+ * a physics-backed entity has a Rapier body to pull first. This queue does none
65
+ * of that — it takes the thunk from whoever owns the surface and runs it at the
66
+ * drain. So the ORDERING lives here once and the surface knowledge stays where
67
+ * the surface is, which is what lets one queue serve a 2D world and a 3D one.
68
+ *
69
+ * ## Resource ownership
70
+ *
71
+ * **Owner:** whoever calls {@link createDeferredCommands}, and that owner is
72
+ * also the only caller of `drain()` — a queue is per-DRAINER, not per-process,
73
+ * so two mounted games are two queues and neither can see the other's work.
74
+ * This module registers nothing anywhere: there is no game-scoped slot (unlike
75
+ * `sim-clock.ts`, which needs one because every world on a Game shares one
76
+ * clock) and no module-level state at all.
77
+ * **Sharers:** the queued subjects, by reference, and only until the drain that
78
+ * disposes them.
79
+ * **Teardown:** dropping the queue. There is deliberately no `dispose()` —
80
+ * nothing here holds a handle, a listener or a timer, and a queue dropped with
81
+ * work still in it has simply not run that work, which is what discarding a
82
+ * frame means.
83
+ */
84
+ /**
85
+ * How many times {@link DeferredCommands.drain} re-drains a queue that keeps
86
+ * refilling itself before declaring the caller's own logic non-terminating.
87
+ *
88
+ * A bound that correct code cannot reach (a deferred command that defers one
89
+ * more, ten deep) while catching the infinite case immediately.
90
+ */
91
+ export const MAX_DRAIN_PASSES = 16;
92
+ /** Build one queue. See the module header for who owns it and who drains it. */
93
+ export function createDeferredCommands() {
94
+ let commands = [];
95
+ const doomed = new Map();
96
+ const disposed = new WeakSet();
97
+ return {
98
+ defer(command) {
99
+ commands.push(command);
100
+ },
101
+ deferDispose(subject, dispose) {
102
+ if (!doomed.has(subject))
103
+ doomed.set(subject, dispose);
104
+ },
105
+ isDisposePending(subject) {
106
+ return doomed.has(subject);
107
+ },
108
+ wasDisposed(subject) {
109
+ return disposed.has(subject);
110
+ },
111
+ drain() {
112
+ let passes = 0;
113
+ while (commands.length > 0) {
114
+ if (++passes > MAX_DRAIN_PASSES) {
115
+ throw new Error(`DeferredCommands.drain: still queueing more work after ${MAX_DRAIN_PASSES} passes. ` +
116
+ 'Something passed to defer() defers itself, so this drain would never terminate.');
117
+ }
118
+ const batch = commands;
119
+ commands = [];
120
+ for (const command of batch)
121
+ command();
122
+ }
123
+ // Subjects last, and only after every deferred command has run — see the
124
+ // module header's ordering section.
125
+ for (const [subject, dispose] of doomed) {
126
+ dispose();
127
+ disposed.add(subject);
128
+ }
129
+ doomed.clear();
130
+ },
131
+ };
132
+ }
@@ -105,8 +105,20 @@
105
105
  *
106
106
  * ## Deliberately absent
107
107
  *
108
- * - **No `every`/`repeat`/interval.** Nothing needs one, and `after`
109
- * re-arming itself is three lines the game owns.
108
+ * - **No `every`/`repeat`/interval that is `core/countdown-timer.ts`.**
109
+ * This header used to say an `after` re-arming itself was "three lines the
110
+ * game owns"; it is three lines that DRIFT, because re-arming schedules the
111
+ * next fire from the moment the callback ran, so every long frame
112
+ * permanently lengthens the interval. A repeating interval needs
113
+ * overshoot carry and multi-fire on a big step to keep its event count
114
+ * right, and it is stepped by its owner rather than by the clock. Both
115
+ * belong to a countdown object, not to a sim-time one-shot.
116
+ * - **No end-of-frame command queue — that is
117
+ * `core/deferred-commands.ts`.** `after(0, fn)` looks like one (the flush
118
+ * below does run at the tail of the frame that scheduled it) and is not:
119
+ * it holds the work forever across a pause, it has no subject identity, and
120
+ * a command it schedules during a flush waits a whole extra frame. See that
121
+ * module's header for all three.
110
122
  * - **No fiber kernel, no coroutine emulation, no `task.spawn`.** Calling an
111
123
  * `async function` *is* `task.spawn` — the language already has it.
112
124
  * - **No wall clock.** This module reads no system timer and creates no
@@ -1 +1 @@
1
- {"version":3,"file":"sim-clock.d.ts","sourceRoot":"","sources":["../../src/core/sim-clock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,iDAAiD;AACjD,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,wEAAwE;IACxE,GAAG,IAAI,MAAM,CAAC;IACd,2EAA2E;IAC3E,OAAO,IAAI,MAAM,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAAC;IAClF;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC;CACpE;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,IAAI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,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAAC;IAClF;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC;CACpE;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;CACjD;AAyBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAiJzE;AAWD,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAE7E;AAED;;;;;;;;+EAQ+E;AAC/E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAElE"}
@@ -105,8 +105,20 @@
105
105
  *
106
106
  * ## Deliberately absent
107
107
  *
108
- * - **No `every`/`repeat`/interval.** Nothing needs one, and `after`
109
- * re-arming itself is three lines the game owns.
108
+ * - **No `every`/`repeat`/interval that is `core/countdown-timer.ts`.**
109
+ * This header used to say an `after` re-arming itself was "three lines the
110
+ * game owns"; it is three lines that DRIFT, because re-arming schedules the
111
+ * next fire from the moment the callback ran, so every long frame
112
+ * permanently lengthens the interval. A repeating interval needs
113
+ * overshoot carry and multi-fire on a big step to keep its event count
114
+ * right, and it is stepped by its owner rather than by the clock. Both
115
+ * belong to a countdown object, not to a sim-time one-shot.
116
+ * - **No end-of-frame command queue — that is
117
+ * `core/deferred-commands.ts`.** `after(0, fn)` looks like one (the flush
118
+ * below does run at the tail of the frame that scheduled it) and is not:
119
+ * it holds the work forever across a pause, it has no subject identity, and
120
+ * a command it schedules during a flush waits a whole extra frame. See that
121
+ * module's header for all three.
110
122
  * - **No fiber kernel, no coroutine emulation, no `task.spawn`.** Calling an
111
123
  * `async function` *is* `task.spawn` — the language already has it.
112
124
  * - **No wall clock.** This module reads no system timer and creates no
@@ -25,13 +25,13 @@
25
25
  * game registry.
26
26
  *
27
27
  * ── THE DOOR ────────────────────────────────────────────────────────────────
28
- * This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-tools
29
- * capability's own registry adopts this list (`installDevToolsInstruments`) and
30
- * publishes each instrument through the SAME door every declaration in that
31
- * capability uses — one provider per reading (`instrument.timescale`), one
32
- * command per action (`instrument.timescale.set`), plus the `dev-tools` index
33
- * provider. That is deliberate and load-bearing: the registry IS the product,
34
- * so every reader of an instrument reaches the SAME registration.
28
+ * The HOST publishes these itself ({@link publishDevInstruments}, called by
29
+ * the mount install paths): one provider per reading
30
+ * (`instrument.timescale`), one command per action
31
+ * (`instrument.timescale.set`), plus the `instruments` index provider. The
32
+ * registry IS the product, so every reader of an instrument reaches the SAME
33
+ * registration and a game writes zero lines and mounts nothing to have
34
+ * them.
35
35
  *
36
36
  * ── DEGRADING ───────────────────────────────────────────────────────────────
37
37
  * An instrument whose subject this game does not have (no physics adapter ⇒ no
@@ -42,10 +42,10 @@
42
42
  *
43
43
  * ── RESOURCE OWNERSHIP, STATED ONCE ─────────────────────────────────────────
44
44
  * {@link createDevInstruments} owns everything it allocates: the frame-time
45
- * ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the
46
- * dev-tools capability's `DevToolsBridge`, which creates one set per mounted
47
- * game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the ONE path
48
- * that ends it. Nothing else here holds a resource; the time-scale, pause and
45
+ * ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the host
46
+ * install path ({@link publishDevInstruments}), which creates one set per
47
+ * mounted game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the
48
+ * ONE path that ends it. Nothing else here holds a resource; the time-scale, pause and
49
49
  * collider instruments only drive state that `Game` already owns.
50
50
  */
51
51
  import { z } from 'zod';
@@ -130,4 +130,31 @@ export declare function summarizeFrameTimes(samples: readonly number[]): FrameTi
130
130
  * caller owns the returned {@link DevInstrumentSet.dispose}.
131
131
  */
132
132
  export declare function createDevInstruments(game: Game): DevInstrumentSet;
133
+ /** The index provider's name. */
134
+ export declare const INSTRUMENTS_PROVIDER = "instruments";
135
+ /** One instrument in the index: descriptor plus this instant's value. A
136
+ * throwing read is reported as itself, never swallowed. */
137
+ export interface PublishedInstrumentReading {
138
+ readonly name: string;
139
+ readonly id: string;
140
+ readonly label: string;
141
+ readonly hint: string;
142
+ readonly unit?: string;
143
+ readonly control: DevInstrumentControl;
144
+ readonly actions: readonly {
145
+ readonly name: string;
146
+ readonly id: string;
147
+ readonly label: string;
148
+ readonly hint: string;
149
+ }[];
150
+ readonly value: unknown;
151
+ readonly error?: string;
152
+ }
153
+ /**
154
+ * Create this game's instrument set and register every door on its debug
155
+ * registry. Called once per mounted Game by the host install path; the
156
+ * returned disposer ends the set's one resource (the frame-time
157
+ * subscription) — the registrations die with the Game itself.
158
+ */
159
+ export declare function publishDevInstruments(game: Game): () => void;
133
160
  //# sourceMappingURL=instruments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["../../src/dev/instruments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;sCAEsC;AACtC,MAAM,MAAM,oBAAoB;AAC9B,oBAAoB;AAClB;IAAE,QAAQ,CAAC,IA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C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kCAAkC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,CAehF;AAcD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,CA2IjE;AAmBD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAMlD;4DAC4D;AAC5D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;IACJ,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAwBD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,IAAI,CA2B5D"}
@@ -25,13 +25,13 @@
25
25
  * game registry.
26
26
  *
27
27
  * ── THE DOOR ────────────────────────────────────────────────────────────────
28
- * This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-tools
29
- * capability's own registry adopts this list (`installDevToolsInstruments`) and
30
- * publishes each instrument through the SAME door every declaration in that
31
- * capability uses — one provider per reading (`instrument.timescale`), one
32
- * command per action (`instrument.timescale.set`), plus the `dev-tools` index
33
- * provider. That is deliberate and load-bearing: the registry IS the product,
34
- * so every reader of an instrument reaches the SAME registration.
28
+ * The HOST publishes these itself ({@link publishDevInstruments}, called by
29
+ * the mount install paths): one provider per reading
30
+ * (`instrument.timescale`), one command per action
31
+ * (`instrument.timescale.set`), plus the `instruments` index provider. The
32
+ * registry IS the product, so every reader of an instrument reaches the SAME
33
+ * registration and a game writes zero lines and mounts nothing to have
34
+ * them.
35
35
  *
36
36
  * ── DEGRADING ───────────────────────────────────────────────────────────────
37
37
  * An instrument whose subject this game does not have (no physics adapter ⇒ no
@@ -42,15 +42,16 @@
42
42
  *
43
43
  * ── RESOURCE OWNERSHIP, STATED ONCE ─────────────────────────────────────────
44
44
  * {@link createDevInstruments} owns everything it allocates: the frame-time
45
- * ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the
46
- * dev-tools capability's `DevToolsBridge`, which creates one set per mounted
47
- * game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the ONE path
48
- * that ends it. Nothing else here holds a resource; the time-scale, pause and
45
+ * ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the host
46
+ * install path ({@link publishDevInstruments}), which creates one set per
47
+ * mounted game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the
48
+ * ONE path that ends it. Nothing else here holds a resource; the time-scale, pause and
49
49
  * collider instruments only drive state that `Game` already owns.
50
50
  */
51
51
  import { z } from 'zod';
52
52
  import { nodeKeyedPhysics } from '../adapter/system-adapter';
53
53
  import { clampTimeScale, TIME_SCALE_RANGE } from '../core/frame-pacing';
54
+ import { getDebugRegistry } from '../runtime/debug-registry';
54
55
  /**
55
56
  * How many display frames the frame-time reading keeps. ~1 second at 60 Hz —
56
57
  * long enough that a hitch is still in the window when you look, short enough
@@ -233,3 +234,72 @@ export function createDevInstruments(game) {
233
234
  function now() {
234
235
  return typeof performance === 'undefined' ? Date.now() : performance.now();
235
236
  }
237
+ // ---------------------------------------------------------------------------
238
+ // Host publication — the instruments' OWN door
239
+ // ---------------------------------------------------------------------------
240
+ //
241
+ // The HOST publishes these (the editor's mount install path), so every game
242
+ // gets them for literally zero lines — no capability, no bridge component, no
243
+ // mount. One provider per reading (`instrument.timescale`), one command per
244
+ // action (`instrument.timescale.set`), plus ONE index provider
245
+ // (`instruments`) carrying every descriptor with this instant's values, so an
246
+ // outside reader gets the whole panel in one round trip. Naming is unchanged
247
+ // from when the dev-tools capability published them, so every existing reader
248
+ // keeps working; only the publisher moved realms.
249
+ /** The index provider's name. */
250
+ export const INSTRUMENTS_PROVIDER = 'instruments';
251
+ /** The registry scope the host publishes under. Not a mounted world —
252
+ * instruments are game-scoped host furniture, like the hooks' `__react__`. */
253
+ const INSTRUMENTS_WORLD_ID = '__instruments__';
254
+ function readingOf(instrument) {
255
+ const base = {
256
+ name: `instrument.${instrument.id}`,
257
+ id: instrument.id,
258
+ label: instrument.label,
259
+ hint: instrument.hint,
260
+ ...(instrument.unit === undefined ? {} : { unit: instrument.unit }),
261
+ control: instrument.control,
262
+ actions: instrument.actions.map((action) => ({
263
+ name: `instrument.${instrument.id}.${action.id}`,
264
+ id: action.id,
265
+ label: action.label,
266
+ hint: action.hint,
267
+ })),
268
+ };
269
+ try {
270
+ return { ...base, value: instrument.read() };
271
+ }
272
+ catch (error) {
273
+ return { ...base, value: null, error: error instanceof Error ? error.message : String(error) };
274
+ }
275
+ }
276
+ /**
277
+ * Create this game's instrument set and register every door on its debug
278
+ * registry. Called once per mounted Game by the host install path; the
279
+ * returned disposer ends the set's one resource (the frame-time
280
+ * subscription) — the registrations die with the Game itself.
281
+ */
282
+ export function publishDevInstruments(game) {
283
+ const registry = getDebugRegistry(game);
284
+ if (!registry) {
285
+ throw new Error('Cannot publish dev instruments: mounted Game has no debug registry.');
286
+ }
287
+ const set = createDevInstruments(game);
288
+ const scope = registry.forRoot(INSTRUMENTS_WORLD_ID);
289
+ for (const instrument of set.instruments) {
290
+ scope.registerStateProvider(`instrument.${instrument.id}`, () => instrument.read(), {
291
+ tier: 'assisted',
292
+ });
293
+ for (const action of instrument.actions) {
294
+ scope.registerCommand(`instrument.${instrument.id}.${action.id}`, {
295
+ description: `${instrument.label}: ${action.label} — ${action.hint}`,
296
+ locus: 'client',
297
+ args: action.args,
298
+ }, (...values) => action.run(values));
299
+ }
300
+ }
301
+ scope.registerStateProvider(INSTRUMENTS_PROVIDER, () => set.instruments.map(readingOf), {
302
+ tier: 'assisted',
303
+ });
304
+ return () => set.dispose();
305
+ }
@@ -545,6 +545,21 @@ export declare class InputManager {
545
545
  isDeviceGamepadButtonPressed(button: number): boolean;
546
546
  isDeviceGamepadButtonJustPressed(button: number): boolean;
547
547
  isDeviceGamepadButtonJustReleased(button: number): boolean;
548
+ /**
549
+ * The RAW `Gamepad.axes[axis]` of the first connected pad, gated on `inputActive`.
550
+ *
551
+ * Deliberately un-deadzoned, and it must stay that way. The engine's own stick deadzone lives on
552
+ * the ACTION path (`gamepad_axis` / `gamepad_axis_pair`, default
553
+ * `GAMEPAD_AXIS_DEFAULT_DEADZONE`), where a game declares it and can override it per binding.
554
+ * This door exists for a caller that must apply a DIFFERENT rule — every foreign-engine compat
555
+ * lane does: Unity's `Gamepad.leftStick` carries a `StickDeadzone` processor with its own
556
+ * 0.125/0.925 (`unity-compat/input-system-device.ts` reproduces it), and Godot's `get_axis`
557
+ * has its own. Baking one engine's constants in here would silently give every other lane the
558
+ * wrong feel under its own API name.
559
+ *
560
+ * So: a caller that wants "a stick" wants a deadzone and must say WHOSE. A caller that wants
561
+ * the hardware number calls this.
562
+ */
548
563
  getDeviceGamepadAxis(axis: number): number;
549
564
  private firstConnectedGamepadIndex;
550
565
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"input-manager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AAC,MAAM,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAUzE;;;;;;;2DAOuD;IACvD,mBAAmB,IAAI,IAAI;IAI3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GACjD,IAAI;IAYP;;;;;;4BAMwB;IACxB,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAI1E;;+DAE2D;IAC3D,mBAAmB,IAAI,IAAI;IAM3B;;kCAE8B;IAC9B,kBAAkB,IAAI,IAAI;IAI1B,6DAA6D;IAC7D,gBAAgB,IAAI,OAAO;IAI3B;;;mBAGe;IACf,aAAa,IAAI;QACf,OAAO,EAAE,CAAC,CAAC;QACX,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG;gBAAE,CAAC,EAAE,MAAM,CAAC;gBAAC,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE,EAAE,CAAC;KACjG;IAID,uDAAuD;IACvD,kBAAkB,CAAC,OAAO,EAAE,WAAW;IAWvC;;;;;;;;;;;OAWG;IACH,eAAe;IAYf,+BAA+B;IAC/B,OAAO;CAoBR"}
@@ -1727,6 +1727,21 @@ export class InputManager {
1727
1727
  return false;
1728
1728
  return this.gamepadButtonsJustUp.has(`${index}:${button}`);
1729
1729
  }
1730
+ /**
1731
+ * The RAW `Gamepad.axes[axis]` of the first connected pad, gated on `inputActive`.
1732
+ *
1733
+ * Deliberately un-deadzoned, and it must stay that way. The engine's own stick deadzone lives on
1734
+ * the ACTION path (`gamepad_axis` / `gamepad_axis_pair`, default
1735
+ * `GAMEPAD_AXIS_DEFAULT_DEADZONE`), where a game declares it and can override it per binding.
1736
+ * This door exists for a caller that must apply a DIFFERENT rule — every foreign-engine compat
1737
+ * lane does: Unity's `Gamepad.leftStick` carries a `StickDeadzone` processor with its own
1738
+ * 0.125/0.925 (`unity-compat/input-system-device.ts` reproduces it), and Godot's `get_axis`
1739
+ * has its own. Baking one engine's constants in here would silently give every other lane the
1740
+ * wrong feel under its own API name.
1741
+ *
1742
+ * So: a caller that wants "a stick" wants a deadzone and must say WHOSE. A caller that wants
1743
+ * the hardware number calls this.
1744
+ */
1730
1745
  getDeviceGamepadAxis(axis) {
1731
1746
  if (!this.inputActive)
1732
1747
  return 0;