@holoscript/core 2.0.1 → 2.0.2
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/LICENSE +21 -0
- package/dist/chunk-3N67RLQP.cjs +1298 -0
- package/dist/chunk-3N67RLQP.cjs.map +1 -0
- package/dist/chunk-3X2EGU7Z.cjs +52 -0
- package/dist/chunk-3X2EGU7Z.cjs.map +1 -0
- package/dist/chunk-4CV4JOE5.js +24 -0
- package/dist/chunk-4CV4JOE5.js.map +1 -0
- package/dist/chunk-4OHVW4XR.cjs +1027 -0
- package/dist/chunk-4OHVW4XR.cjs.map +1 -0
- package/dist/chunk-CZLDE2OZ.cjs +28 -0
- package/dist/chunk-CZLDE2OZ.cjs.map +1 -0
- package/{src/HoloScriptRuntime.ts → dist/chunk-EU6CZMGJ.js} +437 -794
- package/dist/chunk-EU6CZMGJ.js.map +1 -0
- package/dist/chunk-KWYIVRIH.js +344 -0
- package/dist/chunk-KWYIVRIH.js.map +1 -0
- package/dist/chunk-MCP6D4LT.js +1025 -0
- package/dist/chunk-MCP6D4LT.js.map +1 -0
- package/dist/chunk-SATNCODL.js +45 -0
- package/dist/chunk-SATNCODL.js.map +1 -0
- package/dist/chunk-VMZN4EVR.cjs +347 -0
- package/dist/chunk-VMZN4EVR.cjs.map +1 -0
- package/{src/HoloScriptDebugger.ts → dist/chunk-VYIDLUCV.js} +118 -257
- package/dist/chunk-VYIDLUCV.js.map +1 -0
- package/dist/chunk-WFI4T3XB.cjs +424 -0
- package/dist/chunk-WFI4T3XB.cjs.map +1 -0
- package/dist/debugger.cjs +20 -0
- package/dist/debugger.cjs.map +1 -0
- package/dist/debugger.d.cts +171 -0
- package/dist/debugger.d.ts +171 -0
- package/dist/debugger.js +7 -0
- package/dist/debugger.js.map +1 -0
- package/dist/index.cjs +6006 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2482 -0
- package/dist/index.d.ts +2482 -0
- package/dist/index.js +5926 -0
- package/dist/index.js.map +1 -0
- package/dist/parser.cjs +14 -0
- package/dist/parser.cjs.map +1 -0
- package/dist/parser.d.cts +139 -0
- package/dist/parser.d.ts +139 -0
- package/dist/parser.js +5 -0
- package/dist/parser.js.map +1 -0
- package/dist/runtime.cjs +14 -0
- package/dist/runtime.cjs.map +1 -0
- package/dist/runtime.d.cts +180 -0
- package/dist/runtime.d.ts +180 -0
- package/dist/runtime.js +5 -0
- package/dist/runtime.js.map +1 -0
- package/dist/type-checker.cjs +17 -0
- package/dist/type-checker.cjs.map +1 -0
- package/dist/type-checker.d.cts +105 -0
- package/dist/type-checker.d.ts +105 -0
- package/dist/type-checker.js +4 -0
- package/dist/type-checker.js.map +1 -0
- package/dist/types-D6g4ACjP.d.cts +262 -0
- package/dist/types-D6g4ACjP.d.ts +262 -0
- package/package.json +11 -8
- package/src/HoloScript2DParser.js +0 -227
- package/src/HoloScript2DParser.ts +0 -261
- package/src/HoloScriptCodeParser.js +0 -1102
- package/src/HoloScriptCodeParser.ts +0 -1188
- package/src/HoloScriptDebugger.js +0 -458
- package/src/HoloScriptParser.js +0 -338
- package/src/HoloScriptParser.ts +0 -397
- package/src/HoloScriptPlusParser.js +0 -371
- package/src/HoloScriptPlusParser.ts +0 -543
- package/src/HoloScriptRuntime.js +0 -1399
- package/src/HoloScriptRuntime.test.js +0 -351
- package/src/HoloScriptRuntime.test.ts +0 -436
- package/src/HoloScriptTypeChecker.js +0 -356
- package/src/HoloScriptTypeChecker.ts +0 -475
- package/src/__tests__/GraphicsServices.test.js +0 -357
- package/src/__tests__/GraphicsServices.test.ts +0 -427
- package/src/__tests__/HoloScriptPlusParser.test.js +0 -317
- package/src/__tests__/HoloScriptPlusParser.test.ts +0 -392
- package/src/__tests__/integration.test.js +0 -336
- package/src/__tests__/integration.test.ts +0 -416
- package/src/__tests__/performance.bench.js +0 -218
- package/src/__tests__/performance.bench.ts +0 -262
- package/src/__tests__/type-checker.test.js +0 -60
- package/src/__tests__/type-checker.test.ts +0 -73
- package/src/index.js +0 -217
- package/src/index.ts +0 -426
- package/src/interop/Interoperability.js +0 -413
- package/src/interop/Interoperability.ts +0 -494
- package/src/logger.js +0 -42
- package/src/logger.ts +0 -57
- package/src/parser/EnhancedParser.js +0 -205
- package/src/parser/EnhancedParser.ts +0 -251
- package/src/parser/HoloScriptPlusParser.js +0 -928
- package/src/parser/HoloScriptPlusParser.ts +0 -1089
- package/src/runtime/HoloScriptPlusRuntime.js +0 -674
- package/src/runtime/HoloScriptPlusRuntime.ts +0 -861
- package/src/runtime/PerformanceTelemetry.js +0 -323
- package/src/runtime/PerformanceTelemetry.ts +0 -467
- package/src/runtime/RuntimeOptimization.js +0 -361
- package/src/runtime/RuntimeOptimization.ts +0 -416
- package/src/services/HololandGraphicsPipelineService.js +0 -506
- package/src/services/HololandGraphicsPipelineService.ts +0 -662
- package/src/services/PlatformPerformanceOptimizer.js +0 -356
- package/src/services/PlatformPerformanceOptimizer.ts +0 -503
- package/src/state/ReactiveState.js +0 -427
- package/src/state/ReactiveState.ts +0 -572
- package/src/tools/DeveloperExperience.js +0 -376
- package/src/tools/DeveloperExperience.ts +0 -438
- package/src/traits/AIDriverTrait.js +0 -322
- package/src/traits/AIDriverTrait.test.js +0 -329
- package/src/traits/AIDriverTrait.test.ts +0 -357
- package/src/traits/AIDriverTrait.ts +0 -474
- package/src/traits/LightingTrait.js +0 -313
- package/src/traits/LightingTrait.test.js +0 -410
- package/src/traits/LightingTrait.test.ts +0 -462
- package/src/traits/LightingTrait.ts +0 -505
- package/src/traits/MaterialTrait.js +0 -194
- package/src/traits/MaterialTrait.test.js +0 -286
- package/src/traits/MaterialTrait.test.ts +0 -329
- package/src/traits/MaterialTrait.ts +0 -324
- package/src/traits/RenderingTrait.js +0 -356
- package/src/traits/RenderingTrait.test.js +0 -363
- package/src/traits/RenderingTrait.test.ts +0 -427
- package/src/traits/RenderingTrait.ts +0 -555
- package/src/traits/VRTraitSystem.js +0 -740
- package/src/traits/VRTraitSystem.ts +0 -1040
- package/src/traits/VoiceInputTrait.js +0 -284
- package/src/traits/VoiceInputTrait.test.js +0 -226
- package/src/traits/VoiceInputTrait.test.ts +0 -252
- package/src/traits/VoiceInputTrait.ts +0 -401
- package/src/types/AdvancedTypeSystem.js +0 -226
- package/src/types/AdvancedTypeSystem.ts +0 -494
- package/src/types/HoloScriptPlus.d.ts +0 -853
- package/src/types.js +0 -6
- package/src/types.ts +0 -369
- package/tsconfig.json +0 -23
- package/tsup.config.d.ts +0 -2
- package/tsup.config.js +0 -18
- package/tsup.config.ts +0 -19
package/dist/parser.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk4OHVW4XR_cjs = require('./chunk-4OHVW4XR.cjs');
|
|
4
|
+
require('./chunk-3X2EGU7Z.cjs');
|
|
5
|
+
require('./chunk-CZLDE2OZ.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "HoloScriptCodeParser", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunk4OHVW4XR_cjs.HoloScriptCodeParser; }
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=parser.cjs.map
|
|
14
|
+
//# sourceMappingURL=parser.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"parser.cjs"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { A as ASTNode } from './types-D6g4ACjP.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* HoloScript Code Parser
|
|
5
|
+
*
|
|
6
|
+
* Parses HoloScript code strings into AST nodes that can be executed
|
|
7
|
+
* by the HoloScriptRuntime.
|
|
8
|
+
*
|
|
9
|
+
* Syntax Reference:
|
|
10
|
+
* - orb <name> { properties }
|
|
11
|
+
* - function <name>(<params>): <return> { body }
|
|
12
|
+
* - connect <from> to <to> [as <type>]
|
|
13
|
+
* - gate <name> { condition, true_path, false_path }
|
|
14
|
+
* - stream <name> from <source> { transformations }
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface ParseResult {
|
|
18
|
+
success: boolean;
|
|
19
|
+
ast: ASTNode[];
|
|
20
|
+
errors: ParseError[];
|
|
21
|
+
warnings: string[];
|
|
22
|
+
}
|
|
23
|
+
interface ParseError {
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
declare class HoloScriptCodeParser {
|
|
29
|
+
private errors;
|
|
30
|
+
private warnings;
|
|
31
|
+
private tokens;
|
|
32
|
+
private position;
|
|
33
|
+
private keywordSet;
|
|
34
|
+
constructor();
|
|
35
|
+
/**
|
|
36
|
+
* Parse HoloScript code string into AST
|
|
37
|
+
*/
|
|
38
|
+
parse(code: string): ParseResult;
|
|
39
|
+
/**
|
|
40
|
+
* Tokenize code into tokens
|
|
41
|
+
*/
|
|
42
|
+
private tokenize;
|
|
43
|
+
/**
|
|
44
|
+
* Parse program (list of declarations)
|
|
45
|
+
*/
|
|
46
|
+
private parseProgram;
|
|
47
|
+
/**
|
|
48
|
+
* Parse a single declaration
|
|
49
|
+
*/
|
|
50
|
+
private parseDeclaration;
|
|
51
|
+
/**
|
|
52
|
+
* Parse for loop: for (init; condition; update) { body }
|
|
53
|
+
*/
|
|
54
|
+
private parseForLoop;
|
|
55
|
+
/**
|
|
56
|
+
* Parse while loop: while (condition) { body }
|
|
57
|
+
*/
|
|
58
|
+
private parseWhileLoop;
|
|
59
|
+
/**
|
|
60
|
+
* Parse forEach loop: forEach item in collection { body }
|
|
61
|
+
*/
|
|
62
|
+
private parseForEachLoop;
|
|
63
|
+
/**
|
|
64
|
+
* Parse import: import { x, y } from "module"
|
|
65
|
+
*/
|
|
66
|
+
private parseImport;
|
|
67
|
+
/**
|
|
68
|
+
* Parse export: export { x, y } or export function/orb
|
|
69
|
+
*/
|
|
70
|
+
private parseExport;
|
|
71
|
+
/**
|
|
72
|
+
* Parse variable declaration: const/let/var name = value
|
|
73
|
+
*/
|
|
74
|
+
private parseVariableDeclaration;
|
|
75
|
+
/**
|
|
76
|
+
* Parse orb declaration
|
|
77
|
+
*/
|
|
78
|
+
private parseOrb;
|
|
79
|
+
/**
|
|
80
|
+
* Parse function declaration
|
|
81
|
+
*/
|
|
82
|
+
private parseFunction;
|
|
83
|
+
/**
|
|
84
|
+
* Parse connection
|
|
85
|
+
*/
|
|
86
|
+
private parseConnection;
|
|
87
|
+
/**
|
|
88
|
+
* Parse gate (conditional)
|
|
89
|
+
*/
|
|
90
|
+
private parseGate;
|
|
91
|
+
/**
|
|
92
|
+
* Parse stream
|
|
93
|
+
*/
|
|
94
|
+
private parseStream;
|
|
95
|
+
/**
|
|
96
|
+
* Parse nexus (multi-agent hub)
|
|
97
|
+
*/
|
|
98
|
+
private parseNexus;
|
|
99
|
+
/**
|
|
100
|
+
* Parse building (class-like)
|
|
101
|
+
*/
|
|
102
|
+
private parseBuilding;
|
|
103
|
+
/**
|
|
104
|
+
* Parse a property (key: value)
|
|
105
|
+
*/
|
|
106
|
+
private parseProperty;
|
|
107
|
+
/**
|
|
108
|
+
* Parse array [...]
|
|
109
|
+
*/
|
|
110
|
+
private parseArray;
|
|
111
|
+
/**
|
|
112
|
+
* Parse object {...}
|
|
113
|
+
*/
|
|
114
|
+
private parseObject;
|
|
115
|
+
/**
|
|
116
|
+
* Parse position from value
|
|
117
|
+
*/
|
|
118
|
+
private parsePosition;
|
|
119
|
+
private currentToken;
|
|
120
|
+
private advance;
|
|
121
|
+
private check;
|
|
122
|
+
private expect;
|
|
123
|
+
private expectIdentifier;
|
|
124
|
+
/**
|
|
125
|
+
* Parse animate command: animate target property: "..." from: 0 to: 1 duration: 1000
|
|
126
|
+
*/
|
|
127
|
+
private parseAnimate;
|
|
128
|
+
/**
|
|
129
|
+
* Parse modify command: modify target { prop: value }
|
|
130
|
+
*/
|
|
131
|
+
private parseModify;
|
|
132
|
+
/**
|
|
133
|
+
* Parse UI Element: ui2d dashboard#id { ... }
|
|
134
|
+
*/
|
|
135
|
+
private parseUIElement;
|
|
136
|
+
private skipNewlines;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { HoloScriptCodeParser, type ParseError, type ParseResult };
|
package/dist/parser.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { A as ASTNode } from './types-D6g4ACjP.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* HoloScript Code Parser
|
|
5
|
+
*
|
|
6
|
+
* Parses HoloScript code strings into AST nodes that can be executed
|
|
7
|
+
* by the HoloScriptRuntime.
|
|
8
|
+
*
|
|
9
|
+
* Syntax Reference:
|
|
10
|
+
* - orb <name> { properties }
|
|
11
|
+
* - function <name>(<params>): <return> { body }
|
|
12
|
+
* - connect <from> to <to> [as <type>]
|
|
13
|
+
* - gate <name> { condition, true_path, false_path }
|
|
14
|
+
* - stream <name> from <source> { transformations }
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface ParseResult {
|
|
18
|
+
success: boolean;
|
|
19
|
+
ast: ASTNode[];
|
|
20
|
+
errors: ParseError[];
|
|
21
|
+
warnings: string[];
|
|
22
|
+
}
|
|
23
|
+
interface ParseError {
|
|
24
|
+
line: number;
|
|
25
|
+
column: number;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
declare class HoloScriptCodeParser {
|
|
29
|
+
private errors;
|
|
30
|
+
private warnings;
|
|
31
|
+
private tokens;
|
|
32
|
+
private position;
|
|
33
|
+
private keywordSet;
|
|
34
|
+
constructor();
|
|
35
|
+
/**
|
|
36
|
+
* Parse HoloScript code string into AST
|
|
37
|
+
*/
|
|
38
|
+
parse(code: string): ParseResult;
|
|
39
|
+
/**
|
|
40
|
+
* Tokenize code into tokens
|
|
41
|
+
*/
|
|
42
|
+
private tokenize;
|
|
43
|
+
/**
|
|
44
|
+
* Parse program (list of declarations)
|
|
45
|
+
*/
|
|
46
|
+
private parseProgram;
|
|
47
|
+
/**
|
|
48
|
+
* Parse a single declaration
|
|
49
|
+
*/
|
|
50
|
+
private parseDeclaration;
|
|
51
|
+
/**
|
|
52
|
+
* Parse for loop: for (init; condition; update) { body }
|
|
53
|
+
*/
|
|
54
|
+
private parseForLoop;
|
|
55
|
+
/**
|
|
56
|
+
* Parse while loop: while (condition) { body }
|
|
57
|
+
*/
|
|
58
|
+
private parseWhileLoop;
|
|
59
|
+
/**
|
|
60
|
+
* Parse forEach loop: forEach item in collection { body }
|
|
61
|
+
*/
|
|
62
|
+
private parseForEachLoop;
|
|
63
|
+
/**
|
|
64
|
+
* Parse import: import { x, y } from "module"
|
|
65
|
+
*/
|
|
66
|
+
private parseImport;
|
|
67
|
+
/**
|
|
68
|
+
* Parse export: export { x, y } or export function/orb
|
|
69
|
+
*/
|
|
70
|
+
private parseExport;
|
|
71
|
+
/**
|
|
72
|
+
* Parse variable declaration: const/let/var name = value
|
|
73
|
+
*/
|
|
74
|
+
private parseVariableDeclaration;
|
|
75
|
+
/**
|
|
76
|
+
* Parse orb declaration
|
|
77
|
+
*/
|
|
78
|
+
private parseOrb;
|
|
79
|
+
/**
|
|
80
|
+
* Parse function declaration
|
|
81
|
+
*/
|
|
82
|
+
private parseFunction;
|
|
83
|
+
/**
|
|
84
|
+
* Parse connection
|
|
85
|
+
*/
|
|
86
|
+
private parseConnection;
|
|
87
|
+
/**
|
|
88
|
+
* Parse gate (conditional)
|
|
89
|
+
*/
|
|
90
|
+
private parseGate;
|
|
91
|
+
/**
|
|
92
|
+
* Parse stream
|
|
93
|
+
*/
|
|
94
|
+
private parseStream;
|
|
95
|
+
/**
|
|
96
|
+
* Parse nexus (multi-agent hub)
|
|
97
|
+
*/
|
|
98
|
+
private parseNexus;
|
|
99
|
+
/**
|
|
100
|
+
* Parse building (class-like)
|
|
101
|
+
*/
|
|
102
|
+
private parseBuilding;
|
|
103
|
+
/**
|
|
104
|
+
* Parse a property (key: value)
|
|
105
|
+
*/
|
|
106
|
+
private parseProperty;
|
|
107
|
+
/**
|
|
108
|
+
* Parse array [...]
|
|
109
|
+
*/
|
|
110
|
+
private parseArray;
|
|
111
|
+
/**
|
|
112
|
+
* Parse object {...}
|
|
113
|
+
*/
|
|
114
|
+
private parseObject;
|
|
115
|
+
/**
|
|
116
|
+
* Parse position from value
|
|
117
|
+
*/
|
|
118
|
+
private parsePosition;
|
|
119
|
+
private currentToken;
|
|
120
|
+
private advance;
|
|
121
|
+
private check;
|
|
122
|
+
private expect;
|
|
123
|
+
private expectIdentifier;
|
|
124
|
+
/**
|
|
125
|
+
* Parse animate command: animate target property: "..." from: 0 to: 1 duration: 1000
|
|
126
|
+
*/
|
|
127
|
+
private parseAnimate;
|
|
128
|
+
/**
|
|
129
|
+
* Parse modify command: modify target { prop: value }
|
|
130
|
+
*/
|
|
131
|
+
private parseModify;
|
|
132
|
+
/**
|
|
133
|
+
* Parse UI Element: ui2d dashboard#id { ... }
|
|
134
|
+
*/
|
|
135
|
+
private parseUIElement;
|
|
136
|
+
private skipNewlines;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { HoloScriptCodeParser, type ParseError, type ParseResult };
|
package/dist/parser.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"parser.js"}
|
package/dist/runtime.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3N67RLQP_cjs = require('./chunk-3N67RLQP.cjs');
|
|
4
|
+
require('./chunk-3X2EGU7Z.cjs');
|
|
5
|
+
require('./chunk-CZLDE2OZ.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "HoloScriptRuntime", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunk3N67RLQP_cjs.HoloScriptRuntime; }
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=runtime.cjs.map
|
|
14
|
+
//# sourceMappingURL=runtime.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"runtime.cjs"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { v as ImportLoader, A as ASTNode, B as ExecutionResult, J as ParticleSystem, z as RuntimeContext, b as HologramProperties } from './types-D6g4ACjP.cjs';
|
|
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(_importLoader?: ImportLoader);
|
|
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
|
+
/**
|
|
103
|
+
* Execute generic voice commands
|
|
104
|
+
* Handles commands like: show, hide, animate, pulse, create
|
|
105
|
+
*/
|
|
106
|
+
private executeGeneric;
|
|
107
|
+
/**
|
|
108
|
+
* Execute 'show' command
|
|
109
|
+
*/
|
|
110
|
+
private executeShowCommand;
|
|
111
|
+
/**
|
|
112
|
+
* Execute 'hide' command
|
|
113
|
+
*/
|
|
114
|
+
private executeHideCommand;
|
|
115
|
+
/**
|
|
116
|
+
* Execute 'create' command
|
|
117
|
+
*/
|
|
118
|
+
private executeCreateCommand;
|
|
119
|
+
/**
|
|
120
|
+
* Execute 'animate' command
|
|
121
|
+
*/
|
|
122
|
+
private executeAnimateCommand;
|
|
123
|
+
/**
|
|
124
|
+
* Execute 'pulse' command
|
|
125
|
+
*/
|
|
126
|
+
private executePulseCommand;
|
|
127
|
+
/**
|
|
128
|
+
* Execute 'move' command
|
|
129
|
+
*/
|
|
130
|
+
private executeMoveCommand;
|
|
131
|
+
/**
|
|
132
|
+
* Execute 'delete' command
|
|
133
|
+
*/
|
|
134
|
+
private executeDeleteCommand;
|
|
135
|
+
private executeStructure;
|
|
136
|
+
private executeAssignment;
|
|
137
|
+
private executeReturn;
|
|
138
|
+
private evaluateCondition;
|
|
139
|
+
private applyTransformation;
|
|
140
|
+
/**
|
|
141
|
+
* Register event handler
|
|
142
|
+
*/
|
|
143
|
+
on(event: string, handler: EventHandler): void;
|
|
144
|
+
/**
|
|
145
|
+
* Remove event handler
|
|
146
|
+
*/
|
|
147
|
+
off(event: string, handler?: EventHandler): void;
|
|
148
|
+
/**
|
|
149
|
+
* Emit event
|
|
150
|
+
*/
|
|
151
|
+
emit(event: string, data?: unknown): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Trigger UI event
|
|
154
|
+
*/
|
|
155
|
+
triggerUIEvent(elementName: string, eventType: string, data?: unknown): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Update all animations
|
|
158
|
+
*/
|
|
159
|
+
updateAnimations(): void;
|
|
160
|
+
private applyEasing;
|
|
161
|
+
private createParticleEffect;
|
|
162
|
+
private createConnectionStream;
|
|
163
|
+
private createFlowingStream;
|
|
164
|
+
private createExecutionEffect;
|
|
165
|
+
private createDataVisualization;
|
|
166
|
+
private getDataTypeColor;
|
|
167
|
+
getParticleSystems(): Map<string, ParticleSystem>;
|
|
168
|
+
updateParticles(deltaTime: number): void;
|
|
169
|
+
getContext(): RuntimeContext;
|
|
170
|
+
getUIElements(): Map<string, UIElementState>;
|
|
171
|
+
getUIElement(name: string): UIElementState | undefined;
|
|
172
|
+
getAnimations(): Map<string, Animation>;
|
|
173
|
+
reset(): void;
|
|
174
|
+
private createEmptyContext;
|
|
175
|
+
getExecutionHistory(): ExecutionResult[];
|
|
176
|
+
getHologramStates(): Map<string, HologramProperties>;
|
|
177
|
+
getCallStack(): string[];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export { HoloScriptRuntime };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { v as ImportLoader, A as ASTNode, B as ExecutionResult, J as ParticleSystem, z as RuntimeContext, b as HologramProperties } from './types-D6g4ACjP.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(_importLoader?: ImportLoader);
|
|
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
|
+
/**
|
|
103
|
+
* Execute generic voice commands
|
|
104
|
+
* Handles commands like: show, hide, animate, pulse, create
|
|
105
|
+
*/
|
|
106
|
+
private executeGeneric;
|
|
107
|
+
/**
|
|
108
|
+
* Execute 'show' command
|
|
109
|
+
*/
|
|
110
|
+
private executeShowCommand;
|
|
111
|
+
/**
|
|
112
|
+
* Execute 'hide' command
|
|
113
|
+
*/
|
|
114
|
+
private executeHideCommand;
|
|
115
|
+
/**
|
|
116
|
+
* Execute 'create' command
|
|
117
|
+
*/
|
|
118
|
+
private executeCreateCommand;
|
|
119
|
+
/**
|
|
120
|
+
* Execute 'animate' command
|
|
121
|
+
*/
|
|
122
|
+
private executeAnimateCommand;
|
|
123
|
+
/**
|
|
124
|
+
* Execute 'pulse' command
|
|
125
|
+
*/
|
|
126
|
+
private executePulseCommand;
|
|
127
|
+
/**
|
|
128
|
+
* Execute 'move' command
|
|
129
|
+
*/
|
|
130
|
+
private executeMoveCommand;
|
|
131
|
+
/**
|
|
132
|
+
* Execute 'delete' command
|
|
133
|
+
*/
|
|
134
|
+
private executeDeleteCommand;
|
|
135
|
+
private executeStructure;
|
|
136
|
+
private executeAssignment;
|
|
137
|
+
private executeReturn;
|
|
138
|
+
private evaluateCondition;
|
|
139
|
+
private applyTransformation;
|
|
140
|
+
/**
|
|
141
|
+
* Register event handler
|
|
142
|
+
*/
|
|
143
|
+
on(event: string, handler: EventHandler): void;
|
|
144
|
+
/**
|
|
145
|
+
* Remove event handler
|
|
146
|
+
*/
|
|
147
|
+
off(event: string, handler?: EventHandler): void;
|
|
148
|
+
/**
|
|
149
|
+
* Emit event
|
|
150
|
+
*/
|
|
151
|
+
emit(event: string, data?: unknown): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Trigger UI event
|
|
154
|
+
*/
|
|
155
|
+
triggerUIEvent(elementName: string, eventType: string, data?: unknown): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Update all animations
|
|
158
|
+
*/
|
|
159
|
+
updateAnimations(): void;
|
|
160
|
+
private applyEasing;
|
|
161
|
+
private createParticleEffect;
|
|
162
|
+
private createConnectionStream;
|
|
163
|
+
private createFlowingStream;
|
|
164
|
+
private createExecutionEffect;
|
|
165
|
+
private createDataVisualization;
|
|
166
|
+
private getDataTypeColor;
|
|
167
|
+
getParticleSystems(): Map<string, ParticleSystem>;
|
|
168
|
+
updateParticles(deltaTime: number): void;
|
|
169
|
+
getContext(): RuntimeContext;
|
|
170
|
+
getUIElements(): Map<string, UIElementState>;
|
|
171
|
+
getUIElement(name: string): UIElementState | undefined;
|
|
172
|
+
getAnimations(): Map<string, Animation>;
|
|
173
|
+
reset(): void;
|
|
174
|
+
private createEmptyContext;
|
|
175
|
+
getExecutionHistory(): ExecutionResult[];
|
|
176
|
+
getHologramStates(): Map<string, HologramProperties>;
|
|
177
|
+
getCallStack(): string[];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export { HoloScriptRuntime };
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"runtime.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVMZN4EVR_cjs = require('./chunk-VMZN4EVR.cjs');
|
|
4
|
+
require('./chunk-CZLDE2OZ.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "HoloScriptTypeChecker", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkVMZN4EVR_cjs.HoloScriptTypeChecker; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "createTypeChecker", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkVMZN4EVR_cjs.createTypeChecker; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=type-checker.cjs.map
|
|
17
|
+
//# sourceMappingURL=type-checker.cjs.map
|