@vib3code/sdk 2.0.1
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/CHANGELOG.md +118 -0
- package/DOCS/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +34 -0
- package/DOCS/CI_TESTING.md +38 -0
- package/DOCS/CLI_ONBOARDING.md +75 -0
- package/DOCS/CONTROL_REFERENCE.md +64 -0
- package/DOCS/DEV_TRACK_ANALYSIS.md +77 -0
- package/DOCS/DEV_TRACK_PLAN_2026-01-07.md +42 -0
- package/DOCS/DEV_TRACK_SESSION_2026-01-31.md +220 -0
- package/DOCS/ENV_SETUP.md +189 -0
- package/DOCS/EXPORT_FORMATS.md +417 -0
- package/DOCS/GPU_DISPOSAL_GUIDE.md +21 -0
- package/DOCS/LICENSING_TIERS.md +275 -0
- package/DOCS/MASTER_PLAN_2026-01-31.md +570 -0
- package/DOCS/OBS_SETUP_GUIDE.md +98 -0
- package/DOCS/PROJECT_SETUP.md +66 -0
- package/DOCS/RENDERER_LIFECYCLE.md +40 -0
- package/DOCS/REPO_MANIFEST.md +121 -0
- package/DOCS/SESSION_014_PLAN.md +195 -0
- package/DOCS/SESSION_LOG_2026-01-07.md +56 -0
- package/DOCS/STRATEGIC_BLUEPRINT_2026-01-07.md +72 -0
- package/DOCS/SYSTEM_AUDIT_2026-01-30.md +738 -0
- package/DOCS/SYSTEM_INVENTORY.md +520 -0
- package/DOCS/TELEMETRY_EXPORTS.md +34 -0
- package/DOCS/WEBGPU_STATUS.md +38 -0
- package/DOCS/XR_BENCHMARKS.md +608 -0
- package/LICENSE +21 -0
- package/README.md +426 -0
- package/docs/.nojekyll +0 -0
- package/docs/01-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/02-hyperspatial_ego_death.html +346 -0
- package/docs/03-post_cartesian_sublime.html +346 -0
- package/docs/04-crystalline_void_meditation.html +346 -0
- package/docs/05-quantum_decoherence_ballet.html +346 -0
- package/docs/06-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/07-hyperspatial_ego_death.html +346 -0
- package/docs/08-post_cartesian_sublime.html +346 -0
- package/docs/09-crystalline_void_meditation.html +346 -0
- package/docs/10-quantum_decoherence_ballet.html +346 -0
- package/docs/11-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/12-hyperspatial_ego_death.html +346 -0
- package/docs/13-post_cartesian_sublime.html +346 -0
- package/docs/index.html +794 -0
- package/docs/test-hub.html +441 -0
- package/docs/url-state.js +102 -0
- package/docs/vib3-exports/01-quantum-quantum-tetrahedron-lattice.html +489 -0
- package/docs/vib3-exports/02-quantum-quantum-hypersphere-matrix.html +489 -0
- package/docs/vib3-exports/03-quantum-quantum-hypertetra-fractal.html +489 -0
- package/docs/vib3-exports/04-faceted-faceted-crystal-structure.html +407 -0
- package/docs/vib3-exports/05-faceted-faceted-klein-bottle.html +407 -0
- package/docs/vib3-exports/06-faceted-faceted-hypertetra-torus.html +407 -0
- package/docs/vib3-exports/07-holographic-holographic-wave-field.html +457 -0
- package/docs/vib3-exports/08-holographic-holographic-hypersphere-sphere.html +457 -0
- package/docs/vib3-exports/09-holographic-holographic-hypertetra-crystal.html +457 -0
- package/docs/vib3-exports/index.html +238 -0
- package/docs/webgpu-live.html +702 -0
- package/package.json +367 -0
- package/src/advanced/AIPresetGenerator.js +777 -0
- package/src/advanced/MIDIController.js +703 -0
- package/src/advanced/OffscreenWorker.js +1051 -0
- package/src/advanced/WebGPUCompute.js +1051 -0
- package/src/advanced/WebXRRenderer.js +680 -0
- package/src/agent/cli/AgentCLI.js +615 -0
- package/src/agent/cli/index.js +14 -0
- package/src/agent/index.js +73 -0
- package/src/agent/mcp/MCPServer.js +950 -0
- package/src/agent/mcp/index.js +9 -0
- package/src/agent/mcp/tools.js +548 -0
- package/src/agent/telemetry/EventStream.js +669 -0
- package/src/agent/telemetry/Instrumentation.js +618 -0
- package/src/agent/telemetry/TelemetryExporters.js +427 -0
- package/src/agent/telemetry/TelemetryService.js +464 -0
- package/src/agent/telemetry/index.js +52 -0
- package/src/benchmarks/BenchmarkRunner.js +381 -0
- package/src/benchmarks/MetricsCollector.js +299 -0
- package/src/benchmarks/index.js +9 -0
- package/src/benchmarks/scenes.js +259 -0
- package/src/cli/index.js +675 -0
- package/src/config/ApiConfig.js +88 -0
- package/src/core/CanvasManager.js +217 -0
- package/src/core/ErrorReporter.js +117 -0
- package/src/core/ParameterMapper.js +333 -0
- package/src/core/Parameters.js +396 -0
- package/src/core/RendererContracts.js +200 -0
- package/src/core/UnifiedResourceManager.js +370 -0
- package/src/core/VIB3Engine.js +636 -0
- package/src/core/renderers/FacetedRendererAdapter.js +32 -0
- package/src/core/renderers/HolographicRendererAdapter.js +29 -0
- package/src/core/renderers/QuantumRendererAdapter.js +29 -0
- package/src/core/renderers/RendererLifecycleManager.js +63 -0
- package/src/creative/ColorPresetsSystem.js +980 -0
- package/src/creative/ParameterTimeline.js +1061 -0
- package/src/creative/PostProcessingPipeline.js +1113 -0
- package/src/creative/TransitionAnimator.js +683 -0
- package/src/export/CSSExporter.js +226 -0
- package/src/export/CardGeneratorBase.js +279 -0
- package/src/export/ExportManager.js +580 -0
- package/src/export/FacetedCardGenerator.js +279 -0
- package/src/export/HolographicCardGenerator.js +543 -0
- package/src/export/LottieExporter.js +552 -0
- package/src/export/QuantumCardGenerator.js +315 -0
- package/src/export/SVGExporter.js +519 -0
- package/src/export/ShaderExporter.js +903 -0
- package/src/export/TradingCardGenerator.js +3055 -0
- package/src/export/TradingCardManager.js +181 -0
- package/src/export/VIB3PackageExporter.js +559 -0
- package/src/export/index.js +14 -0
- package/src/export/systems/TradingCardSystemFaceted.js +494 -0
- package/src/export/systems/TradingCardSystemHolographic.js +452 -0
- package/src/export/systems/TradingCardSystemQuantum.js +411 -0
- package/src/faceted/FacetedSystem.js +963 -0
- package/src/features/CollectionManager.js +433 -0
- package/src/gallery/CollectionManager.js +240 -0
- package/src/gallery/GallerySystem.js +485 -0
- package/src/geometry/GeometryFactory.js +314 -0
- package/src/geometry/GeometryLibrary.js +72 -0
- package/src/geometry/buffers/BufferBuilder.js +338 -0
- package/src/geometry/buffers/index.js +18 -0
- package/src/geometry/generators/Crystal.js +420 -0
- package/src/geometry/generators/Fractal.js +298 -0
- package/src/geometry/generators/KleinBottle.js +197 -0
- package/src/geometry/generators/Sphere.js +192 -0
- package/src/geometry/generators/Tesseract.js +160 -0
- package/src/geometry/generators/Tetrahedron.js +225 -0
- package/src/geometry/generators/Torus.js +304 -0
- package/src/geometry/generators/Wave.js +341 -0
- package/src/geometry/index.js +142 -0
- package/src/geometry/warp/HypersphereCore.js +211 -0
- package/src/geometry/warp/HypertetraCore.js +386 -0
- package/src/geometry/warp/index.js +57 -0
- package/src/holograms/HolographicVisualizer.js +1073 -0
- package/src/holograms/RealHolographicSystem.js +966 -0
- package/src/holograms/variantRegistry.js +69 -0
- package/src/integrations/FigmaPlugin.js +854 -0
- package/src/integrations/OBSMode.js +754 -0
- package/src/integrations/ThreeJsPackage.js +660 -0
- package/src/integrations/TouchDesignerExport.js +552 -0
- package/src/integrations/frameworks/Vib3React.js +591 -0
- package/src/integrations/frameworks/Vib3Svelte.js +654 -0
- package/src/integrations/frameworks/Vib3Vue.js +628 -0
- package/src/llm/LLMParameterInterface.js +240 -0
- package/src/llm/LLMParameterUI.js +577 -0
- package/src/math/Mat4x4.js +708 -0
- package/src/math/Projection.js +341 -0
- package/src/math/Rotor4D.js +637 -0
- package/src/math/Vec4.js +476 -0
- package/src/math/constants.js +164 -0
- package/src/math/index.js +68 -0
- package/src/math/projections.js +54 -0
- package/src/math/rotations.js +196 -0
- package/src/quantum/QuantumEngine.js +906 -0
- package/src/quantum/QuantumVisualizer.js +1103 -0
- package/src/reactivity/ReactivityConfig.js +499 -0
- package/src/reactivity/ReactivityManager.js +586 -0
- package/src/reactivity/SpatialInputSystem.js +1783 -0
- package/src/reactivity/index.js +93 -0
- package/src/render/CommandBuffer.js +465 -0
- package/src/render/MultiCanvasBridge.js +340 -0
- package/src/render/RenderCommand.js +514 -0
- package/src/render/RenderResourceRegistry.js +523 -0
- package/src/render/RenderState.js +552 -0
- package/src/render/RenderTarget.js +512 -0
- package/src/render/ShaderLoader.js +253 -0
- package/src/render/ShaderProgram.js +599 -0
- package/src/render/UnifiedRenderBridge.js +496 -0
- package/src/render/backends/WebGLBackend.js +1108 -0
- package/src/render/backends/WebGPUBackend.js +1409 -0
- package/src/render/commands/CommandBufferExecutor.js +607 -0
- package/src/render/commands/RenderCommandBuffer.js +661 -0
- package/src/render/commands/index.js +17 -0
- package/src/render/index.js +367 -0
- package/src/scene/Disposable.js +498 -0
- package/src/scene/MemoryPool.js +618 -0
- package/src/scene/Node4D.js +697 -0
- package/src/scene/ResourceManager.js +599 -0
- package/src/scene/Scene4D.js +540 -0
- package/src/scene/index.js +98 -0
- package/src/schemas/error.schema.json +84 -0
- package/src/schemas/extension.schema.json +88 -0
- package/src/schemas/index.js +214 -0
- package/src/schemas/parameters.schema.json +142 -0
- package/src/schemas/tool-pack.schema.json +44 -0
- package/src/schemas/tool-response.schema.json +127 -0
- package/src/shaders/common/fullscreen.vert.glsl +5 -0
- package/src/shaders/common/fullscreen.vert.wgsl +17 -0
- package/src/shaders/common/geometry24.glsl +65 -0
- package/src/shaders/common/geometry24.wgsl +54 -0
- package/src/shaders/common/rotation4d.glsl +85 -0
- package/src/shaders/common/rotation4d.wgsl +86 -0
- package/src/shaders/common/uniforms.glsl +44 -0
- package/src/shaders/common/uniforms.wgsl +48 -0
- package/src/shaders/faceted/faceted.frag.glsl +129 -0
- package/src/shaders/faceted/faceted.frag.wgsl +164 -0
- package/src/shaders/holographic/holographic.frag.glsl +406 -0
- package/src/shaders/holographic/holographic.frag.wgsl +185 -0
- package/src/shaders/quantum/quantum.frag.glsl +513 -0
- package/src/shaders/quantum/quantum.frag.wgsl +361 -0
- package/src/testing/ParallelTestFramework.js +519 -0
- package/src/testing/__snapshots__/exportFormats.test.js.snap +24 -0
- package/src/testing/exportFormats.test.js +8 -0
- package/src/testing/projections.test.js +14 -0
- package/src/testing/rotations.test.js +37 -0
- package/src/ui/InteractivityMenu.js +516 -0
- package/src/ui/StatusManager.js +96 -0
- package/src/ui/adaptive/renderers/webgpu/BufferLayout.ts +252 -0
- package/src/ui/adaptive/renderers/webgpu/PolytopeInstanceBuffer.ts +144 -0
- package/src/ui/adaptive/renderers/webgpu/TripleBufferedUniform.ts +170 -0
- package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +735 -0
- package/src/ui/adaptive/renderers/webgpu/index.ts +112 -0
- package/src/variations/VariationManager.js +431 -0
- package/src/viewer/AudioReactivity.js +505 -0
- package/src/viewer/CardBending.js +481 -0
- package/src/viewer/GalleryUI.js +832 -0
- package/src/viewer/ReactivityManager.js +590 -0
- package/src/viewer/TradingCardExporter.js +600 -0
- package/src/viewer/ViewerPortal.js +374 -0
- package/src/viewer/index.js +12 -0
- package/src/wasm/WasmLoader.js +296 -0
- package/src/wasm/index.js +132 -0
- package/tools/agentic/mcpTools.js +88 -0
- package/tools/cli/agent-cli.js +92 -0
- package/tools/export/formats.js +24 -0
- package/tools/math/rotation-baseline.mjs +64 -0
- package/tools/shader-sync-verify.js +937 -0
- package/tools/telemetry/manifestPipeline.js +141 -0
- package/tools/telemetry/telemetryEvents.js +35 -0
- package/types/adaptive-sdk.d.ts +185 -0
- package/types/advanced/AIPresetGenerator.d.ts +81 -0
- package/types/advanced/MIDIController.d.ts +100 -0
- package/types/advanced/OffscreenWorker.d.ts +82 -0
- package/types/advanced/WebGPUCompute.d.ts +52 -0
- package/types/advanced/WebXRRenderer.d.ts +77 -0
- package/types/advanced/index.d.ts +46 -0
- package/types/core/ErrorReporter.d.ts +50 -0
- package/types/core/VIB3Engine.d.ts +204 -0
- package/types/creative/ColorPresetsSystem.d.ts +91 -0
- package/types/creative/ParameterTimeline.d.ts +74 -0
- package/types/creative/PostProcessingPipeline.d.ts +109 -0
- package/types/creative/TransitionAnimator.d.ts +71 -0
- package/types/creative/index.d.ts +35 -0
- package/types/integrations/FigmaPlugin.d.ts +46 -0
- package/types/integrations/OBSMode.d.ts +74 -0
- package/types/integrations/ThreeJsPackage.d.ts +62 -0
- package/types/integrations/TouchDesignerExport.d.ts +36 -0
- package/types/integrations/Vib3React.d.ts +74 -0
- package/types/integrations/Vib3Svelte.d.ts +63 -0
- package/types/integrations/Vib3Vue.d.ts +55 -0
- package/types/integrations/index.d.ts +52 -0
- package/types/reactivity/SpatialInputSystem.d.ts +173 -0
- package/types/reactivity/index.d.ts +394 -0
- package/types/render/CommandBuffer.d.ts +169 -0
- package/types/render/RenderCommand.d.ts +312 -0
- package/types/render/RenderState.d.ts +279 -0
- package/types/render/RenderTarget.d.ts +254 -0
- package/types/render/ShaderProgram.d.ts +277 -0
- package/types/render/UnifiedRenderBridge.d.ts +143 -0
- package/types/render/WebGLBackend.d.ts +168 -0
- package/types/render/WebGPUBackend.d.ts +186 -0
- package/types/render/index.d.ts +141 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "extension.schema.json",
|
|
4
|
+
"title": "VIB3+ Extension Manifest",
|
|
5
|
+
"description": "Manifest describing VIB3 extensions for partner marketplace distribution.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"manifest_version": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Manifest schema version (semver)."
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
15
|
+
"description": "Stable extension identifier."
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"version": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Extension version (semver)."
|
|
23
|
+
},
|
|
24
|
+
"vendor": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"name": { "type": "string" },
|
|
28
|
+
"url": { "type": "string", "format": "uri" },
|
|
29
|
+
"support_email": { "type": "string", "format": "email" }
|
|
30
|
+
},
|
|
31
|
+
"required": ["name"]
|
|
32
|
+
},
|
|
33
|
+
"capabilities": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"renderers": { "type": "boolean", "default": false },
|
|
37
|
+
"geometry": { "type": "boolean", "default": false },
|
|
38
|
+
"ui": { "type": "boolean", "default": false },
|
|
39
|
+
"agent_tools": { "type": "boolean", "default": false },
|
|
40
|
+
"telemetry": { "type": "boolean", "default": false }
|
|
41
|
+
},
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
},
|
|
44
|
+
"entrypoints": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"runtime": { "type": "string" },
|
|
48
|
+
"ui": { "type": "string" },
|
|
49
|
+
"toolpack": { "type": "string" }
|
|
50
|
+
},
|
|
51
|
+
"required": ["runtime"],
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
},
|
|
54
|
+
"compatibility": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"core_version": { "type": "string" },
|
|
58
|
+
"renderer_contract": { "type": "string" },
|
|
59
|
+
"feature_flags": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": { "type": "string" }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"required": ["core_version"]
|
|
65
|
+
},
|
|
66
|
+
"marketplace": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"properties": {
|
|
69
|
+
"title": { "type": "string" },
|
|
70
|
+
"summary": { "type": "string" },
|
|
71
|
+
"categories": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": { "type": "string" }
|
|
74
|
+
},
|
|
75
|
+
"tags": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": { "type": "string" }
|
|
78
|
+
},
|
|
79
|
+
"preview_images": {
|
|
80
|
+
"type": "array",
|
|
81
|
+
"items": { "type": "string" }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": ["manifest_version", "id", "name", "version", "vendor", "capabilities", "entrypoints", "compatibility"],
|
|
87
|
+
"additionalProperties": false
|
|
88
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB3+ Schema Registry
|
|
3
|
+
* Centralized schema loading with AJV validation
|
|
4
|
+
*
|
|
5
|
+
* NOTE: Using dynamic imports with 'with' syntax for Node.js 22+ compatibility.
|
|
6
|
+
* The 'assert' syntax was deprecated in favor of 'with' in Node.js 22.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Ajv from 'ajv';
|
|
10
|
+
import addFormats from 'ajv-formats';
|
|
11
|
+
import { createRequire } from 'module';
|
|
12
|
+
|
|
13
|
+
// Use createRequire for JSON imports (works in all Node.js versions)
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
|
|
16
|
+
// Import schemas using require (Node.js compatible)
|
|
17
|
+
const parametersSchema = require('./parameters.schema.json');
|
|
18
|
+
const toolResponseSchema = require('./tool-response.schema.json');
|
|
19
|
+
const errorSchema = require('./error.schema.json');
|
|
20
|
+
const extensionSchema = require('./extension.schema.json');
|
|
21
|
+
const toolPackSchema = require('./tool-pack.schema.json');
|
|
22
|
+
|
|
23
|
+
class SchemaRegistry {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.ajv = new Ajv({
|
|
26
|
+
allErrors: true,
|
|
27
|
+
verbose: true,
|
|
28
|
+
strict: false
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Add format validators
|
|
32
|
+
try {
|
|
33
|
+
addFormats(this.ajv);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// addFormats may not be available in all environments
|
|
36
|
+
console.warn('ajv-formats not available, some format validations disabled');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Register schemas
|
|
40
|
+
this.schemas = {
|
|
41
|
+
parameters: parametersSchema,
|
|
42
|
+
toolResponse: toolResponseSchema,
|
|
43
|
+
error: errorSchema,
|
|
44
|
+
extension: extensionSchema,
|
|
45
|
+
toolPack: toolPackSchema
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Add all schemas to AJV first (required for $ref resolution)
|
|
49
|
+
// Error schema must be added before tool-response which refs it
|
|
50
|
+
this.ajv.addSchema(errorSchema, 'error.schema.json');
|
|
51
|
+
this.ajv.addSchema(parametersSchema, 'parameters.schema.json');
|
|
52
|
+
this.ajv.addSchema(extensionSchema, 'extension.schema.json');
|
|
53
|
+
this.ajv.addSchema(toolPackSchema, 'tool-pack.schema.json');
|
|
54
|
+
|
|
55
|
+
// Now compile validators (refs will resolve)
|
|
56
|
+
this.validators = {};
|
|
57
|
+
try {
|
|
58
|
+
this.validators.error = this.ajv.compile(errorSchema);
|
|
59
|
+
this.validators.parameters = this.ajv.compile(parametersSchema);
|
|
60
|
+
this.validators.extension = this.ajv.compile(extensionSchema);
|
|
61
|
+
this.validators.toolPack = this.ajv.compile(toolPackSchema);
|
|
62
|
+
this.validators.toolResponse = this.ajv.compile(toolResponseSchema);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
console.error('Schema compilation error:', e.message);
|
|
65
|
+
// Provide stub validators that always pass (graceful degradation)
|
|
66
|
+
for (const name of Object.keys(this.schemas)) {
|
|
67
|
+
if (!this.validators[name]) {
|
|
68
|
+
this.validators[name] = () => true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Validate data against a schema
|
|
76
|
+
* @param {string} schemaName - Name of the schema
|
|
77
|
+
* @param {object} data - Data to validate
|
|
78
|
+
* @returns {{ valid: boolean, errors: array|null }}
|
|
79
|
+
*/
|
|
80
|
+
validate(schemaName, data) {
|
|
81
|
+
const validator = this.validators[schemaName];
|
|
82
|
+
if (!validator) {
|
|
83
|
+
return {
|
|
84
|
+
valid: false,
|
|
85
|
+
errors: [{ message: `Unknown schema: ${schemaName}` }]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const valid = validator(data);
|
|
90
|
+
return {
|
|
91
|
+
valid,
|
|
92
|
+
errors: valid ? null : validator.errors
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Validate parameters and return normalized structure
|
|
98
|
+
* @param {object} params - Raw parameters
|
|
99
|
+
* @returns {{ valid: boolean, normalized: object|null, errors: array|null }}
|
|
100
|
+
*/
|
|
101
|
+
validateParameters(params) {
|
|
102
|
+
// Normalize flat parameter format to nested structure
|
|
103
|
+
const normalized = this.normalizeParameters(params);
|
|
104
|
+
const result = this.validate('parameters', normalized);
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
...result,
|
|
108
|
+
normalized: result.valid ? normalized : null
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Normalize flat parameters to nested schema structure
|
|
114
|
+
*/
|
|
115
|
+
normalizeParameters(params) {
|
|
116
|
+
return {
|
|
117
|
+
system: params.system || 'quantum',
|
|
118
|
+
variation: params.variation ?? 0,
|
|
119
|
+
geometry: params.geometry ?? 0,
|
|
120
|
+
rotation: {
|
|
121
|
+
XY: params.rot4dXY ?? params.rotation?.XY ?? 0,
|
|
122
|
+
XZ: params.rot4dXZ ?? params.rotation?.XZ ?? 0,
|
|
123
|
+
YZ: params.rot4dYZ ?? params.rotation?.YZ ?? 0,
|
|
124
|
+
XW: params.rot4dXW ?? params.rotation?.XW ?? 0,
|
|
125
|
+
YW: params.rot4dYW ?? params.rotation?.YW ?? 0,
|
|
126
|
+
ZW: params.rot4dZW ?? params.rotation?.ZW ?? 0
|
|
127
|
+
},
|
|
128
|
+
visual: {
|
|
129
|
+
dimension: params.dimension ?? params.visual?.dimension ?? 3.5,
|
|
130
|
+
gridDensity: params.gridDensity ?? params.visual?.gridDensity ?? 15,
|
|
131
|
+
morphFactor: params.morphFactor ?? params.visual?.morphFactor ?? 1.0,
|
|
132
|
+
chaos: params.chaos ?? params.visual?.chaos ?? 0.2,
|
|
133
|
+
speed: params.speed ?? params.visual?.speed ?? 1.0,
|
|
134
|
+
hue: params.hue ?? params.visual?.hue ?? 200,
|
|
135
|
+
intensity: params.intensity ?? params.visual?.intensity ?? 0.5,
|
|
136
|
+
saturation: params.saturation ?? params.visual?.saturation ?? 0.8
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Flatten normalized parameters back to engine format
|
|
143
|
+
*/
|
|
144
|
+
flattenParameters(normalized) {
|
|
145
|
+
return {
|
|
146
|
+
system: normalized.system,
|
|
147
|
+
variation: normalized.variation,
|
|
148
|
+
geometry: normalized.geometry,
|
|
149
|
+
rot4dXY: normalized.rotation.XY,
|
|
150
|
+
rot4dXZ: normalized.rotation.XZ,
|
|
151
|
+
rot4dYZ: normalized.rotation.YZ,
|
|
152
|
+
rot4dXW: normalized.rotation.XW,
|
|
153
|
+
rot4dYW: normalized.rotation.YW,
|
|
154
|
+
rot4dZW: normalized.rotation.ZW,
|
|
155
|
+
dimension: normalized.visual.dimension,
|
|
156
|
+
gridDensity: normalized.visual.gridDensity,
|
|
157
|
+
morphFactor: normalized.visual.morphFactor,
|
|
158
|
+
chaos: normalized.visual.chaos,
|
|
159
|
+
speed: normalized.visual.speed,
|
|
160
|
+
hue: normalized.visual.hue,
|
|
161
|
+
intensity: normalized.visual.intensity,
|
|
162
|
+
saturation: normalized.visual.saturation
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Create an actionable error response
|
|
168
|
+
*/
|
|
169
|
+
createError(type, code, message, details = {}) {
|
|
170
|
+
return {
|
|
171
|
+
error: {
|
|
172
|
+
type,
|
|
173
|
+
code,
|
|
174
|
+
message,
|
|
175
|
+
...details,
|
|
176
|
+
retry_possible: details.retry_possible ?? false
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Create a tool response
|
|
183
|
+
*/
|
|
184
|
+
createToolResponse(operation, data) {
|
|
185
|
+
return {
|
|
186
|
+
success: true,
|
|
187
|
+
operation,
|
|
188
|
+
timestamp: new Date().toISOString(),
|
|
189
|
+
...data
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Get schema for documentation/tooling
|
|
195
|
+
*/
|
|
196
|
+
getSchema(name) {
|
|
197
|
+
return this.schemas[name];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get all schemas for MCP tool registration
|
|
202
|
+
*/
|
|
203
|
+
getAllSchemas() {
|
|
204
|
+
return { ...this.schemas };
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Singleton instance
|
|
209
|
+
export const schemaRegistry = new SchemaRegistry();
|
|
210
|
+
|
|
211
|
+
// Named exports
|
|
212
|
+
export { parametersSchema, toolResponseSchema, errorSchema };
|
|
213
|
+
export { extensionSchema, toolPackSchema };
|
|
214
|
+
export default schemaRegistry;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "parameters.schema.json",
|
|
4
|
+
"title": "VIB3+ Parameter Schema",
|
|
5
|
+
"description": "Complete parameter schema for VIB3+ 4D visualization engine with 6-plane rotation support",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"system": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["quantum", "faceted", "holographic"],
|
|
11
|
+
"description": "Active visualization system",
|
|
12
|
+
"default": "quantum"
|
|
13
|
+
},
|
|
14
|
+
"variation": {
|
|
15
|
+
"type": "integer",
|
|
16
|
+
"minimum": 0,
|
|
17
|
+
"maximum": 99,
|
|
18
|
+
"description": "Variation slot (0-29 default, 30-99 custom)",
|
|
19
|
+
"default": 0
|
|
20
|
+
},
|
|
21
|
+
"geometry": {
|
|
22
|
+
"type": "integer",
|
|
23
|
+
"minimum": 0,
|
|
24
|
+
"maximum": 23,
|
|
25
|
+
"description": "Geometry index: 0-7 base, 8-15 hypersphere core, 16-23 hypertetrahedron core",
|
|
26
|
+
"default": 0
|
|
27
|
+
},
|
|
28
|
+
"rotation": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "6D rotation angles in radians",
|
|
31
|
+
"properties": {
|
|
32
|
+
"XY": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"minimum": -6.283185307,
|
|
35
|
+
"maximum": 6.283185307,
|
|
36
|
+
"description": "X-Y plane rotation (3D space)",
|
|
37
|
+
"default": 0
|
|
38
|
+
},
|
|
39
|
+
"XZ": {
|
|
40
|
+
"type": "number",
|
|
41
|
+
"minimum": -6.283185307,
|
|
42
|
+
"maximum": 6.283185307,
|
|
43
|
+
"description": "X-Z plane rotation (3D space)",
|
|
44
|
+
"default": 0
|
|
45
|
+
},
|
|
46
|
+
"YZ": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"minimum": -6.283185307,
|
|
49
|
+
"maximum": 6.283185307,
|
|
50
|
+
"description": "Y-Z plane rotation (3D space)",
|
|
51
|
+
"default": 0
|
|
52
|
+
},
|
|
53
|
+
"XW": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"minimum": -6.283185307,
|
|
56
|
+
"maximum": 6.283185307,
|
|
57
|
+
"description": "X-W plane rotation (4D hyperspace - inside-out effect)",
|
|
58
|
+
"default": 0
|
|
59
|
+
},
|
|
60
|
+
"YW": {
|
|
61
|
+
"type": "number",
|
|
62
|
+
"minimum": -6.283185307,
|
|
63
|
+
"maximum": 6.283185307,
|
|
64
|
+
"description": "Y-W plane rotation (4D hyperspace)",
|
|
65
|
+
"default": 0
|
|
66
|
+
},
|
|
67
|
+
"ZW": {
|
|
68
|
+
"type": "number",
|
|
69
|
+
"minimum": -6.283185307,
|
|
70
|
+
"maximum": 6.283185307,
|
|
71
|
+
"description": "Z-W plane rotation (4D hyperspace)",
|
|
72
|
+
"default": 0
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"additionalProperties": false
|
|
76
|
+
},
|
|
77
|
+
"visual": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"description": "Visual rendering parameters",
|
|
80
|
+
"properties": {
|
|
81
|
+
"dimension": {
|
|
82
|
+
"type": "number",
|
|
83
|
+
"minimum": 3.0,
|
|
84
|
+
"maximum": 4.5,
|
|
85
|
+
"description": "Dimensional interpolation level",
|
|
86
|
+
"default": 3.5
|
|
87
|
+
},
|
|
88
|
+
"gridDensity": {
|
|
89
|
+
"type": "number",
|
|
90
|
+
"minimum": 4,
|
|
91
|
+
"maximum": 100,
|
|
92
|
+
"description": "Geometric detail/grid density",
|
|
93
|
+
"default": 15
|
|
94
|
+
},
|
|
95
|
+
"morphFactor": {
|
|
96
|
+
"type": "number",
|
|
97
|
+
"minimum": 0,
|
|
98
|
+
"maximum": 2,
|
|
99
|
+
"description": "Shape transformation factor",
|
|
100
|
+
"default": 1.0
|
|
101
|
+
},
|
|
102
|
+
"chaos": {
|
|
103
|
+
"type": "number",
|
|
104
|
+
"minimum": 0,
|
|
105
|
+
"maximum": 1,
|
|
106
|
+
"description": "Randomization/turbulence level",
|
|
107
|
+
"default": 0.2
|
|
108
|
+
},
|
|
109
|
+
"speed": {
|
|
110
|
+
"type": "number",
|
|
111
|
+
"minimum": 0.1,
|
|
112
|
+
"maximum": 3,
|
|
113
|
+
"description": "Animation speed multiplier",
|
|
114
|
+
"default": 1.0
|
|
115
|
+
},
|
|
116
|
+
"hue": {
|
|
117
|
+
"type": "integer",
|
|
118
|
+
"minimum": 0,
|
|
119
|
+
"maximum": 360,
|
|
120
|
+
"description": "Base color hue in degrees",
|
|
121
|
+
"default": 200
|
|
122
|
+
},
|
|
123
|
+
"intensity": {
|
|
124
|
+
"type": "number",
|
|
125
|
+
"minimum": 0,
|
|
126
|
+
"maximum": 1,
|
|
127
|
+
"description": "Visual brightness/intensity",
|
|
128
|
+
"default": 0.5
|
|
129
|
+
},
|
|
130
|
+
"saturation": {
|
|
131
|
+
"type": "number",
|
|
132
|
+
"minimum": 0,
|
|
133
|
+
"maximum": 1,
|
|
134
|
+
"description": "Color saturation",
|
|
135
|
+
"default": 0.8
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "tool-pack.schema.json",
|
|
4
|
+
"title": "VIB3+ Tool Pack Manifest",
|
|
5
|
+
"description": "Tool pack manifest describing grouped MCP tools for partner platforms.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$"
|
|
11
|
+
},
|
|
12
|
+
"name": { "type": "string" },
|
|
13
|
+
"version": { "type": "string" },
|
|
14
|
+
"description": { "type": "string" },
|
|
15
|
+
"tools": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"name": { "type": "string" },
|
|
21
|
+
"description": { "type": "string" },
|
|
22
|
+
"schema_ref": { "type": "string" }
|
|
23
|
+
},
|
|
24
|
+
"required": ["name"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"capabilities": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": { "type": "string" }
|
|
30
|
+
},
|
|
31
|
+
"marketplace": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"listing_id": { "type": "string" },
|
|
35
|
+
"categories": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": { "type": "string" }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": ["id", "name", "version", "tools"],
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "tool-response.schema.json",
|
|
4
|
+
"title": "VIB3+ Tool Response Schema",
|
|
5
|
+
"description": "Semantically rich response format for agentic API tools",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"success": {
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"description": "Whether the operation succeeded"
|
|
11
|
+
},
|
|
12
|
+
"operation": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The operation that was performed",
|
|
15
|
+
"enum": [
|
|
16
|
+
"create_visualization",
|
|
17
|
+
"set_parameters",
|
|
18
|
+
"get_state",
|
|
19
|
+
"render_preview",
|
|
20
|
+
"search_geometries",
|
|
21
|
+
"switch_system",
|
|
22
|
+
"randomize",
|
|
23
|
+
"reset",
|
|
24
|
+
"export_state",
|
|
25
|
+
"import_state",
|
|
26
|
+
"create_4d_visualization",
|
|
27
|
+
"set_rotation",
|
|
28
|
+
"set_visual_parameters",
|
|
29
|
+
"change_geometry",
|
|
30
|
+
"randomize_parameters",
|
|
31
|
+
"reset_parameters",
|
|
32
|
+
"save_to_gallery",
|
|
33
|
+
"load_from_gallery",
|
|
34
|
+
"get_parameter_schema",
|
|
35
|
+
"list_tools"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"scene_id": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"pattern": "^scene_[a-z0-9]+$",
|
|
41
|
+
"description": "Unique scene identifier"
|
|
42
|
+
},
|
|
43
|
+
"geometry": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"index": {
|
|
47
|
+
"type": "integer",
|
|
48
|
+
"minimum": 0,
|
|
49
|
+
"maximum": 23
|
|
50
|
+
},
|
|
51
|
+
"base_type": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"enum": ["tetrahedron", "hypercube", "sphere", "torus", "klein_bottle", "fractal", "wave", "crystal"]
|
|
54
|
+
},
|
|
55
|
+
"core_type": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"enum": ["base", "hypersphere", "hypertetrahedron"]
|
|
58
|
+
},
|
|
59
|
+
"vertex_count": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 4
|
|
62
|
+
},
|
|
63
|
+
"edge_count": {
|
|
64
|
+
"type": "integer",
|
|
65
|
+
"minimum": 0
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"rotation_state": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"XY": { "type": "number" },
|
|
73
|
+
"XZ": { "type": "number" },
|
|
74
|
+
"YZ": { "type": "number" },
|
|
75
|
+
"XW": { "type": "number" },
|
|
76
|
+
"YW": { "type": "number" },
|
|
77
|
+
"ZW": { "type": "number" }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"render_info": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"complexity": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"enum": ["low", "medium", "high", "very_high"]
|
|
86
|
+
},
|
|
87
|
+
"estimated_fps": {
|
|
88
|
+
"type": "integer",
|
|
89
|
+
"minimum": 1,
|
|
90
|
+
"maximum": 144
|
|
91
|
+
},
|
|
92
|
+
"gpu_memory_mb": {
|
|
93
|
+
"type": "number",
|
|
94
|
+
"minimum": 0
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"suggested_next_actions": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"items": {
|
|
101
|
+
"type": "string"
|
|
102
|
+
},
|
|
103
|
+
"description": "Contextually relevant actions the agent might take next"
|
|
104
|
+
},
|
|
105
|
+
"error": {
|
|
106
|
+
"$ref": "error.schema.json"
|
|
107
|
+
},
|
|
108
|
+
"timestamp": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"format": "date-time"
|
|
111
|
+
},
|
|
112
|
+
"duration_ms": {
|
|
113
|
+
"type": "number",
|
|
114
|
+
"minimum": 0,
|
|
115
|
+
"description": "Operation duration in milliseconds"
|
|
116
|
+
},
|
|
117
|
+
"validation_errors": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"items": {
|
|
120
|
+
"type": "object"
|
|
121
|
+
},
|
|
122
|
+
"description": "Schema validation errors, if any"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": ["success", "operation"],
|
|
126
|
+
"additionalProperties": true
|
|
127
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// VIB3+ Fullscreen Triangle Vertex Shader (WGSL)
|
|
2
|
+
// Uses the oversized triangle technique - no vertex buffer needed
|
|
3
|
+
|
|
4
|
+
struct VertexOutput {
|
|
5
|
+
@builtin(position) position: vec4<f32>,
|
|
6
|
+
@location(0) uv: vec2<f32>,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
@vertex
|
|
10
|
+
fn main(@builtin(vertex_index) vertexIndex: u32) -> VertexOutput {
|
|
11
|
+
var output: VertexOutput;
|
|
12
|
+
let x = f32(i32(vertexIndex & 1u) * 4 - 1);
|
|
13
|
+
let y = f32(i32(vertexIndex >> 1u) * 4 - 1);
|
|
14
|
+
output.position = vec4<f32>(x, y, 0.0, 1.0);
|
|
15
|
+
output.uv = vec2<f32>((x + 1.0) * 0.5, (1.0 - y) * 0.5);
|
|
16
|
+
return output;
|
|
17
|
+
}
|