solve-engine 2.38.17 → 2.38.18

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-DwZ8-NYu.d.ts → PackageCompatibility-BRas0tSN.d.ts} +1 -1
  2. package/dist/{PackageCompatibility-DFpkrlUp.d.cts → PackageCompatibility-CUWuzzGW.d.cts} +1 -1
  3. package/dist/{PackageRegistry-BF6WA6w6.d.ts → PackageRegistry-DMcI-_Qz.d.ts} +30 -4
  4. package/dist/{PackageRegistry-bOwZZ3Co.d.cts → PackageRegistry-JqudPxo6.d.cts} +30 -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-4BNV5KTW.cjs → chunk-5E22VW42.cjs} +4 -4
  12. package/dist/chunk-5E22VW42.cjs.map +1 -0
  13. package/dist/chunk-5MFUZDYK.cjs +2 -0
  14. package/dist/chunk-5MFUZDYK.cjs.map +1 -0
  15. package/dist/{chunk-KEUEXSHE.cjs → chunk-5QZQIZTS.cjs} +3 -3
  16. package/dist/{chunk-KEUEXSHE.cjs.map → chunk-5QZQIZTS.cjs.map} +1 -1
  17. package/dist/{chunk-PXHGWBUG.js → chunk-EQMNMV2O.js} +4 -4
  18. package/dist/chunk-EQMNMV2O.js.map +1 -0
  19. package/dist/chunk-JDMHZHL7.js +3 -0
  20. package/dist/chunk-JDMHZHL7.js.map +1 -0
  21. package/dist/chunk-MYGNBES2.cjs +3 -0
  22. package/dist/chunk-MYGNBES2.cjs.map +1 -0
  23. package/dist/{chunk-KEZIXLRU.js → chunk-NMMYBXTV.js} +2 -2
  24. package/dist/{chunk-KEZIXLRU.js.map → chunk-NMMYBXTV.js.map} +1 -1
  25. package/dist/{chunk-NEK3QTWY.cjs → chunk-TVT3SOU5.cjs} +2 -2
  26. package/dist/{chunk-NEK3QTWY.cjs.map → chunk-TVT3SOU5.cjs.map} +1 -1
  27. package/dist/{chunk-T65HJSSB.cjs → chunk-UP7TB5KO.cjs} +2 -2
  28. package/dist/{chunk-T65HJSSB.cjs.map → chunk-UP7TB5KO.cjs.map} +1 -1
  29. package/dist/{chunk-RKNUCZ6P.cjs → chunk-WR5HTFDE.cjs} +2 -2
  30. package/dist/{chunk-RKNUCZ6P.cjs.map → chunk-WR5HTFDE.cjs.map} +1 -1
  31. package/dist/{chunk-3A3GT46U.js → chunk-X2UPN2J3.js} +2 -2
  32. package/dist/{chunk-3A3GT46U.js.map → chunk-X2UPN2J3.js.map} +1 -1
  33. package/dist/{chunk-3ZLMMX25.js → chunk-XDL542DB.js} +2 -2
  34. package/dist/{chunk-3ZLMMX25.js.map → chunk-XDL542DB.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-BF6WA6w6.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-DMcI-_Qz.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-bOwZZ3Co.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-JqudPxo6.cjs';
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-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';
@@ -910,11 +910,37 @@ declare class AsyncResolutionBatcher {
910
910
  constructor(dag: DependencyGraph, lineCache: LineCache, vm: VM, highWaterMark?: number);
911
911
  /**
912
912
  * 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.
913
+ *
914
+ * Called from {@link eventStream} on first use and again after clearAll(),
915
+ * so the batcher keeps emitting events after an engine clear: the engine
916
+ * instance (and this batcher) live on across clear() calls.
916
917
  */
917
918
  private createEventStream;
919
+ /**
920
+ * The event stream, built the first time anything needs one.
921
+ *
922
+ * It used to be built in the constructor, and a ReadableStream is not free
923
+ * to build: its start algorithm queues promise reactions, so every engine
924
+ * paid for a stream, and a host that constructs engines in a synchronous
925
+ * loop accumulated one engine's worth of pending microtasks per engine
926
+ * because nothing drained them until the loop ended. At roughly nine
927
+ * kilobytes each that is ninety megabytes over ten thousand engines, for a
928
+ * stream almost none of them ever read.
929
+ *
930
+ * Building it on first use rather than on first subscribe is what keeps the
931
+ * behaviour identical. The stream buffers up to `highWaterMark` events with
932
+ * no reader attached, so a consumer that subscribes after some events have
933
+ * already flowed still receives them; deferring until {@link getEventStream}
934
+ * would have dropped exactly those. So the emit path asks for it too, and
935
+ * the engine that never resolves anything asynchronously and never
936
+ * subscribes is the only one that never builds it, which is the case worth
937
+ * optimising.
938
+ *
939
+ * A cancelled stream is not rebuilt: cancellation clears the controller but
940
+ * leaves the stream itself in place, so the check below sees one and the
941
+ * events go nowhere, which is what cancelling asked for.
942
+ */
943
+ private eventStream;
918
944
  /**
919
945
  * Add a resolved query key to the pending batch.
920
946
  *
@@ -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';
@@ -910,11 +910,37 @@ declare class AsyncResolutionBatcher {
910
910
  constructor(dag: DependencyGraph, lineCache: LineCache, vm: VM, highWaterMark?: number);
911
911
  /**
912
912
  * 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.
913
+ *
914
+ * Called from {@link eventStream} on first use and again after clearAll(),
915
+ * so the batcher keeps emitting events after an engine clear: the engine
916
+ * instance (and this batcher) live on across clear() calls.
916
917
  */
917
918
  private createEventStream;
919
+ /**
920
+ * The event stream, built the first time anything needs one.
921
+ *
922
+ * It used to be built in the constructor, and a ReadableStream is not free
923
+ * to build: its start algorithm queues promise reactions, so every engine
924
+ * paid for a stream, and a host that constructs engines in a synchronous
925
+ * loop accumulated one engine's worth of pending microtasks per engine
926
+ * because nothing drained them until the loop ended. At roughly nine
927
+ * kilobytes each that is ninety megabytes over ten thousand engines, for a
928
+ * stream almost none of them ever read.
929
+ *
930
+ * Building it on first use rather than on first subscribe is what keeps the
931
+ * behaviour identical. The stream buffers up to `highWaterMark` events with
932
+ * no reader attached, so a consumer that subscribes after some events have
933
+ * already flowed still receives them; deferring until {@link getEventStream}
934
+ * would have dropped exactly those. So the emit path asks for it too, and
935
+ * the engine that never resolves anything asynchronously and never
936
+ * subscribes is the only one that never builds it, which is the case worth
937
+ * optimising.
938
+ *
939
+ * A cancelled stream is not rebuilt: cancellation clears the controller but
940
+ * leaves the stream itself in place, so the check below sees one and the
941
+ * events go nowhere, which is what cancelling asked for.
942
+ */
943
+ private eventStream;
918
944
  /**
919
945
  * Add a resolved query key to the pending batch.
920
946
  *
@@ -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
  *