@viji-dev/core 0.8.14 → 0.8.16
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/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/assets/{viji.worker-DS4koMQX.js → viji.worker-BEba5y4h.js} +395 -404
- package/dist/docs-api.js +2 -2
- package/dist/{essentia-wasm.web-CN4UhEyR.js → essentia-wasm.web-Bt54HQaY.js} +2 -2
- package/dist/{index-BvlTOvkN.js → index-f5EKzN3f.js} +27 -8
- package/dist/index.d.ts +53 -62
- package/dist/index.js +6 -4
- package/package.json +1 -1
package/dist/docs-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as kn } from "./index-
|
|
1
|
+
import { g as kn } from "./index-f5EKzN3f.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-
|
|
3377
|
+
//# sourceMappingURL=essentia-wasm.web-Bt54HQaY.js.map
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
const hI = [
|
|
2
|
+
"audio",
|
|
3
|
+
"video",
|
|
4
|
+
"mouse",
|
|
5
|
+
"keyboard",
|
|
6
|
+
"pointer",
|
|
7
|
+
"touch",
|
|
8
|
+
"sensors",
|
|
9
|
+
"devices"
|
|
10
|
+
], RI = [
|
|
11
|
+
"faceDetection",
|
|
12
|
+
"faceMesh",
|
|
13
|
+
"emotion",
|
|
14
|
+
"handTracking",
|
|
15
|
+
"poseDetection",
|
|
16
|
+
"segmentation"
|
|
17
|
+
];
|
|
1
18
|
class S extends Error {
|
|
2
19
|
constructor(A, B, I) {
|
|
3
20
|
super(A), this.code = B, this.context = I, this.name = "VijiCoreError";
|
|
@@ -537,7 +554,7 @@ class DB {
|
|
|
537
554
|
}
|
|
538
555
|
}
|
|
539
556
|
}
|
|
540
|
-
const hB = "" + new URL("assets/viji.worker-
|
|
557
|
+
const hB = "" + new URL("assets/viji.worker-BEba5y4h.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
558
|
class kB {
|
|
542
559
|
constructor(A, B, I) {
|
|
543
560
|
this.iframeManager = A, this.sceneCode = B, this.init = I;
|
|
@@ -1524,7 +1541,7 @@ class lB {
|
|
|
1524
1541
|
if (!this.isInitialized)
|
|
1525
1542
|
return this.initPromise ? this.initPromise : (this.initPromise = (async () => {
|
|
1526
1543
|
try {
|
|
1527
|
-
const A = await import("./essentia.js-core.es-CC_3Ap1i.js"), B = await import("./essentia-wasm.web-
|
|
1544
|
+
const A = await import("./essentia.js-core.es-CC_3Ap1i.js"), B = await import("./essentia-wasm.web-Bt54HQaY.js").then((g) => g.e), I = A.Essentia || A.default?.Essentia || A.default;
|
|
1528
1545
|
let Q = B.default || B.EssentiaWASM || B.default?.EssentiaWASM;
|
|
1529
1546
|
if (!Q)
|
|
1530
1547
|
throw new Error("WASM module not found - check essentia-wasm.web.js export");
|
|
@@ -8602,9 +8619,9 @@ class K {
|
|
|
8602
8619
|
*
|
|
8603
8620
|
* WebKit (Safari/iOS) caveat: the 2D `getImageData` fence forces a full-canvas
|
|
8604
8621
|
* readback that is pathologically slow there, so 2D `gpuMs` is unreliable on
|
|
8605
|
-
* WebKit
|
|
8606
|
-
*
|
|
8607
|
-
*
|
|
8622
|
+
* WebKit — prefer steady-state `frameIntervalMs` for 2D raster cost on WebKit.
|
|
8623
|
+
* A pathological readback is bounded by this call's RPC timeout (it rejects),
|
|
8624
|
+
* not by per-frame logic. The WebGL fence is unaffected.
|
|
8608
8625
|
*
|
|
8609
8626
|
* Use only on a scene NOT serving as a live compositor source/mixer —
|
|
8610
8627
|
* the per-frame fence would stutter the mixer output (enforced below).
|
|
@@ -8781,12 +8798,14 @@ function DI(h) {
|
|
|
8781
8798
|
expectedVersion: 1
|
|
8782
8799
|
} : typeof A.senderTime != "number" ? { code: "invalid-field", details: "senderTime must be a number", field: "senderTime" } : null;
|
|
8783
8800
|
}
|
|
8784
|
-
const
|
|
8801
|
+
const wI = "0.8.15";
|
|
8785
8802
|
export {
|
|
8786
8803
|
yA as A,
|
|
8787
|
-
|
|
8804
|
+
RI as C,
|
|
8805
|
+
hI as I,
|
|
8806
|
+
wI as V,
|
|
8788
8807
|
K as a,
|
|
8789
8808
|
S as b,
|
|
8790
8809
|
PB as g
|
|
8791
8810
|
};
|
|
8792
|
-
//# sourceMappingURL=index-
|
|
8811
|
+
//# sourceMappingURL=index-f5EKzN3f.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -766,9 +766,9 @@ export declare type CanvasContextType = '2d' | 'webgl' | 'webgl2';
|
|
|
766
766
|
* of the ~1s performance snapshot.
|
|
767
767
|
*/
|
|
768
768
|
export declare interface CapabilityTransition {
|
|
769
|
-
capability:
|
|
769
|
+
capability: InputCapabilityKey | 'cv';
|
|
770
770
|
/** Present when `capability` is `'cv'`. */
|
|
771
|
-
cvType?:
|
|
771
|
+
cvType?: CVFeatureKey;
|
|
772
772
|
/** Present when `capability` is `'cv'` — which CV level transitioned. */
|
|
773
773
|
level?: 'active' | 'meaningful';
|
|
774
774
|
/** The new state. */
|
|
@@ -937,6 +937,13 @@ export declare interface CountPair {
|
|
|
937
937
|
falseCount: number;
|
|
938
938
|
}
|
|
939
939
|
|
|
940
|
+
/**
|
|
941
|
+
* Runtime-enumerable identifiers for the computer-vision features. These are the
|
|
942
|
+
* keys under the `cv` member of {@link SceneCapabilities}, {@link FrameCapabilities},
|
|
943
|
+
* and {@link PeriodCapabilityCounts}.
|
|
944
|
+
*/
|
|
945
|
+
export declare const CV_FEATURE_KEYS: readonly ["faceDetection", "faceMesh", "emotion", "handTracking", "poseDetection", "segmentation"];
|
|
946
|
+
|
|
940
947
|
/** Per-CV-feature live activity: `active` = model loaded + first inference completed (cost is being paid); `meaningful` = last result was non-empty. */
|
|
941
948
|
export declare interface CVActivity {
|
|
942
949
|
/** Feature is running/inferring (model loaded, first inference completed). */
|
|
@@ -951,6 +958,9 @@ export declare interface CVActivity {
|
|
|
951
958
|
*/
|
|
952
959
|
declare type CVFeature = 'faceDetection' | 'faceMesh' | 'handTracking' | 'poseDetection' | 'bodySegmentation' | 'emotionDetection';
|
|
953
960
|
|
|
961
|
+
/** A single CV feature identifier. @see {@link CV_FEATURE_KEYS} */
|
|
962
|
+
export declare type CVFeatureKey = typeof CV_FEATURE_KEYS[number];
|
|
963
|
+
|
|
954
964
|
/**
|
|
955
965
|
* Computer-vision processing rate relative to the input video stream rate.
|
|
956
966
|
* `'full'` runs CV on every delivered video frame, `'half'` every other frame,
|
|
@@ -1234,25 +1244,13 @@ export declare interface FaceData {
|
|
|
1234
1244
|
* capabilities (audio/video/sensors/devices) reflect `isConnected`;
|
|
1235
1245
|
* interaction-class (mouse/keyboard/pointer/touch) reflect active use of the
|
|
1236
1246
|
* specific inputs the scene reads; CV reports `{active, meaningful}` per type.
|
|
1247
|
+
*
|
|
1248
|
+
* A flag per {@link INPUT_CAPABILITY_KEYS} entry, plus per-{@link CV_FEATURE_KEYS}
|
|
1249
|
+
* activity — derived from those arrays so it cannot drift from them.
|
|
1237
1250
|
*/
|
|
1238
|
-
export declare
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
mouse: boolean;
|
|
1242
|
-
keyboard: boolean;
|
|
1243
|
-
pointer: boolean;
|
|
1244
|
-
touch: boolean;
|
|
1245
|
-
sensors: boolean;
|
|
1246
|
-
devices: boolean;
|
|
1247
|
-
cv: {
|
|
1248
|
-
faceDetection: CVActivity;
|
|
1249
|
-
faceMesh: CVActivity;
|
|
1250
|
-
emotion: CVActivity;
|
|
1251
|
-
handTracking: CVActivity;
|
|
1252
|
-
poseDetection: CVActivity;
|
|
1253
|
-
segmentation: CVActivity;
|
|
1254
|
-
};
|
|
1255
|
-
}
|
|
1251
|
+
export declare type FrameCapabilities = Record<InputCapabilityKey, boolean> & {
|
|
1252
|
+
cv: Record<CVFeatureKey, CVActivity>;
|
|
1253
|
+
};
|
|
1256
1254
|
|
|
1257
1255
|
/** One per-frame performance + capability record. */
|
|
1258
1256
|
export declare interface FramePerfSample {
|
|
@@ -1268,7 +1266,7 @@ export declare interface FramePerfSample {
|
|
|
1268
1266
|
* WebGL scenes via `gl.finish()` (GPU drain), 2D-canvas scenes via
|
|
1269
1267
|
* `getImageData()` (raster flush). `null` when there is no drawable context or
|
|
1270
1268
|
* readback fails. Note: 2D `gpuMs` is unreliable on WebKit (the `getImageData`
|
|
1271
|
-
* readback is pathologically slow there and
|
|
1269
|
+
* readback is pathologically slow there and inflates the value) — use
|
|
1272
1270
|
* `frameIntervalMs` for 2D raster cost on WebKit.
|
|
1273
1271
|
*/
|
|
1274
1272
|
gpuMs: number | null;
|
|
@@ -1417,6 +1415,21 @@ declare interface ImageParameter {
|
|
|
1417
1415
|
category: ParameterCategory;
|
|
1418
1416
|
}
|
|
1419
1417
|
|
|
1418
|
+
/**
|
|
1419
|
+
* Runtime-enumerable identifiers for the **input / interaction** capabilities
|
|
1420
|
+
* tracked live per rendered frame. This is the live capability vocabulary — the
|
|
1421
|
+
* keys of {@link FrameCapabilities} and {@link PeriodCapabilityCounts}, and the
|
|
1422
|
+
* single source of truth those types derive from.
|
|
1423
|
+
*
|
|
1424
|
+
* Note: `parameters` is intentionally absent. It is a *declared-only* tag on
|
|
1425
|
+
* {@link SceneCapabilities} (the scene defines tunable parameters), not a live
|
|
1426
|
+
* consumed signal, so it is not part of the per-frame capability set.
|
|
1427
|
+
*/
|
|
1428
|
+
export declare const INPUT_CAPABILITY_KEYS: readonly ["audio", "video", "mouse", "keyboard", "pointer", "touch", "sensors", "devices"];
|
|
1429
|
+
|
|
1430
|
+
/** A single input/interaction capability identifier. @see {@link INPUT_CAPABILITY_KEYS} */
|
|
1431
|
+
export declare type InputCapabilityKey = typeof INPUT_CAPABILITY_KEYS[number];
|
|
1432
|
+
|
|
1420
1433
|
export declare interface InstrumentSerialized {
|
|
1421
1434
|
mode: OnsetMode;
|
|
1422
1435
|
muted: boolean;
|
|
@@ -1720,43 +1733,17 @@ export declare interface PerformanceStats {
|
|
|
1720
1733
|
/**
|
|
1721
1734
|
* Per-capability frame counts over the report period. CV types report
|
|
1722
1735
|
* separate `active` and `meaningful` pairs.
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
faceDetection: {
|
|
1735
|
-
active: CountPair;
|
|
1736
|
-
meaningful: CountPair;
|
|
1737
|
-
};
|
|
1738
|
-
faceMesh: {
|
|
1739
|
-
active: CountPair;
|
|
1740
|
-
meaningful: CountPair;
|
|
1741
|
-
};
|
|
1742
|
-
emotion: {
|
|
1743
|
-
active: CountPair;
|
|
1744
|
-
meaningful: CountPair;
|
|
1745
|
-
};
|
|
1746
|
-
handTracking: {
|
|
1747
|
-
active: CountPair;
|
|
1748
|
-
meaningful: CountPair;
|
|
1749
|
-
};
|
|
1750
|
-
poseDetection: {
|
|
1751
|
-
active: CountPair;
|
|
1752
|
-
meaningful: CountPair;
|
|
1753
|
-
};
|
|
1754
|
-
segmentation: {
|
|
1755
|
-
active: CountPair;
|
|
1756
|
-
meaningful: CountPair;
|
|
1757
|
-
};
|
|
1758
|
-
};
|
|
1759
|
-
}
|
|
1736
|
+
*
|
|
1737
|
+
* A {@link CountPair} per {@link INPUT_CAPABILITY_KEYS} entry, plus active +
|
|
1738
|
+
* meaningful pairs per {@link CV_FEATURE_KEYS} — derived from those arrays so it
|
|
1739
|
+
* cannot drift from them.
|
|
1740
|
+
*/
|
|
1741
|
+
export declare type PeriodCapabilityCounts = Record<InputCapabilityKey, CountPair> & {
|
|
1742
|
+
cv: Record<CVFeatureKey, {
|
|
1743
|
+
active: CountPair;
|
|
1744
|
+
meaningful: CountPair;
|
|
1745
|
+
}>;
|
|
1746
|
+
};
|
|
1760
1747
|
|
|
1761
1748
|
/**
|
|
1762
1749
|
* Phase-Locked Loop for stable beat phase tracking
|
|
@@ -1898,6 +1885,10 @@ export declare type Resolution = {
|
|
|
1898
1885
|
* but a rarely-ambiguous case may show an extra one. Shader scenes are
|
|
1899
1886
|
* detected from built-in uniform usage (exact); native/p5 scenes from
|
|
1900
1887
|
* `viji.*` usage tokens.
|
|
1888
|
+
*
|
|
1889
|
+
* The input keys here are pinned to {@link INPUT_CAPABILITY_KEYS} and the `cv`
|
|
1890
|
+
* keys to {@link CV_FEATURE_KEYS} by a compile-time guard (below), so this shape
|
|
1891
|
+
* cannot drift from the runtime vocabulary.
|
|
1901
1892
|
*/
|
|
1902
1893
|
export declare interface SceneCapabilities {
|
|
1903
1894
|
/** Scene reads audio analysis (volume, bands, beat, FFT/waveform, or audio streams). */
|
|
@@ -2674,7 +2665,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
|
|
|
2674
2665
|
/** Returned by `on*` listener registration calls; invoke to unsubscribe. */
|
|
2675
2666
|
export declare type Unsubscribe = () => void;
|
|
2676
2667
|
|
|
2677
|
-
export declare const VERSION = "0.8.
|
|
2668
|
+
export declare const VERSION = "0.8.15";
|
|
2678
2669
|
|
|
2679
2670
|
/**
|
|
2680
2671
|
* Real-time video API: drawable frame, dimensions, and the source-side
|
|
@@ -3896,9 +3887,9 @@ export declare class VijiCore {
|
|
|
3896
3887
|
*
|
|
3897
3888
|
* WebKit (Safari/iOS) caveat: the 2D `getImageData` fence forces a full-canvas
|
|
3898
3889
|
* readback that is pathologically slow there, so 2D `gpuMs` is unreliable on
|
|
3899
|
-
* WebKit
|
|
3900
|
-
*
|
|
3901
|
-
*
|
|
3890
|
+
* WebKit — prefer steady-state `frameIntervalMs` for 2D raster cost on WebKit.
|
|
3891
|
+
* A pathological readback is bounded by this call's RPC timeout (it rejects),
|
|
3892
|
+
* not by per-frame logic. The WebGL fence is unaffected.
|
|
3902
3893
|
*
|
|
3903
3894
|
* Use only on a scene NOT serving as a live compositor source/mixer —
|
|
3904
3895
|
* the per-frame fence would stutter the mixer output (enforced below).
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as s, C as o, I as E, V as i, a as A, b as C } from "./index-f5EKzN3f.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
s as AudioSystem,
|
|
4
|
+
o as CV_FEATURE_KEYS,
|
|
5
|
+
E as INPUT_CAPABILITY_KEYS,
|
|
4
6
|
i as VERSION,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
A as VijiCore,
|
|
8
|
+
C as VijiCoreError
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=index.js.map
|