@viji-dev/core 0.11.8 → 0.12.0
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 +109 -28
- package/dist/artist-global.d.ts +109 -28
- package/dist/artist-jsdoc.d.ts +27 -18
- package/dist/assets/viji.worker-Clz2HjaH.js +587 -0
- package/dist/docs-api.js +8 -8
- package/dist/{essentia-wasm.web-B48G7Mzk.js → essentia-wasm.web-7iahj_bF.js} +1 -2
- package/dist/essentia.js-core.es-CC_3Ap1i.js +0 -1
- package/dist/{index-fdus0y3o.js → index-BcsAA44l.js} +631 -487
- package/dist/index.d.ts +192 -37
- package/dist/index.js +1 -2
- package/package.json +7 -2
- package/dist/assets/viji.worker-B1ltcEP7.js +0 -24324
package/dist/index.d.ts
CHANGED
|
@@ -854,8 +854,17 @@ declare interface BeatEvent {
|
|
|
854
854
|
* then auto-resets to `false`.
|
|
855
855
|
*/
|
|
856
856
|
declare interface ButtonConfig {
|
|
857
|
-
/**
|
|
858
|
-
|
|
857
|
+
/**
|
|
858
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
859
|
+
* the parameter's name is inferred from the variable or object key you
|
|
860
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
861
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
862
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
863
|
+
* unique. When set, it overrides the inferred name.
|
|
864
|
+
*/
|
|
865
|
+
name?: string;
|
|
866
|
+
/** Display name shown on the button in the parameter UI. Optional — defaults to the parameter's name. */
|
|
867
|
+
label?: string;
|
|
859
868
|
/** Optional tooltip / help text shown next to the control. */
|
|
860
869
|
description?: string;
|
|
861
870
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -873,7 +882,7 @@ declare interface ButtonParameter {
|
|
|
873
882
|
/** `true` for the single frame after the user clicks the button, `false` otherwise. */
|
|
874
883
|
value: boolean;
|
|
875
884
|
/** Display name shown on the button in the parameter UI. */
|
|
876
|
-
label
|
|
885
|
+
label?: string;
|
|
877
886
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
878
887
|
description?: string;
|
|
879
888
|
/** Group name under which the control appears in the UI. */
|
|
@@ -947,8 +956,17 @@ export declare interface CaptureFrameOptions {
|
|
|
947
956
|
* label and UI grouping/visibility.
|
|
948
957
|
*/
|
|
949
958
|
declare interface ColorConfig {
|
|
950
|
-
/**
|
|
951
|
-
|
|
959
|
+
/**
|
|
960
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
961
|
+
* the parameter's name is inferred from the variable or object key you
|
|
962
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
963
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
964
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
965
|
+
* unique. When set, it overrides the inferred name.
|
|
966
|
+
*/
|
|
967
|
+
name?: string;
|
|
968
|
+
/** Display name shown next to the color swatch in the parameter UI. Optional — defaults to the parameter's name. */
|
|
969
|
+
label?: string;
|
|
952
970
|
/** Optional tooltip / help text shown next to the control. */
|
|
953
971
|
description?: string;
|
|
954
972
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -1009,7 +1027,7 @@ declare interface ColorParameter {
|
|
|
1009
1027
|
b: number;
|
|
1010
1028
|
};
|
|
1011
1029
|
/** Display name shown next to the swatch in the parameter UI. */
|
|
1012
|
-
label
|
|
1030
|
+
label?: string;
|
|
1013
1031
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
1014
1032
|
description?: string;
|
|
1015
1033
|
/** Group name under which the control appears in the UI. */
|
|
@@ -1023,10 +1041,19 @@ declare interface ColorParameter {
|
|
|
1023
1041
|
* draggable pad; both `x` and `y` are clamped to `-1..1`.
|
|
1024
1042
|
*/
|
|
1025
1043
|
declare interface CoordinateConfig {
|
|
1044
|
+
/**
|
|
1045
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
1046
|
+
* the parameter's name is inferred from the variable or object key you
|
|
1047
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
1048
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
1049
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
1050
|
+
* unique. When set, it overrides the inferred name.
|
|
1051
|
+
*/
|
|
1052
|
+
name?: string;
|
|
1026
1053
|
/** Snap increment for both `x` and `y` components. Default: `0.01`. */
|
|
1027
1054
|
step?: number;
|
|
1028
|
-
/** Display name shown next to the pad in the parameter UI.
|
|
1029
|
-
label
|
|
1055
|
+
/** Display name shown next to the pad in the parameter UI. Optional — defaults to the parameter's name. */
|
|
1056
|
+
label?: string;
|
|
1030
1057
|
/** Optional tooltip / help text shown next to the control. */
|
|
1031
1058
|
description?: string;
|
|
1032
1059
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -1045,7 +1072,7 @@ declare interface CoordinateParameter {
|
|
|
1045
1072
|
/** Snap increment for both `x` and `y` components. */
|
|
1046
1073
|
step: number;
|
|
1047
1074
|
/** Display name shown next to the pad in the parameter UI. */
|
|
1048
|
-
label
|
|
1075
|
+
label?: string;
|
|
1049
1076
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
1050
1077
|
description?: string;
|
|
1051
1078
|
/** Group name under which the control appears in the UI. */
|
|
@@ -1591,8 +1618,17 @@ export declare interface HandData {
|
|
|
1591
1618
|
* or a P5 image wrapper (P5 renderer).
|
|
1592
1619
|
*/
|
|
1593
1620
|
declare interface ImageConfig {
|
|
1594
|
-
/**
|
|
1595
|
-
|
|
1621
|
+
/**
|
|
1622
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
1623
|
+
* the parameter's name is inferred from the variable or object key you
|
|
1624
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
1625
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
1626
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
1627
|
+
* unique. When set, it overrides the inferred name.
|
|
1628
|
+
*/
|
|
1629
|
+
name?: string;
|
|
1630
|
+
/** Display name shown next to the upload field in the parameter UI. Optional — defaults to the parameter's name. */
|
|
1631
|
+
label?: string;
|
|
1596
1632
|
/** Optional tooltip / help text shown next to the control. */
|
|
1597
1633
|
description?: string;
|
|
1598
1634
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -1612,7 +1648,7 @@ declare interface ImageParameter {
|
|
|
1612
1648
|
/** P5-compatible image wrapper. Only available in the P5 renderer; added at runtime by the P5 adapter. */
|
|
1613
1649
|
readonly p5?: any;
|
|
1614
1650
|
/** Display name shown next to the upload field in the parameter UI. */
|
|
1615
|
-
label
|
|
1651
|
+
label?: string;
|
|
1616
1652
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
1617
1653
|
description?: string;
|
|
1618
1654
|
/** Group name under which the control appears in the UI. */
|
|
@@ -1768,6 +1804,15 @@ export declare interface MouseEventData {
|
|
|
1768
1804
|
* label, and UI grouping/visibility for a precise numeric input.
|
|
1769
1805
|
*/
|
|
1770
1806
|
declare interface NumberConfig {
|
|
1807
|
+
/**
|
|
1808
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
1809
|
+
* the parameter's name is inferred from the variable or object key you
|
|
1810
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
1811
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
1812
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
1813
|
+
* unique. When set, it overrides the inferred name.
|
|
1814
|
+
*/
|
|
1815
|
+
name?: string;
|
|
1771
1816
|
/** Inclusive minimum value. Default: `0`. */
|
|
1772
1817
|
min?: number;
|
|
1773
1818
|
/** Inclusive maximum value. Default: `100`. */
|
|
@@ -1780,8 +1825,8 @@ declare interface NumberConfig {
|
|
|
1780
1825
|
* (`step: 0.001`).
|
|
1781
1826
|
*/
|
|
1782
1827
|
step?: number;
|
|
1783
|
-
/** Display name shown next to the input in the parameter UI.
|
|
1784
|
-
label
|
|
1828
|
+
/** Display name shown next to the input in the parameter UI. Optional — defaults to the parameter's name. */
|
|
1829
|
+
label?: string;
|
|
1785
1830
|
/** Optional tooltip / help text shown next to the control. */
|
|
1786
1831
|
description?: string;
|
|
1787
1832
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -1804,7 +1849,7 @@ declare interface NumberParameter {
|
|
|
1804
1849
|
/** Increment between values. */
|
|
1805
1850
|
step: number;
|
|
1806
1851
|
/** Display name shown next to the input in the parameter UI. */
|
|
1807
|
-
label
|
|
1852
|
+
label?: string;
|
|
1808
1853
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
1809
1854
|
description?: string;
|
|
1810
1855
|
/** Group name under which the control appears in the UI. */
|
|
@@ -1880,8 +1925,19 @@ export declare interface ParameterConfig {
|
|
|
1880
1925
|
}
|
|
1881
1926
|
|
|
1882
1927
|
export declare interface ParameterDefinition {
|
|
1928
|
+
/**
|
|
1929
|
+
* Stable parameter identity. Always equals the Record key under which the
|
|
1930
|
+
* definition is registered in `groups[].parameters` — addressing
|
|
1931
|
+
* (`setParameter`), saved values, presets, locks, and the controller
|
|
1932
|
+
* protocol all resolve by `name`. For script scenes (native/p5) `name` is
|
|
1933
|
+
* the artist's own variable or object-key name, inferred at compile time;
|
|
1934
|
+
* for shader scenes it is the GLSL uniform name. `label` is display-only —
|
|
1935
|
+
* never key UI lists or lookups off `label`.
|
|
1936
|
+
*/
|
|
1937
|
+
name: string;
|
|
1883
1938
|
type: ParameterType;
|
|
1884
1939
|
defaultValue: ParameterValue;
|
|
1940
|
+
/** Display text shown in parameter UIs. Not an identity — see `name`. */
|
|
1885
1941
|
label?: string;
|
|
1886
1942
|
description?: string;
|
|
1887
1943
|
group?: string;
|
|
@@ -2184,10 +2240,13 @@ export declare interface SceneConsoleMessage {
|
|
|
2184
2240
|
* Static metadata about a scene, derived without running it. Returned by
|
|
2185
2241
|
* `VijiCore.getSceneData()`.
|
|
2186
2242
|
*
|
|
2187
|
-
* `renderer`, `p5CanvasMode`, and `capabilities` are
|
|
2188
|
-
*
|
|
2189
|
-
*
|
|
2190
|
-
*
|
|
2243
|
+
* `renderer`, `p5CanvasMode`, and `capabilities` are **final when
|
|
2244
|
+
* `initialize()` resolves** — the worker analyzes the scene source and reports
|
|
2245
|
+
* the results in its `scene-analysis` ack, which `initialize()` awaits before
|
|
2246
|
+
* resolving. Reads before that return placeholder defaults. The parameter
|
|
2247
|
+
* counts populate once the scene has registered its parameters (mirroring how
|
|
2248
|
+
* parameter data has always surfaced), so read them after the core has
|
|
2249
|
+
* initialized the scene.
|
|
2191
2250
|
*/
|
|
2192
2251
|
export declare interface SceneData {
|
|
2193
2252
|
/** Detected renderer the scene targets. */
|
|
@@ -2222,9 +2281,19 @@ export declare interface SceneData {
|
|
|
2222
2281
|
* - `UNHANDLED_REJECTION`: caught by the worker's `unhandledrejection` handler.
|
|
2223
2282
|
* - `SHADER_COMPILE_ERROR`: GLSL compile failure (shader mode).
|
|
2224
2283
|
* - `P5_INIT_ERROR`: failure during P5 mode initialization (e.g. missing `render`).
|
|
2284
|
+
* - `SCENE_PARSE_ERROR`: the script scene could not be parsed by the load-time
|
|
2285
|
+
* parameter name-inference pass (a genuine syntax error — the scene would not
|
|
2286
|
+
* have executed either).
|
|
2287
|
+
* - `PARAM_NAME_MISSING`: a `viji.<type>(...)` call was not assigned to a
|
|
2288
|
+
* variable or object key and carries no explicit `name` — nothing to infer an
|
|
2289
|
+
* identity from. Assign it to a `const`, or pass `name:'...'`.
|
|
2290
|
+
* - `PARAM_NAME_DUPLICATE`: two parameters resolved to the same name. Names are
|
|
2291
|
+
* scene-global; rename one, or pass `name:'...'` to distinguish them.
|
|
2292
|
+
* - `PARAM_NAME_INVALID`: an explicit `name` is not a valid identifier or is a
|
|
2293
|
+
* reserved word (`__proto__`, `constructor`, `prototype`).
|
|
2225
2294
|
* - `ENGINE_INTERNAL`: engine path with no artist attribution.
|
|
2226
2295
|
*/
|
|
2227
|
-
export declare type SceneErrorCode = 'SCENE_CODE_ERROR' | 'RENDER_ERROR' | 'UNCAUGHT_ERROR' | 'UNHANDLED_REJECTION' | 'SHADER_COMPILE_ERROR' | 'P5_INIT_ERROR' | 'ENGINE_INTERNAL';
|
|
2296
|
+
export declare type SceneErrorCode = 'SCENE_CODE_ERROR' | 'RENDER_ERROR' | 'UNCAUGHT_ERROR' | 'UNHANDLED_REJECTION' | 'SHADER_COMPILE_ERROR' | 'P5_INIT_ERROR' | 'SCENE_PARSE_ERROR' | 'PARAM_NAME_MISSING' | 'PARAM_NAME_DUPLICATE' | 'PARAM_NAME_INVALID' | 'ENGINE_INTERNAL';
|
|
2228
2297
|
|
|
2229
2298
|
/**
|
|
2230
2299
|
* Structured scene runtime error envelope surfaced via `VijiCore.onSceneRuntimeError`.
|
|
@@ -2315,10 +2384,19 @@ declare interface SegmentationData {
|
|
|
2315
2384
|
* as a dropdown or segmented control.
|
|
2316
2385
|
*/
|
|
2317
2386
|
declare interface SelectConfig {
|
|
2387
|
+
/**
|
|
2388
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
2389
|
+
* the parameter's name is inferred from the variable or object key you
|
|
2390
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
2391
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
2392
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
2393
|
+
* unique. When set, it overrides the inferred name.
|
|
2394
|
+
*/
|
|
2395
|
+
name?: string;
|
|
2318
2396
|
/** Available choices. The element type (`string` or `number`) becomes the parameter's value type. Required. */
|
|
2319
2397
|
options: string[] | number[];
|
|
2320
|
-
/** Display name shown next to the dropdown in the parameter UI.
|
|
2321
|
-
label
|
|
2398
|
+
/** Display name shown next to the dropdown in the parameter UI. Optional — defaults to the parameter's name. */
|
|
2399
|
+
label?: string;
|
|
2322
2400
|
/** Optional tooltip / help text shown next to the control. */
|
|
2323
2401
|
description?: string;
|
|
2324
2402
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -2337,7 +2415,7 @@ declare interface SelectParameter {
|
|
|
2337
2415
|
/** The full list of choices originally configured. */
|
|
2338
2416
|
options: string[] | number[];
|
|
2339
2417
|
/** Display name shown next to the dropdown in the parameter UI. */
|
|
2340
|
-
label
|
|
2418
|
+
label?: string;
|
|
2341
2419
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
2342
2420
|
description?: string;
|
|
2343
2421
|
/** Group name under which the control appears in the UI. */
|
|
@@ -2653,6 +2731,15 @@ export declare interface SerializedTempoInductionState {
|
|
|
2653
2731
|
* increment, label, and UI grouping/visibility.
|
|
2654
2732
|
*/
|
|
2655
2733
|
declare interface SliderConfig {
|
|
2734
|
+
/**
|
|
2735
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
2736
|
+
* the parameter's name is inferred from the variable or object key you
|
|
2737
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
2738
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
2739
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
2740
|
+
* unique. When set, it overrides the inferred name.
|
|
2741
|
+
*/
|
|
2742
|
+
name?: string;
|
|
2656
2743
|
/** Inclusive minimum value of the slider. Default: `0`. */
|
|
2657
2744
|
min?: number;
|
|
2658
2745
|
/** Inclusive maximum value of the slider. Default: `100`. */
|
|
@@ -2665,8 +2752,8 @@ declare interface SliderConfig {
|
|
|
2665
2752
|
* (`step: 1` on a range of `3..30`) or fine precision (`step: 0.001`).
|
|
2666
2753
|
*/
|
|
2667
2754
|
step?: number;
|
|
2668
|
-
/** Display name shown next to the control in the parameter UI.
|
|
2669
|
-
label
|
|
2755
|
+
/** Display name shown next to the control in the parameter UI. Optional — defaults to the parameter's name. */
|
|
2756
|
+
label?: string;
|
|
2670
2757
|
/** Optional tooltip / help text shown next to the control. */
|
|
2671
2758
|
description?: string;
|
|
2672
2759
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -2689,7 +2776,7 @@ declare interface SliderParameter {
|
|
|
2689
2776
|
/** Increment between values. */
|
|
2690
2777
|
step: number;
|
|
2691
2778
|
/** Display name shown next to the control in the parameter UI. */
|
|
2692
|
-
label
|
|
2779
|
+
label?: string;
|
|
2693
2780
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
2694
2781
|
description?: string;
|
|
2695
2782
|
/** Group name under which the control appears in the UI. */
|
|
@@ -2714,8 +2801,17 @@ export declare interface StateImportError {
|
|
|
2714
2801
|
* text input field.
|
|
2715
2802
|
*/
|
|
2716
2803
|
declare interface TextConfig {
|
|
2717
|
-
/**
|
|
2718
|
-
|
|
2804
|
+
/**
|
|
2805
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
2806
|
+
* the parameter's name is inferred from the variable or object key you
|
|
2807
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
2808
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
2809
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
2810
|
+
* unique. When set, it overrides the inferred name.
|
|
2811
|
+
*/
|
|
2812
|
+
name?: string;
|
|
2813
|
+
/** Display name shown next to the text field in the parameter UI. Optional — defaults to the parameter's name. */
|
|
2814
|
+
label?: string;
|
|
2719
2815
|
/** Optional tooltip / help text shown next to the control. */
|
|
2720
2816
|
description?: string;
|
|
2721
2817
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -2736,7 +2832,7 @@ declare interface TextParameter {
|
|
|
2736
2832
|
/** Maximum character count enforced by the host UI. */
|
|
2737
2833
|
maxLength?: number;
|
|
2738
2834
|
/** Display name shown next to the input in the parameter UI. */
|
|
2739
|
-
label
|
|
2835
|
+
label?: string;
|
|
2740
2836
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
2741
2837
|
description?: string;
|
|
2742
2838
|
/** Group name under which the control appears in the UI. */
|
|
@@ -2750,8 +2846,17 @@ declare interface TextParameter {
|
|
|
2750
2846
|
* label and UI grouping/visibility.
|
|
2751
2847
|
*/
|
|
2752
2848
|
declare interface ToggleConfig {
|
|
2753
|
-
/**
|
|
2754
|
-
|
|
2849
|
+
/**
|
|
2850
|
+
* Advanced: explicit parameter identity. Normally you do NOT set this —
|
|
2851
|
+
* the parameter's name is inferred from the variable or object key you
|
|
2852
|
+
* assign it to (`const speed = viji.slider(...)` → `speed`). Set `name`
|
|
2853
|
+
* only for parameters not assigned to a variable or key (created in an
|
|
2854
|
+
* array, loop, or factory). Must be a valid identifier and scene-globally
|
|
2855
|
+
* unique. When set, it overrides the inferred name.
|
|
2856
|
+
*/
|
|
2857
|
+
name?: string;
|
|
2858
|
+
/** Display name shown next to the switch in the parameter UI. Optional — defaults to the parameter's name. */
|
|
2859
|
+
label?: string;
|
|
2755
2860
|
/** Optional tooltip / help text shown next to the control. */
|
|
2756
2861
|
description?: string;
|
|
2757
2862
|
/** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
|
|
@@ -2768,7 +2873,7 @@ declare interface ToggleParameter {
|
|
|
2768
2873
|
/** Current state of the switch. Updates in real-time when the user toggles it. */
|
|
2769
2874
|
value: boolean;
|
|
2770
2875
|
/** Display name shown next to the switch in the parameter UI. */
|
|
2771
|
-
label
|
|
2876
|
+
label?: string;
|
|
2772
2877
|
/** Tooltip / help text for the control (empty string when not configured). */
|
|
2773
2878
|
description?: string;
|
|
2774
2879
|
/** Group name under which the control appears in the UI. */
|
|
@@ -2871,7 +2976,7 @@ declare type TrackingState = 'TRACKING' | 'LOCKED' | 'BREAKDOWN' | 'LOST';
|
|
|
2871
2976
|
/** Returned by `on*` listener registration calls; invoke to unsubscribe. */
|
|
2872
2977
|
export declare type Unsubscribe = () => void;
|
|
2873
2978
|
|
|
2874
|
-
export declare const VERSION = "0.
|
|
2979
|
+
export declare const VERSION = "0.12.0";
|
|
2875
2980
|
|
|
2876
2981
|
/**
|
|
2877
2982
|
* Real-time video API: drawable frame, dimensions, and the source-side
|
|
@@ -3234,6 +3339,7 @@ export declare class VijiCore {
|
|
|
3234
3339
|
private isInitialized;
|
|
3235
3340
|
private isDestroyed;
|
|
3236
3341
|
private isInitializing;
|
|
3342
|
+
private engineGroupReleased;
|
|
3237
3343
|
private instanceId;
|
|
3238
3344
|
private screenRefreshRate;
|
|
3239
3345
|
private refreshRateRafId;
|
|
@@ -3262,6 +3368,8 @@ export declare class VijiCore {
|
|
|
3262
3368
|
private sceneConsumesAnalysedFrame;
|
|
3263
3369
|
private sceneContextType?;
|
|
3264
3370
|
private parametersInitialized;
|
|
3371
|
+
private isAwaitingSceneAnalysis;
|
|
3372
|
+
private analysisWindowSceneError;
|
|
3265
3373
|
private parameterListeners;
|
|
3266
3374
|
private parameterDefinedListeners;
|
|
3267
3375
|
private parameterErrorListeners;
|
|
@@ -3359,9 +3467,36 @@ export declare class VijiCore {
|
|
|
3359
3467
|
*/
|
|
3360
3468
|
hide(): void;
|
|
3361
3469
|
/**
|
|
3362
|
-
* Initializes the core components in sequence
|
|
3470
|
+
* Initializes the core components in sequence. When this resolves the
|
|
3471
|
+
* scene is live and `getSceneData()`'s analysis fields are final.
|
|
3472
|
+
*
|
|
3473
|
+
* Rejection contract — three codes pass through unwrapped so consumers
|
|
3474
|
+
* can branch on them:
|
|
3475
|
+
* - `INITIALIZATION_CANCELLED` — `destroy()` landed while initializing.
|
|
3476
|
+
* Expected during rapid mount/unmount (hover previews, deck swaps);
|
|
3477
|
+
* not a failure.
|
|
3478
|
+
* - `INSTANCE_DESTROYED` — called on a destroyed core, or on one whose
|
|
3479
|
+
* previous `initialize()` failed and released its engine reference;
|
|
3480
|
+
* construct a fresh core instead.
|
|
3481
|
+
* - `SCENE_DECRYPT_ERROR` — an encrypted (`viji-enc:`) scene could not be
|
|
3482
|
+
* decrypted (wrong/missing key component, tampered or malformed
|
|
3483
|
+
* envelope, unsupported envelope version). Permanent for this payload:
|
|
3484
|
+
* the scene genuinely cannot run — surface a typed error state, do not
|
|
3485
|
+
* retry.
|
|
3486
|
+
*
|
|
3487
|
+
* Every other failure (including a `scene-analysis` ack failure or
|
|
3488
|
+
* timeout) rejects as `INITIALIZATION_ERROR` with the underlying error in
|
|
3489
|
+
* `details.error`. Note `details` no longer carries the config.
|
|
3363
3490
|
*/
|
|
3364
3491
|
initialize(): Promise<void>;
|
|
3492
|
+
/**
|
|
3493
|
+
* Release this core's engine-group reference after a failed initialize().
|
|
3494
|
+
* Idempotent; skipped when destroy() owns the teardown (it detaches and
|
|
3495
|
+
* releases itself). Detach + release are safe on partially-attached state:
|
|
3496
|
+
* `detachSink` deletes from maps and `release` is a member-set delete with
|
|
3497
|
+
* a `_destroyed`-guarded last-release dispose.
|
|
3498
|
+
*/
|
|
3499
|
+
private releaseEngineGroupOnFailure;
|
|
3365
3500
|
/**
|
|
3366
3501
|
* Sets up the interaction system for Phase 7.
|
|
3367
3502
|
*
|
|
@@ -3449,8 +3584,10 @@ export declare class VijiCore {
|
|
|
3449
3584
|
* Returns static metadata about the scene: its renderer, the capabilities its
|
|
3450
3585
|
* code declares it uses, and its parameter shape.
|
|
3451
3586
|
*
|
|
3452
|
-
* `renderer`, `p5CanvasMode`, and `capabilities` are
|
|
3453
|
-
*
|
|
3587
|
+
* `renderer`, `p5CanvasMode`, and `capabilities` are **final when
|
|
3588
|
+
* `initialize()` resolves** — they are assigned from the worker's
|
|
3589
|
+
* `scene-analysis` ack during initialization; reads before that return
|
|
3590
|
+
* placeholder defaults. The parameter counts populate once the scene has
|
|
3454
3591
|
* registered its parameters.
|
|
3455
3592
|
*
|
|
3456
3593
|
* Distinct from {@link getCapabilities}, which reports what the *host*
|
|
@@ -3495,7 +3632,13 @@ export declare class VijiCore {
|
|
|
3495
3632
|
*/
|
|
3496
3633
|
unlinkEventSource(): void;
|
|
3497
3634
|
/**
|
|
3498
|
-
* Link source cores that this core will pull frames from
|
|
3635
|
+
* Link source cores that this core will pull frames from.
|
|
3636
|
+
*
|
|
3637
|
+
* Requires an initialized core: the mixer's renderer type decides the
|
|
3638
|
+
* capture flip orientation, and `sceneRenderer` is final only when
|
|
3639
|
+
* `initialize()` resolves (Design B). A pre-ready call would silently read
|
|
3640
|
+
* the `'native'` default and composite shader mixers un-flipped — silently
|
|
3641
|
+
* wrong output, so it fails loud instead.
|
|
3499
3642
|
*/
|
|
3500
3643
|
linkFrameSources(...sourceCores: VijiCore[]): void;
|
|
3501
3644
|
/**
|
|
@@ -4424,6 +4567,18 @@ export declare interface VijiCoreConfig {
|
|
|
4424
4567
|
_sc?: string;
|
|
4425
4568
|
/** Initial render hint (logo variant/position), applied before the first frame. */
|
|
4426
4569
|
_rh?: number;
|
|
4570
|
+
/**
|
|
4571
|
+
* Per-scene key component for encrypted (`viji-enc:`) scene delivery —
|
|
4572
|
+
* an opaque base64url blob served next to the scene payload. Required to
|
|
4573
|
+
* decrypt an encrypted `sceneCode`; ignored for plaintext scenes. Routed
|
|
4574
|
+
* to the worker inside the `set-scene-code` payload on the direct control
|
|
4575
|
+
* port (never through the iframe bootstrap).
|
|
4576
|
+
*
|
|
4577
|
+
* Omitted from the `configuration` getter: serializing ciphertext and the
|
|
4578
|
+
* key component into one log/state dump would make the dump decryptable
|
|
4579
|
+
* with the shipped bundle constant — do not persist or log this value.
|
|
4580
|
+
*/
|
|
4581
|
+
_sk?: string;
|
|
4427
4582
|
/** Called when the scene is visually live (render loop running, branding applied) but before audio/video/WASM setup completes. */
|
|
4428
4583
|
onRenderStart?: () => void;
|
|
4429
4584
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, C as i, I as r, V as o, a as C, c as E, b as A } from "./index-
|
|
1
|
+
import { A as e, C as i, I as r, V as o, a as C, c as E, b as A } from "./index-BcsAA44l.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AudioSystem,
|
|
4
4
|
i as CV_FEATURE_KEYS,
|
|
@@ -8,4 +8,3 @@ export {
|
|
|
8
8
|
E as VijiCoreError,
|
|
9
9
|
A as analyzeSceneCapabilities
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viji-dev/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Universal execution engine for Viji Creative scenes",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"module": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
@@ -50,12 +51,13 @@
|
|
|
50
51
|
"scripts": {
|
|
51
52
|
"prebuild": "node scripts/prebuild-clean.mjs && node scripts/sync-version.mjs",
|
|
52
53
|
"version": "npm run build && git add -A",
|
|
53
|
-
"build": "vite build && node scripts/copy-tasks-assets.mjs && node scripts/build-artist-types.mjs && node scripts/lint-artist-types-drift.mjs && node scripts/build-docs-api.mjs",
|
|
54
|
+
"build": "vite build && node scripts/copy-tasks-assets.mjs && node scripts/minify-dist.mjs && node scripts/build-artist-types.mjs && node scripts/lint-artist-types-drift.mjs && node scripts/build-docs-api.mjs",
|
|
54
55
|
"build:docs": "node scripts/build-docs-api.mjs",
|
|
55
56
|
"lint:ai-prompts-drift": "node scripts/lint-ai-prompts-drift.mjs",
|
|
56
57
|
"dev": "node scripts/sync-version.mjs && vite build --watch",
|
|
57
58
|
"integration": "vite --config integration-example/vite.config.ts",
|
|
58
59
|
"test": "vitest",
|
|
60
|
+
"test:run": "vitest run",
|
|
59
61
|
"test:coverage": "vitest --coverage",
|
|
60
62
|
"type-check": "tsc --noEmit",
|
|
61
63
|
"lint": "eslint src --ext .ts"
|
|
@@ -93,7 +95,10 @@
|
|
|
93
95
|
},
|
|
94
96
|
"dependencies": {
|
|
95
97
|
"@mediapipe/tasks-vision": "^0.10.20",
|
|
98
|
+
"@noble/ciphers": "2.3.0",
|
|
96
99
|
"@noble/curves": "^2.2.0",
|
|
100
|
+
"@noble/hashes": "2.2.0",
|
|
101
|
+
"acorn": "8.15.0",
|
|
97
102
|
"essentia.js": "^0.1.3",
|
|
98
103
|
"fft.js": "^4.0.4",
|
|
99
104
|
"sucrase": "^3.35.1"
|