@probelabs/probe 0.6.0-rc238 → 0.6.0-rc239
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/bin/binaries/probe-v0.6.0-rc239-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc239-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc239-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/{probe-v0.6.0-rc238-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc239-x86_64-pc-windows-msvc.zip} +0 -0
- package/bin/binaries/probe-v0.6.0-rc239-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/dsl/runtime.js +3 -16
- package/build/agent/dsl/validator.js +5 -4
- package/build/agent/index.js +6 -14
- package/cjs/agent/ProbeAgent.cjs +6 -14
- package/cjs/index.cjs +6 -14
- package/package.json +1 -1
- package/src/agent/dsl/runtime.js +3 -16
- package/src/agent/dsl/validator.js +5 -4
- package/bin/binaries/probe-v0.6.0-rc238-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc238-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc238-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc238-x86_64-unknown-linux-musl.tar.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Orchestrates the full pipeline:
|
|
5
5
|
* 1. Validate (AST whitelist)
|
|
6
6
|
* 2. Transform (inject await, wrap in async IIFE)
|
|
7
|
-
* 3. Execute in SandboxJS with tool globals
|
|
7
|
+
* 3. Execute in SandboxJS with tool globals
|
|
8
8
|
*
|
|
9
9
|
* Returns the result or a structured error.
|
|
10
10
|
*/
|
|
@@ -25,7 +25,6 @@ const Sandbox = SandboxModule.default || SandboxModule;
|
|
|
25
25
|
* @param {Object} [options.mcpTools={}] - MCP tool metadata
|
|
26
26
|
* @param {Function} options.llmCall - Function for LLM() calls: (instruction, data, options?) => Promise<any>
|
|
27
27
|
* @param {number} [options.mapConcurrency=3] - Concurrency limit for map()
|
|
28
|
-
* @param {number} [options.timeoutMs=120000] - Execution timeout in milliseconds (default 2 min)
|
|
29
28
|
* @param {number} [options.maxLoopIterations=5000] - Max iterations for while/for loops
|
|
30
29
|
* @param {Object} [options.tracer=null] - SimpleAppTracer instance for OTEL telemetry
|
|
31
30
|
* @returns {Object} Runtime with execute() method
|
|
@@ -37,7 +36,6 @@ export function createDSLRuntime(options) {
|
|
|
37
36
|
mcpTools = {},
|
|
38
37
|
llmCall,
|
|
39
38
|
mapConcurrency = 3,
|
|
40
|
-
timeoutMs = 120000,
|
|
41
39
|
maxLoopIterations = 5000,
|
|
42
40
|
tracer = null,
|
|
43
41
|
sessionStore = {},
|
|
@@ -108,9 +106,8 @@ export function createDSLRuntime(options) {
|
|
|
108
106
|
};
|
|
109
107
|
}
|
|
110
108
|
|
|
111
|
-
// Step 3: Execute in SandboxJS
|
|
109
|
+
// Step 3: Execute in SandboxJS
|
|
112
110
|
tracer?.addEvent?.('dsl.phase.execute_start', {
|
|
113
|
-
'dsl.timeout_ms': timeoutMs,
|
|
114
111
|
'dsl.max_loop_iterations': maxLoopIterations,
|
|
115
112
|
});
|
|
116
113
|
|
|
@@ -147,20 +144,10 @@ export function createDSLRuntime(options) {
|
|
|
147
144
|
};
|
|
148
145
|
process.on('unhandledRejection', rejectionHandler);
|
|
149
146
|
|
|
150
|
-
// Race execution against timeout
|
|
151
|
-
let timeoutHandle;
|
|
152
|
-
const executionPromise = exec().run();
|
|
153
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
154
|
-
timeoutHandle = setTimeout(() => {
|
|
155
|
-
reject(new Error(`Execution timed out after ${Math.round(timeoutMs / 1000)}s. Script took too long — reduce the amount of work (fewer items, smaller data) or increase timeout.`));
|
|
156
|
-
}, timeoutMs);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
147
|
let result;
|
|
160
148
|
try {
|
|
161
|
-
result = await
|
|
149
|
+
result = await exec().run();
|
|
162
150
|
} finally {
|
|
163
|
-
clearTimeout(timeoutHandle);
|
|
164
151
|
// Delay handler removal — SandboxJS can throw async errors after execution completes
|
|
165
152
|
setTimeout(() => {
|
|
166
153
|
process.removeListener('unhandledRejection', rejectionHandler);
|
|
@@ -16,18 +16,23 @@ const ALLOWED_NODE_TYPES = new Set([
|
|
|
16
16
|
'BlockStatement',
|
|
17
17
|
'VariableDeclaration',
|
|
18
18
|
'VariableDeclarator',
|
|
19
|
+
'FunctionDeclaration',
|
|
19
20
|
'ArrowFunctionExpression',
|
|
20
21
|
'FunctionExpression',
|
|
21
22
|
'CallExpression',
|
|
23
|
+
'NewExpression',
|
|
22
24
|
'MemberExpression',
|
|
23
25
|
'Identifier',
|
|
24
26
|
'Literal',
|
|
25
27
|
'TemplateLiteral',
|
|
26
28
|
'TemplateElement',
|
|
29
|
+
'TaggedTemplateExpression',
|
|
27
30
|
'ArrayExpression',
|
|
28
31
|
'ObjectExpression',
|
|
29
32
|
'SpreadElement',
|
|
30
33
|
'IfStatement',
|
|
34
|
+
'SwitchStatement',
|
|
35
|
+
'SwitchCase',
|
|
31
36
|
'ConditionalExpression',
|
|
32
37
|
'ForOfStatement',
|
|
33
38
|
'ForInStatement',
|
|
@@ -127,10 +132,6 @@ export function validateDSL(code) {
|
|
|
127
132
|
errors.push(`Generator functions are not allowed at position ${node.start}`);
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
// Block regex literals — SandboxJS doesn't support them
|
|
131
|
-
if (node.type === 'Literal' && node.regex) {
|
|
132
|
-
errors.push(`Regex literals are not supported at position ${node.start}. Use String methods like indexOf(), includes(), startsWith() instead.`);
|
|
133
|
-
}
|
|
134
135
|
|
|
135
136
|
// Check identifiers against blocklist
|
|
136
137
|
if (node.type === 'Identifier' && BLOCKED_IDENTIFIERS.has(node.name)) {
|
package/build/agent/index.js
CHANGED
|
@@ -21499,9 +21499,6 @@ function validateDSL(code) {
|
|
|
21499
21499
|
if (node.type === "FunctionExpression" && node.generator) {
|
|
21500
21500
|
errors.push(`Generator functions are not allowed at position ${node.start}`);
|
|
21501
21501
|
}
|
|
21502
|
-
if (node.type === "Literal" && node.regex) {
|
|
21503
|
-
errors.push(`Regex literals are not supported at position ${node.start}. Use String methods like indexOf(), includes(), startsWith() instead.`);
|
|
21504
|
-
}
|
|
21505
21502
|
if (node.type === "Identifier" && BLOCKED_IDENTIFIERS.has(node.name)) {
|
|
21506
21503
|
errors.push(`Blocked identifier: '${node.name}' at position ${node.start}`);
|
|
21507
21504
|
}
|
|
@@ -21540,18 +21537,23 @@ var init_validator = __esm({
|
|
|
21540
21537
|
"BlockStatement",
|
|
21541
21538
|
"VariableDeclaration",
|
|
21542
21539
|
"VariableDeclarator",
|
|
21540
|
+
"FunctionDeclaration",
|
|
21543
21541
|
"ArrowFunctionExpression",
|
|
21544
21542
|
"FunctionExpression",
|
|
21545
21543
|
"CallExpression",
|
|
21544
|
+
"NewExpression",
|
|
21546
21545
|
"MemberExpression",
|
|
21547
21546
|
"Identifier",
|
|
21548
21547
|
"Literal",
|
|
21549
21548
|
"TemplateLiteral",
|
|
21550
21549
|
"TemplateElement",
|
|
21550
|
+
"TaggedTemplateExpression",
|
|
21551
21551
|
"ArrayExpression",
|
|
21552
21552
|
"ObjectExpression",
|
|
21553
21553
|
"SpreadElement",
|
|
21554
21554
|
"IfStatement",
|
|
21555
|
+
"SwitchStatement",
|
|
21556
|
+
"SwitchCase",
|
|
21555
21557
|
"ConditionalExpression",
|
|
21556
21558
|
"ForOfStatement",
|
|
21557
21559
|
"ForInStatement",
|
|
@@ -22013,7 +22015,6 @@ function createDSLRuntime(options) {
|
|
|
22013
22015
|
mcpTools = {},
|
|
22014
22016
|
llmCall,
|
|
22015
22017
|
mapConcurrency = 3,
|
|
22016
|
-
timeoutMs = 12e4,
|
|
22017
22018
|
maxLoopIterations = 5e3,
|
|
22018
22019
|
tracer = null,
|
|
22019
22020
|
sessionStore = {},
|
|
@@ -22068,7 +22069,6 @@ ${validation.errors.join("\n")}`,
|
|
|
22068
22069
|
};
|
|
22069
22070
|
}
|
|
22070
22071
|
tracer?.addEvent?.("dsl.phase.execute_start", {
|
|
22071
|
-
"dsl.timeout_ms": timeoutMs,
|
|
22072
22072
|
"dsl.max_loop_iterations": maxLoopIterations
|
|
22073
22073
|
});
|
|
22074
22074
|
try {
|
|
@@ -22096,18 +22096,10 @@ ${validation.errors.join("\n")}`,
|
|
|
22096
22096
|
escapedError = reason;
|
|
22097
22097
|
};
|
|
22098
22098
|
process.on("unhandledRejection", rejectionHandler);
|
|
22099
|
-
let timeoutHandle;
|
|
22100
|
-
const executionPromise = exec6().run();
|
|
22101
|
-
const timeoutPromise = new Promise((_, reject2) => {
|
|
22102
|
-
timeoutHandle = setTimeout(() => {
|
|
22103
|
-
reject2(new Error(`Execution timed out after ${Math.round(timeoutMs / 1e3)}s. Script took too long \u2014 reduce the amount of work (fewer items, smaller data) or increase timeout.`));
|
|
22104
|
-
}, timeoutMs);
|
|
22105
|
-
});
|
|
22106
22099
|
let result;
|
|
22107
22100
|
try {
|
|
22108
|
-
result = await
|
|
22101
|
+
result = await exec6().run();
|
|
22109
22102
|
} finally {
|
|
22110
|
-
clearTimeout(timeoutHandle);
|
|
22111
22103
|
setTimeout(() => {
|
|
22112
22104
|
process.removeListener("unhandledRejection", rejectionHandler);
|
|
22113
22105
|
}, 500);
|
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -50948,9 +50948,6 @@ function validateDSL(code) {
|
|
|
50948
50948
|
if (node.type === "FunctionExpression" && node.generator) {
|
|
50949
50949
|
errors.push(`Generator functions are not allowed at position ${node.start}`);
|
|
50950
50950
|
}
|
|
50951
|
-
if (node.type === "Literal" && node.regex) {
|
|
50952
|
-
errors.push(`Regex literals are not supported at position ${node.start}. Use String methods like indexOf(), includes(), startsWith() instead.`);
|
|
50953
|
-
}
|
|
50954
50951
|
if (node.type === "Identifier" && BLOCKED_IDENTIFIERS.has(node.name)) {
|
|
50955
50952
|
errors.push(`Blocked identifier: '${node.name}' at position ${node.start}`);
|
|
50956
50953
|
}
|
|
@@ -50989,18 +50986,23 @@ var init_validator = __esm({
|
|
|
50989
50986
|
"BlockStatement",
|
|
50990
50987
|
"VariableDeclaration",
|
|
50991
50988
|
"VariableDeclarator",
|
|
50989
|
+
"FunctionDeclaration",
|
|
50992
50990
|
"ArrowFunctionExpression",
|
|
50993
50991
|
"FunctionExpression",
|
|
50994
50992
|
"CallExpression",
|
|
50993
|
+
"NewExpression",
|
|
50995
50994
|
"MemberExpression",
|
|
50996
50995
|
"Identifier",
|
|
50997
50996
|
"Literal",
|
|
50998
50997
|
"TemplateLiteral",
|
|
50999
50998
|
"TemplateElement",
|
|
50999
|
+
"TaggedTemplateExpression",
|
|
51000
51000
|
"ArrayExpression",
|
|
51001
51001
|
"ObjectExpression",
|
|
51002
51002
|
"SpreadElement",
|
|
51003
51003
|
"IfStatement",
|
|
51004
|
+
"SwitchStatement",
|
|
51005
|
+
"SwitchCase",
|
|
51004
51006
|
"ConditionalExpression",
|
|
51005
51007
|
"ForOfStatement",
|
|
51006
51008
|
"ForInStatement",
|
|
@@ -51462,7 +51464,6 @@ function createDSLRuntime(options) {
|
|
|
51462
51464
|
mcpTools = {},
|
|
51463
51465
|
llmCall,
|
|
51464
51466
|
mapConcurrency = 3,
|
|
51465
|
-
timeoutMs = 12e4,
|
|
51466
51467
|
maxLoopIterations = 5e3,
|
|
51467
51468
|
tracer = null,
|
|
51468
51469
|
sessionStore = {},
|
|
@@ -51517,7 +51518,6 @@ ${validation.errors.join("\n")}`,
|
|
|
51517
51518
|
};
|
|
51518
51519
|
}
|
|
51519
51520
|
tracer?.addEvent?.("dsl.phase.execute_start", {
|
|
51520
|
-
"dsl.timeout_ms": timeoutMs,
|
|
51521
51521
|
"dsl.max_loop_iterations": maxLoopIterations
|
|
51522
51522
|
});
|
|
51523
51523
|
try {
|
|
@@ -51545,18 +51545,10 @@ ${validation.errors.join("\n")}`,
|
|
|
51545
51545
|
escapedError = reason;
|
|
51546
51546
|
};
|
|
51547
51547
|
process.on("unhandledRejection", rejectionHandler);
|
|
51548
|
-
let timeoutHandle;
|
|
51549
|
-
const executionPromise = exec6().run();
|
|
51550
|
-
const timeoutPromise = new Promise((_, reject2) => {
|
|
51551
|
-
timeoutHandle = setTimeout(() => {
|
|
51552
|
-
reject2(new Error(`Execution timed out after ${Math.round(timeoutMs / 1e3)}s. Script took too long \u2014 reduce the amount of work (fewer items, smaller data) or increase timeout.`));
|
|
51553
|
-
}, timeoutMs);
|
|
51554
|
-
});
|
|
51555
51548
|
let result;
|
|
51556
51549
|
try {
|
|
51557
|
-
result = await
|
|
51550
|
+
result = await exec6().run();
|
|
51558
51551
|
} finally {
|
|
51559
|
-
clearTimeout(timeoutHandle);
|
|
51560
51552
|
setTimeout(() => {
|
|
51561
51553
|
process.removeListener("unhandledRejection", rejectionHandler);
|
|
51562
51554
|
}, 500);
|
package/cjs/index.cjs
CHANGED
|
@@ -112363,9 +112363,6 @@ function validateDSL(code) {
|
|
|
112363
112363
|
if (node.type === "FunctionExpression" && node.generator) {
|
|
112364
112364
|
errors.push(`Generator functions are not allowed at position ${node.start}`);
|
|
112365
112365
|
}
|
|
112366
|
-
if (node.type === "Literal" && node.regex) {
|
|
112367
|
-
errors.push(`Regex literals are not supported at position ${node.start}. Use String methods like indexOf(), includes(), startsWith() instead.`);
|
|
112368
|
-
}
|
|
112369
112366
|
if (node.type === "Identifier" && BLOCKED_IDENTIFIERS.has(node.name)) {
|
|
112370
112367
|
errors.push(`Blocked identifier: '${node.name}' at position ${node.start}`);
|
|
112371
112368
|
}
|
|
@@ -112404,18 +112401,23 @@ var init_validator = __esm({
|
|
|
112404
112401
|
"BlockStatement",
|
|
112405
112402
|
"VariableDeclaration",
|
|
112406
112403
|
"VariableDeclarator",
|
|
112404
|
+
"FunctionDeclaration",
|
|
112407
112405
|
"ArrowFunctionExpression",
|
|
112408
112406
|
"FunctionExpression",
|
|
112409
112407
|
"CallExpression",
|
|
112408
|
+
"NewExpression",
|
|
112410
112409
|
"MemberExpression",
|
|
112411
112410
|
"Identifier",
|
|
112412
112411
|
"Literal",
|
|
112413
112412
|
"TemplateLiteral",
|
|
112414
112413
|
"TemplateElement",
|
|
112414
|
+
"TaggedTemplateExpression",
|
|
112415
112415
|
"ArrayExpression",
|
|
112416
112416
|
"ObjectExpression",
|
|
112417
112417
|
"SpreadElement",
|
|
112418
112418
|
"IfStatement",
|
|
112419
|
+
"SwitchStatement",
|
|
112420
|
+
"SwitchCase",
|
|
112419
112421
|
"ConditionalExpression",
|
|
112420
112422
|
"ForOfStatement",
|
|
112421
112423
|
"ForInStatement",
|
|
@@ -112877,7 +112879,6 @@ function createDSLRuntime(options) {
|
|
|
112877
112879
|
mcpTools = {},
|
|
112878
112880
|
llmCall,
|
|
112879
112881
|
mapConcurrency = 3,
|
|
112880
|
-
timeoutMs = 12e4,
|
|
112881
112882
|
maxLoopIterations = 5e3,
|
|
112882
112883
|
tracer = null,
|
|
112883
112884
|
sessionStore = {},
|
|
@@ -112932,7 +112933,6 @@ ${validation.errors.join("\n")}`,
|
|
|
112932
112933
|
};
|
|
112933
112934
|
}
|
|
112934
112935
|
tracer?.addEvent?.("dsl.phase.execute_start", {
|
|
112935
|
-
"dsl.timeout_ms": timeoutMs,
|
|
112936
112936
|
"dsl.max_loop_iterations": maxLoopIterations
|
|
112937
112937
|
});
|
|
112938
112938
|
try {
|
|
@@ -112960,18 +112960,10 @@ ${validation.errors.join("\n")}`,
|
|
|
112960
112960
|
escapedError = reason;
|
|
112961
112961
|
};
|
|
112962
112962
|
process.on("unhandledRejection", rejectionHandler);
|
|
112963
|
-
let timeoutHandle;
|
|
112964
|
-
const executionPromise = exec6().run();
|
|
112965
|
-
const timeoutPromise = new Promise((_, reject2) => {
|
|
112966
|
-
timeoutHandle = setTimeout(() => {
|
|
112967
|
-
reject2(new Error(`Execution timed out after ${Math.round(timeoutMs / 1e3)}s. Script took too long \u2014 reduce the amount of work (fewer items, smaller data) or increase timeout.`));
|
|
112968
|
-
}, timeoutMs);
|
|
112969
|
-
});
|
|
112970
112963
|
let result;
|
|
112971
112964
|
try {
|
|
112972
|
-
result = await
|
|
112965
|
+
result = await exec6().run();
|
|
112973
112966
|
} finally {
|
|
112974
|
-
clearTimeout(timeoutHandle);
|
|
112975
112967
|
setTimeout(() => {
|
|
112976
112968
|
process.removeListener("unhandledRejection", rejectionHandler);
|
|
112977
112969
|
}, 500);
|
package/package.json
CHANGED
package/src/agent/dsl/runtime.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Orchestrates the full pipeline:
|
|
5
5
|
* 1. Validate (AST whitelist)
|
|
6
6
|
* 2. Transform (inject await, wrap in async IIFE)
|
|
7
|
-
* 3. Execute in SandboxJS with tool globals
|
|
7
|
+
* 3. Execute in SandboxJS with tool globals
|
|
8
8
|
*
|
|
9
9
|
* Returns the result or a structured error.
|
|
10
10
|
*/
|
|
@@ -25,7 +25,6 @@ const Sandbox = SandboxModule.default || SandboxModule;
|
|
|
25
25
|
* @param {Object} [options.mcpTools={}] - MCP tool metadata
|
|
26
26
|
* @param {Function} options.llmCall - Function for LLM() calls: (instruction, data, options?) => Promise<any>
|
|
27
27
|
* @param {number} [options.mapConcurrency=3] - Concurrency limit for map()
|
|
28
|
-
* @param {number} [options.timeoutMs=120000] - Execution timeout in milliseconds (default 2 min)
|
|
29
28
|
* @param {number} [options.maxLoopIterations=5000] - Max iterations for while/for loops
|
|
30
29
|
* @param {Object} [options.tracer=null] - SimpleAppTracer instance for OTEL telemetry
|
|
31
30
|
* @returns {Object} Runtime with execute() method
|
|
@@ -37,7 +36,6 @@ export function createDSLRuntime(options) {
|
|
|
37
36
|
mcpTools = {},
|
|
38
37
|
llmCall,
|
|
39
38
|
mapConcurrency = 3,
|
|
40
|
-
timeoutMs = 120000,
|
|
41
39
|
maxLoopIterations = 5000,
|
|
42
40
|
tracer = null,
|
|
43
41
|
sessionStore = {},
|
|
@@ -108,9 +106,8 @@ export function createDSLRuntime(options) {
|
|
|
108
106
|
};
|
|
109
107
|
}
|
|
110
108
|
|
|
111
|
-
// Step 3: Execute in SandboxJS
|
|
109
|
+
// Step 3: Execute in SandboxJS
|
|
112
110
|
tracer?.addEvent?.('dsl.phase.execute_start', {
|
|
113
|
-
'dsl.timeout_ms': timeoutMs,
|
|
114
111
|
'dsl.max_loop_iterations': maxLoopIterations,
|
|
115
112
|
});
|
|
116
113
|
|
|
@@ -147,20 +144,10 @@ export function createDSLRuntime(options) {
|
|
|
147
144
|
};
|
|
148
145
|
process.on('unhandledRejection', rejectionHandler);
|
|
149
146
|
|
|
150
|
-
// Race execution against timeout
|
|
151
|
-
let timeoutHandle;
|
|
152
|
-
const executionPromise = exec().run();
|
|
153
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
154
|
-
timeoutHandle = setTimeout(() => {
|
|
155
|
-
reject(new Error(`Execution timed out after ${Math.round(timeoutMs / 1000)}s. Script took too long — reduce the amount of work (fewer items, smaller data) or increase timeout.`));
|
|
156
|
-
}, timeoutMs);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
147
|
let result;
|
|
160
148
|
try {
|
|
161
|
-
result = await
|
|
149
|
+
result = await exec().run();
|
|
162
150
|
} finally {
|
|
163
|
-
clearTimeout(timeoutHandle);
|
|
164
151
|
// Delay handler removal — SandboxJS can throw async errors after execution completes
|
|
165
152
|
setTimeout(() => {
|
|
166
153
|
process.removeListener('unhandledRejection', rejectionHandler);
|
|
@@ -16,18 +16,23 @@ const ALLOWED_NODE_TYPES = new Set([
|
|
|
16
16
|
'BlockStatement',
|
|
17
17
|
'VariableDeclaration',
|
|
18
18
|
'VariableDeclarator',
|
|
19
|
+
'FunctionDeclaration',
|
|
19
20
|
'ArrowFunctionExpression',
|
|
20
21
|
'FunctionExpression',
|
|
21
22
|
'CallExpression',
|
|
23
|
+
'NewExpression',
|
|
22
24
|
'MemberExpression',
|
|
23
25
|
'Identifier',
|
|
24
26
|
'Literal',
|
|
25
27
|
'TemplateLiteral',
|
|
26
28
|
'TemplateElement',
|
|
29
|
+
'TaggedTemplateExpression',
|
|
27
30
|
'ArrayExpression',
|
|
28
31
|
'ObjectExpression',
|
|
29
32
|
'SpreadElement',
|
|
30
33
|
'IfStatement',
|
|
34
|
+
'SwitchStatement',
|
|
35
|
+
'SwitchCase',
|
|
31
36
|
'ConditionalExpression',
|
|
32
37
|
'ForOfStatement',
|
|
33
38
|
'ForInStatement',
|
|
@@ -127,10 +132,6 @@ export function validateDSL(code) {
|
|
|
127
132
|
errors.push(`Generator functions are not allowed at position ${node.start}`);
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
// Block regex literals — SandboxJS doesn't support them
|
|
131
|
-
if (node.type === 'Literal' && node.regex) {
|
|
132
|
-
errors.push(`Regex literals are not supported at position ${node.start}. Use String methods like indexOf(), includes(), startsWith() instead.`);
|
|
133
|
-
}
|
|
134
135
|
|
|
135
136
|
// Check identifiers against blocklist
|
|
136
137
|
if (node.type === 'Identifier' && BLOCKED_IDENTIFIERS.has(node.name)) {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|