solve-engine 2.38.26 → 2.38.28

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.
Files changed (126) hide show
  1. package/dist/{PackageCompatibility-C7ILySsH.d.ts → PackageCompatibility-BfRpqwmD.d.ts} +1 -1
  2. package/dist/{PackageCompatibility-CzDzOIg9.d.cts → PackageCompatibility-CcfNMlWN.d.cts} +1 -1
  3. package/dist/{PackageRegistry-D7_B0mxv.d.ts → PackageRegistry-ClAKDDOP.d.ts} +25 -4
  4. package/dist/{PackageRegistry-Bd8ErpwZ.d.cts → PackageRegistry-DLLVZW0S.d.cts} +25 -4
  5. package/dist/{Parselet-DmMY2s9Y.d.cts → Parselet-ClR3Blwp.d.cts} +1 -1
  6. package/dist/{Parselet-Br1tHash.d.ts → Parselet-DkAFnfU2.d.ts} +1 -1
  7. package/dist/{VMBuiltins-BqkoJtHt.d.ts → VMBuiltins-Bk8TQNF1.d.ts} +2 -2
  8. package/dist/{VMBuiltins-Baa90D2v.d.cts → VMBuiltins-ClXnXk9K.d.cts} +2 -2
  9. package/dist/{Value-B55Hvn3e.d.cts → Value-wMuCzPn0.d.cts} +18 -2
  10. package/dist/{Value-B55Hvn3e.d.ts → Value-wMuCzPn0.d.ts} +18 -2
  11. package/dist/{chunk-L2JQQ5EO.js → chunk-34RTVUU3.js} +3 -3
  12. package/dist/{chunk-L2JQQ5EO.js.map → chunk-34RTVUU3.js.map} +1 -1
  13. package/dist/{chunk-QP4VIEXZ.js → chunk-36JGHDZR.js} +2 -2
  14. package/dist/chunk-36JGHDZR.js.map +1 -0
  15. package/dist/chunk-3ZFJLH4W.cjs +2 -0
  16. package/dist/chunk-3ZFJLH4W.cjs.map +1 -0
  17. package/dist/{chunk-EZ7R3ZHM.cjs → chunk-4AX7GIZY.cjs} +3 -3
  18. package/dist/{chunk-EZ7R3ZHM.cjs.map → chunk-4AX7GIZY.cjs.map} +1 -1
  19. package/dist/chunk-4H27GUVY.js +2 -0
  20. package/dist/chunk-4H27GUVY.js.map +1 -0
  21. package/dist/{chunk-ZWDLC4MR.cjs → chunk-5BRJQREI.cjs} +4 -4
  22. package/dist/{chunk-ZWDLC4MR.cjs.map → chunk-5BRJQREI.cjs.map} +1 -1
  23. package/dist/{chunk-AWGSR2GZ.js → chunk-BNVE6I22.js} +2 -2
  24. package/dist/{chunk-AWGSR2GZ.js.map → chunk-BNVE6I22.js.map} +1 -1
  25. package/dist/chunk-CAJKB4WQ.js +2 -0
  26. package/dist/chunk-CAJKB4WQ.js.map +1 -0
  27. package/dist/{chunk-ZSFOIBIH.js → chunk-CUH3FEWI.js} +2 -2
  28. package/dist/chunk-CUH3FEWI.js.map +1 -0
  29. package/dist/{chunk-NMZRAJLJ.cjs → chunk-FZTGWNVU.cjs} +2 -2
  30. package/dist/{chunk-NMZRAJLJ.cjs.map → chunk-FZTGWNVU.cjs.map} +1 -1
  31. package/dist/{chunk-RMBUP4XA.js → chunk-GMHYWVOG.js} +2 -2
  32. package/dist/{chunk-RMBUP4XA.js.map → chunk-GMHYWVOG.js.map} +1 -1
  33. package/dist/chunk-HPJ5SQEL.js +3 -0
  34. package/dist/chunk-HPJ5SQEL.js.map +1 -0
  35. package/dist/chunk-HTB3D3FU.cjs +3 -0
  36. package/dist/chunk-HTB3D3FU.cjs.map +1 -0
  37. package/dist/chunk-KVHLLR67.cjs +3 -0
  38. package/dist/chunk-KVHLLR67.cjs.map +1 -0
  39. package/dist/{chunk-Z4MIX43O.cjs → chunk-NIDVZMKV.cjs} +2 -2
  40. package/dist/chunk-NIDVZMKV.cjs.map +1 -0
  41. package/dist/chunk-NW5MM3Q6.js +3 -0
  42. package/dist/chunk-NW5MM3Q6.js.map +1 -0
  43. package/dist/{chunk-TCDB45AW.js → chunk-QXZVDT54.js} +2 -2
  44. package/dist/{chunk-TCDB45AW.js.map → chunk-QXZVDT54.js.map} +1 -1
  45. package/dist/chunk-SXLHFK7M.cjs +2 -0
  46. package/dist/{chunk-NH74IT7B.cjs.map → chunk-SXLHFK7M.cjs.map} +1 -1
  47. package/dist/{chunk-OBQC7KDY.cjs → chunk-TIWNKFSD.cjs} +2 -2
  48. package/dist/{chunk-OBQC7KDY.cjs.map → chunk-TIWNKFSD.cjs.map} +1 -1
  49. package/dist/chunk-TSVKHY5E.js +2 -0
  50. package/dist/{chunk-A34R65WT.js.map → chunk-TSVKHY5E.js.map} +1 -1
  51. package/dist/chunk-U5PPRJ3B.cjs +2 -0
  52. package/dist/chunk-U5PPRJ3B.cjs.map +1 -0
  53. package/dist/chunk-VOWMVLVV.cjs +2 -0
  54. package/dist/chunk-VOWMVLVV.cjs.map +1 -0
  55. package/dist/{chunk-R6NGKIBC.cjs → chunk-VZ4FEVWA.cjs} +2 -2
  56. package/dist/{chunk-R6NGKIBC.cjs.map → chunk-VZ4FEVWA.cjs.map} +1 -1
  57. package/dist/{chunk-TFZNEEJR.js → chunk-XAKFFIMQ.js} +3 -3
  58. package/dist/{chunk-TFZNEEJR.js.map → chunk-XAKFFIMQ.js.map} +1 -1
  59. package/dist/constants.cjs +1 -1
  60. package/dist/constants.js +1 -1
  61. package/dist/engine.cjs +1 -1
  62. package/dist/engine.d.cts +7 -7
  63. package/dist/engine.d.ts +7 -7
  64. package/dist/engine.js +1 -1
  65. package/dist/engine.worker.cjs +1 -1
  66. package/dist/engine.worker.js +1 -1
  67. package/dist/format.cjs +1 -1
  68. package/dist/format.d.cts +1 -1
  69. package/dist/format.d.ts +1 -1
  70. package/dist/format.js +1 -1
  71. package/dist/index.cjs +1 -1
  72. package/dist/index.d.cts +7 -7
  73. package/dist/index.d.ts +7 -7
  74. package/dist/index.js +1 -1
  75. package/dist/language.d.cts +6 -6
  76. package/dist/language.d.ts +6 -6
  77. package/dist/packages.cjs +1 -1
  78. package/dist/packages.d.cts +5 -5
  79. package/dist/packages.d.ts +5 -5
  80. package/dist/packages.js +1 -1
  81. package/dist/parser.d.cts +3 -3
  82. package/dist/parser.d.ts +3 -3
  83. package/dist/{pipeline-CADMN2D1.d.ts → pipeline-CLegjVrf.d.ts} +1 -1
  84. package/dist/{pipeline-C1-CJnFJ.d.cts → pipeline-DKNPr6s8.d.cts} +1 -1
  85. package/dist/resolvers.d.cts +1 -1
  86. package/dist/resolvers.d.ts +1 -1
  87. package/dist/testing.cjs +2 -2
  88. package/dist/testing.d.cts +6 -6
  89. package/dist/testing.d.ts +6 -6
  90. package/dist/testing.js +1 -1
  91. package/dist/uom.cjs +1 -1
  92. package/dist/uom.d.cts +1 -1
  93. package/dist/uom.d.ts +1 -1
  94. package/dist/uom.js +1 -1
  95. package/dist/vm.cjs +1 -1
  96. package/dist/vm.d.cts +4 -4
  97. package/dist/vm.d.ts +4 -4
  98. package/dist/vm.js +1 -1
  99. package/dist/worker.cjs +2 -2
  100. package/dist/worker.d.cts +5 -5
  101. package/dist/worker.d.ts +5 -5
  102. package/dist/worker.js +1 -1
  103. package/package.json +1 -1
  104. package/dist/chunk-44E7U4O5.js +0 -3
  105. package/dist/chunk-44E7U4O5.js.map +0 -1
  106. package/dist/chunk-54QMY2VL.cjs +0 -2
  107. package/dist/chunk-54QMY2VL.cjs.map +0 -1
  108. package/dist/chunk-5TCSFTZD.js +0 -2
  109. package/dist/chunk-5TCSFTZD.js.map +0 -1
  110. package/dist/chunk-5TVI2UPZ.cjs +0 -2
  111. package/dist/chunk-5TVI2UPZ.cjs.map +0 -1
  112. package/dist/chunk-6FBXJYWO.cjs +0 -3
  113. package/dist/chunk-6FBXJYWO.cjs.map +0 -1
  114. package/dist/chunk-A34R65WT.js +0 -2
  115. package/dist/chunk-KSOB5FCI.js +0 -3
  116. package/dist/chunk-KSOB5FCI.js.map +0 -1
  117. package/dist/chunk-NH74IT7B.cjs +0 -2
  118. package/dist/chunk-QP4VIEXZ.js.map +0 -1
  119. package/dist/chunk-QT4IQADG.cjs +0 -3
  120. package/dist/chunk-QT4IQADG.cjs.map +0 -1
  121. package/dist/chunk-Y5ZY6DPX.cjs +0 -2
  122. package/dist/chunk-Y5ZY6DPX.cjs.map +0 -1
  123. package/dist/chunk-Z4MIX43O.cjs.map +0 -1
  124. package/dist/chunk-ZISAN7NW.js +0 -2
  125. package/dist/chunk-ZISAN7NW.js.map +0 -1
  126. package/dist/chunk-ZSFOIBIH.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-D7_B0mxv.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-ClAKDDOP.js';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-Bd8ErpwZ.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-DLLVZW0S.cjs';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -1,14 +1,14 @@
