solve-engine 1.0.0-beta.4 → 1.0.0-beta.6
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/{chunk-EAAHVJ4P.cjs → chunk-62W2DYYA.cjs} +3 -3
- package/dist/{chunk-EAAHVJ4P.cjs.map → chunk-62W2DYYA.cjs.map} +1 -1
- package/dist/{chunk-3MNKQZ77.js → chunk-BAMZT3GL.js} +3 -3
- package/dist/{chunk-3MNKQZ77.js.map → chunk-BAMZT3GL.js.map} +1 -1
- package/dist/{chunk-2NPS5DQ3.cjs → chunk-BXKJLM5R.cjs} +13 -5
- package/dist/chunk-BXKJLM5R.cjs.map +1 -0
- package/dist/{chunk-43G3JT2E.cjs → chunk-CSG5XVNJ.cjs} +35 -35
- package/dist/chunk-CSG5XVNJ.cjs.map +1 -0
- package/dist/{chunk-X2BWAZAU.cjs → chunk-FN2WMF2W.cjs} +28 -27
- package/dist/chunk-FN2WMF2W.cjs.map +1 -0
- package/dist/{chunk-FIFQPKBA.js → chunk-GVWHCL2N.js} +3 -3
- package/dist/chunk-GVWHCL2N.js.map +1 -0
- package/dist/{chunk-OWRHDUJD.js → chunk-LVLUHTRD.js} +3 -3
- package/dist/{chunk-OWRHDUJD.js.map → chunk-LVLUHTRD.js.map} +1 -1
- package/dist/{chunk-KHJUSHFU.js → chunk-MVBEL57Q.js} +13 -5
- package/dist/chunk-MVBEL57Q.js.map +1 -0
- package/dist/{chunk-DDQVZGLO.js → chunk-NUR3K7EW.js} +7 -6
- package/dist/chunk-NUR3K7EW.js.map +1 -0
- package/dist/{chunk-M4Q47KHF.cjs → chunk-QDMPOAI7.cjs} +22 -22
- package/dist/{chunk-M4Q47KHF.cjs.map → chunk-QDMPOAI7.cjs.map} +1 -1
- package/dist/constants.cjs +4 -4
- package/dist/constants.js +1 -1
- package/dist/engine.cjs +15 -15
- package/dist/engine.js +5 -5
- package/dist/index.cjs +11 -11
- package/dist/index.js +6 -6
- package/dist/packages.cjs +25 -25
- package/dist/packages.d.cts +42 -0
- package/dist/packages.d.ts +42 -0
- package/dist/packages.js +2 -2
- package/dist/vm.cjs +13 -13
- package/dist/vm.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2NPS5DQ3.cjs.map +0 -1
- package/dist/chunk-43G3JT2E.cjs.map +0 -1
- package/dist/chunk-DDQVZGLO.js.map +0 -1
- package/dist/chunk-FIFQPKBA.js.map +0 -1
- package/dist/chunk-KHJUSHFU.js.map +0 -1
- package/dist/chunk-X2BWAZAU.cjs.map +0 -1
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
var chunkMTX2KVU7_cjs = require('./chunk-MTX2KVU7.cjs');
|
|
4
4
|
var chunkX6K3HUOY_cjs = require('./chunk-X6K3HUOY.cjs');
|
|
5
5
|
var chunk5X2PTP6F_cjs = require('./chunk-5X2PTP6F.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkQDMPOAI7_cjs = require('./chunk-QDMPOAI7.cjs');
|
|
7
7
|
var chunk47LRVGOT_cjs = require('./chunk-47LRVGOT.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkCSG5XVNJ_cjs = require('./chunk-CSG5XVNJ.cjs');
|
|
9
9
|
var chunkNZFKROS7_cjs = require('./chunk-NZFKROS7.cjs');
|
|
10
10
|
var chunkAHCLWAM5_cjs = require('./chunk-AHCLWAM5.cjs');
|
|
11
11
|
var chunkZ2XP767T_cjs = require('./chunk-Z2XP767T.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkBXKJLM5R_cjs = require('./chunk-BXKJLM5R.cjs');
|
|
13
13
|
var chunk4CVLFLOB_cjs = require('./chunk-4CVLFLOB.cjs');
|
|
14
14
|
var chunkOC6LTXYS_cjs = require('./chunk-OC6LTXYS.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunk62W2DYYA_cjs = require('./chunk-62W2DYYA.cjs');
|
|
16
16
|
var chunkWWOLFXTX_cjs = require('./chunk-WWOLFXTX.cjs');
|
|
17
17
|
var chunkTY3TLZAW_cjs = require('./chunk-TY3TLZAW.cjs');
|
|
18
18
|
var chunkM4N5GA5Z_cjs = require('./chunk-M4N5GA5Z.cjs');
|
|
@@ -2203,7 +2203,7 @@ function checkPackageCompatibility(candidate, existing) {
|
|
|
2203
2203
|
|
|
2204
2204
|
// src/api/EngineVersionCompatibility.ts
|
|
2205
2205
|
var import_semver = chunkB7LXJ6LC_cjs.__toESM(require_semver2(), 1);
|
|
2206
|
-
function checkEngineVersionCompatibility(pkg, engineVersion =
|
|
2206
|
+
function checkEngineVersionCompatibility(pkg, engineVersion = chunk62W2DYYA_cjs.ENGINE_VERSION) {
|
|
2207
2207
|
if (!pkg.engineVersion) return { compatible: true };
|
|
2208
2208
|
if ((0, import_semver.validRange)(pkg.engineVersion) === null) {
|
|
2209
2209
|
return { compatible: false, reason: "invalid-range", declaredRange: pkg.engineVersion, engineVersion };
|
|
@@ -2214,7 +2214,7 @@ function checkEngineVersionCompatibility(pkg, engineVersion = chunkEAAHVJ4P_cjs.
|
|
|
2214
2214
|
}
|
|
2215
2215
|
return { compatible: true };
|
|
2216
2216
|
}
|
|
2217
|
-
function assertEngineVersionCompatible(pkg, engineVersion =
|
|
2217
|
+
function assertEngineVersionCompatible(pkg, engineVersion = chunk62W2DYYA_cjs.ENGINE_VERSION) {
|
|
2218
2218
|
const result = checkEngineVersionCompatibility(pkg, engineVersion);
|
|
2219
2219
|
if (result.compatible) return;
|
|
2220
2220
|
if (result.reason === "invalid-range") {
|
|
@@ -2251,7 +2251,7 @@ function getCompileEngine() {
|
|
|
2251
2251
|
var executeVm = null;
|
|
2252
2252
|
function getExecuteVm() {
|
|
2253
2253
|
if (!executeVm) {
|
|
2254
|
-
executeVm =
|
|
2254
|
+
executeVm = chunkQDMPOAI7_cjs.createVM(chunkBXKJLM5R_cjs.sharedOpRegistry, 200, 5e4);
|
|
2255
2255
|
}
|
|
2256
2256
|
return executeVm;
|
|
2257
2257
|
}
|
|
@@ -2323,7 +2323,7 @@ function executeOne(item) {
|
|
|
2323
2323
|
const numbers = new Float64Array(item.numbersBuffer, 0, item.numbersLength);
|
|
2324
2324
|
const bytecode = { opcodes, numbers, strings: item.strings };
|
|
2325
2325
|
try {
|
|
2326
|
-
const result =
|
|
2326
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(bytecode, vmm);
|
|
2327
2327
|
if (result.type === "pending") {
|
|
2328
2328
|
return {
|
|
2329
2329
|
lineNumber: item.lineNumber,
|
|
@@ -2373,6 +2373,7 @@ function handleExecuteBatch(msg) {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
var inWorkerScope = typeof self !== "undefined" && typeof window === "undefined";
|
|
2375
2375
|
var handleMessage = (event) => {
|
|
2376
|
+
if (event.origin && self.location && event.origin !== self.location.origin) return;
|
|
2376
2377
|
const msg = event.data;
|
|
2377
2378
|
switch (msg.type) {
|
|
2378
2379
|
case "COMPILE_BATCH":
|
|
@@ -2987,7 +2988,7 @@ var _AsyncResolutionBatcher = class _AsyncResolutionBatcher {
|
|
|
2987
2988
|
if (!entry || entry.bytecode.opcodes.length === 0) continue;
|
|
2988
2989
|
const stackBefore = this.vm.getStack().length;
|
|
2989
2990
|
try {
|
|
2990
|
-
const result =
|
|
2991
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(entry.bytecode, this.vm);
|
|
2991
2992
|
while (this.vm.getStack().length > stackBefore) {
|
|
2992
2993
|
this.vm.pop();
|
|
2993
2994
|
}
|
|
@@ -3293,7 +3294,7 @@ function extractReadsAndWrites(tokens) {
|
|
|
3293
3294
|
const t = tokens[i];
|
|
3294
3295
|
if (t.type === "GLOBAL") {
|
|
3295
3296
|
if (i + 2 < tokens.length && tokens[i + 1].type === "COLON" && isVarName(tokens[i + 2])) {
|
|
3296
|
-
const key =
|
|
3297
|
+
const key = chunkBXKJLM5R_cjs.globalDagKey(tokens[i + 2].value);
|
|
3297
3298
|
reads.push(key);
|
|
3298
3299
|
if (i + 3 < tokens.length && tokens[i + 3].type === "EQUALS") {
|
|
3299
3300
|
writes.push(key);
|
|
@@ -3352,9 +3353,9 @@ var ExpressionEngine = class {
|
|
|
3352
3353
|
//#region Constructor
|
|
3353
3354
|
constructor(localeCode = "en", diagnosticMode = false, config, diagnosticPipeline, packages) {
|
|
3354
3355
|
//#region Private Properties
|
|
3355
|
-
this.dag = new
|
|
3356
|
+
this.dag = new chunkQDMPOAI7_cjs.DependencyGraph();
|
|
3356
3357
|
this.lineCache = new LineCache();
|
|
3357
|
-
this.scopeManager = new
|
|
3358
|
+
this.scopeManager = new chunkQDMPOAI7_cjs.ScopeManager();
|
|
3358
3359
|
/** Registry of async resolvers from registered packages. */
|
|
3359
3360
|
this.resolverRegistry = new chunkX6K3HUOY_cjs.ResolverRegistry();
|
|
3360
3361
|
/**
|
|
@@ -3420,10 +3421,10 @@ var ExpressionEngine = class {
|
|
|
3420
3421
|
// Most recent pipeline telemetry, populated when AllocationTracker.isEnabled().
|
|
3421
3422
|
this.lastTelemetry = null;
|
|
3422
3423
|
this.localeCode = localeCode;
|
|
3423
|
-
this.config =
|
|
3424
|
+
this.config = chunk62W2DYYA_cjs.mergeEngineConfig(chunk62W2DYYA_cjs.DEFAULT_CONFIG, config ?? {});
|
|
3424
3425
|
this.lexer = new chunkWWOLFXTX_cjs.Lexer(localeCode, chunkWWOLFXTX_cjs.buildTokenLookup(localeCode));
|
|
3425
3426
|
this.registry = new chunkMTX2KVU7_cjs.ParseletRegistry();
|
|
3426
|
-
this.context =
|
|
3427
|
+
this.context = chunkBXKJLM5R_cjs.createEngineContext();
|
|
3427
3428
|
if (diagnosticPipeline) {
|
|
3428
3429
|
this.diagnosticPipeline = diagnosticPipeline;
|
|
3429
3430
|
} else if (diagnosticMode) {
|
|
@@ -3441,7 +3442,7 @@ var ExpressionEngine = class {
|
|
|
3441
3442
|
50,
|
|
3442
3443
|
(word) => this.normalizer.canStartPhrase(word)
|
|
3443
3444
|
));
|
|
3444
|
-
const pkgList = packages ??
|
|
3445
|
+
const pkgList = packages ?? chunkCSG5XVNJ_cjs.BUILTIN_PACKAGES;
|
|
3445
3446
|
for (const pkg of pkgList) {
|
|
3446
3447
|
try {
|
|
3447
3448
|
this.registerPackage(pkg);
|
|
@@ -3453,7 +3454,7 @@ var ExpressionEngine = class {
|
|
|
3453
3454
|
}
|
|
3454
3455
|
}
|
|
3455
3456
|
this.parser = new chunkMTX2KVU7_cjs.PrecedenceParser(this.registry, this.config.validation.maxNestingDepth, localeCode);
|
|
3456
|
-
this.vm =
|
|
3457
|
+
this.vm = chunkQDMPOAI7_cjs.createVM(
|
|
3457
3458
|
this.context.opRegistry,
|
|
3458
3459
|
this.config.vm.maxStackDepth,
|
|
3459
3460
|
this.config.vm.maxInstructions,
|
|
@@ -3633,7 +3634,7 @@ var ExpressionEngine = class {
|
|
|
3633
3634
|
}
|
|
3634
3635
|
if (pkg.asConverters) {
|
|
3635
3636
|
for (const [name, handler] of Object.entries(pkg.asConverters)) {
|
|
3636
|
-
|
|
3637
|
+
chunkBXKJLM5R_cjs.registerAsConverter(name, handler);
|
|
3637
3638
|
contribution.asConverterNames.push(name);
|
|
3638
3639
|
}
|
|
3639
3640
|
}
|
|
@@ -3683,7 +3684,7 @@ var ExpressionEngine = class {
|
|
|
3683
3684
|
this.lexer.unregisterVocabulary(contribution.lexerVocabulary);
|
|
3684
3685
|
}
|
|
3685
3686
|
for (const name of contribution.asConverterNames) {
|
|
3686
|
-
|
|
3687
|
+
chunkBXKJLM5R_cjs.unregisterAsConverter(name);
|
|
3687
3688
|
}
|
|
3688
3689
|
this.packageCompletionItems.delete(packageName);
|
|
3689
3690
|
this.packageContributions.delete(packageName);
|
|
@@ -3755,7 +3756,7 @@ var ExpressionEngine = class {
|
|
|
3755
3756
|
controller.abort();
|
|
3756
3757
|
};
|
|
3757
3758
|
chunkZ2XP767T_cjs.setActiveQueryClient(this.queryClient);
|
|
3758
|
-
const result =
|
|
3759
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(program, this.vm, tracePipeline, traceExpression, this.makeLineContext(lineNumber));
|
|
3759
3760
|
while (this.vm.getStack().length > stackBefore) {
|
|
3760
3761
|
this.vm.pop();
|
|
3761
3762
|
}
|
|
@@ -3806,7 +3807,7 @@ var ExpressionEngine = class {
|
|
|
3806
3807
|
controller.abort();
|
|
3807
3808
|
};
|
|
3808
3809
|
chunkZ2XP767T_cjs.setActiveQueryClient(this.queryClient);
|
|
3809
|
-
const result =
|
|
3810
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(program, this.vm, void 0, void 0, this.makeLineContext(lineNumber));
|
|
3810
3811
|
while (this.vm.getStack().length > stackBefore) {
|
|
3811
3812
|
this.vm.pop();
|
|
3812
3813
|
}
|
|
@@ -4063,7 +4064,7 @@ var ExpressionEngine = class {
|
|
|
4063
4064
|
* names, which ordinary evaluation deliberately never allows.
|
|
4064
4065
|
*/
|
|
4065
4066
|
executeSymbolicTolerant(program) {
|
|
4066
|
-
const result =
|
|
4067
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(program, this.vm, void 0, void 0, void 0, true);
|
|
4067
4068
|
if (result.type === "error") throw result.error;
|
|
4068
4069
|
if (result.type === "pending") {
|
|
4069
4070
|
throw chunkM4N5GA5Z_cjs.ErrorFactory.execution(
|
|
@@ -4209,7 +4210,7 @@ var ExpressionEngine = class {
|
|
|
4209
4210
|
}
|
|
4210
4211
|
return this.simplifySymbolically(beforeTokens);
|
|
4211
4212
|
}
|
|
4212
|
-
if (
|
|
4213
|
+
if (chunkCSG5XVNJ_cjs.containsSymbolicCall(normalizedTokens)) {
|
|
4213
4214
|
return this.simplifySymbolically(normalizedTokens);
|
|
4214
4215
|
}
|
|
4215
4216
|
if (normalizedTokens[0].type === "COLON" || normalizedTokens[0].type === "GLOBAL") return null;
|
|
@@ -4310,7 +4311,7 @@ var ExpressionEngine = class {
|
|
|
4310
4311
|
solveScalarEquation(equation) {
|
|
4311
4312
|
const lhs = this.executeSymbolicTolerant(equation.lhsProgram);
|
|
4312
4313
|
const rhs = this.executeSymbolicTolerant(equation.rhsProgram);
|
|
4313
|
-
return
|
|
4314
|
+
return chunkBXKJLM5R_cjs.solveEquationValues(lhs, rhs, equation.variable);
|
|
4314
4315
|
}
|
|
4315
4316
|
//#endregion
|
|
4316
4317
|
/**
|
|
@@ -6798,8 +6799,8 @@ var ThreeTierEvaluator = class {
|
|
|
6798
6799
|
this.checkpointer = checkpointer ?? null;
|
|
6799
6800
|
this.pageManager = new PageManager();
|
|
6800
6801
|
this.engine.setDocumentModel(this.doc);
|
|
6801
|
-
this.globalUnsubscribe =
|
|
6802
|
-
for (const lineNumber of this.dag.getAffectedLines(
|
|
6802
|
+
this.globalUnsubscribe = chunkBXKJLM5R_cjs.sharedGlobalVariableStore.subscribe((name) => {
|
|
6803
|
+
for (const lineNumber of this.dag.getAffectedLines(chunkBXKJLM5R_cjs.globalDagKey(name))) {
|
|
6803
6804
|
this.doc.markDirtyByLineNumber(lineNumber);
|
|
6804
6805
|
}
|
|
6805
6806
|
});
|
|
@@ -7482,5 +7483,5 @@ exports.checkPackageCompatibility = checkPackageCompatibility;
|
|
|
7482
7483
|
exports.extractReadsAndWrites = extractReadsAndWrites;
|
|
7483
7484
|
exports.findInlineSolvesInLine = findInlineSolvesInLine;
|
|
7484
7485
|
exports.isEmptyLine = isEmptyLine;
|
|
7485
|
-
//# sourceMappingURL=chunk-
|
|
7486
|
-
//# sourceMappingURL=chunk-
|
|
7486
|
+
//# sourceMappingURL=chunk-FN2WMF2W.cjs.map
|
|
7487
|
+
//# sourceMappingURL=chunk-FN2WMF2W.cjs.map
|