@holoscript/core 2.0.1 → 2.1.0

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 (137) hide show
  1. package/dist/chunk-2XXE34KS.js +344 -0
  2. package/dist/chunk-2XXE34KS.js.map +1 -0
  3. package/dist/chunk-3X2EGU7Z.cjs +52 -0
  4. package/dist/chunk-3X2EGU7Z.cjs.map +1 -0
  5. package/dist/chunk-AFFVFO4D.js +1689 -0
  6. package/dist/chunk-AFFVFO4D.js.map +1 -0
  7. package/dist/chunk-DGUM43GV.js +10 -0
  8. package/dist/chunk-DGUM43GV.js.map +1 -0
  9. package/{src/HoloScriptDebugger.ts → dist/chunk-DOY73HDH.js} +118 -257
  10. package/dist/chunk-DOY73HDH.js.map +1 -0
  11. package/dist/chunk-JEQ2X3Z6.cjs +12 -0
  12. package/dist/chunk-JEQ2X3Z6.cjs.map +1 -0
  13. package/dist/chunk-L6VLNVKP.cjs +1691 -0
  14. package/dist/chunk-L6VLNVKP.cjs.map +1 -0
  15. package/dist/chunk-MFNO57XL.cjs +347 -0
  16. package/dist/chunk-MFNO57XL.cjs.map +1 -0
  17. package/dist/chunk-R75MREOS.cjs +424 -0
  18. package/dist/chunk-R75MREOS.cjs.map +1 -0
  19. package/dist/chunk-SATNCODL.js +45 -0
  20. package/dist/chunk-SATNCODL.js.map +1 -0
  21. package/dist/chunk-T57ZL7KR.cjs +1281 -0
  22. package/dist/chunk-T57ZL7KR.cjs.map +1 -0
  23. package/dist/chunk-U72GEJZT.js +1279 -0
  24. package/dist/chunk-U72GEJZT.js.map +1 -0
  25. package/dist/debugger.cjs +20 -0
  26. package/dist/debugger.cjs.map +1 -0
  27. package/dist/debugger.d.cts +171 -0
  28. package/dist/debugger.d.ts +171 -0
  29. package/dist/debugger.js +7 -0
  30. package/dist/debugger.js.map +1 -0
  31. package/dist/index.cjs +6803 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.cts +4093 -0
  34. package/dist/index.d.ts +4093 -0
  35. package/dist/index.js +6715 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/parser.cjs +14 -0
  38. package/dist/parser.cjs.map +1 -0
  39. package/dist/parser.d.cts +172 -0
  40. package/dist/parser.d.ts +172 -0
  41. package/dist/parser.js +5 -0
  42. package/dist/parser.js.map +1 -0
  43. package/dist/runtime.cjs +14 -0
  44. package/dist/runtime.cjs.map +1 -0
  45. package/dist/runtime.d.cts +200 -0
  46. package/dist/runtime.d.ts +200 -0
  47. package/dist/runtime.js +5 -0
  48. package/dist/runtime.js.map +1 -0
  49. package/dist/type-checker.cjs +17 -0
  50. package/dist/type-checker.cjs.map +1 -0
  51. package/dist/type-checker.d.cts +105 -0
  52. package/dist/type-checker.d.ts +105 -0
  53. package/dist/type-checker.js +4 -0
  54. package/dist/type-checker.js.map +1 -0
  55. package/dist/types-4h8cbtF_.d.cts +329 -0
  56. package/dist/types-4h8cbtF_.d.ts +329 -0
  57. package/package.json +17 -13
  58. package/src/HoloScript2DParser.js +0 -227
  59. package/src/HoloScript2DParser.ts +0 -261
  60. package/src/HoloScriptCodeParser.js +0 -1102
  61. package/src/HoloScriptCodeParser.ts +0 -1188
  62. package/src/HoloScriptDebugger.js +0 -458
  63. package/src/HoloScriptParser.js +0 -338
  64. package/src/HoloScriptParser.ts +0 -397
  65. package/src/HoloScriptPlusParser.js +0 -371
  66. package/src/HoloScriptPlusParser.ts +0 -543
  67. package/src/HoloScriptRuntime.js +0 -1399
  68. package/src/HoloScriptRuntime.test.js +0 -351
  69. package/src/HoloScriptRuntime.test.ts +0 -436
  70. package/src/HoloScriptRuntime.ts +0 -1653
  71. package/src/HoloScriptTypeChecker.js +0 -356
  72. package/src/HoloScriptTypeChecker.ts +0 -475
  73. package/src/__tests__/GraphicsServices.test.js +0 -357
  74. package/src/__tests__/GraphicsServices.test.ts +0 -427
  75. package/src/__tests__/HoloScriptPlusParser.test.js +0 -317
  76. package/src/__tests__/HoloScriptPlusParser.test.ts +0 -392
  77. package/src/__tests__/integration.test.js +0 -336
  78. package/src/__tests__/integration.test.ts +0 -416
  79. package/src/__tests__/performance.bench.js +0 -218
  80. package/src/__tests__/performance.bench.ts +0 -262
  81. package/src/__tests__/type-checker.test.js +0 -60
  82. package/src/__tests__/type-checker.test.ts +0 -73
  83. package/src/index.js +0 -217
  84. package/src/index.ts +0 -426
  85. package/src/interop/Interoperability.js +0 -413
  86. package/src/interop/Interoperability.ts +0 -494
  87. package/src/logger.js +0 -42
  88. package/src/logger.ts +0 -57
  89. package/src/parser/EnhancedParser.js +0 -205
  90. package/src/parser/EnhancedParser.ts +0 -251
  91. package/src/parser/HoloScriptPlusParser.js +0 -928
  92. package/src/parser/HoloScriptPlusParser.ts +0 -1089
  93. package/src/runtime/HoloScriptPlusRuntime.js +0 -674
  94. package/src/runtime/HoloScriptPlusRuntime.ts +0 -861
  95. package/src/runtime/PerformanceTelemetry.js +0 -323
  96. package/src/runtime/PerformanceTelemetry.ts +0 -467
  97. package/src/runtime/RuntimeOptimization.js +0 -361
  98. package/src/runtime/RuntimeOptimization.ts +0 -416
  99. package/src/services/HololandGraphicsPipelineService.js +0 -506
  100. package/src/services/HololandGraphicsPipelineService.ts +0 -662
  101. package/src/services/PlatformPerformanceOptimizer.js +0 -356
  102. package/src/services/PlatformPerformanceOptimizer.ts +0 -503
  103. package/src/state/ReactiveState.js +0 -427
  104. package/src/state/ReactiveState.ts +0 -572
  105. package/src/tools/DeveloperExperience.js +0 -376
  106. package/src/tools/DeveloperExperience.ts +0 -438
  107. package/src/traits/AIDriverTrait.js +0 -322
  108. package/src/traits/AIDriverTrait.test.js +0 -329
  109. package/src/traits/AIDriverTrait.test.ts +0 -357
  110. package/src/traits/AIDriverTrait.ts +0 -474
  111. package/src/traits/LightingTrait.js +0 -313
  112. package/src/traits/LightingTrait.test.js +0 -410
  113. package/src/traits/LightingTrait.test.ts +0 -462
  114. package/src/traits/LightingTrait.ts +0 -505
  115. package/src/traits/MaterialTrait.js +0 -194
  116. package/src/traits/MaterialTrait.test.js +0 -286
  117. package/src/traits/MaterialTrait.test.ts +0 -329
  118. package/src/traits/MaterialTrait.ts +0 -324
  119. package/src/traits/RenderingTrait.js +0 -356
  120. package/src/traits/RenderingTrait.test.js +0 -363
  121. package/src/traits/RenderingTrait.test.ts +0 -427
  122. package/src/traits/RenderingTrait.ts +0 -555
  123. package/src/traits/VRTraitSystem.js +0 -740
  124. package/src/traits/VRTraitSystem.ts +0 -1040
  125. package/src/traits/VoiceInputTrait.js +0 -284
  126. package/src/traits/VoiceInputTrait.test.js +0 -226
  127. package/src/traits/VoiceInputTrait.test.ts +0 -252
  128. package/src/traits/VoiceInputTrait.ts +0 -401
  129. package/src/types/AdvancedTypeSystem.js +0 -226
  130. package/src/types/AdvancedTypeSystem.ts +0 -494
  131. package/src/types/HoloScriptPlus.d.ts +0 -853
  132. package/src/types.js +0 -6
  133. package/src/types.ts +0 -369
  134. package/tsconfig.json +0 -23
  135. package/tsup.config.d.ts +0 -2
  136. package/tsup.config.js +0 -18
  137. package/tsup.config.ts +0 -19
