solve-engine 2.38.17 → 2.38.19

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 (75) hide show
  1. package/dist/{PackageCompatibility-DFpkrlUp.d.cts → PackageCompatibility-Bv42nEm2.d.cts} +1 -1
  2. package/dist/{PackageCompatibility-DwZ8-NYu.d.ts → PackageCompatibility-ZCZVGHws.d.ts} +1 -1
  3. package/dist/{PackageRegistry-bOwZZ3Co.d.cts → PackageRegistry-7dFbaAZp.d.cts} +45 -4
  4. package/dist/{PackageRegistry-BF6WA6w6.d.ts → PackageRegistry-B6s8LGCu.d.ts} +45 -4
  5. package/dist/{VMBuiltins-8xIW2gTv.d.cts → VMBuiltins-0C4z3yDS.d.cts} +19 -0
  6. package/dist/{VMBuiltins-ChJ7Joj0.d.ts → VMBuiltins-Bu6qaKi0.d.ts} +19 -0
  7. package/dist/{chunk-KE6SELT2.js → chunk-45J6ALYU.js} +3 -3
  8. package/dist/{chunk-KE6SELT2.js.map → chunk-45J6ALYU.js.map} +1 -1
  9. package/dist/chunk-4I7XP3KF.js +2 -0
  10. package/dist/chunk-4I7XP3KF.js.map +1 -0
  11. package/dist/chunk-5MFUZDYK.cjs +2 -0
  12. package/dist/chunk-5MFUZDYK.cjs.map +1 -0
  13. package/dist/{chunk-KEUEXSHE.cjs → chunk-5QZQIZTS.cjs} +3 -3
  14. package/dist/{chunk-KEUEXSHE.cjs.map → chunk-5QZQIZTS.cjs.map} +1 -1
  15. package/dist/chunk-NN6Q5S4I.cjs +3 -0
  16. package/dist/chunk-NN6Q5S4I.cjs.map +1 -0
  17. package/dist/{chunk-PXHGWBUG.js → chunk-P3ODL6WX.js} +4 -4
  18. package/dist/chunk-P3ODL6WX.js.map +1 -0
  19. package/dist/{chunk-NEK3QTWY.cjs → chunk-TVT3SOU5.cjs} +2 -2
  20. package/dist/{chunk-NEK3QTWY.cjs.map → chunk-TVT3SOU5.cjs.map} +1 -1
  21. package/dist/{chunk-4BNV5KTW.cjs → chunk-U45F6L2L.cjs} +4 -4
  22. package/dist/chunk-U45F6L2L.cjs.map +1 -0
  23. package/dist/chunk-VSYQSSN6.js +3 -0
  24. package/dist/chunk-VSYQSSN6.js.map +1 -0
  25. package/dist/{chunk-RKNUCZ6P.cjs → chunk-WR5HTFDE.cjs} +2 -2
  26. package/dist/{chunk-RKNUCZ6P.cjs.map → chunk-WR5HTFDE.cjs.map} +1 -1
  27. package/dist/{chunk-3A3GT46U.js → chunk-X2UPN2J3.js} +2 -2
  28. package/dist/{chunk-3A3GT46U.js.map → chunk-X2UPN2J3.js.map} +1 -1
  29. package/dist/{chunk-3ZLMMX25.js → chunk-XDL542DB.js} +2 -2
  30. package/dist/{chunk-3ZLMMX25.js.map → chunk-XDL542DB.js.map} +1 -1
  31. package/dist/{chunk-T65HJSSB.cjs → chunk-XPP5U527.cjs} +2 -2
  32. package/dist/{chunk-T65HJSSB.cjs.map → chunk-XPP5U527.cjs.map} +1 -1
  33. package/dist/{chunk-KEZIXLRU.js → chunk-ZYITLCTW.js} +2 -2
  34. package/dist/{chunk-KEZIXLRU.js.map → chunk-ZYITLCTW.js.map} +1 -1
  35. package/dist/constants.cjs +1 -1
  36. package/dist/constants.js +1 -1
  37. package/dist/engine.cjs +1 -1
  38. package/dist/engine.d.cts +4 -4
  39. package/dist/engine.d.ts +4 -4
  40. package/dist/engine.js +1 -1
  41. package/dist/engine.worker.cjs +1 -1
  42. package/dist/engine.worker.js +1 -1
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.d.cts +4 -4
  45. package/dist/index.d.ts +4 -4
  46. package/dist/index.js +1 -1
  47. package/dist/language.d.cts +3 -3
  48. package/dist/language.d.ts +3 -3
  49. package/dist/packages.cjs +1 -1
  50. package/dist/packages.d.cts +2 -2
  51. package/dist/packages.d.ts +2 -2
  52. package/dist/packages.js +1 -1
  53. package/dist/testing.cjs +2 -2
  54. package/dist/testing.d.cts +3 -3
  55. package/dist/testing.d.ts +3 -3
  56. package/dist/testing.js +1 -1
  57. package/dist/vm.cjs +1 -1
  58. package/dist/vm.d.cts +1 -1
  59. package/dist/vm.d.ts +1 -1
  60. package/dist/vm.js +1 -1
  61. package/dist/worker.cjs +2 -2
  62. package/dist/worker.d.cts +2 -2
  63. package/dist/worker.d.ts +2 -2
  64. package/dist/worker.js +1 -1
  65. package/package.json +1 -1
  66. package/dist/chunk-4BNV5KTW.cjs.map +0 -1
  67. package/dist/chunk-MLYKA4XG.js +0 -3
  68. package/dist/chunk-MLYKA4XG.js.map +0 -1
  69. package/dist/chunk-PXHGWBUG.js.map +0 -1
  70. package/dist/chunk-TWXUJJVP.cjs +0 -3
  71. package/dist/chunk-TWXUJJVP.cjs.map +0 -1
  72. package/dist/chunk-WRKDFQXE.cjs +0 -2
  73. package/dist/chunk-WRKDFQXE.cjs.map +0 -1
  74. package/dist/chunk-XKUYR2ZK.js +0 -2
  75. package/dist/chunk-XKUYR2ZK.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-bOwZZ3Co.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-7dFbaAZp.cjs';
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-BF6WA6w6.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-B6s8LGCu.js';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -2,7 +2,7 @@ import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from '
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-8xIW2gTv.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-0C4z3yDS.cjs';
6
6
  import { V as Value, b as ValueType, D as DatetimeGrain } from './Value-B55Hvn3e.cjs';
