@viji-dev/core 0.13.0 → 0.15.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/index.d.ts CHANGED
@@ -249,7 +249,7 @@ declare interface ButtonParameter {
249
249
  * The canvas rendering context a scene actually locked. Detected at runtime
250
250
  * (authoritative) once the context is acquired. See {@link SceneData.contextType}.
251
251
  */
252
- export declare type CanvasContextType = '2d' | 'webgl' | 'webgl2';
252
+ export declare type CanvasContextType = '2d' | 'webgl' | 'webgl2' | 'webgpu';
253
253
 
254
254
  /**
255
255
  * An immediate edge in a capability's consumed-meaningfully state, delivered
@@ -1317,6 +1317,12 @@ export declare interface PerformanceStats {
1317
1317
  resolution: Resolution;
1318
1318
  scale: number;
1319
1319
  frameRate: FrameRateInfo;
1320
+ /**
1321
+ * Worker spawn scheme the sandbox selected (see {@link WorkerSpawnScheme});
1322
+ * `undefined` until the worker is up. Mirrors `getSceneData().workerSpawn`
1323
+ * so support can read it from a stats snapshot alone.
1324
+ */
1325
+ workerSpawn?: WorkerSpawnScheme;
1320
1326
  cv?: {
1321
1327
  activeFeatures: CVFeature[];
1322
1328
  processingTime: number;
@@ -1455,6 +1461,29 @@ export declare type Resolution = {
1455
1461
  height: number;
1456
1462
  };
1457
1463
 
1464
+ /**
1465
+ * Payload of the worker's `scene-analysis` ack — the correlated response to
1466
+ * `set-scene-code`. The worker runs static analysis (renderer, capabilities,
1467
+ * p5 canvas mode, analysedFrame consumption) after receiving the scene code
1468
+ * and **before** compiling it, and the host's `initialize()` awaits this ack
1469
+ * to assign the four `SceneData` fields exactly once. Carries booleans/enums
1470
+ * only — never scene source.
1471
+ *
1472
+ * Public since 0.14.0: this is also the return type of `analyzeScene`
1473
+ * (`@viji-dev/core/scene-analysis`), which the worker itself calls to build
1474
+ * the ack — one shape, one producer, two transports.
1475
+ */
1476
+ export declare interface SceneAnalysisData {
1477
+ /** Detected renderer the scene targets. */
1478
+ renderer: RendererType;
1479
+ /** P5 canvas mode; present only when `renderer` is `'p5'`. */
1480
+ p5CanvasMode?: P5CanvasMode;
1481
+ /** Capabilities the scene's code declares it uses (inclusive-biased). */
1482
+ capabilities: SceneCapabilities;
1483
+ /** Whether the scene consumes per-frame analysed-frame bitmaps (CV). */
1484
+ consumesAnalysedFrame: boolean;
1485
+ }
1486
+
1458
1487
  /**
1459
1488
  * The set of engine capabilities a scene's code declares it uses, derived by
1460
1489
  * static analysis of the scene source (no execution). Detection is
@@ -1570,11 +1599,17 @@ export declare interface SceneData {
1570
1599
  p5CanvasMode?: P5CanvasMode;
1571
1600
  /**
1572
1601
  * The canvas context the scene actually locked (`'2d'` / `'webgl'` /
1573
- * `'webgl2'`), detected at runtime. Present once the context locks (first
1602
+ * `'webgl2'` / `'webgpu'`), detected at runtime. Present once the context locks (first
1574
1603
  * render); `undefined` before that. Authoritative — Core locks the context,
1575
1604
  * so this is exact even for native scenes with dynamic `useContext`.
1576
1605
  */
1577
1606
  contextType?: CanvasContextType;
1607
+ /**
1608
+ * Worker spawn scheme the sandbox selected for this core (see
1609
+ * {@link WorkerSpawnScheme}). Present once the worker is up; `undefined`
1610
+ * before initialization completes.
1611
+ */
1612
+ workerSpawn?: WorkerSpawnScheme;
1578
1613
  /** Capabilities the scene's code declares it uses (inclusive-biased). */
1579
1614
  capabilities: SceneCapabilities;
1580
1615
  /** Total number of parameters the scene defines. */
@@ -2285,7 +2320,7 @@ declare interface TouchPoint {
2285
2320
  /** Returned by `on*` listener registration calls; invoke to unsubscribe. */
2286
2321
  export declare type Unsubscribe = () => void;
2287
2322
 
2288
- export declare const VERSION = "0.13.0";
2323
+ export declare const VERSION = "0.15.0";
2289
2324
 
2290
2325
  /**
2291
2326
  * Real-time video API: drawable frame, dimensions, and the source-side
@@ -2483,6 +2518,8 @@ export declare interface VijiAPI {
2483
2518
  ctx?: OffscreenCanvasRenderingContext2D;
2484
2519
  /** WebGL rendering context. `undefined` until `viji.useContext('webgl')` or `'webgl2'` is called; afterwards equals the cached context. */
2485
2520
  gl?: WebGLRenderingContext | WebGL2RenderingContext;
2521
+ /** WebGPU canvas context. `undefined` until `viji.useContext('webgpu')` (or a direct `viji.canvas.getContext('webgpu')`) succeeds; afterwards equals the acquired context. Stays `undefined` on browsers without WebGPU support. */
2522
+ gpu?: GPUCanvasContext;
2486
2523
  /** Current canvas width in pixels. Updates automatically when the host resizes the canvas; read every frame. */
2487
2524
  width: number;
2488
2525
  /** Current canvas height in pixels. Updates automatically when the host resizes the canvas; read every frame. */
@@ -2623,6 +2660,28 @@ export declare interface VijiAPI {
2623
2660
  * `null`. Choose ONE type and use it for the entire scene.
2624
2661
  */
2625
2662
  useContext(type: 'webgl2'): WebGL2RenderingContext | null;
2663
+ /**
2664
+ * Selects a WebGPU canvas context. Returns the raw `GPUCanvasContext` and
2665
+ * also stores it on `viji.gpu`. Adapter and device acquisition stay in scene
2666
+ * code (`navigator.gpu` is available; top-level `await` works), and the
2667
+ * scene must call `configure()` on the context before rendering. A canvas
2668
+ * only supports one context type. Returns `null` when a different context
2669
+ * type was already requested OR when the browser has no WebGPU support,
2670
+ * so always guard and provide a fallback. Choose ONE type and use it for
2671
+ * the entire scene.
2672
+ *
2673
+ * @example
2674
+ * const gctx = viji.useContext('webgpu');
2675
+ * if (!navigator.gpu || !gctx) {
2676
+ * // fall back, e.g. render a message via a 2d scene variant
2677
+ * } else {
2678
+ * const adapter = await navigator.gpu.requestAdapter();
2679
+ * const device = await adapter.requestDevice();
2680
+ * const format = navigator.gpu.getPreferredCanvasFormat();
2681
+ * gctx.configure({ device, format, alphaMode: 'opaque' });
2682
+ * }
2683
+ */
2684
+ useContext(type: 'webgpu'): GPUCanvasContext | null;
2626
2685
  }
2627
2686
 
2628
2687
  /**
@@ -2667,6 +2726,8 @@ export declare class VijiCore {
2667
2726
  private sceneP5CanvasMode?;
2668
2727
  private sceneConsumesAnalysedFrame;
2669
2728
  private sceneContextType?;
2729
+ /** Worker spawn scheme the sandbox selected; set once the worker is up. */
2730
+ private sceneWorkerSpawn?;
2670
2731
  private parametersInitialized;
2671
2732
  private isAwaitingSceneAnalysis;
2672
2733
  private analysisWindowSceneError;
@@ -3917,4 +3978,14 @@ export declare class VijiCoreError extends Error {
3917
3978
  constructor(message: string, code: string, context?: any | undefined);
3918
3979
  }
3919
3980
 
3981
+ /**
3982
+ * Worker spawn scheme selected by the iframe's capability probe: `'blob'`
3983
+ * where a blob worker inside the sandbox is already a secure context
3984
+ * (Firefox, Safari), `'data'` where it is not (Chromium), in which case the
3985
+ * worker is spawned from a data: stub so scene code gains `[SecureContext]`
3986
+ * APIs such as WebGPU. Diagnostic; surfaced in `getSceneData()` and
3987
+ * `getStats()`.
3988
+ */
3989
+ export declare type WorkerSpawnScheme = 'blob' | 'data';
3990
+
3920
3991
  export { }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as E, I as o, V as s, a as C, b as I } from "./index-CkmT_70R.js";
1
+ import { C as E, I as o, V as s, a as C, b as I } from "./index-CuQT5y06.js";
2
2
  export {
3
3
  E as CV_FEATURE_KEYS,
4
4
  o as INPUT_CAPABILITY_KEYS,
@@ -1,4 +1,4 @@
1
- class o {
1
+ class a {
2
2
  /**
3
3
  * Detects the renderer type from scene code comments
4
4
  *
@@ -44,7 +44,7 @@ class o {
44
44
  * @returns The set of capabilities the scene declares it uses
45
45
  */
46
46
  static detectCapabilities(e, t) {
47
- const s = this.stripCommentsAndStrings(e), i = {
47
+ const i = this.stripCommentsAndStrings(e), s = {
48
48
  audio: !1,
49
49
  video: !1,
50
50
  mouse: !1,
@@ -63,7 +63,7 @@ class o {
63
63
  segmentation: !1
64
64
  }
65
65
  };
66
- return t === "shader" ? this.detectShaderCapabilities(s, i) : this.detectScriptCapabilities(s, i), i;
66
+ return t === "shader" ? this.detectShaderCapabilities(i, s) : this.detectScriptCapabilities(i, s), s;
67
67
  }
68
68
  /**
69
69
  * Replaces comment spans and string/template literals with whitespace via a
@@ -74,37 +74,37 @@ class o {
74
74
  */
75
75
  static stripCommentsAndStrings(e) {
76
76
  let t = "";
77
- const s = e.length;
78
- let i = 0;
79
- for (; i < s; ) {
80
- const r = e[i], a = i + 1 < s ? e[i + 1] : "";
81
- if (r === "/" && a === "/") {
82
- for (i += 2; i < s && e[i] !== `
83
- `; ) i++;
77
+ const i = e.length;
78
+ let s = 0;
79
+ for (; s < i; ) {
80
+ const r = e[s], o = s + 1 < i ? e[s + 1] : "";
81
+ if (r === "/" && o === "/") {
82
+ for (s += 2; s < i && e[s] !== `
83
+ `; ) s++;
84
84
  continue;
85
85
  }
86
- if (r === "/" && a === "*") {
87
- for (i += 2; i < s && !(e[i] === "*" && e[i + 1] === "/"); ) i++;
88
- i += 2, t += " ";
86
+ if (r === "/" && o === "*") {
87
+ for (s += 2; s < i && !(e[s] === "*" && e[s + 1] === "/"); ) s++;
88
+ s += 2, t += " ";
89
89
  continue;
90
90
  }
91
91
  if (r === '"' || r === "'" || r === "`") {
92
92
  const u = r;
93
- for (i++; i < s; ) {
94
- if (e[i] === "\\") {
95
- i += 2;
93
+ for (s++; s < i; ) {
94
+ if (e[s] === "\\") {
95
+ s += 2;
96
96
  continue;
97
97
  }
98
- if (e[i] === u) {
99
- i++;
98
+ if (e[s] === u) {
99
+ s++;
100
100
  break;
101
101
  }
102
- i++;
102
+ s++;
103
103
  }
104
104
  t += " ";
105
105
  continue;
106
106
  }
107
- t += r, i++;
107
+ t += r, s++;
108
108
  }
109
109
  return t;
110
110
  }
@@ -163,19 +163,24 @@ class o {
163
163
  return /\b(analysedFrame|getAnalysedFrameData)\b/.test(t) || /\bu_videoAnalysed\w*/.test(t);
164
164
  }
165
165
  static detectUsage(e, t) {
166
- const s = this.stripCommentsAndStrings(e), i = {
166
+ const i = this.stripCommentsAndStrings(e), s = {
167
167
  mouse: { position: !1, left: !1, right: !1, middle: !1 },
168
168
  pointer: { position: !1, down: !1 },
169
169
  touch: !1
170
170
  };
171
- return t === "shader" ? (i.mouse.position = /\bu_mouse(\b|InCanvas|Delta|Wheel)/.test(s), i.mouse.left = /\bu_mouse(Left|Pressed|WasPressed|WasReleased)\b/.test(s), i.mouse.right = /\bu_mouseRight\b/.test(s), i.mouse.middle = /\bu_mouseMiddle\b/.test(s), i.pointer.position = /\bu_pointer(\b|Delta|InCanvas)/.test(s), i.pointer.down = /\bu_pointer(Down|WasPressed|WasReleased)\b/.test(s), i.touch = /\bu_touch/.test(s)) : (i.mouse.position = /\bmouse\.(x|y|deltaX|deltaY|wheelDelta|wheelX|wheelY|wasMoved)\b/.test(s), i.mouse.left = /\bmouse\.(leftButton|isPressed|wasPressed|wasReleased)\b/.test(s), i.mouse.right = /\bmouse\.rightButton\b/.test(s), i.mouse.middle = /\bmouse\.middleButton\b/.test(s), i.pointer.position = /\bpointer\.(x|y|deltaX|deltaY)\b/.test(s), i.pointer.down = /\bpointer\.(isDown|wasPressed|wasReleased)\b/.test(s), i.touch = /\btouches\./.test(s)), i;
171
+ return t === "shader" ? (s.mouse.position = /\bu_mouse(\b|InCanvas|Delta|Wheel)/.test(i), s.mouse.left = /\bu_mouse(Left|Pressed|WasPressed|WasReleased)\b/.test(i), s.mouse.right = /\bu_mouseRight\b/.test(i), s.mouse.middle = /\bu_mouseMiddle\b/.test(i), s.pointer.position = /\bu_pointer(\b|Delta|InCanvas)/.test(i), s.pointer.down = /\bu_pointer(Down|WasPressed|WasReleased)\b/.test(i), s.touch = /\bu_touch/.test(i)) : (s.mouse.position = /\bmouse\.(x|y|deltaX|deltaY|wheelDelta|wheelX|wheelY|wasMoved)\b/.test(i), s.mouse.left = /\bmouse\.(leftButton|isPressed|wasPressed|wasReleased)\b/.test(i), s.mouse.right = /\bmouse\.rightButton\b/.test(i), s.mouse.middle = /\bmouse\.middleButton\b/.test(i), s.pointer.position = /\bpointer\.(x|y|deltaX|deltaY)\b/.test(i), s.pointer.down = /\bpointer\.(isDown|wasPressed|wasReleased)\b/.test(i), s.touch = /\btouches\./.test(i)), s;
172
172
  }
173
173
  }
174
174
  function b(n) {
175
- const e = o.detectRendererType(n);
176
- return o.detectCapabilities(n, e);
175
+ const e = a.detectRendererType(n), t = e === "p5" ? a.detectP5CanvasMode(n) : void 0;
176
+ return {
177
+ renderer: e,
178
+ ...t !== void 0 && { p5CanvasMode: t },
179
+ capabilities: a.detectCapabilities(n, e),
180
+ consumesAnalysedFrame: a.detectAnalysedFrameUse(n)
181
+ };
177
182
  }
178
183
  export {
179
- o as S,
184
+ a as S,
180
185
  b as a
181
186
  };
@@ -1,36 +1,80 @@
1
1
  /**
2
- * Analyzes a scene's source code and returns the capabilities it declares,
3
- * without constructing a core. Composes {@link SceneAnalyzer.detectRendererType}
4
- * and {@link SceneAnalyzer.detectCapabilities} — the same two steps `VijiCore`
5
- * performs at construction — so for a given core version the result is
6
- * identical to a booted core's `getSceneData().capabilities`.
2
+ * Full static scene analysis — everything the worker's `scene-analysis` ack
3
+ * carries, computed without constructing a core. Composes the same four
4
+ * statics the worker runs in phase 1 of scene load ({@link
5
+ * SceneAnalyzer.detectRendererType} → {@link SceneAnalyzer.detectP5CanvasMode}
6
+ * → {@link SceneAnalyzer.detectCapabilities} → {@link
7
+ * SceneAnalyzer.detectAnalysedFrameUse}), and the worker itself consumes this
8
+ * function to build the ack — so for a given core version the result is the
9
+ * exact payload a booted core's `initialize()` resolves its scene analysis
10
+ * with. Parity holds through shared code, not parallel composition.
7
11
  *
8
12
  * Intended for out-of-engine consumers (e.g. server-side persistence of
9
- * per-scene capabilities). The following properties are an intentional, kept
10
- * contract:
11
- * - **Pure and Node-safe** — static analysis only; the scene is never executed
12
- * and no DOM, canvas, or worker API is touched. Callable in a bare Node
13
- * process.
13
+ * per-scene capabilities; migration tooling that needs the renderer without
14
+ * booting a core). The following properties are an intentional, kept
15
+ * contract, covering all four fields:
16
+ * - **Pure and Node-safe** — static analysis only; the scene is never
17
+ * executed and no DOM, canvas, or worker API is touched. Callable in a
18
+ * bare Node process.
14
19
  * - **Deterministic** — same code string, same result, within a core version.
15
- * - **Inclusive-biased** — a capability the scene uses is never hidden; a
16
- * rare ambiguous case may report an extra one.
17
- * - **Safe on untrusted input** — linear-time scan and regexes with no throw
18
- * paths on any string input.
20
+ * - **Raw-code input** — `renderer` and `p5CanvasMode` are comment-directive
21
+ * scans over the artist's original source, before any transpilation (the
22
+ * worker applies sucrase only after this analysis, and only to script
23
+ * scenes). Pass stored scene code as-is.
24
+ * - **Inclusive-biased** (`capabilities`) — a capability the scene uses is
25
+ * never hidden; a rare ambiguous case may report an extra one.
26
+ * - **Safe on untrusted input** — linear-time scans and regexes with no
27
+ * throw paths on any string input.
19
28
  *
20
- * Note for consumers filtering on `video`: the flag means the scene reads the
21
- * video *image* (pixels/texture). Shader scenes that consume only CV result
22
- * uniforms report `cv.*` without `video`, so a "reacts to the camera" filter
23
- * should test `video || any cv key`.
29
+ * `p5CanvasMode` is present only when `renderer` is `'p5'`, mirroring the
30
+ * ack shape exactly.
24
31
  *
25
- * @param sceneCode - The artist's scene code (native, p5, or shader)
26
- * @returns The set of capabilities the scene declares it uses
32
+ * Note for consumers filtering on `capabilities.video`: the flag means the
33
+ * scene reads the video *image* (pixels/texture). Shader scenes that consume
34
+ * only CV result uniforms report `cv.*` without `video`, so a "reacts to the
35
+ * camera" filter should test `video || any cv key`.
36
+ *
37
+ * @param sceneCode - The artist's scene code (native, p5, or shader), raw
38
+ * @returns The complete static analysis — the worker's ack payload
27
39
  * @example
28
40
  * ```ts
29
- * const caps = analyzeSceneCapabilities(scene.code);
30
- * if (caps.audio) tags.push('audio');
41
+ * const analysis = analyzeScene(scene.code);
42
+ * if (analysis.renderer === 'shader') return skip(scene);
43
+ * if (analysis.capabilities.audio) tags.push('audio');
31
44
  * ```
32
45
  */
33
- export declare function analyzeSceneCapabilities(sceneCode: string): SceneCapabilities;
46
+ export declare function analyzeScene(sceneCode: string): SceneAnalysisData;
47
+
48
+ /**
49
+ * P5 main-canvas mode. Only meaningful when {@link SceneData.renderer} is
50
+ * `'p5'`: `'2d'` for the default 2D canvas, `'webgl'` for a WEBGL canvas.
51
+ */
52
+ declare type P5CanvasMode = '2d' | 'webgl';
53
+
54
+ declare type RendererType = 'native' | 'p5' | 'shader';
55
+
56
+ /**
57
+ * Payload of the worker's `scene-analysis` ack — the correlated response to
58
+ * `set-scene-code`. The worker runs static analysis (renderer, capabilities,
59
+ * p5 canvas mode, analysedFrame consumption) after receiving the scene code
60
+ * and **before** compiling it, and the host's `initialize()` awaits this ack
61
+ * to assign the four `SceneData` fields exactly once. Carries booleans/enums
62
+ * only — never scene source.
63
+ *
64
+ * Public since 0.14.0: this is also the return type of `analyzeScene`
65
+ * (`@viji-dev/core/scene-analysis`), which the worker itself calls to build
66
+ * the ack — one shape, one producer, two transports.
67
+ */
68
+ declare interface SceneAnalysisData {
69
+ /** Detected renderer the scene targets. */
70
+ renderer: RendererType;
71
+ /** P5 canvas mode; present only when `renderer` is `'p5'`. */
72
+ p5CanvasMode?: P5CanvasMode;
73
+ /** Capabilities the scene's code declares it uses (inclusive-biased). */
74
+ capabilities: SceneCapabilities;
75
+ /** Whether the scene consumes per-frame analysed-frame bitmaps (CV). */
76
+ consumesAnalysedFrame: boolean;
77
+ }
34
78
 
35
79
  /**
36
80
  * The set of engine capabilities a scene's code declares it uses, derived by
@@ -1,4 +1,4 @@
1
- import { a as i } from "./scene-analysis-DNN8jTaH.js";
1
+ import { a as n } from "./scene-analysis-CEQRlNUL.js";
2
2
  export {
3
- i as analyzeSceneCapabilities
3
+ n as analyzeScene
4
4
  };
package/package.json CHANGED
@@ -1,116 +1,117 @@
1
- {
2
- "name": "@viji-dev/core",
3
- "version": "0.13.0",
4
- "description": "Universal execution engine for Viji Creative scenes",
5
- "type": "module",
6
- "sideEffects": false,
7
- "main": "./dist/index.js",
8
- "module": "./dist/index.js",
9
- "types": "./dist/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "import": "./dist/index.js",
13
- "types": "./dist/index.d.ts"
14
- },
15
- "./scene-analysis": {
16
- "import": "./dist/scene-analysis.js",
17
- "types": "./dist/scene-analysis.d.ts"
18
- },
19
- "./param-inference": {
20
- "import": "./dist/param-inference.js",
21
- "types": "./dist/param-inference.d.ts"
22
- },
23
- "./package.json": "./package.json",
24
- "./artist-global": {
25
- "types": "./dist/artist-global.d.ts"
26
- },
27
- "./artist-dts": {
28
- "import": "./dist/artist-dts.js",
29
- "types": "./dist/artist-dts.d.ts"
30
- },
31
- "./artist-jsdoc": {
32
- "types": "./dist/artist-jsdoc.d.ts"
33
- },
34
- "./artist-js-ambient": {
35
- "types": "./dist/artist-js-ambient.d.ts"
36
- },
37
- "./artist-dts-p5": {
38
- "import": "./dist/artist-dts-p5.js",
39
- "types": "./dist/artist-dts-p5.d.ts"
40
- },
41
- "./artist-global-p5": {
42
- "types": "./dist/artist-global-p5.d.ts"
43
- },
44
- "./shader-uniforms": {
45
- "import": "./dist/shader-uniforms.js",
46
- "types": "./dist/shader-uniforms.d.ts"
47
- },
48
- "./docs-api": {
49
- "import": "./dist/docs-api.js",
50
- "types": "./dist/docs-api.d.ts"
51
- }
52
- },
53
- "files": [
54
- "dist/*.js",
55
- "dist/*.d.ts",
56
- "dist/assets",
57
- "!dist/**/*.map",
58
- "README.md"
59
- ],
60
- "scripts": {
61
- "audio-lab": "vite --config audio-lab/vite.config.mjs",
62
- "prebuild": "node scripts/prebuild-clean.mjs && node scripts/sync-version.mjs",
63
- "version": "npm run build && git add -A",
64
- "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",
65
- "build:docs": "node scripts/build-docs-api.mjs",
66
- "lint:ai-prompts-drift": "node scripts/lint-ai-prompts-drift.mjs",
67
- "dev": "node scripts/sync-version.mjs && vite build --watch",
68
- "integration": "vite --config integration-example/vite.config.ts",
69
- "test": "vitest",
70
- "test:run": "vitest run",
71
- "test:coverage": "vitest --coverage",
72
- "type-check": "tsc --noEmit",
73
- "lint": "eslint src --ext .ts"
74
- },
75
- "keywords": [
76
- "viji",
77
- "creative",
78
- "webgl",
79
- "audio-reactive",
80
- "canvas",
81
- "webworker"
82
- ],
83
- "author": "Viji Team",
84
- "license": "SEE LICENSE IN LICENSE",
85
- "devDependencies": {
86
- "@types/node": "^20.0.0",
87
- "@types/p5": "^1.7.6",
88
- "@typescript-eslint/eslint-plugin": "^6.0.0",
89
- "@typescript-eslint/parser": "^6.0.0",
90
- "@vitest/coverage-v8": "^1.0.0",
91
- "dts-bundle-generator": "^9.5.1",
92
- "eslint": "^8.0.0",
93
- "github-slugger": "^2.0.0",
94
- "happy-dom": "^18.0.1",
95
- "mdast-util-to-string": "^4.0.0",
96
- "remark-parse": "^11.0.0",
97
- "typescript": "^5.0.0",
98
- "unified": "^11.0.5",
99
- "vite": "^5.0.0",
100
- "vite-plugin-dts": "^3.0.0",
101
- "vitest": "^1.0.0"
102
- },
103
- "engines": {
104
- "node": ">=18.0.0"
105
- },
106
- "dependencies": {
107
- "@mediapipe/tasks-vision": "^0.10.20",
108
- "@noble/ciphers": "2.3.0",
109
- "@noble/curves": "^2.2.0",
110
- "@noble/hashes": "2.2.0",
111
- "acorn": "8.15.0",
112
- "essentia.js": "^0.1.3",
113
- "fft.js": "^4.0.4",
114
- "sucrase": "^3.35.1"
115
- }
116
- }
1
+ {
2
+ "name": "@viji-dev/core",
3
+ "version": "0.15.0",
4
+ "description": "Universal execution engine for Viji Creative scenes",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./scene-analysis": {
16
+ "import": "./dist/scene-analysis.js",
17
+ "types": "./dist/scene-analysis.d.ts"
18
+ },
19
+ "./param-inference": {
20
+ "import": "./dist/param-inference.js",
21
+ "types": "./dist/param-inference.d.ts"
22
+ },
23
+ "./package.json": "./package.json",
24
+ "./artist-global": {
25
+ "types": "./dist/artist-global.d.ts"
26
+ },
27
+ "./artist-dts": {
28
+ "import": "./dist/artist-dts.js",
29
+ "types": "./dist/artist-dts.d.ts"
30
+ },
31
+ "./artist-jsdoc": {
32
+ "types": "./dist/artist-jsdoc.d.ts"
33
+ },
34
+ "./artist-js-ambient": {
35
+ "types": "./dist/artist-js-ambient.d.ts"
36
+ },
37
+ "./artist-dts-p5": {
38
+ "import": "./dist/artist-dts-p5.js",
39
+ "types": "./dist/artist-dts-p5.d.ts"
40
+ },
41
+ "./artist-global-p5": {
42
+ "types": "./dist/artist-global-p5.d.ts"
43
+ },
44
+ "./shader-uniforms": {
45
+ "import": "./dist/shader-uniforms.js",
46
+ "types": "./dist/shader-uniforms.d.ts"
47
+ },
48
+ "./docs-api": {
49
+ "import": "./dist/docs-api.js",
50
+ "types": "./dist/docs-api.d.ts"
51
+ }
52
+ },
53
+ "files": [
54
+ "dist/*.js",
55
+ "dist/*.d.ts",
56
+ "dist/assets",
57
+ "!dist/**/*.map",
58
+ "README.md"
59
+ ],
60
+ "scripts": {
61
+ "audio-lab": "vite --config audio-lab/vite.config.mjs",
62
+ "prebuild": "node scripts/prebuild-clean.mjs && node scripts/sync-version.mjs",
63
+ "version": "npm run build && git add -A",
64
+ "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",
65
+ "build:docs": "node scripts/build-docs-api.mjs",
66
+ "lint:ai-prompts-drift": "node scripts/lint-ai-prompts-drift.mjs",
67
+ "dev": "node scripts/sync-version.mjs && vite build --watch",
68
+ "integration": "vite --config integration-example/vite.config.ts",
69
+ "test": "vitest",
70
+ "test:run": "vitest run",
71
+ "test:coverage": "vitest --coverage",
72
+ "type-check": "tsc --noEmit",
73
+ "lint": "eslint src --ext .ts"
74
+ },
75
+ "keywords": [
76
+ "viji",
77
+ "creative",
78
+ "webgl",
79
+ "audio-reactive",
80
+ "canvas",
81
+ "webworker"
82
+ ],
83
+ "author": "Viji Team",
84
+ "license": "SEE LICENSE IN LICENSE",
85
+ "devDependencies": {
86
+ "@types/node": "^20.0.0",
87
+ "@types/p5": "^1.7.6",
88
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
89
+ "@typescript-eslint/parser": "^6.0.0",
90
+ "@vitest/coverage-v8": "^1.0.0",
91
+ "@webgpu/types": "0.1.72",
92
+ "dts-bundle-generator": "^9.5.1",
93
+ "eslint": "^8.0.0",
94
+ "github-slugger": "^2.0.0",
95
+ "happy-dom": "^18.0.1",
96
+ "mdast-util-to-string": "^4.0.0",
97
+ "remark-parse": "^11.0.0",
98
+ "typescript": "^5.0.0",
99
+ "unified": "^11.0.5",
100
+ "vite": "^5.0.0",
101
+ "vite-plugin-dts": "^3.0.0",
102
+ "vitest": "^1.0.0"
103
+ },
104
+ "engines": {
105
+ "node": ">=18.0.0"
106
+ },
107
+ "dependencies": {
108
+ "@mediapipe/tasks-vision": "^0.10.20",
109
+ "@noble/ciphers": "2.3.0",
110
+ "@noble/curves": "^2.2.0",
111
+ "@noble/hashes": "2.2.0",
112
+ "acorn": "8.15.0",
113
+ "essentia.js": "^0.1.3",
114
+ "fft.js": "^4.0.4",
115
+ "sucrase": "^3.35.1"
116
+ }
117
+ }