@holoscript/core 1.0.0-alpha.1 → 2.0.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 (127) hide show
  1. package/package.json +10 -9
  2. package/src/HoloScript2DParser.js +227 -0
  3. package/src/HoloScript2DParser.ts +5 -0
  4. package/src/HoloScriptCodeParser.js +1102 -0
  5. package/src/HoloScriptCodeParser.ts +145 -20
  6. package/src/HoloScriptDebugger.js +458 -0
  7. package/src/HoloScriptParser.js +338 -0
  8. package/src/HoloScriptPlusParser.js +371 -0
  9. package/src/HoloScriptPlusParser.ts +543 -0
  10. package/src/HoloScriptRuntime.js +1399 -0
  11. package/src/HoloScriptRuntime.test.js +351 -0
  12. package/src/HoloScriptRuntime.ts +257 -3
  13. package/src/HoloScriptTypeChecker.js +356 -0
  14. package/src/__tests__/GraphicsServices.test.js +357 -0
  15. package/src/__tests__/GraphicsServices.test.ts +427 -0
  16. package/src/__tests__/HoloScriptPlusParser.test.js +317 -0
  17. package/src/__tests__/HoloScriptPlusParser.test.ts +392 -0
  18. package/src/__tests__/integration.test.js +336 -0
  19. package/src/__tests__/performance.bench.js +218 -0
  20. package/src/__tests__/type-checker.test.js +60 -0
  21. package/src/__tests__/type-checker.test.ts +73 -0
  22. package/src/index.js +217 -0
  23. package/src/index.ts +158 -18
  24. package/src/interop/Interoperability.js +413 -0
  25. package/src/interop/Interoperability.ts +494 -0
  26. package/src/logger.js +42 -0
  27. package/src/parser/EnhancedParser.js +205 -0
  28. package/src/parser/EnhancedParser.ts +251 -0
  29. package/src/parser/HoloScriptPlusParser.js +928 -0
  30. package/src/parser/HoloScriptPlusParser.ts +1089 -0
  31. package/src/runtime/HoloScriptPlusRuntime.js +674 -0
  32. package/src/runtime/HoloScriptPlusRuntime.ts +861 -0
  33. package/src/runtime/PerformanceTelemetry.js +323 -0
  34. package/src/runtime/PerformanceTelemetry.ts +467 -0
  35. package/src/runtime/RuntimeOptimization.js +361 -0
  36. package/src/runtime/RuntimeOptimization.ts +416 -0
  37. package/src/services/HololandGraphicsPipelineService.js +506 -0
  38. package/src/services/HololandGraphicsPipelineService.ts +662 -0
  39. package/src/services/PlatformPerformanceOptimizer.js +356 -0
  40. package/src/services/PlatformPerformanceOptimizer.ts +503 -0
  41. package/src/state/ReactiveState.js +427 -0
  42. package/src/state/ReactiveState.ts +572 -0
  43. package/src/tools/DeveloperExperience.js +376 -0
  44. package/src/tools/DeveloperExperience.ts +438 -0
  45. package/src/traits/AIDriverTrait.js +322 -0
  46. package/src/traits/AIDriverTrait.test.js +329 -0
  47. package/src/traits/AIDriverTrait.test.ts +357 -0
  48. package/src/traits/AIDriverTrait.ts +474 -0
  49. package/src/traits/LightingTrait.js +313 -0
  50. package/src/traits/LightingTrait.test.js +410 -0
  51. package/src/traits/LightingTrait.test.ts +462 -0
  52. package/src/traits/LightingTrait.ts +505 -0
  53. package/src/traits/MaterialTrait.js +194 -0
  54. package/src/traits/MaterialTrait.test.js +286 -0
  55. package/src/traits/MaterialTrait.test.ts +329 -0
  56. package/src/traits/MaterialTrait.ts +324 -0
  57. package/src/traits/RenderingTrait.js +356 -0
  58. package/src/traits/RenderingTrait.test.js +363 -0
  59. package/src/traits/RenderingTrait.test.ts +427 -0
  60. package/src/traits/RenderingTrait.ts +555 -0
  61. package/src/traits/VRTraitSystem.js +740 -0
  62. package/src/traits/VRTraitSystem.ts +1040 -0
  63. package/src/traits/VoiceInputTrait.js +284 -0
  64. package/src/traits/VoiceInputTrait.test.js +226 -0
  65. package/src/traits/VoiceInputTrait.test.ts +252 -0
  66. package/src/traits/VoiceInputTrait.ts +401 -0
  67. package/src/types/AdvancedTypeSystem.js +226 -0
  68. package/src/types/AdvancedTypeSystem.ts +494 -0
  69. package/src/types/HoloScriptPlus.d.ts +853 -0
  70. package/src/types.js +6 -0
  71. package/src/types.ts +96 -1
  72. package/tsconfig.json +1 -1
  73. package/tsup.config.d.ts +2 -0
  74. package/tsup.config.js +18 -0
  75. package/LICENSE +0 -21
  76. package/dist/chunk-3X2EGU7Z.cjs +0 -52
  77. package/dist/chunk-3X2EGU7Z.cjs.map +0 -1
  78. package/dist/chunk-723TPVHD.js +0 -1074
  79. package/dist/chunk-723TPVHD.js.map +0 -1
  80. package/dist/chunk-EOKNAVDO.cjs +0 -424
  81. package/dist/chunk-EOKNAVDO.cjs.map +0 -1
  82. package/dist/chunk-HQZ3HUMY.js +0 -1087
  83. package/dist/chunk-HQZ3HUMY.js.map +0 -1
  84. package/dist/chunk-KWYIVRIH.js +0 -344
  85. package/dist/chunk-KWYIVRIH.js.map +0 -1
  86. package/dist/chunk-LKH4ZAN6.js +0 -421
  87. package/dist/chunk-LKH4ZAN6.js.map +0 -1
  88. package/dist/chunk-SATNCODL.js +0 -45
  89. package/dist/chunk-SATNCODL.js.map +0 -1
  90. package/dist/chunk-VMZN4EVR.cjs +0 -347
  91. package/dist/chunk-VMZN4EVR.cjs.map +0 -1
  92. package/dist/chunk-VV3UUUYP.cjs +0 -1089
  93. package/dist/chunk-VV3UUUYP.cjs.map +0 -1
  94. package/dist/chunk-XRYTSQHZ.cjs +0 -1076
  95. package/dist/chunk-XRYTSQHZ.cjs.map +0 -1
  96. package/dist/debugger.cjs +0 -19
  97. package/dist/debugger.cjs.map +0 -1
  98. package/dist/debugger.d.cts +0 -171
  99. package/dist/debugger.d.ts +0 -171
  100. package/dist/debugger.js +0 -6
  101. package/dist/debugger.js.map +0 -1
  102. package/dist/index.cjs +0 -755
  103. package/dist/index.cjs.map +0 -1
  104. package/dist/index.d.cts +0 -169
  105. package/dist/index.d.ts +0 -169
  106. package/dist/index.js +0 -699
  107. package/dist/index.js.map +0 -1
  108. package/dist/parser.cjs +0 -13
  109. package/dist/parser.cjs.map +0 -1
  110. package/dist/parser.d.cts +0 -154
  111. package/dist/parser.d.ts +0 -154
  112. package/dist/parser.js +0 -4
  113. package/dist/parser.js.map +0 -1
  114. package/dist/runtime.cjs +0 -13
  115. package/dist/runtime.cjs.map +0 -1
  116. package/dist/runtime.d.cts +0 -147
  117. package/dist/runtime.d.ts +0 -147
  118. package/dist/runtime.js +0 -4
  119. package/dist/runtime.js.map +0 -1
  120. package/dist/type-checker.cjs +0 -16
  121. package/dist/type-checker.cjs.map +0 -1
  122. package/dist/type-checker.d.cts +0 -105
  123. package/dist/type-checker.d.ts +0 -105
  124. package/dist/type-checker.js +0 -3
  125. package/dist/type-checker.js.map +0 -1
  126. package/dist/types-WQSk1Qs2.d.cts +0 -238
  127. package/dist/types-WQSk1Qs2.d.ts +0 -238
