@vgai/engine 0.5.16 → 0.5.18

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 (109) hide show
  1. package/dist/adapter/adapter-module.d.ts +1 -16
  2. package/dist/adapter/adapter-module.d.ts.map +1 -1
  3. package/dist/adapter/adapter-module.js +1 -11
  4. package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +0 -2
  5. package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
  6. package/dist/adapter/finders/scenes-from-entrypoint-selection.js +3 -6
  7. package/dist/adapter/renderer-config.d.ts +83 -0
  8. package/dist/adapter/renderer-config.d.ts.map +1 -0
  9. package/dist/adapter/renderer-config.js +121 -0
  10. package/dist/adapter/root-adapter.d.ts +6 -2
  11. package/dist/adapter/root-adapter.d.ts.map +1 -1
  12. package/dist/adapter/root-seam-contract.d.ts +5 -0
  13. package/dist/adapter/root-seam-contract.d.ts.map +1 -1
  14. package/dist/adapter/root-seam-contract.js +1 -0
  15. package/dist/adapter/setup-three-root-adapter.js +9 -9
  16. package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -1
  17. package/dist/canvas-react/pixi-react-adapter.js +92 -41
  18. package/dist/data/curve.d.ts +1 -1
  19. package/dist/data/curve.js +2 -2
  20. package/dist/dev/instruments.d.ts +4 -4
  21. package/dist/dev/instruments.js +4 -4
  22. package/dist/dev/register-render-vitals.d.ts +2 -2
  23. package/dist/dev/register-render-vitals.js +2 -2
  24. package/dist/dev/static-batch-advisor.d.ts +1 -1
  25. package/dist/dev/static-batch-advisor.js +2 -2
  26. package/dist/input/input-manager.d.ts +15 -0
  27. package/dist/input/input-manager.d.ts.map +1 -1
  28. package/dist/input/input-manager.js +22 -0
  29. package/dist/manifest/load.d.ts +0 -3
  30. package/dist/manifest/load.d.ts.map +1 -1
  31. package/dist/manifest/load.js +0 -4
  32. package/dist/manifest/schema.d.ts +0 -2
  33. package/dist/manifest/schema.d.ts.map +1 -1
  34. package/dist/manifest/schema.js +3 -24
  35. package/dist/pixi/authoring.d.ts +33 -0
  36. package/dist/pixi/authoring.d.ts.map +1 -1
  37. package/dist/pixi/authoring.js +86 -6
  38. package/dist/react/world-state.d.ts +12 -0
  39. package/dist/react/world-state.d.ts.map +1 -1
  40. package/dist/react/world-state.js +14 -0
  41. package/dist/render/soft-particle-depth.d.ts +3 -3
  42. package/dist/render/soft-particle-depth.d.ts.map +1 -1
  43. package/dist/render/soft-particle-depth.js +8 -13
  44. package/dist/runtime/create-runtime.d.ts +2 -16
  45. package/dist/runtime/create-runtime.d.ts.map +1 -1
  46. package/dist/runtime/create-runtime.js +36 -38
  47. package/dist/runtime/dev-build.d.ts +37 -0
  48. package/dist/runtime/dev-build.d.ts.map +1 -0
  49. package/dist/runtime/dev-build.js +49 -0
  50. package/dist/runtime/game.d.ts +9 -1
  51. package/dist/runtime/game.d.ts.map +1 -1
  52. package/dist/runtime/game.js +25 -1
  53. package/dist/runtime/mount-manifest.d.ts +0 -13
  54. package/dist/runtime/mount-manifest.d.ts.map +1 -1
  55. package/dist/runtime/mount-manifest.js +2 -21
  56. package/dist/world3d-react/engine-bridge.d.ts.map +1 -1
  57. package/dist/world3d-react/engine-bridge.js +28 -3
  58. package/dist/world3d-react/index.d.ts +2 -2
  59. package/dist/world3d-react/index.d.ts.map +1 -1
  60. package/dist/world3d-react/index.js +2 -2
  61. package/dist/world3d-react/r3f-adapter.d.ts +2 -2
  62. package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
  63. package/dist/world3d-react/r3f-adapter.js +90 -15
  64. package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
  65. package/dist/world3d-react/r3f-root-factory.js +12 -2
  66. package/dist/world3d-react/rapier-physics-bridge.d.ts +4 -4
  67. package/dist/world3d-react/rapier-physics-bridge.js +3 -3
  68. package/dist/world3d-react/renderer-config.d.ts +7 -69
  69. package/dist/world3d-react/renderer-config.d.ts.map +1 -1
  70. package/dist/world3d-react/renderer-config.js +7 -108
  71. package/dist/world3d-react/world-context.d.ts +43 -0
  72. package/dist/world3d-react/world-context.d.ts.map +1 -1
  73. package/dist/world3d-react/world-context.js +89 -46
  74. package/dist-config/config.js.map +1 -1
  75. package/package.json +1 -1
  76. package/schemas/engine-capabilities.json +3 -3
  77. package/schemas/vgai-project.schema.json +2 -7
  78. package/src/adapter/adapter-module.ts +1 -25
  79. package/src/adapter/finders/scenes-from-entrypoint-selection.ts +3 -8
  80. package/src/adapter/renderer-config.ts +178 -0
  81. package/src/adapter/root-adapter.ts +6 -2
  82. package/src/adapter/root-seam-contract.ts +1 -0
  83. package/src/adapter/setup-three-root-adapter.ts +9 -9
  84. package/src/canvas-react/pixi-react-adapter.tsx +98 -53
  85. package/src/data/curve.ts +2 -2
  86. package/src/dev/instruments.ts +4 -4
  87. package/src/dev/register-render-vitals.ts +2 -2
  88. package/src/dev/static-batch-advisor.ts +2 -2
  89. package/src/input/input-manager.ts +23 -0
  90. package/src/manifest/load.ts +0 -7
  91. package/src/manifest/schema.ts +3 -26
  92. package/src/pixi/authoring.ts +98 -6
  93. package/src/react/world-state.tsx +15 -0
  94. package/src/render/soft-particle-depth.ts +8 -13
  95. package/src/runtime/create-runtime.ts +38 -52
  96. package/src/runtime/dev-build.ts +49 -0
  97. package/src/runtime/game.ts +31 -2
  98. package/src/runtime/mount-manifest.ts +2 -33
  99. package/src/world3d-react/engine-bridge.ts +28 -3
  100. package/src/world3d-react/index.ts +5 -5
  101. package/src/world3d-react/r3f-adapter.tsx +89 -20
  102. package/src/world3d-react/r3f-root-factory.tsx +12 -2
  103. package/src/world3d-react/rapier-physics-bridge.tsx +4 -4
  104. package/src/world3d-react/renderer-config.ts +7 -164
  105. package/src/world3d-react/world-context.ts +100 -51
  106. package/dist/runtime/dev-layers.d.ts +0 -34
  107. package/dist/runtime/dev-layers.d.ts.map +0 -1
  108. package/dist/runtime/dev-layers.js +0 -46
  109. package/src/runtime/dev-layers.ts +0 -46
