@viji-dev/core 0.5.5 → 0.5.7

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/index.d.ts CHANGED
@@ -218,6 +218,14 @@ export declare class AudioSystem {
218
218
  private lastPhaseLogTime;
219
219
  private onsetLogBuffer;
220
220
  private debugMode;
221
+ /**
222
+ * One-way lifecycle flag flipped at the top of `resetAudioState()`.
223
+ * Gates re-entry into `ensureAudioContext()` and the public stream-mutation
224
+ * entry points so an in-flight async caller (e.g. a worker RPC firing
225
+ * mid-teardown) cannot resurrect a fresh `AudioContext` after destroy
226
+ * has already nulled the field. AudioSystem is single-use after reset.
227
+ */
228
+ private destroyed;
221
229
  private diagnosticLogger;
222
230
  private onsetDetection;
223
231
  private essentiaOnsetDetection;
@@ -419,8 +427,13 @@ export declare class AudioSystem {
419
427
  /**
420
428
  * Reset all audio state (called when destroying).
421
429
  * Disconnects all channels, closes AudioContext, resets all modules.
430
+ *
431
+ * Returns a Promise that resolves once `AudioContext.close()` has fully
432
+ * transitioned the context to `closed`. Callers tearing the system down
433
+ * (e.g. `VijiCore.destroy()`) MUST await this; otherwise Blink keeps the
434
+ * context alive in `Pending activities` and leaks ~4 MB per cycle.
422
435
  */
423
- resetAudioState(): void;
436
+ resetAudioState(): Promise<void>;
424
437
  /**
425
438
  * Add an additional audio stream (lightweight analysis, no beat detection).
426
439
  * @param streamIndex Global stream index (from VijiCore: AUDIO_ADDITIONAL_BASE + n or AUDIO_DEVICE_BASE + n)
@@ -2254,7 +2267,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
2254
2267
  /** Returned by `on*` listener registration calls; invoke to unsubscribe. */
2255
2268
  export declare type Unsubscribe = () => void;
2256
2269
 
2257
- export declare const VERSION = "0.5.5";
2270
+ export declare const VERSION = "0.5.7";
2258
2271
 
2259
2272
  /**
2260
2273
  * Real-time video API: drawable frame, dimensions, and the source-side
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A, V, a, b } from "./index-DsJxKERc.js";
1
+ import { A, V, a, b } from "./index-CwwVLcjs.js";
2
2
  export {
3
3
  A as AudioSystem,
4
4
  V as VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viji-dev/core",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Universal execution engine for Viji Creative scenes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",