@viji-dev/core 0.8.11 → 0.8.12

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/dist/docs-api.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const docsApi = {
2
2
  "version": "1.1.0",
3
3
  "coreVersion": "0.8.11",
4
- "generatedAt": "2026-06-04T09:28:42.834Z",
4
+ "generatedAt": "2026-06-06T12:20:36.994Z",
5
5
  "navigation": [
6
6
  {
7
7
  "id": "getting-started",
@@ -1,4 +1,4 @@
1
- import { g as kn } from "./index-BH2kB2OG.js";
1
+ import { g as kn } from "./index-DYUAz0BO.js";
2
2
  function jn(Oe, ot) {
3
3
  for (var ve = 0; ve < ot.length; ve++) {
4
4
  const Z = ot[ve];
@@ -3374,4 +3374,4 @@ const xn = /* @__PURE__ */ kn(yi), Ln = /* @__PURE__ */ jn({
3374
3374
  export {
3375
3375
  Ln as e
3376
3376
  };
3377
- //# sourceMappingURL=essentia-wasm.web-BGfjWBMO.js.map
3377
+ //# sourceMappingURL=essentia-wasm.web-BAkt7bza.js.map
@@ -537,7 +537,7 @@ class DB {
537
537
  }
538
538
  }
539
539
  }
540
- const hB = "" + new URL("assets/viji.worker-CtPXL0fz.js", import.meta.url).href, RB = new URL("assets/wasm/vision_wasm_internal.js", import.meta.url).href, wB = new URL("assets/wasm/vision_wasm_internal.wasm", import.meta.url).href, sB = new URL("assets/wasm/vision_wasm_nosimd_internal.js", import.meta.url).href, FB = new URL("assets/wasm/vision_wasm_nosimd_internal.wasm", import.meta.url).href;
540
+ const hB = "" + new URL("assets/viji.worker-dW7fkaOy.js", import.meta.url).href, RB = new URL("assets/wasm/vision_wasm_internal.js", import.meta.url).href, wB = new URL("assets/wasm/vision_wasm_internal.wasm", import.meta.url).href, sB = new URL("assets/wasm/vision_wasm_nosimd_internal.js", import.meta.url).href, FB = new URL("assets/wasm/vision_wasm_nosimd_internal.wasm", import.meta.url).href;
541
541
  class kB {
542
542
  constructor(A, B, I) {
543
543
  this.iframeManager = A, this.sceneCode = B, this.init = I;
@@ -1524,7 +1524,7 @@ class lB {
1524
1524
  if (!this.isInitialized)
1525
1525
  return this.initPromise ? this.initPromise : (this.initPromise = (async () => {
1526
1526
  try {
1527
- const A = await import("./essentia.js-core.es-CC_3Ap1i.js"), B = await import("./essentia-wasm.web-BGfjWBMO.js").then((g) => g.e), I = A.Essentia || A.default?.Essentia || A.default;
1527
+ const A = await import("./essentia.js-core.es-CC_3Ap1i.js"), B = await import("./essentia-wasm.web-BAkt7bza.js").then((g) => g.e), I = A.Essentia || A.default?.Essentia || A.default;
1528
1528
  let Q = B.default || B.EssentiaWASM || B.default?.EssentiaWASM;
1529
1529
  if (!Q)
1530
1530
  throw new Error("WASM module not found - check essentia-wasm.web.js export");
@@ -7018,6 +7018,8 @@ class K {
7018
7018
  sceneRenderer = "native";
7019
7019
  sceneCapabilities;
7020
7020
  sceneP5CanvasMode;
7021
+ // The runtime-locked canvas context, reported by the worker once it locks.
7022
+ sceneContextType;
7021
7023
  parametersInitialized = !1;
7022
7024
  // Event listeners for parameter system
7023
7025
  parameterListeners = /* @__PURE__ */ new Map();
@@ -7301,7 +7303,7 @@ class K {
7301
7303
  }), this.workerManager.onMessage("performance-warning", (A) => {
7302
7304
  console.warn("Performance warning:", A);
7303
7305
  }), this.workerManager.onMessage("performance-update", (A) => {
7304
- A.effectiveRefreshRate !== void 0 && (this.stats.frameRate.effectiveRefreshRate = A.effectiveRefreshRate, this.stats.frameRate.mode = A.frameRateMode, this.stats.frameRate.screenRefreshRate = A.screenRefreshRate), A.cv !== void 0 && (this.stats.cv = A.cv), A.frames !== void 0 && (this.stats.frames = A.frames, this.stats.timing = A.timing, this.stats.capabilities = A.capabilities, this.firePerformanceSnapshot());
7306
+ A.effectiveRefreshRate !== void 0 && (this.stats.frameRate.effectiveRefreshRate = A.effectiveRefreshRate, this.stats.frameRate.mode = A.frameRateMode, this.stats.frameRate.screenRefreshRate = A.screenRefreshRate), A.cv !== void 0 && (this.stats.cv = A.cv), A.contextType !== void 0 && (this.sceneContextType = A.contextType), A.frames !== void 0 && (this.stats.frames = A.frames, this.stats.timing = A.timing, this.stats.capabilities = A.capabilities, this.firePerformanceSnapshot());
7305
7307
  }), this.workerManager.onMessage("capability-transition", (A) => {
7306
7308
  this.fireCapabilityTransition(A);
7307
7309
  }), this.workerManager.onMessage("parameters-defined", (A) => {
@@ -7541,6 +7543,7 @@ class K {
7541
7543
  return {
7542
7544
  renderer: this.sceneRenderer,
7543
7545
  ...this.sceneP5CanvasMode !== void 0 && { p5CanvasMode: this.sceneP5CanvasMode },
7546
+ ...this.sceneContextType !== void 0 && { contextType: this.sceneContextType },
7544
7547
  capabilities: this.sceneCapabilities,
7545
7548
  parameterCount: this.parameterValues.size,
7546
7549
  parameterCounts: A,
@@ -8597,6 +8600,12 @@ class K {
8597
8600
  * `getImageData()` (raster flush) for 2D-canvas scenes, so `gpuMs` is
8598
8601
  * populated for both (`null` only with no drawable context).
8599
8602
  *
8603
+ * WebKit (Safari/iOS) caveat: the 2D `getImageData` fence forces a full-canvas
8604
+ * readback that is pathologically slow there, so 2D `gpuMs` is unreliable on
8605
+ * WebKit and self-disables to `null` if it blows a per-frame budget (so the
8606
+ * run can't hang). Prefer steady-state `frameIntervalMs` for 2D raster cost on
8607
+ * WebKit. The WebGL fence is unaffected.
8608
+ *
8600
8609
  * Use only on a scene NOT serving as a live compositor source/mixer —
8601
8610
  * the per-frame fence would stutter the mixer output (enforced below).
8602
8611
  * In-session `frameIntervalMs` includes the fence stall (session-relative);
@@ -8780,4 +8789,4 @@ export {
8780
8789
  S as b,
8781
8790
  PB as g
8782
8791
  };
8783
- //# sourceMappingURL=index-BH2kB2OG.js.map
8792
+ //# sourceMappingURL=index-DYUAz0BO.js.map
package/dist/index.d.ts CHANGED
@@ -754,6 +754,12 @@ declare interface ButtonParameter {
754
754
  category: ParameterCategory;
755
755
  }
756
756
 
757
+ /**
758
+ * The canvas rendering context a scene actually locked. Detected at runtime
759
+ * (authoritative) once the context is acquired. See {@link SceneData.contextType}.
760
+ */
761
+ export declare type CanvasContextType = '2d' | 'webgl' | 'webgl2';
762
+
757
763
  /**
758
764
  * An immediate edge in a capability's consumed-meaningfully state, delivered
759
765
  * via `onCapabilityTransition`. Fires the instant the bit flips, independent
@@ -1260,8 +1266,10 @@ export declare interface FramePerfSample {
1260
1266
  * Fence-accurate downstream frame time in ms, or `null` when unavailable.
1261
1267
  * Always `null` in steady state. Populated only by `runFencedBenchmark()`:
1262
1268
  * WebGL scenes via `gl.finish()` (GPU drain), 2D-canvas scenes via
1263
- * `getImageData()` (raster flush). `null` only when there is no drawable
1264
- * context or readback fails.
1269
+ * `getImageData()` (raster flush). `null` when there is no drawable context or
1270
+ * readback fails. Note: 2D `gpuMs` is unreliable on WebKit (the `getImageData`
1271
+ * readback is pathologically slow there and self-disables to `null`) — use
1272
+ * `frameIntervalMs` for 2D raster cost on WebKit.
1265
1273
  */
1266
1274
  gpuMs: number | null;
1267
1275
  /** Interval since the previous rendered frame (ms). Session-relative under benchmark. */
@@ -1989,6 +1997,13 @@ export declare interface SceneData {
1989
1997
  renderer: RendererType;
1990
1998
  /** P5 canvas mode; present only when `renderer` is `'p5'`. */
1991
1999
  p5CanvasMode?: P5CanvasMode;
2000
+ /**
2001
+ * The canvas context the scene actually locked (`'2d'` / `'webgl'` /
2002
+ * `'webgl2'`), detected at runtime. Present once the context locks (first
2003
+ * render); `undefined` before that. Authoritative — Core locks the context,
2004
+ * so this is exact even for native scenes with dynamic `useContext`.
2005
+ */
2006
+ contextType?: CanvasContextType;
1992
2007
  /** Capabilities the scene's code declares it uses (inclusive-biased). */
1993
2008
  capabilities: SceneCapabilities;
1994
2009
  /** Total number of parameters the scene defines. */
@@ -3060,6 +3075,7 @@ export declare class VijiCore {
3060
3075
  private sceneRenderer;
3061
3076
  private sceneCapabilities;
3062
3077
  private sceneP5CanvasMode?;
3078
+ private sceneContextType?;
3063
3079
  private parametersInitialized;
3064
3080
  private parameterListeners;
3065
3081
  private parameterDefinedListeners;
@@ -3878,6 +3894,12 @@ export declare class VijiCore {
3878
3894
  * `getImageData()` (raster flush) for 2D-canvas scenes, so `gpuMs` is
3879
3895
  * populated for both (`null` only with no drawable context).
3880
3896
  *
3897
+ * WebKit (Safari/iOS) caveat: the 2D `getImageData` fence forces a full-canvas
3898
+ * readback that is pathologically slow there, so 2D `gpuMs` is unreliable on
3899
+ * WebKit and self-disables to `null` if it blows a per-frame budget (so the
3900
+ * run can't hang). Prefer steady-state `frameIntervalMs` for 2D raster cost on
3901
+ * WebKit. The WebGL fence is unaffected.
3902
+ *
3881
3903
  * Use only on a scene NOT serving as a live compositor source/mixer —
3882
3904
  * the per-frame fence would stutter the mixer output (enforced below).
3883
3905
  * In-session `frameIntervalMs` includes the fence stall (session-relative);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as a, V as i, a as s, b as e } from "./index-BH2kB2OG.js";
1
+ import { A as a, V as i, a as s, b as e } from "./index-DYUAz0BO.js";
2
2
  export {
3
3
  a as AudioSystem,
4
4
  i as VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viji-dev/core",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "description": "Universal execution engine for Viji Creative scenes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",