@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.
- package/package.json +10 -9
- package/src/HoloScript2DParser.js +227 -0
- package/src/HoloScript2DParser.ts +5 -0
- package/src/HoloScriptCodeParser.js +1102 -0
- package/src/HoloScriptCodeParser.ts +145 -20
- package/src/HoloScriptDebugger.js +458 -0
- package/src/HoloScriptParser.js +338 -0
- package/src/HoloScriptPlusParser.js +371 -0
- package/src/HoloScriptPlusParser.ts +543 -0
- package/src/HoloScriptRuntime.js +1399 -0
- package/src/HoloScriptRuntime.test.js +351 -0
- package/src/HoloScriptRuntime.ts +257 -3
- package/src/HoloScriptTypeChecker.js +356 -0
- package/src/__tests__/GraphicsServices.test.js +357 -0
- package/src/__tests__/GraphicsServices.test.ts +427 -0
- package/src/__tests__/HoloScriptPlusParser.test.js +317 -0
- package/src/__tests__/HoloScriptPlusParser.test.ts +392 -0
- package/src/__tests__/integration.test.js +336 -0
- package/src/__tests__/performance.bench.js +218 -0
- package/src/__tests__/type-checker.test.js +60 -0
- package/src/__tests__/type-checker.test.ts +73 -0
- package/src/index.js +217 -0
- package/src/index.ts +158 -18
- package/src/interop/Interoperability.js +413 -0
- package/src/interop/Interoperability.ts +494 -0
- package/src/logger.js +42 -0
- package/src/parser/EnhancedParser.js +205 -0
- package/src/parser/EnhancedParser.ts +251 -0
- package/src/parser/HoloScriptPlusParser.js +928 -0
- package/src/parser/HoloScriptPlusParser.ts +1089 -0
- package/src/runtime/HoloScriptPlusRuntime.js +674 -0
- package/src/runtime/HoloScriptPlusRuntime.ts +861 -0
- package/src/runtime/PerformanceTelemetry.js +323 -0
- package/src/runtime/PerformanceTelemetry.ts +467 -0
- package/src/runtime/RuntimeOptimization.js +361 -0
- package/src/runtime/RuntimeOptimization.ts +416 -0
- package/src/services/HololandGraphicsPipelineService.js +506 -0
- package/src/services/HololandGraphicsPipelineService.ts +662 -0
- package/src/services/PlatformPerformanceOptimizer.js +356 -0
- package/src/services/PlatformPerformanceOptimizer.ts +503 -0
- package/src/state/ReactiveState.js +427 -0
- package/src/state/ReactiveState.ts +572 -0
- package/src/tools/DeveloperExperience.js +376 -0
- package/src/tools/DeveloperExperience.ts +438 -0
- package/src/traits/AIDriverTrait.js +322 -0
- package/src/traits/AIDriverTrait.test.js +329 -0
- package/src/traits/AIDriverTrait.test.ts +357 -0
- package/src/traits/AIDriverTrait.ts +474 -0
- package/src/traits/LightingTrait.js +313 -0
- package/src/traits/LightingTrait.test.js +410 -0
- package/src/traits/LightingTrait.test.ts +462 -0
- package/src/traits/LightingTrait.ts +505 -0
- package/src/traits/MaterialTrait.js +194 -0
- package/src/traits/MaterialTrait.test.js +286 -0
- package/src/traits/MaterialTrait.test.ts +329 -0
- package/src/traits/MaterialTrait.ts +324 -0
- package/src/traits/RenderingTrait.js +356 -0
- package/src/traits/RenderingTrait.test.js +363 -0
- package/src/traits/RenderingTrait.test.ts +427 -0
- package/src/traits/RenderingTrait.ts +555 -0
- package/src/traits/VRTraitSystem.js +740 -0
- package/src/traits/VRTraitSystem.ts +1040 -0
- package/src/traits/VoiceInputTrait.js +284 -0
- package/src/traits/VoiceInputTrait.test.js +226 -0
- package/src/traits/VoiceInputTrait.test.ts +252 -0
- package/src/traits/VoiceInputTrait.ts +401 -0
- package/src/types/AdvancedTypeSystem.js +226 -0
- package/src/types/AdvancedTypeSystem.ts +494 -0
- package/src/types/HoloScriptPlus.d.ts +853 -0
- package/src/types.js +6 -0
- package/src/types.ts +96 -1
- package/tsconfig.json +1 -1
- package/tsup.config.d.ts +2 -0
- package/tsup.config.js +18 -0
- package/LICENSE +0 -21
- package/dist/chunk-3X2EGU7Z.cjs +0 -52
- package/dist/chunk-3X2EGU7Z.cjs.map +0 -1
- package/dist/chunk-723TPVHD.js +0 -1074
- package/dist/chunk-723TPVHD.js.map +0 -1
- package/dist/chunk-EOKNAVDO.cjs +0 -424
- package/dist/chunk-EOKNAVDO.cjs.map +0 -1
- package/dist/chunk-HQZ3HUMY.js +0 -1087
- package/dist/chunk-HQZ3HUMY.js.map +0 -1
- package/dist/chunk-KWYIVRIH.js +0 -344
- package/dist/chunk-KWYIVRIH.js.map +0 -1
- package/dist/chunk-LKH4ZAN6.js +0 -421
- package/dist/chunk-LKH4ZAN6.js.map +0 -1
- package/dist/chunk-SATNCODL.js +0 -45
- package/dist/chunk-SATNCODL.js.map +0 -1
- package/dist/chunk-VMZN4EVR.cjs +0 -347
- package/dist/chunk-VMZN4EVR.cjs.map +0 -1
- package/dist/chunk-VV3UUUYP.cjs +0 -1089
- package/dist/chunk-VV3UUUYP.cjs.map +0 -1
- package/dist/chunk-XRYTSQHZ.cjs +0 -1076
- package/dist/chunk-XRYTSQHZ.cjs.map +0 -1
- package/dist/debugger.cjs +0 -19
- package/dist/debugger.cjs.map +0 -1
- package/dist/debugger.d.cts +0 -171
- package/dist/debugger.d.ts +0 -171
- package/dist/debugger.js +0 -6
- package/dist/debugger.js.map +0 -1
- package/dist/index.cjs +0 -755
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -169
- package/dist/index.d.ts +0 -169
- package/dist/index.js +0 -699
- package/dist/index.js.map +0 -1
- package/dist/parser.cjs +0 -13
- package/dist/parser.cjs.map +0 -1
- package/dist/parser.d.cts +0 -154
- package/dist/parser.d.ts +0 -154
- package/dist/parser.js +0 -4
- package/dist/parser.js.map +0 -1
- package/dist/runtime.cjs +0 -13
- package/dist/runtime.cjs.map +0 -1
- package/dist/runtime.d.cts +0 -147
- package/dist/runtime.d.ts +0 -147
- package/dist/runtime.js +0 -4
- package/dist/runtime.js.map +0 -1
- package/dist/type-checker.cjs +0 -16
- package/dist/type-checker.cjs.map +0 -1
- package/dist/type-checker.d.cts +0 -105
- package/dist/type-checker.d.ts +0 -105
- package/dist/type-checker.js +0 -3
- package/dist/type-checker.js.map +0 -1
- package/dist/types-WQSk1Qs2.d.cts +0 -238
- package/dist/types-WQSk1Qs2.d.ts +0 -238
package/dist/runtime.d.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { A as ASTNode, p as ExecutionResult, q as ParticleSystem, R as RuntimeContext, b as HologramProperties } from './types-WQSk1Qs2.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* HoloScript Runtime Engine
|
|
5
|
-
*
|
|
6
|
-
* Executes HoloScript AST in VR environment with spatial computation.
|
|
7
|
-
* Supports:
|
|
8
|
-
* - Orb creation and manipulation
|
|
9
|
-
* - Function definition and invocation with arguments
|
|
10
|
-
* - Connections and reactive data flow
|
|
11
|
-
* - Gates (conditionals)
|
|
12
|
-
* - Streams (data pipelines)
|
|
13
|
-
* - 2D UI elements
|
|
14
|
-
* - Built-in commands (show, hide, animate, pulse)
|
|
15
|
-
* - Expression evaluation
|
|
16
|
-
* - Event system
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Event handler type
|
|
21
|
-
*/
|
|
22
|
-
type EventHandler = (data?: unknown) => void | Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Animation state
|
|
25
|
-
*/
|
|
26
|
-
interface Animation {
|
|
27
|
-
target: string;
|
|
28
|
-
property: string;
|
|
29
|
-
from: number;
|
|
30
|
-
to: number;
|
|
31
|
-
duration: number;
|
|
32
|
-
startTime: number;
|
|
33
|
-
easing: string;
|
|
34
|
-
loop?: boolean;
|
|
35
|
-
yoyo?: boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* UI Element state
|
|
39
|
-
*/
|
|
40
|
-
interface UIElementState {
|
|
41
|
-
type: string;
|
|
42
|
-
name: string;
|
|
43
|
-
properties: Record<string, unknown>;
|
|
44
|
-
value?: unknown;
|
|
45
|
-
visible: boolean;
|
|
46
|
-
enabled: boolean;
|
|
47
|
-
}
|
|
48
|
-
declare class HoloScriptRuntime {
|
|
49
|
-
private context;
|
|
50
|
-
private particleSystems;
|
|
51
|
-
private executionHistory;
|
|
52
|
-
private startTime;
|
|
53
|
-
private nodeCount;
|
|
54
|
-
private currentScope;
|
|
55
|
-
private callStack;
|
|
56
|
-
private eventHandlers;
|
|
57
|
-
private animations;
|
|
58
|
-
private uiElements;
|
|
59
|
-
private builtinFunctions;
|
|
60
|
-
constructor();
|
|
61
|
-
/**
|
|
62
|
-
* Initialize built-in functions
|
|
63
|
-
*/
|
|
64
|
-
private initBuiltins;
|
|
65
|
-
/**
|
|
66
|
-
* Execute a single AST node
|
|
67
|
-
*/
|
|
68
|
-
executeNode(node: ASTNode): Promise<ExecutionResult>;
|
|
69
|
-
/**
|
|
70
|
-
* Execute multiple nodes in sequence
|
|
71
|
-
*/
|
|
72
|
-
executeProgram(nodes: ASTNode[], depth?: number): Promise<ExecutionResult[]>;
|
|
73
|
-
/**
|
|
74
|
-
* Call a function with arguments
|
|
75
|
-
*/
|
|
76
|
-
callFunction(name: string, args?: unknown[]): Promise<ExecutionResult>;
|
|
77
|
-
/**
|
|
78
|
-
* Set a variable in current scope
|
|
79
|
-
*/
|
|
80
|
-
setVariable(name: string, value: unknown): void;
|
|
81
|
-
/**
|
|
82
|
-
* Get a variable from scope chain
|
|
83
|
-
*/
|
|
84
|
-
getVariable(name: string): unknown;
|
|
85
|
-
/**
|
|
86
|
-
* Evaluate an expression
|
|
87
|
-
*/
|
|
88
|
-
evaluateExpression(expr: string): unknown;
|
|
89
|
-
/**
|
|
90
|
-
* Split string by comma, respecting nesting
|
|
91
|
-
*/
|
|
92
|
-
private splitByComma;
|
|
93
|
-
private executeOrb;
|
|
94
|
-
private executeFunction;
|
|
95
|
-
private executeConnection;
|
|
96
|
-
private executeGate;
|
|
97
|
-
private executeStream;
|
|
98
|
-
private executeCall;
|
|
99
|
-
private executeDebug;
|
|
100
|
-
private executeVisualize;
|
|
101
|
-
private executeUIElement;
|
|
102
|
-
private executeStructure;
|
|
103
|
-
private executeAssignment;
|
|
104
|
-
private executeReturn;
|
|
105
|
-
private evaluateCondition;
|
|
106
|
-
private applyTransformation;
|
|
107
|
-
/**
|
|
108
|
-
* Register event handler
|
|
109
|
-
*/
|
|
110
|
-
on(event: string, handler: EventHandler): void;
|
|
111
|
-
/**
|
|
112
|
-
* Remove event handler
|
|
113
|
-
*/
|
|
114
|
-
off(event: string, handler?: EventHandler): void;
|
|
115
|
-
/**
|
|
116
|
-
* Emit event
|
|
117
|
-
*/
|
|
118
|
-
emit(event: string, data?: unknown): Promise<void>;
|
|
119
|
-
/**
|
|
120
|
-
* Trigger UI event
|
|
121
|
-
*/
|
|
122
|
-
triggerUIEvent(elementName: string, eventType: string, data?: unknown): Promise<void>;
|
|
123
|
-
/**
|
|
124
|
-
* Update all animations
|
|
125
|
-
*/
|
|
126
|
-
updateAnimations(): void;
|
|
127
|
-
private applyEasing;
|
|
128
|
-
private createParticleEffect;
|
|
129
|
-
private createConnectionStream;
|
|
130
|
-
private createFlowingStream;
|
|
131
|
-
private createExecutionEffect;
|
|
132
|
-
private createDataVisualization;
|
|
133
|
-
private getDataTypeColor;
|
|
134
|
-
getParticleSystems(): Map<string, ParticleSystem>;
|
|
135
|
-
updateParticles(deltaTime: number): void;
|
|
136
|
-
getContext(): RuntimeContext;
|
|
137
|
-
getUIElements(): Map<string, UIElementState>;
|
|
138
|
-
getUIElement(name: string): UIElementState | undefined;
|
|
139
|
-
getAnimations(): Map<string, Animation>;
|
|
140
|
-
reset(): void;
|
|
141
|
-
private createEmptyContext;
|
|
142
|
-
getExecutionHistory(): ExecutionResult[];
|
|
143
|
-
getHologramStates(): Map<string, HologramProperties>;
|
|
144
|
-
getCallStack(): string[];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export { HoloScriptRuntime };
|
package/dist/runtime.js
DELETED
package/dist/runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"runtime.js"}
|
package/dist/type-checker.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkVMZN4EVR_cjs = require('./chunk-VMZN4EVR.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "HoloScriptTypeChecker", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkVMZN4EVR_cjs.HoloScriptTypeChecker; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "createTypeChecker", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkVMZN4EVR_cjs.createTypeChecker; }
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=type-checker.cjs.map
|
|
16
|
-
//# sourceMappingURL=type-checker.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"type-checker.cjs"}
|
package/dist/type-checker.d.cts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { A as ASTNode } from './types-WQSk1Qs2.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* HoloScript Type Checker
|
|
5
|
-
*
|
|
6
|
-
* Static type analysis for HoloScript code.
|
|
7
|
-
* Validates types, detects errors, and provides type information.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
type HoloScriptType = 'number' | 'string' | 'boolean' | 'array' | 'object' | 'function' | 'void' | 'any' | 'unknown' | 'never' | 'orb' | 'stream' | 'connection' | 'gate';
|
|
11
|
-
interface TypeInfo {
|
|
12
|
-
type: HoloScriptType;
|
|
13
|
-
elementType?: HoloScriptType;
|
|
14
|
-
properties?: Map<string, TypeInfo>;
|
|
15
|
-
parameters?: ParameterType[];
|
|
16
|
-
returnType?: HoloScriptType;
|
|
17
|
-
nullable?: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface ParameterType {
|
|
20
|
-
name: string;
|
|
21
|
-
type: HoloScriptType;
|
|
22
|
-
optional?: boolean;
|
|
23
|
-
defaultValue?: unknown;
|
|
24
|
-
}
|
|
25
|
-
interface TypeDiagnostic {
|
|
26
|
-
severity: 'error' | 'warning' | 'info';
|
|
27
|
-
message: string;
|
|
28
|
-
line: number;
|
|
29
|
-
column: number;
|
|
30
|
-
code: string;
|
|
31
|
-
suggestions?: string[];
|
|
32
|
-
}
|
|
33
|
-
interface TypeCheckResult {
|
|
34
|
-
valid: boolean;
|
|
35
|
-
diagnostics: TypeDiagnostic[];
|
|
36
|
-
typeMap: Map<string, TypeInfo>;
|
|
37
|
-
}
|
|
38
|
-
declare class HoloScriptTypeChecker {
|
|
39
|
-
private typeMap;
|
|
40
|
-
private diagnostics;
|
|
41
|
-
private currentLine;
|
|
42
|
-
private currentColumn;
|
|
43
|
-
constructor();
|
|
44
|
-
/**
|
|
45
|
-
* Type check an AST
|
|
46
|
-
*/
|
|
47
|
-
check(ast: ASTNode[]): TypeCheckResult;
|
|
48
|
-
/**
|
|
49
|
-
* Collect type declarations
|
|
50
|
-
*/
|
|
51
|
-
private collectDeclaration;
|
|
52
|
-
private collectOrbDeclaration;
|
|
53
|
-
private collectMethodDeclaration;
|
|
54
|
-
private collectVariableDeclaration;
|
|
55
|
-
private collectStreamDeclaration;
|
|
56
|
-
/**
|
|
57
|
-
* Check a node for type errors
|
|
58
|
-
*/
|
|
59
|
-
private checkNode;
|
|
60
|
-
private checkConnection;
|
|
61
|
-
private checkGate;
|
|
62
|
-
private checkForLoop;
|
|
63
|
-
private checkWhileLoop;
|
|
64
|
-
private checkForEachLoop;
|
|
65
|
-
private checkImport;
|
|
66
|
-
private checkExport;
|
|
67
|
-
/**
|
|
68
|
-
* Infer type from a value
|
|
69
|
-
*/
|
|
70
|
-
private inferType;
|
|
71
|
-
/**
|
|
72
|
-
* Parse type string to HoloScriptType
|
|
73
|
-
*/
|
|
74
|
-
private parseTypeString;
|
|
75
|
-
/**
|
|
76
|
-
* Extract variable names from an expression string
|
|
77
|
-
*/
|
|
78
|
-
private extractVariables;
|
|
79
|
-
/**
|
|
80
|
-
* Check if string is a literal
|
|
81
|
-
*/
|
|
82
|
-
private isLiteral;
|
|
83
|
-
/**
|
|
84
|
-
* Add a diagnostic
|
|
85
|
-
*/
|
|
86
|
-
private addDiagnostic;
|
|
87
|
-
/**
|
|
88
|
-
* Get type info for a name
|
|
89
|
-
*/
|
|
90
|
-
getType(name: string): TypeInfo | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* Get all registered types
|
|
93
|
-
*/
|
|
94
|
-
getAllTypes(): Map<string, TypeInfo>;
|
|
95
|
-
/**
|
|
96
|
-
* Reset the type checker
|
|
97
|
-
*/
|
|
98
|
-
reset(): void;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Create a type checker instance
|
|
102
|
-
*/
|
|
103
|
-
declare function createTypeChecker(): HoloScriptTypeChecker;
|
|
104
|
-
|
|
105
|
-
export { type HoloScriptType, HoloScriptTypeChecker, type ParameterType, type TypeCheckResult, type TypeDiagnostic, type TypeInfo, createTypeChecker };
|
package/dist/type-checker.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { A as ASTNode } from './types-WQSk1Qs2.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* HoloScript Type Checker
|
|
5
|
-
*
|
|
6
|
-
* Static type analysis for HoloScript code.
|
|
7
|
-
* Validates types, detects errors, and provides type information.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
type HoloScriptType = 'number' | 'string' | 'boolean' | 'array' | 'object' | 'function' | 'void' | 'any' | 'unknown' | 'never' | 'orb' | 'stream' | 'connection' | 'gate';
|
|
11
|
-
interface TypeInfo {
|
|
12
|
-
type: HoloScriptType;
|
|
13
|
-
elementType?: HoloScriptType;
|
|
14
|
-
properties?: Map<string, TypeInfo>;
|
|
15
|
-
parameters?: ParameterType[];
|
|
16
|
-
returnType?: HoloScriptType;
|
|
17
|
-
nullable?: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface ParameterType {
|
|
20
|
-
name: string;
|
|
21
|
-
type: HoloScriptType;
|
|
22
|
-
optional?: boolean;
|
|
23
|
-
defaultValue?: unknown;
|
|
24
|
-
}
|
|
25
|
-
interface TypeDiagnostic {
|
|
26
|
-
severity: 'error' | 'warning' | 'info';
|
|
27
|
-
message: string;
|
|
28
|
-
line: number;
|
|
29
|
-
column: number;
|
|
30
|
-
code: string;
|
|
31
|
-
suggestions?: string[];
|
|
32
|
-
}
|
|
33
|
-
interface TypeCheckResult {
|
|
34
|
-
valid: boolean;
|
|
35
|
-
diagnostics: TypeDiagnostic[];
|
|
36
|
-
typeMap: Map<string, TypeInfo>;
|
|
37
|
-
}
|
|
38
|
-
declare class HoloScriptTypeChecker {
|
|
39
|
-
private typeMap;
|
|
40
|
-
private diagnostics;
|
|
41
|
-
private currentLine;
|
|
42
|
-
private currentColumn;
|
|
43
|
-
constructor();
|
|
44
|
-
/**
|
|
45
|
-
* Type check an AST
|
|
46
|
-
*/
|
|
47
|
-
check(ast: ASTNode[]): TypeCheckResult;
|
|
48
|
-
/**
|
|
49
|
-
* Collect type declarations
|
|
50
|
-
*/
|
|
51
|
-
private collectDeclaration;
|
|
52
|
-
private collectOrbDeclaration;
|
|
53
|
-
private collectMethodDeclaration;
|
|
54
|
-
private collectVariableDeclaration;
|
|
55
|
-
private collectStreamDeclaration;
|
|
56
|
-
/**
|
|
57
|
-
* Check a node for type errors
|
|
58
|
-
*/
|
|
59
|
-
private checkNode;
|
|
60
|
-
private checkConnection;
|
|
61
|
-
private checkGate;
|
|
62
|
-
private checkForLoop;
|
|
63
|
-
private checkWhileLoop;
|
|
64
|
-
private checkForEachLoop;
|
|
65
|
-
private checkImport;
|
|
66
|
-
private checkExport;
|
|
67
|
-
/**
|
|
68
|
-
* Infer type from a value
|
|
69
|
-
*/
|
|
70
|
-
private inferType;
|
|
71
|
-
/**
|
|
72
|
-
* Parse type string to HoloScriptType
|
|
73
|
-
*/
|
|
74
|
-
private parseTypeString;
|
|
75
|
-
/**
|
|
76
|
-
* Extract variable names from an expression string
|
|
77
|
-
*/
|
|
78
|
-
private extractVariables;
|
|
79
|
-
/**
|
|
80
|
-
* Check if string is a literal
|
|
81
|
-
*/
|
|
82
|
-
private isLiteral;
|
|
83
|
-
/**
|
|
84
|
-
* Add a diagnostic
|
|
85
|
-
*/
|
|
86
|
-
private addDiagnostic;
|
|
87
|
-
/**
|
|
88
|
-
* Get type info for a name
|
|
89
|
-
*/
|
|
90
|
-
getType(name: string): TypeInfo | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* Get all registered types
|
|
93
|
-
*/
|
|
94
|
-
getAllTypes(): Map<string, TypeInfo>;
|
|
95
|
-
/**
|
|
96
|
-
* Reset the type checker
|
|
97
|
-
*/
|
|
98
|
-
reset(): void;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Create a type checker instance
|
|
102
|
-
*/
|
|
103
|
-
declare function createTypeChecker(): HoloScriptTypeChecker;
|
|
104
|
-
|
|
105
|
-
export { type HoloScriptType, HoloScriptTypeChecker, type ParameterType, type TypeCheckResult, type TypeDiagnostic, type TypeInfo, createTypeChecker };
|
package/dist/type-checker.js
DELETED
package/dist/type-checker.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"type-checker.js"}
|
|
@@ -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 };
|