@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.
Files changed (258) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/DOCS/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +34 -0
  3. package/DOCS/CI_TESTING.md +38 -0
  4. package/DOCS/CLI_ONBOARDING.md +75 -0
  5. package/DOCS/CONTROL_REFERENCE.md +64 -0
  6. package/DOCS/DEV_TRACK_ANALYSIS.md +77 -0
  7. package/DOCS/DEV_TRACK_PLAN_2026-01-07.md +42 -0
  8. package/DOCS/DEV_TRACK_SESSION_2026-01-31.md +220 -0
  9. package/DOCS/ENV_SETUP.md +189 -0
  10. package/DOCS/EXPORT_FORMATS.md +417 -0
  11. package/DOCS/GPU_DISPOSAL_GUIDE.md +21 -0
  12. package/DOCS/LICENSING_TIERS.md +275 -0
  13. package/DOCS/MASTER_PLAN_2026-01-31.md +570 -0
  14. package/DOCS/OBS_SETUP_GUIDE.md +98 -0
  15. package/DOCS/PROJECT_SETUP.md +66 -0
  16. package/DOCS/RENDERER_LIFECYCLE.md +40 -0
  17. package/DOCS/REPO_MANIFEST.md +121 -0
  18. package/DOCS/SESSION_014_PLAN.md +195 -0
  19. package/DOCS/SESSION_LOG_2026-01-07.md +56 -0
  20. package/DOCS/STRATEGIC_BLUEPRINT_2026-01-07.md +72 -0
  21. package/DOCS/SYSTEM_AUDIT_2026-01-30.md +738 -0
  22. package/DOCS/SYSTEM_INVENTORY.md +520 -0
  23. package/DOCS/TELEMETRY_EXPORTS.md +34 -0
  24. package/DOCS/WEBGPU_STATUS.md +38 -0
  25. package/DOCS/XR_BENCHMARKS.md +608 -0
  26. package/LICENSE +21 -0
  27. package/README.md +426 -0
  28. package/docs/.nojekyll +0 -0
  29. package/docs/01-dissolution_of_euclidean_hegemony.html +346 -0
  30. package/docs/02-hyperspatial_ego_death.html +346 -0
  31. package/docs/03-post_cartesian_sublime.html +346 -0
  32. package/docs/04-crystalline_void_meditation.html +346 -0
  33. package/docs/05-quantum_decoherence_ballet.html +346 -0
  34. package/docs/06-dissolution_of_euclidean_hegemony.html +346 -0
  35. package/docs/07-hyperspatial_ego_death.html +346 -0
  36. package/docs/08-post_cartesian_sublime.html +346 -0
  37. package/docs/09-crystalline_void_meditation.html +346 -0
  38. package/docs/10-quantum_decoherence_ballet.html +346 -0
  39. package/docs/11-dissolution_of_euclidean_hegemony.html +346 -0
  40. package/docs/12-hyperspatial_ego_death.html +346 -0
  41. package/docs/13-post_cartesian_sublime.html +346 -0
  42. package/docs/index.html +794 -0
  43. package/docs/test-hub.html +441 -0
  44. package/docs/url-state.js +102 -0
  45. package/docs/vib3-exports/01-quantum-quantum-tetrahedron-lattice.html +489 -0
  46. package/docs/vib3-exports/02-quantum-quantum-hypersphere-matrix.html +489 -0
  47. package/docs/vib3-exports/03-quantum-quantum-hypertetra-fractal.html +489 -0
  48. package/docs/vib3-exports/04-faceted-faceted-crystal-structure.html +407 -0
  49. package/docs/vib3-exports/05-faceted-faceted-klein-bottle.html +407 -0
  50. package/docs/vib3-exports/06-faceted-faceted-hypertetra-torus.html +407 -0
  51. package/docs/vib3-exports/07-holographic-holographic-wave-field.html +457 -0
  52. package/docs/vib3-exports/08-holographic-holographic-hypersphere-sphere.html +457 -0
  53. package/docs/vib3-exports/09-holographic-holographic-hypertetra-crystal.html +457 -0
  54. package/docs/vib3-exports/index.html +238 -0
  55. package/docs/webgpu-live.html +702 -0
  56. package/package.json +367 -0
  57. package/src/advanced/AIPresetGenerator.js +777 -0
  58. package/src/advanced/MIDIController.js +703 -0
  59. package/src/advanced/OffscreenWorker.js +1051 -0
  60. package/src/advanced/WebGPUCompute.js +1051 -0
  61. package/src/advanced/WebXRRenderer.js +680 -0
  62. package/src/agent/cli/AgentCLI.js +615 -0
  63. package/src/agent/cli/index.js +14 -0
  64. package/src/agent/index.js +73 -0
  65. package/src/agent/mcp/MCPServer.js +950 -0
  66. package/src/agent/mcp/index.js +9 -0
  67. package/src/agent/mcp/tools.js +548 -0
  68. package/src/agent/telemetry/EventStream.js +669 -0
  69. package/src/agent/telemetry/Instrumentation.js +618 -0
  70. package/src/agent/telemetry/TelemetryExporters.js +427 -0
  71. package/src/agent/telemetry/TelemetryService.js +464 -0
  72. package/src/agent/telemetry/index.js +52 -0
  73. package/src/benchmarks/BenchmarkRunner.js +381 -0
  74. package/src/benchmarks/MetricsCollector.js +299 -0
  75. package/src/benchmarks/index.js +9 -0
  76. package/src/benchmarks/scenes.js +259 -0
  77. package/src/cli/index.js +675 -0
  78. package/src/config/ApiConfig.js +88 -0
  79. package/src/core/CanvasManager.js +217 -0
  80. package/src/core/ErrorReporter.js +117 -0
  81. package/src/core/ParameterMapper.js +333 -0
  82. package/src/core/Parameters.js +396 -0
  83. package/src/core/RendererContracts.js +200 -0
  84. package/src/core/UnifiedResourceManager.js +370 -0
  85. package/src/core/VIB3Engine.js +636 -0
  86. package/src/core/renderers/FacetedRendererAdapter.js +32 -0
  87. package/src/core/renderers/HolographicRendererAdapter.js +29 -0
  88. package/src/core/renderers/QuantumRendererAdapter.js +29 -0
  89. package/src/core/renderers/RendererLifecycleManager.js +63 -0
  90. package/src/creative/ColorPresetsSystem.js +980 -0
  91. package/src/creative/ParameterTimeline.js +1061 -0
  92. package/src/creative/PostProcessingPipeline.js +1113 -0
  93. package/src/creative/TransitionAnimator.js +683 -0
  94. package/src/export/CSSExporter.js +226 -0
  95. package/src/export/CardGeneratorBase.js +279 -0
  96. package/src/export/ExportManager.js +580 -0
  97. package/src/export/FacetedCardGenerator.js +279 -0
  98. package/src/export/HolographicCardGenerator.js +543 -0
  99. package/src/export/LottieExporter.js +552 -0
  100. package/src/export/QuantumCardGenerator.js +315 -0
  101. package/src/export/SVGExporter.js +519 -0
  102. package/src/export/ShaderExporter.js +903 -0
  103. package/src/export/TradingCardGenerator.js +3055 -0
  104. package/src/export/TradingCardManager.js +181 -0
  105. package/src/export/VIB3PackageExporter.js +559 -0
  106. package/src/export/index.js +14 -0
  107. package/src/export/systems/TradingCardSystemFaceted.js +494 -0
  108. package/src/export/systems/TradingCardSystemHolographic.js +452 -0
  109. package/src/export/systems/TradingCardSystemQuantum.js +411 -0
  110. package/src/faceted/FacetedSystem.js +963 -0
  111. package/src/features/CollectionManager.js +433 -0
  112. package/src/gallery/CollectionManager.js +240 -0
  113. package/src/gallery/GallerySystem.js +485 -0
  114. package/src/geometry/GeometryFactory.js +314 -0
  115. package/src/geometry/GeometryLibrary.js +72 -0
  116. package/src/geometry/buffers/BufferBuilder.js +338 -0
  117. package/src/geometry/buffers/index.js +18 -0
  118. package/src/geometry/generators/Crystal.js +420 -0
  119. package/src/geometry/generators/Fractal.js +298 -0
  120. package/src/geometry/generators/KleinBottle.js +197 -0
  121. package/src/geometry/generators/Sphere.js +192 -0
  122. package/src/geometry/generators/Tesseract.js +160 -0
  123. package/src/geometry/generators/Tetrahedron.js +225 -0
  124. package/src/geometry/generators/Torus.js +304 -0
  125. package/src/geometry/generators/Wave.js +341 -0
  126. package/src/geometry/index.js +142 -0
  127. package/src/geometry/warp/HypersphereCore.js +211 -0
  128. package/src/geometry/warp/HypertetraCore.js +386 -0
  129. package/src/geometry/warp/index.js +57 -0
  130. package/src/holograms/HolographicVisualizer.js +1073 -0
  131. package/src/holograms/RealHolographicSystem.js +966 -0
  132. package/src/holograms/variantRegistry.js +69 -0
  133. package/src/integrations/FigmaPlugin.js +854 -0
  134. package/src/integrations/OBSMode.js +754 -0
  135. package/src/integrations/ThreeJsPackage.js +660 -0
  136. package/src/integrations/TouchDesignerExport.js +552 -0
  137. package/src/integrations/frameworks/Vib3React.js +591 -0
  138. package/src/integrations/frameworks/Vib3Svelte.js +654 -0
  139. package/src/integrations/frameworks/Vib3Vue.js +628 -0
  140. package/src/llm/LLMParameterInterface.js +240 -0
  141. package/src/llm/LLMParameterUI.js +577 -0
  142. package/src/math/Mat4x4.js +708 -0
  143. package/src/math/Projection.js +341 -0
  144. package/src/math/Rotor4D.js +637 -0
  145. package/src/math/Vec4.js +476 -0
  146. package/src/math/constants.js +164 -0
  147. package/src/math/index.js +68 -0
  148. package/src/math/projections.js +54 -0
  149. package/src/math/rotations.js +196 -0
  150. package/src/quantum/QuantumEngine.js +906 -0
  151. package/src/quantum/QuantumVisualizer.js +1103 -0
  152. package/src/reactivity/ReactivityConfig.js +499 -0
  153. package/src/reactivity/ReactivityManager.js +586 -0
  154. package/src/reactivity/SpatialInputSystem.js +1783 -0
  155. package/src/reactivity/index.js +93 -0
  156. package/src/render/CommandBuffer.js +465 -0
  157. package/src/render/MultiCanvasBridge.js +340 -0
  158. package/src/render/RenderCommand.js +514 -0
  159. package/src/render/RenderResourceRegistry.js +523 -0
  160. package/src/render/RenderState.js +552 -0
  161. package/src/render/RenderTarget.js +512 -0
  162. package/src/render/ShaderLoader.js +253 -0
  163. package/src/render/ShaderProgram.js +599 -0
  164. package/src/render/UnifiedRenderBridge.js +496 -0
  165. package/src/render/backends/WebGLBackend.js +1108 -0
  166. package/src/render/backends/WebGPUBackend.js +1409 -0
  167. package/src/render/commands/CommandBufferExecutor.js +607 -0
  168. package/src/render/commands/RenderCommandBuffer.js +661 -0
  169. package/src/render/commands/index.js +17 -0
  170. package/src/render/index.js +367 -0
  171. package/src/scene/Disposable.js +498 -0
  172. package/src/scene/MemoryPool.js +618 -0
  173. package/src/scene/Node4D.js +697 -0
  174. package/src/scene/ResourceManager.js +599 -0
  175. package/src/scene/Scene4D.js +540 -0
  176. package/src/scene/index.js +98 -0
  177. package/src/schemas/error.schema.json +84 -0
  178. package/src/schemas/extension.schema.json +88 -0
  179. package/src/schemas/index.js +214 -0
  180. package/src/schemas/parameters.schema.json +142 -0
  181. package/src/schemas/tool-pack.schema.json +44 -0
  182. package/src/schemas/tool-response.schema.json +127 -0
  183. package/src/shaders/common/fullscreen.vert.glsl +5 -0
  184. package/src/shaders/common/fullscreen.vert.wgsl +17 -0
  185. package/src/shaders/common/geometry24.glsl +65 -0
  186. package/src/shaders/common/geometry24.wgsl +54 -0
  187. package/src/shaders/common/rotation4d.glsl +85 -0
  188. package/src/shaders/common/rotation4d.wgsl +86 -0
  189. package/src/shaders/common/uniforms.glsl +44 -0
  190. package/src/shaders/common/uniforms.wgsl +48 -0
  191. package/src/shaders/faceted/faceted.frag.glsl +129 -0
  192. package/src/shaders/faceted/faceted.frag.wgsl +164 -0
  193. package/src/shaders/holographic/holographic.frag.glsl +406 -0
  194. package/src/shaders/holographic/holographic.frag.wgsl +185 -0
  195. package/src/shaders/quantum/quantum.frag.glsl +513 -0
  196. package/src/shaders/quantum/quantum.frag.wgsl +361 -0
  197. package/src/testing/ParallelTestFramework.js +519 -0
  198. package/src/testing/__snapshots__/exportFormats.test.js.snap +24 -0
  199. package/src/testing/exportFormats.test.js +8 -0
  200. package/src/testing/projections.test.js +14 -0
  201. package/src/testing/rotations.test.js +37 -0
  202. package/src/ui/InteractivityMenu.js +516 -0
  203. package/src/ui/StatusManager.js +96 -0
  204. package/src/ui/adaptive/renderers/webgpu/BufferLayout.ts +252 -0
  205. package/src/ui/adaptive/renderers/webgpu/PolytopeInstanceBuffer.ts +144 -0
  206. package/src/ui/adaptive/renderers/webgpu/TripleBufferedUniform.ts +170 -0
  207. package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +735 -0
  208. package/src/ui/adaptive/renderers/webgpu/index.ts +112 -0
  209. package/src/variations/VariationManager.js +431 -0
  210. package/src/viewer/AudioReactivity.js +505 -0
  211. package/src/viewer/CardBending.js +481 -0
  212. package/src/viewer/GalleryUI.js +832 -0
  213. package/src/viewer/ReactivityManager.js +590 -0
  214. package/src/viewer/TradingCardExporter.js +600 -0
  215. package/src/viewer/ViewerPortal.js +374 -0
  216. package/src/viewer/index.js +12 -0
  217. package/src/wasm/WasmLoader.js +296 -0
  218. package/src/wasm/index.js +132 -0
  219. package/tools/agentic/mcpTools.js +88 -0
  220. package/tools/cli/agent-cli.js +92 -0
  221. package/tools/export/formats.js +24 -0
  222. package/tools/math/rotation-baseline.mjs +64 -0
  223. package/tools/shader-sync-verify.js +937 -0
  224. package/tools/telemetry/manifestPipeline.js +141 -0
  225. package/tools/telemetry/telemetryEvents.js +35 -0
  226. package/types/adaptive-sdk.d.ts +185 -0
  227. package/types/advanced/AIPresetGenerator.d.ts +81 -0
  228. package/types/advanced/MIDIController.d.ts +100 -0
  229. package/types/advanced/OffscreenWorker.d.ts +82 -0
  230. package/types/advanced/WebGPUCompute.d.ts +52 -0
  231. package/types/advanced/WebXRRenderer.d.ts +77 -0
  232. package/types/advanced/index.d.ts +46 -0
  233. package/types/core/ErrorReporter.d.ts +50 -0
  234. package/types/core/VIB3Engine.d.ts +204 -0
  235. package/types/creative/ColorPresetsSystem.d.ts +91 -0
  236. package/types/creative/ParameterTimeline.d.ts +74 -0
  237. package/types/creative/PostProcessingPipeline.d.ts +109 -0
  238. package/types/creative/TransitionAnimator.d.ts +71 -0
  239. package/types/creative/index.d.ts +35 -0
  240. package/types/integrations/FigmaPlugin.d.ts +46 -0
  241. package/types/integrations/OBSMode.d.ts +74 -0
  242. package/types/integrations/ThreeJsPackage.d.ts +62 -0
  243. package/types/integrations/TouchDesignerExport.d.ts +36 -0
  244. package/types/integrations/Vib3React.d.ts +74 -0
  245. package/types/integrations/Vib3Svelte.d.ts +63 -0
  246. package/types/integrations/Vib3Vue.d.ts +55 -0
  247. package/types/integrations/index.d.ts +52 -0
  248. package/types/reactivity/SpatialInputSystem.d.ts +173 -0
  249. package/types/reactivity/index.d.ts +394 -0
  250. package/types/render/CommandBuffer.d.ts +169 -0
  251. package/types/render/RenderCommand.d.ts +312 -0
  252. package/types/render/RenderState.d.ts +279 -0
  253. package/types/render/RenderTarget.d.ts +254 -0
  254. package/types/render/ShaderProgram.d.ts +277 -0
  255. package/types/render/UnifiedRenderBridge.d.ts +143 -0
  256. package/types/render/WebGLBackend.d.ts +168 -0
  257. package/types/render/WebGPUBackend.d.ts +186 -0
  258. package/types/render/index.d.ts +141 -0