@@ -1,357 +0,0 @@
1
- /**
2
- * Graphics Services Tests
3
- *
4
- * Tests for HololandGraphicsPipelineService and PlatformPerformanceOptimizer
5
- */
6
- import { describe, it, expect } from 'vitest';
7
- import { HololandGraphicsPipelineService } from '../services/HololandGraphicsPipelineService';
8
- import { PlatformPerformanceOptimizer } from '../services/PlatformPerformanceOptimizer';
9
- // ============================================================================
10
- // Hololand Graphics Pipeline Service Tests
11
- // ============================================================================
12
- describe('HololandGraphicsPipelineService', () => {
13
- describe('Initialization', () => {
14
- it('should create instance with default settings', () => {
15
- const service = new HololandGraphicsPipelineService('desktop');
16
- expect(service).toBeDefined();
17
- });
18
- it('should initialize for mobile platform', () => {
19
- const service = new HololandGraphicsPipelineService('mobile');
20
- const estimate = service.getGPUMemoryEstimate();
21
- expect(estimate.budget).toBe(256); // Mobile budget
22
- });
23
- it('should initialize for VR platform', () => {
24
- const service = new HololandGraphicsPipelineService('vr');
25
- const estimate = service.getGPUMemoryEstimate();
26
- expect(estimate.budget).toBe(512); // VR budget
27
- });
28
- it('should initialize for desktop platform', () => {
29
- const service = new HololandGraphicsPipelineService('desktop');
30
- const estimate = service.getGPUMemoryEstimate();
31
- expect(estimate.budget).toBe(2048); // Desktop budget
32
- });
33
- });
34
- describe('GPU Memory Management', () => {
35
- it('should estimate GPU memory correctly', () => {
36
- const service = new HololandGraphicsPipelineService('desktop');
37
- const estimate = service.getGPUMemoryEstimate();
38
- expect(estimate.textureMemory).toBeGreaterThanOrEqual(0);
39
- expect(estimate.geometryMemory).toBeGreaterThanOrEqual(0);
40
- expect(estimate.estimatedTotal).toBeGreaterThanOrEqual(0);
41
- expect(estimate.utilization).toBeGreaterThanOrEqual(0);
42
- });
43
- it('should track memory utilization', () => {
44
- const service = new HololandGraphicsPipelineService('mobile');
45
- const estimate = service.getGPUMemoryEstimate();
46
- // Should not exceed budget
47
- expect(estimate.utilization).toBeLessThanOrEqual(100);
48
- });
49
- it('should allow setting memory budget', () => {
50
- const service = new HololandGraphicsPipelineService('desktop');
51
- service.setMemoryBudget(1024);
52
- const estimate = service.getGPUMemoryEstimate();
53
- expect(estimate.budget).toBe(1024);
54
- });
55
- });
56
- describe('Platform Optimization', () => {
57
- it('should optimize for mobile', () => {
58
- const service = new HololandGraphicsPipelineService('desktop');
59
- service.optimizePlatform('mobile');
60
- const estimate = service.getGPUMemoryEstimate();
61
- expect(estimate.budget).toBe(256);
62
- });
63
- it('should optimize for VR', () => {
64
- const service = new HololandGraphicsPipelineService('desktop');
65
- service.optimizePlatform('vr');
66
- const estimate = service.getGPUMemoryEstimate();
67
- expect(estimate.budget).toBe(512);
68
- });
69
- it('should optimize for desktop', () => {
70
- const service = new HololandGraphicsPipelineService('mobile');
71
- service.optimizePlatform('desktop');
72
- const estimate = service.getGPUMemoryEstimate();
73
- expect(estimate.budget).toBe(2048);
74
- });
75
- });
76
- describe('Performance Metrics', () => {
77
- it('should return performance metrics', () => {
78
- const service = new HololandGraphicsPipelineService('desktop');
79
- const metrics = service.getPerformanceMetrics();
80
- expect(metrics).toBeDefined();
81
- expect(metrics.drawCalls).toBeGreaterThanOrEqual(0);
82
- expect(metrics.fps).toBeGreaterThanOrEqual(0);
83
- expect(metrics.gpuMemoryUsed).toBeGreaterThanOrEqual(0);
84
- });
85
- });
86
- describe('Graphics Configuration', () => {
87
- it('should initialize from graphics configuration', () => {
88
- const service = new HololandGraphicsPipelineService('desktop');
89
- const config = {
90
- material: { type: 'pbr', pbr: { metallic: 0.5 } },
91
- lighting: { preset: 'studio' },
92
- rendering: { quality: 'high' },
93
- };
94
- service.initialize(config);
95
- const estimate = service.getGPUMemoryEstimate();
96
- expect(estimate.estimatedTotal).toBeGreaterThanOrEqual(0);
97
- });
98
- });
99
- });
100
- // ============================================================================
101
- // Platform Performance Optimizer Tests
102
- // ============================================================================
103
- describe('PlatformPerformanceOptimizer', () => {
104
- describe('Device Capabilities Detection', () => {
105
- it('should detect mobile device capabilities', () => {
106
- const device = {
107
- platform: 'mobile',
108
- gpuVendor: 'Qualcomm',
109
- gpuModel: 'Adreno 640',
110
- gpuMemory: 1024,
111
- cpuCores: 4,
112
- ramTotal: 4096,
113
- screenResolution: { width: 1080, height: 2220 },
114
- refreshRate: 90,
115
- };
116
- const optimizer = new PlatformPerformanceOptimizer(device);
117
- const profile = optimizer.getProfile();
118
- expect(profile.qualityLevel).toBe('low');
119
- expect(profile.fpsTarget).toBe(30);
120
- });
121
- it('should detect VR device capabilities', () => {
122
- const device = {
123
- platform: 'vr',
124
- gpuVendor: 'NVIDIA',
125
- gpuModel: 'RTX 2070',
126
- gpuMemory: 8192,
127
- cpuCores: 8,
128
- ramTotal: 16384,
129
- screenResolution: { width: 1832, height: 1920 },
130
- refreshRate: 90,
131
- };
132
- const optimizer = new PlatformPerformanceOptimizer(device);
133
- const profile = optimizer.getProfile();
134
- expect(profile.fpsTarget).toBe(90);
135
- expect(profile.qualityLevel).toBe('high');
136
- });
137
- it('should detect desktop device capabilities', () => {
138
- const device = {
139
- platform: 'desktop',
140
- gpuVendor: 'NVIDIA',
141
- gpuModel: 'RTX 3090',
142
- gpuMemory: 24576,
143
- cpuCores: 16,
144
- ramTotal: 32768,
145
- screenResolution: { width: 3440, height: 1440 },
146
- refreshRate: 165,
147
- };
148
- const optimizer = new PlatformPerformanceOptimizer(device);
149
- const profile = optimizer.getProfile();
150
- expect(profile.qualityLevel).toBe('ultra');
151
- expect(profile.fpsTarget).toBe(165);
152
- });
153
- });
154
- describe('Device Optimization', () => {
155
- it('should generate mobile optimization settings', () => {
156
- const device = {
157
- platform: 'mobile',
158
- gpuVendor: 'Qualcomm',
159
- gpuModel: 'Adreno 640',
160
- gpuMemory: 1024,
161
- cpuCores: 4,
162
- ramTotal: 4096,
163
- screenResolution: { width: 1080, height: 2220 },
164
- refreshRate: 90,
165
- };
166
- const optimizer = new PlatformPerformanceOptimizer(device);
167
- const settings = optimizer.optimizeForDevice();
168
- expect(settings.platform).toBe('mobile');
169
- expect(settings.quality).toBe('low');
170
- expect(settings.textureResolution).toBeLessThanOrEqual(512);
171
- });
172
- it('should generate VR optimization settings', () => {
173
- const device = {
174
- platform: 'vr',
175
- gpuVendor: 'NVIDIA',
176
- gpuModel: 'RTX 2070',
177
- gpuMemory: 8192,
178
- cpuCores: 8,
179
- ramTotal: 16384,
180
- screenResolution: { width: 1832, height: 1920 },
181
- refreshRate: 90,
182
- };
183
- const optimizer = new PlatformPerformanceOptimizer(device);
184
- const settings = optimizer.optimizeForDevice();
185
- expect(settings.platform).toBe('vr');
186
- expect(settings.quality).toBe('high');
187
- });
188
- it('should generate desktop optimization settings', () => {
189
- const device = {
190
- platform: 'desktop',
191
- gpuVendor: 'NVIDIA',
192
- gpuModel: 'RTX 3090',
193
- gpuMemory: 24576,
194
- cpuCores: 16,
195
- ramTotal: 32768,
196
- screenResolution: { width: 3440, height: 1440 },
197
- refreshRate: 165,
198
- };
199
- const optimizer = new PlatformPerformanceOptimizer(device);
200
- const settings = optimizer.optimizeForDevice();
201
- expect(settings.platform).toBe('desktop');
202
- expect(settings.quality).toBe('ultra');
203
- expect(settings.textureResolution).toBe(4096);
204
- });
205
- });
206
- describe('Adaptive Quality', () => {
207
- it('should track frame metrics', () => {
208
- const device = {
209
- platform: 'mobile',
210
- gpuVendor: 'Qualcomm',
211
- gpuModel: 'Adreno 640',
212
- gpuMemory: 1024,
213
- cpuCores: 4,
214
- ramTotal: 4096,
215
- screenResolution: { width: 1080, height: 2220 },
216
- refreshRate: 90,
217
- };
218
- const optimizer = new PlatformPerformanceOptimizer(device);
219
- // Simulate frame updates
220
- optimizer.updateFrameMetrics(30, 500, 16.67);
221
- optimizer.updateFrameMetrics(28, 520, 17.5);
222
- optimizer.updateFrameMetrics(25, 550, 20);
223
- // Should track without errors
224
- expect(true).toBe(true);
225
- });
226
- it('should provide recommendations for low FPS', () => {
227
- const device = {
228
- platform: 'mobile',
229
- gpuVendor: 'Qualcomm',
230
- gpuModel: 'Adreno 640',
231
- gpuMemory: 1024,
232
- cpuCores: 4,
233
- ramTotal: 4096,
234
- screenResolution: { width: 1080, height: 2220 },
235
- refreshRate: 90,
236
- };
237
- const optimizer = new PlatformPerformanceOptimizer(device);
238
- // Simulate low FPS frames
239
- for (let i = 0; i < 10; i++) {
240
- optimizer.updateFrameMetrics(20, 600, 50);
241
- }
242
- const recommendations = optimizer.getRecommendations();
243
- expect(recommendations.length).toBeGreaterThan(0);
244
- });
245
- it('should provide recommendations for low power mode', () => {
246
- const device = {
247
- platform: 'mobile',
248
- gpuVendor: 'Qualcomm',
249
- gpuModel: 'Adreno 640',
250
- gpuMemory: 1024,
251
- cpuCores: 4,
252
- ramTotal: 4096,
253
- screenResolution: { width: 1080, height: 2220 },
254
- refreshRate: 90,
255
- isLowPowerMode: true,
256
- };
257
- const optimizer = new PlatformPerformanceOptimizer(device);
258
- const recommendations = optimizer.getRecommendations();
259
- expect(recommendations.length).toBeGreaterThan(0);
260
- expect(recommendations.some((r) => r.includes('low power'))).toBe(true);
261
- });
262
- });
263
- describe('Performance Profiling', () => {
264
- it('should create performance profile for device', () => {
265
- const device = {
266
- platform: 'desktop',
267
- gpuVendor: 'NVIDIA',
268
- gpuModel: 'RTX 3090',
269
- gpuMemory: 24576,
270
- cpuCores: 16,
271
- ramTotal: 32768,
272
- screenResolution: { width: 3440, height: 1440 },
273
- refreshRate: 165,
274
- };
275
- const optimizer = new PlatformPerformanceOptimizer(device);
276
- const profile = optimizer.getProfile();
277
- expect(profile.device).toEqual(device);
278
- expect(profile.capabilities).toBeDefined();
279
- expect(profile.qualityLevel).toBe('ultra');
280
- });
281
- it('should have appropriate CPU budget for platform', () => {
282
- const mobileDevice = {
283
- platform: 'mobile',
284
- gpuVendor: 'Qualcomm',
285
- gpuModel: 'Adreno 640',
286
- gpuMemory: 1024,
287
- cpuCores: 4,
288
- ramTotal: 4096,
289
- screenResolution: { width: 1080, height: 2220 },
290
- refreshRate: 90,
291
- };
292
- const vrDevice = {
293
- platform: 'vr',
294
- gpuVendor: 'NVIDIA',
295
- gpuModel: 'RTX 2070',
296
- gpuMemory: 8192,
297
- cpuCores: 8,
298
- ramTotal: 16384,
299
- screenResolution: { width: 1832, height: 1920 },
300
- refreshRate: 90,
301
- };
302
- const mobileOptimizer = new PlatformPerformanceOptimizer(mobileDevice);
303
- const vrOptimizer = new PlatformPerformanceOptimizer(vrDevice);
304
- const mobileProfile = mobileOptimizer.getProfile();
305
- const vrProfile = vrOptimizer.getProfile();
306
- // VR should have tighter budget (90 FPS)
307
- expect(vrProfile.cpuBudget).toBeLessThan(mobileProfile.cpuBudget);
308
- });
309
- });
310
- describe('Compression Selection', () => {
311
- it('should select ASTC for mobile', () => {
312
- const device = {
313
- platform: 'mobile',
314
- gpuVendor: 'Qualcomm',
315
- gpuModel: 'Adreno 640',
316
- gpuMemory: 1024,
317
- cpuCores: 4,
318
- ramTotal: 4096,
319
- screenResolution: { width: 1080, height: 2220 },
320
- refreshRate: 90,
321
- };
322
- const optimizer = new PlatformPerformanceOptimizer(device);
323
- const settings = optimizer.optimizeForDevice();
324
- expect(settings.compression).toMatch(/astc|pvrtc/);
325
- });
326
- it('should select Basis for VR', () => {
327
- const device = {
328
- platform: 'vr',
329
- gpuVendor: 'NVIDIA',
330
- gpuModel: 'RTX 2070',
331
- gpuMemory: 8192,
332
- cpuCores: 8,
333
- ramTotal: 16384,
334
- screenResolution: { width: 1832, height: 1920 },
335
- refreshRate: 90,
336
- };
337
- const optimizer = new PlatformPerformanceOptimizer(device);
338
- const settings = optimizer.optimizeForDevice();
339
- expect(settings.compression).toBe('basis');
340
- });
341
- it('should select no compression for desktop', () => {
342
- const device = {
343
- platform: 'desktop',
344
- gpuVendor: 'NVIDIA',
345
- gpuModel: 'RTX 3090',
346
- gpuMemory: 24576,
347
- cpuCores: 16,
348
- ramTotal: 32768,
349
- screenResolution: { width: 3440, height: 1440 },
350
- refreshRate: 165,
351
- };
352
- const optimizer = new PlatformPerformanceOptimizer(device);
353
- const settings = optimizer.optimizeForDevice();
354
- expect(settings.compression).toBe('none');
355
- });
356
- });
357
- });