solve-engine 1.0.0-beta.4 → 1.0.0-beta.5
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-X2BWAZAU.cjs → chunk-73GSBGUU.cjs} +27 -27
- package/dist/{chunk-X2BWAZAU.cjs.map → chunk-73GSBGUU.cjs.map} +1 -1
- package/dist/{chunk-EAAHVJ4P.cjs → chunk-AZUA3F4I.cjs} +3 -3
- package/dist/{chunk-EAAHVJ4P.cjs.map → chunk-AZUA3F4I.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-FIFQPKBA.js → chunk-GVWHCL2N.js} +3 -3
- package/dist/chunk-GVWHCL2N.js.map +1 -0
- package/dist/{chunk-KHJUSHFU.js → chunk-MVBEL57Q.js} +13 -5
- package/dist/chunk-MVBEL57Q.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/{chunk-DDQVZGLO.js → chunk-TZLCIJWP.js} +6 -6
- package/dist/{chunk-DDQVZGLO.js.map → chunk-TZLCIJWP.js.map} +1 -1
- package/dist/{chunk-OWRHDUJD.js → chunk-VZH3NOLP.js} +3 -3
- package/dist/{chunk-OWRHDUJD.js.map → chunk-VZH3NOLP.js.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-FIFQPKBA.js.map +0 -1
- package/dist/chunk-KHJUSHFU.js.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 chunkAZUA3F4I_cjs = require('./chunk-AZUA3F4I.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 = chunkAZUA3F4I_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 = chunkAZUA3F4I_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,
|
|
@@ -2987,7 +2987,7 @@ var _AsyncResolutionBatcher = class _AsyncResolutionBatcher {
|
|
|
2987
2987
|
if (!entry || entry.bytecode.opcodes.length === 0) continue;
|
|
2988
2988
|
const stackBefore = this.vm.getStack().length;
|
|
2989
2989
|
try {
|
|
2990
|
-
const result =
|
|
2990
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(entry.bytecode, this.vm);
|
|
2991
2991
|
while (this.vm.getStack().length > stackBefore) {
|
|
2992
2992
|
this.vm.pop();
|
|
2993
2993
|
}
|
|
@@ -3293,7 +3293,7 @@ function extractReadsAndWrites(tokens) {
|
|
|
3293
3293
|
const t = tokens[i];
|
|
3294
3294
|
if (t.type === "GLOBAL") {
|
|
3295
3295
|
if (i + 2 < tokens.length && tokens[i + 1].type === "COLON" && isVarName(tokens[i + 2])) {
|
|
3296
|
-
const key =
|
|
3296
|
+
const key = chunkBXKJLM5R_cjs.globalDagKey(tokens[i + 2].value);
|
|
3297
3297
|
reads.push(key);
|
|
3298
3298
|
if (i + 3 < tokens.length && tokens[i + 3].type === "EQUALS") {
|
|
3299
3299
|
writes.push(key);
|
|
@@ -3352,9 +3352,9 @@ var ExpressionEngine = class {
|
|
|
3352
3352
|
//#region Constructor
|
|
3353
3353
|
constructor(localeCode = "en", diagnosticMode = false, config, diagnosticPipeline, packages) {
|
|
3354
3354
|
//#region Private Properties
|
|
3355
|
-
this.dag = new
|
|
3355
|
+
this.dag = new chunkQDMPOAI7_cjs.DependencyGraph();
|
|
3356
3356
|
this.lineCache = new LineCache();
|
|
3357
|
-
this.scopeManager = new
|
|
3357
|
+
this.scopeManager = new chunkQDMPOAI7_cjs.ScopeManager();
|
|
3358
3358
|
/** Registry of async resolvers from registered packages. */
|
|
3359
3359
|
this.resolverRegistry = new chunkX6K3HUOY_cjs.ResolverRegistry();
|
|
3360
3360
|
/**
|
|
@@ -3420,10 +3420,10 @@ var ExpressionEngine = class {
|
|
|
3420
3420
|
// Most recent pipeline telemetry, populated when AllocationTracker.isEnabled().
|
|
3421
3421
|
this.lastTelemetry = null;
|
|
3422
3422
|
this.localeCode = localeCode;
|
|
3423
|
-
this.config =
|
|
3423
|
+
this.config = chunkAZUA3F4I_cjs.mergeEngineConfig(chunkAZUA3F4I_cjs.DEFAULT_CONFIG, config ?? {});
|
|
3424
3424
|
this.lexer = new chunkWWOLFXTX_cjs.Lexer(localeCode, chunkWWOLFXTX_cjs.buildTokenLookup(localeCode));
|
|
3425
3425
|
this.registry = new chunkMTX2KVU7_cjs.ParseletRegistry();
|
|
3426
|
-
this.context =
|
|
3426
|
+
this.context = chunkBXKJLM5R_cjs.createEngineContext();
|
|
3427
3427
|
if (diagnosticPipeline) {
|
|
3428
3428
|
this.diagnosticPipeline = diagnosticPipeline;
|
|
3429
3429
|
} else if (diagnosticMode) {
|
|
@@ -3441,7 +3441,7 @@ var ExpressionEngine = class {
|
|
|
3441
3441
|
50,
|
|
3442
3442
|
(word) => this.normalizer.canStartPhrase(word)
|
|
3443
3443
|
));
|
|
3444
|
-
const pkgList = packages ??
|
|
3444
|
+
const pkgList = packages ?? chunkCSG5XVNJ_cjs.BUILTIN_PACKAGES;
|
|
3445
3445
|
for (const pkg of pkgList) {
|
|
3446
3446
|
try {
|
|
3447
3447
|
this.registerPackage(pkg);
|
|
@@ -3453,7 +3453,7 @@ var ExpressionEngine = class {
|
|
|
3453
3453
|
}
|
|
3454
3454
|
}
|
|
3455
3455
|
this.parser = new chunkMTX2KVU7_cjs.PrecedenceParser(this.registry, this.config.validation.maxNestingDepth, localeCode);
|
|
3456
|
-
this.vm =
|
|
3456
|
+
this.vm = chunkQDMPOAI7_cjs.createVM(
|
|
3457
3457
|
this.context.opRegistry,
|
|
3458
3458
|
this.config.vm.maxStackDepth,
|
|
3459
3459
|
this.config.vm.maxInstructions,
|
|
@@ -3633,7 +3633,7 @@ var ExpressionEngine = class {
|
|
|
3633
3633
|
}
|
|
3634
3634
|
if (pkg.asConverters) {
|
|
3635
3635
|
for (const [name, handler] of Object.entries(pkg.asConverters)) {
|
|
3636
|
-
|
|
3636
|
+
chunkBXKJLM5R_cjs.registerAsConverter(name, handler);
|
|
3637
3637
|
contribution.asConverterNames.push(name);
|
|
3638
3638
|
}
|
|
3639
3639
|
}
|
|
@@ -3683,7 +3683,7 @@ var ExpressionEngine = class {
|
|
|
3683
3683
|
this.lexer.unregisterVocabulary(contribution.lexerVocabulary);
|
|
3684
3684
|
}
|
|
3685
3685
|
for (const name of contribution.asConverterNames) {
|
|
3686
|
-
|
|
3686
|
+
chunkBXKJLM5R_cjs.unregisterAsConverter(name);
|
|
3687
3687
|
}
|
|
3688
3688
|
this.packageCompletionItems.delete(packageName);
|
|
3689
3689
|
this.packageContributions.delete(packageName);
|
|
@@ -3755,7 +3755,7 @@ var ExpressionEngine = class {
|
|
|
3755
3755
|
controller.abort();
|
|
3756
3756
|
};
|
|
3757
3757
|
chunkZ2XP767T_cjs.setActiveQueryClient(this.queryClient);
|
|
3758
|
-
const result =
|
|
3758
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(program, this.vm, tracePipeline, traceExpression, this.makeLineContext(lineNumber));
|
|
3759
3759
|
while (this.vm.getStack().length > stackBefore) {
|
|
3760
3760
|
this.vm.pop();
|
|
3761
3761
|
}
|
|
@@ -3806,7 +3806,7 @@ var ExpressionEngine = class {
|
|
|
3806
3806
|
controller.abort();
|
|
3807
3807
|
};
|
|
3808
3808
|
chunkZ2XP767T_cjs.setActiveQueryClient(this.queryClient);
|
|
3809
|
-
const result =
|
|
3809
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(program, this.vm, void 0, void 0, this.makeLineContext(lineNumber));
|
|
3810
3810
|
while (this.vm.getStack().length > stackBefore) {
|
|
3811
3811
|
this.vm.pop();
|
|
3812
3812
|
}
|
|
@@ -4063,7 +4063,7 @@ var ExpressionEngine = class {
|
|
|
4063
4063
|
* names, which ordinary evaluation deliberately never allows.
|
|
4064
4064
|
*/
|
|
4065
4065
|
executeSymbolicTolerant(program) {
|
|
4066
|
-
const result =
|
|
4066
|
+
const result = chunkQDMPOAI7_cjs.executeBytecode(program, this.vm, void 0, void 0, void 0, true);
|
|
4067
4067
|
if (result.type === "error") throw result.error;
|
|
4068
4068
|
if (result.type === "pending") {
|
|
4069
4069
|
throw chunkM4N5GA5Z_cjs.ErrorFactory.execution(
|
|
@@ -4209,7 +4209,7 @@ var ExpressionEngine = class {
|
|
|
4209
4209
|
}
|
|
4210
4210
|
return this.simplifySymbolically(beforeTokens);
|
|
4211
4211
|
}
|
|
4212
|
-
if (
|
|
4212
|
+
if (chunkCSG5XVNJ_cjs.containsSymbolicCall(normalizedTokens)) {
|
|
4213
4213
|
return this.simplifySymbolically(normalizedTokens);
|
|
4214
4214
|
}
|
|
4215
4215
|
if (normalizedTokens[0].type === "COLON" || normalizedTokens[0].type === "GLOBAL") return null;
|
|
@@ -4310,7 +4310,7 @@ var ExpressionEngine = class {
|
|
|
4310
4310
|
solveScalarEquation(equation) {
|
|
4311
4311
|
const lhs = this.executeSymbolicTolerant(equation.lhsProgram);
|
|
4312
4312
|
const rhs = this.executeSymbolicTolerant(equation.rhsProgram);
|
|
4313
|
-
return
|
|
4313
|
+
return chunkBXKJLM5R_cjs.solveEquationValues(lhs, rhs, equation.variable);
|
|
4314
4314
|
}
|
|
4315
4315
|
//#endregion
|
|
4316
4316
|
/**
|
|
@@ -6798,8 +6798,8 @@ var ThreeTierEvaluator = class {
|
|
|
6798
6798
|
this.checkpointer = checkpointer ?? null;
|
|
6799
6799
|
this.pageManager = new PageManager();
|
|
6800
6800
|
this.engine.setDocumentModel(this.doc);
|
|
6801
|
-
this.globalUnsubscribe =
|
|
6802
|
-
for (const lineNumber of this.dag.getAffectedLines(
|
|
6801
|
+
this.globalUnsubscribe = chunkBXKJLM5R_cjs.sharedGlobalVariableStore.subscribe((name) => {
|
|
6802
|
+
for (const lineNumber of this.dag.getAffectedLines(chunkBXKJLM5R_cjs.globalDagKey(name))) {
|
|
6803
6803
|
this.doc.markDirtyByLineNumber(lineNumber);
|
|
6804
6804
|
}
|
|
6805
6805
|
});
|
|
@@ -7482,5 +7482,5 @@ exports.checkPackageCompatibility = checkPackageCompatibility;
|
|
|
7482
7482
|
exports.extractReadsAndWrites = extractReadsAndWrites;
|
|
7483
7483
|
exports.findInlineSolvesInLine = findInlineSolvesInLine;
|
|
7484
7484
|
exports.isEmptyLine = isEmptyLine;
|
|
7485
|
-
//# sourceMappingURL=chunk-
|
|
7486
|
-
//# sourceMappingURL=chunk-
|
|
7485
|
+
//# sourceMappingURL=chunk-73GSBGUU.cjs.map
|
|
7486
|
+
//# sourceMappingURL=chunk-73GSBGUU.cjs.map
|