@@ -1 +1 @@
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AI,YAAY,EAAE;IAIvB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAKrC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAI3C;gEAC4D;IAC5D,OAAO,CAAC,MAAM;IA8Bd,OAAO,CAAC,MAAM;IAad,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAcjD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAe5D,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,EAAE;IAkBpC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAYnD,OAAO,CAAC,aAAa;IAYrB;;;;;;;;OAQG;IACH,YAAY,CAAC,OAAO,EAAE,SAAS,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;IAevE,OAAO,IAAI,OAAO;IAGlB,gBAAgB,IAAI,SAAS;IAG7B,gFAAgF;IAChF,cAAc,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI;IAKxC,wFAAwF;IACxF,SAAS,IAAI,IAAI;CAGlB"}
@@ -22,7 +22,12 @@ function kindOf(o) {
22
22
  * are not names — they used to win and hide every owner. Then the texture
23
23
  * alias (`Sprite.from('satellite')`). Then a remaining game constructor
24
24
  * (`TitleScreen`, `PrimaryButton`). Bare `new Container()` still reads as
25
- * `container`.
25
+ * `container` — plus its child count when it has children, because ten
26
+ * unnamed siblings that all read `container` name nothing at all; the
27
+ * editor loads games that never labelled anything and the panel still has
28
+ * to be legible. The count is DISPLAY only (row ids keep using raw
29
+ * `.label`) and rides only this last fallthrough: a row that earned a real
30
+ * name is never decorated.
26
31
  */
27
32
  function displayLabel(o) {
28
33
  const authored = authoredLabel(o);
@@ -37,12 +42,27 @@ function displayLabel(o) {
37
42
  const ctor = usefulCtorName(o);
38
43
  if (ctor)
39
44
  return ctor;
40
- return kindOf(o);
45
+ const kind = kindOf(o);
46
+ const childCount = o.children?.length ?? 0;
47
+ return childCount > 0 ? `${kind} (${childCount})` : kind;
41
48
  }
42
- /** Pixi v8 stamps Sprite/Graphics `.label` with the class name. That is not an authored name. */
49
+ /**
50
+ * Pixi v8 stamps Sprite/Graphics `.label` with the class name. That is not an
51
+ * authored name.
52
+ *
53
+ * The minified-constructor guard is about the SAME leak: a shipped build's
54
+ * `_Container` becomes `e`, and that `e` is a class name wearing a label's
55
+ * clothes. It is only that leak when the label IS this object's own class
56
+ * name — `container.label = 'fx'` (or 'ui', 'hp') is a name the game
57
+ * actually authored, and a game gets to be terse.
58
+ */
43
59
  function authoredLabel(o) {
44
60
  const authored = o.label?.trim();
45
- if (!authored || isGenericPixiCtor(authored))
61
+ if (!authored)
62
+ return undefined;
63
+ if (isMinifiedCtor(authored) && authored !== o.constructor?.name)
64
+ return authored;
65
+ if (isGenericPixiCtor(authored))
46
66
  return undefined;
47
67
  return authored;
48
68
  }
@@ -237,6 +257,36 @@ export class AuthoringAdapter2D {
237
257
  overlay = {};
238
258
  dirty = false;
239
259
  identity;
260
+ /**
261
+ * THE ROW-NAME MEMO — what makes a hierarchy read linear instead of a
262
+ * reflective flood walk per node per read.
263
+ *
264
+ * {@link displayLabel} is not a field read. For anything the game did not
265
+ * label itself it calls `viewOwnerLabel`, which climbs eight ancestors and
266
+ * reflects over each one's own fields, its bags, and two levels of whatever
267
+ * those hold — a deliberate search for the game object that owns this
268
+ * `.view`. Measured 2026-08-20 on a 1822-node `@pixi/react` canvas world,
269
+ * with the tab VISIBLE and the world rendering, one full projection walk
270
+ * cost ~800ms, essentially all of it here: once a world has rendered, the
271
+ * ancestors' own fields include Pixi's live render-group graph, so the
272
+ * search walks that too and finds nothing, every time, for every node.
273
+ *
274
+ * And it was asked four times per node per derivation — the projection
275
+ * walk, the conformance probe and the hierarchy facet each re-ask — which
276
+ * is how a status snapshot reached 115,433 `toNode` calls on one tree.
277
+ *
278
+ * ## What invalidates a remembered name
279
+ *
280
+ * Every input the derivation reads OFF THE OBJECT: its authored `.label`,
281
+ * its class, its texture, its parent, and how many children it has. Any of
282
+ * those changing re-derives — so a rename, a reparent, a retexture, and a
283
+ * sibling added or removed are all seen. What a remembered name does NOT
284
+ * re-notice is a game reassigning an ANCESTOR's field to point at this view
285
+ * after the fact, with the tree otherwise untouched; `viewOwnerLabel` is a
286
+ * naming heuristic, not a verdict, and the alternative is the 800ms walk
287
+ * above on every read of the tree.
288
+ */
289
+ names = new WeakMap();
240
290
  constructor(root, opts = {}) {
241
291
  this.root = root;
242
292
  if (opts.overlay)
@@ -291,12 +341,42 @@ export class AuthoringAdapter2D {
291
341
  displayObject(id) {
292
342
  return this.byId.get(id) ?? null;
293
343
  }
344
+ /** This object's row name, derived once and remembered until one of the
345
+ * inputs it is derived from changes. See {@link names}. */
346
+ nameOf(o) {
347
+ const cached = this.names.get(o);
348
+ const parent = o.parent ?? null;
349
+ const type = o.constructor;
350
+ const own = o.label ?? null;
351
+ const texture = o.texture ?? null;
352
+ const childCount = o.children?.length ?? 0;
353
+ if (cached &&
354
+ cached.parent === parent &&
355
+ cached.type === type &&
356
+ cached.own === own &&
357
+ cached.texture === texture &&
358
+ cached.childCount === childCount) {
359
+ return cached;
360
+ }
361
+ const derived = {
362
+ label: displayLabel(o),
363
+ kind: kindOf(o),
364
+ parent,
365
+ type,
366
+ own,
367
+ texture,
368
+ childCount,
369
+ };
370
+ this.names.set(o, derived);
371
+ return derived;
372
+ }
294
373
  toNode(o) {
295
374
  const self = o;
375
+ const { label, kind } = this.nameOf(o);
296
376
  return {
297
377
  id: self.__authId ?? '',
298
- label: displayLabel(o),
299
- kind: kindOf(o),
378
+ label,
379
+ kind,
300
380
  parentId: o.parent?.__authId ?? null,
301
381
  childIds: o.children.map((c) => c.__authId ?? ''),
302
382
  };
@@ -46,6 +46,18 @@ export declare function WorldProvider({ game, children }: PropsWithChildren<{
46
46
  * descriptively when called outside one — matching the repo's loud-failure
47
47
  * habit rather than silently returning `null`. */
48
48
  export declare function useGame(): Game;
49
+ /**
50
+ * {@link useGame}'s non-throwing sibling: the `Game` when one hosts this tree,
51
+ * `null` otherwise.
52
+ *
53
+ * For components that legitimately mount BOTH under a running game and under a
54
+ * host that has none — the editor design-mounts a world to author it, and a
55
+ * story renders a component with no game at all. Those components must degrade
56
+ * (a dev/QA surface that simply has nothing to drive) rather than throw during
57
+ * render, which would take the whole world down with it. Everything else uses
58
+ * `useGame`, whose throw is the honest report of a wiring bug.
59
+ */
60
+ export declare function useOptionalGame(): Game | null;
49
61
  /**
50
62
  * Subscribe to a selected slice of game state. Re-renders only when the
51
63
  * selected value changes: the selector re-runs at most once per completed
@@ -1 +1 @@
1
- {"version":3,"file":"world-state.d.ts","sourceRoot":"","sources":["../../src/react/world-state.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAA4B,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;6EAC6E;AAC7E,OAAO,EAAE,OAAO,EAAE,CAAC;AAInB;;;;;;;;;;;;;;oFAcoF;AACpF,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,iBAAiB,CAAC;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,+BAElF;AAED;;mDAEmD;AACnD,wBAAgB,OAAO,I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QAAQ,EAAE,OAAO,KAAK,CAAC,EAClC,MAAM,GAAE,MAAM,CAAC,CAAC,CAAa,GAC5B,CAAC,CAoBH;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,EACjB,IAAI,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CAAE,GAC1C,IAAI,CAaN;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,GAAG,SAAS,GAAG,SAAS,EAC1E,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAE,EACrE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAC/D,IAAI,CAeN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CASxE"}
@@ -51,6 +51,20 @@ export function useGame() {
51
51
  }
52
52
  return game;
53
53
  }
54
+ /**
55
+ * {@link useGame}'s non-throwing sibling: the `Game` when one hosts this tree,
56
+ * `null` otherwise.
57
+ *
58
+ * For components that legitimately mount BOTH under a running game and under a
59
+ * host that has none — the editor design-mounts a world to author it, and a
60
+ * story renders a component with no game at all. Those components must degrade
61
+ * (a dev/QA surface that simply has nothing to drive) rather than throw during
62
+ * render, which would take the whole world down with it. Everything else uses
63
+ * `useGame`, whose throw is the honest report of a wiring bug.
64
+ */
65
+ export function useOptionalGame() {
66
+ return useContext(GameContext);
67
+ }
54
68
  /**
55
69
  * Subscribe to a selected slice of game state. Re-renders only when the
56
70
  * selected value changes: the selector re-runs at most once per completed
@@ -91,9 +91,9 @@
91
91
  * callers are `registerParticleSystem` / `unregisterParticleSystem`.
92
92
  * - The render target and override material belong to the
93
93
  * {@link SoftParticleDepthPass} instance and die with its `dispose()`. The
94
- * pass itself is owned by whichever adapter mount created it (the R3F adapter
95
- * and `setup-three-root-adapter`), and that mount's teardown is the one path
96
- * allowed to end it.
94
+ * pass is owned by the renderer loop that calls it: an adapter mount for a
95
+ * runtime renderer, or the editor Scene viewport for its renderer. That
96
+ * owner's teardown is the one path allowed to end it.
97
97
  */
98
98
  import * as THREE from 'three';
99
99
  import type { BatchedRenderer } from 'three.quarks';
@@ -1 +1 @@
1
- {"version":3,"file":"soft-particle-depth.d.ts","sourceRoot":"","sources":["../../src/render/soft-particle-depth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAepD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,IAAI,KAAK,CAAC,WAAW,CAOnD;AAED,8FAA8F;AAC9F,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAQvE;AAED,uFAAuF;AACvF,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD;AAED,0FAA0F;AAC1F,MAAM,WAAW,yBAAyB;IACxC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC3D,eAAe,IAAI,KAAK,CAAC,iBAAiB,GAAG,IAAI,CA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BAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC3D,eAAe,IAAI,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAClD,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IAC1D,kGAAkG;IAClG,QAAQ,CAAC,SAAS,CAAC,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;CACpE;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,yBAAyB,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IAC5F,OAAO,IAAI,IAAI,CAAC;CACjB;AA0CD,wBAAgB,2BAA2B,IAAI,qBAAqB,CA0GnE"}
@@ -91,9 +91,9 @@
91
91
  * callers are `registerParticleSystem` / `unregisterParticleSystem`.
92
92
  * - The render target and override material belong to the
93
93
  * {@link SoftParticleDepthPass} instance and die with its `dispose()`. The
94
- * pass itself is owned by whichever adapter mount created it (the R3F adapter
95
- * and `setup-three-root-adapter`), and that mount's teardown is the one path
96
- * allowed to end it.
94
+ * pass is owned by the renderer loop that calls it: an adapter mount for a
95
+ * runtime renderer, or the editor Scene viewport for its renderer. That
96
+ * owner's teardown is the one path allowed to end it.
97
97
  */
98
98
  import * as THREE from 'three';
99
99
  /**
@@ -173,16 +173,11 @@ function drawsIntoDepth(object) {
173
173
  * The three renderer members this prepass CANNOT do without — the render-target
174
174
  * swap it draws through, and the buffer size it sizes that target from.
175
175
  *
176
- * A real `WebGLRenderer` has all of them. A DESIGN-TIME settle does not: a
177
- * stand-in that only has to answer `render` mounts a world so the editor can
178
- * read it, and reaching for `getDrawingBufferSize` on one threw
179
- * `renderer.getDrawingBufferSize is not a function` out of the first driven
180
- * frame so a world whose particles merely *declare* a proximity fade could
181
- * not be settled at all. A prepass is an EFFECT: with no renderer to run it on,
182
- * the right answer is the inert far-depth default every batch is already bound
183
- * to (see {@link farDepthTexture}), which is pixel-identical to a batch that
184
- * never asked for soft particles. So this degrades, loudly and once, instead of
185
- * taking the frame down with it.
176
+ * A real `WebGLRenderer` has all of them. A design-time stand-in that only has
177
+ * to answer `render` may mount a world so another host can read it, but cannot
178
+ * run this effect. The editor does not pass that stand-in here: its real
179
+ * viewport renderer owns its own pass. Other incomplete hosts still degrade
180
+ * loudly and once instead of taking the frame down.
186
181
  */
187
182
  const REQUIRED_RENDERER_MEMBERS = [
188
183
  'getDrawingBufferSize',
@@ -56,22 +56,6 @@ export interface RootMountSpecBase {
56
56
  readonly zOrder?: number | undefined;
57
57
  /** Whether play-mode pause/step applies to this world (D10). Defaults to `true`. */
58
58
  readonly pausable?: boolean | undefined;
59
- /**
60
- * `vgai.project.json`'s `dev: true` — this root is a DEV LAYER (the game's
61
- * own dev GUI), not shipped game content. Two things happen here: the
62
- * surface is stacked ABOVE every non-dev root (a dev layer sits topmost),
63
- * and it is marked `data-vgai-dev-layer="true"` so the play compositor can
64
- * leave it out of a capture (`composite-screenshot.ts`). Whether a dev root
65
- * reaches this function at all is the CALLER's gate —
66
- * `mountManifestRoots` asks `devLayersEnabled()` before building the spec.
67
- *
68
- * It steals no input from the game while closed for a reason that predates
69
- * this flag and needs no new mechanism: a dev layer is a `dom` root, DOM
70
- * layers are `pointer-events:none` (see `mountOneReactRoot`) with the
71
- * mounted tree opting individual elements back in, and the input router
72
- * never sees DOM roots at all.
73
- */
74
- readonly dev?: boolean | undefined;
75
59
  /**
76
60
  * Optional claim predicate for the delegating input router (D5 §2a), over
77
61
  * a point RELATIVE TO THE CONTAINER. Absent means: this world claims only
@@ -227,6 +211,8 @@ export interface RootsRuntimeConfig {
227
211
  */
228
212
  export interface GameSession {
229
213
  stop(): void;
214
+ /** Resolves after every root has finished the cleanup initiated by stop(). */
215
+ readonly stopComplete: Promise<void>;
230
216
  pause(): void;
231
217
  resume(): void;
232
218
  step(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"create-runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/create-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,cAAc,EAAoB,MAAM,yBAAyB,CAAC;AACnG,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAEhB,gBAAgB,EAChB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAGL,KAAK,IAAI,EACT,KAAK,YAAY,EAEjB,KAAK,YAAY,EAClB,MAAM,QAAQ,CAAC;AAGhB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA0B/C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,gBAAgB,EACzB,IAAI,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GACjE,YAAY,CAYd;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,EAC9B,OAAO,EAAE,eAAe,EACxB,IAAI,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GACjE,YAAY,CAYd;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,EAC3B,OAAO,EAAE,gBA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ACb,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,IAAI,IAAI,CAAC;IACb;gDAC4C;IAC5C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjE;iEAC6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAExF"}
@@ -443,22 +443,12 @@ async function createRootsGameRuntime(config) {
443
443
  // DOM-root layer shares this SAME stacking pass even though it is a `<div>`, not a
444
444
  // canvas, and carries no `hitTest` (the router never sees react entries at
445
445
  // all — see the dispatch loop below). ---
446
- // Dev layers sit TOPMOST, above every non-dev root, whatever zOrder either
447
- // declares: a dev GUI the game can paint over is not a dev GUI. Expressed as
448
- // two independent `stackOrder` passes concatenated rather than a magic
449
- // zOrder value, so `stackOrder`'s one rule (ascending zOrder, ties -> array
450
- // order) still governs WITHIN each band and nothing has to reason about what
451
- // number is "high enough".
452
446
  const claimEntries = mountSpecs.map((spec) => ({
453
447
  id: spec.id,
454
448
  zOrder: spec.zOrder ?? 0,
455
449
  hitTest: spec.hitTest,
456
- dev: spec.dev === true,
457
450
  }));
458
- const stacked = [
459
- ...stackOrder(claimEntries.filter((e) => !e.dev)),
460
- ...stackOrder(claimEntries.filter((e) => e.dev)),
461
- ];
451
+ const stacked = stackOrder(claimEntries);
462
452
  const bottomId = stacked[0]?.id;
463
453
  const kindById = new Map(mountSpecs.map((spec) => [spec.id, spec.kind]));
464
454
  const surfacesById = new Map();
@@ -473,12 +463,6 @@ async function createRootsGameRuntime(config) {
473
463
  // surface.ts`, which is the one door the capture/staleness/screenshot
474
464
  // sites now ask (ARCHITECTURE-CORE §The editor protocol, zero inference).
475
465
  surface.dataset['vgaiRootId'] = entry.id;
476
- // The capture's marker (`composite-screenshot.ts` reads exactly this
477
- // attribute): a dev layer is excluded from a play capture unless the
478
- // capture asks for it, because a contaminated "does the game look right"
479
- // frame is worthless.
480
- if (entry.dev)
481
- surface.dataset['vgaiDevLayer'] = 'true';
482
466
  if (!isReact) {
483
467
  const canvas = surface;
484
468
  canvas.width = w;
@@ -577,33 +561,47 @@ async function createRootsGameRuntime(config) {
577
561
  const retractRenderHarness = renderMode && renderModeLocation !== undefined
578
562
  ? installSessionRenderHarness(game, renderModeLocation, config.renderControl?.target)
579
563
  : undefined;
564
+ let resolveStopComplete;
565
+ const stopComplete = new Promise((resolve) => {
566
+ resolveStopComplete = resolve;
567
+ });
568
+ let stopping = false;
580
569
  function fullCleanup() {
581
- loop.stop();
582
- router.dispose();
583
- for (const entry of mountedEntries) {
584
- entry.mounted.dispose();
585
- entry.renderer?.dispose();
586
- entry.renderer?.forceContextLoss();
587
- // Remove from the element's CURRENT parent, not the mount-time
588
- // `container`: the editor's Game panel re-parents the live surfaces
589
- // when its mount element swaps (fill <-> device preset, W2c), and
590
- // `container.removeChild` would throw NotFoundError after such a move.
591
- // `container` remains the fallback for hosts whose element stand-ins
592
- // never wire `parentNode` (headless unit fixtures); an element already
593
- // detached by such a host is a no-op via the catch.
594
- try {
595
- (entry.element.parentNode ?? container).removeChild(entry.element);
596
- }
597
- catch {
598
- /* already detached — nothing to remove */
570
+ if (stopping)
571
+ return;
572
+ stopping = true;
573
+ try {
574
+ loop.stop();
575
+ router.dispose();
576
+ for (const entry of mountedEntries) {
577
+ entry.mounted.dispose();
578
+ entry.renderer?.dispose();
579
+ entry.renderer?.forceContextLoss();
580
+ // Remove from the element's CURRENT parent, not the mount-time
581
+ // `container`: the editor's Game panel re-parents the live surfaces
582
+ // when its mount element swaps (fill <-> device preset, W2c), and
583
+ // `container.removeChild` would throw NotFoundError after such a move.
584
+ // `container` remains the fallback for hosts whose element stand-ins
585
+ // never wire `parentNode` (headless unit fixtures); an element already
586
+ // detached by such a host is a no-op via the catch.
587
+ try {
588
+ (entry.element.parentNode ?? container).removeChild(entry.element);
589
+ }
590
+ catch {
591
+ /* already detached — nothing to remove */
592
+ }
599
593
  }
594
+ game.dispose();
595
+ retractDevGlobals();
596
+ retractRenderHarness?.();
597
+ }
598
+ finally {
599
+ void Promise.allSettled(mountedEntries.map((entry) => entry.mounted.disposeComplete ?? Promise.resolve())).then(() => resolveStopComplete());
600
600
  }
601
- game.dispose();
602
- retractDevGlobals();
603
- retractRenderHarness?.();
604
601
  }
605
602
  return {
606
603
  stop: fullCleanup,
604
+ stopComplete,
607
605
  // `Game.play` owns per-world pause, loop-gate, and audio-gate semantics.
608
606
  pause() {
609
607
  game.play.pause();
@@ -0,0 +1,37 @@
1
+ /**
2
+ * THE one owner of "is this a development context". Every reader that has to
3
+ * answer that question calls {@link devBuildEnabled}; there is deliberately NO
4
+ * second source of truth — not a module-level cached boolean, not a
5
+ * `globalThis` flag, not a per-host copy of the `import.meta.env` read below.
6
+ * Instrumentation that ships to players because two places disagreed about
7
+ * what "dev" means is exactly the failure this single owner exists to make
8
+ * impossible.
9
+ *
10
+ * Ownership, stated in one place (the build rule):
11
+ * - OWNER: this function. It resolves the answer; nothing else derives it.
12
+ * - SHARERS: the two three-root adapters (`adapter/setup-three-root-adapter.ts`
13
+ * and `world3d-react/r3f-adapter.tsx`), which seed live render vitals only
14
+ * under it, and the `static-batch` capability's mutation watch and `Frozen`
15
+ * warning. Any future dev-only instrument calls this too, with its own
16
+ * `override`.
17
+ * - TEARDOWN: none. This is a pure predicate over build config and one
18
+ * caller-supplied argument — it owns no resource, allocates nothing, and
19
+ * has no lifecycle to end.
20
+ *
21
+ * The three inputs, highest precedence first:
22
+ * 1. `override` — the explicit per-call answer. A headless test, a capture
23
+ * harness, or a host that knows better passes `true`/`false` and gets
24
+ * exactly that. Passing `undefined` (or omitting it) means "decide for
25
+ * me" and falls through. The editor's own preview mount is the worked
26
+ * case: it is a dev session by definition even when the editor SPA it
27
+ * runs inside is a production build.
28
+ * 2. A dev build — `import.meta.env.DEV`. The ordinary local/editor case.
29
+ * 3. A production build's EXPLICIT opt-in — `VITE_VGAI_DEV_BUILD=true`.
30
+ * Instrumenting a production bundle is a real, legitimate choice (an
31
+ * internal playtest build, a QA build), and it must be an opt-in someone
32
+ * had to type, never something a default drifts into.
33
+ *
34
+ * Anything else — a production build with no opt-in — is `false`.
35
+ */
36
+ export declare function devBuildEnabled(override?: boolean | undefined): boolean;
37
+ //# sourceMappingURL=dev-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-build.d.ts","sourceRoot":"","sources":["../../src/runtime/dev-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAavE"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * THE one owner of "is this a development context". Every reader that has to
3
+ * answer that question calls {@link devBuildEnabled}; there is deliberately NO
4
+ * second source of truth — not a module-level cached boolean, not a
5
+ * `globalThis` flag, not a per-host copy of the `import.meta.env` read below.
6
+ * Instrumentation that ships to players because two places disagreed about
7
+ * what "dev" means is exactly the failure this single owner exists to make
8
+ * impossible.
9
+ *
10
+ * Ownership, stated in one place (the build rule):
11
+ * - OWNER: this function. It resolves the answer; nothing else derives it.
12
+ * - SHARERS: the two three-root adapters (`adapter/setup-three-root-adapter.ts`
13
+ * and `world3d-react/r3f-adapter.tsx`), which seed live render vitals only
14
+ * under it, and the `static-batch` capability's mutation watch and `Frozen`
15
+ * warning. Any future dev-only instrument calls this too, with its own
16
+ * `override`.
17
+ * - TEARDOWN: none. This is a pure predicate over build config and one
18
+ * caller-supplied argument — it owns no resource, allocates nothing, and
19
+ * has no lifecycle to end.
20
+ *
21
+ * The three inputs, highest precedence first:
22
+ * 1. `override` — the explicit per-call answer. A headless test, a capture
23
+ * harness, or a host that knows better passes `true`/`false` and gets
24
+ * exactly that. Passing `undefined` (or omitting it) means "decide for
25
+ * me" and falls through. The editor's own preview mount is the worked
26
+ * case: it is a dev session by definition even when the editor SPA it
27
+ * runs inside is a production build.
28
+ * 2. A dev build — `import.meta.env.DEV`. The ordinary local/editor case.
29
+ * 3. A production build's EXPLICIT opt-in — `VITE_VGAI_DEV_BUILD=true`.
30
+ * Instrumenting a production bundle is a real, legitimate choice (an
31
+ * internal playtest build, a QA build), and it must be an opt-in someone
32
+ * had to type, never something a default drifts into.
33
+ *
34
+ * Anything else — a production build with no opt-in — is `false`.
35
+ */
36
+ export function devBuildEnabled(override) {
37
+ if (override !== undefined)
38
+ return override;
39
+ // `import.meta` is cast whole, not just its `.env`: this module is reachable
40
+ // from programs whose tsconfig does not pull in `vite/client` (the session
41
+ // client's, for one, which reaches the three adapter transitively), and there
42
+ // `ImportMeta` has no declared `env` at all. The cast keeps the single owner
43
+ // of the dev answer importable from ANY program rather than forcing every
44
+ // downstream tsconfig to adopt Vite's ambient types.
45
+ const env = import.meta.env;
46
+ if (env?.DEV === true)
47
+ return true;
48
+ return env?.VITE_VGAI_DEV_BUILD === 'true';
49
+ }
@@ -504,8 +504,16 @@ export interface GameInternal extends Game {
504
504
  * the conventional `/inputmaps/default.inputmap.json` (or the adapter's
505
505
  * configured `inputMapPath`); runtime additions go through
506
506
  * `ctx.input.registerAction` instead.
507
+ *
508
+ * `{ optional: true }` is the CONVENTIONAL-PATH probe a root uses when the
509
+ * project never named a map: an absent file resolves quietly (a brand-new
510
+ * scaffold declares no actions yet), pins nothing — so a sibling root may
511
+ * still declare its own map — and yields to a map another root already
512
+ * owns. A map that exists but fails to parse is as loud either way.
507
513
  */
508
- loadInputMap(path: string): Promise<void>;
514
+ loadInputMap(path: string, options?: {
515
+ optional?: boolean;
516
+ }): Promise<void>;
509
517
  /** Release game-owned resources after every mounted root has disposed. */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;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,0EAA0E;IAC1E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C;;;;;;;;;kDAS8C;IAC9C,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,GAAG,YAAY,CA6wBf"}
@@ -318,6 +318,10 @@ export function createGame(opts) {
318
318
  input.setDebugEmit((event, detail) => debugRegistry.forRoot('(game)').emit(event, detail));
319
319
  let inputMapPath = null;
320
320
  let inputMapLoad = null;
321
+ /** In-flight/settled conventional-path probes (`loadInputMap(path, {optional})`),
322
+ * so two roots probing the same path share one fetch. Separate from
323
+ * `inputMapLoad` because a probe that found nothing declares nothing. */
324
+ const inputMapProbes = new Map();
321
325
  function requireDefaultRoot() {
322
326
  if (roots.length === 0) {
323
327
  throw new Error('Game.defaultRoot: no roots registered yet');
@@ -913,7 +917,27 @@ export function createGame(opts) {
913
917
  runFrameImpl(fixedDt, { skipRenderPhases });
914
918
  }
915
919
  },
916
- loadInputMap(path) {
920
+ loadInputMap(path, options) {
921
+ if (options?.optional === true) {
922
+ // The conventional-path probe. It never becomes the game's declared
923
+ // map unless a file was actually there, so a root that DOES name a
924
+ // map (a sibling canvas root, a later mount) is never pre-empted by a
925
+ // probe that found nothing — the competing-path throw below would
926
+ // otherwise fire on a project that declared exactly one map.
927
+ if (inputMapPath)
928
+ return inputMapLoad ?? Promise.resolve();
929
+ let probe = inputMapProbes.get(path);
930
+ if (!probe) {
931
+ probe = input.loadMapIfPresent(path).then((loaded) => {
932
+ if (loaded && !inputMapPath) {
933
+ inputMapPath = path;
934
+ inputMapLoad = Promise.resolve();
935
+ }
936
+ });
937
+ inputMapProbes.set(path, probe);
938
+ }
939
+ return probe;
940
+ }
917
941
  if (inputMapPath && inputMapPath !== path) {
918
942
  throw new Error(`Game.loadInputMap: input map is already "${inputMapPath}"; root requested "${path}". ` +
919
943
  'Input is game-owned, so roots cannot load competing maps.');
@@ -106,15 +106,6 @@ export interface MountManifestOptions {
106
106
  readonly seed?: number | undefined;
107
107
  /** Host identity for a private play run or coordinated Team Test. */
108
108
  readonly playtest?: PlaytestContext | null | undefined;
109
- /**
110
- * The explicit per-mount answer to "are dev layers enabled" — forwarded
111
- * verbatim to `devLayersEnabled` (`runtime/dev-layers.ts`), the ONE owner of
112
- * that question. Omit it and the build decides (dev build ⇒ on; production
113
- * build ⇒ off unless `VITE_VGAI_DEV_LAYERS=true`). A root declaring
114
- * `dev: true` is simply not mounted when the answer is `false`, so a shipped
115
- * build carries no dev GUI at all.
116
- */
117
- readonly devLayers?: boolean | undefined;
118
109
  /** Where to read `?vgai-seed=` from for the boot-time seed reader. Same
119
110
  * override precedent as `debugBridge.url` (defaults to `window.location`
120
111
  * when a real `window` exists; a headless caller with no override gets no
@@ -165,10 +156,6 @@ export declare function resolveManifest(raw: unknown): ResolvedGameManifest;
165
156
  * ingest }` adapter with no caller-supplied adapter, or an empty manifest all
166
157
  * throw a named `Error` identifying the world id, its kind, and what was
167
158
  * expected — never a silent skip or a partially-mounted session.
168
- *
169
- * The ONE root that IS skipped silently is a `dev: true` dev layer when dev
170
- * layers are disabled (`devLayersEnabled`) — that skip is the feature: it is
171
- * what makes a dev GUI safe to leave in the game.
172
159
  */
173
160
  export declare function mountManifestRoots(opts: MountManifestOptions): Promise<GameSession>;
174
161
  //# sourceMappingURL=mount-manifest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mount-manifest.d.ts","sourceRoot":"","sources":["../../src/runtime/mount-manifest.ts"],"names":[],"mappings":"A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