@viji-dev/core 0.20.0 → 0.21.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
@@ -1136,6 +1136,9 @@ declare interface ImageParameter {
1136
1136
  category: ParameterCategory;
1137
1137
  }
1138
1138
 
1139
+ /** Value type of one `initialParameters` entry: a parameter value, or a {@link ModelSeed} for model parameters. */
1140
+ export declare type InitialParameterValue = ParameterValue | ModelSeed;
1141
+
1139
1142
  /**
1140
1143
  * Runtime-enumerable identifiers for the **input / interaction** capabilities
1141
1144
  * tracked live per rendered frame. This is the live capability vocabulary — the
@@ -1228,6 +1231,158 @@ export declare interface MinAvgMax {
1228
1231
  max: number;
1229
1232
  }
1230
1233
 
1234
+ /**
1235
+ * The 3D model formats a `viji.model()` parameter accepts, with the file
1236
+ * extension (dot included) and the canonical MIME type the Viji backend
1237
+ * stores and serves for each. Cross-repo contract: the client builds its
1238
+ * picker `accept` list and MIME canonicalization from this table, the
1239
+ * backend keeps an equal literal and asserts equality in its tests.
1240
+ *
1241
+ * Multi-file formats (`.gltf` with external buffers and textures) are
1242
+ * deliberately absent: one asset is one file.
1243
+ */
1244
+ export declare const MODEL_FORMATS: ReadonlyArray<ModelFormatInfo>;
1245
+
1246
+ /**
1247
+ * Configuration object passed to `viji.model()`. The host renders a file
1248
+ * picker for 3D model files; the user-supplied file becomes available as a
1249
+ * {@link ModelValue} (bytes plus a blob URL) that your own loader parses.
1250
+ */
1251
+ declare interface ModelConfig {
1252
+ /**
1253
+ * Advanced: explicit parameter identity. Normally you do NOT set this —
1254
+ * the parameter's name is inferred from the variable or object key you
1255
+ * assign it to (`const statue = viji.model(...)` → `statue`). Set `name`
1256
+ * only for parameters not assigned to a variable or key (created in an
1257
+ * array, loop, or factory). Must be a valid identifier and scene-globally
1258
+ * unique. When set, it overrides the inferred name.
1259
+ */
1260
+ name?: string;
1261
+ /** Display name shown next to the file picker in the parameter UI. Optional — defaults to the parameter's name. */
1262
+ label?: string;
1263
+ /** Optional tooltip / help text shown next to the control. */
1264
+ description?: string;
1265
+ /** Group name for organizing related parameters under a shared heading. Default: `'general'`. */
1266
+ group?: string;
1267
+ /** Visibility category. The control hides when its capability is unavailable. Default: `'general'`. */
1268
+ category?: ParameterCategory;
1269
+ /**
1270
+ * Required: the formats your scene can parse, for example `['glb']` for a
1271
+ * three.js `GLTFLoader` scene or `['obj', 'stl']` for p5 `loadModel()`.
1272
+ * The host filters its picker by this list and core rejects files of other
1273
+ * formats before the scene sees them. Must not be empty; list only what
1274
+ * your loader handles.
1275
+ */
1276
+ formats: ModelFormat[];
1277
+ }
1278
+
1279
+ /**
1280
+ * Host-side value of a 3D model parameter: what parameter listeners,
1281
+ * `getParameter()` and `getParameterValues()` deliver once a model is set.
1282
+ * A frozen plain object carrying the format tag only; core keeps no copy of
1283
+ * the bytes on the host (they are transferred to the scene). Hosts that need
1284
+ * to tell it apart from other object values check the parameter's declared
1285
+ * type (`'model'`) or the presence of a string `format`.
1286
+ */
1287
+ export declare interface ModelDescriptor {
1288
+ /** Format tag of the model the scene currently holds. */
1289
+ readonly format: ModelFormat;
1290
+ }
1291
+
1292
+ /**
1293
+ * `VijiCoreError.code` values a model parameter can raise:
1294
+ * `MODEL_FORMAT_UNKNOWN` (the file is not a supported model),
1295
+ * `MODEL_FORMAT_NOT_ALLOWED` (the parameter's `formats` exclude it),
1296
+ * `MODEL_LOAD_ERROR` (reading or fetching the input failed).
1297
+ */
1298
+ export declare type ModelErrorCode = 'MODEL_FORMAT_UNKNOWN' | 'MODEL_FORMAT_NOT_ALLOWED' | 'MODEL_LOAD_ERROR';
1299
+
1300
+ /**
1301
+ * Format tag of a 3D model file. One tag per supported file type; the
1302
+ * extension and canonical MIME type of each live in `MODEL_FORMATS`.
1303
+ */
1304
+ export declare type ModelFormat = 'glb' | 'obj' | 'stl' | 'ply' | 'las' | 'laz' | 'splat';
1305
+
1306
+ /** One row of `MODEL_FORMATS`: a format tag with its file extension and canonical MIME type. */
1307
+ export declare interface ModelFormatInfo {
1308
+ /** Format tag used by `viji.model()` and the `format` field of a model value. */
1309
+ readonly format: ModelFormat;
1310
+ /** File extension including the dot, lower case (for picker `accept` lists). */
1311
+ readonly extension: string;
1312
+ /** Canonical MIME type the Viji backend stores and serves for this format. */
1313
+ readonly mime: string;
1314
+ }
1315
+
1316
+ /**
1317
+ * What `setParameter` accepts for a model parameter: a `File` or `Blob`
1318
+ * (read on the host), a bare `ArrayBuffer` or a {@link ModelSeed} (the
1319
+ * buffer is TRANSFERRED to the scene and becomes unusable on the host), a
1320
+ * URL string (fetched without credentials), or `null` to clear.
1321
+ */
1322
+ export declare type ModelInput = File | Blob | ArrayBuffer | ModelSeed | string | null;
1323
+
1324
+ /**
1325
+ * Reactive object returned by `viji.model()`. `value` is `null` until the user
1326
+ * provides a 3D model file.
1327
+ */
1328
+ declare interface ModelParameter {
1329
+ /** The current model as a {@link ModelValue}, or `null` until the user provides one. */
1330
+ value: ModelValue | null;
1331
+ /** Formats this parameter accepts (the `formats` you passed). */
1332
+ readonly formats: ReadonlyArray<ModelFormat>;
1333
+ /** Display name shown next to the upload field in the parameter UI. */
1334
+ label?: string;
1335
+ /** Tooltip / help text for the control (empty string when not configured). */
1336
+ description?: string;
1337
+ /** Group name under which the control appears in the UI. */
1338
+ group: string;
1339
+ /** Visibility category that controls when the parameter is shown. */
1340
+ category: ParameterCategory;
1341
+ }
1342
+
1343
+ /**
1344
+ * What `initialParameters` accepts for a model parameter. Structured-cloned
1345
+ * to the scene (your buffer stays usable). `format` is preferred (a host
1346
+ * that stores assets knows it from the MIME type); when omitted, the format
1347
+ * is sniffed from the bytes with `name` as the extension hint.
1348
+ */
1349
+ export declare interface ModelSeed {
1350
+ /** The whole model file. Must be an `ArrayBuffer` (not a view, not shared) with at least one byte. */
1351
+ bytes: ArrayBuffer;
1352
+ /** Format tag. Sniffed from `bytes` when omitted. */
1353
+ format?: ModelFormat | undefined;
1354
+ /** File name or URL, used only as an extension hint for the sniff; never stored. */
1355
+ name?: string | undefined;
1356
+ }
1357
+
1358
+ /**
1359
+ * The model a `viji.model()` parameter currently holds: the file as bytes plus
1360
+ * a lazily created blob URL, tagged with its format. Core never parses the
1361
+ * file; pass `bytes` to a loader's `parse()` or `url` to its `load()`.
1362
+ *
1363
+ * Read `value` where you parse it. When the host replaces or clears the
1364
+ * model, core drops the bytes and revokes `url`; geometry you already built
1365
+ * from them stays valid, but a URL taken from the replaced value rejects
1366
+ * when loaded afterwards.
1367
+ */
1368
+ declare interface ModelValue {
1369
+ /** Format tag of the file, resolved by the host before transfer. */
1370
+ readonly format: ModelFormat;
1371
+ /**
1372
+ * The whole file, transferred from the host without a copy. `byteLength`
1373
+ * is the file size. Some loaders transfer the buffer to their own worker
1374
+ * and detach it; pass `bytes.slice(0)` to those, or disable their worker.
1375
+ */
1376
+ readonly bytes: ArrayBuffer;
1377
+ /**
1378
+ * Blob URL for loaders that take a URL (three.js `.load()`, p5 `loadModel()`).
1379
+ * Created on first read (a Blob copies the bytes, so it is never built
1380
+ * eagerly), cached, and revoked when the host replaces or clears the model.
1381
+ * Reading it on a value the host already replaced throws.
1382
+ */
1383
+ readonly url: string;
1384
+ }
1385
+
1231
1386
  /**
1232
1387
  * Mouse input state for the current frame: position, individual button states,
1233
1388
  * per-frame movement, scroll wheel, and frame-based press / release events.
@@ -1395,6 +1550,12 @@ export declare interface ParameterConfig {
1395
1550
  */