@@ -0,0 +1,516 @@
1
+ /**
2
+ * Interactivity Menu System
3
+ * Visual interface for Universal Interactivity Engine
4
+ * Shows real-time input data and parameter mappings
5
+ */
6
+
7
+ export class InteractivityMenu {
8
+ constructor(interactivityEngine) {
9
+ this.engine = interactivityEngine;
10
+ this.isVisible = false;
11
+ this.menuContainer = null;
12
+ this.updateInterval = null;
13
+
14
+ this.createMenu();
15
+ this.bindEvents();
16
+
17
+ console.log('๐ŸŽ›๏ธ Interactivity Menu initialized');
18
+ }
19
+
20
+ /**
21
+ * Create the interactivity menu UI
22
+ */
23
+ createMenu() {
24
+ // Create menu container
25
+ this.menuContainer = document.createElement('div');
26
+ this.menuContainer.id = 'interactivity-menu';
27
+ this.menuContainer.innerHTML = `
28
+ <style>
29
+ #interactivity-menu {
30
+ position: fixed;
31
+ top: 50px;
32
+ right: 20px;
33
+ width: 350px;
34
+ background: rgba(0, 0, 0, 0.9);
35
+ border: 2px solid #00ffff;
36
+ border-radius: 10px;
37
+ padding: 20px;
38
+ font-family: 'Orbitron', monospace;
39
+ font-size: 0.8rem;
40
+ color: #00ffff;
41
+ z-index: 2000;
42
+ display: none;
43
+ backdrop-filter: blur(10px);
44
+ box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
45
+ }
46
+
47
+ .interactivity-header {
48
+ text-align: center;
49
+ margin-bottom: 20px;
50
+ font-size: 1rem;
51
+ color: #ff00ff;
52
+ text-shadow: 0 0 10px #ff00ff;
53
+ }
54
+
55
+ .input-source {
56
+ background: rgba(0, 255, 255, 0.1);
57
+ border: 1px solid rgba(0, 255, 255, 0.3);
58
+ border-radius: 5px;
59
+ padding: 10px;
60
+ margin-bottom: 10px;
61
+ }
62
+
63
+ .source-header {
64
+ display: flex;
65
+ justify-content: space-between;
66
+ align-items: center;
67
+ margin-bottom: 5px;
68
+ }
69
+
70
+ .source-name {
71
+ font-weight: bold;
72
+ color: #00ff00;
73
+ }
74
+
75
+ .source-status {
76
+ padding: 2px 6px;
77
+ border-radius: 3px;
78
+ font-size: 0.7rem;
79
+ font-weight: bold;
80
+ }
81
+
82
+ .status-active {
83
+ background: #00ff00;
84
+ color: #000;
85
+ }
86
+
87
+ .status-inactive {
88
+ background: #ff6600;
89
+ color: #fff;
90
+ }
91
+
92
+ .reactive-bands {
93
+ display: grid;
94
+ grid-template-columns: 1fr 1fr;
95
+ gap: 5px;
96
+ margin-top: 5px;
97
+ }
98
+
99
+ .reactive-band {
100
+ display: flex;
101
+ flex-direction: column;
102
+ font-size: 0.7rem;
103
+ }
104
+
105
+ .band-label {
106
+ color: #ffff00;
107
+ margin-bottom: 2px;
108
+ }
109
+
110
+ .band-bar {
111
+ height: 6px;
112
+ background: rgba(255, 255, 255, 0.2);
113
+ border-radius: 3px;
114
+ overflow: hidden;
115
+ }
116
+
117
+ .band-fill {
118
+ height: 100%;
119
+ background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
120
+ width: 0%;
121
+ transition: width 0.1s ease;
122
+ }
123
+
124
+ .parameter-mappings {
125
+ margin-top: 15px;
126
+ padding-top: 15px;
127
+ border-top: 1px solid rgba(0, 255, 255, 0.3);
128
+ }
129
+
130
+ .mapping-header {
131
+ color: #ff00ff;
132
+ font-weight: bold;
133
+ margin-bottom: 10px;
134
+ }
135
+
136
+ .parameter-mapping {
137
+ display: flex;
138
+ justify-content: space-between;
139
+ align-items: center;
140
+ padding: 3px 0;
141
+ font-size: 0.7rem;
142
+ }
143
+
144
+ .param-name {
145
+ color: #ffff00;
146
+ }
147
+
148
+ .param-value {
149
+ color: #00ff00;
150
+ font-family: 'Courier New', monospace;
151
+ }
152
+
153
+ .performance-stats {
154
+ margin-top: 15px;
155
+ padding-top: 15px;
156
+ border-top: 1px solid rgba(0, 255, 255, 0.3);
157
+ font-size: 0.7rem;
158
+ }
159
+
160
+ .perf-stat {
161
+ display: flex;
162
+ justify-content: space-between;
163
+ margin-bottom: 3px;
164
+ }
165
+
166
+ .toggle-btn {
167
+ background: rgba(255, 0, 255, 0.2);
168
+ border: 1px solid #ff00ff;
169
+ color: #ff00ff;
170
+ padding: 5px 10px;
171
+ border-radius: 3px;
172
+ cursor: pointer;
173
+ font-size: 0.7rem;
174
+ transition: all 0.3s;
175
+ }
176
+
177
+ .toggle-btn:hover {
178
+ background: rgba(255, 0, 255, 0.4);
179
+ }
180
+
181
+ .toggle-btn.active {
182
+ background: #ff00ff;
183
+ color: #000;
184
+ }
185
+ </style>
186
+
187
+ <div class="interactivity-header">
188
+ ๐ŸŽ›๏ธ UNIVERSAL INTERACTIVITY ENGINE
189
+ </div>
190
+
191
+ <div id="input-sources">
192
+ <!-- Input sources will be dynamically populated -->
193
+ </div>
194
+
195
+ <div class="parameter-mappings">
196
+ <div class="mapping-header">๐Ÿ“Š PARAMETER MAPPINGS</div>
197
+ <div id="parameter-values">
198
+ <!-- Parameter values will be dynamically updated -->
199
+ </div>
200
+ </div>
201
+
202
+ <div class="performance-stats">
203
+ <div class="mapping-header">โšก PERFORMANCE</div>
204
+ <div id="performance-data">
205
+ <!-- Performance stats will be updated -->
206
+ </div>
207
+ </div>
208
+ `;
209
+
210
+ document.body.appendChild(this.menuContainer);
211
+ }
212
+
213
+ /**
214
+ * Show the interactivity menu
215
+ */
216
+ show() {
217
+ this.isVisible = true;
218
+ this.menuContainer.style.display = 'block';
219
+ this.startUpdates();
220
+ console.log('๐ŸŽ›๏ธ Interactivity Menu shown');
221
+ }
222
+
223
+ /**
224
+ * Hide the interactivity menu
225
+ */
226
+ hide() {
227
+ this.isVisible = false;
228
+ this.menuContainer.style.display = 'none';
229
+ this.stopUpdates();
230
+ console.log('๐ŸŽ›๏ธ Interactivity Menu hidden');
231
+ }
232
+
233
+ /**
234
+ * Toggle menu visibility
235
+ */
236
+ toggle() {
237
+ if (this.isVisible) {
238
+ this.hide();
239
+ } else {
240
+ this.show();
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Bind keyboard events
246
+ */
247
+ bindEvents() {
248
+ document.addEventListener('keydown', (e) => {
249
+ // Toggle with I key (when not typing in inputs)
250
+ if (e.key === 'i' || e.key === 'I') {
251
+ if (!['INPUT', 'TEXTAREA'].includes(e.target.tagName)) {
252
+ e.preventDefault();
253
+ this.toggle();
254
+ }
255
+ }
256
+ });
257
+ }
258
+
259
+ /**
260
+ * Start real-time updates
261
+ */
262
+ startUpdates() {
263
+ if (this.updateInterval) return;
264
+
265
+ this.updateInterval = setInterval(() => {
266
+ this.updateInputSources();
267
+ this.updateParameterMappings();
268
+ this.updatePerformanceStats();
269
+ }, 100); // Update 10 times per second
270
+ }
271
+
272
+ /**
273
+ * Stop real-time updates
274
+ */
275
+ stopUpdates() {
276
+ if (this.updateInterval) {
277
+ clearInterval(this.updateInterval);
278
+ this.updateInterval = null;
279
+ }
280
+ }
281
+
282
+ /**
283
+ * Update input sources display
284
+ */
285
+ updateInputSources() {
286
+ const sourcesContainer = document.getElementById('input-sources');
287
+ const reactiveBands = this.engine.getReactiveBands();
288
+ const activeInputs = this.engine.activeInputs;
289
+
290
+ let sourcesHTML = '';
291
+
292
+ // Audio sources
293
+ if (activeInputs.has('audio')) {
294
+ sourcesHTML += this.createSourceHTML('audio', '๐ŸŽต Audio Input', true, {
295
+ 'Bass': reactiveBands.audio.bass,
296
+ 'Mid': reactiveBands.audio.mid,
297
+ 'High': reactiveBands.audio.high,
298
+ 'Energy': reactiveBands.audio.energy
299
+ });
300
+ }
301
+
302
+ // Mouse/Touch sources
303
+ if (activeInputs.has('mouse/touch')) {
304
+ sourcesHTML += this.createSourceHTML('mouseTouch', '๐Ÿ–ฑ๏ธ Mouse/Touch', true, {
305
+ 'Movement': reactiveBands.movement.smoothed,
306
+ 'Velocity': reactiveBands.velocity.smoothed,
307
+ 'Precision': reactiveBands.precision.smoothed
308
+ });
309
+ }
310
+
311
+ // Keyboard sources
312
+ if (activeInputs.has('keyboard')) {
313
+ sourcesHTML += this.createSourceHTML('keyboard', 'โŒจ๏ธ Keyboard', true, {
314
+ 'Typing Rate': reactiveBands.ui.typing.velocity || 0,
315
+ 'Rhythm': reactiveBands.ui.typing.rhythm || 0
316
+ });
317
+ }
318
+
319
+ // Gamepad sources
320
+ if (activeInputs.has('gamepad')) {
321
+ sourcesHTML += this.createSourceHTML('gamepad', '๐ŸŽฎ Gamepad', true, {
322
+ 'Pressure': reactiveBands.gamepad.pressure,
323
+ 'Left X': Math.abs(reactiveBands.gamepad.axes[0] || 0),
324
+ 'Left Y': Math.abs(reactiveBands.gamepad.axes[1] || 0),
325
+ 'Right X': Math.abs(reactiveBands.gamepad.axes[2] || 0)
326
+ });
327
+ }
328
+
329
+ // Device orientation
330
+ if (activeInputs.has('device-orientation')) {
331
+ sourcesHTML += this.createSourceHTML('wearable', 'โŒš Device Sensors', true, {
332
+ 'Tilt X': Math.abs(reactiveBands.wearable.tilt.x),
333
+ 'Tilt Y': Math.abs(reactiveBands.wearable.tilt.y),
334
+ 'Motion': reactiveBands.wearable.motion
335
+ });
336
+ }
337
+
338
+ // UI interactions
339
+ if (activeInputs.has('ui')) {
340
+ sourcesHTML += this.createSourceHTML('ui', '๐Ÿ–ฅ๏ธ UI Interactions', true, {
341
+ 'Scroll': reactiveBands.ui.scroll || 0,
342
+ 'Click': reactiveBands.ui.click || 0,
343
+ 'Hover': reactiveBands.ui.hover || 0
344
+ });
345
+ }
346
+
347
+ sourcesContainer.innerHTML = sourcesHTML;
348
+ }
349
+
350
+ /**
351
+ * Create HTML for an input source
352
+ */
353
+ createSourceHTML(sourceId, sourceName, isActive, bands) {
354
+ const statusClass = isActive ? 'status-active' : 'status-inactive';
355
+ const statusText = isActive ? 'ACTIVE' : 'INACTIVE';
356
+
357
+ let bandsHTML = '';
358
+ for (const [name, value] of Object.entries(bands)) {
359
+ const percentage = Math.min(100, Math.max(0, value * 100));
360
+ bandsHTML += `
361
+ <div class="reactive-band">
362
+ <div class="band-label">${name}</div>
363
+ <div class="band-bar">
364
+ <div class="band-fill" style="width: ${percentage}%"></div>
365
+ </div>
366
+ </div>
367
+ `;
368
+ }
369
+
370
+ return `
371
+ <div class="input-source">
372
+ <div class="source-header">
373
+ <span class="source-name">${sourceName}</span>
374
+ <span class="source-status ${statusClass}">${statusText}</span>
375
+ </div>
376
+ <div class="reactive-bands">
377
+ ${bandsHTML}
378
+ </div>
379
+ </div>
380
+ `;
381
+ }
382
+
383
+ /**
384
+ * Update parameter mappings display
385
+ */
386
+ updateParameterMappings() {
387
+ const parametersContainer = document.getElementById('parameter-values');
388
+
389
+ const parameters = [
390
+ 'rot4dXW', 'rot4dYW', 'rot4dZW',
391
+ 'speed', 'hue', 'gridDensity',
392
+ 'morphFactor', 'chaos'
393
+ ];
394
+
395
+ let parametersHTML = '';
396
+ for (const param of parameters) {
397
+ const value = this.engine.getParameterValue(param);
398
+ if (value !== null) {
399
+ parametersHTML += `
400
+ <div class="parameter-mapping">
401
+ <span class="param-name">${param}</span>
402
+ <span class="param-value">${value.toFixed(2)}</span>
403
+ </div>
404
+ `;
405
+ }
406
+ }
407
+
408
+ parametersContainer.innerHTML = parametersHTML;
409
+ }
410
+
411
+ /**
412
+ * Update performance statistics display
413
+ */
414
+ updatePerformanceStats() {
415
+ const performanceContainer = document.getElementById('performance-data');
416
+ const stats = this.engine.getPerformanceStats();
417
+
418
+ const performanceHTML = `
419
+ <div class="perf-stat">
420
+ <span>Update Rate:</span>
421
+ <span>${stats.updateRate.toFixed(1)} Hz</span>
422
+ </div>
423
+ <div class="perf-stat">
424
+ <span>Processing Time:</span>
425
+ <span>${stats.processingTime.toFixed(2)} ms</span>
426
+ </div>
427
+ <div class="perf-stat">
428
+ <span>Active Sources:</span>
429
+ <span>${stats.totalSources}</span>
430
+ </div>
431
+ <div class="perf-stat">
432
+ <span>Input Latency:</span>
433
+ <span>${stats.inputLatency.toFixed(1)} ms</span>
434
+ </div>
435
+ `;
436
+
437
+ performanceContainer.innerHTML = performanceHTML;
438
+ }
439
+
440
+ /**
441
+ * Add custom parameter mapping
442
+ */
443
+ addCustomMapping(parameterName, sourcePath, range = [0, 1], smoothing = 0.5) {
444
+ this.engine.parameterMappings[parameterName] = {
445
+ sources: [sourcePath],
446
+ range: range,
447
+ smoothing: smoothing
448
+ };
449
+
450
+ console.log(`๐ŸŽ›๏ธ Added custom mapping: ${parameterName} <- ${sourcePath}`);
451
+ }
452
+
453
+ /**
454
+ * Remove parameter mapping
455
+ */
456
+ removeMapping(parameterName) {
457
+ delete this.engine.parameterMappings[parameterName];
458
+ console.log(`๐ŸŽ›๏ธ Removed mapping: ${parameterName}`);
459
+ }
460
+
461
+ /**
462
+ * Export current configuration
463
+ */
464
+ exportConfiguration() {
465
+ const config = {
466
+ parameterMappings: this.engine.parameterMappings,
467
+ activeInputs: Array.from(this.engine.activeInputs),
468
+ timestamp: new Date().toISOString()
469
+ };
470
+
471
+ const blob = new Blob([JSON.stringify(config, null, 2)], {
472
+ type: 'application/json'
473
+ });
474
+
475
+ const url = URL.createObjectURL(blob);
476
+ const a = document.createElement('a');
477
+ a.href = url;
478
+ a.download = 'vib34d-interactivity-config.json';
479
+ a.click();
480
+ URL.revokeObjectURL(url);
481
+
482
+ console.log('๐ŸŽ›๏ธ Configuration exported');
483
+ }
484
+
485
+ /**
486
+ * Import configuration
487
+ */
488
+ async importConfiguration(file) {
489
+ try {
490
+ const text = await file.text();
491
+ const config = JSON.parse(text);
492
+
493
+ if (config.parameterMappings) {
494
+ this.engine.parameterMappings = config.parameterMappings;
495
+ console.log('๐ŸŽ›๏ธ Configuration imported successfully');
496
+ return true;
497
+ }
498
+ } catch (error) {
499
+ console.error('๐ŸŽ›๏ธ Failed to import configuration:', error);
500
+ }
501
+
502
+ return false;
503
+ }
504
+
505
+ /**
506
+ * Destroy the menu
507
+ */
508
+ destroy() {
509
+ this.stopUpdates();
510
+ if (this.menuContainer) {
511
+ this.menuContainer.remove();
512
+ this.menuContainer = null;
513
+ }
514
+ console.log('๐Ÿงน Interactivity Menu destroyed');
515
+ }
516
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * VIB34D Status Management System
3
+ * Handles UI feedback and status messaging
4
+ */
5
+
6
+ export class StatusManager {
7
+ constructor() {
8
+ this.statusElement = null;
9
+ this.timeout = null;
10
+ this.init();
11
+ }
12
+
13
+ /**
14
+ * Initialize status system
15
+ */
16
+ init() {
17
+ this.statusElement = document.getElementById('status');
18
+ // Silent handling - status element is optional
19
+ }
20
+
21
+ /**
22
+ * Set status message with type and auto-clear
23
+ */
24
+ setStatus(message, type = 'info', duration = 3000) {
25
+ if (!this.statusElement) return;
26
+
27
+ this.statusElement.textContent = message;
28
+ this.statusElement.className = `status ${type}`;
29
+
30
+ // Clear previous timeout
31
+ if (this.timeout) {
32
+ clearTimeout(this.timeout);
33
+ }
34
+
35
+ // Auto-clear after duration (unless it's an error)
36
+ if (type !== 'error' && duration > 0) {
37
+ this.timeout = setTimeout(() => {
38
+ this.clearStatus();
39
+ }, duration);
40
+ }
41
+
42
+ // Log to console as well
43
+ const logMethod = type === 'error' ? 'error' : type === 'warning' ? 'warn' : 'log';
44
+ console[logMethod](`[${type.toUpperCase()}] ${message}`);
45
+ }
46
+
47
+ /**
48
+ * Clear status message
49
+ */
50
+ clearStatus() {
51
+ if (this.statusElement) {
52
+ this.statusElement.textContent = '';
53
+ this.statusElement.className = 'status';
54
+ }
55
+
56
+ if (this.timeout) {
57
+ clearTimeout(this.timeout);
58
+ this.timeout = null;
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Show success message
64
+ */
65
+ success(message, duration = 3000) {
66
+ this.setStatus(message, 'success', duration);
67
+ }
68
+
69
+ /**
70
+ * Show error message (persists until cleared)
71
+ */
72
+ error(message) {
73
+ this.setStatus(message, 'error', 0);
74
+ }
75
+
76
+ /**
77
+ * Show warning message
78
+ */
79
+ warning(message, duration = 4000) {
80
+ this.setStatus(message, 'warning', duration);
81
+ }
82
+
83
+ /**
84
+ * Show info message
85
+ */
86
+ info(message, duration = 3000) {
87
+ this.setStatus(message, 'info', duration);
88
+ }
89
+
90
+ /**
91
+ * Show loading message
92
+ */
93
+ loading(message) {
94
+ this.setStatus(message, 'loading', 0);
95
+ }
96
+ }