@holoscript/engine 6.0.3 → 6.0.4

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 (192) hide show
  1. package/dist/AutoMesher-CK47F6AV.js +17 -0
  2. package/dist/GPUBuffers-2LHBCD7X.js +9 -0
  3. package/dist/WebGPUContext-TNEUYU2Y.js +11 -0
  4. package/dist/animation/index.cjs +38 -38
  5. package/dist/animation/index.d.cts +1 -1
  6. package/dist/animation/index.d.ts +1 -1
  7. package/dist/animation/index.js +1 -1
  8. package/dist/audio/index.cjs +16 -6
  9. package/dist/audio/index.d.cts +1 -1
  10. package/dist/audio/index.d.ts +1 -1
  11. package/dist/audio/index.js +1 -1
  12. package/dist/camera/index.cjs +23 -23
  13. package/dist/camera/index.d.cts +1 -1
  14. package/dist/camera/index.d.ts +1 -1
  15. package/dist/camera/index.js +1 -1
  16. package/dist/character/index.cjs +6 -4
  17. package/dist/character/index.js +1 -1
  18. package/dist/choreography/index.cjs +1194 -0
  19. package/dist/choreography/index.d.cts +687 -0
  20. package/dist/choreography/index.d.ts +687 -0
  21. package/dist/choreography/index.js +1156 -0
  22. package/dist/chunk-2CSNRI2N.js +217 -0
  23. package/dist/chunk-33T2WINR.js +266 -0
  24. package/dist/chunk-35R73OFM.js +1257 -0
  25. package/dist/chunk-4MMDSUNP.js +1256 -0
  26. package/dist/chunk-5V6HOU72.js +319 -0
  27. package/dist/chunk-6QOP6PYF.js +1038 -0
  28. package/dist/chunk-7KMJVHIL.js +8944 -0
  29. package/dist/chunk-7VPUC62U.js +1106 -0
  30. package/dist/chunk-A2Y6RCAT.js +1878 -0
  31. package/dist/chunk-AHM42MK6.js +8944 -0
  32. package/dist/chunk-BL7IDTHE.js +218 -0
  33. package/dist/chunk-CITOMSWL.js +10462 -0
  34. package/dist/chunk-CXDPKW2K.js +8944 -0
  35. package/dist/chunk-CXZPLD4S.js +223 -0
  36. package/dist/chunk-CZYJE7IH.js +5169 -0
  37. package/dist/chunk-D2OP7YC7.js +6325 -0
  38. package/dist/chunk-EDRVQHUU.js +1544 -0
  39. package/dist/chunk-EJSLOOW2.js +3589 -0
  40. package/dist/chunk-F53SFGW5.js +1878 -0
  41. package/dist/chunk-HCFPELPY.js +919 -0
  42. package/dist/chunk-HNEE36PY.js +93 -0
  43. package/dist/chunk-HYXNV36F.js +1256 -0
  44. package/dist/chunk-IB7KHVFY.js +821 -0
  45. package/dist/chunk-IBBO7YYG.js +690 -0
  46. package/dist/chunk-ILIBGINU.js +5470 -0
  47. package/dist/chunk-IS4MHLKN.js +5479 -0
  48. package/dist/chunk-JT2PFKWD.js +5479 -0
  49. package/dist/chunk-K4CUB4NY.js +1038 -0
  50. package/dist/chunk-KATDQXRJ.js +10462 -0
  51. package/dist/chunk-KBQE6ZFJ.js +8944 -0
  52. package/dist/chunk-KBVD5K7E.js +560 -0
  53. package/dist/chunk-KCDPVQRY.js +4088 -0
  54. package/dist/chunk-KN4QJPKN.js +8944 -0
  55. package/dist/chunk-KWJ3ROSI.js +8944 -0
  56. package/dist/chunk-L45VF6DD.js +919 -0
  57. package/dist/chunk-LY4T37YK.js +307 -0
  58. package/dist/chunk-MDN5WZXA.js +1544 -0
  59. package/dist/chunk-MGCDP6VU.js +928 -0
  60. package/dist/chunk-NCX7X6G2.js +8681 -0
  61. package/dist/chunk-OF54BPVD.js +913 -0
  62. package/dist/chunk-OWSN2Q3Q.js +690 -0
  63. package/dist/chunk-PRRB5TTA.js +406 -0
  64. package/dist/chunk-PXWVQF76.js +4086 -0
  65. package/dist/chunk-PYCOIDT2.js +812 -0
  66. package/dist/chunk-PZCSADOV.js +928 -0
  67. package/dist/chunk-Q2XBVS2K.js +1038 -0
  68. package/dist/chunk-QDZRXWN5.js +1776 -0
  69. package/dist/chunk-RNWOZ6WQ.js +913 -0
  70. package/dist/chunk-ROLFT4CJ.js +1693 -0
  71. package/dist/chunk-SLTJRZ2N.js +266 -0
  72. package/dist/chunk-SRUS5XSU.js +4088 -0
  73. package/dist/chunk-TKCA3WZ5.js +5409 -0
  74. package/dist/chunk-TNRMXYI2.js +1650 -0
  75. package/dist/chunk-TQB3GJGM.js +9763 -0
  76. package/dist/chunk-TUFGXG6K.js +510 -0
  77. package/dist/chunk-U6KMTGQJ.js +632 -0
  78. package/dist/chunk-VMGJQST6.js +8681 -0
  79. package/dist/chunk-X4F4TCG4.js +5470 -0
  80. package/dist/chunk-ZIFROE75.js +1544 -0
  81. package/dist/chunk-ZIJQYHSQ.js +1204 -0
  82. package/dist/combat/index.cjs +4 -4
  83. package/dist/combat/index.d.cts +1 -1
  84. package/dist/combat/index.d.ts +1 -1
  85. package/dist/combat/index.js +1 -1
  86. package/dist/ecs/index.cjs +1 -1
  87. package/dist/ecs/index.js +1 -1
  88. package/dist/environment/index.cjs +14 -14
  89. package/dist/environment/index.d.cts +1 -1
  90. package/dist/environment/index.d.ts +1 -1
  91. package/dist/environment/index.js +1 -1
  92. package/dist/gpu/index.cjs +4810 -0
  93. package/dist/gpu/index.js +3714 -0
  94. package/dist/hologram/index.cjs +27 -1
  95. package/dist/hologram/index.js +1 -1
  96. package/dist/index-B2PIsAmR.d.cts +2180 -0
  97. package/dist/index-B2PIsAmR.d.ts +2180 -0
  98. package/dist/index-BHySEPX7.d.cts +2921 -0
  99. package/dist/index-BJV21zuy.d.cts +341 -0
  100. package/dist/index-BJV21zuy.d.ts +341 -0
  101. package/dist/index-BQutTphC.d.cts +790 -0
  102. package/dist/index-ByIq2XrS.d.cts +3910 -0
  103. package/dist/index-BysHjDSO.d.cts +224 -0
  104. package/dist/index-BysHjDSO.d.ts +224 -0
  105. package/dist/index-CKwAJGck.d.ts +455 -0
  106. package/dist/index-CUl3QstQ.d.cts +3006 -0
  107. package/dist/index-CUl3QstQ.d.ts +3006 -0
  108. package/dist/index-CmYtNiI-.d.cts +953 -0
  109. package/dist/index-CmYtNiI-.d.ts +953 -0
  110. package/dist/index-CnRzWxi_.d.cts +522 -0
  111. package/dist/index-CnRzWxi_.d.ts +522 -0
  112. package/dist/index-CwRWbSC7.d.ts +2921 -0
  113. package/dist/index-CxKIBstO.d.ts +790 -0
  114. package/dist/index-DJ6-R8vh.d.cts +455 -0
  115. package/dist/index-DQKisbcI.d.cts +4968 -0
  116. package/dist/index-DQKisbcI.d.ts +4968 -0
  117. package/dist/index-DRT2zJez.d.ts +3910 -0
  118. package/dist/index-DfNLiAka.d.cts +192 -0
  119. package/dist/index-DfNLiAka.d.ts +192 -0
  120. package/dist/index-nMvkoRm8.d.cts +405 -0
  121. package/dist/index-nMvkoRm8.d.ts +405 -0
  122. package/dist/index-s9yOFU37.d.cts +604 -0
  123. package/dist/index-s9yOFU37.d.ts +604 -0
  124. package/dist/index.cjs +22966 -6960
  125. package/dist/index.d.cts +864 -20
  126. package/dist/index.d.ts +864 -20
  127. package/dist/index.js +3062 -48
  128. package/dist/input/index.cjs +1 -1
  129. package/dist/input/index.js +1 -1
  130. package/dist/orbital/index.cjs +3 -3
  131. package/dist/orbital/index.d.cts +1 -1
  132. package/dist/orbital/index.d.ts +1 -1
  133. package/dist/orbital/index.js +1 -1
  134. package/dist/particles/index.cjs +16 -16
  135. package/dist/particles/index.d.cts +1 -1
  136. package/dist/particles/index.d.ts +1 -1
  137. package/dist/particles/index.js +1 -1
  138. package/dist/physics/index.cjs +2377 -21
  139. package/dist/physics/index.d.cts +1 -1
  140. package/dist/physics/index.d.ts +1 -1
  141. package/dist/physics/index.js +35 -1
  142. package/dist/postfx/index.cjs +3491 -0
  143. package/dist/postfx/index.js +93 -0
  144. package/dist/procedural/index.cjs +1 -1
  145. package/dist/procedural/index.js +1 -1
  146. package/dist/puppeteer-5VF6KDVO.js +52197 -0
  147. package/dist/puppeteer-IZVZ3SG4.js +52197 -0
  148. package/dist/rendering/index.cjs +33 -32
  149. package/dist/rendering/index.d.cts +1 -1
  150. package/dist/rendering/index.d.ts +1 -1
  151. package/dist/rendering/index.js +8 -6
  152. package/dist/runtime/index.cjs +23 -13
  153. package/dist/runtime/index.d.cts +1 -1
  154. package/dist/runtime/index.d.ts +1 -1
  155. package/dist/runtime/index.js +8 -6
  156. package/dist/runtime/protocols/index.cjs +349 -0
  157. package/dist/runtime/protocols/index.js +15 -0
  158. package/dist/scene/index.cjs +8 -8
  159. package/dist/scene/index.d.cts +1 -1
  160. package/dist/scene/index.d.ts +1 -1
  161. package/dist/scene/index.js +1 -1
  162. package/dist/shader/index.cjs +3087 -0
  163. package/dist/shader/index.js +3044 -0
  164. package/dist/simulation/index.cjs +10680 -0
  165. package/dist/simulation/index.d.cts +3 -0
  166. package/dist/simulation/index.d.ts +3 -0
  167. package/dist/simulation/index.js +307 -0
  168. package/dist/spatial/index.cjs +2443 -0
  169. package/dist/spatial/index.d.cts +1545 -0
  170. package/dist/spatial/index.d.ts +1545 -0
  171. package/dist/spatial/index.js +2400 -0
  172. package/dist/terrain/index.cjs +1 -1
  173. package/dist/terrain/index.d.cts +1 -1
  174. package/dist/terrain/index.d.ts +1 -1
  175. package/dist/terrain/index.js +1 -1
  176. package/dist/transformers.node-4NKAPD5U.js +45620 -0
  177. package/dist/vm/index.cjs +7 -8
  178. package/dist/vm/index.d.cts +1 -1
  179. package/dist/vm/index.d.ts +1 -1
  180. package/dist/vm/index.js +1 -1
  181. package/dist/vm-bridge/index.cjs +2 -2
  182. package/dist/vm-bridge/index.d.cts +2 -2
  183. package/dist/vm-bridge/index.d.ts +2 -2
  184. package/dist/vm-bridge/index.js +1 -1
  185. package/dist/vr/index.cjs +6 -6
  186. package/dist/vr/index.js +1 -1
  187. package/dist/world/index.cjs +3 -3
  188. package/dist/world/index.d.cts +1 -1
  189. package/dist/world/index.d.ts +1 -1
  190. package/dist/world/index.js +1 -1
  191. package/package.json +53 -21
  192. package/LICENSE +0 -21