1396
1551
  step?: number;
1397
1552
  options?: string[] | number[];
1553
+ /**
1554
+ * For model type: the formats the scene can parse (required by
1555
+ * `viji.model()`, so always present on model definitions). Hosts filter
1556
+ * their pickers by it; core rejects files of other formats at set time.
1557
+ */
1558
+ formats?: ModelFormat[] | undefined;
1398
1559
  maxLength?: number;
1399
1560
  /**
1400
1561
  * For color and gradient types: the value carries a transparency channel
@@ -1447,9 +1608,9 @@ export declare interface ParameterGroup {
1447
1608
  * The kind of UI control a parameter renders as. Used for the per-type
1448
1609
  * breakdown in {@link SceneData.parameterCounts}.
1449
1610
  */
1450
- export declare type ParameterType = 'slider' | 'color' | 'toggle' | 'select' | 'text' | 'number' | 'image' | 'button' | 'coordinate' | 'gradient';
1611
+ export declare type ParameterType = 'slider' | 'color' | 'toggle' | 'select' | 'text' | 'number' | 'image' | 'button' | 'coordinate' | 'gradient' | 'model';
1451
1612
 
1452
- export declare type ParameterValue = string | number | boolean | ImageBitmap | CoordinateValue | GradientValue | null;
1613
+ export declare type ParameterValue = string | number | boolean | ImageBitmap | CoordinateValue | GradientValue | ModelDescriptor | null;
1453
1614
 
