@seljs/runtime 1.1.0 → 1.2.0-beta.3
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/dist/environment/environment.cjs +12 -14
- package/dist/environment/environment.d.cts +1 -0
- package/dist/environment/environment.d.mts +1 -0
- package/dist/environment/environment.mjs +14 -16
- package/dist/environment/types.d.cts +4 -17
- package/dist/environment/types.d.mts +4 -17
- package/dist/errors/errors.cjs +13 -0
- package/dist/errors/errors.d.cts +12 -1
- package/dist/errors/errors.d.mts +12 -1
- package/dist/errors/errors.mjs +13 -1
- package/dist/errors/index.d.mts +1 -1
- package/dist/execution/types.d.cts +3 -0
- package/dist/execution/types.d.mts +3 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +5 -5
|
@@ -24,6 +24,7 @@ let _seljs_common = require("@seljs/common");
|
|
|
24
24
|
const debug = require_debug.createLogger("environment");
|
|
25
25
|
var SELRuntime = class {
|
|
26
26
|
env;
|
|
27
|
+
checker;
|
|
27
28
|
client;
|
|
28
29
|
schema;
|
|
29
30
|
variableTypes = /* @__PURE__ */ new Map();
|
|
@@ -66,13 +67,6 @@ var SELRuntime = class {
|
|
|
66
67
|
*/
|
|
67
68
|
constructor(config) {
|
|
68
69
|
const limits = config.limits;
|
|
69
|
-
const celLimits = limits ? {
|
|
70
|
-
maxAstNodes: limits.maxAstNodes,
|
|
71
|
-
maxDepth: limits.maxDepth,
|
|
72
|
-
maxListElements: limits.maxListElements,
|
|
73
|
-
maxMapEntries: limits.maxMapEntries,
|
|
74
|
-
maxCallArguments: limits.maxCallArguments
|
|
75
|
-
} : void 0;
|
|
76
70
|
this.maxRounds = limits?.maxRounds ?? 10;
|
|
77
71
|
this.maxCalls = limits?.maxCalls ?? 100;
|
|
78
72
|
this.multicallOptions = config.multicall;
|
|
@@ -93,13 +87,11 @@ var SELRuntime = class {
|
|
|
93
87
|
callCounter: this.currentCallCounter
|
|
94
88
|
});
|
|
95
89
|
};
|
|
96
|
-
const { env, contractBindings, codecRegistry } = (0, _seljs_checker.createRuntimeEnvironment)(this.schema, handler
|
|
97
|
-
limits: celLimits,
|
|
98
|
-
unlistedVariablesAreDyn: true
|
|
99
|
-
});
|
|
90
|
+
const { env, contractBindings, codecRegistry } = (0, _seljs_checker.createRuntimeEnvironment)(this.schema, handler);
|
|
100
91
|
this.env = env;
|
|
101
92
|
this.contractBindings = contractBindings;
|
|
102
93
|
this.codecRegistry = codecRegistry;
|
|
94
|
+
this.checker = new _seljs_checker.SELChecker(config.schema, { rules: config.rules });
|
|
103
95
|
for (const v of this.schema.variables) this.variableTypes.set(v.name, v.type);
|
|
104
96
|
}
|
|
105
97
|
/**
|
|
@@ -157,12 +149,16 @@ var SELRuntime = class {
|
|
|
157
149
|
const executionVariables = Object.keys(evaluationContext).length ? evaluationContext : {};
|
|
158
150
|
const typeCheckResult = parseResult.check();
|
|
159
151
|
if (!typeCheckResult.valid) throw new _seljs_common.SELTypeError(typeCheckResult.error?.message ?? "Type check failed", { cause: typeCheckResult.error });
|
|
152
|
+
const lintResult = this.checker.check(expression);
|
|
153
|
+
const lintErrors = lintResult.diagnostics.filter((d) => d.severity === "error");
|
|
154
|
+
if (lintErrors.length > 0) throw new require_errors.SELLintError(lintErrors);
|
|
160
155
|
return {
|
|
161
156
|
parseResult,
|
|
162
157
|
collectedCalls,
|
|
163
158
|
normalizedContext,
|
|
164
159
|
executionVariables,
|
|
165
|
-
typeCheckResult
|
|
160
|
+
typeCheckResult,
|
|
161
|
+
diagnostics: lintResult.diagnostics.filter((d) => d.severity !== "error")
|
|
166
162
|
};
|
|
167
163
|
}
|
|
168
164
|
async executeContractCalls(collectedCalls, executionVariables, resolvedClient) {
|
|
@@ -212,7 +208,7 @@ var SELRuntime = class {
|
|
|
212
208
|
debug("evaluate: %s", expression);
|
|
213
209
|
const resolvedClient = options?.client ?? this.client;
|
|
214
210
|
try {
|
|
215
|
-
const { parseResult, collectedCalls, normalizedContext, executionVariables, typeCheckResult } = this.planExecution(expression, context ?? {});
|
|
211
|
+
const { parseResult, collectedCalls, normalizedContext, executionVariables, typeCheckResult, diagnostics } = this.planExecution(expression, context ?? {});
|
|
216
212
|
let executionMeta;
|
|
217
213
|
let executionCache;
|
|
218
214
|
if (collectedCalls.length > 0) {
|
|
@@ -238,10 +234,12 @@ var SELRuntime = class {
|
|
|
238
234
|
}
|
|
239
235
|
const value = typeCheckResult.type ? this.codecRegistry.encode(typeCheckResult.type, result) : result;
|
|
240
236
|
debug("evaluate: result type=%s", typeof value);
|
|
241
|
-
|
|
237
|
+
const evalResult = executionMeta ? {
|
|
242
238
|
value,
|
|
243
239
|
meta: executionMeta
|
|
244
240
|
} : { value };
|
|
241
|
+
if (diagnostics.length > 0) evalResult.diagnostics = diagnostics;
|
|
242
|
+
return evalResult;
|
|
245
243
|
} catch (error) {
|
|
246
244
|
throw require_error_wrapper.wrapError(error);
|
|
247
245
|
}
|
|
@@ -5,6 +5,7 @@ import { TypeCheckResult } from "@marcbachmann/cel-js";
|
|
|
5
5
|
//#region src/environment/environment.d.ts
|
|
6
6
|
declare class SELRuntime {
|
|
7
7
|
private readonly env;
|
|
8
|
+
private readonly checker;
|
|
8
9
|
private readonly client?;
|
|
9
10
|
private readonly schema;
|
|
10
11
|
private readonly variableTypes;
|
|
@@ -5,6 +5,7 @@ import { TypeCheckResult } from "@marcbachmann/cel-js";
|
|
|
5
5
|
//#region src/environment/environment.d.ts
|
|
6
6
|
declare class SELRuntime {
|
|
7
7
|
private readonly env;
|
|
8
|
+
private readonly checker;
|
|
8
9
|
private readonly client?;
|
|
9
10
|
private readonly schema;
|
|
10
11
|
private readonly variableTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeContextForEvaluation } from "./context.mjs";
|
|
2
2
|
import { buildExecutionReplayCache } from "./replay-cache.mjs";
|
|
3
3
|
import { createLogger } from "../debug.mjs";
|
|
4
|
-
import { MulticallBatchError, SELContractError, SELTypeError } from "../errors/errors.mjs";
|
|
4
|
+
import { MulticallBatchError, SELContractError, SELLintError, SELTypeError } from "../errors/errors.mjs";
|
|
5
5
|
import "../errors/index.mjs";
|
|
6
6
|
import { CallCounter, buildContractInfoMap, executeContractCall, resolveExecutionBlockNumber } from "./contract-caller.mjs";
|
|
7
7
|
import { wrapError } from "./error-wrapper.mjs";
|
|
@@ -9,7 +9,7 @@ import { collectCalls } from "../analysis/call-collector.mjs";
|
|
|
9
9
|
import { analyzeDependencies } from "../analysis/dependency-analyzer.mjs";
|
|
10
10
|
import { planRounds } from "../analysis/round-planner.mjs";
|
|
11
11
|
import { MultiRoundExecutor } from "../execution/multi-round-executor.mjs";
|
|
12
|
-
import { createRuntimeEnvironment } from "@seljs/checker";
|
|
12
|
+
import { SELChecker, createRuntimeEnvironment } from "@seljs/checker";
|
|
13
13
|
//#region src/environment/environment.ts
|
|
14
14
|
/**
|
|
15
15
|
* Core SEL runtime that bridges CEL expression evaluation with EVM contract reads.
|
|
@@ -22,6 +22,7 @@ import { createRuntimeEnvironment } from "@seljs/checker";
|
|
|
22
22
|
const debug = createLogger("environment");
|
|
23
23
|
var SELRuntime = class {
|
|
24
24
|
env;
|
|
25
|
+
checker;
|
|
25
26
|
client;
|
|
26
27
|
schema;
|
|
27
28
|
variableTypes = /* @__PURE__ */ new Map();
|
|
@@ -64,13 +65,6 @@ var SELRuntime = class {
|
|
|
64
65
|
*/
|
|
65
66
|
constructor(config) {
|
|
66
67
|
const limits = config.limits;
|
|
67
|
-
const celLimits = limits ? {
|
|
68
|
-
maxAstNodes: limits.maxAstNodes,
|
|
69
|
-
maxDepth: limits.maxDepth,
|
|
70
|
-
maxListElements: limits.maxListElements,
|
|
71
|
-
maxMapEntries: limits.maxMapEntries,
|
|
72
|
-
maxCallArguments: limits.maxCallArguments
|
|
73
|
-
} : void 0;
|
|
74
68
|
this.maxRounds = limits?.maxRounds ?? 10;
|
|
75
69
|
this.maxCalls = limits?.maxCalls ?? 100;
|
|
76
70
|
this.multicallOptions = config.multicall;
|
|
@@ -91,13 +85,11 @@ var SELRuntime = class {
|
|
|
91
85
|
callCounter: this.currentCallCounter
|
|
92
86
|
});
|
|
93
87
|
};
|
|
94
|
-
const { env, contractBindings, codecRegistry } = createRuntimeEnvironment(this.schema, handler
|
|
95
|
-
limits: celLimits,
|
|
96
|
-
unlistedVariablesAreDyn: true
|
|
97
|
-
});
|
|
88
|
+
const { env, contractBindings, codecRegistry } = createRuntimeEnvironment(this.schema, handler);
|
|
98
89
|
this.env = env;
|
|
99
90
|
this.contractBindings = contractBindings;
|
|
100
91
|
this.codecRegistry = codecRegistry;
|
|
92
|
+
this.checker = new SELChecker(config.schema, { rules: config.rules });
|
|
101
93
|
for (const v of this.schema.variables) this.variableTypes.set(v.name, v.type);
|
|
102
94
|
}
|
|
103
95
|
/**
|
|
@@ -155,12 +147,16 @@ var SELRuntime = class {
|
|
|
155
147
|
const executionVariables = Object.keys(evaluationContext).length ? evaluationContext : {};
|
|
156
148
|
const typeCheckResult = parseResult.check();
|
|
157
149
|
if (!typeCheckResult.valid) throw new SELTypeError(typeCheckResult.error?.message ?? "Type check failed", { cause: typeCheckResult.error });
|
|
150
|
+
const lintResult = this.checker.check(expression);
|
|
151
|
+
const lintErrors = lintResult.diagnostics.filter((d) => d.severity === "error");
|
|
152
|
+
if (lintErrors.length > 0) throw new SELLintError(lintErrors);
|
|
158
153
|
return {
|
|
159
154
|
parseResult,
|
|
160
155
|
collectedCalls,
|
|
161
156
|
normalizedContext,
|
|
162
157
|
executionVariables,
|
|
163
|
-
typeCheckResult
|
|
158
|
+
typeCheckResult,
|
|
159
|
+
diagnostics: lintResult.diagnostics.filter((d) => d.severity !== "error")
|
|
164
160
|
};
|
|
165
161
|
}
|
|
166
162
|
async executeContractCalls(collectedCalls, executionVariables, resolvedClient) {
|
|
@@ -210,7 +206,7 @@ var SELRuntime = class {
|
|
|
210
206
|
debug("evaluate: %s", expression);
|
|
211
207
|
const resolvedClient = options?.client ?? this.client;
|
|
212
208
|
try {
|
|
213
|
-
const { parseResult, collectedCalls, normalizedContext, executionVariables, typeCheckResult } = this.planExecution(expression, context ?? {});
|
|
209
|
+
const { parseResult, collectedCalls, normalizedContext, executionVariables, typeCheckResult, diagnostics } = this.planExecution(expression, context ?? {});
|
|
214
210
|
let executionMeta;
|
|
215
211
|
let executionCache;
|
|
216
212
|
if (collectedCalls.length > 0) {
|
|
@@ -236,10 +232,12 @@ var SELRuntime = class {
|
|
|
236
232
|
}
|
|
237
233
|
const value = typeCheckResult.type ? this.codecRegistry.encode(typeCheckResult.type, result) : result;
|
|
238
234
|
debug("evaluate: result type=%s", typeof value);
|
|
239
|
-
|
|
235
|
+
const evalResult = executionMeta ? {
|
|
240
236
|
value,
|
|
241
237
|
meta: executionMeta
|
|
242
238
|
} : { value };
|
|
239
|
+
if (diagnostics.length > 0) evalResult.diagnostics = diagnostics;
|
|
240
|
+
return evalResult;
|
|
243
241
|
} catch (error) {
|
|
244
242
|
throw wrapError(error);
|
|
245
243
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELCheckerOptions } from "@seljs/checker";
|
|
1
2
|
import { SELSchema } from "@seljs/schema";
|
|
2
3
|
import { Address, PublicClient } from "viem";
|
|
3
4
|
|
|
@@ -15,26 +16,12 @@ interface MulticallOptions {
|
|
|
15
16
|
address?: Address;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
* Limits for
|
|
19
|
-
*
|
|
20
|
-
* AST limits (`maxAstNodes`, `maxDepth`, `maxListElements`, `maxMapEntries`,
|
|
21
|
-
* `maxCallArguments`) are forwarded to the underlying CEL parser to constrain
|
|
22
|
-
* expression complexity.
|
|
19
|
+
* Limits for contract call execution.
|
|
23
20
|
*
|
|
24
21
|
* Execution limits (`maxRounds`, `maxCalls`) bound the multi-round contract
|
|
25
22
|
* execution engine. An {@link ExecutionLimitError} is thrown when exceeded.
|
|
26
23
|
*/
|
|
27
24
|
interface SELLimits {
|
|
28
|
-
/** Maximum number of AST nodes allowed in a parsed expression */
|
|
29
|
-
maxAstNodes?: number;
|
|
30
|
-
/** Maximum nesting depth of the AST */
|
|
31
|
-
maxDepth?: number;
|
|
32
|
-
/** Maximum number of elements in a list literal */
|
|
33
|
-
maxListElements?: number;
|
|
34
|
-
/** Maximum number of entries in a map literal */
|
|
35
|
-
maxMapEntries?: number;
|
|
36
|
-
/** Maximum number of arguments in a single function call */
|
|
37
|
-
maxCallArguments?: number;
|
|
38
25
|
/** Maximum number of dependency-ordered execution rounds (default: 10) */
|
|
39
26
|
maxRounds?: number;
|
|
40
27
|
/** Maximum total number of contract calls across all rounds (default: 100) */
|
|
@@ -46,14 +33,14 @@ interface SELLimits {
|
|
|
46
33
|
* All contracts and context must be declared here — the environment
|
|
47
34
|
* cannot be mutated after construction.
|
|
48
35
|
*/
|
|
49
|
-
interface SELRuntimeConfig {
|
|
36
|
+
interface SELRuntimeConfig extends SELCheckerOptions {
|
|
50
37
|
/** SEL schema describing contracts, variables, types, functions, and macros */
|
|
51
38
|
schema: SELSchema;
|
|
52
39
|
/** Viem public client for executing on-chain contract reads */
|
|
53
40
|
client?: PublicClient;
|
|
54
41
|
/** Multicall3 batching options for contract call execution */
|
|
55
42
|
multicall?: MulticallOptions;
|
|
56
|
-
/**
|
|
43
|
+
/** Execution limits for contract call rounds and total calls */
|
|
57
44
|
limits?: SELLimits;
|
|
58
45
|
}
|
|
59
46
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELCheckerOptions } from "@seljs/checker";
|
|
1
2
|
import { Address, PublicClient } from "viem";
|
|
2
3
|
import { SELSchema } from "@seljs/schema";
|
|
3
4
|
|
|
@@ -15,26 +16,12 @@ interface MulticallOptions {
|
|
|
15
16
|
address?: Address;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
* Limits for
|
|
19
|
-
*
|
|
20
|
-
* AST limits (`maxAstNodes`, `maxDepth`, `maxListElements`, `maxMapEntries`,
|
|
21
|
-
* `maxCallArguments`) are forwarded to the underlying CEL parser to constrain
|
|
22
|
-
* expression complexity.
|
|
19
|
+
* Limits for contract call execution.
|
|
23
20
|
*
|
|
24
21
|
* Execution limits (`maxRounds`, `maxCalls`) bound the multi-round contract
|
|
25
22
|
* execution engine. An {@link ExecutionLimitError} is thrown when exceeded.
|
|
26
23
|
*/
|
|
27
24
|
interface SELLimits {
|
|
28
|
-
/** Maximum number of AST nodes allowed in a parsed expression */
|
|
29
|
-
maxAstNodes?: number;
|
|
30
|
-
/** Maximum nesting depth of the AST */
|
|
31
|
-
maxDepth?: number;
|
|
32
|
-
/** Maximum number of elements in a list literal */
|
|
33
|
-
maxListElements?: number;
|
|
34
|
-
/** Maximum number of entries in a map literal */
|
|
35
|
-
maxMapEntries?: number;
|
|
36
|
-
/** Maximum number of arguments in a single function call */
|
|
37
|
-
maxCallArguments?: number;
|
|
38
25
|
/** Maximum number of dependency-ordered execution rounds (default: 10) */
|
|
39
26
|
maxRounds?: number;
|
|
40
27
|
/** Maximum total number of contract calls across all rounds (default: 100) */
|
|
@@ -46,14 +33,14 @@ interface SELLimits {
|
|
|
46
33
|
* All contracts and context must be declared here — the environment
|
|
47
34
|
* cannot be mutated after construction.
|
|
48
35
|
*/
|
|
49
|
-
interface SELRuntimeConfig {
|
|
36
|
+
interface SELRuntimeConfig extends SELCheckerOptions {
|
|
50
37
|
/** SEL schema describing contracts, variables, types, functions, and macros */
|
|
51
38
|
schema: SELSchema;
|
|
52
39
|
/** Viem public client for executing on-chain contract reads */
|
|
53
40
|
client?: PublicClient;
|
|
54
41
|
/** Multicall3 batching options for contract call execution */
|
|
55
42
|
multicall?: MulticallOptions;
|
|
56
|
-
/**
|
|
43
|
+
/** Execution limits for contract call rounds and total calls */
|
|
57
44
|
limits?: SELLimits;
|
|
58
45
|
}
|
|
59
46
|
//#endregion
|
package/dist/errors/errors.cjs
CHANGED
|
@@ -60,9 +60,22 @@ var MulticallBatchError = class extends _seljs_common.SELError {
|
|
|
60
60
|
this.methodName = options?.methodName;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Thrown when lint rules with error severity detect violations.
|
|
65
|
+
* Contains the diagnostics that caused the failure.
|
|
66
|
+
*/
|
|
67
|
+
var SELLintError = class extends _seljs_common.SELError {
|
|
68
|
+
diagnostics;
|
|
69
|
+
constructor(diagnostics, options) {
|
|
70
|
+
const messages = diagnostics.map((d) => d.message).join("; ");
|
|
71
|
+
super(`Expression lint failed: ${messages}`, options);
|
|
72
|
+
this.diagnostics = diagnostics;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
63
75
|
//#endregion
|
|
64
76
|
exports.CircularDependencyError = CircularDependencyError;
|
|
65
77
|
exports.ExecutionLimitError = ExecutionLimitError;
|
|
66
78
|
exports.MulticallBatchError = MulticallBatchError;
|
|
67
79
|
exports.SELContractError = SELContractError;
|
|
68
80
|
exports.SELEvaluationError = SELEvaluationError;
|
|
81
|
+
exports.SELLintError = SELLintError;
|
package/dist/errors/errors.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELDiagnostic } from "@seljs/checker";
|
|
1
2
|
import { SELError, SELParseError, SELTypeError } from "@seljs/common";
|
|
2
3
|
|
|
3
4
|
//#region src/errors/errors.d.ts
|
|
@@ -60,5 +61,15 @@ declare class MulticallBatchError extends SELError {
|
|
|
60
61
|
methodName?: string;
|
|
61
62
|
});
|
|
62
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Thrown when lint rules with error severity detect violations.
|
|
66
|
+
* Contains the diagnostics that caused the failure.
|
|
67
|
+
*/
|
|
68
|
+
declare class SELLintError extends SELError {
|
|
69
|
+
readonly diagnostics: SELDiagnostic[];
|
|
70
|
+
constructor(diagnostics: SELDiagnostic[], options?: {
|
|
71
|
+
cause?: unknown;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
63
74
|
//#endregion
|
|
64
|
-
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError };
|
|
75
|
+
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError };
|
package/dist/errors/errors.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELDiagnostic } from "@seljs/checker";
|
|
1
2
|
import { SELError, SELParseError, SELTypeError } from "@seljs/common";
|
|
2
3
|
|
|
3
4
|
//#region src/errors/errors.d.ts
|
|
@@ -60,5 +61,15 @@ declare class MulticallBatchError extends SELError {
|
|
|
60
61
|
methodName?: string;
|
|
61
62
|
});
|
|
62
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Thrown when lint rules with error severity detect violations.
|
|
66
|
+
* Contains the diagnostics that caused the failure.
|
|
67
|
+
*/
|
|
68
|
+
declare class SELLintError extends SELError {
|
|
69
|
+
readonly diagnostics: SELDiagnostic[];
|
|
70
|
+
constructor(diagnostics: SELDiagnostic[], options?: {
|
|
71
|
+
cause?: unknown;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
63
74
|
//#endregion
|
|
64
|
-
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError };
|
|
75
|
+
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError };
|
package/dist/errors/errors.mjs
CHANGED
|
@@ -59,5 +59,17 @@ var MulticallBatchError = class extends SELError {
|
|
|
59
59
|
this.methodName = options?.methodName;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Thrown when lint rules with error severity detect violations.
|
|
64
|
+
* Contains the diagnostics that caused the failure.
|
|
65
|
+
*/
|
|
66
|
+
var SELLintError = class extends SELError {
|
|
67
|
+
diagnostics;
|
|
68
|
+
constructor(diagnostics, options) {
|
|
69
|
+
const messages = diagnostics.map((d) => d.message).join("; ");
|
|
70
|
+
super(`Expression lint failed: ${messages}`, options);
|
|
71
|
+
this.diagnostics = diagnostics;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
62
74
|
//#endregion
|
|
63
|
-
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError };
|
|
75
|
+
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError };
|
package/dist/errors/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError } from "./errors.mjs";
|
|
1
|
+
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError } from "./errors.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELDiagnostic } from "@seljs/checker";
|
|
1
2
|
import { PublicClient } from "viem";
|
|
2
3
|
|
|
3
4
|
//#region src/execution/types.d.ts
|
|
@@ -53,6 +54,8 @@ interface EvaluateResult<T = unknown> {
|
|
|
53
54
|
value: T;
|
|
54
55
|
/** Execution metadata, present when contract calls were executed */
|
|
55
56
|
meta?: ExecutionMeta;
|
|
57
|
+
/** Advisory diagnostics (warnings/info) from lint rules, when non-empty */
|
|
58
|
+
diagnostics?: SELDiagnostic[];
|
|
56
59
|
}
|
|
57
60
|
//#endregion
|
|
58
61
|
export { EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionMeta, ExecutionResult };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELDiagnostic } from "@seljs/checker";
|
|
1
2
|
import { PublicClient } from "viem";
|
|
2
3
|
|
|
3
4
|
//#region src/execution/types.d.ts
|
|
@@ -53,6 +54,8 @@ interface EvaluateResult<T = unknown> {
|
|
|
53
54
|
value: T;
|
|
54
55
|
/** Execution metadata, present when contract calls were executed */
|
|
55
56
|
meta?: ExecutionMeta;
|
|
57
|
+
/** Advisory diagnostics (warnings/info) from lint rules, when non-empty */
|
|
58
|
+
diagnostics?: SELDiagnostic[];
|
|
56
59
|
}
|
|
57
60
|
//#endregion
|
|
58
61
|
export { EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionMeta, ExecutionResult };
|
package/dist/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ exports.MulticallBatchError = require_errors.MulticallBatchError;
|
|
|
12
12
|
exports.SELContractError = require_errors.SELContractError;
|
|
13
13
|
exports.SELError = _seljs_common.SELError;
|
|
14
14
|
exports.SELEvaluationError = require_errors.SELEvaluationError;
|
|
15
|
+
exports.SELLintError = require_errors.SELLintError;
|
|
15
16
|
exports.SELParseError = _seljs_common.SELParseError;
|
|
16
17
|
exports.SELRuntime = require_environment.SELRuntime;
|
|
17
18
|
exports.SELTypeError = _seljs_common.SELTypeError;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MulticallOptions, SELLimits, SELRuntimeConfig } from "./environment/types.cjs";
|
|
2
2
|
import { EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionMeta, ExecutionResult } from "./execution/types.cjs";
|
|
3
3
|
import { SELRuntime } from "./environment/environment.cjs";
|
|
4
|
-
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError } from "./errors/errors.cjs";
|
|
4
|
+
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError } from "./errors/errors.cjs";
|
|
5
5
|
import { createSEL } from "./factory.cjs";
|
|
6
6
|
import { CallArgument, CollectedCall, DependencyGraph, ExecutionPlan, ExecutionRound, GraphNode } from "./analysis/types.cjs";
|
|
7
|
-
export { CallArgument, CircularDependencyError, CollectedCall, DependencyGraph, EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionLimitError, ExecutionMeta, ExecutionPlan, ExecutionResult, ExecutionRound, GraphNode, MulticallBatchError, MulticallOptions, SELContractError, SELError, SELEvaluationError, SELLimits, SELParseError, SELRuntime, SELRuntimeConfig, SELTypeError, createSEL };
|
|
7
|
+
export { CallArgument, CircularDependencyError, CollectedCall, DependencyGraph, EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionLimitError, ExecutionMeta, ExecutionPlan, ExecutionResult, ExecutionRound, GraphNode, MulticallBatchError, MulticallOptions, SELContractError, SELError, SELEvaluationError, SELLimits, SELLintError, SELParseError, SELRuntime, SELRuntimeConfig, SELTypeError, createSEL };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MulticallOptions, SELLimits, SELRuntimeConfig } from "./environment/types.mjs";
|
|
2
2
|
import { EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionMeta, ExecutionResult } from "./execution/types.mjs";
|
|
3
3
|
import { SELRuntime } from "./environment/environment.mjs";
|
|
4
|
-
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError } from "./errors/errors.mjs";
|
|
4
|
+
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError } from "./errors/errors.mjs";
|
|
5
5
|
import { createSEL } from "./factory.mjs";
|
|
6
6
|
import { CallArgument, CollectedCall, DependencyGraph, ExecutionPlan, ExecutionRound, GraphNode } from "./analysis/types.mjs";
|
|
7
|
-
export { CallArgument, CircularDependencyError, CollectedCall, DependencyGraph, EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionLimitError, ExecutionMeta, ExecutionPlan, ExecutionResult, ExecutionRound, GraphNode, MulticallBatchError, MulticallOptions, SELContractError, SELError, SELEvaluationError, SELLimits, SELParseError, SELRuntime, SELRuntimeConfig, SELTypeError, createSEL };
|
|
7
|
+
export { CallArgument, CircularDependencyError, CollectedCall, DependencyGraph, EvaluateOptions, EvaluateResult, ExecutionContext, ExecutionLimitError, ExecutionMeta, ExecutionPlan, ExecutionResult, ExecutionRound, GraphNode, MulticallBatchError, MulticallOptions, SELContractError, SELError, SELEvaluationError, SELLimits, SELLintError, SELParseError, SELRuntime, SELRuntimeConfig, SELTypeError, createSEL };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELTypeError } from "./errors/errors.mjs";
|
|
1
|
+
import { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELTypeError } from "./errors/errors.mjs";
|
|
2
2
|
import "./errors/index.mjs";
|
|
3
3
|
import { SELRuntime } from "./environment/environment.mjs";
|
|
4
4
|
import "./environment/index.mjs";
|
|
5
5
|
import { createSEL } from "./factory.mjs";
|
|
6
|
-
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELParseError, SELRuntime, SELTypeError, createSEL };
|
|
6
|
+
export { CircularDependencyError, ExecutionLimitError, MulticallBatchError, SELContractError, SELError, SELEvaluationError, SELLintError, SELParseError, SELRuntime, SELTypeError, createSEL };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seljs/runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/abinnovision/seljs"
|
|
6
6
|
},
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@marcbachmann/cel-js": "^7.5.3",
|
|
53
|
-
"@seljs/checker": "1.
|
|
54
|
-
"@seljs/common": "1.
|
|
55
|
-
"@seljs/env": "1.
|
|
53
|
+
"@seljs/checker": "1.2.0-beta.3",
|
|
54
|
+
"@seljs/common": "1.2.0-beta.3",
|
|
55
|
+
"@seljs/env": "1.2.0-beta.3",
|
|
56
56
|
"@seljs/schema": "1.1.0",
|
|
57
|
-
"@seljs/types": "1.
|
|
57
|
+
"@seljs/types": "1.2.0-beta.3",
|
|
58
58
|
"debug": "^4.4.3",
|
|
59
59
|
"viem": "^2.47.2"
|
|
60
60
|
},
|