solve-engine 2.38.4 → 2.38.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.
Files changed (66) hide show
  1. package/dist/{PackageCompatibility-DscVGabN.d.ts → PackageCompatibility-BvKJ84Nt.d.ts} +1 -1
  2. package/dist/{PackageCompatibility-CuUVgjBW.d.cts → PackageCompatibility-UpD1nhk6.d.cts} +1 -1
  3. package/dist/{PackageRegistry-G6qyHROU.d.cts → PackageRegistry-DEFOYdGm.d.cts} +1 -1
  4. package/dist/{PackageRegistry-DJekaRdM.d.ts → PackageRegistry-DIUOXCa1.d.ts} +1 -1
  5. package/dist/{VMBuiltins-RpmR0yHh.d.cts → VMBuiltins-BdQaT3DC.d.cts} +44 -6
  6. package/dist/{VMBuiltins-BnE1KdV5.d.ts → VMBuiltins-CKMK3-LX.d.ts} +44 -6
  7. package/dist/{VMCheckpoints-D0_5-IIa.d.cts → VMCheckpoints-Bmb47bFF.d.cts} +1 -1
  8. package/dist/{VMCheckpoints-DpHlGjJ3.d.ts → VMCheckpoints-DRbJOzVW.d.ts} +1 -1
  9. package/dist/{chunk-E4OXWDC6.cjs → chunk-2NADUGGY.cjs} +4 -4
  10. package/dist/{chunk-E4OXWDC6.cjs.map → chunk-2NADUGGY.cjs.map} +1 -1
  11. package/dist/{chunk-IPVC55ZS.js → chunk-3KQLJIAN.js} +2 -2
  12. package/dist/{chunk-IPVC55ZS.js.map → chunk-3KQLJIAN.js.map} +1 -1
  13. package/dist/{chunk-D52DE6EY.js → chunk-DTB7KZJR.js} +3 -3
  14. package/dist/{chunk-D52DE6EY.js.map → chunk-DTB7KZJR.js.map} +1 -1
  15. package/dist/chunk-KSKZAMYD.cjs +2 -0
  16. package/dist/chunk-KSKZAMYD.cjs.map +1 -0
  17. package/dist/chunk-LM66JRCK.js +3 -0
  18. package/dist/chunk-LM66JRCK.js.map +1 -0
  19. package/dist/{chunk-YXULZQCL.cjs → chunk-MFQUKTLG.cjs} +3 -3
  20. package/dist/{chunk-YXULZQCL.cjs.map → chunk-MFQUKTLG.cjs.map} +1 -1
  21. package/dist/{chunk-F6BLEHJR.js → chunk-UY6UIKPD.js} +3 -3
  22. package/dist/{chunk-F6BLEHJR.js.map → chunk-UY6UIKPD.js.map} +1 -1
  23. package/dist/chunk-Y4IHM3PD.js +2 -0
  24. package/dist/chunk-Y4IHM3PD.js.map +1 -0
  25. package/dist/{chunk-DONOF2NA.cjs → chunk-Z5CAI6QU.cjs} +2 -2
  26. package/dist/{chunk-DONOF2NA.cjs.map → chunk-Z5CAI6QU.cjs.map} +1 -1
  27. package/dist/{chunk-6UGSI263.cjs → chunk-ZE6JTU23.cjs} +3 -3
  28. package/dist/chunk-ZE6JTU23.cjs.map +1 -0
  29. package/dist/constants.cjs +1 -1
  30. package/dist/constants.js +1 -1
  31. package/dist/engine.cjs +1 -1
  32. package/dist/engine.d.cts +4 -4
  33. package/dist/engine.d.ts +4 -4
  34. package/dist/engine.js +1 -1
  35. package/dist/engine.worker.cjs +1 -1
  36. package/dist/engine.worker.js +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.cts +4 -4
  39. package/dist/index.d.ts +4 -4
  40. package/dist/index.js +1 -1
  41. package/dist/language.d.cts +3 -3
  42. package/dist/language.d.ts +3 -3
  43. package/dist/packages.cjs +1 -1
  44. package/dist/packages.d.cts +2 -2
  45. package/dist/packages.d.ts +2 -2
  46. package/dist/packages.js +1 -1
  47. package/dist/testing.cjs +2 -2
  48. package/dist/testing.d.cts +3 -3
  49. package/dist/testing.d.ts +3 -3
  50. package/dist/testing.js +1 -1
  51. package/dist/vm.cjs +1 -1
  52. package/dist/vm.d.cts +2 -2
  53. package/dist/vm.d.ts +2 -2
  54. package/dist/vm.js +1 -1
  55. package/dist/worker.cjs +2 -2
  56. package/dist/worker.d.cts +2 -2
  57. package/dist/worker.d.ts +2 -2
  58. package/dist/worker.js +1 -1
  59. package/package.json +1 -1
  60. package/dist/chunk-6UGSI263.cjs.map +0 -1
  61. package/dist/chunk-O7IUJXOT.cjs +0 -2
  62. package/dist/chunk-O7IUJXOT.cjs.map +0 -1
  63. package/dist/chunk-UDBOAKLW.js +0 -2
  64. package/dist/chunk-UDBOAKLW.js.map +0 -1
  65. package/dist/chunk-Z7NUXVH4.js +0 -3
  66. package/dist/chunk-Z7NUXVH4.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-DJekaRdM.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-DIUOXCa1.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-G6qyHROU.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-DEFOYdGm.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-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 { D as DependencyGraph, V as VM, f as DagSnapshot, g as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-RpmR0yHh.cjs';
5
+ import { D as DependencyGraph, V as VM, f as DagSnapshot, g as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-BdQaT3DC.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';
@@ -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 { D as DependencyGraph, V as VM, f as DagSnapshot, g as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-BnE1KdV5.js';
5
+ import { D as DependencyGraph, V as VM, f as DagSnapshot, g as EngineContext, S as ScopeManager, P as PluginFunctionHandler, A as AsConverter } from './VMBuiltins-CKMK3-LX.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';
@@ -591,6 +591,8 @@ declare const sharedOpRegistry: OpRegistry;
591
591
  /** Serialized snapshot of the dependency graph for diagnostic rendering. */
592
592
  interface DagSnapshot {
593
593
  consumers: Record<string, number[]>;
594
+ /** key -> the lines that write it, the mirror of `consumers`. */
595
+ producers: Record<string, number[]>;
594
596
  writes: Record<number, string[]>;
595
597
  reads: Record<number, string[]>;
596
598
  dataSourceDeps: Record<number, string[]>;
@@ -607,12 +609,36 @@ interface DagSnapshot {
607
609
  * - Efficient removal of deleted lines (removeLine)
608
610
  */
609
611
  declare class DependencyGraph {
612
+ /** key -> the lines that READ it. Answers "what does an edit to this affect". */
610
613
  private consumers;
614
+ /**
615
+ * key -> the lines that WRITE it. Answers "what is in this group".
616
+ *
617
+ * The half that was missing. `consumers` alone can say which lines ask about
618
+ * `#food`; only this can say which lines are *in* it, which is what a
619
+ * category-tag aggregate needs and why it used to walk the whole document
620
+ * instead of asking.
621
+ */
622
+ private producers;
611
623
  private dependencies;
612
624
  private writes;
613
625
  private lineReads;
614
- private dataSourceDependencies;
615
- private dataSourceConsumers;
626
+ /**
627
+ * line -> the keys it reads that {@link registerLine} must not replace.
628
+ *
629
+ * Variable and tag edges are recovered from the line's text every time it is
630
+ * registered, so registering replaces them. A data-source edge is discovered
631
+ * at run time, after that registration, so replacing would drop it. Both live
632
+ * in the same {@link consumers} index; only the bookkeeping differs.
633
+ */
634
+ private pinnedReads;
635
+ /**
636
+ * Whether this line already carries exactly these edges.
637
+ *
638
+ * Reads are compared against the stored set minus its pinned keys, since a
639
+ * pinned key (a data source) is not part of what a caller passes.
640
+ */
641
+ private hasSameEdges;
616
642
  /**
617
643
  * Register a line's variable reads and writes in the dependency graph.
618
644
  *
@@ -668,7 +694,7 @@ declare class DependencyGraph {
668
694
  * @param queryKey - The query key that was updated
669
695
  * @returns Set of line numbers that need re-evaluation
670
696
  */
671
- getAffectedLinesByDataSource(dataSourceId: string, queryKey: string[]): Set<number>;
697
+ getAffectedLinesByDataSource(dataSourceId: string, queryKey: string[]): ReadonlySet<number>;
672
698
  /**
673
699
  * Remove a line from the dependency graph (e.g., when a line is deleted from the document).
674
700
  *
@@ -684,21 +710,33 @@ declare class DependencyGraph {
684
710
  * @param variable - The variable name
685
711
  * @returns Set of line numbers that read this variable, or empty set if none
686
712
  */
687
- getConsumers(variable: string): Set<number>;
713
+ getConsumers(variable: string): ReadonlySet<number>;
714
+ /**
715
+ * Get all line numbers that produce (write) a given key.
716
+ *
717
+ * The mirror of {@link getConsumers}, and the reason the producer index
718
+ * exists: for a category tag it is the group's membership, so an aggregate
719
+ * over `#food` costs the size of the group rather than the size of the
720
+ * document.
721
+ *
722
+ * @param key - The key, from {@link edgeKey}
723
+ * @returns Set of line numbers that write this key, or empty set if none
724
+ */
725
+ getProducers(key: string): ReadonlySet<number>;
688
726
  /**
689
727
  * Get all variables that a line depends on (reads).
690
728
  *
691
729
  * @param lineNumber - The line number to query
692
730
  * @returns Set of variable names this line reads, or empty set if none
693
731
  */
694
- getDependencies(lineNumber: number): Set<string>;
732
+ getDependencies(lineNumber: number): ReadonlySet<string>;
695
733
  /**
696
734
  * Get all variables that a line writes (assigns to).
697
735
  *
698
736
  * @param lineNumber - The line number to query
699
737
  * @returns Set of variable names this line writes, or empty set if none
700
738
  */
701
- getWrites(lineNumber: number): Set<string>;
739
+ getWrites(lineNumber: number): ReadonlySet<string>;
702
740
  /**
703
741
  * Get a serializable snapshot of the entire dependency graph for diagnostics.
704
742
  *
@@ -591,6 +591,8 @@ declare const sharedOpRegistry: OpRegistry;
591
591
  /** Serialized snapshot of the dependency graph for diagnostic rendering. */
592
592
  interface DagSnapshot {
593
593
  consumers: Record<string, number[]>;
594
+ /** key -> the lines that write it, the mirror of `consumers`. */
595
+ producers: Record<string, number[]>;
594
596
  writes: Record<number, string[]>;
595
597
  reads: Record<number, string[]>;
596
598
  dataSourceDeps: Record<number, string[]>;
@@ -607,12 +609,36 @@ interface DagSnapshot {
607
609
  * - Efficient removal of deleted lines (removeLine)
608
610
  */
609
611
  declare class DependencyGraph {
612
+ /** key -> the lines that READ it. Answers "what does an edit to this affect". */
610
613
  private consumers;
614
+ /**
615
+ * key -> the lines that WRITE it. Answers "what is in this group".
616
+ *
617
+ * The half that was missing. `consumers` alone can say which lines ask about
618
+ * `#food`; only this can say which lines are *in* it, which is what a
619
+ * category-tag aggregate needs and why it used to walk the whole document
620
+ * instead of asking.
621
+ */
622
+ private producers;
611
623
  private dependencies;
612
624
  private writes;
613
625
  private lineReads;
614
- private dataSourceDependencies;
615
- private dataSourceConsumers;
626
+ /**
627
+ * line -> the keys it reads that {@link registerLine} must not replace.
628
+ *
629
+ * Variable and tag edges are recovered from the line's text every time it is
630
+ * registered, so registering replaces them. A data-source edge is discovered
631
+ * at run time, after that registration, so replacing would drop it. Both live
632
+ * in the same {@link consumers} index; only the bookkeeping differs.
633
+ */
634
+ private pinnedReads;
635
+ /**
636
+ * Whether this line already carries exactly these edges.
637
+ *
638
+ * Reads are compared against the stored set minus its pinned keys, since a
639
+ * pinned key (a data source) is not part of what a caller passes.
640
+ */
641
+ private hasSameEdges;
616
642
  /**
617
643
  * Register a line's variable reads and writes in the dependency graph.
618
644
  *
@@ -668,7 +694,7 @@ declare class DependencyGraph {
668
694
  * @param queryKey - The query key that was updated
669
695
  * @returns Set of line numbers that need re-evaluation
670
696
  */
671
- getAffectedLinesByDataSource(dataSourceId: string, queryKey: string[]): Set<number>;
697
+ getAffectedLinesByDataSource(dataSourceId: string, queryKey: string[]): ReadonlySet<number>;
672
698
  /**
673
699
  * Remove a line from the dependency graph (e.g., when a line is deleted from the document).
674
700
  *
@@ -684,21 +710,33 @@ declare class DependencyGraph {
684
710
  * @param variable - The variable name
685
711
  * @returns Set of line numbers that read this variable, or empty set if none
686
712
  */
687
- getConsumers(variable: string): Set<number>;
713
+ getConsumers(variable: string): ReadonlySet<number>;
714
+ /**
715
+ * Get all line numbers that produce (write) a given key.
716
+ *
717
+ * The mirror of {@link getConsumers}, and the reason the producer index
718
+ * exists: for a category tag it is the group's membership, so an aggregate
719
+ * over `#food` costs the size of the group rather than the size of the
720
+ * document.
721
+ *
722
+ * @param key - The key, from {@link edgeKey}
723
+ * @returns Set of line numbers that write this key, or empty set if none
724
+ */
725
+ getProducers(key: string): ReadonlySet<number>;
688
726
  /**
689
727
  * Get all variables that a line depends on (reads).
690
728
  *
691
729
  * @param lineNumber - The line number to query
692
730
  * @returns Set of variable names this line reads, or empty set if none
693
731
  */
694
- getDependencies(lineNumber: number): Set<string>;
732
+ getDependencies(lineNumber: number): ReadonlySet<string>;
695
733
  /**
696
734
  * Get all variables that a line writes (assigns to).
697
735
  *
698
736
  * @param lineNumber - The line number to query
699
737
  * @returns Set of variable names this line writes, or empty set if none
700
738
  */
701
- getWrites(lineNumber: number): Set<string>;
739
+ getWrites(lineNumber: number): ReadonlySet<string>;
702
740
  /**
703
741
  * Get a serializable snapshot of the entire dependency graph for diagnostics.
704
742
  *
@@ -1,5 +1,5 @@
1
1
  import { V as Value } from './Value-B55Hvn3e.cjs';
2
- import { V as VM } from './VMBuiltins-RpmR0yHh.cjs';
2
+ import { V as VM } from './VMBuiltins-BdQaT3DC.cjs';
3
3
  import { U as UserFunctionDef } from './BytecodeBuilder-DSWKZi4f.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { V as Value } from './Value-B55Hvn3e.js';
2
- import { V as VM } from './VMBuiltins-BnE1KdV5.js';
2
+ import { V as VM } from './VMBuiltins-CKMK3-LX.js';
3
3
  import { U as UserFunctionDef } from './BytecodeBuilder-DSWKZi4f.js';
4
4
 
5
5
  /**