@vib3code/sdk 2.0.3-canary.6f35b4c → 2.0.3-canary.75a3290
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/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md +142 -0
- package/package.json +10 -1
- package/src/agent/index.js +1 -3
- package/src/agent/mcp/MCPServer.js +196 -0
- package/src/agent/mcp/index.js +1 -1
- package/src/agent/mcp/tools.js +87 -0
- package/src/cli/index.js +374 -44
- package/src/core/VIB3Engine.js +55 -3
- package/src/core/index.js +18 -0
- package/src/core/renderers/FacetedRendererAdapter.js +10 -9
- package/src/core/renderers/HolographicRendererAdapter.js +11 -7
- package/src/core/renderers/QuantumRendererAdapter.js +11 -7
- package/src/creative/index.js +11 -0
- package/src/export/index.js +11 -1
- package/src/faceted/FacetedSystem.js +8 -4
- package/src/holograms/RealHolographicSystem.js +126 -31
- package/src/math/index.js +7 -7
- package/src/reactivity/index.js +3 -5
- package/src/render/LayerPresetManager.js +372 -0
- package/src/render/LayerReactivityBridge.js +344 -0
- package/src/render/LayerRelationshipGraph.js +610 -0
- package/src/render/MultiCanvasBridge.js +148 -25
- package/src/render/index.js +27 -2
- package/src/scene/index.js +4 -4
- package/src/testing/ParallelTestFramework.js +2 -2
- package/src/viewer/GalleryUI.js +17 -0
- package/src/viewer/ViewerPortal.js +2 -2
- package/types/adaptive-sdk.d.ts +204 -5
- package/types/agent/cli.d.ts +78 -0
- package/types/agent/index.d.ts +18 -0
- package/types/agent/mcp.d.ts +87 -0
- package/types/agent/telemetry.d.ts +190 -0
- package/types/core/VIB3Engine.d.ts +26 -0
- package/types/core/index.d.ts +261 -0
- package/types/creative/AestheticMapper.d.ts +72 -0
- package/types/creative/ChoreographyPlayer.d.ts +96 -0
- package/types/creative/index.d.ts +17 -0
- package/types/export/index.d.ts +243 -0
- package/types/geometry/index.d.ts +164 -0
- package/types/math/index.d.ts +214 -0
- package/types/render/LayerPresetManager.d.ts +78 -0
- package/types/render/LayerReactivityBridge.d.ts +85 -0
- package/types/render/LayerRelationshipGraph.d.ts +174 -0
- package/types/render/index.d.ts +3 -0
- package/types/scene/index.d.ts +204 -0
- package/types/systems/index.d.ts +244 -0
- package/types/variations/index.d.ts +62 -0
- package/types/viewer/index.d.ts +225 -0
|
@@ -7,16 +7,20 @@ export class QuantumRendererAdapter extends RendererContract {
|
|
|
7
7
|
this.system = system;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
init() {
|
|
11
|
-
return true;
|
|
10
|
+
init(context = {}) {
|
|
11
|
+
return this.system.init ? this.system.init(context) : true;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
resize() {
|
|
15
|
-
|
|
14
|
+
resize(width, height, pixelRatio = 1) {
|
|
15
|
+
if (this.system.resize) {
|
|
16
|
+
this.system.resize(width, height, pixelRatio);
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
render() {
|
|
19
|
-
this.system.
|
|
20
|
+
render(frameState) {
|
|
21
|
+
if (this.system.render) {
|
|
22
|
+
this.system.render(frameState);
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
setActive(active) {
|
|
@@ -24,6 +28,6 @@ export class QuantumRendererAdapter extends RendererContract {
|
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
dispose() {
|
|
27
|
-
this.system.
|
|
31
|
+
this.system.dispose();
|
|
28
32
|
}
|
|
29
33
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB3+ Creative Tooling Module
|
|
3
|
+
* @module creative
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { ColorPresetsSystem } from './ColorPresetsSystem.js';
|
|
7
|
+
export { TransitionAnimator } from './TransitionAnimator.js';
|
|
8
|
+
export { PostProcessingPipeline } from './PostProcessingPipeline.js';
|
|
9
|
+
export { ParameterTimeline } from './ParameterTimeline.js';
|
|
10
|
+
export { ChoreographyPlayer } from './ChoreographyPlayer.js';
|
|
11
|
+
export { AestheticMapper } from './AestheticMapper.js';
|
package/src/export/index.js
CHANGED
|
@@ -8,7 +8,17 @@ export { exportSVG, downloadSVG } from './SVGExporter.js';
|
|
|
8
8
|
export { exportCSS, downloadCSS, toStyleObject } from './CSSExporter.js';
|
|
9
9
|
export { exportLottie, downloadLottie } from './LottieExporter.js';
|
|
10
10
|
|
|
11
|
-
//
|
|
11
|
+
// Core managers
|
|
12
12
|
export { ExportManager } from './ExportManager.js';
|
|
13
13
|
export { CardGeneratorBase } from './CardGeneratorBase.js';
|
|
14
14
|
export { TradingCardManager } from './TradingCardManager.js';
|
|
15
|
+
|
|
16
|
+
// Shader & package exporters
|
|
17
|
+
export { ShaderExporter } from './ShaderExporter.js';
|
|
18
|
+
export { VIB3PackageExporter, VIB3_PACKAGE_VERSION, createVIB3Package } from './VIB3PackageExporter.js';
|
|
19
|
+
export { TradingCardGenerator } from './TradingCardGenerator.js';
|
|
20
|
+
|
|
21
|
+
// Per-system card generators
|
|
22
|
+
export { TradingCardSystemFaceted } from './systems/TradingCardSystemFaceted.js';
|
|
23
|
+
export { TradingCardSystemHolographic } from './systems/TradingCardSystemHolographic.js';
|
|
24
|
+
export { TradingCardSystemQuantum } from './systems/TradingCardSystemQuantum.js';
|
|
@@ -634,15 +634,19 @@ export class FacetedSystem {
|
|
|
634
634
|
return false;
|
|
635
635
|
}
|
|
636
636
|
|
|
637
|
-
async initialize() {
|
|
637
|
+
async initialize(options = {}) {
|
|
638
638
|
if (this.initialized) return true;
|
|
639
|
-
const canvas =
|
|
639
|
+
const canvas = options.canvas ||
|
|
640
|
+
document.getElementById('faceted-content-canvas') ||
|
|
640
641
|
document.getElementById('content-canvas');
|
|
641
642
|
if (!canvas) {
|
|
642
643
|
console.warn("FacetedSystem: No canvas found for initialize()");
|
|
643
644
|
return false;
|
|
644
645
|
}
|
|
645
|
-
return this.initWithBridge(canvas, {
|
|
646
|
+
return this.initWithBridge(canvas, {
|
|
647
|
+
preferWebGPU: options.preferWebGPU !== undefined ? options.preferWebGPU : true,
|
|
648
|
+
debug: options.debug || false
|
|
649
|
+
});
|
|
646
650
|
}
|
|
647
651
|
|
|
648
652
|
// ─── Parameters ───
|
|
@@ -775,7 +779,7 @@ export class FacetedSystem {
|
|
|
775
779
|
if (layer) layer.style.display = active ? 'block' : 'none';
|
|
776
780
|
}
|
|
777
781
|
|
|
778
|
-
init(context) { return this.initialize(); }
|
|
782
|
+
init(context = {}) { return this.initialize(context); }
|
|
779
783
|
|
|
780
784
|
resize(width, height, pixelRatio = 1) {
|
|
781
785
|
const w = Math.floor(width * pixelRatio);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { HolographicVisualizer } from './HolographicVisualizer.js';
|
|
7
7
|
import { MultiCanvasBridge } from '../render/MultiCanvasBridge.js';
|
|
8
|
+
import { LayerRelationshipGraph } from '../render/LayerRelationshipGraph.js';
|
|
8
9
|
import { shaderLoader } from '../render/ShaderLoader.js';
|
|
9
10
|
|
|
10
11
|
export class RealHolographicSystem {
|
|
@@ -32,6 +33,12 @@ export class RealHolographicSystem {
|
|
|
32
33
|
/** @type {number} time accumulator for bridge rendering (ms) */
|
|
33
34
|
this._bridgeTime = 0;
|
|
34
35
|
|
|
36
|
+
// Layer relationship graph — keystone-driven inter-layer parameter system
|
|
37
|
+
/** @type {LayerRelationshipGraph} */
|
|
38
|
+
this._layerGraph = new LayerRelationshipGraph({
|
|
39
|
+
profile: options.relationshipProfile || 'holographic'
|
|
40
|
+
});
|
|
41
|
+
|
|
35
42
|
// Conditional reactivity: Use built-in only if ReactivityManager not active
|
|
36
43
|
this.useBuiltInReactivity = !window.reactivityManager;
|
|
37
44
|
|
|
@@ -220,7 +227,11 @@ export class RealHolographicSystem {
|
|
|
220
227
|
if (Object.keys(canvasMap).length === 0) return null;
|
|
221
228
|
|
|
222
229
|
const bridge = new MultiCanvasBridge();
|
|
223
|
-
await bridge.initialize({
|
|
230
|
+
await bridge.initialize({
|
|
231
|
+
canvases: canvasMap,
|
|
232
|
+
preferWebGPU: options.preferWebGPU !== false,
|
|
233
|
+
relationshipGraph: this._layerGraph
|
|
234
|
+
});
|
|
224
235
|
|
|
225
236
|
// Load external shader files, fall back to inline if unavailable
|
|
226
237
|
let sources = {
|
|
@@ -369,48 +380,130 @@ export class RealHolographicSystem {
|
|
|
369
380
|
}
|
|
370
381
|
|
|
371
382
|
updateParameter(param, value) {
|
|
372
|
-
// Store custom parameter overrides
|
|
383
|
+
// Store custom parameter overrides (keystone state)
|
|
373
384
|
if (!this.customParams) {
|
|
374
385
|
this.customParams = {};
|
|
375
386
|
}
|
|
376
387
|
this.customParams[param] = value;
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
388
|
+
|
|
389
|
+
// Build keystone params from current state + this update
|
|
390
|
+
const keystoneParams = { ...this._buildKeystoneParams(), [param]: value };
|
|
391
|
+
|
|
392
|
+
// Resolve all layers through the relationship graph
|
|
393
|
+
const resolved = this._layerGraph.resolveAll(keystoneParams, Date.now());
|
|
394
|
+
|
|
395
|
+
// Apply resolved params to each visualizer by role
|
|
381
396
|
this.visualizers.forEach((visualizer, index) => {
|
|
397
|
+
const role = visualizer.role || 'content';
|
|
398
|
+
const layerParams = resolved[role] || keystoneParams;
|
|
399
|
+
|
|
382
400
|
try {
|
|
383
401
|
if (visualizer.updateParameters) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
} else {
|
|
390
|
-
console.warn(`⚠️ Holographic layer ${index} missing updateParameters method, using fallback`);
|
|
391
|
-
// Fallback for older method (direct parameter setting)
|
|
392
|
-
if (visualizer.variantParams) {
|
|
393
|
-
visualizer.variantParams[param] = value;
|
|
394
|
-
|
|
395
|
-
// If it's a geometry type change, regenerate role params with new geometry
|
|
396
|
-
if (param === 'geometryType') {
|
|
397
|
-
visualizer.roleParams = visualizer.generateRoleParams(visualizer.role);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// Force manual render for older visualizers
|
|
401
|
-
if (visualizer.render) {
|
|
402
|
-
visualizer.render();
|
|
403
|
-
}
|
|
402
|
+
visualizer.updateParameters(layerParams);
|
|
403
|
+
} else if (visualizer.variantParams) {
|
|
404
|
+
Object.assign(visualizer.variantParams, layerParams);
|
|
405
|
+
if (param === 'geometryType' || param === 'geometry') {
|
|
406
|
+
visualizer.roleParams = visualizer.generateRoleParams(role);
|
|
404
407
|
}
|
|
405
408
|
}
|
|
406
409
|
} catch (error) {
|
|
407
|
-
console.error(
|
|
410
|
+
console.error(`Failed to update holographic layer ${index} (${role}):`, error);
|
|
408
411
|
}
|
|
409
412
|
});
|
|
410
|
-
|
|
411
|
-
console.log(`🔄 Holographic parameter update complete: ${param}=${value}`);
|
|
412
413
|
}
|
|
413
|
-
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Update multiple parameters at once (RendererContract / VIB3Engine compatible).
|
|
417
|
+
* Resolves all layers through the relationship graph in a single pass.
|
|
418
|
+
* @param {Object} params - Key-value pairs of parameters to update
|
|
419
|
+
*/
|
|
420
|
+
updateParameters(params) {
|
|
421
|
+
if (!params || typeof params !== 'object') return;
|
|
422
|
+
|
|
423
|
+
// Merge into custom params (keystone state)
|
|
424
|
+
if (!this.customParams) {
|
|
425
|
+
this.customParams = {};
|
|
426
|
+
}
|
|
427
|
+
Object.assign(this.customParams, params);
|
|
428
|
+
|
|
429
|
+
// Build keystone params + resolve all layers in one shot
|
|
430
|
+
const keystoneParams = { ...this._buildKeystoneParams(), ...params };
|
|
431
|
+
const resolved = this._layerGraph.resolveAll(keystoneParams, Date.now());
|
|
432
|
+
|
|
433
|
+
this.visualizers.forEach((visualizer, index) => {
|
|
434
|
+
const role = visualizer.role || 'content';
|
|
435
|
+
const layerParams = resolved[role] || keystoneParams;
|
|
436
|
+
|
|
437
|
+
try {
|
|
438
|
+
if (visualizer.updateParameters) {
|
|
439
|
+
visualizer.updateParameters(layerParams);
|
|
440
|
+
} else if (visualizer.variantParams) {
|
|
441
|
+
Object.assign(visualizer.variantParams, layerParams);
|
|
442
|
+
}
|
|
443
|
+
} catch (error) {
|
|
444
|
+
console.error(`Failed to update holographic layer ${index} (${role}):`, error);
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// ========================================================================
|
|
450
|
+
// Layer Relationship Graph API
|
|
451
|
+
// ========================================================================
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Build keystone parameters from current state.
|
|
455
|
+
* These are the driver values that get transformed by the relationship
|
|
456
|
+
* graph to produce each dependent layer's parameters.
|
|
457
|
+
* @private
|
|
458
|
+
* @returns {Object}
|
|
459
|
+
*/
|
|
460
|
+
_buildKeystoneParams() {
|
|
461
|
+
const base = {};
|
|
462
|
+
// Pull from first (content) visualizer's variant params if available
|
|
463
|
+
const content = this.visualizers.find(v => v.role === 'content');
|
|
464
|
+
if (content && content.variantParams) {
|
|
465
|
+
Object.assign(base, content.variantParams);
|
|
466
|
+
}
|
|
467
|
+
// Merge custom overrides
|
|
468
|
+
if (this.customParams) {
|
|
469
|
+
Object.assign(base, this.customParams);
|
|
470
|
+
}
|
|
471
|
+
return base;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Get the layer relationship graph for direct configuration.
|
|
476
|
+
* @returns {LayerRelationshipGraph}
|
|
477
|
+
*/
|
|
478
|
+
get layerGraph() {
|
|
479
|
+
return this._layerGraph;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Load a relationship profile by name.
|
|
484
|
+
* @param {string} profileName - holographic, symmetry, chord, storm, legacy
|
|
485
|
+
*/
|
|
486
|
+
loadRelationshipProfile(profileName) {
|
|
487
|
+
this._layerGraph.loadProfile(profileName);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Set the keystone (driver) layer.
|
|
492
|
+
* @param {string} layerName - background, shadow, content, highlight, or accent
|
|
493
|
+
*/
|
|
494
|
+
setKeystone(layerName) {
|
|
495
|
+
this._layerGraph.setKeystone(layerName);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Set the relationship for a dependent layer.
|
|
500
|
+
* @param {string} layerName
|
|
501
|
+
* @param {string|Function|Object} relationship - Preset name, function, or { preset, config }
|
|
502
|
+
*/
|
|
503
|
+
setLayerRelationship(layerName, relationship) {
|
|
504
|
+
this._layerGraph.setRelationship(layerName, relationship);
|
|
505
|
+
}
|
|
506
|
+
|
|
414
507
|
// Override updateVariant to preserve custom parameters
|
|
415
508
|
updateVariant(newVariant) {
|
|
416
509
|
if (newVariant < 0) newVariant = this.totalVariants - 1;
|
|
@@ -469,7 +562,9 @@ export class RealHolographicSystem {
|
|
|
469
562
|
Object.assign(params, this.customParams);
|
|
470
563
|
}
|
|
471
564
|
|
|
472
|
-
|
|
565
|
+
// Include layer relationship graph config for serialization
|
|
566
|
+
params.layerRelationship = this._layerGraph.exportConfig();
|
|
567
|
+
|
|
473
568
|
return params;
|
|
474
569
|
}
|
|
475
570
|
|
package/src/math/index.js
CHANGED
|
@@ -59,10 +59,10 @@ export {
|
|
|
59
59
|
clamp, lerp, smoothstep, smootherstep
|
|
60
60
|
} from './constants.js';
|
|
61
61
|
|
|
62
|
-
// Default export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
62
|
+
// Default export — uses the static imports already declared above
|
|
63
|
+
import { Vec4 as _Vec4 } from './Vec4.js';
|
|
64
|
+
import { Rotor4D as _Rotor4D } from './Rotor4D.js';
|
|
65
|
+
import { Mat4x4 as _Mat4x4 } from './Mat4x4.js';
|
|
66
|
+
import { Projection as _Projection } from './Projection.js';
|
|
67
|
+
|
|
68
|
+
export default { Vec4: _Vec4, Rotor4D: _Rotor4D, Mat4x4: _Mat4x4, Projection: _Projection };
|
package/src/reactivity/index.js
CHANGED
|
@@ -23,10 +23,11 @@ export { ReactivityManager } from './ReactivityManager.js';
|
|
|
23
23
|
/**
|
|
24
24
|
* Create a pre-configured ReactivityManager with common settings
|
|
25
25
|
*/
|
|
26
|
-
export function createReactivityManager(options = {}) {
|
|
26
|
+
export async function createReactivityManager(options = {}) {
|
|
27
27
|
const { config, parameterUpdateFn } = options;
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const { ReactivityManager } = await import('./ReactivityManager.js');
|
|
30
|
+
const manager = new ReactivityManager(parameterUpdateFn);
|
|
30
31
|
|
|
31
32
|
if (config) {
|
|
32
33
|
manager.loadConfig(config);
|
|
@@ -39,7 +40,6 @@ export function createReactivityManager(options = {}) {
|
|
|
39
40
|
* Create ReactivityConfig from a preset name
|
|
40
41
|
*/
|
|
41
42
|
export function createPresetConfig(presetName) {
|
|
42
|
-
const { ReactivityConfig } = require('./ReactivityConfig.js');
|
|
43
43
|
const config = new ReactivityConfig();
|
|
44
44
|
|
|
45
45
|
switch (presetName) {
|
|
@@ -89,5 +89,3 @@ export function createPresetConfig(presetName) {
|
|
|
89
89
|
|
|
90
90
|
return config;
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
console.log('🎛️ VIB3+ Reactivity System loaded');
|