1
- import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-Br1tHash.js';
1
+ import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-DkAFnfU2.js';
2
2
  import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-DPn5dfCH.js';
3
3
  import { IAsyncResolver } from './resolvers.js';
4
4
  import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-DAzPp-j1.js';
5
- import { b as VMCheckpointer, D as DependencyGraph, V as VM, h as DagSnapshot, i as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-BqkoJtHt.js';
6
- import { V as Value, b as ValueType, D as DatetimeGrain } from './Value-B55Hvn3e.js';
5
+ import { b as VMCheckpointer, D as DependencyGraph, V as VM, h as DagSnapshot, i as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-Bk8TQNF1.js';
6
+ import { V as Value, b as ValueType, D as DatetimeGrain } from './Value-wMuCzPn0.js';
7
7
  import { a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.js';
8
8
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
9
9
  import { QueryClient } from '@tanstack/query-core';
10
10
  import { E as EngineError } from './EngineError-Bm4OYmw8.js';
11
- import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-CADMN2D1.js';
11
+ import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-CLegjVrf.js';
12
12
  import { T as Token } from './Token-D8f7yaz1.js';
13
13
  import { D as DateAmbiguity, E as EngineConfigOverride, a as EngineConfig } from './Configuration-BxriK9Kw.js';
14
14
 
@@ -248,6 +248,21 @@ declare class DocumentModel {
248
248
  * Built on first `getLinePosition()` call, invalidated on structural edits.
249
249
  */
250
250
  private _positionCache;
251
+ /**
252
+ * Lazy order cache: 0-based position → lineId, the reverse of
253
+ * {@link _positionCache} and the order the tree holds.
254
+ *
255
+ * `getLineAt(position)` walked the order tree on every call, an O(log n)
256
+ * recursion. The cross-line forms lean on it hard: `total above`, a line
257
+ * range and each boundary check turn a position into a line this way, once
258
+ * per line they scan, every pass, so in an editing session, where the
259
+ * positions do not move between structural edits, it was the single largest
260
+ * cost in the evaluator (about a quarter of an edit's re-evaluation). This
261
+ * turns the lookup into an array index. Built in the same pass as
262
+ * {@link _positionCache} and invalidated with it, so an edit that only
263
+ * changes a line's text (the common keystroke) leaves it standing.
264
+ */
265
+ private _orderedIds;
251
266
  /**
252
267
  * Line IDs currently marked dirty, maintained alongside every
253
268
  * `state.dirty` mutation (in this class and in every other module that
@@ -362,6 +377,12 @@ declare class DocumentModel {
362
377
  * Get the LineState at the given 1-based line position. O(1).
363
378
  */
364
379
  getLineAt(position: number): LineState | undefined;
380
+ /**
381
+ * Build both order caches in one walk of the tree, and return the ordered
382
+ * ids. The two are kept in lock-step: either both are current or both are
383
+ * rebuilt, so {@link getLineAt} and {@link getLinePosition} never disagree.
384
+ */
385
+ private buildOrderCaches;
365
386
  /**
366
387
  * Get the 1-based position of a line by its persistent ID.
367
388
  * Returns -1 if the line ID is not in the document.
@@ -1,14 +1,14 @@
1
- import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-DmMY2s9Y.cjs';
1
+ import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-ClR3Blwp.cjs';
2
2
  import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-DaWkCu84.cjs';
3
3
  import { IAsyncResolver } from './resolvers.cjs';
4
4
  import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-D382VSYh.cjs';
5
- import { b as VMCheckpointer, D as DependencyGraph, V as VM, h as DagSnapshot, i as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-Baa90D2v.cjs';
6
- import { V as Value, b as ValueType, D as DatetimeGrain } from './Value-B55Hvn3e.cjs';
5
+ import { b as VMCheckpointer, D as DependencyGraph, V as VM, h as DagSnapshot, i as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-ClXnXk9K.cjs';
6
+ import { V as Value, b as ValueType, D as DatetimeGrain } from './Value-wMuCzPn0.cjs';
7
7
  import { a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.cjs';
8
8
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
9
9
  import { QueryClient } from '@tanstack/query-core';
10
10
  import { E as EngineError } from './EngineError-Bm4OYmw8.cjs';
11
- import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-C1-CJnFJ.cjs';
11
+ import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-DKNPr6s8.cjs';
12
12
  import { T as Token } from './Token-D8f7yaz1.cjs';
13
13
  import { D as DateAmbiguity, E as EngineConfigOverride, a as EngineConfig } from './Configuration-BxriK9Kw.cjs';
14
14
 
@@ -248,6 +248,21 @@ declare class DocumentModel {
248
248
  * Built on first `getLinePosition()` call, invalidated on structural edits.
249
249
  */
250
250
  private _positionCache;
251
+ /**
252
+ * Lazy order cache: 0-based position → lineId, the reverse of
253
+ * {@link _positionCache} and the order the tree holds.
254
+ *
255
+ * `getLineAt(position)` walked the order tree on every call, an O(log n)
256
+ * recursion. The cross-line forms lean on it hard: `total above`, a line
257
+ * range and each boundary check turn a position into a line this way, once
258
+ * per line they scan, every pass, so in an editing session, where the
259
+ * positions do not move between structural edits, it was the single largest
260
+ * cost in the evaluator (about a quarter of an edit's re-evaluation). This
261
+ * turns the lookup into an array index. Built in the same pass as
262
+ * {@link _positionCache} and invalidated with it, so an edit that only
263
+ * changes a line's text (the common keystroke) leaves it standing.
264
+ */
265
+ private _orderedIds;
251
266
  /**
252
267
  * Line IDs currently marked dirty, maintained alongside every
253
268
  * `state.dirty` mutation (in this class and in every other module that
@@ -362,6 +377,12 @@ declare class DocumentModel {
362
377
  * Get the LineState at the given 1-based line position. O(1).
363
378
  */
364
379
  getLineAt(position: number): LineState | undefined;
380
+ /**
381
+ * Build both order caches in one walk of the tree, and return the ordered
382
+ * ids. The two are kept in lock-step: either both are current or both are
383
+ * rebuilt, so {@link getLineAt} and {@link getLinePosition} never disagree.
384
+ */
385
+ private buildOrderCaches;
365
386
  /**
366
387
  * Get the 1-based position of a line by its persistent ID.
367
388
  * Returns -1 if the line ID is not in the document.
@@ -1,6 +1,6 @@
1
1
  import { B as BytecodeBuilder } from './BytecodeBuilder-DSWKZi4f.cjs';
2
2
  import { T as Token } from './Token-D8f7yaz1.cjs';
3
- import { D as DiagnosticPipeline } from './pipeline-C1-CJnFJ.cjs';
3
+ import { D as DiagnosticPipeline } from './pipeline-DKNPr6s8.cjs';
4
4
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { B as BytecodeBuilder } from './BytecodeBuilder-DSWKZi4f.js';
2
2
  import { T as Token } from './Token-D8f7yaz1.js';
3
- import { D as DiagnosticPipeline } from './pipeline-CADMN2D1.js';
3
+ import { D as DiagnosticPipeline } from './pipeline-CLegjVrf.js';
4
4
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
5
5
 
6
6
  /**
@@ -1,8 +1,8 @@
1
- import { V as Value } from './Value-B55Hvn3e.js';
1
+ import { V as Value } from './Value-wMuCzPn0.js';
2
2
  import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.js';
3
3
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
4
4
  import { E as EngineError } from './EngineError-Bm4OYmw8.js';
5
- import { D as DiagnosticPipeline } from './pipeline-CADMN2D1.js';
5
+ import { D as DiagnosticPipeline } from './pipeline-CLegjVrf.js';
6
6
 
7
7
  /**
8
8
  * Create a new VM instance with the given opcode registry and configurable limits.
@@ -1,8 +1,8 @@
1
- import { V as Value } from './Value-B55Hvn3e.cjs';
1
+ import { V as Value } from './Value-wMuCzPn0.cjs';
2
2
  import { U as UserFunctionDef, A as AnonymousBodyDef, a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.cjs';
3
3
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
4
4
  import { E as EngineError } from './EngineError-Bm4OYmw8.cjs';
5
- import { D as DiagnosticPipeline } from './pipeline-C1-CJnFJ.cjs';
5
+ import { D as DiagnosticPipeline } from './pipeline-DKNPr6s8.cjs';
6
6
 
7
7
  /**
8
8
  * Create a new VM instance with the given opcode registry and configurable limits.
@@ -606,9 +606,25 @@ type DisplayBase = "hex" | "bin" | "oct";
606
606
  * `unit` slot, which is free for this type.
607
607
  */
608
608
  declare function hexValue(n: number | bigint, base?: DisplayBase): Value;
609
- /** Create a BigInt-typed Value (arbitrary-precision integer). */
609
+ /**
610
+ * Create a BigInt-typed Value (arbitrary-precision integer).
611
+ *
612
+ * Charged on birth by its byte size, so a doubling chain like `b(n) = n * n`
613
+ * nested deep trips the allocation budget (the running tally accumulates each
614
+ * product) rather than building a multi-megabyte integer. The `^` and `<<`
615
+ * operators refuse past their own bit ceiling before they reach here; multiply,
616
+ * which has no such ceiling, is bounded by this charge.
617
+ */
610
618
  declare function bigIntValue(n: bigint): Value;
611
- /** Create a String-typed Value. */
619
+ /**
620
+ * Create a String-typed Value.
621
+ *
622
+ * Charged on birth by its length, the one place every string is born, so a
623
+ * doubling chain like `d(s) = s + s` nested deep trips the allocation budget
624
+ * rather than building a near-gigabyte string. The charge is a no-op outside an
625
+ * evaluation (the formatter, snapshot restore and host callers), exactly like
626
+ * {@link matrixValue}.
627
+ */
612
628
  declare function stringValue(s: string): Value;
613
629
  /** Create a Unit-of-Measurement Value (typed number with unit annotation). */
614
630
  declare function uomValue(n: number, unit: string): Value;
@@ -606,9 +606,25 @@ type DisplayBase = "hex" | "bin" | "oct";
606
606
  * `unit` slot, which is free for this type.
607
607
  */
608
608
  declare function hexValue(n: number | bigint, base?: DisplayBase): Value;
609
- /** Create a BigInt-typed Value (arbitrary-precision integer). */
609
+ /**
610
+ * Create a BigInt-typed Value (arbitrary-precision integer).
611
+ *
612
+ * Charged on birth by its byte size, so a doubling chain like `b(n) = n * n`
613
+ * nested deep trips the allocation budget (the running tally accumulates each
614
+ * product) rather than building a multi-megabyte integer. The `^` and `<<`
615
+ * operators refuse past their own bit ceiling before they reach here; multiply,
616
+ * which has no such ceiling, is bounded by this charge.
617
+ */
610
618
  declare function bigIntValue(n: bigint): Value;
611
- /** Create a String-typed Value. */
619
+ /**
620
+ * Create a String-typed Value.
621
+ *
622
+ * Charged on birth by its length, the one place every string is born, so a
623
+ * doubling chain like `d(s) = s + s` nested deep trips the allocation budget
624
+ * rather than building a near-gigabyte string. The charge is a no-op outside an
625
+ * evaluation (the formatter, snapshot restore and host callers), exactly like
626
+ * {@link matrixValue}.
627
+ */
612
628
  declare function stringValue(s: string): Value;
613
629
  /** Create a Unit-of-Measurement Value (typed number with unit annotation). */
614
630
  declare function uomValue(n: number, unit: string): Value;