@vib3code/sdk 2.0.3-canary.91a95f3 → 2.0.3-canary.98b84da
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/AGENT_HARNESS_ARCHITECTURE.md +2 -0
- package/DOCS/ANDROID_DEPLOYMENT.md +59 -0
- package/DOCS/ARCHITECTURE.md +1 -0
- package/DOCS/CI_TESTING.md +2 -0
- package/DOCS/CLI_ONBOARDING.md +2 -0
- package/DOCS/CONTROL_REFERENCE.md +2 -0
- package/DOCS/CROSS_SITE_DESIGN_PATTERNS.md +2 -0
- package/DOCS/ENV_SETUP.md +2 -0
- package/DOCS/EPIC_SCROLL_EVENTS.md +2 -0
- package/DOCS/EXPANSION_DESIGN.md +979 -0
- package/DOCS/EXPANSION_DESIGN_ULTRA.md +389 -0
- package/DOCS/EXPORT_FORMATS.md +2 -0
- package/DOCS/GPU_DISPOSAL_GUIDE.md +2 -0
- package/DOCS/HANDOFF_LANDING_PAGE.md +2 -0
- package/DOCS/HANDOFF_SDK_DEVELOPMENT.md +2 -0
- package/DOCS/LICENSING_TIERS.md +2 -0
- package/DOCS/MASTER_PLAN_2026-01-31.md +4 -2
- package/DOCS/MULTIVIZ_CHOREOGRAPHY_PATTERNS.md +3 -1
- package/DOCS/OBS_SETUP_GUIDE.md +2 -0
- package/DOCS/OPTIMIZATION_PLAN_MATH.md +119 -0
- package/DOCS/PRODUCT_STRATEGY.md +2 -0
- package/DOCS/PROJECT_SETUP.md +2 -0
- package/DOCS/README.md +5 -3
- package/DOCS/REFERENCE_SCROLL_ANALYSIS.md +2 -0
- package/DOCS/RENDERER_LIFECYCLE.md +2 -0
- package/DOCS/REPO_MANIFEST.md +2 -0
- package/DOCS/ROADMAP.md +2 -0
- package/DOCS/SCROLL_TIMELINE_v3.md +2 -0
- package/DOCS/SITE_REFACTOR_PLAN.md +2 -0
- package/DOCS/STATUS.md +2 -0
- package/DOCS/SYSTEM_INVENTORY.md +4 -2
- package/DOCS/TELEMETRY_EXPORTS.md +2 -0
- package/DOCS/VISUAL_ANALYSIS_CLICKERSS.md +2 -0
- package/DOCS/VISUAL_ANALYSIS_FACETAD.md +2 -0
- package/DOCS/VISUAL_ANALYSIS_SIMONE.md +2 -0
- package/DOCS/VISUAL_ANALYSIS_TABLESIDE.md +2 -0
- package/DOCS/WEBGPU_STATUS.md +121 -38
- package/DOCS/XR_BENCHMARKS.md +2 -0
- package/DOCS/archive/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +1 -34
- package/DOCS/archive/DEV_TRACK_ANALYSIS.md +1 -80
- package/DOCS/archive/DEV_TRACK_PLAN_2026-01-07.md +1 -42
- package/DOCS/archive/SESSION_014_PLAN.md +1 -195
- package/DOCS/archive/SESSION_LOG_2026-01-07.md +1 -56
- package/DOCS/archive/STRATEGIC_BLUEPRINT_2026-01-07.md +1 -72
- package/DOCS/archive/SYSTEM_AUDIT_2026-01-30.md +1 -741
- package/DOCS/archive/WEBGPU_STATUS_2026-02-15_STALE.md +1 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-01-31.md +2 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-06.md +2 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-13.md +15 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md +144 -0
- package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-16.md +110 -0
- package/DOCS/dev-tracks/PERF_UPGRADE_2026-02-16.md +310 -0
- package/DOCS/dev-tracks/README.md +2 -0
- package/docs/webgpu-live.html +1 -1
- package/package.json +11 -4
- package/src/agent/index.js +1 -3
- package/src/agent/mcp/MCPServer.js +542 -188
- package/src/agent/mcp/index.js +1 -1
- package/src/agent/mcp/tools.js +132 -32
- package/src/cli/index.js +431 -47
- 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/experimental/GameLoop.js +72 -0
- package/src/experimental/LatticePhysics.js +100 -0
- package/src/experimental/LiveDirector.js +143 -0
- package/src/experimental/PlayerController4D.js +154 -0
- package/src/experimental/VIB3Actor.js +138 -0
- package/src/experimental/VIB3Compositor.js +117 -0
- package/src/experimental/VIB3Link.js +122 -0
- package/src/experimental/VIB3Orchestrator.js +146 -0
- package/src/experimental/VIB3Universe.js +109 -0
- package/src/experimental/demos/CrystalLabyrinth.js +202 -0
- package/src/export/SVGExporter.js +9 -5
- package/src/export/index.js +11 -1
- package/src/faceted/FacetedSystem.js +27 -10
- package/src/games/glyph-war/GlyphWarVisualizer.js +641 -0
- package/src/geometry/generators/Crystal.js +2 -2
- package/src/geometry/warp/HypersphereCore.js +53 -24
- package/src/holograms/HolographicVisualizer.js +58 -89
- package/src/holograms/RealHolographicSystem.js +126 -31
- package/src/math/Mat4x4.js +372 -140
- package/src/math/Projection.js +39 -4
- package/src/math/Rotor4D.js +157 -67
- package/src/math/Vec4.js +265 -111
- package/src/math/index.js +7 -7
- package/src/quantum/QuantumVisualizer.js +24 -20
- 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/ShaderLoader.js +38 -0
- package/src/render/ShaderProgram.js +4 -4
- package/src/render/UnifiedRenderBridge.js +1 -1
- package/src/render/backends/WebGPUBackend.js +8 -4
- package/src/render/index.js +27 -2
- package/src/scene/Node4D.js +74 -24
- package/src/scene/index.js +4 -4
- package/src/shaders/common/geometry24.glsl +65 -0
- package/src/shaders/common/geometry24.wgsl +54 -0
- package/src/shaders/common/rotation4d.glsl +4 -4
- package/src/shaders/common/rotation4d.wgsl +2 -2
- package/src/shaders/common/uniforms.wgsl +15 -8
- package/src/shaders/faceted/faceted.frag.wgsl +19 -6
- package/src/shaders/holographic/holographic.frag.wgsl +7 -5
- package/src/shaders/quantum/quantum.frag.wgsl +7 -5
- package/src/testing/ParallelTestFramework.js +2 -2
- package/src/testing/ProjectionClass.test.js +38 -0
- package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +2 -2
- package/src/viewer/GalleryUI.js +17 -0
- package/src/viewer/ViewerPortal.js +2 -2
- package/tools/shader-sync-verify.js +6 -4
- package/tools/update_projection.py +109 -0
- 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
package/types/adaptive-sdk.d.ts
CHANGED
|
@@ -5,14 +5,20 @@
|
|
|
5
5
|
* Barrel re-export for all typed modules.
|
|
6
6
|
*
|
|
7
7
|
* Typed modules:
|
|
8
|
-
* - core
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
8
|
+
* - core (VIB3Engine, CanvasManager, ParameterManager, ParameterMapper, VitalitySystem, RendererContracts, UnifiedResourceManager)
|
|
9
|
+
* - math (constants, projections, rotations, Vec4)
|
|
10
|
+
* - geometry (GeometryLibrary, generators, BufferBuilder)
|
|
11
|
+
* - systems (QuantumEngine, FacetedSystem, RealHolographicSystem)
|
|
12
|
+
* - scene (ObjectPool, TypedArrayPool, Vec4Pool, PoolManager)
|
|
13
|
+
* - viewer (ViewerPortal, ViewerInputHandler, GalleryUI, CardBending, AudioReactivity, TradingCardExporter)
|
|
14
|
+
* - variations (VariationManager)
|
|
15
|
+
* - reactivity (ReactivityManager, ReactivityConfig, SpatialInputSystem)
|
|
12
16
|
* - render (WebGL/WebGPU backends, ShaderProgram, RenderState, CommandBuffer)
|
|
13
|
-
* - creative (ColorPresets, TransitionAnimator, PostProcessing, Timeline)
|
|
17
|
+
* - creative (ColorPresets, TransitionAnimator, PostProcessing, Timeline, AestheticMapper, ChoreographyPlayer)
|
|
14
18
|
* - integrations (React, Vue, Svelte, Figma, Three.js, TouchDesigner, OBS)
|
|
15
19
|
* - advanced (WebXR, WebGPU Compute, MIDI, AI Presets, OffscreenWorker)
|
|
20
|
+
* - export (ExportManager, ShaderExporter, VIB3PackageExporter, TradingCardGenerator)
|
|
21
|
+
* - agent (MCPServer, AgentCLI, TelemetryService)
|
|
16
22
|
*/
|
|
17
23
|
|
|
18
24
|
// Core engine
|
|
@@ -99,6 +105,37 @@ export {
|
|
|
99
105
|
Shader4DOptions
|
|
100
106
|
} from './render/index';
|
|
101
107
|
|
|
108
|
+
// Layer relationship system
|
|
109
|
+
export {
|
|
110
|
+
LayerRelationshipGraph,
|
|
111
|
+
RelationshipFn,
|
|
112
|
+
RelationshipPreset,
|
|
113
|
+
RelationshipConfig,
|
|
114
|
+
LayerRelationshipProfile,
|
|
115
|
+
LayerRelationshipExport,
|
|
116
|
+
LAYER_ORDER as RENDER_LAYER_ORDER,
|
|
117
|
+
PRESET_REGISTRY,
|
|
118
|
+
PROFILES
|
|
119
|
+
} from './render/LayerRelationshipGraph';
|
|
120
|
+
|
|
121
|
+
// Layer preset manager
|
|
122
|
+
export {
|
|
123
|
+
LayerPresetManager,
|
|
124
|
+
LayerPreset,
|
|
125
|
+
PresetMetadata,
|
|
126
|
+
PresetLibrary,
|
|
127
|
+
PresetManagerOptions
|
|
128
|
+
} from './render/LayerPresetManager';
|
|
129
|
+
|
|
130
|
+
// Layer reactivity bridge
|
|
131
|
+
export {
|
|
132
|
+
LayerReactivityBridge,
|
|
133
|
+
ModulationMapping,
|
|
134
|
+
InputState as LayerInputState,
|
|
135
|
+
ReactivityBridgeConfig,
|
|
136
|
+
MODULATION_PROFILES
|
|
137
|
+
} from './render/LayerReactivityBridge';
|
|
138
|
+
|
|
102
139
|
// Creative tooling
|
|
103
140
|
export {
|
|
104
141
|
ColorPresetsSystem,
|
|
@@ -183,3 +220,165 @@ export {
|
|
|
183
220
|
WorkerSwitchMessage,
|
|
184
221
|
WorkerResizeMessage
|
|
185
222
|
} from './advanced/index';
|
|
223
|
+
|
|
224
|
+
// Export system
|
|
225
|
+
export {
|
|
226
|
+
ExportManager,
|
|
227
|
+
ShaderExporter,
|
|
228
|
+
VIB3PackageExporter,
|
|
229
|
+
TradingCardGenerator,
|
|
230
|
+
TradingCardManager,
|
|
231
|
+
CardGeneratorBase,
|
|
232
|
+
FacetedCardGenerator,
|
|
233
|
+
QuantumCardGenerator,
|
|
234
|
+
HolographicCardGenerator,
|
|
235
|
+
TradingCardSystemFaceted,
|
|
236
|
+
TradingCardSystemHolographic,
|
|
237
|
+
TradingCardSystemQuantum,
|
|
238
|
+
VIB3_PACKAGE_VERSION,
|
|
239
|
+
exportSVG,
|
|
240
|
+
downloadSVG,
|
|
241
|
+
exportCSS,
|
|
242
|
+
downloadCSS,
|
|
243
|
+
toStyleObject,
|
|
244
|
+
exportLottie,
|
|
245
|
+
downloadLottie,
|
|
246
|
+
createVIB3Package
|
|
247
|
+
} from './export/index';
|
|
248
|
+
|
|
249
|
+
// Core - expanded types (CanvasManager, Parameters, RendererContracts, etc.)
|
|
250
|
+
export {
|
|
251
|
+
CanvasManager,
|
|
252
|
+
CanvasLayer,
|
|
253
|
+
ParameterManager,
|
|
254
|
+
ParameterDef,
|
|
255
|
+
VIB3Parameters,
|
|
256
|
+
ParameterConfiguration,
|
|
257
|
+
ParameterMapper,
|
|
258
|
+
MappableSystem,
|
|
259
|
+
VitalitySystem,
|
|
260
|
+
RendererContract,
|
|
261
|
+
RendererContractAdapter,
|
|
262
|
+
ResourceManagerContract,
|
|
263
|
+
FrameState,
|
|
264
|
+
UnifiedResourceManager
|
|
265
|
+
} from './core/index';
|
|
266
|
+
|
|
267
|
+
// Math - constants, projections, rotations, Vec4
|
|
268
|
+
export {
|
|
269
|
+
PI, TAU, HALF_PI, QUARTER_PI,
|
|
270
|
+
DEG_TO_RAD, RAD_TO_DEG,
|
|
271
|
+
EPSILON,
|
|
272
|
+
PHI, PHI_INV,
|
|
273
|
+
PLANE_NAMES as ROTATION_PLANE_NAMES,
|
|
274
|
+
encodeGeometry,
|
|
275
|
+
decodeGeometry,
|
|
276
|
+
toRadians,
|
|
277
|
+
toDegrees,
|
|
278
|
+
clamp,
|
|
279
|
+
lerp,
|
|
280
|
+
smoothstep,
|
|
281
|
+
smootherstep,
|
|
282
|
+
perspectiveProject4D,
|
|
283
|
+
stereographicProject4D,
|
|
284
|
+
ProjectionResult,
|
|
285
|
+
createRotationMatrix4D,
|
|
286
|
+
identityMatrix4x4,
|
|
287
|
+
multiplyMatrix4x4,
|
|
288
|
+
transposeMatrix4x4,
|
|
289
|
+
applyMatrix4x4,
|
|
290
|
+
vectorLength4D,
|
|
291
|
+
normalizeVector4D,
|
|
292
|
+
normalizeRotationAngles,
|
|
293
|
+
composeRotationMatrixFromAngles,
|
|
294
|
+
RotationPlane,
|
|
295
|
+
Matrix4x4,
|
|
296
|
+
Vector4D,
|
|
297
|
+
Vec4
|
|
298
|
+
} from './math/index';
|
|
299
|
+
|
|
300
|
+
// Geometry - library, generators, buffers
|
|
301
|
+
export {
|
|
302
|
+
GeometryLibrary,
|
|
303
|
+
Geometry4D,
|
|
304
|
+
VariationParameters,
|
|
305
|
+
GeometryBuffers,
|
|
306
|
+
buildVertexBuffer,
|
|
307
|
+
buildEdgeIndexBuffer,
|
|
308
|
+
buildFaceIndexBuffer,
|
|
309
|
+
buildGeometryBuffers,
|
|
310
|
+
generateTesseract,
|
|
311
|
+
generateSphere,
|
|
312
|
+
generateTorus
|
|
313
|
+
} from './geometry/index';
|
|
314
|
+
|
|
315
|
+
// Visualization systems
|
|
316
|
+
export {
|
|
317
|
+
QuantumEngine,
|
|
318
|
+
QuantumEngineOptions,
|
|
319
|
+
FacetedSystem,
|
|
320
|
+
FacetedSystemOptions,
|
|
321
|
+
RealHolographicSystem,
|
|
322
|
+
HolographicSystemOptions,
|
|
323
|
+
CanvasSet,
|
|
324
|
+
AudioData,
|
|
325
|
+
RenderMode
|
|
326
|
+
} from './systems/index';
|
|
327
|
+
|
|
328
|
+
// Scene - memory pools
|
|
329
|
+
export {
|
|
330
|
+
ObjectPool,
|
|
331
|
+
TypedArrayPool,
|
|
332
|
+
Vec4Pool,
|
|
333
|
+
Mat4x4Pool,
|
|
334
|
+
PoolManager,
|
|
335
|
+
pools,
|
|
336
|
+
PoolStats,
|
|
337
|
+
ObjectPoolOptions
|
|
338
|
+
} from './scene/index';
|
|
339
|
+
|
|
340
|
+
// Viewer - portal, input, gallery, cards
|
|
341
|
+
export {
|
|
342
|
+
ViewerPortal,
|
|
343
|
+
ViewerInputHandler,
|
|
344
|
+
GalleryUI,
|
|
345
|
+
CardBending,
|
|
346
|
+
AudioReactivity as ViewerAudioReactivity,
|
|
347
|
+
TradingCardExporter,
|
|
348
|
+
PortalMode,
|
|
349
|
+
RotationState,
|
|
350
|
+
InputSource,
|
|
351
|
+
InputPreset,
|
|
352
|
+
GalleryViewMode,
|
|
353
|
+
BendPreset,
|
|
354
|
+
FrameStyle,
|
|
355
|
+
RarityLevel
|
|
356
|
+
} from './viewer/index';
|
|
357
|
+
|
|
358
|
+
// Variations
|
|
359
|
+
export {
|
|
360
|
+
VariationManager,
|
|
361
|
+
VariationSlot,
|
|
362
|
+
VariationOptions
|
|
363
|
+
} from './variations/index';
|
|
364
|
+
|
|
365
|
+
// Agent system
|
|
366
|
+
export {
|
|
367
|
+
MCPServer,
|
|
368
|
+
mcpServer,
|
|
369
|
+
toolDefinitions,
|
|
370
|
+
AgentCLI,
|
|
371
|
+
BatchExecutor,
|
|
372
|
+
CommandType,
|
|
373
|
+
ResponseStatus,
|
|
374
|
+
TelemetryService,
|
|
375
|
+
TelemetrySpan,
|
|
376
|
+
EventType,
|
|
377
|
+
telemetry,
|
|
378
|
+
EventStreamServer,
|
|
379
|
+
EventStreamClient,
|
|
380
|
+
PrometheusExporter,
|
|
381
|
+
JSONExporter,
|
|
382
|
+
NDJSONExporter,
|
|
383
|
+
ConsoleExporter
|
|
384
|
+
} from './agent/index';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB3+ Agent CLI Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
import { EventEmitter } from 'events';
|
|
5
|
+
|
|
6
|
+
export declare const CommandType: {
|
|
7
|
+
SET_PARAMETER: 'set_parameter';
|
|
8
|
+
GET_PARAMETER: 'get_parameter';
|
|
9
|
+
SET_GEOMETRY: 'set_geometry';
|
|
10
|
+
SET_SYSTEM: 'set_system';
|
|
11
|
+
ROTATE: 'rotate';
|
|
12
|
+
RESET_ROTATION: 'reset_rotation';
|
|
13
|
+
BATCH: 'batch';
|
|
14
|
+
BATCH_ROTATE: 'batch_rotate';
|
|
15
|
+
GET_METRICS: 'get_metrics';
|
|
16
|
+
GET_SPANS: 'get_spans';
|
|
17
|
+
FLUSH_TELEMETRY: 'flush_telemetry';
|
|
18
|
+
PING: 'ping';
|
|
19
|
+
STATUS: 'status';
|
|
20
|
+
HELP: 'help';
|
|
21
|
+
QUIT: 'quit';
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export declare const ResponseStatus: {
|
|
25
|
+
OK: 'ok';
|
|
26
|
+
ERROR: 'error';
|
|
27
|
+
PARTIAL: 'partial';
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export interface CLIOptions {
|
|
31
|
+
inputStream?: NodeJS.ReadableStream;
|
|
32
|
+
outputStream?: NodeJS.WritableStream;
|
|
33
|
+
errorStream?: NodeJS.WritableStream;
|
|
34
|
+
format?: 'jsonl' | 'json' | 'text';
|
|
35
|
+
pretty?: boolean;
|
|
36
|
+
enableTelemetry?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface CLICommand {
|
|
40
|
+
type: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface CLIResponse {
|
|
46
|
+
id?: string;
|
|
47
|
+
status: 'ok' | 'error' | 'partial';
|
|
48
|
+
result?: any;
|
|
49
|
+
error?: string;
|
|
50
|
+
durationMs?: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class AgentCLI extends EventEmitter {
|
|
54
|
+
engine: any;
|
|
55
|
+
options: CLIOptions;
|
|
56
|
+
constructor(engine: any, options?: CLIOptions);
|
|
57
|
+
start(): void;
|
|
58
|
+
stop(): void;
|
|
59
|
+
registerHandler(type: string, handler: (command: CLICommand) => any | Promise<any>): void;
|
|
60
|
+
execute(command: CLICommand): Promise<any>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class BatchExecutor {
|
|
64
|
+
cli: AgentCLI;
|
|
65
|
+
queue: CLICommand[];
|
|
66
|
+
results: Array<{ status: string; command: string; result?: any; error?: string }>;
|
|
67
|
+
constructor(cli: AgentCLI);
|
|
68
|
+
add(command: CLICommand): this;
|
|
69
|
+
execute(): Promise<Array<{ status: string; command: string; result?: any; error?: string }>>;
|
|
70
|
+
executeParallel(): Promise<Array<{ status: string; command: string; result?: any; error?: string }>>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface StreamingCLIResult {
|
|
74
|
+
cli: AgentCLI;
|
|
75
|
+
streamServer: any;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function createStreamingCLI(engine: any, httpServer: any, options?: CLIOptions): StreamingCLIResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB3+ SDK Agent Module Type Definitions
|
|
3
|
+
* @module @vib3code/sdk/agent
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ─── Re-exports ───
|
|
7
|
+
export { MCPServer, mcpServer, toolDefinitions, getToolList, getToolNames, getTool, validateToolInput } from './mcp';
|
|
8
|
+
export { AgentCLI, BatchExecutor, CommandType, ResponseStatus, createStreamingCLI } from './cli';
|
|
9
|
+
export {
|
|
10
|
+
TelemetryService, TelemetrySpan, EventType, SpanStatus,
|
|
11
|
+
withTelemetry, withTelemetrySync, telemetry,
|
|
12
|
+
PrometheusExporter, JSONExporter, NDJSONExporter, ConsoleExporter, createExporter,
|
|
13
|
+
StreamEventType, EventStreamServer, EventStreamClient, SSEConnection,
|
|
14
|
+
createSSEHandler, connectTelemetryToStream,
|
|
15
|
+
configureTelemetry, getTelemetry, trace, traceFunction,
|
|
16
|
+
traceAsyncIterable, instrumentClass, traceObject, withTiming,
|
|
17
|
+
meter, traceBatch, TraceContext
|
|
18
|
+
} from './telemetry';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB3+ MCP Server Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface ToolDefinition {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ToolResponse {
|
|
12
|
+
success: boolean;
|
|
13
|
+
operation: string;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
duration_ms?: number;
|
|
16
|
+
error?: {
|
|
17
|
+
type: string;
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
suggestion?: string;
|
|
21
|
+
};
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface RotationArgs {
|
|
26
|
+
XY?: number;
|
|
27
|
+
XZ?: number;
|
|
28
|
+
YZ?: number;
|
|
29
|
+
XW?: number;
|
|
30
|
+
YW?: number;
|
|
31
|
+
ZW?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface VisualParameterArgs {
|
|
35
|
+
hue?: number;
|
|
36
|
+
saturation?: number;
|
|
37
|
+
intensity?: number;
|
|
38
|
+
speed?: number;
|
|
39
|
+
chaos?: number;
|
|
40
|
+
morphFactor?: number;
|
|
41
|
+
gridDensity?: number;
|
|
42
|
+
dimension?: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GeometryArgs {
|
|
46
|
+
geometry_index?: number;
|
|
47
|
+
base_geometry?: number;
|
|
48
|
+
core_type?: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class MCPServer {
|
|
52
|
+
constructor(engine?: any);
|
|
53
|
+
setEngine(engine: any): void;
|
|
54
|
+
buildResponse(operation: string, data: Record<string, any>, options?: { success?: boolean; startTime?: number }): ToolResponse;
|
|
55
|
+
validateToolResponse(response: ToolResponse): ToolResponse;
|
|
56
|
+
handleToolCall(toolName: string, args?: Record<string, any>): Promise<ToolResponse>;
|
|
57
|
+
createVisualization(args: { system?: string; geometry_index?: number; projection?: string }): Promise<ToolResponse>;
|
|
58
|
+
setRotation(args: RotationArgs): ToolResponse;
|
|
59
|
+
setVisualParameters(args: VisualParameterArgs): ToolResponse;
|
|
60
|
+
switchSystem(args: { system: string }): Promise<ToolResponse>;
|
|
61
|
+
changeGeometry(args: GeometryArgs): ToolResponse;
|
|
62
|
+
getState(): ToolResponse;
|
|
63
|
+
randomizeParameters(args?: { preserve_system?: boolean; preserve_geometry?: boolean }): ToolResponse;
|
|
64
|
+
resetParameters(): ToolResponse;
|
|
65
|
+
saveToGallery(args: { name?: string }): ToolResponse;
|
|
66
|
+
loadFromGallery(args: { id?: number; name?: string }): ToolResponse;
|
|
67
|
+
searchGeometries(args: { core_type?: string; query?: string }): ToolResponse;
|
|
68
|
+
getParameterSchema(): ToolResponse;
|
|
69
|
+
getSDKContext(): ToolResponse;
|
|
70
|
+
listTools(includeSchemas?: boolean): ToolDefinition[];
|
|
71
|
+
setReactivityConfig(args: Record<string, any>): ToolResponse;
|
|
72
|
+
getReactivityConfig(): ToolResponse;
|
|
73
|
+
configureAudioBand(args: Record<string, any>): ToolResponse;
|
|
74
|
+
exportPackage(args: Record<string, any>): ToolResponse;
|
|
75
|
+
applyBehaviorPreset(args: { preset: string }): ToolResponse;
|
|
76
|
+
listBehaviorPresets(): ToolResponse;
|
|
77
|
+
describeVisualState(): ToolResponse;
|
|
78
|
+
batchSetParameters(args: { parameters: Record<string, any>[] }): Promise<ToolResponse>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const mcpServer: MCPServer;
|
|
82
|
+
export const toolDefinitions: ToolDefinition[];
|
|
83
|
+
|
|
84
|
+
export function getToolList(): ToolDefinition[];
|
|
85
|
+
export function getToolNames(): string[];
|
|
86
|
+
export function getTool(name: string): ToolDefinition | undefined;
|
|
87
|
+
export function validateToolInput(toolName: string, input: Record<string, any>): { valid: boolean; errors?: string[] };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB3+ Telemetry Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
import { EventEmitter } from 'events';
|
|
5
|
+
|
|
6
|
+
// ─── Event Types ───
|
|
7
|
+
|
|
8
|
+
export declare const EventType: {
|
|
9
|
+
TOOL_INVOCATION: string;
|
|
10
|
+
TOOL_ERROR: string;
|
|
11
|
+
SYSTEM_SWITCH: string;
|
|
12
|
+
PARAMETER_CHANGE: string;
|
|
13
|
+
RENDER_FRAME: string;
|
|
14
|
+
AUDIO_UPDATE: string;
|
|
15
|
+
ERROR: string;
|
|
16
|
+
LIFECYCLE: string;
|
|
17
|
+
PERFORMANCE: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export declare const SpanStatus: {
|
|
21
|
+
UNSET: 'unset';
|
|
22
|
+
OK: 'ok';
|
|
23
|
+
ERROR: 'error';
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// ─── TelemetrySpan ───
|
|
27
|
+
|
|
28
|
+
export interface SpanEvent {
|
|
29
|
+
name: string;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
attributes: Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class TelemetrySpan {
|
|
35
|
+
name: string;
|
|
36
|
+
traceId: string;
|
|
37
|
+
spanId: string;
|
|
38
|
+
parentSpanId: string | null;
|
|
39
|
+
startTime: number;
|
|
40
|
+
endTime: number | null;
|
|
41
|
+
duration: number | null;
|
|
42
|
+
status: string;
|
|
43
|
+
statusMessage: string | null;
|
|
44
|
+
attributes: Record<string, any>;
|
|
45
|
+
events: SpanEvent[];
|
|
46
|
+
|
|
47
|
+
constructor(name: string, traceId: string, parentSpanId?: string | null, attributes?: Record<string, any>);
|
|
48
|
+
addEvent(name: string, attributes?: Record<string, any>): void;
|
|
49
|
+
setAttribute(key: string, value: any): void;
|
|
50
|
+
setAttributes(attrs: Record<string, any>): void;
|
|
51
|
+
setStatus(status: string, message?: string | null): void;
|
|
52
|
+
end(): void;
|
|
53
|
+
toJSON(): Record<string, any>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ─── TelemetryService ───
|
|
57
|
+
|
|
58
|
+
export interface TelemetryOptions {
|
|
59
|
+
maxSpans?: number;
|
|
60
|
+
maxEvents?: number;
|
|
61
|
+
flushIntervalMs?: number;
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface TelemetryMetrics {
|
|
66
|
+
spans_total: number;
|
|
67
|
+
events_total: number;
|
|
68
|
+
errors_total: number;
|
|
69
|
+
tool_invocations: number;
|
|
70
|
+
render_frames: number;
|
|
71
|
+
[key: string]: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class TelemetryService {
|
|
75
|
+
constructor(options?: TelemetryOptions);
|
|
76
|
+
startTrace(): string;
|
|
77
|
+
getTraceId(): string;
|
|
78
|
+
createSpan(name: string, attributes?: Record<string, any>, parentSpanId?: string | null): TelemetrySpan;
|
|
79
|
+
recordSpan(span: TelemetrySpan): void;
|
|
80
|
+
recordEvent(type: string, attributes?: Record<string, any>): void;
|
|
81
|
+
subscribe(eventType: string, callback: (data: any) => void): () => void;
|
|
82
|
+
emit(eventType: string, data: any): void;
|
|
83
|
+
flush(): { spans: any[]; events: any[]; metrics: TelemetryMetrics };
|
|
84
|
+
getMetrics(): TelemetryMetrics;
|
|
85
|
+
getSpans(): TelemetrySpan[];
|
|
86
|
+
resetMetrics(): void;
|
|
87
|
+
setEnabled(enabled: boolean): void;
|
|
88
|
+
destroy(): void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const telemetry: TelemetryService;
|
|
92
|
+
|
|
93
|
+
export function withTelemetry<T>(service: TelemetryService, operationName: string, fn: (span: TelemetrySpan) => Promise<T>, attributes?: Record<string, any>): Promise<T>;
|
|
94
|
+
export function withTelemetrySync<T>(service: TelemetryService, operationName: string, fn: (span: TelemetrySpan) => T, attributes?: Record<string, any>): T;
|
|
95
|
+
|
|
96
|
+
// ─── Exporters ───
|
|
97
|
+
|
|
98
|
+
export class PrometheusExporter {
|
|
99
|
+
export(metrics: TelemetryMetrics): string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export class JSONExporter {
|
|
103
|
+
export(data: any): string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export class NDJSONExporter {
|
|
107
|
+
export(data: any[]): string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class ConsoleExporter {
|
|
111
|
+
export(data: any): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function createExporter(type: 'prometheus' | 'json' | 'ndjson' | 'console', options?: Record<string, any>): PrometheusExporter | JSONExporter | NDJSONExporter | ConsoleExporter;
|
|
115
|
+
|
|
116
|
+
// ─── Event Streaming ───
|
|
117
|
+
|
|
118
|
+
export declare const StreamEventType: {
|
|
119
|
+
SPAN_START: string;
|
|
120
|
+
SPAN_END: string;
|
|
121
|
+
METRIC: string;
|
|
122
|
+
ERROR: string;
|
|
123
|
+
HEARTBEAT: string;
|
|
124
|
+
TELEMETRY: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export interface StreamEvent {
|
|
128
|
+
type: string;
|
|
129
|
+
data: any;
|
|
130
|
+
id?: string;
|
|
131
|
+
channel?: string;
|
|
132
|
+
timestamp?: number;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class EventStreamServer extends EventEmitter {
|
|
136
|
+
constructor(options?: { heartbeatIntervalMs?: number; maxReplayBuffer?: number; channels?: string[] });
|
|
137
|
+
handleConnection(req: any, res: any, options?: { channel?: string; filters?: string[] }): void;
|
|
138
|
+
broadcast(event: StreamEvent, channel?: string): void;
|
|
139
|
+
sendTo(connectionId: string, event: StreamEvent): void;
|
|
140
|
+
streamTelemetry(telemetryEvent: any): void;
|
|
141
|
+
streamSpanStart(span: TelemetrySpan): void;
|
|
142
|
+
streamSpanEnd(span: TelemetrySpan): void;
|
|
143
|
+
streamMetric(name: string, value: number, labels?: Record<string, string>): void;
|
|
144
|
+
streamError(error: Error): void;
|
|
145
|
+
getConnectionIds(): string[];
|
|
146
|
+
closeConnection(connectionId: string): void;
|
|
147
|
+
close(): void;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export class SSEConnection {
|
|
151
|
+
id: string;
|
|
152
|
+
constructor(options: { req: any; res: any; channel?: string; filters?: string[] });
|
|
153
|
+
send(event: StreamEvent): void;
|
|
154
|
+
matchesChannel(channel: string): boolean;
|
|
155
|
+
matchesFilters(event: StreamEvent): boolean;
|
|
156
|
+
close(): void;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export class EventStreamClient extends EventEmitter {
|
|
160
|
+
constructor(url: string, options?: { autoReconnect?: boolean; maxRetries?: number; retryDelayMs?: number });
|
|
161
|
+
connect(): void;
|
|
162
|
+
disconnect(): void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function createSSEHandler(server: EventStreamServer): (req: any, res: any) => void;
|
|
166
|
+
export function connectTelemetryToStream(telemetryService: TelemetryService, streamServer: EventStreamServer): void;
|
|
167
|
+
|
|
168
|
+
// ─── Instrumentation ───
|
|
169
|
+
|
|
170
|
+
export function configureTelemetry(telemetryService: TelemetryService): void;
|
|
171
|
+
export function getTelemetry(): TelemetryService;
|
|
172
|
+
|
|
173
|
+
export interface TraceOptions {
|
|
174
|
+
attributes?: Record<string, any>;
|
|
175
|
+
recordArgs?: boolean;
|
|
176
|
+
recordResult?: boolean;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function trace(spanName: string, options?: TraceOptions): MethodDecorator;
|
|
180
|
+
export function traceFunction<T extends (...args: any[]) => any>(fn: T, name?: string, options?: TraceOptions): T;
|
|
181
|
+
export function traceAsyncIterable<T>(iterable: AsyncIterable<T>, name: string, options?: TraceOptions): AsyncIterable<T>;
|
|
182
|
+
export function instrumentClass(ClassConstructor: new (...args: any[]) => any, options?: { methods?: string[]; exclude?: string[] }): void;
|
|
183
|
+
export function traceObject(target: Record<string, any>, name: string, options?: { methods?: string[] }): Record<string, any>;
|
|
184
|
+
export function withTiming<T>(fn: () => T, callback: (durationMs: number) => void): T;
|
|
185
|
+
export function meter(metricName: string, options?: { unit?: string; description?: string }): (value: number, labels?: Record<string, string>) => void;
|
|
186
|
+
export function traceBatch(operations: Array<() => any>, name: string): Promise<any[]>;
|
|
187
|
+
|
|
188
|
+
export class TraceContext {
|
|
189
|
+
constructor(telemetry: TelemetryService);
|
|
190
|
+
}
|
|
@@ -14,6 +14,8 @@ export type BackendType = 'webgl' | 'webgpu' | 'direct-webgl' | null;
|
|
|
14
14
|
|
|
15
15
|
/** VIB3Engine constructor options */
|
|
16
16
|
export interface VIB3EngineOptions {
|
|
17
|
+
/** Initial system to create (default: 'quantum') */
|
|
18
|
+
system?: SystemName;
|
|
17
19
|
/** Prefer WebGPU with WebGL fallback (default: true) */
|
|
18
20
|
preferWebGPU?: boolean;
|
|
19
21
|
/** Enable debug logging (default: false) */
|
|
@@ -195,6 +197,30 @@ export declare class VIB3Engine {
|
|
|
195
197
|
/** Import engine state (restores system, parameters, and reactivity) */
|
|
196
198
|
importState(state: Partial<VIB3EngineState>): Promise<void>;
|
|
197
199
|
|
|
200
|
+
// ========================================================================
|
|
201
|
+
// Convenience Methods
|
|
202
|
+
// ========================================================================
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Create a parameter update callback for creative modules.
|
|
206
|
+
* Returns `(name, value) => void` that calls `setParameter` internally.
|
|
207
|
+
* Eliminates boilerplate wiring.
|
|
208
|
+
*/
|
|
209
|
+
createParameterCallback(): (name: string, value: number) => void;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Get current breath value from VitalitySystem (0-1).
|
|
213
|
+
* Avoids reaching into `engine.vitality.getBreath()` directly.
|
|
214
|
+
*/
|
|
215
|
+
getBreath(): number;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Register a listener for parameter changes.
|
|
219
|
+
* Callback receives the full parameter object after each change.
|
|
220
|
+
* @returns Unsubscribe function
|
|
221
|
+
*/
|
|
222
|
+
onParameterChange(callback: (params: Record<string, number>) => void): () => void;
|
|
223
|
+
|
|
198
224
|
// ========================================================================
|
|
199
225
|
// Lifecycle
|
|
200
226
|
// ========================================================================
|