@@ -0,0 +1,3006 @@
1
+ import { HoloComposition, PhonemeTimestamp, Vector3, StateMachineNode, SemanticSOP, CulturalMemory, VREffect, NormViolation, EpisodicMemory, StigmergicTrace, CulturalNorm, NormProposal, NormEngine, RaycastHit, VRHand, TraitContext, HostCapabilities, HSPlusNode, ReactiveState, HSPlusAST } from '@holoscript/core';
2
+ import * as THREE from 'three';
3
+
4
+ /**
5
+ * RuntimeRegistry.ts
6
+ *
7
+ * Central registry for HoloScript runtime modules.
8
+ * Allows Hololand to discover and execute runtimes dynamically.
9
+ */
10
+
11
+ interface RuntimeModule {
12
+ /** Runtime identifier */
13
+ id: string;
14
+ /** Runtime name */
15
+ name: string;
16
+ /** Runtime version */
17
+ version: string;
18
+ /** Supported composition types */
19
+ supportedTypes: string[];
20
+ /** Initialize runtime from composition */
21
+ initialize(composition: HoloComposition, config?: any): RuntimeExecutor;
22
+ /** Runtime capabilities */
23
+ capabilities: RuntimeCapabilities;
24
+ /** Runtime metadata */
25
+ metadata: RuntimeMetadata;
26
+ }
27
+ interface RuntimeExecutor {
28
+ /** Start execution */
29
+ start(): void;
30
+ /** Stop execution */
31
+ stop(): void;
32
+ /** Pause execution */
33
+ pause(): void;
34
+ /** Resume execution */
35
+ resume(): void;
36
+ /** Update runtime (called per frame) */
37
+ update(dt: number): void;
38
+ /** Get runtime statistics */
39
+ getStatistics(): any;
40
+ /** Get runtime state */
41
+ getState(): any;
42
+ /** Reset runtime */
43
+ reset(): void;
44
+ }
45
+ interface RuntimeCapabilities {
46
+ /** Physics simulation */
47
+ physics?: {
48
+ gravity: boolean;
49
+ collision: boolean;
50
+ constraints: boolean;
51
+ softBody: boolean;
52
+ fluids: boolean;
53
+ };
54
+ /** Rendering capabilities */
55
+ rendering?: {
56
+ particles: boolean;
57
+ lighting: boolean;
58
+ shadows: boolean;
59
+ postProcessing: boolean;
60
+ };
61
+ /** Interaction capabilities */
62
+ interaction?: {
63
+ userInput: boolean;
64
+ gestures: boolean;
65
+ voice: boolean;
66
+ haptics: boolean;
67
+ };
68
+ /** Platform support */
69
+ platforms?: string[];
70
+ /** Performance metrics */
71
+ performance?: {
72
+ maxEntities: number;
73
+ maxParticles: number;
74
+ targetFPS: number;
75
+ };
76
+ }
77
+ interface RuntimeMetadata {
78
+ /** Author */
79
+ author?: string;
80
+ /** Description */
81
+ description?: string;
82
+ /** Documentation URL */
83
+ documentation?: string;
84
+ /** Repository URL */
85
+ repository?: string;
86
+ /** License */
87
+ license?: string;
88
+ /** Tags */
89
+ tags?: string[];
90
+ }
91
+ /**
92
+ * Runtime Registry - Central registry for all HoloScript runtimes
93
+ */
94
+ declare class RuntimeRegistryClass {
95
+ private runtimes;
96
+ /**
97
+ * Register a runtime module
98
+ */
99
+ register(runtime: RuntimeModule): void;
100
+ /**
101
+ * Unregister a runtime module
102
+ */
103
+ unregister(runtimeId: string): boolean;
104
+ /**
105
+ * Get runtime by ID
106
+ */
107
+ get(runtimeId: string): RuntimeModule | undefined;
108
+ /**
109
+ * Check if runtime is registered
110
+ */
111
+ has(runtimeId: string): boolean;
112
+ /**
113
+ * Get all registered runtimes
114
+ */
115
+ getAll(): RuntimeModule[];
116
+ /**
117
+ * Get runtime IDs
118
+ */
119
+ getIds(): string[];
120
+ /**
121
+ * Find runtimes by type
122
+ */
123
+ findByType(type: string): RuntimeModule[];
124
+ /**
125
+ * Find runtimes by capability
126
+ */
127
+ findByCapability(capability: string): RuntimeModule[];
128
+ /**
129
+ * Find runtimes by tag
130
+ */
131
+ findByTag(tag: string): RuntimeModule[];
132
+ /**
133
+ * Execute composition with appropriate runtime
134
+ */
135
+ execute(composition: HoloComposition, config?: any): RuntimeExecutor | null;
136
+ /**
137
+ * Get registry statistics
138
+ */
139
+ getStatistics(): {
140
+ totalRuntimes: number;
141
+ runtimes: {
142
+ id: string;
143
+ name: string;
144
+ version: string;
145
+ types: string[];
146
+ tags: string[];
147
+ }[];
148
+ };
149
+ /**
150
+ * Clear all runtimes (mainly for testing)
151
+ */
152
+ clear(): void;
153
+ }
154
+ declare const RuntimeRegistry: RuntimeRegistryClass;
155
+ /**
156
+ * Decorator for registering runtime modules
157
+ */
158
+ declare function registerRuntime(runtime: RuntimeModule): RuntimeModule;
159
+
160
+ /**
161
+ * RuntimeRenderer.ts
162
+ *
163
+ * Abstract runtime renderer interface.
164
+ * Bridges HoloScript runtime physics → visual rendering backends.
165
+ */
166
+
167
+ /**
168
+ * Renderable object in 3D space
169
+ */
170
+ interface RenderableObject {
171
+ id: string;
172
+ type: string;
173
+ position: [number, number, number];
174
+ rotation?: [number, number, number];
175
+ scale?: [number, number, number];
176
+ geometry?: {
177
+ type: string;
178
+ size?: number | [number, number, number];
179
+ radius?: number;
180
+ height?: number;
181
+ segments?: number;
182
+ };
183
+ material?: {
184
+ type?: string;
185
+ color?: string;
186
+ roughness?: number;
187
+ metalness?: number;
188
+ opacity?: number;
189
+ transparent?: boolean;
190
+ [key: string]: unknown;
191
+ };
192
+ visible?: boolean;
193
+ castShadow?: boolean;
194
+ receiveShadow?: boolean;
195
+ }
196
+ /**
197
+ * Particle system configuration
198
+ */
199
+ interface ParticleSystem {
200
+ id: string;
201
+ maxParticles: number;
202
+ positions: Float32Array;
203
+ velocities?: Float32Array;
204
+ colors?: Float32Array;
205
+ sizes?: Float32Array;
206
+ lifetimes?: Float32Array;
207
+ material?: {
208
+ type?: string;
209
+ color?: string;
210
+ size?: number;
211
+ opacity?: number;
212
+ blending?: string;
213
+ };
214
+ }
215
+ /**
216
+ * Light configuration
217
+ */
218
+ interface RenderableLight {
219
+ id: string;
220
+ type: 'directional' | 'point' | 'spot' | 'hemisphere' | 'ambient' | 'area';
221
+ position?: [number, number, number];
222
+ color?: string;
223
+ intensity?: number;
224
+ castShadow?: boolean;
225
+ target?: [number, number, number];
226
+ }
227
+ /**
228
+ * Camera configuration
229
+ */
230
+ interface RenderableCamera {
231
+ position: [number, number, number];
232
+ target: [number, number, number];
233
+ fov?: number;
234
+ aspect?: number;
235
+ near?: number;
236
+ far?: number;
237
+ }
238
+ /**
239
+ * Post-processing effects
240
+ */
241
+ interface PostProcessingEffect {
242
+ type: string;
243
+ enabled: boolean;
244
+ params?: Record<string, unknown>;
245
+ }
246
+ /**
247
+ * Abstract Runtime Renderer
248
+ */
249
+ interface RuntimeRenderer {
250
+ /**
251
+ * Initialize renderer with composition
252
+ */
253
+ initialize(composition: HoloComposition, config?: RendererConfig): void;
254
+ /**
255
+ * Start rendering loop
256
+ */
257
+ start(): void;
258
+ /**
259
+ * Stop rendering loop
260
+ */
261
+ stop(): void;
262
+ /**
263
+ * Update scene (called per frame)
264
+ */
265
+ update(deltaTime: number): void;
266
+ /**
267
+ * Render single frame
268
+ */
269
+ render(): void;
270
+ /**
271
+ * Add object to scene
272
+ */
273
+ addObject(object: RenderableObject): void;
274
+ /**
275
+ * Remove object from scene
276
+ */
277
+ removeObject(objectId: string): void;
278
+ /**
279
+ * Update object transform
280
+ */
281
+ updateObjectTransform(objectId: string, transform: {
282
+ position?: [number, number, number];
283
+ rotation?: [number, number, number];
284
+ scale?: [number, number, number];
285
+ }): void;
286
+ /**
287
+ * Add particle system
288
+ */
289
+ addParticleSystem(system: ParticleSystem): void;
290
+ /**
291
+ * Update particle system
292
+ */
293
+ updateParticleSystem(systemId: string, positions: Float32Array, colors?: Float32Array): void;
294
+ /**
295
+ * Remove particle system
296
+ */
297
+ removeParticleSystem(systemId: string): void;
298
+ /**
299
+ * Add light to scene
300
+ */
301
+ addLight(light: RenderableLight): void;
302
+ /**
303
+ * Update camera
304
+ */
305
+ updateCamera(camera: RenderableCamera): void;
306
+ /**
307
+ * Enable post-processing effect
308
+ */
309
+ enablePostProcessing(effect: PostProcessingEffect): void;
310
+ /**
311
+ * Get renderer statistics
312
+ */
313
+ getStatistics(): RendererStatistics;
314
+ /**
315
+ * Resize renderer
316
+ */
317
+ resize(width: number, height: number): void;
318
+ /**
319
+ * Dispose renderer and free resources
320
+ */
321
+ dispose(): void;
322
+ }
323
+ /**
324
+ * Renderer configuration
325
+ */
326
+ interface RendererConfig {
327
+ canvas?: HTMLCanvasElement;
328
+ width?: number;
329
+ height?: number;
330
+ backgroundColor?: string;
331
+ antialias?: boolean;
332
+ shadows?: boolean;
333
+ physicallyCorrectLights?: boolean;
334
+ toneMapping?: string;
335
+ toneMappingExposure?: number;
336
+ outputEncoding?: string;
337
+ maxLights?: number;
338
+ debug?: boolean;
339
+ }
340
+ /**
341
+ * Renderer statistics
342
+ */
343
+ interface RendererStatistics {
344
+ fps: number;
345
+ frameTime: number;
346
+ drawCalls: number;
347
+ triangles: number;
348
+ points: number;
349
+ lines: number;
350
+ objects: number;
351
+ lights: number;
352
+ textures: number;
353
+ programs: number;
354
+ memoryUsage?: {
355
+ geometries: number;
356
+ textures: number;
357
+ };
358
+ }
359
+ /**
360
+ * Base renderer implementation with common logic
361
+ */
362
+ declare abstract class BaseRuntimeRenderer implements RuntimeRenderer {
363
+ protected composition?: HoloComposition;
364
+ protected config: RendererConfig;
365
+ protected isRunning: boolean;
366
+ protected objects: Map<string, RenderableObject>;
367
+ protected particleSystems: Map<string, ParticleSystem>;
368
+ protected lights: Map<string, RenderableLight>;
369
+ protected camera?: RenderableCamera;
370
+ constructor(config?: RendererConfig);
371
+ abstract initialize(composition: HoloComposition, config?: RendererConfig): void;
372
+ abstract start(): void;
373
+ abstract stop(): void;
374
+ abstract update(deltaTime: number): void;
375
+ abstract render(): void;
376
+ abstract addObject(object: RenderableObject): void;
377
+ abstract removeObject(objectId: string): void;
378
+ abstract updateObjectTransform(objectId: string, transform: {
379
+ position?: [number, number, number];
380
+ rotation?: [number, number, number];
381
+ scale?: [number, number, number];
382
+ }): void;
383
+ abstract addParticleSystem(system: ParticleSystem): void;
384
+ abstract updateParticleSystem(systemId: string, positions: Float32Array, colors?: Float32Array): void;
385
+ abstract removeParticleSystem(systemId: string): void;
386
+ abstract addLight(light: RenderableLight): void;
387
+ abstract updateCamera(camera: RenderableCamera): void;
388
+ abstract enablePostProcessing(effect: PostProcessingEffect): void;
389
+ abstract getStatistics(): RendererStatistics;
390
+ abstract resize(width: number, height: number): void;
391
+ abstract dispose(): void;
392
+ }
393
+
394
+ /**
395
+ * ThreeJSRenderer.ts
396
+ *
397
+ * Three.js implementation of RuntimeRenderer.
398
+ * Uses R3FCompiler's material presets and type mappings for runtime rendering.
399
+ */
400
+
401
+ interface TransformSpec {
402
+ position?: [number, number, number];
403
+ rotation?: [number, number, number];
404
+ scale?: [number, number, number];
405
+ }
406
+ /**
407
+ * Three.js Runtime Renderer
408
+ *
409
+ * Renders HoloScript compositions using Three.js at runtime.
410
+ * Extracts rendering knowledge from R3FCompiler for direct execution.
411
+ */
412
+ declare class ThreeJSRenderer extends BaseRuntimeRenderer {
413
+ private scene;
414
+ private renderer;
415
+ private activeCamera;
416
+ private meshes;
417
+ private particleGeometries;
418
+ private particleMeshes;
419
+ private lightObjects;
420
+ private animationFrameId?;
421
+ private clock;
422
+ private composer;
423
+ private renderPass;
424
+ private bloomPass;
425
+ private bokehPass;
426
+ private ssaoPass;
427
+ private enabledEffects;
428
+ private instancedMeshes;
429
+ private instanceMatrices;
430
+ private instanceCounts;
431
+ private maxInstancesPerType;
432
+ private enableInstancing;
433
+ private stats;
434
+ constructor(config?: RendererConfig);
435
+ /**
436
+ * Initialize renderer with composition
437
+ */
438
+ initialize(composition: HoloComposition, config?: RendererConfig): void;
439
+ /**
440
+ * Initialize Three.js scene (lazy loaded)
441
+ */
442
+ private initializeThreeJS;
443
+ /**
444
+ * Load composition into Three.js scene
445
+ */
446
+ private loadComposition;
447
+ /**
448
+ * Add default lighting to scene
449
+ */
450
+ private addDefaultLighting;
451
+ /**
452
+ * Start rendering loop
453
+ */
454
+ start(): void;
455
+ /**
456
+ * Stop rendering loop
457
+ */
458
+ stop(): void;
459
+ /**
460
+ * Animation loop
461
+ */
462
+ private animate;
463
+ /**
464
+ * Update scene
465
+ */
466
+ update(_deltaTime: number): void;
467
+ /**
468
+ * Render frame
469
+ */
470
+ render(): void;
471
+ /**
472
+ * Add object to scene
473
+ */
474
+ addObject(object: RenderableObject): void;
475
+ /**
476
+ * Create geometry from specification
477
+ */
478
+ private static getThreeLib;
479
+ private createGeometry;
480
+ /**
481
+ * Create material using R3FCompiler presets
482
+ */
483
+ private createMaterial;
484
+ /**
485
+ * Remove object from scene
486
+ */
487
+ removeObject(objectId: string): void;
488
+ /**
489
+ * Update object transform
490
+ */
491
+ updateObjectTransform(objectId: string, transform: TransformSpec): void;
492
+ /**
493
+ * Add particle system
494
+ */
495
+ addParticleSystem(system: ParticleSystem): void;
496
+ /**
497
+ * Update particle system
498
+ */
499
+ updateParticleSystem(systemId: string, positions: Float32Array, colors?: Float32Array): void;
500
+ /**
501
+ * Remove particle system
502
+ */
503
+ removeParticleSystem(systemId: string): void;
504
+ /**
505
+ * Add light to scene
506
+ */
507
+ addLight(light: RenderableLight): void;
508
+ /**
509
+ * Update camera
510
+ */
511
+ updateCamera(camera: RenderableCamera): void;
512
+ /**
513
+ * Initialize post-processing pipeline
514
+ */
515
+ private initializePostProcessing;
516
+ /**
517
+ * Enable post-processing effect
518
+ */
519
+ enablePostProcessing(effect: PostProcessingEffect): void;
520
+ /**
521
+ * Enable/disable frustum culling optimization
522
+ * Automatically enabled by Three.js, but can be toggled per object
523
+ */
524
+ enableFrustumCulling(enable: boolean): void;
525
+ /**
526
+ * Optimize geometry by merging vertices and reducing complexity
527
+ * This is a simple optimization that can reduce memory usage
528
+ */
529
+ optimizeGeometries(): void;
530
+ /**
531
+ * Set Level of Detail (LOD) for objects based on distance from camera
532
+ * Objects far from camera use simpler geometry
533
+ */
534
+ updateLOD(): void;
535
+ /**
536
+ * Enable automatic performance optimizations
537
+ * Runs optimization passes periodically
538
+ */
539
+ private performanceOptimizationFrame;
540
+ enableAutoOptimization(enable: boolean): void;
541
+ /**
542
+ * Get renderer statistics
543
+ */
544
+ getStatistics(): RendererStatistics;
545
+ /**
546
+ * Resize renderer
547
+ */
548
+ resize(width: number, height: number): void;
549
+ /**
550
+ * Dispose renderer and free resources
551
+ */
552
+ dispose(): void;
553
+ }
554
+
555
+ /**
556
+ * InstancedMeshManager.ts
557
+ *
558
+ * GPU instancing system for rendering massive numbers of similar objects.
559
+ * Reduces draw calls from 10,000 to ~10 for extreme performance.
560
+ *
561
+ * Performance Impact:
562
+ * - Without instancing: 1,000 objects = 1,000 draw calls = ~30 FPS
563
+ * - With instancing: 10,000 objects = ~10 draw calls = 60 FPS
564
+ */
565
+
566
+ interface InstancedObjectData {
567
+ /** Unique instance ID */
568
+ id: string;
569
+ /** Position [x, y, z] */
570
+ position: [number, number, number];
571
+ /** Rotation [x, y, z] (Euler angles) */
572
+ rotation: [number, number, number];
573
+ /** Scale [x, y, z] */
574
+ scale: [number, number, number];
575
+ /** Color (hex string or RGB) */
576
+ color?: string | [number, number, number];
577
+ /** Custom user data */
578
+ userData?: any;
579
+ }
580
+ interface InstanceBatchConfig {
581
+ /** Geometry type */
582
+ geometryType: 'box' | 'sphere' | 'cylinder' | 'custom';
583
+ /** Geometry parameters (e.g., size for box) */
584
+ geometryParams?: any;
585
+ /** Material configuration */
586
+ material: {
587
+ type: 'standard' | 'basic' | 'physical';
588
+ color?: string;
589
+ metalness?: number;
590
+ roughness?: number;
591
+ emissive?: string;
592
+ opacity?: number;
593
+ transparent?: boolean;
594
+ };
595
+ /** Maximum instances this batch can hold */
596
+ maxInstances: number;
597
+ /** Custom geometry (if geometryType is 'custom') */
598
+ customGeometry?: THREE.BufferGeometry;
599
+ }
600
+ interface InstanceBatchStats {
601
+ /** Number of active instances */
602
+ activeCount: number;
603
+ /** Maximum capacity */
604
+ maxInstances: number;
605
+ /** Utilization percentage */
606
+ utilization: number;
607
+ /** Geometry type */
608
+ geometryType: string;
609
+ /** Material type */
610
+ materialType: string;
611
+ }
612
+ /**
613
+ * Manages multiple batches of instanced meshes
614
+ */
615
+ declare class InstancedMeshManager {
616
+ private readonly batches;
617
+ private readonly instanceToBatch;
618
+ private batchCounter;
619
+ /**
620
+ * Create a batch key from config
621
+ */
622
+ private getBatchKey;
623
+ /**
624
+ * Create or get existing batch
625
+ */
626
+ private getOrCreateBatch;
627
+ /**
628
+ * Add instanced object
629
+ */
630
+ addInstance(data: InstancedObjectData, config: InstanceBatchConfig): boolean;
631
+ /**
632
+ * Update instance
633
+ */
634
+ updateInstance(id: string, data: Partial<InstancedObjectData>): boolean;
635
+ /**
636
+ * Remove instance
637
+ */
638
+ removeInstance(id: string): boolean;
639
+ /**
640
+ * Get all meshes for adding to scene
641
+ */
642
+ getMeshes(): THREE.InstancedMesh[];
643
+ /**
644
+ * Get overall statistics
645
+ */
646
+ getStats(): {
647
+ totalBatches: number;
648
+ totalInstances: number;
649
+ batches: Map<string, InstanceBatchStats>;
650
+ };
651
+ /**
652
+ * Clear all instances
653
+ */
654
+ clear(): void;
655
+ /**
656
+ * Dispose all resources
657
+ */
658
+ dispose(): void;
659
+ }
660
+
661
+ /**
662
+ * PostProcessingManager.ts
663
+ *
664
+ * Advanced post-processing effects for AAA-quality visuals.
665
+ * Includes SSAO, SSR, bloom, motion blur, TAA, and more.
666
+ *
667
+ * Visual Impact:
668
+ * - SSAO: Realistic ambient occlusion shadows
669
+ * - Bloom: Glowing lights and emissive materials
670
+ * - Motion Blur: Cinematic motion effects
671
+ * - TAA: Anti-aliasing with temporal filtering
672
+ * - Depth of Field: Camera focus effects
673
+ */
674
+
675
+ type PostProcessingQuality = 'low' | 'medium' | 'high' | 'ultra';
676
+ interface PostProcessingConfig {
677
+ /** Enable SSAO (Screen-Space Ambient Occlusion) */
678
+ ssao?: {
679
+ enabled: boolean;
680
+ radius?: number;
681
+ minDistance?: number;
682
+ maxDistance?: number;
683
+ intensity?: number;
684
+ };
685
+ /** Enable Bloom */
686
+ bloom?: {
687
+ enabled: boolean;
688
+ strength?: number;
689
+ radius?: number;
690
+ threshold?: number;
691
+ };
692
+ /** Enable TAA (Temporal Anti-Aliasing) */
693
+ taa?: {
694
+ enabled: boolean;
695
+ sampleLevel?: number;
696
+ };
697
+ /** Enable FXAA (Fast Approximate Anti-Aliasing) */
698
+ fxaa?: {
699
+ enabled: boolean;
700
+ };
701
+ /** Enable Motion Blur */
702
+ motionBlur?: {
703
+ enabled: boolean;
704
+ intensity?: number;
705
+ samples?: number;
706
+ };
707
+ /** Enable Depth of Field */
708
+ depthOfField?: {
709
+ enabled: boolean;
710
+ focusDistance?: number;
711
+ focalLength?: number;
712
+ bokehScale?: number;
713
+ };
714
+ /** Enable Vignette */
715
+ vignette?: {
716
+ enabled: boolean;
717
+ offset?: number;
718
+ darkness?: number;
719
+ };
720
+ /** Enable Film Grain */
721
+ filmGrain?: {
722
+ enabled: boolean;
723
+ intensity?: number;
724
+ };
725
+ /** Enable Chromatic Aberration */
726
+ chromaticAberration?: {
727
+ enabled: boolean;
728
+ offset?: number;
729
+ };
730
+ /** Overall quality preset */
731
+ quality?: PostProcessingQuality;
732
+ }
733
+ interface PostProcessingStats {
734
+ enabled: boolean;
735
+ activeEffects: number;
736
+ renderTime: number;
737
+ quality: PostProcessingQuality;
738
+ }
739
+ /**
740
+ * Manages post-processing effects for enhanced visuals
741
+ */
742
+ declare class PostProcessingManager {
743
+ private composer;
744
+ private config;
745
+ private quality;
746
+ private enabled;
747
+ private renderTime;
748
+ private passes;
749
+ constructor(config?: PostProcessingConfig);
750
+ /**
751
+ * Merge user config with quality preset
752
+ */
753
+ private mergeWithPreset;
754
+ /**
755
+ * Initialize post-processing with renderer, scene, and camera
756
+ */
757
+ initialize(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera): void;
758
+ /**
759
+ * Add SSAO (Screen-Space Ambient Occlusion)
760
+ */
761
+ private addSSAO;
762
+ /**
763
+ * Add Bloom effect
764
+ */
765
+ private addBloom;
766
+ /**
767
+ * Add TAA (Temporal Anti-Aliasing)
768
+ */
769
+ private addTAA;
770
+ /**
771
+ * Add FXAA (Fast Approximate Anti-Aliasing)
772
+ */
773
+ private addFXAA;
774
+ /**
775
+ * Add Vignette effect
776
+ */
777
+ private addVignette;
778
+ /**
779
+ * Add Film Grain effect
780
+ */
781
+ private addFilmGrain;
782
+ /**
783
+ * Add Chromatic Aberration effect
784
+ */
785
+ private addChromaticAberration;
786
+ /**
787
+ * Render with post-processing
788
+ */
789
+ render(deltaTime?: number): void;
790
+ /**
791
+ * Update quality preset
792
+ */
793
+ setQuality(quality: PostProcessingQuality): void;
794
+ /**
795
+ * Enable/disable specific effect
796
+ */
797
+ setEffectEnabled(effectName: string, enabled: boolean): void;
798
+ /**
799
+ * Enable/disable all post-processing
800
+ */
801
+ setEnabled(enabled: boolean): void;
802
+ /**
803
+ * Get statistics
804
+ */
805
+ getStats(): PostProcessingStats;
806
+ /**
807
+ * Resize (call when renderer size changes)
808
+ */
809
+ setSize(width: number, height: number): void;
810
+ /**
811
+ * Dispose resources
812
+ */
813
+ dispose(): void;
814
+ }
815
+
816
+ /**
817
+ * ShaderOptimizationManager.ts
818
+ *
819
+ * Custom shader system for GPU-based performance optimizations.
820
+ * Provides highly optimized shaders for particles, meshes, and compute operations.
821
+ *
822
+ * Performance Benefits:
823
+ * - Custom particle shader: 3-5x faster than default PointsMaterial
824
+ * - Batched mesh shader: 2-3x faster rendering for similar objects
825
+ * - GPU-based physics: 10-20x faster than CPU calculations
826
+ * - Instanced rendering: Up to 100x reduction in draw calls
827
+ */
828
+
829
+ /**
830
+ * High-performance particle shader with GPU-based size/color calculations
831
+ */
832
+ declare const OptimizedParticleShader: {
833
+ uniforms: {
834
+ time: {
835
+ value: number;
836
+ };
837
+ pointSize: {
838
+ value: number;
839
+ };
840
+ cameraPosition: {
841
+ value: THREE.Vector3;
842
+ };
843
+ fadeDistance: {
844
+ value: number;
845
+ };
846
+ };
847
+ vertexShader: string;
848
+ fragmentShader: string;
849
+ };
850
+ /**
851
+ * GPU-accelerated debris/fragment shader with LOD support
852
+ */
853
+ declare const OptimizedDebrisShader: {
854
+ uniforms: {
855
+ time: {
856
+ value: number;
857
+ };
858
+ lightPosition: {
859
+ value: THREE.Vector3;
860
+ };
861
+ lightColor: {
862
+ value: THREE.Color;
863
+ };
864
+ ambientIntensity: {
865
+ value: number;
866
+ };
867
+ };
868
+ vertexShader: string;
869
+ fragmentShader: string;
870
+ };
871
+ /**
872
+ * Batched mesh shader for rendering many similar objects efficiently
873
+ */
874
+ declare const BatchedMeshShader: {
875
+ uniforms: {
876
+ diffuseMap: {
877
+ value: THREE.Texture | null;
878
+ };
879
+ lightPosition: {
880
+ value: THREE.Vector3;
881
+ };
882
+ tintColor: {
883
+ value: THREE.Color;
884
+ };
885
+ };
886
+ vertexShader: string;
887
+ fragmentShader: string;
888
+ };
889
+ /**
890
+ * Water/fluid simulation shader (simplified for performance)
891
+ */
892
+ declare const OptimizedFluidShader: {
893
+ uniforms: {
894
+ time: {
895
+ value: number;
896
+ };
897
+ flowSpeed: {
898
+ value: number;
899
+ };
900
+ waveHeight: {
901
+ value: number;
902
+ };
903
+ waterColor: {
904
+ value: THREE.Color;
905
+ };
906
+ opacity: {
907
+ value: number;
908
+ };
909
+ };
910
+ vertexShader: string;
911
+ fragmentShader: string;
912
+ };
913
+ /**
914
+ * Terrain deformation shader
915
+ */
916
+ declare const TerrainDeformationShader: {
917
+ uniforms: {
918
+ deformationMap: {
919
+ value: THREE.Texture | null;
920
+ };
921
+ heightScale: {
922
+ value: number;
923
+ };
924
+ baseColor: {
925
+ value: THREE.Color;
926
+ };
927
+ grassColor: {
928
+ value: THREE.Color;
929
+ };
930
+ rockColor: {
931
+ value: THREE.Color;
932
+ };
933
+ };
934
+ vertexShader: string;
935
+ fragmentShader: string;
936
+ };
937
+ interface ShaderOptimizationConfig {
938
+ /** Enable custom particle shader */
939
+ useOptimizedParticles?: boolean;
940
+ /** Enable custom debris shader */
941
+ useOptimizedDebris?: boolean;
942
+ /** Enable batched mesh shader */
943
+ useBatchedMeshes?: boolean;
944
+ /** Enable fluid shader */
945
+ useFluidShader?: boolean;
946
+ /** Enable terrain deformation */
947
+ useTerrainDeformation?: boolean;
948
+ }
949
+ interface ShaderPerformanceStats {
950
+ shadersActive: number;
951
+ drawCalls: number;
952
+ triangles: number;
953
+ shaderCompileTime: number;
954
+ }
955
+ /**
956
+ * Manages shader-based optimizations for maximum performance
957
+ */
958
+ declare class ShaderOptimizationManager {
959
+ private config;
960
+ private materials;
961
+ private compileTime;
962
+ constructor(config?: ShaderOptimizationConfig);
963
+ /**
964
+ * Create optimized particle material
965
+ */
966
+ createParticleMaterial(params?: {
967
+ pointSize?: number;
968
+ fadeDistance?: number;
969
+ }): THREE.ShaderMaterial;
970
+ /**
971
+ * Create optimized debris material
972
+ */
973
+ createDebrisMaterial(params?: {
974
+ lightPosition?: THREE.Vector3;
975
+ ambientIntensity?: number;
976
+ }): THREE.ShaderMaterial;
977
+ /**
978
+ * Create batched mesh material
979
+ */
980
+ createBatchedMeshMaterial(params?: {
981
+ diffuseMap?: THREE.Texture;
982
+ tintColor?: THREE.Color;
983
+ }): THREE.ShaderMaterial;
984
+ /**
985
+ * Create fluid shader material
986
+ */
987
+ createFluidMaterial(params?: {
988
+ flowSpeed?: number;
989
+ waveHeight?: number;
990
+ waterColor?: THREE.Color;
991
+ opacity?: number;
992
+ }): THREE.ShaderMaterial;
993
+ /**
994
+ * Create terrain deformation material
995
+ */
996
+ createTerrainMaterial(params?: {
997
+ deformationMap?: THREE.Texture;
998
+ heightScale?: number;
999
+ baseColor?: THREE.Color;
1000
+ }): THREE.ShaderMaterial;
1001
+ /**
1002
+ * Update shader uniforms (call each frame)
1003
+ */
1004
+ update(_deltaTime: number): void;
1005
+ /**
1006
+ * Get performance statistics
1007
+ */
1008
+ getStats(): ShaderPerformanceStats;
1009
+ /**
1010
+ * Dispose all shader materials
1011
+ */
1012
+ dispose(): void;
1013
+ }
1014
+
1015
+ /**
1016
+ * SceneInspector.ts
1017
+ *
1018
+ * Comprehensive debugging and inspection system for HoloScript scenes.
1019
+ * Provides visual debugging overlays, performance metrics, and scene exploration tools.
1020
+ *
1021
+ * Features:
1022
+ * - Scene hierarchy visualization
1023
+ * - Object property inspection
1024
+ * - Performance metrics (FPS, draw calls, memory)
1025
+ * - Visual debug overlays (bounding boxes, normals, wireframe)
1026
+ * - Camera debugging
1027
+ * - Particle system visualization
1028
+ * - Physics debug rendering
1029
+ */
1030
+
1031
+ interface InspectorConfig {
1032
+ /** Show FPS counter */
1033
+ showFPS?: boolean;
1034
+ /** Show memory usage */
1035
+ showMemory?: boolean;
1036
+ /** Show draw calls */
1037
+ showDrawCalls?: boolean;
1038
+ /** Show scene hierarchy */
1039
+ showHierarchy?: boolean;
1040
+ /** Show bounding boxes */
1041
+ showBoundingBoxes?: boolean;
1042
+ /** Show wireframe overlay */
1043
+ showWireframe?: boolean;
1044
+ /** Show normals */
1045
+ showNormals?: boolean;
1046
+ /** Show camera frustum */
1047
+ showCameraFrustum?: boolean;
1048
+ /** Show coordinate axes */
1049
+ showAxes?: boolean;
1050
+ /** Show grid */
1051
+ showGrid?: boolean;
1052
+ }
1053
+ interface SceneStats {
1054
+ fps: number;
1055
+ frameTime: number;
1056
+ objectCount: number;
1057
+ triangleCount: number;
1058
+ drawCalls: number;
1059
+ memory: {
1060
+ geometries: number;
1061
+ textures: number;
1062
+ total: number;
1063
+ };
1064
+ particleSystems: number;
1065
+ activeLights: number;
1066
+ cameras: number;
1067
+ }
1068
+ interface ObjectInfo {
1069
+ name: string;
1070
+ type: string;
1071
+ uuid: string;
1072
+ position: THREE.Vector3;
1073
+ rotation: THREE.Euler;
1074
+ scale: THREE.Vector3;
1075
+ visible: boolean;
1076
+ children: number;
1077
+ triangles: number;
1078
+ }
1079
+ /**
1080
+ * Scene Inspector for debugging and visualization
1081
+ */
1082
+ declare class SceneInspector {
1083
+ private config;
1084
+ private scene;
1085
+ private camera;
1086
+ private renderer;
1087
+ private boundingBoxHelpers;
1088
+ private normalHelpers;
1089
+ private axesHelper;
1090
+ private gridHelper;
1091
+ private cameraHelper;
1092
+ private frameCount;
1093
+ private lastTime;
1094
+ private fps;
1095
+ private frameTime;
1096
+ private frameTimeSamples;
1097
+ constructor(config?: InspectorConfig);
1098
+ /**
1099
+ * Attach inspector to a scene
1100
+ */
1101
+ attach(scene: THREE.Scene, camera: THREE.Camera, renderer: THREE.WebGLRenderer): void;
1102
+ /**
1103
+ * Detach inspector from scene
1104
+ */
1105
+ detach(): void;
1106
+ /**
1107
+ * Initialize debug overlay objects
1108
+ */
1109
+ private initializeDebugOverlays;
1110
+ /**
1111
+ * Clear all debug overlays
1112
+ */
1113
+ private clearDebugOverlays;
1114
+ /**
1115
+ * Update debug visualizations (call each frame)
1116
+ */
1117
+ update(): void;
1118
+ /**
1119
+ * Update performance metrics
1120
+ */
1121
+ private updatePerformanceMetrics;
1122
+ /**
1123
+ * Update debug overlay objects
1124
+ */
1125
+ private updateDebugOverlays;
1126
+ /**
1127
+ * Update bounding box helpers
1128
+ */
1129
+ private updateBoundingBoxes;
1130
+ /**
1131
+ * Clear bounding box helpers
1132
+ */
1133
+ private clearBoundingBoxes;
1134
+ /**
1135
+ * Update normal helpers
1136
+ */
1137
+ private updateNormals;
1138
+ /**
1139
+ * Clear normal helpers
1140
+ */
1141
+ private clearNormals;
1142
+ /**
1143
+ * Get comprehensive scene statistics
1144
+ */
1145
+ getStats(): SceneStats;
1146
+ /**
1147
+ * Get empty stats structure
1148
+ */
1149
+ private getEmptyStats;
1150
+ /**
1151
+ * Get scene hierarchy as tree structure
1152
+ */
1153
+ getSceneHierarchy(): ObjectInfo[];
1154
+ /**
1155
+ * Get detailed information about a specific object
1156
+ */
1157
+ getObjectInfo(object: THREE.Object3D): ObjectInfo;
1158
+ /**
1159
+ * Find object by UUID
1160
+ */
1161
+ findObject(uuid: string): THREE.Object3D | null;
1162
+ /**
1163
+ * Find objects by name
1164
+ */
1165
+ findObjectsByName(name: string): THREE.Object3D[];
1166
+ /**
1167
+ * Find objects by type
1168
+ */
1169
+ findObjectsByType(type: string): THREE.Object3D[];
1170
+ /**
1171
+ * Toggle debug feature
1172
+ */
1173
+ toggleFeature(feature: keyof InspectorConfig, enabled?: boolean): void;
1174
+ /**
1175
+ * Get current configuration
1176
+ */
1177
+ getConfig(): Required<InspectorConfig>;
1178
+ /**
1179
+ * Update configuration
1180
+ */
1181
+ setConfig(config: Partial<InspectorConfig>): void;
1182
+ /**
1183
+ * Export scene statistics as JSON
1184
+ */
1185
+ exportStats(): string;
1186
+ /**
1187
+ * Dispose inspector and cleanup
1188
+ */
1189
+ dispose(): void;
1190
+ }
1191
+
1192
+ /**
1193
+ * GameLoop.ts — Sprint 6
1194
+ *
1195
+ * A simple deterministic game loop using setInterval for portability
1196
+ * across Node.js and browser environments. Exposes start/stop/pause/resume
1197
+ * and calls the provided `onUpdate(deltaMs)` callback each tick.
1198
+ *
1199
+ * Design choices:
1200
+ * - Uses setInterval rather than requestAnimationFrame so tests can advance
1201
+ * time without requiring a browser runtime.
1202
+ * - `tickIntervalMs` defaults to 16ms (≈60 fps) but is overridable.
1203
+ * - `pause()` keeps the interval alive but skips the onUpdate call,
1204
+ * preserving the timing baseline so resume is seamless.
1205
+ * - `frame` is incremented every time onUpdate fires (not every tick).
1206
+ */
1207
+ interface GameLoopOptions {
1208
+ /** Called each tick with deltaMs since last tick (paused ticks are skipped). */
1209
+ onUpdate: (deltaMs: number) => void | Promise<void>;
1210
+ /**
1211
+ * Interval between ticks in ms.
1212
+ * @default 16 (approx. 60 fps)
1213
+ */
1214
+ tickIntervalMs?: number;
1215
+ /**
1216
+ * Alias for tickIntervalMs, derived from fps.
1217
+ * If provided, takes precedence over tickIntervalMs.
1218
+ */
1219
+ targetFps?: number;
1220
+ }
1221
+ declare class GameLoop {
1222
+ private _isRunning;
1223
+ private _isPaused;
1224
+ private _frame;
1225
+ private _handle;
1226
+ private _lastTime;
1227
+ private readonly onUpdate;
1228
+ private readonly intervalMs;
1229
+ constructor(options: GameLoopOptions);
1230
+ /** Whether the loop is currently running (not stopped). */
1231
+ get isRunning(): boolean;
1232
+ /** Whether the loop is paused (running but not ticking). */
1233
+ get isPaused(): boolean;
1234
+ /** Number of update calls since start() (skips paused frames). */
1235
+ get frame(): number;
1236
+ /**
1237
+ * Start the game loop.
1238
+ * If already running, this is a no-op.
1239
+ */
1240
+ start(): void;
1241
+ /**
1242
+ * Stop the game loop permanently.
1243
+ * Resets frame counter and running state.
1244
+ */
1245
+ stop(): void;
1246
+ /**
1247
+ * Pause the loop. `isRunning` stays true but `onUpdate` is not called.
1248
+ * The interval continues so resuming has minimal lag.
1249
+ */
1250
+ pause(): void;
1251
+ /**
1252
+ * Resume from a paused state. Resets the last-time baseline so the first
1253
+ * resumed tick doesn't produce an artificially large delta.
1254
+ */
1255
+ resume(): void;
1256
+ private _tick;
1257
+ }
1258
+
1259
+ /**
1260
+ * AssetPipeline.ts — Sprint 7
1261
+ *
1262
+ * A lightweight, type-keyed asset loading pipeline with:
1263
+ * - Per-type loader registration
1264
+ * - Content-addressable cache (type + path key)
1265
+ * - Failed-load exclusion from cache
1266
+ * - evict(), clear(), isLoaded(), loadedCount
1267
+ *
1268
+ * Designed for use in SceneRunner and test contexts where you need
1269
+ * deterministic, promise-based asset loading with no framework dependencies.
1270
+ */
1271
+ /** A loader function maps a path string → an arbitrary asset value. */
1272
+ type AssetLoader<T = unknown> = (path: string) => Promise<T>;
1273
+ declare class AssetPipeline {
1274
+ private loaders;
1275
+ private cache;
1276
+ /** Register (or replace) a loader for an asset type. */
1277
+ registerLoader<T>(type: string, loader: AssetLoader<T>): void;
1278
+ /** Whether a loader is registered for the given type. */
1279
+ hasLoader(type: string): boolean;
1280
+ /**
1281
+ * Load an asset by type and path.
1282
+ *
1283
+ * - Returns the cached asset if already loaded.
1284
+ * - Calls the registered loader and caches the result.
1285
+ * - Throws if no loader is registered for the type.
1286
+ * - Does NOT cache failed loads, so a subsequent call may retry.
1287
+ */
1288
+ load<T = unknown>(type: string, path: string): Promise<T>;
1289
+ /** Whether the asset at (type, path) is currently cached. */
1290
+ isLoaded(type: string, path: string): boolean;
1291
+ /** Remove a single asset from the cache. */
1292
+ evict(type: string, path: string): void;
1293
+ /** Remove all assets from the cache. */
1294
+ clear(): void;
1295
+ /** Number of currently cached assets. */
1296
+ get loadedCount(): number;
1297
+ }
1298
+
1299
+ /**
1300
+ * HotReloadManager.ts — Sprint 8
1301
+ *
1302
+ * Manages live module reload with:
1303
+ * - Per-key watcher registration / deregistration
1304
+ * - State migration helper for preserving entity state across reloads
1305
+ * - Version tracking (increments per triggerReload call)
1306
+ * - Isolated watcher error handling (one failure does not block others)
1307
+ *
1308
+ * Design:
1309
+ * - `watch(key, fn)` registers a callback. Multiple watchers per key allowed.
1310
+ * - `triggerReload(key, content, oldState?)` calls each watcher in order.
1311
+ * If a watcher throws, `onError` is called and the next watcher still runs.
1312
+ * - `migrateState(old, newDefaults)` produces a merged state object:
1313
+ * fields present in newDefaults take their value from oldState (preserving
1314
+ * live game values), and any field in newDefaults not in oldState gets its
1315
+ * default value from newDefaults.
1316
+ */
1317
+ type ReloadWatcher<TContent = unknown, TState = unknown> = (content: TContent, prevState: TState | undefined, meta: {
1318
+ key: string;
1319
+ version: number;
1320
+ }) => void;
1321
+ interface HotReloadManagerOptions {
1322
+ onError?: (key: string, error: Error) => void;
1323
+ }
1324
+ declare class HotReloadManager {
1325
+ private watchers;
1326
+ private versions;
1327
+ private readonly onError?;
1328
+ constructor(options?: HotReloadManagerOptions);
1329
+ /** Register a watcher for a module key. Returns an unsubscribe function. */
1330
+ watch(key: string, fn: ReloadWatcher): () => void;
1331
+ /** Remove a specific watcher. */
1332
+ unwatch(key: string, fn: ReloadWatcher): void;
1333
+ /** Remove ALL watchers for a key. */
1334
+ unwatchAll(key: string): void;
1335
+ /** Whether at least one watcher is registered for the key. */
1336
+ isWatched(key: string): boolean;
1337
+ /**
1338
+ * Trigger a reload for the given key.
1339
+ *
1340
+ * @param key Module identifier (file path, scene name, etc.)
1341
+ * @param content New module content (AST, raw code, etc.)
1342
+ * @param oldState Previous runtime state to pass to watchers for migration
1343
+ */
1344
+ triggerReload<TContent = unknown, TState = unknown>(key: string, content: TContent, oldState?: TState): void;
1345
+ /**
1346
+ * Produce a merged state after a reload.
1347
+ *
1348
+ * Strategy:
1349
+ * - Start with `newState` (the defaults from the new module).
1350
+ * - For each key in `newState`, if `oldState` also has that key, prefer
1351
+ * the old value (preserves live runtime values like hp, position, etc.).
1352
+ * - Keys in `oldState` NOT present in `newState` are discarded (the new
1353
+ * module removed that field).
1354
+ *
1355
+ * If `oldState` is null/undefined, returns `newState` unchanged.
1356
+ */
1357
+ migrateState<T extends Record<string, unknown>>(oldState: T | null | undefined, newState: T): T;
1358
+ /** How many times triggerReload has been called for this key. */
1359
+ version(key: string): number;
1360
+ }
1361
+
1362
+ /**
1363
+ * GameEngine — HoloScript+ Top-Level Runtime Facade
1364
+ *
1365
+ * Composes GameLoop + AssetPipeline + HotReloadManager into a
1366
+ * single ergonomic entry point:
1367
+ *
1368
+ * const engine = new GameEngine();
1369
+ * engine.addUpdateHandler('physics', myPhysicsFn);
1370
+ * engine.start();
1371
+ * // ...
1372
+ * engine.stop();
1373
+ *
1374
+ * The engine does NOT depend on a renderer or HoloScript parser directly —
1375
+ * it provides lifecycle hooks so the caller can wire those in.
1376
+ *
1377
+ * @module runtime/GameEngine
1378
+ * @version 1.0.0
1379
+ */
1380
+
1381
+ type UpdateHandler = (delta: number, frame: number) => void;
1382
+ type EnginePhase = 'idle' | 'running' | 'paused' | 'stopped';
1383
+ interface GameEngineOptions extends Omit<GameLoopOptions, 'onUpdate'> {
1384
+ /** Enable hot-reload watcher integration. Default: false */
1385
+ hotReload?: boolean;
1386
+ }
1387
+ interface EngineStats {
1388
+ phase: EnginePhase;
1389
+ frame: number;
1390
+ fps: number;
1391
+ assetCount: number;
1392
+ }
1393
+ declare class GameEngine {
1394
+ readonly loop: GameLoop;
1395
+ readonly assets: AssetPipeline;
1396
+ readonly hotReload: HotReloadManager;
1397
+ private _phase;
1398
+ private _updateHandlers;
1399
+ private _frame;
1400
+ private _lastTickTime;
1401
+ private _fps;
1402
+ constructor(options?: GameEngineOptions);
1403
+ /** Start the engine (and the internal game loop). */
1404
+ start(): void;
1405
+ /** Stop the engine permanently. */
1406
+ stop(): void;
1407
+ /** Pause the update loop (keep state intact). */
1408
+ pause(): void;
1409
+ /** Resume from paused state. */
1410
+ resume(): void;
1411
+ /**
1412
+ * Register a named update handler that runs every tick.
1413
+ * Multiple handlers run in insertion order.
1414
+ */
1415
+ addUpdateHandler(name: string, fn: UpdateHandler): void;
1416
+ /** Remove a previously-registered update handler. */
1417
+ removeUpdateHandler(name: string): boolean;
1418
+ /** List all registered handler names. */
1419
+ getHandlerNames(): string[];
1420
+ /**
1421
+ * Register a typed asset loader and return the engine (fluent API).
1422
+ * Delegates to this.assets.registerLoader().
1423
+ */
1424
+ registerLoader<T = unknown>(type: string, loader: AssetLoader<T>): this;
1425
+ /**
1426
+ * Preload an asset by type and path. Resolves when loaded or throws.
1427
+ * Delegates to this.assets.load().
1428
+ */
1429
+ preload<T = unknown>(type: string, path: string): Promise<T>;
1430
+ /**
1431
+ * Watch a module by key. On reload, the watcher fn is called.
1432
+ * Returns an unsubscribe function.
1433
+ */
1434
+ watch(key: string, fn: ReloadWatcher): () => void;
1435
+ /**
1436
+ * Trigger a hot-reload for the given key.
1437
+ */
1438
+ reload<TContent = unknown, TState = unknown>(key: string, content: TContent, oldState?: TState): void;
1439
+ get phase(): EnginePhase;
1440
+ get frame(): number;
1441
+ get fps(): number;
1442
+ /** Snapshot of engine state for debugging/telemetry. */
1443
+ getStats(): EngineStats;
1444
+ private _onUpdate;
1445
+ }
1446
+
1447
+ /**
1448
+ * @holoscript/core Runtime Optimization
1449
+ *
1450
+ * Object pooling, lazy evaluation, memoization, caching
1451
+ */
1452
+ /**
1453
+ * Generic object pool for efficient memory reuse
1454
+ */
1455
+ declare class ObjectPool<T> {
1456
+ private factory;
1457
+ private reset;
1458
+ private _capacity;
1459
+ private available;
1460
+ private inUse;
1461
+ private peakUsage;
1462
+ constructor(factory: () => T, reset: (obj: T) => void, _capacity?: number);
1463
+ /**
1464
+ * Pre-allocate objects
1465
+ */
1466
+ private preallocate;
1467
+ /**
1468
+ * Acquire object from pool
1469
+ */
1470
+ acquire(): T;
1471
+ /**
1472
+ * Release object back to pool
1473
+ */
1474
+ release(obj: T): void;
1475
+ /**
1476
+ * Batch acquire
1477
+ */
1478
+ acquireBatch(count: number): T[];
1479
+ /**
1480
+ * Batch release
1481
+ */
1482
+ releaseBatch(objects: T[]): void;
1483
+ /**
1484
+ * Get pool statistics
1485
+ */
1486
+ getStats(): {
1487
+ available: number;
1488
+ inUse: number;
1489
+ peakUsage: number;
1490
+ utilization: number;
1491
+ };
1492
+ /**
1493
+ * Clear pool
1494
+ */
1495
+ clear(): void;
1496
+ }
1497
+ /**
1498
+ * Lazy evaluated value
1499
+ */
1500
+ declare class Lazy<T> {
1501
+ private compute;
1502
+ private value;
1503
+ private computed;
1504
+ constructor(compute: () => T);
1505
+ /**
1506
+ * Get value (compute if needed)
1507
+ */
1508
+ get(): T;
1509
+ /**
1510
+ * Force re-computation
1511
+ */
1512
+ reset(): void;
1513
+ /**
1514
+ * Check if computed
1515
+ */
1516
+ isComputed(): boolean;
1517
+ }
1518
+ /**
1519
+ * Memoization decorator
1520
+ */
1521
+ declare function memoize<T extends (...args: any[]) => any>(fn: T, maxSize?: number): T;
1522
+ /**
1523
+ * Memoized property decorator
1524
+ */
1525
+ declare function MemoizedProperty(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
1526
+ /**
1527
+ * Method memoization decorator
1528
+ */
1529
+ declare function MethodMemoize(maxSize?: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
1530
+ /**
1531
+ * LRU Cache with maximum size
1532
+ */
1533
+ declare class LRUCache<K, V> {
1534
+ private maxSize;
1535
+ private cache;
1536
+ private accessOrder;
1537
+ constructor(maxSize?: number);
1538
+ /**
1539
+ * Get value from cache
1540
+ */
1541
+ get(key: K): V | undefined;
1542
+ /**
1543
+ * Set value in cache
1544
+ */
1545
+ set(key: K, value: V): void;
1546
+ /**
1547
+ * Clear cache
1548
+ */
1549
+ clear(): void;
1550
+ /**
1551
+ * Get cache stats
1552
+ */
1553
+ getStats(): {
1554
+ size: number;
1555
+ maxSize: number;
1556
+ utilization: number;
1557
+ };
1558
+ }
1559
+ /**
1560
+ * Batch processing for efficient bulk operations
1561
+ */
1562
+ declare class Batcher<T, R> {
1563
+ private processor;
1564
+ private batchSize;
1565
+ private flushIntervalMs;
1566
+ private queue;
1567
+ private processingTimeout;
1568
+ constructor(processor: (batch: T[]) => Promise<R[]>, batchSize?: number, flushIntervalMs?: number);
1569
+ /**
1570
+ * Add item to batch
1571
+ */
1572
+ add(item: T): Promise<R>;
1573
+ /**
1574
+ * Flush batch
1575
+ */
1576
+ private flush;
1577
+ /**
1578
+ * Manually flush remaining items
1579
+ */
1580
+ flushAll(): Promise<R[]>;
1581
+ }
1582
+ /**
1583
+ * Performance profiler with hot path tracking
1584
+ */
1585
+ declare class PerformanceProfiler {
1586
+ private measurements;
1587
+ private activeTimers;
1588
+ /**
1589
+ * Start timing a function
1590
+ */
1591
+ startTimer(label: string): void;
1592
+ /**
1593
+ * End timing
1594
+ */
1595
+ endTimer(label: string): number;
1596
+ /**
1597
+ * Measure function execution
1598
+ */
1599
+ measure<T>(label: string, fn: () => Promise<T>): Promise<T>;
1600
+ /**
1601
+ * Get profiling report
1602
+ */
1603
+ getReport(): string;
1604
+ /**
1605
+ * Reset measurements
1606
+ */
1607
+ reset(): void;
1608
+ /**
1609
+ * Get hottest paths
1610
+ */
1611
+ getHotPaths(topN?: number): Array<[string, number]>;
1612
+ }
1613
+ declare function getGlobalProfiler(): PerformanceProfiler;
1614
+
1615
+ /**
1616
+ * @holoscript/core Voice Synthesizer Interface
1617
+ *
1618
+ * Defines the @builtin runtime interface for neural text-to-speech.
1619
+ * Runtimes implement this to bridge with providers like ElevenLabs, Azure, or Coqui.
1620
+ */
1621
+ /**
1622
+ * Voice synthesizer configuration
1623
+ */
1624
+ interface VoiceConfig {
1625
+ /** Backend provider (e.g., 'elevenlabs', 'azure', 'coqui') */
1626
+ backend: string;
1627
+ /** API Key or local model path */
1628
+ apiKey?: string;
1629
+ modelPath?: string;
1630
+ /** Default voice settings */
1631
+ defaultVoiceId?: string;
1632
+ }
1633
+ /**
1634
+ * Speech synthesis request
1635
+ */
1636
+ interface VoiceRequest {
1637
+ text: string;
1638
+ voiceId?: string;
1639
+ /** Emotion parameters (0-1 intensity) */
1640
+ emotion?: {
1641
+ type: 'angry' | 'sad' | 'excited' | 'friendly' | 'scared' | 'neutral';
1642
+ intensity: number;
1643
+ };
1644
+ /** Prosody settings */
1645
+ pitch?: number;
1646
+ rate?: number;
1647
+ volume?: number;
1648
+ }
1649
+ /**
1650
+ * Available voice information
1651
+ */
1652
+ interface VoiceInfo {
1653
+ id: string;
1654
+ name: string;
1655
+ gender?: 'male' | 'female' | 'non-binary';
1656
+ language: string;
1657
+ provider: string;
1658
+ }
1659
+ /**
1660
+ * VoiceSynthesizer @builtin Interface
1661
+ */
1662
+ interface VoiceSynthesizer {
1663
+ /** Initialize the synthesizer with config */
1664
+ initialize(config: VoiceConfig): Promise<void>;
1665
+ /**
1666
+ * Generate audio buffer from text.
1667
+ * Runtimes should handle the actual networking/synthesis.
1668
+ */
1669
+ generate(request: VoiceRequest): Promise<ArrayBuffer>;
1670
+ /** List available voices */
1671
+ getVoices(): Promise<VoiceInfo[]>;
1672
+ /** Dispose resources */
1673
+ dispose(): void;
1674
+ }
1675
+ /**
1676
+ * Global registry for builtin VoiceSynthesizers
1677
+ */
1678
+ declare const voiceSynthesizerRegistry: Map<string, VoiceSynthesizer>;
1679
+ /**
1680
+ * Register a voice synthesizer implementation
1681
+ */
1682
+ declare function registerVoiceSynthesizer(name: string, synthesizer: VoiceSynthesizer): void;
1683
+ /**
1684
+ * Get a registered voice synthesizer
1685
+ */
1686
+ declare function getVoiceSynthesizer(name: string): VoiceSynthesizer | undefined;
1687
+
1688
+ /**
1689
+ * @holoscript/core Base Voice Synthesizer
1690
+ *
1691
+ * Implements the VoiceSynthesizer interface with support for external providers
1692
+ * and local phoneme/audio caching.
1693
+ */
1694
+
1695
+ declare class BaseVoiceSynthesizer implements VoiceSynthesizer {
1696
+ private config?;
1697
+ private cache;
1698
+ private voices;
1699
+ constructor();
1700
+ initialize(config: VoiceConfig): Promise<void>;
1701
+ generate(request: VoiceRequest): Promise<ArrayBuffer>;
1702
+ getVoices(): Promise<VoiceInfo[]>;
1703
+ dispose(): void;
1704
+ private fetchElevenLabsVoices;
1705
+ private fetchAzureVoices;
1706
+ private callElevenLabs;
1707
+ private callAzure;
1708
+ private generateLocal;
1709
+ }
1710
+
1711
+ /**
1712
+ * Multimodal signals for emotion inference
1713
+ */
1714
+ interface EmotionSignals {
1715
+ /** Head stability (1.0 = stable, 0.0 = high jitter/shaking) */
1716
+ headStability: number;
1717
+ /** Dominant hand stability (1.0 = stable, 0.0 = tremors/jitter) */
1718
+ handStability: number;
1719
+ /** Interaction intensity (e.g., clicks per second, force of movement) */
1720
+ interactionIntensity: number;
1721
+ /** Task failure rate or repeated interaction patterns */
1722
+ behavioralStressing: number;
1723
+ /** Optional audio-derived stress (from VoiceSynthesizer/SpeechRecognizer) */
1724
+ voiceStress?: number;
1725
+ }
1726
+ /**
1727
+ * Result of emotion inference
1728
+ */
1729
+ interface EmotionInference {
1730
+ /** Frustration level (0.0 to 1.0) */
1731
+ frustration: number;
1732
+ /** Confusion/Uncertainty level (0.0 to 1.0) */
1733
+ confusion: number;
1734
+ /** User engagement/Focus level (0.0 to 1.0) */
1735
+ engagement: number;
1736
+ /** Predicted primary affective state */
1737
+ primaryState: 'neutral' | 'happy' | 'angry' | 'sad' | 'scared' | 'confused' | 'frustrated';
1738
+ }
1739
+ /**
1740
+ * Emotion detector configuration
1741
+ */
1742
+ interface EmotionConfig {
1743
+ /** Mode of detection (e.g., 'passive', 'active', 'calibrated') */
1744
+ mode: string;
1745
+ /** Model identifier or path */
1746
+ modelId?: string;
1747
+ /** Sensitivity adjustment (0.0 to 1.0) */
1748
+ sensitivity?: number;
1749
+ }
1750
+ /**
1751
+ * EmotionDetector @builtin Interface
1752
+ */
1753
+ interface EmotionDetector {
1754
+ /** Initialize the detector with config */
1755
+ initialize(config: EmotionConfig): Promise<void>;
1756
+ /**
1757
+ * Infer emotional state from multimodal signals.
1758
+ * This is typically called at a lower frequency than the main loop (e.g., 5Hz).
1759
+ */
1760
+ infer(signals: EmotionSignals): EmotionInference;
1761
+ /** Dispose resources */
1762
+ dispose(): void;
1763
+ }
1764
+ /**
1765
+ * Global registry for builtin EmotionDetectors
1766
+ */
1767
+ declare const emotionDetectorRegistry: Map<string, EmotionDetector>;
1768
+ /**
1769
+ * Register an emotion detector implementation
1770
+ */
1771
+ declare function registerEmotionDetector(name: string, detector: EmotionDetector): void;
1772
+ /**
1773
+ * Get a registered emotion detector
1774
+ */
1775
+ declare function getEmotionDetector(name: string): EmotionDetector | undefined;
1776
+
1777
+ /**
1778
+ * @holoscript/core Local Emotion Detector
1779
+ *
1780
+ * Implements multimodal emotion inference based on behavioral signals,
1781
+ * head motion, and hand stability.
1782
+ */
1783
+
1784
+ declare class LocalEmotionDetector implements EmotionDetector {
1785
+ private config?;
1786
+ private headStabilityHistory;
1787
+ private handStabilityHistory;
1788
+ private readonly WINDOW_SIZE;
1789
+ constructor();
1790
+ initialize(config: EmotionConfig): Promise<void>;
1791
+ infer(signals: EmotionSignals): EmotionInference;
1792
+ dispose(): void;
1793
+ private getAverage;
1794
+ }
1795
+
1796
+ /**
1797
+ * @holoscript/core Speech Recognizer Interface
1798
+ *
1799
+ * Defines the @builtin runtime interface for speech-to-text and phoneme recognition.
1800
+ * Runtimes (WASM/Node.js) implement this to bridge with whisper.cpp or other providers.
1801
+ */
1802
+
1803
+ /**
1804
+ * Speech recognition configuration
1805
+ */
1806
+ interface SpeechRecognizerConfig {
1807
+ /** Backend provider (e.g., 'whisper.cpp', 'web-speech') */
1808
+ backend: string;
1809
+ /** Model size/type (e.g., 'tiny', 'base', 'small') */
1810
+ model?: string;
1811
+ /** Enable phoneme-level timestamp output */
1812
+ outputPhonemes?: boolean;
1813
+ /** Recognition language (ISO code) */
1814
+ language?: string;
1815
+ /** Sampling rate (default 16000) */
1816
+ sampleRate?: number;
1817
+ }
1818
+ /**
1819
+ * Transcription result segment
1820
+ */
1821
+ interface TranscriptionSegment {
1822
+ text: string;
1823
+ start: number;
1824
+ end: number;
1825
+ phonemes?: PhonemeTimestamp[];
1826
+ }
1827
+ /**
1828
+ * SpeechRecognizer @builtin Interface
1829
+ */
1830
+ interface SpeechRecognizer {
1831
+ /** Initialize the recognizer with config */
1832
+ initialize(config: SpeechRecognizerConfig): Promise<void>;
1833
+ /**
1834
+ * Transcribe an audio stream or buffer.
1835
+ * Returns segments with optional phoneme-level timestamps.
1836
+ */
1837
+ transcribe(audio: ArrayBuffer | Blob | unknown, options?: {
1838
+ phonemeMode?: boolean;
1839
+ timestamps?: boolean;
1840
+ }): Promise<TranscriptionSegment[]>;
1841
+ /** Stop any active recognition */
1842
+ stop(): void;
1843
+ /** Dispose resources */
1844
+ dispose(): void;
1845
+ }
1846
+ /**
1847
+ * Global registry for builtin SpeechRecognizers
1848
+ */
1849
+ declare const speechRecognizerRegistry: Map<string, SpeechRecognizer>;
1850
+ /**
1851
+ * Register a speech recognizer implementation
1852
+ */
1853
+ declare function registerSpeechRecognizer(name: string, recognizer: SpeechRecognizer): void;
1854
+ /**
1855
+ * Get a registered speech recognizer
1856
+ */
1857
+ declare function getSpeechRecognizer(name: string): SpeechRecognizer | undefined;
1858
+
1859
+ /**
1860
+ * @holoscript/core Mock Speech Recognizer
1861
+ *
1862
+ * Implements the SpeechRecognizer interface for testing and simulation.
1863
+ * Returns dummy transcription segments with phoneme-level timestamps.
1864
+ */
1865
+
1866
+ declare class MockSpeechRecognizer implements SpeechRecognizer {
1867
+ private config?;
1868
+ constructor();
1869
+ initialize(config: SpeechRecognizerConfig): Promise<void>;
1870
+ transcribe(audio: ArrayBuffer | Blob | unknown, options?: {
1871
+ phonemeMode?: boolean;
1872
+ timestamps?: boolean;
1873
+ }): Promise<TranscriptionSegment[]>;
1874
+ stop(): void;
1875
+ dispose(): void;
1876
+ /**
1877
+ * Generates dummy phonemes for a word
1878
+ */
1879
+ private generatePhonemes;
1880
+ }
1881
+
1882
+ /**
1883
+ * @holoscript/core Navigation Engine Interface
1884
+ *
1885
+ * Defines the @builtin runtime interface for GPU-accelerated pathfinding.
1886
+ * Runtimes implement this to bridge with GPU-based flow field generators.
1887
+ */
1888
+
1889
+ /**
1890
+ * Navigation engine configuration
1891
+ */
1892
+ interface NavigationConfig {
1893
+ /** Backend provider (e.g., 'gpu_flowfield', 'recast', 'custom') */
1894
+ backend: string;
1895
+ /** Dimensions of the navigation grid */
1896
+ gridSize: [number, number, number];
1897
+ /** Resolution of the grid (meters per cell) */
1898
+ resolution: number;
1899
+ /** Height of the navigation floor */
1900
+ floorY?: number;
1901
+ }
1902
+ /**
1903
+ * Destination for flow field generation
1904
+ */
1905
+ interface NavDestination {
1906
+ id: string;
1907
+ position: Vector3;
1908
+ radius?: number;
1909
+ }
1910
+ /**
1911
+ * NavigationEngine @builtin Interface
1912
+ */
1913
+ interface NavigationEngine {
1914
+ /** Initialize the engine with config */
1915
+ initialize(config: NavigationConfig): Promise<void>;
1916
+ /**
1917
+ * Generate or update a flow field for a destination.
1918
+ * This triggers a GPU compute pass.
1919
+ */
1920
+ updateFlowField(destination: NavDestination): Promise<void>;
1921
+ /**
1922
+ * Sample the flow field at a given position.
1923
+ * Return a direction vector pointing toward the destination.
1924
+ */
1925
+ sampleDirection(destinationId: string, position: Vector3): Vector3;
1926
+ /** Update obstacles in the navigation grid */
1927
+ updateObstacle(id: string, position: Vector3, size: Vector3, active: boolean): void;
1928
+ /** Dispose resources */
1929
+ dispose(): void;
1930
+ }
1931
+ /**
1932
+ * Global registry for builtin NavigationEngines
1933
+ */
1934
+ declare const navigationEngineRegistry: Map<string, NavigationEngine>;
1935
+ /**
1936
+ * Register a navigation engine implementation
1937
+ */
1938
+ declare function registerNavigationEngine(name: string, engine: NavigationEngine): void;
1939
+ /**
1940
+ * Get a registered navigation engine
1941
+ */
1942
+ declare function getNavigationEngine(name: string): NavigationEngine | undefined;
1943
+
1944
+ /**
1945
+ * @holoscript/core Physics Engine Interface
1946
+ *
1947
+ * Defines the @builtin runtime interface for GPU-accelerated mass physics.
1948
+ * Runtimes implement this to bridge with WebGPU, PhysX, or Bullet backends.
1949
+ */
1950
+ /**
1951
+ * Physics engine configuration
1952
+ */
1953
+ interface PhysicsConfig$1 {
1954
+ /** Backend provider (e.g., 'webgpu', 'physx-gpu', 'bullet') */
1955
+ backend: string;
1956
+ /** Gravity vector */
1957
+ gravity: [number, number, number];
1958
+ /** Global simulation parameters */
1959
+ parameters?: {
1960
+ substeps?: number;
1961
+ solverIterations?: number;
1962
+ broadphase?: 'sap' | 'bvh' | 'grid';
1963
+ gpuMemoryLimitMB?: number;
1964
+ };
1965
+ }
1966
+ /**
1967
+ * Rigid body properties
1968
+ */
1969
+ interface BodyProps {
1970
+ type: 'dynamic' | 'static' | 'kinematic';
1971
+ mass: number;
1972
+ position: [number, number, number];
1973
+ rotation: [number, number, number, number];
1974
+ velocity?: [number, number, number];
1975
+ angularVelocity?: [number, number, number];
1976
+ shape: 'box' | 'sphere' | 'capsule' | 'mesh';
1977
+ shapeParams?: number[];
1978
+ friction?: number;
1979
+ restitution?: number;
1980
+ linearDamping?: number;
1981
+ angularDamping?: number;
1982
+ }
1983
+ /**
1984
+ * Current state of a rigid body synced from GPU
1985
+ */
1986
+ interface BodyState {
1987
+ position: [number, number, number];
1988
+ rotation: [number, number, number, number];
1989
+ velocity: [number, number, number];
1990
+ angularVelocity: [number, number, number];
1991
+ isSleeping: boolean;
1992
+ }
1993
+ /**
1994
+ * PhysicsEngine @builtin Interface
1995
+ */
1996
+ interface PhysicsEngine {
1997
+ /** Initialize the engine with config */
1998
+ initialize(config: PhysicsConfig$1): Promise<void>;
1999
+ /** Add a body to the simulation */
2000
+ addBody(id: string, props: BodyProps): void;
2001
+ /** Remove a body from the simulation */
2002
+ removeBody(id: string): void;
2003
+ /** Update body properties (e.g., teleport, change velocity) */
2004
+ updateBody(id: string, props: Partial<BodyProps>): void;
2005
+ /** Apply a force or impulse to a body */
2006
+ applyForce(id: string, force: [number, number, number], point?: [number, number, number]): void;
2007
+ /** Step the simulation */
2008
+ step(dt: number): void;
2009
+ /**
2010
+ * Get the current state of all bodies.
2011
+ * This is typically called once per frame to sync GPU state back to CPU objects.
2012
+ */
2013
+ getStates(): Record<string, BodyState>;
2014
+ /** Dispose resources */
2015
+ dispose(): void;
2016
+ }
2017
+ /**
2018
+ * Global registry for builtin PhysicsEngines
2019
+ */
2020
+ declare const physicsEngineRegistry: Map<string, PhysicsEngine>;
2021
+ /**
2022
+ * Register a physics engine implementation
2023
+ */
2024
+ declare function registerPhysicsEngine(name: string, engine: PhysicsEngine): void;
2025
+ /**
2026
+ * Get a registered physics engine
2027
+ */
2028
+ declare function getPhysicsEngine(name: string): PhysicsEngine | undefined;
2029
+
2030
+ interface StateMachineInstance {
2031
+ definition: StateMachineNode;
2032
+ currentState: string;
2033
+ context: Record<string, any>;
2034
+ }
2035
+ /** Hook executor function type */
2036
+ type HookExecutor = (code: string, context: Record<string, any>) => any;
2037
+ /**
2038
+ * StateMachineInterpreter - Handles runtime execution of spatial state machines
2039
+ */
2040
+ declare class StateMachineInterpreter {
2041
+ private instances;
2042
+ private hookExecutor;
2043
+ /**
2044
+ * Set the hook executor function (called by runtime during initialization)
2045
+ */
2046
+ setHookExecutor(executor: HookExecutor): void;
2047
+ /**
2048
+ * Initialize a new state machine instance
2049
+ */
2050
+ createInstance(id: string, definition: StateMachineNode, context: Record<string, any>): StateMachineInstance;
2051
+ /**
2052
+ * Process an event and trigger transitions
2053
+ */
2054
+ sendEvent(id: string, event: string): boolean;
2055
+ /**
2056
+ * Force transition to a specific state
2057
+ */
2058
+ transitionTo(id: string, targetStateName: string): void;
2059
+ /**
2060
+ * Execute code block using the registered hook executor
2061
+ */
2062
+ private executeHook;
2063
+ getInstance(id: string): StateMachineInstance | undefined;
2064
+ removeInstance(id: string): void;
2065
+ }
2066
+ declare const stateMachineInterpreter: StateMachineInterpreter;
2067
+
2068
+ /**
2069
+ * @fileoverview HoloLand Culture Runtime — Live Norm + Memory Engine
2070
+ * @module @holoscript/core/runtime
2071
+ *
2072
+ * Wires the CulturalMemory and NormEngine into HoloLand's tick loop.
2073
+ * Manages the full lifecycle of emergent culture within a running world:
2074
+ *
2075
+ * - Agent registration and norm adoption on join
2076
+ * - Per-tick memory decay and trace evaporation
2077
+ * - Effect-based norm compliance evaluation (real-time)
2078
+ * - SOP consolidation on tick intervals
2079
+ * - Cultural health monitoring for world operators
2080
+ * - Event bus for culture-related notifications
2081
+ *
2082
+ * @version 1.0.0
2083
+ */
2084
+
2085
+ /** A culture event emitted by the runtime */
2086
+ interface CultureEvent {
2087
+ type: 'violation' | 'norm_adopted' | 'norm_proposed' | 'sop_formed' | 'cultural_shift' | 'trace_reinforced';
2088
+ agentId: string;
2089
+ normId?: string;
2090
+ details: string;
2091
+ timestamp: number;
2092
+ severity: 'info' | 'warning' | 'critical';
2093
+ }
2094
+ /** Culture runtime configuration */
2095
+ interface CultureRuntimeConfig {
2096
+ /** Ticks between SOP consolidation runs */
2097
+ consolidationInterval: number;
2098
+ /** Ticks between adoption curve snapshots */
2099
+ snapshotInterval: number;
2100
+ /** Default norms all agents must adopt */
2101
+ defaultNorms: string[];
2102
+ /** Cultural health warning threshold (0-1) */
2103
+ healthWarningThreshold: number;
2104
+ /** Max events to retain */
2105
+ maxEventHistory: number;
2106
+ /** Enable auto-enforcement (block hard violations) */
2107
+ autoEnforce: boolean;
2108
+ }
2109
+ /**
2110
+ * CultureRuntime — manages emergent culture within a HoloLand world.
2111
+ */
2112
+ declare class CultureRuntime {
2113
+ private config;
2114
+ private memory;
2115
+ private norms;
2116
+ private events;
2117
+ private tickCount;
2118
+ private agents;
2119
+ private lastHealthScore;
2120
+ constructor(config?: Partial<CultureRuntimeConfig>);
2121
+ /**
2122
+ * Agent joins the world.
2123
+ */
2124
+ agentJoin(agentId: string, adoptNorms?: string[]): void;
2125
+ /**
2126
+ * Agent leaves the world (consolidate their knowledge first).
2127
+ */
2128
+ agentLeave(agentId: string): SemanticSOP[];
2129
+ /**
2130
+ * Main tick: advance the culture simulation.
2131
+ * Call this once per world tick.
2132
+ */
2133
+ tick(): {
2134
+ decayed: ReturnType<CulturalMemory['tick']>;
2135
+ events: CultureEvent[];
2136
+ };
2137
+ /**
2138
+ * Evaluate an agent's intended effects against active norms.
2139
+ * Called before allowing the agent to execute an action.
2140
+ *
2141
+ * @returns Whether the action is allowed (true) or blocked (false)
2142
+ */
2143
+ evaluateAction(agentId: string, effects: VREffect[], zoneId?: string): {
2144
+ allowed: boolean;
2145
+ violations: NormViolation[];
2146
+ blocked: VREffect[];
2147
+ };
2148
+ /**
2149
+ * Record an experience for an agent.
2150
+ */
2151
+ recordExperience(agentId: string, event: string, opts?: {
2152
+ normId?: string;
2153
+ valence?: number;
2154
+ importance?: number;
2155
+ participants?: string[];
2156
+ tags?: string[];
2157
+ }): EpisodicMemory;
2158
+ /**
2159
+ * Leave a trace in the world.
2160
+ */
2161
+ leaveTrace(agentId: string, zoneId: string, label: string, position: [number, number, number]): StigmergicTrace;
2162
+ /**
2163
+ * Perceive nearby traces.
2164
+ */
2165
+ perceiveTraces(zoneId: string, position: [number, number, number]): StigmergicTrace[];
2166
+ /**
2167
+ * Propose a new norm.
2168
+ */
2169
+ proposeNorm(agentId: string, norm: CulturalNorm): NormProposal;
2170
+ /**
2171
+ * Get cultural dashboard data.
2172
+ */
2173
+ dashboard(): {
2174
+ health: number;
2175
+ agents: number;
2176
+ normStats: ReturnType<NormEngine['stats']>;
2177
+ memoryStats: ReturnType<CulturalMemory['stats']>;
2178
+ recentEvents: CultureEvent[];
2179
+ tickCount: number;
2180
+ };
2181
+ /**
2182
+ * Get event history.
2183
+ */
2184
+ getEvents(filter?: {
2185
+ type?: CultureEvent['type'];
2186
+ agentId?: string;
2187
+ }): CultureEvent[];
2188
+ /**
2189
+ * Export full culture state (for world save).
2190
+ */
2191
+ exportState(): {
2192
+ memory: ReturnType<CulturalMemory['exportState']>;
2193
+ tickCount: number;
2194
+ };
2195
+ private emit;
2196
+ }
2197
+
2198
+ /**
2199
+ * MQTT Client for HoloScript IoT Integration
2200
+ *
2201
+ * Provides MQTT 3.1.1 and 5.0 protocol support for IoT device communication.
2202
+ * Supports pub/sub patterns, QoS levels, and wildcard subscriptions.
2203
+ *
2204
+ * @version 1.0.0
2205
+ */
2206
+ type QoS = 0 | 1 | 2;
2207
+ type MQTTVersion = '3.1.1' | '5.0';
2208
+ interface MQTTClientConfig {
2209
+ /** Broker URL (e.g., mqtt://localhost:1883, wss://broker.example.com) */
2210
+ broker: string;
2211
+ /** Client ID (auto-generated if not provided) */
2212
+ clientId?: string;
2213
+ /** MQTT protocol version */
2214
+ version?: MQTTVersion;
2215
+ /** Username for authentication */
2216
+ username?: string;
2217
+ /** Password for authentication */
2218
+ password?: string;
2219
+ /** Keep-alive interval in seconds */
2220
+ keepAlive?: number;
2221
+ /** Clean session flag */
2222
+ cleanSession?: boolean;
2223
+ /** Reconnect options */
2224
+ reconnect?: {
2225
+ enabled: boolean;
2226
+ maxAttempts?: number;
2227
+ baseDelay?: number;
2228
+ maxDelay?: number;
2229
+ };
2230
+ /** TLS/SSL options */
2231
+ tls?: {
2232
+ enabled: boolean;
2233
+ rejectUnauthorized?: boolean;
2234
+ ca?: string;
2235
+ cert?: string;
2236
+ key?: string;
2237
+ };
2238
+ /** Will message */
2239
+ will?: {
2240
+ topic: string;
2241
+ payload: string | Buffer;
2242
+ qos?: QoS;
2243
+ retain?: boolean;
2244
+ };
2245
+ }
2246
+ interface MQTTMessage {
2247
+ topic: string;
2248
+ payload: Buffer | string;
2249
+ qos: QoS;
2250
+ retain: boolean;
2251
+ /** MQTT 5.0 properties */
2252
+ properties?: {
2253
+ payloadFormatIndicator?: number;
2254
+ messageExpiryInterval?: number;
2255
+ contentType?: string;
2256
+ responseTopic?: string;
2257
+ correlationData?: Buffer;
2258
+ userProperties?: Record<string, string>;
2259
+ };
2260
+ }
2261
+ interface MQTTSubscription {
2262
+ topic: string;
2263
+ qos: QoS;
2264
+ /** No Local flag (MQTT 5.0) */
2265
+ noLocal?: boolean;
2266
+ /** Retain as Published flag (MQTT 5.0) */
2267
+ retainAsPublished?: boolean;
2268
+ /** Retain handling option (MQTT 5.0) */
2269
+ retainHandling?: 0 | 1 | 2;
2270
+ }
2271
+ interface MQTTPublishOptions {
2272
+ qos?: QoS;
2273
+ retain?: boolean;
2274
+ /** MQTT 5.0 properties */
2275
+ properties?: MQTTMessage['properties'];
2276
+ }
2277
+ type MQTTClientState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'closed';
2278
+ interface MQTTClientEvents {
2279
+ connect: () => void;
2280
+ disconnect: (reason?: string) => void;
2281
+ reconnect: (attempt: number) => void;
2282
+ message: (topic: string, message: MQTTMessage) => void;
2283
+ error: (error: Error) => void;
2284
+ offline: () => void;
2285
+ }
2286
+ declare class MQTTClient {
2287
+ private config;
2288
+ private state;
2289
+ private subscriptions;
2290
+ private messageQueue;
2291
+ private reconnectAttempts;
2292
+ private reconnectTimeout;
2293
+ private eventHandlers;
2294
+ private simulatedMode;
2295
+ constructor(config: MQTTClientConfig);
2296
+ /**
2297
+ * Connect to the MQTT broker
2298
+ */
2299
+ connect(): Promise<void>;
2300
+ /**
2301
+ * Disconnect from the MQTT broker
2302
+ */
2303
+ disconnect(): Promise<void>;
2304
+ /**
2305
+ * Get current connection state
2306
+ */
2307
+ getState(): MQTTClientState;
2308
+ /**
2309
+ * Check if connected
2310
+ */
2311
+ isConnected(): boolean;
2312
+ /**
2313
+ * Publish a message to a topic
2314
+ */
2315
+ publish(topic: string, payload: string | Buffer | object, options?: MQTTPublishOptions): Promise<void>;
2316
+ /**
2317
+ * Subscribe to a topic pattern
2318
+ */
2319
+ subscribe(topicOrSubscription: string | MQTTSubscription, handler: (message: MQTTMessage) => void): Promise<void>;
2320
+ /**
2321
+ * Unsubscribe from a topic
2322
+ */
2323
+ unsubscribe(topic: string, handler?: (message: MQTTMessage) => void): Promise<void>;
2324
+ /**
2325
+ * Get active subscriptions
2326
+ */
2327
+ getSubscriptions(): string[];
2328
+ /**
2329
+ * Register an event handler
2330
+ */
2331
+ on<K extends keyof MQTTClientEvents>(event: K, handler: MQTTClientEvents[K]): void;
2332
+ /**
2333
+ * Remove an event handler
2334
+ */
2335
+ off<K extends keyof MQTTClientEvents>(event: K, handler: MQTTClientEvents[K]): void;
2336
+ /**
2337
+ * Emit an event
2338
+ */
2339
+ private emit;
2340
+ /**
2341
+ * Check if a topic matches a subscription pattern
2342
+ * Supports + (single-level) and # (multi-level) wildcards
2343
+ */
2344
+ static matchTopic(pattern: string, topic: string): boolean;
2345
+ /**
2346
+ * Parse message payload based on content type
2347
+ */
2348
+ static parsePayload(message: MQTTMessage): unknown;
2349
+ private generateClientId;
2350
+ private simulateConnect;
2351
+ private simulatePublish;
2352
+ private simulateSubscribe;
2353
+ private simulateUnsubscribe;
2354
+ private deliverMessage;
2355
+ private scheduleReconnect;
2356
+ private flushMessageQueue;
2357
+ /**
2358
+ * Inject a message for testing purposes
2359
+ */
2360
+ _injectMessage(topic: string, payload: string | Buffer | object): void;
2361
+ }
2362
+ /**
2363
+ * Create an MQTT client
2364
+ */
2365
+ declare function createMQTTClient(config: MQTTClientConfig): MQTTClient;
2366
+ /**
2367
+ * Register a named MQTT client
2368
+ */
2369
+ declare function registerMQTTClient(name: string, client: MQTTClient): void;
2370
+ /**
2371
+ * Get a registered MQTT client
2372
+ */
2373
+ declare function getMQTTClient(name: string): MQTTClient | undefined;
2374
+ /**
2375
+ * Unregister an MQTT client
2376
+ */
2377
+ declare function unregisterMQTTClient(name: string): void;
2378
+
2379
+ /**
2380
+ * TraitContextFactory
2381
+ *
2382
+ * Creates TraitContext objects backed by platform-provided APIs.
2383
+ * This is the dependency-injection layer that connects HoloScript's 121 trait
2384
+ * handlers to real platform services (audio, physics, haptics, accessibility, etc.)
2385
+ *
2386
+ * Without this factory, trait handlers receive no-op context and do nothing.
2387
+ * With it, every trait handler in @holoscript/core actually executes against
2388
+ * real platform services.
2389
+ *
2390
+ * Consuming platforms (e.g., Hololand, custom engines) implement the Provider
2391
+ * interfaces and pass them to createTraitContextFactory().
2392
+ *
2393
+ * @module TraitContextFactory
2394
+ */
2395
+
2396
+ /** Implemented by platform physics engine */
2397
+ interface PhysicsProvider {
2398
+ applyVelocity(nodeId: string, velocity: Vector3): void;
2399
+ applyAngularVelocity(nodeId: string, angularVelocity: Vector3): void;
2400
+ setKinematic(nodeId: string, kinematic: boolean): void;
2401
+ raycast(origin: Vector3, direction: Vector3, maxDistance: number): RaycastHit | null;
2402
+ getBodyPosition?(nodeId: string): Vector3 | null;
2403
+ getBodyVelocity?(nodeId: string): Vector3 | null;
2404
+ }
2405
+ /** Implemented by platform spatial audio engine */
2406
+ interface AudioProvider {
2407
+ playSound(source: string, options?: {
2408
+ position?: Vector3;
2409
+ volume?: number;
2410
+ spatial?: boolean;
2411
+ }): void;
2412
+ updateSpatialSource?(nodeId: string, options: {
2413
+ hrtfProfile?: string;
2414
+ occlusion?: number;
2415
+ reverbWet?: number;
2416
+ }): void;
2417
+ registerAmbisonicSource?(nodeId: string, order: number): void;
2418
+ setAudioPortal?(portalId: string, targetZone: string, openingSize: number): void;
2419
+ updateAudioMaterial?(nodeId: string, absorption: number, reflection: number): void;
2420
+ }
2421
+ /** Implemented by platform haptic engine */
2422
+ interface HapticsProvider {
2423
+ pulse(hand: 'left' | 'right', intensity: number, duration?: number): void;
2424
+ rumble(hand: 'left' | 'right', intensity: number): void;
2425
+ }
2426
+ /** Implemented by platform accessibility manager */
2427
+ interface AccessibilityProvider {
2428
+ announce(text: string): void;
2429
+ setScreenReaderFocus(nodeId: string): void;
2430
+ setAltText(nodeId: string, text: string): void;
2431
+ setHighContrast(enabled: boolean): void;
2432
+ }
2433
+ /** Implemented by WebXR session or platform gesture system */
2434
+ interface VRProvider {
2435
+ getLeftHand(): VRHand | null;
2436
+ getRightHand(): VRHand | null;
2437
+ getHeadsetPosition(): Vector3;
2438
+ getHeadsetRotation(): Vector3;
2439
+ getPointerRay(hand: 'left' | 'right'): {
2440
+ origin: Vector3;
2441
+ direction: Vector3;
2442
+ } | null;
2443
+ getDominantHand(): VRHand | null;
2444
+ }
2445
+ /** Implemented by platform network layer for networked traits */
2446
+ interface NetworkProvider {
2447
+ broadcastState(nodeId: string, state: Record<string, unknown>): void;
2448
+ requestAuthority(nodeId: string): boolean;
2449
+ onRemoteUpdate(nodeId: string, callback: (state: Record<string, unknown>) => void): void;
2450
+ }
2451
+ /** Implemented by platform renderer for volumetric/GPU traits */
2452
+ interface RendererProvider {
2453
+ createGaussianSplat(nodeId: string, config: Record<string, unknown>): void;
2454
+ createPointCloud(nodeId: string, config: Record<string, unknown>): void;
2455
+ dispatchCompute(nodeId: string, shader: string, workgroups: number[]): void;
2456
+ destroyRenderable(nodeId: string): void;
2457
+ }
2458
+ interface TraitContextFactoryConfig {
2459
+ physics?: PhysicsProvider;
2460
+ audio?: AudioProvider;
2461
+ haptics?: HapticsProvider;
2462
+ accessibility?: AccessibilityProvider;
2463
+ vr?: VRProvider;
2464
+ network?: NetworkProvider;
2465
+ renderer?: RendererProvider;
2466
+ }
2467
+ declare class TraitContextFactory {
2468
+ private physicsProvider;
2469
+ private audioProvider;
2470
+ private hapticsProvider;
2471
+ private accessibilityProvider;
2472
+ private vrProvider;
2473
+ private networkProvider;
2474
+ private rendererProvider;
2475
+ private scaleMagnitude;
2476
+ private globalState;
2477
+ private eventListeners;
2478
+ constructor(config?: TraitContextFactoryConfig);
2479
+ setPhysicsProvider(provider: PhysicsProvider): void;
2480
+ setAudioProvider(provider: AudioProvider): void;
2481
+ setHapticsProvider(provider: HapticsProvider): void;
2482
+ setAccessibilityProvider(provider: AccessibilityProvider): void;
2483
+ setVRProvider(provider: VRProvider): void;
2484
+ setNetworkProvider(provider: NetworkProvider): void;
2485
+ setRendererProvider(provider: RendererProvider): void;
2486
+ on(event: string, handler: (payload: unknown) => void): void;
2487
+ off(event: string, handler: (payload: unknown) => void): void;
2488
+ private emit;
2489
+ /**
2490
+ * Build a TraitContext backed by real providers.
2491
+ * Pass this to VRTraitRegistry.attachTrait / updateTrait / handleEvent.
2492
+ */
2493
+ createContext(): TraitContext;
2494
+ getNetworkProvider(): NetworkProvider | undefined;
2495
+ getRendererProvider(): RendererProvider | undefined;
2496
+ dispose(): void;
2497
+ }
2498
+ declare function createTraitContextFactory(config?: TraitContextFactoryConfig): TraitContextFactory;
2499
+
2500
+ /**
2501
+ * Runtime Profile Configuration
2502
+ *
2503
+ * Defines different runtime profiles for various deployment scenarios:
2504
+ * - headless: Server-side execution without rendering (IoT, edge, testing)
2505
+ * - minimal: Lightweight runtime with basic rendering
2506
+ * - standard: Full runtime with all features
2507
+ * - vr: Extended runtime with VR/XR support
2508
+ *
2509
+ * @version 1.0.0
2510
+ */
2511
+ type RuntimeProfileName = 'headless' | 'minimal' | 'standard' | 'vr';
2512
+ interface RenderingConfig {
2513
+ /** Enable visual rendering */
2514
+ enabled: boolean;
2515
+ /** Max FPS (0 = unlimited) */
2516
+ maxFps?: number;
2517
+ /** Enable shadows */
2518
+ shadows?: boolean;
2519
+ /** Enable post-processing */
2520
+ postProcessing?: boolean;
2521
+ /** Renderer type */
2522
+ renderer?: 'webgl' | 'webgpu' | 'canvas2d' | 'none';
2523
+ }
2524
+ interface PhysicsConfig {
2525
+ /** Enable physics simulation */
2526
+ enabled: boolean;
2527
+ /** Physics engine to use */
2528
+ engine?: 'simple' | 'rapier' | 'cannon' | 'none';
2529
+ /** Physics tick rate in Hz */
2530
+ tickRate?: number;
2531
+ /** Gravity vector [x, y, z] */
2532
+ gravity?: [number, number, number];
2533
+ }
2534
+ interface AudioConfig {
2535
+ /** Enable audio system */
2536
+ enabled: boolean;
2537
+ /** Enable spatial audio */
2538
+ spatial?: boolean;
2539
+ /** Max simultaneous sounds */
2540
+ maxSounds?: number;
2541
+ }
2542
+ interface NetworkConfig {
2543
+ /** Enable networking */
2544
+ enabled: boolean;
2545
+ /** Enable state sync */
2546
+ stateSync?: boolean;
2547
+ /** Sync interval in ms */
2548
+ syncInterval?: number;
2549
+ /** Enable WebRTC for P2P */
2550
+ webrtc?: boolean;
2551
+ }
2552
+ interface InputConfig {
2553
+ /** Enable input handling */
2554
+ enabled: boolean;
2555
+ /** Enable keyboard input */
2556
+ keyboard?: boolean;
2557
+ /** Enable mouse input */
2558
+ mouse?: boolean;
2559
+ /** Enable touch input */
2560
+ touch?: boolean;
2561
+ /** Enable gamepad input */
2562
+ gamepad?: boolean;
2563
+ /** Enable VR controller input */
2564
+ vrControllers?: boolean;
2565
+ }
2566
+ interface ProtocolConfig {
2567
+ /** Enable MQTT protocol */
2568
+ mqtt?: boolean;
2569
+ /** Enable WebSocket protocol */
2570
+ websocket?: boolean;
2571
+ /** Enable HTTP REST protocol */
2572
+ http?: boolean;
2573
+ /** Enable CoAP protocol (IoT) */
2574
+ coap?: boolean;
2575
+ }
2576
+ interface RuntimeProfile {
2577
+ /** Profile name */
2578
+ name: RuntimeProfileName;
2579
+ /** Profile description */
2580
+ description: string;
2581
+ /** Rendering configuration */
2582
+ rendering: RenderingConfig;
2583
+ /** Physics configuration */
2584
+ physics: PhysicsConfig;
2585
+ /** Audio configuration */
2586
+ audio: AudioConfig;
2587
+ /** Network configuration */
2588
+ network: NetworkConfig;
2589
+ /** Input configuration */
2590
+ input: InputConfig;
2591
+ /** Protocol bindings configuration */
2592
+ protocols: ProtocolConfig;
2593
+ /** Enable lifecycle hooks */
2594
+ lifecycleHooks: boolean;
2595
+ /** Enable state management */
2596
+ stateManagement: boolean;
2597
+ /** Enable event system */
2598
+ events: boolean;
2599
+ /** Enable trait system */
2600
+ traits: boolean;
2601
+ /** Target memory budget in MB (0 = unlimited) */
2602
+ memoryBudget: number;
2603
+ /** Startup timeout in ms */
2604
+ startupTimeout: number;
2605
+ }
2606
+ /**
2607
+ * Headless profile for server-side execution
2608
+ * - No rendering, audio, or input
2609
+ * - State management, events, traits enabled
2610
+ * - IoT protocols enabled
2611
+ * - Memory budget: 50MB
2612
+ * - Startup time: <500ms
2613
+ */
2614
+ declare const HEADLESS_PROFILE: RuntimeProfile;
2615
+ /**
2616
+ * Minimal profile for lightweight browser execution
2617
+ * - Basic 2D rendering
2618
+ * - Simple physics
2619
+ * - Limited audio
2620
+ */
2621
+ declare const MINIMAL_PROFILE: RuntimeProfile;
2622
+ /**
2623
+ * Standard profile for full browser execution
2624
+ * - Full WebGL rendering
2625
+ * - Full physics
2626
+ * - Spatial audio
2627
+ */
2628
+ declare const STANDARD_PROFILE: RuntimeProfile;
2629
+ /**
2630
+ * VR profile for immersive XR applications
2631
+ * - High-performance WebGL/WebGPU rendering
2632
+ * - Full physics with haptics
2633
+ * - Spatial audio
2634
+ * - VR input support
2635
+ */
2636
+ declare const VR_PROFILE: RuntimeProfile;
2637
+ /**
2638
+ * Get a profile by name
2639
+ */
2640
+ declare function getProfile(name: RuntimeProfileName): RuntimeProfile;
2641
+ /**
2642
+ * Register a custom profile
2643
+ */
2644
+ declare function registerProfile(name: string, profile: RuntimeProfile): void;
2645
+ /**
2646
+ * Get all available profile names
2647
+ */
2648
+ declare function getAvailableProfiles(): RuntimeProfileName[];
2649
+ /**
2650
+ * Create a custom profile by merging with a base profile
2651
+ */
2652
+ declare function createCustomProfile(base: RuntimeProfileName, overrides: Partial<RuntimeProfile>): RuntimeProfile;
2653
+
2654
+ /**
2655
+ * Headless Runtime
2656
+ *
2657
+ * Lightweight runtime for server-side execution, IoT devices, edge computing,
2658
+ * and testing scenarios. No rendering, audio, or input - just state, events,
2659
+ * and trait execution.
2660
+ *
2661
+ * Features:
2662
+ * - State management with reactive updates
2663
+ * - Event system for pub/sub
2664
+ * - Trait system for behavior composition
2665
+ * - Lifecycle hooks (on_mount, on_update, on_unmount)
2666
+ * - MQTT/WebSocket protocol support
2667
+ * - Memory-efficient (<50MB footprint)
2668
+ * - Fast startup (<500ms)
2669
+ *
2670
+ * @version 1.0.0
2671
+ */
2672
+
2673
+ type LifecycleHandler = (...args: unknown[]) => void;
2674
+ interface HeadlessNodeInstance {
2675
+ node: HSPlusNode;
2676
+ lifecycleHandlers: Map<string, LifecycleHandler[]>;
2677
+ children: HeadlessNodeInstance[];
2678
+ parent: HeadlessNodeInstance | null;
2679
+ destroyed: boolean;
2680
+ data?: Record<string, unknown>;
2681
+ }
2682
+ /**
2683
+ * Handler function for BT action dispatch via `runtime.registerAction()`.
2684
+ * Called when the BehaviorTree's native action bridge emits `action:${name}`.
2685
+ * Return true (success) or false (failure). Async handlers return a Promise.
2686
+ */
2687
+ type ActionHandler = (params: Record<string, unknown>, blackboard: Record<string, unknown>, context: {
2688
+ emit: (event: string, payload?: unknown) => void;
2689
+ hostCapabilities?: HostCapabilities;
2690
+ }) => Promise<boolean> | boolean;
2691
+ interface HeadlessRuntimeOptions {
2692
+ /** Runtime profile (defaults to HEADLESS_PROFILE) */
2693
+ profile?: RuntimeProfile;
2694
+ /** External state providers */
2695
+ stateProviders?: Map<string, () => unknown>;
2696
+ /** Update tick rate in Hz (default: 10) */
2697
+ tickRate?: number;
2698
+ /** Enable debug logging */
2699
+ debug?: boolean;
2700
+ /** Max instances limit (default: 1000) */
2701
+ maxInstances?: number;
2702
+ /** Custom builtins to inject */
2703
+ builtins?: Record<string, unknown>;
2704
+ /** Action dispatcher for BehaviorTreeTrait — maps BT action names to external handlers.
2705
+ * Return true (success), false (failure), or 'running' (async in progress).
2706
+ * The blackboard parameter is the BT's shared state for updating conditions. */
2707
+ executeAction?: (owner: unknown, actionName: string, params: Record<string, unknown>, blackboard?: Record<string, unknown>) => boolean | 'running';
2708
+ /** Optional capability adapter for host operations used by traits such as shell/file_system. */
2709
+ hostCapabilities?: HostCapabilities;
2710
+ }
2711
+ interface HeadlessRuntimeStats {
2712
+ /** Number of active node instances */
2713
+ instanceCount: number;
2714
+ /** Memory usage estimate in bytes */
2715
+ memoryEstimate: number;
2716
+ /** Total updates processed */
2717
+ updateCount: number;
2718
+ /** Total events emitted */
2719
+ eventCount: number;
2720
+ /** Uptime in milliseconds */
2721
+ uptime: number;
2722
+ /** Average tick duration in ms */
2723
+ avgTickDuration: number;
2724
+ }
2725
+ declare class HeadlessRuntime {
2726
+ private ast;
2727
+ private profile;
2728
+ private options;
2729
+ state: ReactiveState<any>;
2730
+ private evaluator;
2731
+ private rootInstance;
2732
+ private eventHandlers;
2733
+ private updateInterval;
2734
+ private startTime;
2735
+ private lastTickTime;
2736
+ private tickDurations;
2737
+ private stats;
2738
+ private running;
2739
+ private builtins;
2740
+ private actionRegistry;
2741
+ private _routingEvent;
2742
+ constructor(ast: HSPlusAST, options?: HeadlessRuntimeOptions);
2743
+ private initializeState;
2744
+ private createBuiltins;
2745
+ /**
2746
+ * Start the headless runtime
2747
+ */
2748
+ start(): void;
2749
+ /**
2750
+ * Stop the headless runtime
2751
+ */
2752
+ stop(): void;
2753
+ /**
2754
+ * Check if runtime is running
2755
+ */
2756
+ isRunning(): boolean;
2757
+ private tick;
2758
+ private updateStateProviders;
2759
+ private updateInstance;
2760
+ private instantiateNode;
2761
+ private processDirectives;
2762
+ private registerLifecycleHandler;
2763
+ private callLifecycle;
2764
+ private createTraitContext;
2765
+ /**
2766
+ * Route an event to trait onEvent() handlers on all node instances.
2767
+ * This enables @shell, @file_system, @llm_agent and other traits to
2768
+ * receive events in headless mode (previously only onUpdate/onAttach fired).
2769
+ */
2770
+ private routeEventToTraits;
2771
+ private destroyInstance;
2772
+ /**
2773
+ * Get current state snapshot
2774
+ */
2775
+ getState(): Record<string, unknown>;
2776
+ /**
2777
+ * Update state
2778
+ */
2779
+ setState(updates: Partial<Record<string, unknown>>): void;
2780
+ /**
2781
+ * Get a state value
2782
+ */
2783
+ get<K extends string>(key: K): unknown;
2784
+ /**
2785
+ * Set a state value
2786
+ */
2787
+ set<K extends string>(key: K, value: unknown): void;
2788
+ /**
2789
+ * Emit an event
2790
+ */
2791
+ emit(event: string, payload?: unknown): void;
2792
+ /**
2793
+ * Register a named action handler for BehaviorTree's native action bridge.
2794
+ * When a BT action node emits `action:${name}`, this handler is called
2795
+ * and the result is sent back via `action:result`.
2796
+ */
2797
+ registerAction(name: string, handler: ActionHandler): void;
2798
+ /**
2799
+ * Subscribe to an event
2800
+ */
2801
+ on(event: string, handler: (payload: unknown) => void): () => void;
2802
+ /**
2803
+ * Subscribe to an event (fires once)
2804
+ */
2805
+ once(event: string, handler: (payload: unknown) => void): () => void;
2806
+ /**
2807
+ * Get runtime statistics
2808
+ */
2809
+ getStats(): HeadlessRuntimeStats;
2810
+ /**
2811
+ * Get runtime profile
2812
+ */
2813
+ getProfile(): RuntimeProfile;
2814
+ /**
2815
+ * Find a node by ID
2816
+ */
2817
+ findNode(id: string): HSPlusNode | null;
2818
+ /**
2819
+ * Execute a manual update tick
2820
+ */
2821
+ manualTick(delta?: number): void;
2822
+ private estimateMemory;
2823
+ private log;
2824
+ }
2825
+ /**
2826
+ * Create a new headless runtime instance
2827
+ */
2828
+ declare function createHeadlessRuntime(ast: HSPlusAST, options?: HeadlessRuntimeOptions): HeadlessRuntime;
2829
+
2830
+ /**
2831
+ * HoloScript Runtime System
2832
+ *
2833
+ * Central runtime registry and execution system for HoloScript compositions.
2834
+ */
2835
+
2836
+ type index_AccessibilityProvider = AccessibilityProvider;
2837
+ type index_ActionHandler = ActionHandler;
2838
+ type index_AssetLoader<T = unknown> = AssetLoader<T>;
2839
+ type index_AssetPipeline = AssetPipeline;
2840
+ declare const index_AssetPipeline: typeof AssetPipeline;
2841
+ type index_AudioConfig = AudioConfig;
2842
+ type index_AudioProvider = AudioProvider;
2843
+ type index_BaseRuntimeRenderer = BaseRuntimeRenderer;
2844
+ declare const index_BaseRuntimeRenderer: typeof BaseRuntimeRenderer;
2845
+ type index_BaseVoiceSynthesizer = BaseVoiceSynthesizer;
2846
+ declare const index_BaseVoiceSynthesizer: typeof BaseVoiceSynthesizer;
2847
+ declare const index_BatchedMeshShader: typeof BatchedMeshShader;
2848
+ type index_Batcher<T, R> = Batcher<T, R>;
2849
+ declare const index_Batcher: typeof Batcher;
2850
+ type index_BodyProps = BodyProps;
2851
+ type index_BodyState = BodyState;
2852
+ type index_CultureEvent = CultureEvent;
2853
+ type index_CultureRuntime = CultureRuntime;
2854
+ declare const index_CultureRuntime: typeof CultureRuntime;
2855
+ type index_CultureRuntimeConfig = CultureRuntimeConfig;
2856
+ type index_EmotionConfig = EmotionConfig;
2857
+ type index_EmotionDetector = EmotionDetector;
2858
+ type index_EmotionInference = EmotionInference;
2859
+ type index_EmotionSignals = EmotionSignals;
2860
+ type index_EnginePhase = EnginePhase;
2861
+ type index_EngineStats = EngineStats;
2862
+ type index_GameEngine = GameEngine;
2863
+ declare const index_GameEngine: typeof GameEngine;
2864
+ type index_GameEngineOptions = GameEngineOptions;
2865
+ type index_GameLoop = GameLoop;
2866
+ declare const index_GameLoop: typeof GameLoop;
2867
+ type index_GameLoopOptions = GameLoopOptions;
2868
+ declare const index_HEADLESS_PROFILE: typeof HEADLESS_PROFILE;
2869
+ type index_HapticsProvider = HapticsProvider;
2870
+ type index_HeadlessNodeInstance = HeadlessNodeInstance;
2871
+ type index_HeadlessRuntime = HeadlessRuntime;
2872
+ declare const index_HeadlessRuntime: typeof HeadlessRuntime;
2873
+ type index_HeadlessRuntimeOptions = HeadlessRuntimeOptions;
2874
+ type index_HeadlessRuntimeStats = HeadlessRuntimeStats;
2875
+ type index_HookExecutor = HookExecutor;
2876
+ type index_HotReloadManager = HotReloadManager;
2877
+ declare const index_HotReloadManager: typeof HotReloadManager;
2878
+ type index_HotReloadManagerOptions = HotReloadManagerOptions;
2879
+ type index_InputConfig = InputConfig;
2880
+ type index_InspectorConfig = InspectorConfig;
2881
+ type index_InstanceBatchConfig = InstanceBatchConfig;
2882
+ type index_InstanceBatchStats = InstanceBatchStats;
2883
+ type index_InstancedMeshManager = InstancedMeshManager;
2884
+ declare const index_InstancedMeshManager: typeof InstancedMeshManager;
2885
+ type index_InstancedObjectData = InstancedObjectData;
2886
+ type index_LRUCache<K, V> = LRUCache<K, V>;
2887
+ declare const index_LRUCache: typeof LRUCache;
2888
+ type index_Lazy<T> = Lazy<T>;
2889
+ declare const index_Lazy: typeof Lazy;
2890
+ type index_LocalEmotionDetector = LocalEmotionDetector;
2891
+ declare const index_LocalEmotionDetector: typeof LocalEmotionDetector;
2892
+ declare const index_MINIMAL_PROFILE: typeof MINIMAL_PROFILE;
2893
+ type index_MQTTClient = MQTTClient;
2894
+ declare const index_MQTTClient: typeof MQTTClient;
2895
+ type index_MQTTClientConfig = MQTTClientConfig;
2896
+ type index_MQTTClientEvents = MQTTClientEvents;
2897
+ type index_MQTTClientState = MQTTClientState;
2898
+ type index_MQTTMessage = MQTTMessage;
2899
+ type index_MQTTPublishOptions = MQTTPublishOptions;
2900
+ type index_MQTTSubscription = MQTTSubscription;
2901
+ type index_MQTTVersion = MQTTVersion;
2902
+ declare const index_MemoizedProperty: typeof MemoizedProperty;
2903
+ declare const index_MethodMemoize: typeof MethodMemoize;
2904
+ type index_MockSpeechRecognizer = MockSpeechRecognizer;
2905
+ declare const index_MockSpeechRecognizer: typeof MockSpeechRecognizer;
2906
+ type index_NavDestination = NavDestination;
2907
+ type index_NavigationConfig = NavigationConfig;
2908
+ type index_NavigationEngine = NavigationEngine;
2909
+ type index_NetworkConfig = NetworkConfig;
2910
+ type index_NetworkProvider = NetworkProvider;
2911
+ type index_ObjectInfo = ObjectInfo;
2912
+ type index_ObjectPool<T> = ObjectPool<T>;
2913
+ declare const index_ObjectPool: typeof ObjectPool;
2914
+ declare const index_OptimizedDebrisShader: typeof OptimizedDebrisShader;
2915
+ declare const index_OptimizedFluidShader: typeof OptimizedFluidShader;
2916
+ declare const index_OptimizedParticleShader: typeof OptimizedParticleShader;
2917
+ type index_ParticleSystem = ParticleSystem;
2918
+ type index_PerformanceProfiler = PerformanceProfiler;
2919
+ declare const index_PerformanceProfiler: typeof PerformanceProfiler;
2920
+ type index_PhysicsEngine = PhysicsEngine;
2921
+ type index_PhysicsProvider = PhysicsProvider;
2922
+ type index_PostProcessingConfig = PostProcessingConfig;
2923
+ type index_PostProcessingEffect = PostProcessingEffect;
2924
+ type index_PostProcessingManager = PostProcessingManager;
2925
+ declare const index_PostProcessingManager: typeof PostProcessingManager;
2926
+ type index_PostProcessingQuality = PostProcessingQuality;
2927
+ type index_PostProcessingStats = PostProcessingStats;
2928
+ type index_ProtocolConfig = ProtocolConfig;
2929
+ type index_QoS = QoS;
2930
+ type index_ReloadWatcher<TContent = unknown, TState = unknown> = ReloadWatcher<TContent, TState>;
2931
+ type index_RenderableCamera = RenderableCamera;
2932
+ type index_RenderableLight = RenderableLight;
2933
+ type index_RenderableObject = RenderableObject;
2934
+ type index_RendererConfig = RendererConfig;
2935
+ type index_RendererProvider = RendererProvider;
2936
+ type index_RendererStatistics = RendererStatistics;
2937
+ type index_RenderingConfig = RenderingConfig;
2938
+ type index_RuntimeCapabilities = RuntimeCapabilities;
2939
+ type index_RuntimeExecutor = RuntimeExecutor;
2940
+ type index_RuntimeMetadata = RuntimeMetadata;
2941
+ type index_RuntimeModule = RuntimeModule;
2942
+ type index_RuntimeProfile = RuntimeProfile;
2943
+ type index_RuntimeProfileName = RuntimeProfileName;
2944
+ declare const index_RuntimeRegistry: typeof RuntimeRegistry;
2945
+ type index_RuntimeRenderer = RuntimeRenderer;
2946
+ declare const index_STANDARD_PROFILE: typeof STANDARD_PROFILE;
2947
+ type index_SceneInspector = SceneInspector;
2948
+ declare const index_SceneInspector: typeof SceneInspector;
2949
+ type index_SceneStats = SceneStats;
2950
+ type index_ShaderOptimizationConfig = ShaderOptimizationConfig;
2951
+ type index_ShaderOptimizationManager = ShaderOptimizationManager;
2952
+ declare const index_ShaderOptimizationManager: typeof ShaderOptimizationManager;
2953
+ type index_ShaderPerformanceStats = ShaderPerformanceStats;
2954
+ type index_SpeechRecognizer = SpeechRecognizer;
2955
+ type index_SpeechRecognizerConfig = SpeechRecognizerConfig;
2956
+ type index_StateMachineInstance = StateMachineInstance;
2957
+ type index_StateMachineInterpreter = StateMachineInterpreter;
2958
+ declare const index_StateMachineInterpreter: typeof StateMachineInterpreter;
2959
+ declare const index_TerrainDeformationShader: typeof TerrainDeformationShader;
2960
+ type index_ThreeJSRenderer = ThreeJSRenderer;
2961
+ declare const index_ThreeJSRenderer: typeof ThreeJSRenderer;
2962
+ type index_TraitContextFactory = TraitContextFactory;
2963
+ declare const index_TraitContextFactory: typeof TraitContextFactory;
2964
+ type index_TraitContextFactoryConfig = TraitContextFactoryConfig;
2965
+ type index_TranscriptionSegment = TranscriptionSegment;
2966
+ type index_UpdateHandler = UpdateHandler;
2967
+ type index_VRProvider = VRProvider;
2968
+ declare const index_VR_PROFILE: typeof VR_PROFILE;
2969
+ type index_VoiceConfig = VoiceConfig;
2970
+ type index_VoiceInfo = VoiceInfo;
2971
+ type index_VoiceRequest = VoiceRequest;
2972
+ type index_VoiceSynthesizer = VoiceSynthesizer;
2973
+ declare const index_createCustomProfile: typeof createCustomProfile;
2974
+ declare const index_createHeadlessRuntime: typeof createHeadlessRuntime;
2975
+ declare const index_createMQTTClient: typeof createMQTTClient;
2976
+ declare const index_createTraitContextFactory: typeof createTraitContextFactory;
2977
+ declare const index_emotionDetectorRegistry: typeof emotionDetectorRegistry;
2978
+ declare const index_getAvailableProfiles: typeof getAvailableProfiles;
2979
+ declare const index_getEmotionDetector: typeof getEmotionDetector;
2980
+ declare const index_getGlobalProfiler: typeof getGlobalProfiler;
2981
+ declare const index_getMQTTClient: typeof getMQTTClient;
2982
+ declare const index_getNavigationEngine: typeof getNavigationEngine;
2983
+ declare const index_getPhysicsEngine: typeof getPhysicsEngine;
2984
+ declare const index_getProfile: typeof getProfile;
2985
+ declare const index_getSpeechRecognizer: typeof getSpeechRecognizer;
2986
+ declare const index_getVoiceSynthesizer: typeof getVoiceSynthesizer;
2987
+ declare const index_memoize: typeof memoize;
2988
+ declare const index_navigationEngineRegistry: typeof navigationEngineRegistry;
2989
+ declare const index_physicsEngineRegistry: typeof physicsEngineRegistry;
2990
+ declare const index_registerEmotionDetector: typeof registerEmotionDetector;
2991
+ declare const index_registerMQTTClient: typeof registerMQTTClient;
2992
+ declare const index_registerNavigationEngine: typeof registerNavigationEngine;
2993
+ declare const index_registerPhysicsEngine: typeof registerPhysicsEngine;
2994
+ declare const index_registerProfile: typeof registerProfile;
2995
+ declare const index_registerRuntime: typeof registerRuntime;
2996
+ declare const index_registerSpeechRecognizer: typeof registerSpeechRecognizer;
2997
+ declare const index_registerVoiceSynthesizer: typeof registerVoiceSynthesizer;
2998
+ declare const index_speechRecognizerRegistry: typeof speechRecognizerRegistry;
2999
+ declare const index_stateMachineInterpreter: typeof stateMachineInterpreter;
3000
+ declare const index_unregisterMQTTClient: typeof unregisterMQTTClient;
3001
+ declare const index_voiceSynthesizerRegistry: typeof voiceSynthesizerRegistry;
3002
+ declare namespace index {
3003
+ export { type index_AccessibilityProvider as AccessibilityProvider, type index_ActionHandler as ActionHandler, type index_AssetLoader as AssetLoader, index_AssetPipeline as AssetPipeline, type index_AudioConfig as AudioConfig, type index_AudioProvider as AudioProvider, index_BaseRuntimeRenderer as BaseRuntimeRenderer, index_BaseVoiceSynthesizer as BaseVoiceSynthesizer, index_BatchedMeshShader as BatchedMeshShader, index_Batcher as Batcher, type index_BodyProps as BodyProps, type index_BodyState as BodyState, type index_CultureEvent as CultureEvent, index_CultureRuntime as CultureRuntime, type index_CultureRuntimeConfig as CultureRuntimeConfig, type index_EmotionConfig as EmotionConfig, type index_EmotionDetector as EmotionDetector, type index_EmotionInference as EmotionInference, type index_EmotionSignals as EmotionSignals, type index_EnginePhase as EnginePhase, type index_EngineStats as EngineStats, index_GameEngine as GameEngine, type index_GameEngineOptions as GameEngineOptions, index_GameLoop as GameLoop, type index_GameLoopOptions as GameLoopOptions, index_HEADLESS_PROFILE as HEADLESS_PROFILE, type index_HapticsProvider as HapticsProvider, type index_HeadlessNodeInstance as HeadlessNodeInstance, index_HeadlessRuntime as HeadlessRuntime, type index_HeadlessRuntimeOptions as HeadlessRuntimeOptions, type index_HeadlessRuntimeStats as HeadlessRuntimeStats, type index_HookExecutor as HookExecutor, index_HotReloadManager as HotReloadManager, type index_HotReloadManagerOptions as HotReloadManagerOptions, type index_InputConfig as InputConfig, type index_InspectorConfig as InspectorConfig, type index_InstanceBatchConfig as InstanceBatchConfig, type index_InstanceBatchStats as InstanceBatchStats, index_InstancedMeshManager as InstancedMeshManager, type index_InstancedObjectData as InstancedObjectData, index_LRUCache as LRUCache, index_Lazy as Lazy, index_LocalEmotionDetector as LocalEmotionDetector, index_MINIMAL_PROFILE as MINIMAL_PROFILE, index_MQTTClient as MQTTClient, type index_MQTTClientConfig as MQTTClientConfig, type index_MQTTClientEvents as MQTTClientEvents, type index_MQTTClientState as MQTTClientState, type index_MQTTMessage as MQTTMessage, type index_MQTTPublishOptions as MQTTPublishOptions, type index_MQTTSubscription as MQTTSubscription, type index_MQTTVersion as MQTTVersion, index_MemoizedProperty as MemoizedProperty, index_MethodMemoize as MethodMemoize, index_MockSpeechRecognizer as MockSpeechRecognizer, type index_NavDestination as NavDestination, type index_NavigationConfig as NavigationConfig, type index_NavigationEngine as NavigationEngine, type index_NetworkConfig as NetworkConfig, type index_NetworkProvider as NetworkProvider, type index_ObjectInfo as ObjectInfo, index_ObjectPool as ObjectPool, index_OptimizedDebrisShader as OptimizedDebrisShader, index_OptimizedFluidShader as OptimizedFluidShader, index_OptimizedParticleShader as OptimizedParticleShader, type index_ParticleSystem as ParticleSystem, index_PerformanceProfiler as PerformanceProfiler, type index_PhysicsEngine as PhysicsEngine, type index_PhysicsProvider as PhysicsProvider, type index_PostProcessingConfig as PostProcessingConfig, type index_PostProcessingEffect as PostProcessingEffect, index_PostProcessingManager as PostProcessingManager, type index_PostProcessingQuality as PostProcessingQuality, type index_PostProcessingStats as PostProcessingStats, type index_ProtocolConfig as ProtocolConfig, type index_QoS as QoS, type index_ReloadWatcher as ReloadWatcher, type index_RenderableCamera as RenderableCamera, type index_RenderableLight as RenderableLight, type index_RenderableObject as RenderableObject, type index_RendererConfig as RendererConfig, type index_RendererProvider as RendererProvider, type index_RendererStatistics as RendererStatistics, type index_RenderingConfig as RenderingConfig, type index_RuntimeCapabilities as RuntimeCapabilities, type index_RuntimeExecutor as RuntimeExecutor, type index_RuntimeMetadata as RuntimeMetadata, type index_RuntimeModule as RuntimeModule, type index_RuntimeProfile as RuntimeProfile, type index_RuntimeProfileName as RuntimeProfileName, index_RuntimeRegistry as RuntimeRegistry, type index_RuntimeRenderer as RuntimeRenderer, index_STANDARD_PROFILE as STANDARD_PROFILE, index_SceneInspector as SceneInspector, type index_SceneStats as SceneStats, type index_ShaderOptimizationConfig as ShaderOptimizationConfig, index_ShaderOptimizationManager as ShaderOptimizationManager, type index_ShaderPerformanceStats as ShaderPerformanceStats, type index_SpeechRecognizer as SpeechRecognizer, type index_SpeechRecognizerConfig as SpeechRecognizerConfig, type index_StateMachineInstance as StateMachineInstance, index_StateMachineInterpreter as StateMachineInterpreter, index_TerrainDeformationShader as TerrainDeformationShader, index_ThreeJSRenderer as ThreeJSRenderer, index_TraitContextFactory as TraitContextFactory, type index_TraitContextFactoryConfig as TraitContextFactoryConfig, type index_TranscriptionSegment as TranscriptionSegment, type index_UpdateHandler as UpdateHandler, type index_VRProvider as VRProvider, index_VR_PROFILE as VR_PROFILE, type index_VoiceConfig as VoiceConfig, type index_VoiceInfo as VoiceInfo, type index_VoiceRequest as VoiceRequest, type index_VoiceSynthesizer as VoiceSynthesizer, index_createCustomProfile as createCustomProfile, index_createHeadlessRuntime as createHeadlessRuntime, index_createMQTTClient as createMQTTClient, index_createTraitContextFactory as createTraitContextFactory, index_emotionDetectorRegistry as emotionDetectorRegistry, index_getAvailableProfiles as getAvailableProfiles, index_getEmotionDetector as getEmotionDetector, index_getGlobalProfiler as getGlobalProfiler, index_getMQTTClient as getMQTTClient, index_getNavigationEngine as getNavigationEngine, index_getPhysicsEngine as getPhysicsEngine, index_getProfile as getProfile, index_getSpeechRecognizer as getSpeechRecognizer, index_getVoiceSynthesizer as getVoiceSynthesizer, index_memoize as memoize, index_navigationEngineRegistry as navigationEngineRegistry, index_physicsEngineRegistry as physicsEngineRegistry, index_registerEmotionDetector as registerEmotionDetector, index_registerMQTTClient as registerMQTTClient, index_registerNavigationEngine as registerNavigationEngine, index_registerPhysicsEngine as registerPhysicsEngine, index_registerProfile as registerProfile, index_registerRuntime as registerRuntime, index_registerSpeechRecognizer as registerSpeechRecognizer, index_registerVoiceSynthesizer as registerVoiceSynthesizer, index_speechRecognizerRegistry as speechRecognizerRegistry, index_stateMachineInterpreter as stateMachineInterpreter, index_unregisterMQTTClient as unregisterMQTTClient, index_voiceSynthesizerRegistry as voiceSynthesizerRegistry };
3004
+ }
3005
+
3006
+ export { MemoizedProperty as $, type AccessibilityProvider as A, BaseRuntimeRenderer as B, type CultureEvent as C, type HookExecutor as D, type EmotionConfig as E, HotReloadManager as F, GameEngine as G, HEADLESS_PROFILE as H, type HotReloadManagerOptions as I, type InputConfig as J, type InspectorConfig as K, type InstanceBatchConfig as L, type InstanceBatchStats as M, InstancedMeshManager as N, type InstancedObjectData as O, LRUCache as P, Lazy as Q, LocalEmotionDetector as R, MINIMAL_PROFILE as S, MQTTClient as T, type MQTTClientConfig as U, type MQTTClientEvents as V, type MQTTClientState as W, type MQTTMessage as X, type MQTTPublishOptions as Y, type MQTTSubscription as Z, type MQTTVersion as _, type ActionHandler as a, createMQTTClient as a$, MethodMemoize as a0, MockSpeechRecognizer as a1, type NavDestination as a2, type NavigationConfig as a3, type NavigationEngine as a4, type NetworkConfig as a5, type NetworkProvider as a6, type ObjectInfo as a7, ObjectPool as a8, OptimizedDebrisShader as a9, type RuntimeProfileName as aA, RuntimeRegistry as aB, type RuntimeRenderer as aC, STANDARD_PROFILE as aD, SceneInspector as aE, type SceneStats as aF, type ShaderOptimizationConfig as aG, ShaderOptimizationManager as aH, type ShaderPerformanceStats as aI, type SpeechRecognizer as aJ, type SpeechRecognizerConfig as aK, type StateMachineInstance as aL, StateMachineInterpreter as aM, TerrainDeformationShader as aN, ThreeJSRenderer as aO, TraitContextFactory as aP, type TraitContextFactoryConfig as aQ, type TranscriptionSegment as aR, type UpdateHandler as aS, type VRProvider as aT, VR_PROFILE as aU, type VoiceConfig as aV, type VoiceInfo as aW, type VoiceRequest as aX, type VoiceSynthesizer as aY, createCustomProfile as aZ, createHeadlessRuntime as a_, OptimizedFluidShader as aa, OptimizedParticleShader as ab, type ParticleSystem as ac, PerformanceProfiler as ad, type PhysicsEngine as ae, type PhysicsProvider as af, type PostProcessingConfig as ag, type PostProcessingEffect as ah, PostProcessingManager as ai, type PostProcessingQuality as aj, type PostProcessingStats as ak, type ProtocolConfig as al, type QoS as am, type ReloadWatcher as an, type RenderableCamera as ao, type RenderableLight as ap, type RenderableObject as aq, type RendererConfig as ar, type RendererProvider as as, type RendererStatistics as at, type RenderingConfig as au, type RuntimeCapabilities as av, type RuntimeExecutor as aw, type RuntimeMetadata as ax, type RuntimeModule as ay, type RuntimeProfile as az, type AssetLoader as b, createTraitContextFactory as b0, emotionDetectorRegistry as b1, getAvailableProfiles as b2, getEmotionDetector as b3, getGlobalProfiler as b4, getMQTTClient as b5, getNavigationEngine as b6, getPhysicsEngine as b7, getProfile as b8, getSpeechRecognizer as b9, getVoiceSynthesizer as ba, memoize as bb, navigationEngineRegistry as bc, physicsEngineRegistry as bd, registerEmotionDetector as be, registerMQTTClient as bf, registerNavigationEngine as bg, registerPhysicsEngine as bh, registerProfile as bi, registerRuntime as bj, registerSpeechRecognizer as bk, registerVoiceSynthesizer as bl, speechRecognizerRegistry as bm, stateMachineInterpreter as bn, unregisterMQTTClient as bo, voiceSynthesizerRegistry as bp, AssetPipeline as c, type AudioConfig as d, type AudioProvider as e, BaseVoiceSynthesizer as f, BatchedMeshShader as g, Batcher as h, index as i, type BodyProps as j, type BodyState as k, CultureRuntime as l, type CultureRuntimeConfig as m, type EmotionDetector as n, type EmotionInference as o, type EmotionSignals as p, type EnginePhase as q, type EngineStats as r, type GameEngineOptions as s, GameLoop as t, type GameLoopOptions as u, type HapticsProvider as v, type HeadlessNodeInstance as w, HeadlessRuntime as x, type HeadlessRuntimeOptions as y, type HeadlessRuntimeStats as z };