7
7
  import { a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.cjs';
8
8
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.cjs';
@@ -464,6 +464,21 @@ declare class DocumentModel {
464
464
  /**
465
465
  * Mark a line as clean (re-evaluated successfully).
466
466
  */
467
+ /**
468
+ * Forget what a line answered, without forgetting the line.
469
+ *
470
+ * For a line whose answer was computed about a document that no longer
471
+ * exists. Marking it dirty says it must run again; this says that until it
472
+ * does, it has nothing to tell anyone who asks, which is the state a pass
473
+ * over the text from scratch would be in.
474
+ *
475
+ * The bytecode is left alone. It is compiled from the line's own text, which
476
+ * a structural edit does not change, and dropping it would recompile the
477
+ * document for nothing.
478
+ *
479
+ * @param lineId - Persistent line identifier.
480
+ */
481
+ forgetResult(lineId: number): void;
467
482
  markClean(lineId: number): void;
468
483
  /**
469
484
  * Mark a line as dirty (needs re-evaluation) by its 1-based position.
@@ -910,11 +925,37 @@ declare class AsyncResolutionBatcher {
910
925
  constructor(dag: DependencyGraph, lineCache: LineCache, vm: VM, highWaterMark?: number);
911
926
  /**
912
927
  * Create a fresh internal event stream and wire its controller.
913
- * Called from the constructor and again from clearAll() so the batcher
914
- * keeps emitting events after an engine clear, the engine instance
915
- * (and this batcher) live on across clear() calls.
928
+ *
929
+ * Called from {@link eventStream} on first use and again after clearAll(),
930
+ * so the batcher keeps emitting events after an engine clear: the engine
931
+ * instance (and this batcher) live on across clear() calls.
916
932
  */
917
933
  private createEventStream;
934
+ /**
935
+ * The event stream, built the first time anything needs one.
936
+ *
937
+ * It used to be built in the constructor, and a ReadableStream is not free
938
+ * to build: its start algorithm queues promise reactions, so every engine
939
+ * paid for a stream, and a host that constructs engines in a synchronous
940
+ * loop accumulated one engine's worth of pending microtasks per engine
941
+ * because nothing drained them until the loop ended. At roughly nine
942
+ * kilobytes each that is ninety megabytes over ten thousand engines, for a
943
+ * stream almost none of them ever read.
944
+ *
945
+ * Building it on first use rather than on first subscribe is what keeps the
946
+ * behaviour identical. The stream buffers up to `highWaterMark` events with
947
+ * no reader attached, so a consumer that subscribes after some events have
948
+ * already flowed still receives them; deferring until {@link getEventStream}
949
+ * would have dropped exactly those. So the emit path asks for it too, and
950
+ * the engine that never resolves anything asynchronously and never
951
+ * subscribes is the only one that never builds it, which is the case worth
952
+ * optimising.
953
+ *
954
+ * A cancelled stream is not rebuilt: cancellation clears the controller but
955
+ * leaves the stream itself in place, so the check below sees one and the
956
+ * events go nowhere, which is what cancelling asked for.
957
+ */
958
+ private eventStream;
918
959
  /**
919
960
  * Add a resolved query key to the pending batch.
920
961
  *
@@ -2,7 +2,7 @@ import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from '
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-ChJ7Joj0.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-Bu6qaKi0.js';
6
6
  import { V as Value, b as ValueType, D as DatetimeGrain } from './Value-B55Hvn3e.js';
7
7
  import { a as BytecodeProgram } from './BytecodeBuilder-DSWKZi4f.js';
8
8
  import { C as CalendarBackend } from './CalendarBackend-MdS3Bb4P.js';
@@ -464,6 +464,21 @@ declare class DocumentModel {
464
464
  /**
465
465
  * Mark a line as clean (re-evaluated successfully).
466
466
  */
467
+ /**
468
+ * Forget what a line answered, without forgetting the line.
469
+ *
470
+ * For a line whose answer was computed about a document that no longer
471
+ * exists. Marking it dirty says it must run again; this says that until it
472
+ * does, it has nothing to tell anyone who asks, which is the state a pass
473
+ * over the text from scratch would be in.
474
+ *
475
+ * The bytecode is left alone. It is compiled from the line's own text, which
476
+ * a structural edit does not change, and dropping it would recompile the
477
+ * document for nothing.
478
+ *
479
+ * @param lineId - Persistent line identifier.
480
+ */
481
+ forgetResult(lineId: number): void;
467
482
  markClean(lineId: number): void;
468
483
  /**
469
484
  * Mark a line as dirty (needs re-evaluation) by its 1-based position.
@@ -910,11 +925,37 @@ declare class AsyncResolutionBatcher {
910
925
  constructor(dag: DependencyGraph, lineCache: LineCache, vm: VM, highWaterMark?: number);
911
926
  /**
912
927
  * Create a fresh internal event stream and wire its controller.
913
- * Called from the constructor and again from clearAll() so the batcher
914
- * keeps emitting events after an engine clear, the engine instance
915
- * (and this batcher) live on across clear() calls.
928
+ *
929
+ * Called from {@link eventStream} on first use and again after clearAll(),
930
+ * so the batcher keeps emitting events after an engine clear: the engine
931
+ * instance (and this batcher) live on across clear() calls.
916
932
  */
917
933
  private createEventStream;
934
+ /**
935
+ * The event stream, built the first time anything needs one.
936
+ *
937
+ * It used to be built in the constructor, and a ReadableStream is not free
938
+ * to build: its start algorithm queues promise reactions, so every engine
939
+ * paid for a stream, and a host that constructs engines in a synchronous
940
+ * loop accumulated one engine's worth of pending microtasks per engine
941
+ * because nothing drained them until the loop ended. At roughly nine
942
+ * kilobytes each that is ninety megabytes over ten thousand engines, for a
943
+ * stream almost none of them ever read.
944
+ *
945
+ * Building it on first use rather than on first subscribe is what keeps the
946
+ * behaviour identical. The stream buffers up to `highWaterMark` events with
947
+ * no reader attached, so a consumer that subscribes after some events have
948
+ * already flowed still receives them; deferring until {@link getEventStream}
949
+ * would have dropped exactly those. So the emit path asks for it too, and
950
+ * the engine that never resolves anything asynchronously and never
951
+ * subscribes is the only one that never builds it, which is the case worth
952
+ * optimising.
953
+ *
954
+ * A cancelled stream is not rebuilt: cancellation clears the controller but
955
+ * leaves the stream itself in place, so the check below sees one and the
956
+ * events go nowhere, which is what cancelling asked for.
957
+ */
958
+ private eventStream;
918
959
  /**
919
960
  * Add a resolved query key to the pending batch.
920
961
  *
@@ -729,6 +729,25 @@ declare class DependencyGraph {
729
729
  * @param dependsOnLine - 1-based line whose result it read
730
730
  */
731
731
  registerLinePositionDependency(lineNumber: number, dependsOnLine: number): void;
732
+ /**
733
+ * Every line that read some position's result, whichever position it was.
734
+ *
735
+ * For a structural edit, which changes what a position *means* rather than
736
+ * what any line says. Inserting a line moves everything below it, so `line 5`
737
+ * now names different text, `prev` names a different neighbour, and an
738
+ * `above` aggregate covers a different block, all without a character
739
+ * changing on the line that reads them.
740
+ *
741
+ * Deliberately not filtered by which positions moved. A reader whose target
742
+ * shifted has to re-run, and so does one that shifted past its own target and
743
+ * became a self-reference, and the second is not visible from the target
744
+ * alone. Positional readers are a small minority of a document's lines, so
745
+ * re-running all of them costs almost nothing and cannot be wrong.
746
+ *
747
+ * @returns The 1-based line numbers doing the reading, valid until the next
748
+ * structural change.
749
+ */
750
+ linesReadingAPosition(): Iterable<number>;
732
751
  /**
733
752
  * The lines that read the result of line `lineNumber`.
734
753
  *
@@ -729,6 +729,25 @@ declare class DependencyGraph {
729
729
  * @param dependsOnLine - 1-based line whose result it read
730
730
  */
731
731
  registerLinePositionDependency(lineNumber: number, dependsOnLine: number): void;
732
+ /**
733
+ * Every line that read some position's result, whichever position it was.
734
+ *
735
+ * For a structural edit, which changes what a position *means* rather than
736
+ * what any line says. Inserting a line moves everything below it, so `line 5`
737
+ * now names different text, `prev` names a different neighbour, and an
738
+ * `above` aggregate covers a different block, all without a character
739
+ * changing on the line that reads them.
740
+ *
741
+ * Deliberately not filtered by which positions moved. A reader whose target
742
+ * shifted has to re-run, and so does one that shifted past its own target and
743
+ * became a self-reference, and the second is not visible from the target
744
+ * alone. Positional readers are a small minority of a document's lines, so
745
+ * re-running all of them costs almost nothing and cannot be wrong.
746
+ *
747
+ * @returns The 1-based line numbers doing the reading, valid until the next
748
+ * structural change.
749
+ */
750
+ linesReadingAPosition(): Iterable<number>;
732
751
  /**
733
752
  * The lines that read the result of line `lineNumber`.
734
753
  *