1454
1615
  export declare interface PerformanceStats {
1455
1616
  resolution: Resolution;
@@ -2523,7 +2684,7 @@ declare interface TouchPoint {
2523
2684
  /** Returned by `on*` listener registration calls; invoke to unsubscribe. */
2524
2685
  export declare type Unsubscribe = () => void;
2525
2686
 
2526
- export declare const VERSION = "0.20.0";
2687
+ export declare const VERSION = "0.21.0";
2527
2688
 
2528
2689
  /**
2529
2690
  * Real-time video API: drawable frame, dimensions, and the source-side
@@ -2824,6 +2985,20 @@ export declare interface VijiAPI {
2824
2985
  * if (tex.value) ctx.drawImage(tex.value, 0, 0, viji.width, viji.height);
2825
2986
  */
2826
2987
  image: (defaultValue: null, config: ImageConfig) => ImageParameter;
2988
+ /**
2989
+ * Declares a 3D model parameter. `formats` is required: list only the formats
2990
+ * your loader parses, so the host picker offers nothing the scene cannot show.
2991
+ * The user-supplied file becomes available as `value` (a `ModelValue` with
2992
+ * `bytes`, `url` and `format`); parse it with your own loader (three.js loaders,
2993
+ * p5 `loadModel()`, loaders.gl). Core never parses the file. Must be called at
2994
+ * the top level of the scene, never inside `render()`.
2995
+ *
2996
+ * @example
2997
+ * const statue = viji.model(null, { label: 'Statue', formats: ['glb'] });
2998
+ * // later, when statue.value changes:
2999
+ * loader.parse(statue.value.bytes, '', (gltf) => scene.add(gltf.scene));
3000
+ */
3001
+ model: (defaultValue: null, config: ModelConfig) => ModelParameter;
2827
3002
  /**
2828
3003
  * Declares a momentary button parameter. `value` is `true` for one frame after
2829
3004
  * the user clicks, then auto-resets. Perfect for triggering discrete events.
@@ -2939,9 +3114,12 @@ export declare class VijiCore {
2939
3114
  private config;
2940
3115
  /**
2941
3116
  * `config.initialParameters` after `sanitizeInitialParameters` (set in
2942
- * `initialize()`, cleared in `destroy()`). Overlaid onto `parameterValues`
3117
+ * `initialize()`, released at the end of `handleParametersDefined`, its
3118
+ * only consumer, and in `destroy()`). Overlaid onto `parameterValues`
2943
3119
  * when the worker reports its definitions, so the host table matches what
2944
3120
  * the worker seeded before frame 1. `null` when no seed was supplied.
3121
+ * Released after define so model seed buffers (up to tens of MB) do not
3122
+ * stay reachable from the host for the core's lifetime.
2945
3123
  */
2946
3124
  private initialSeed;
2947
3125
  private isHeadless;
@@ -3151,10 +3329,20 @@ export declare class VijiCore {
3151
3329
  */
3152
3330
  private normalizeParameterInput;
3153
3331
  /**
3154
- * Set a single parameter value
3155
- * Handles all parameter types including images intelligently
3156
- */
3157
- setParameter(name: string, value: ParameterValue | ColorInput | GradientInput | File | Blob): Promise<void>;
3332
+ * Set a single parameter value.
3333
+ * Handles all parameter types including images and 3D models.
3334
+ *
3335
+ * Model parameters accept a {@link ModelInput}: a `File` or `Blob` (read
3336
+ * here), a URL string (fetched without credentials), a bare `ArrayBuffer`
3337
+ * or a `ModelSeed`, or `null` to clear. A buffer you pass is TRANSFERRED to
3338
+ * the scene and is unusable afterwards; when one model feeds several cores
3339
+ * (VJ decks), pass a `File` / `Blob` or re-read the bytes per core. Core
3340
+ * keeps no copy of the bytes: listeners and `getParameter()` receive a
3341
+ * `ModelDescriptor` (`{ format }`). Rejects with `MODEL_FORMAT_UNKNOWN` when the file
3342
+ * is not a supported model, `MODEL_FORMAT_NOT_ALLOWED` when the parameter's
3343
+ * `formats` exclude it, and `MODEL_LOAD_ERROR` when reading or fetching fails.
3344
+ */
3345
+ setParameter(name: string, value: ParameterValue | ColorInput | GradientInput | File | Blob | ModelInput): Promise<void>;
3158
3346
  /**
3159
3347
  * Internal method to handle image parameter loading and transfer
3160
3348
  * Loads the image on the host side and creates TWO ImageBitmaps:
@@ -3162,13 +3350,26 @@ export declare class VijiCore {
3162
3350
  * - One to transfer to the worker
3163
3351
  */
3164
3352
  private handleImageParameter;
3353
+ /**
3354
+ * Internal: resolve, validate and transfer a 3D model parameter value.
3355
+ *
3356
+ * Order (security review S12): resolve the bytes, validate format and
3357
+ * allowlist, then post inside try/catch, and only after a successful post
3358
+ * commit the host table and notify listeners. Format errors are thrown
3359
+ * BEFORE the I/O try so they keep their own codes; only read / fetch
3360
+ * failures become `MODEL_LOAD_ERROR`. The host keeps the descriptor only.
3361
+ */
3362
+ private handleModelParameter;
3165
3363
  /**
3166
3364
  * Set multiple parameter values efficiently.
3167
3365
  *
3168
3366
  * For color parameters, accepts the same rich input forms as `setParameter`
3169
3367
  * (hex, RGB/HSB objects, CSS / GLSL strings); they are normalized to canonical hex.
3368
+ * Model parameters accept the same {@link ModelInput} forms as `setParameter`;
3369
+ * each model entry is resolved and transferred individually (in order) before
3370
+ * the remaining values are sent as one batch.
3170
3371
  */
3171
- setParameters(values: Record<string, ParameterValue | ColorInput | GradientInput>): Promise<void>;
3372
+ setParameters(values: Record<string, ParameterValue | ColorInput | GradientInput | ModelInput>): Promise<void>;
3172
3373
  /**
3173
3374
  * Get current parameter value
3174
3375
  */
@@ -4131,8 +4332,18 @@ export declare interface VijiCoreConfig {
4131
4332
  * closed is dropped from the seed with a console warning. URL strings are
4132
4333
  * not resolved and `File` / `Blob` values are not seedable; use
4133
4334
  * {@link VijiCore.setParameter} after `onParametersDefined` for those.
4134
- */
4135
- initialParameters?: Record<string, ParameterValue>;
4335
+ *
4336
+ * Model parameters accept a {@link ModelSeed} (`{ bytes, format? }`). The
4337
+ * buffer is structured-cloned to the scene (one copy; your buffer stays
4338
+ * usable and may be shared between keys), core keeps none of it after the
4339
+ * scene reports its parameters, and the host table shows a
4340
+ * {@link ModelDescriptor}. Seeds whose bytes are empty, detached, or
4341
+ * not an `ArrayBuffer`, or whose format cannot be resolved, are dropped
4342
+ * with a warning. The whole seed rides one message with a 5 second budget:
4343
+ * keep model seeds small (total under 64 MB) and set large models with
4344
+ * `setParameter` after `onParametersDefined` instead.
4345
+ */
4346
+ initialParameters?: Record<string, InitialParameterValue>;
4136
4347
  /** Frame rate mode - render every frame (`'full'`), every 2nd (`'half'`), every 4th (`'quarter'`), or every 8th (`'eighth'`). */
4137
4348
  frameRateMode?: FrameRateMode;
4138
4349
  /** Resolution: scale (number) or explicit dimensions (object). Required for headless, must be object form */
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import { C as E, I as o, V as s, a as C, b as I } from "./index-Dw5Jy7so.js";
1
+ import { C as E, I as s, M as o, V as C, a as I, b as V } from "./index-C9OHLFGB.js";
2
2
  export {
3
3
  E as CV_FEATURE_KEYS,
4
- o as INPUT_CAPABILITY_KEYS,
5
- s as VERSION,
6
- C as VijiCore,
7
- I as VijiCoreError
4
+ s as INPUT_CAPABILITY_KEYS,
5
+ o as MODEL_FORMATS,
6
+ C as VERSION,
7
+ I as VijiCore,
8
+ V as VijiCoreError
8
9
  };
@@ -3100,6 +3100,7 @@ const ai = /* @__PURE__ */ new Set([
3100
3100
  "number",
3101
3101
  "text",
3102
3102
  "image",
3103
+ "model",
3103
3104
  "button",
3104
3105
  "coordinate",
3105
3106
  "gradient"
@@ -145,7 +145,7 @@ class u {
145
145
  * per-source refinement lives in {@link detectScriptSources}, run afterwards.
146
146
  */
147
147
  static detectScriptCapabilities(e, t) {
148
- /\bviji\.audio/.test(e) && (t.audio = !0), /\bviji\.video/.test(e) && (t.video = !0), /\bviji\.mouse/.test(e) && (t.mouse = !0), /\bviji\.keyboard/.test(e) && (t.keyboard = !0), /\bviji\.touches/.test(e) && (t.touch = !0), /\bviji\.pointer/.test(e) && (t.pointer = !0), /\bviji\.device\b/.test(e) && (t.sensors = !0), /\bviji\.devices/.test(e) && (t.devices = !0), /\bviji\.(slider|color|toggle|select|text|number|image|button|coordinate|gradient)\s*\(/.test(e) && (t.parameters = !0), /\benableFaceDetection\b/.test(e) && (t.cv.faceDetection = !0), /\benableFaceMesh\b/.test(e) && (t.cv.faceMesh = !0), /\benableEmotionDetection\b/.test(e) && (t.cv.emotion = !0), /\benableHandTracking\b/.test(e) && (t.cv.handTracking = !0), /\benablePoseDetection\b/.test(e) && (t.cv.poseDetection = !0), /\benableBodySegmentation\b/.test(e) && (t.cv.segmentation = !0);
148
+ /\bviji\.audio/.test(e) && (t.audio = !0), /\bviji\.video/.test(e) && (t.video = !0), /\bviji\.mouse/.test(e) && (t.mouse = !0), /\bviji\.keyboard/.test(e) && (t.keyboard = !0), /\bviji\.touches/.test(e) && (t.touch = !0), /\bviji\.pointer/.test(e) && (t.pointer = !0), /\bviji\.device\b/.test(e) && (t.sensors = !0), /\bviji\.devices/.test(e) && (t.devices = !0), /\bviji\.(slider|color|toggle|select|text|number|image|model|button|coordinate|gradient)\s*\(/.test(e) && (t.parameters = !0), /\benableFaceDetection\b/.test(e) && (t.cv.faceDetection = !0), /\benableFaceMesh\b/.test(e) && (t.cv.faceMesh = !0), /\benableEmotionDetection\b/.test(e) && (t.cv.emotion = !0), /\benableHandTracking\b/.test(e) && (t.cv.handTracking = !0), /\benablePoseDetection\b/.test(e) && (t.cv.poseDetection = !0), /\benableBodySegmentation\b/.test(e) && (t.cv.segmentation = !0);
149
149
  }
150
150
  /**
151
151
  * Shader per-source refinement (`caps.sources`) from built-in uniform usage.
@@ -1,4 +1,4 @@
1
- import { a as n } from "./scene-analysis-Bsf4JrzY.js";
1
+ import { a as n } from "./scene-analysis-C7cAsqhv.js";
2
2
  export {
3
3
  n as analyzeScene
4
4
  };
package/package.json CHANGED
@@ -1,117 +1,117 @@
1
- {
2
- "name": "@viji-dev/core",
3
- "version": "0.20.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
- }
1
+ {
2
+ "name": "@viji-dev/core",
3
+ "version": "0.21.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
+ }