@@ -1,238 +0,0 @@
1
- /**
2
- * @holoscript/core Types
3
- *
4
- * Core type definitions for HoloScript AST and runtime
5
- */
6
- interface SpatialPosition {
7
- x: number;
8
- y: number;
9
- z: number;
10
- }
11
- interface Position2D {
12
- x: number;
13
- y: number;
14
- }
15
- interface Size2D {
16
- width: number;
17
- height: number;
18
- }
19
- type HologramShape = 'orb' | 'cube' | 'cylinder' | 'pyramid' | 'sphere';
20
- interface HologramProperties {
21
- shape: HologramShape;
22
- color: string;
23
- size: number;
24
- glow: boolean;
25
- interactive: boolean;
26
- }
27
- interface VoiceCommand {
28
- command: string;
29
- confidence: number;
30
- timestamp: number;
31
- spatialContext?: SpatialPosition;
32
- }
33
- type GestureType = 'pinch' | 'swipe' | 'rotate' | 'grab' | 'release';
34
- type HandType = 'left' | 'right';
35
- interface GestureData {
36
- type: GestureType;
37
- position: SpatialPosition;
38
- direction?: SpatialPosition;
39
- magnitude: number;
40
- hand: HandType;
41
- }
42
- interface ASTNode {
43
- type: string;
44
- position?: SpatialPosition;
45
- hologram?: HologramProperties;
46
- /** Source line number (1-indexed) */
47
- line?: number;
48
- /** Source column number (0-indexed) */
49
- column?: number;
50
- }
51
- interface OrbNode extends ASTNode {
52
- type: 'orb';
53
- name: string;
54
- properties: Record<string, unknown>;
55
- methods: MethodNode[];
56
- }
57
- interface MethodNode extends ASTNode {
58
- type: 'method';
59
- name: string;
60
- parameters: ParameterNode[];
61
- body: ASTNode[];
62
- returnType?: string;
63
- }
64
- interface ParameterNode extends ASTNode {
65
- type: 'parameter';
66
- name: string;
67
- dataType: string;
68
- defaultValue?: unknown;
69
- }
70
- interface ConnectionNode extends ASTNode {
71
- type: 'connection';
72
- from: string;
73
- to: string;
74
- dataType: string;
75
- bidirectional: boolean;
76
- }
77
- interface GateNode extends ASTNode {
78
- type: 'gate';
79
- condition: string;
80
- truePath: ASTNode[];
81
- falsePath: ASTNode[];
82
- }
83
- interface StreamNode extends ASTNode {
84
- type: 'stream';
85
- name: string;
86
- source: string;
87
- transformations: TransformationNode[];
88
- }
89
- interface TransformationNode extends ASTNode {
90
- type: 'transformation';
91
- operation: string;
92
- parameters: Record<string, unknown>;
93
- }
94
- interface GenericASTNode extends ASTNode {
95
- [key: string]: unknown;
96
- }
97
- /**
98
- * Primitive types for data cells
99
- */
100
- type DataCellType = 'text' | 'metric' | 'list' | 'status' | 'progress' | 'chart' | 'input' | 'button';
101
- /**
102
- * Style properties for data cells
103
- */
104
- interface DataCellStyle {
105
- color?: string;
106
- glow?: number;
107
- opacity?: number;
108
- fontSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
109
- fontWeight?: 'normal' | 'medium' | 'bold';
110
- }
111
- /**
112
- * Data cell AST node with full nested prop support
113
- */
114
- interface DataCellNode extends ASTNode {
115
- type: 'data_cell';
116
- /** Primitive type for rendering */
117
- cellType: DataCellType;
118
- /** API endpoint for data fetching */
119
- dataSource?: string;
120
- /** Refresh interval in seconds */
121
- refresh?: number;
122
- /** Position offset relative to parent [x, y, z] */
123
- positionOffset?: [number, number, number];
124
- /** Nested properties for component configuration */
125
- props: {
126
- label?: string;
127
- format?: 'number' | 'percent' | 'currency' | 'duration' | 'bytes';
128
- unit?: string;
129
- style?: DataCellStyle;
130
- [key: string]: unknown;
131
- };
132
- }
133
- /**
134
- * Data zone containing multiple data cells
135
- */
136
- interface DataZoneNode extends ASTNode {
137
- type: 'data_zone';
138
- /** Zone identifier */
139
- name: string;
140
- /** Orientation hint for layout */
141
- orientation?: string;
142
- /** Child data cells */
143
- cells: DataCellNode[];
144
- }
145
- interface ForLoopNode extends ASTNode {
146
- type: 'for-loop';
147
- init: string;
148
- condition: string;
149
- update: string;
150
- body: ASTNode[];
151
- }
152
- interface WhileLoopNode extends ASTNode {
153
- type: 'while-loop';
154
- condition: string;
155
- body: ASTNode[];
156
- }
157
- interface ForEachLoopNode extends ASTNode {
158
- type: 'foreach-loop';
159
- variable: string;
160
- collection: string;
161
- body: ASTNode[];
162
- }
163
- interface ImportNode extends ASTNode {
164
- type: 'import';
165
- imports: string[];
166
- defaultImport?: string;
167
- modulePath: string;
168
- }
169
- interface ExportNode extends ASTNode {
170
- type: 'export';
171
- exports?: string[];
172
- declaration?: ASTNode;
173
- }
174
- interface VariableDeclarationNode extends ASTNode {
175
- type: 'variable-declaration';
176
- kind: 'const' | 'let' | 'var';
177
- name: string;
178
- dataType?: string;
179
- value?: unknown;
180
- }
181
- type UIElementType = 'canvas' | 'button' | 'textinput' | 'panel' | 'text' | 'image' | 'list' | 'modal' | 'slider' | 'toggle' | 'dropdown' | 'flex-container' | 'grid-container' | 'scroll-view' | 'tab-view';
182
- interface UI2DNode {
183
- type: '2d-element';
184
- elementType: UIElementType;
185
- name: string;
186
- properties: Record<string, unknown>;
187
- children?: UI2DNode[];
188
- events?: Record<string, string>;
189
- }
190
- interface UIStyle {
191
- backgroundColor?: string;
192
- color?: string;
193
- fontSize?: number;
194
- fontFamily?: string;
195
- borderColor?: string;
196
- borderWidth?: number;
197
- borderRadius?: number;
198
- padding?: number;
199
- margin?: number;
200
- }
201
- interface RuntimeContext {
202
- variables: Map<string, unknown>;
203
- functions: Map<string, MethodNode>;
204
- connections: ConnectionNode[];
205
- spatialMemory: Map<string, SpatialPosition>;
206
- hologramState: Map<string, HologramProperties>;
207
- executionStack: ASTNode[];
208
- }
209
- interface ExecutionResult {
210
- success: boolean;
211
- output?: unknown;
212
- hologram?: HologramProperties;
213
- spatialPosition?: SpatialPosition;
214
- error?: string;
215
- executionTime?: number;
216
- }
217
- interface ParticleSystem {
218
- particles: SpatialPosition[];
219
- color: string;
220
- lifetime: number;
221
- speed: number;
222
- }
223
- interface SecurityConfig {
224
- maxCommandLength: number;
225
- maxTokens: number;
226
- maxHologramsPerUser: number;
227
- suspiciousKeywords: string[];
228
- allowedShapes: string[];
229
- allowedUIElements: string[];
230
- }
231
- interface RuntimeSecurityLimits {
232
- maxExecutionDepth: number;
233
- maxTotalNodes: number;
234
- maxExecutionTimeMs: number;
235
- maxParticlesPerSystem: number;
236
- }
237
-
238
- export type { ASTNode as A, ConnectionNode as C, DataCellType as D, ExportNode as E, ForLoopNode as F, GestureData as G, HologramShape as H, ImportNode as I, MethodNode as M, OrbNode as O, Position2D as P, RuntimeContext as R, SpatialPosition as S, TransformationNode as T, UI2DNode as U, VoiceCommand as V, WhileLoopNode as W, Size2D as a, HologramProperties as b, GestureType as c, HandType as d, ParameterNode as e, GateNode as f, StreamNode as g, GenericASTNode as h, ForEachLoopNode as i, VariableDeclarationNode as j, DataCellStyle as k, DataCellNode as l, DataZoneNode as m, UIElementType as n, UIStyle as o, ExecutionResult as p, ParticleSystem as q, SecurityConfig as r, RuntimeSecurityLimits as s };