@vgai/engine 0.5.28 → 0.5.30

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.
@@ -57,5 +57,12 @@ export declare function mountIngestGame2D(pixiNamespace: unknown, game: IngestGa
57
57
  captureTimeoutMs?: number;
58
58
  onWait?: (wait: VisibleCaptureWindow | null) => void;
59
59
  acceptCapture?: (runtime: CapturedRuntime2D) => boolean;
60
- }): Promise<IngestMount2D>;
60
+ /**
61
+ * Called after the entry has run, before spending the Pixi capture budget.
62
+ * A canvas host with other structural adapters can answer true once one of
63
+ * those runtimes is ready; `null` then means "dispatch that runtime" rather
64
+ * than "Pixi failed".
65
+ */
66
+ preferStructuralRuntime?: () => boolean | Promise<boolean>;
67
+ }): Promise<IngestMount2D | null>;
61
68
  //# sourceMappingURL=ingest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../../src/pixi/ingest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,oBAAoB,EAC1B,MAAM,iBAAiB,CAAC;AAEzB,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,8BAA8B,0BAA0B,CAAC;AAEtE,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAI3C;AAED,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,KAA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AC9B,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,YAAY,EAClB,IAAI,GAAE;IACJ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC;IACxD;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD,GACL,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAiC/B"}
@@ -44,6 +44,10 @@ export async function mountIngestGame2D(pixiNamespace, game, opts = {}) {
44
44
  });
45
45
  try {
46
46
  await game.load();
47
+ if (await opts.preferStructuralRuntime?.()) {
48
+ capture.uninstall();
49
+ return null;
50
+ }
47
51
  }
48
52
  catch (err) {
49
53
  capture.uninstall();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@vgai/engine",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.5.28",
5
+ "version": "0.5.30",
6
6
  "description": "Readable TypeScript game engine and universal host for Three.js, PixiJS, and React games.",
7
7
  "keywords": [
8
8
  "game-engine",
@@ -72,13 +72,24 @@ export async function mountIngestGame2D(
72
72
  captureTimeoutMs?: number;
73
73
  onWait?: (wait: VisibleCaptureWindow | null) => void;
74
74
  acceptCapture?: (runtime: CapturedRuntime2D) => boolean;
75
+ /**
76
+ * Called after the entry has run, before spending the Pixi capture budget.
77
+ * A canvas host with other structural adapters can answer true once one of
78
+ * those runtimes is ready; `null` then means "dispatch that runtime" rather
79
+ * than "Pixi failed".
80
+ */
81
+ preferStructuralRuntime?: () => boolean | Promise<boolean>;
75
82
  } = {},
76
- ): Promise<IngestMount2D> {
83
+ ): Promise<IngestMount2D | null> {
77
84
  const capture = installSceneCapture2D(pixiNamespace, {
78
85
  ...(opts.acceptCapture ? { accept: opts.acceptCapture } : {}),
79
86
  });
80
87
  try {
81
88
  await game.load();
89
+ if (await opts.preferStructuralRuntime?.()) {
90
+ capture.uninstall();
91
+ return null;
92
+ }
82
93
  } catch (err) {
83
94
  capture.uninstall();
84
95
  throw new IngestGame2DLoadError(game.id, err);