@titan-design/code-read 0.1.8 → 0.2.0

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.
@@ -2,7 +2,7 @@ import { z, ZodType } from 'zod';
2
2
  import { JsonEnvelope } from '@titan-design/rpc-protocol';
3
3
 
4
4
  /** The read API's semver. Bump it whenever `CONTRACT` changes; `contract.lock.json` records the last one. */
5
- declare const CODE_READ_API_VERSION = "0.1.2";
5
+ declare const CODE_READ_API_VERSION = "0.1.8";
6
6
  interface CommandContract<Args extends ZodType = ZodType, Result extends ZodType = ZodType> {
7
7
  description: string;
8
8
  args: Args;
@@ -146,6 +146,14 @@ declare const CONTRACT: {
146
146
  id: z.ZodString;
147
147
  baseline: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
148
148
  metrics: z.ZodDefault<z.ZodArray<z.ZodString>>;
149
+ lenses: z.ZodDefault<z.ZodArray<z.ZodEnum<{
150
+ score: "score";
151
+ exports: "exports";
152
+ centrality: "centrality";
153
+ coupling: "coupling";
154
+ tests: "tests";
155
+ }>>>;
156
+ window: z.ZodDefault<z.ZodString>;
149
157
  }, z.core.$strip>;
150
158
  readonly result: z.ZodObject<{
151
159
  node: z.ZodObject<{
@@ -197,6 +205,64 @@ declare const CONTRACT: {
197
205
  baseline: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
198
206
  delta: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
199
207
  }, z.core.$strip>>;
208
+ lenses: z.ZodOptional<z.ZodObject<{
209
+ exports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
210
+ name: z.ZodString;
211
+ utilization: z.ZodNumber;
212
+ cognitive: z.ZodNullable<z.ZodNumber>;
213
+ consumers: z.ZodNumber;
214
+ exported: z.ZodBoolean;
215
+ }, z.core.$strip>>>>;
216
+ score: z.ZodOptional<z.ZodNullable<z.ZodObject<{
217
+ grain: z.ZodEnum<{
218
+ symbol: "symbol";
219
+ file: "file";
220
+ }>;
221
+ window: z.ZodString;
222
+ score: z.ZodNumber;
223
+ churn: z.ZodOptional<z.ZodNumber>;
224
+ complexity: z.ZodOptional<z.ZodNumber>;
225
+ recency: z.ZodOptional<z.ZodNumber>;
226
+ utilization: z.ZodOptional<z.ZodNumber>;
227
+ rank: z.ZodNullable<z.ZodNumber>;
228
+ ranked: z.ZodNumber;
229
+ }, z.core.$strip>>>;
230
+ centrality: z.ZodOptional<z.ZodNullable<z.ZodObject<{
231
+ score: z.ZodNullable<z.ZodNumber>;
232
+ rank: z.ZodNullable<z.ZodNumber>;
233
+ of: z.ZodNumber;
234
+ }, z.core.$strip>>>;
235
+ coupling: z.ZodOptional<z.ZodNullable<z.ZodObject<{
236
+ measured: z.ZodBoolean;
237
+ partners: z.ZodArray<z.ZodObject<{
238
+ node: z.ZodObject<{
239
+ id: z.ZodString;
240
+ kind: z.ZodString;
241
+ name: z.ZodString;
242
+ path: z.ZodString;
243
+ span: z.ZodOptional<z.ZodObject<{
244
+ startLine: z.ZodNumber;
245
+ endLine: z.ZodNumber;
246
+ }, z.core.$strip>>;
247
+ }, z.core.$strip>;
248
+ count: z.ZodNumber;
249
+ }, z.core.$strip>>;
250
+ }, z.core.$strip>>>;
251
+ tests: z.ZodOptional<z.ZodNullable<z.ZodObject<{
252
+ tests: z.ZodArray<z.ZodObject<{
253
+ id: z.ZodString;
254
+ kind: z.ZodString;
255
+ name: z.ZodString;
256
+ path: z.ZodString;
257
+ span: z.ZodOptional<z.ZodObject<{
258
+ startLine: z.ZodNumber;
259
+ endLine: z.ZodNumber;
260
+ }, z.core.$strip>>;
261
+ }, z.core.$strip>>;
262
+ indexedCount: z.ZodNullable<z.ZodNumber>;
263
+ coEditMeasured: z.ZodBoolean;
264
+ }, z.core.$strip>>>;
265
+ }, z.core.$strip>>;
200
266
  baselineSnapshotId: z.ZodOptional<z.ZodNumber>;
201
267
  comparable: z.ZodOptional<z.ZodBoolean>;
202
268
  snapshotId: z.ZodNumber;
@@ -540,6 +606,640 @@ declare const CONTRACT: {
540
606
  }, z.core.$strip>;
541
607
  }, z.core.$strip>;
542
608
  };
609
+ readonly "hotspots.list": {
610
+ readonly description: string;
611
+ readonly args: z.ZodObject<{
612
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
613
+ baseline: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
614
+ grain: z.ZodDefault<z.ZodEnum<{
615
+ symbol: "symbol";
616
+ file: "file";
617
+ }>>;
618
+ window: z.ZodDefault<z.ZodString>;
619
+ cutoff: z.ZodOptional<z.ZodNumber>;
620
+ offset: z.ZodDefault<z.ZodNumber>;
621
+ limit: z.ZodDefault<z.ZodNumber>;
622
+ }, z.core.$strip>;
623
+ readonly result: z.ZodObject<{
624
+ rows: z.ZodArray<z.ZodObject<{
625
+ node: z.ZodObject<{
626
+ id: z.ZodString;
627
+ kind: z.ZodString;
628
+ name: z.ZodString;
629
+ path: z.ZodString;
630
+ span: z.ZodOptional<z.ZodObject<{
631
+ startLine: z.ZodNumber;
632
+ endLine: z.ZodNumber;
633
+ }, z.core.$strip>>;
634
+ }, z.core.$strip>;
635
+ churn: z.ZodNumber;
636
+ complexity: z.ZodNumber;
637
+ recency: z.ZodNumber;
638
+ score: z.ZodNumber;
639
+ utilization: z.ZodOptional<z.ZodNumber>;
640
+ baselineScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
641
+ mark: z.ZodOptional<z.ZodEnum<{
642
+ new: "new";
643
+ worsened: "worsened";
644
+ }>>;
645
+ }, z.core.$strip>>;
646
+ total: z.ZodNumber;
647
+ baselineSnapshotId: z.ZodOptional<z.ZodNumber>;
648
+ comparable: z.ZodOptional<z.ZodBoolean>;
649
+ snapshotId: z.ZodNumber;
650
+ }, z.core.$strip>;
651
+ };
652
+ readonly "overview.get": {
653
+ readonly description: string;
654
+ readonly args: z.ZodObject<{
655
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
656
+ baseline: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
657
+ window: z.ZodDefault<z.ZodString>;
658
+ cutoff: z.ZodDefault<z.ZodNumber>;
659
+ weights: z.ZodPrefault<z.ZodObject<{
660
+ hotspots: z.ZodPrefault<z.ZodObject<{
661
+ each: z.ZodDefault<z.ZodNumber>;
662
+ cap: z.ZodDefault<z.ZodNumber>;
663
+ }, z.core.$strip>>;
664
+ findings: z.ZodPrefault<z.ZodObject<{
665
+ each_new: z.ZodDefault<z.ZodNumber>;
666
+ each_carry: z.ZodDefault<z.ZodNumber>;
667
+ cap: z.ZodDefault<z.ZodNumber>;
668
+ }, z.core.$strip>>;
669
+ complexity: z.ZodPrefault<z.ZodObject<{
670
+ budget: z.ZodDefault<z.ZodNumber>;
671
+ each: z.ZodDefault<z.ZodNumber>;
672
+ cap: z.ZodDefault<z.ZodNumber>;
673
+ }, z.core.$strip>>;
674
+ hidden_coupling: z.ZodPrefault<z.ZodObject<{
675
+ each: z.ZodDefault<z.ZodNumber>;
676
+ cap: z.ZodDefault<z.ZodNumber>;
677
+ }, z.core.$strip>>;
678
+ }, z.core.$strip>>;
679
+ exclude_rules: z.ZodDefault<z.ZodArray<z.ZodString>>;
680
+ combined: z.ZodDefault<z.ZodBoolean>;
681
+ reading_limit: z.ZodDefault<z.ZodNumber>;
682
+ look_limit: z.ZodDefault<z.ZodNumber>;
683
+ }, z.core.$strip>;
684
+ readonly result: z.ZodObject<{
685
+ kpis: z.ZodObject<{
686
+ hotspotsOverCutoff: z.ZodNumber;
687
+ maxComplexity: z.ZodNumber;
688
+ knowledgeSilos: z.ZodNumber;
689
+ findings: z.ZodObject<{
690
+ open: z.ZodNumber;
691
+ new: z.ZodOptional<z.ZodNumber>;
692
+ carryover: z.ZodOptional<z.ZodNumber>;
693
+ resolved: z.ZodOptional<z.ZodNumber>;
694
+ }, z.core.$strip>;
695
+ }, z.core.$strip>;
696
+ signals: z.ZodArray<z.ZodObject<{
697
+ key: z.ZodEnum<{
698
+ findings: "findings";
699
+ complexity: "complexity";
700
+ hotspots: "hotspots";
701
+ "hidden-coupling": "hidden-coupling";
702
+ }>;
703
+ label: z.ZodString;
704
+ penalty: z.ZodNumber;
705
+ cap: z.ZodNumber;
706
+ measured: z.ZodBoolean;
707
+ detail: z.ZodString;
708
+ }, z.core.$strip>>;
709
+ combined: z.ZodOptional<z.ZodNumber>;
710
+ readingOrder: z.ZodArray<z.ZodObject<{
711
+ node: z.ZodObject<{
712
+ id: z.ZodString;
713
+ kind: z.ZodString;
714
+ name: z.ZodString;
715
+ path: z.ZodString;
716
+ span: z.ZodOptional<z.ZodObject<{
717
+ startLine: z.ZodNumber;
718
+ endLine: z.ZodNumber;
719
+ }, z.core.$strip>>;
720
+ }, z.core.$strip>;
721
+ centrality: z.ZodNumber;
722
+ }, z.core.$strip>>;
723
+ lookFirst: z.ZodArray<z.ZodObject<{
724
+ node: z.ZodObject<{
725
+ id: z.ZodString;
726
+ kind: z.ZodString;
727
+ name: z.ZodString;
728
+ path: z.ZodString;
729
+ span: z.ZodOptional<z.ZodObject<{
730
+ startLine: z.ZodNumber;
731
+ endLine: z.ZodNumber;
732
+ }, z.core.$strip>>;
733
+ }, z.core.$strip>;
734
+ score: z.ZodNumber;
735
+ churn: z.ZodNumber;
736
+ complexity: z.ZodNumber;
737
+ recency: z.ZodNumber;
738
+ reasons: z.ZodArray<z.ZodEnum<{
739
+ findings: "findings";
740
+ "over-cutoff": "over-cutoff";
741
+ "churn-complexity": "churn-complexity";
742
+ }>>;
743
+ }, z.core.$strip>>;
744
+ baselineSnapshotId: z.ZodOptional<z.ZodNumber>;
745
+ comparable: z.ZodOptional<z.ZodBoolean>;
746
+ snapshotId: z.ZodNumber;
747
+ }, z.core.$strip>;
748
+ };
749
+ readonly "changes.get": {
750
+ readonly description: string;
751
+ readonly args: z.ZodObject<{
752
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
753
+ baseline: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
754
+ window: z.ZodDefault<z.ZodString>;
755
+ cutoff: z.ZodDefault<z.ZodNumber>;
756
+ limit: z.ZodDefault<z.ZodNumber>;
757
+ }, z.core.$strip>;
758
+ readonly result: z.ZodObject<{
759
+ snapshotId: z.ZodNumber;
760
+ baselineSnapshotId: z.ZodNumber;
761
+ comparable: z.ZodBoolean;
762
+ files: z.ZodObject<{
763
+ crossedCutoff: z.ZodArray<z.ZodObject<{
764
+ node: z.ZodObject<{
765
+ id: z.ZodString;
766
+ kind: z.ZodString;
767
+ name: z.ZodString;
768
+ path: z.ZodString;
769
+ span: z.ZodOptional<z.ZodObject<{
770
+ startLine: z.ZodNumber;
771
+ endLine: z.ZodNumber;
772
+ }, z.core.$strip>>;
773
+ }, z.core.$strip>;
774
+ before: z.ZodNumber;
775
+ after: z.ZodNumber;
776
+ delta: z.ZodNumber;
777
+ }, z.core.$strip>>;
778
+ added: z.ZodArray<z.ZodObject<{
779
+ node: z.ZodObject<{
780
+ id: z.ZodString;
781
+ kind: z.ZodString;
782
+ name: z.ZodString;
783
+ path: z.ZodString;
784
+ span: z.ZodOptional<z.ZodObject<{
785
+ startLine: z.ZodNumber;
786
+ endLine: z.ZodNumber;
787
+ }, z.core.$strip>>;
788
+ }, z.core.$strip>;
789
+ score: z.ZodNumber;
790
+ }, z.core.$strip>>;
791
+ }, z.core.$strip>;
792
+ findings: z.ZodObject<{
793
+ new: z.ZodArray<z.ZodObject<{
794
+ id: z.ZodString;
795
+ snapshotId: z.ZodNumber;
796
+ rule: z.ZodString;
797
+ tool: z.ZodString;
798
+ severity: z.ZodString;
799
+ node: z.ZodObject<{
800
+ id: z.ZodString;
801
+ kind: z.ZodString;
802
+ name: z.ZodString;
803
+ path: z.ZodString;
804
+ span: z.ZodOptional<z.ZodObject<{
805
+ startLine: z.ZodNumber;
806
+ endLine: z.ZodNumber;
807
+ }, z.core.$strip>>;
808
+ }, z.core.$strip>;
809
+ destination: z.ZodOptional<z.ZodObject<{
810
+ id: z.ZodString;
811
+ kind: z.ZodString;
812
+ name: z.ZodString;
813
+ path: z.ZodString;
814
+ span: z.ZodOptional<z.ZodObject<{
815
+ startLine: z.ZodNumber;
816
+ endLine: z.ZodNumber;
817
+ }, z.core.$strip>>;
818
+ }, z.core.$strip>>;
819
+ range: z.ZodOptional<z.ZodObject<{
820
+ startLine: z.ZodNumber;
821
+ endLine: z.ZodNumber;
822
+ }, z.core.$strip>>;
823
+ metric: z.ZodOptional<z.ZodString>;
824
+ value: z.ZodOptional<z.ZodNumber>;
825
+ threshold: z.ZodOptional<z.ZodNumber>;
826
+ excess: z.ZodNullable<z.ZodNumber>;
827
+ status: z.ZodOptional<z.ZodEnum<{
828
+ new: "new";
829
+ carryover: "carryover";
830
+ resolved: "resolved";
831
+ worsened: "worsened";
832
+ improved: "improved";
833
+ }>>;
834
+ message: z.ZodString;
835
+ provenance: z.ZodObject<{
836
+ kind: z.ZodEnum<{
837
+ measured: "measured";
838
+ derived: "derived";
839
+ model: "model";
840
+ }>;
841
+ source: z.ZodString;
842
+ at: z.ZodOptional<z.ZodString>;
843
+ }, z.core.$strip>;
844
+ }, z.core.$strip>>;
845
+ worsened: z.ZodArray<z.ZodObject<{
846
+ finding: z.ZodObject<{
847
+ id: z.ZodString;
848
+ snapshotId: z.ZodNumber;
849
+ rule: z.ZodString;
850
+ tool: z.ZodString;
851
+ severity: z.ZodString;
852
+ node: z.ZodObject<{
853
+ id: z.ZodString;
854
+ kind: z.ZodString;
855
+ name: z.ZodString;
856
+ path: z.ZodString;
857
+ span: z.ZodOptional<z.ZodObject<{
858
+ startLine: z.ZodNumber;
859
+ endLine: z.ZodNumber;
860
+ }, z.core.$strip>>;
861
+ }, z.core.$strip>;
862
+ destination: z.ZodOptional<z.ZodObject<{
863
+ id: z.ZodString;
864
+ kind: z.ZodString;
865
+ name: z.ZodString;
866
+ path: z.ZodString;
867
+ span: z.ZodOptional<z.ZodObject<{
868
+ startLine: z.ZodNumber;
869
+ endLine: z.ZodNumber;
870
+ }, z.core.$strip>>;
871
+ }, z.core.$strip>>;
872
+ range: z.ZodOptional<z.ZodObject<{
873
+ startLine: z.ZodNumber;
874
+ endLine: z.ZodNumber;
875
+ }, z.core.$strip>>;
876
+ metric: z.ZodOptional<z.ZodString>;
877
+ value: z.ZodOptional<z.ZodNumber>;
878
+ threshold: z.ZodOptional<z.ZodNumber>;
879
+ excess: z.ZodNullable<z.ZodNumber>;
880
+ status: z.ZodOptional<z.ZodEnum<{
881
+ new: "new";
882
+ carryover: "carryover";
883
+ resolved: "resolved";
884
+ worsened: "worsened";
885
+ improved: "improved";
886
+ }>>;
887
+ message: z.ZodString;
888
+ provenance: z.ZodObject<{
889
+ kind: z.ZodEnum<{
890
+ measured: "measured";
891
+ derived: "derived";
892
+ model: "model";
893
+ }>;
894
+ source: z.ZodString;
895
+ at: z.ZodOptional<z.ZodString>;
896
+ }, z.core.$strip>;
897
+ }, z.core.$strip>;
898
+ before: z.ZodNumber;
899
+ delta: z.ZodNumber;
900
+ }, z.core.$strip>>;
901
+ improved: z.ZodArray<z.ZodObject<{
902
+ finding: z.ZodObject<{
903
+ id: z.ZodString;
904
+ snapshotId: z.ZodNumber;
905
+ rule: z.ZodString;
906
+ tool: z.ZodString;
907
+ severity: z.ZodString;
908
+ node: z.ZodObject<{
909
+ id: z.ZodString;
910
+ kind: z.ZodString;
911
+ name: z.ZodString;
912
+ path: z.ZodString;
913
+ span: z.ZodOptional<z.ZodObject<{
914
+ startLine: z.ZodNumber;
915
+ endLine: z.ZodNumber;
916
+ }, z.core.$strip>>;
917
+ }, z.core.$strip>;
918
+ destination: z.ZodOptional<z.ZodObject<{
919
+ id: z.ZodString;
920
+ kind: z.ZodString;
921
+ name: z.ZodString;
922
+ path: z.ZodString;
923
+ span: z.ZodOptional<z.ZodObject<{
924
+ startLine: z.ZodNumber;
925
+ endLine: z.ZodNumber;
926
+ }, z.core.$strip>>;
927
+ }, z.core.$strip>>;
928
+ range: z.ZodOptional<z.ZodObject<{
929
+ startLine: z.ZodNumber;
930
+ endLine: z.ZodNumber;
931
+ }, z.core.$strip>>;
932
+ metric: z.ZodOptional<z.ZodString>;
933
+ value: z.ZodOptional<z.ZodNumber>;
934
+ threshold: z.ZodOptional<z.ZodNumber>;
935
+ excess: z.ZodNullable<z.ZodNumber>;
936
+ status: z.ZodOptional<z.ZodEnum<{
937
+ new: "new";
938
+ carryover: "carryover";
939
+ resolved: "resolved";
940
+ worsened: "worsened";
941
+ improved: "improved";
942
+ }>>;
943
+ message: z.ZodString;
944
+ provenance: z.ZodObject<{
945
+ kind: z.ZodEnum<{
946
+ measured: "measured";
947
+ derived: "derived";
948
+ model: "model";
949
+ }>;
950
+ source: z.ZodString;
951
+ at: z.ZodOptional<z.ZodString>;
952
+ }, z.core.$strip>;
953
+ }, z.core.$strip>;
954
+ before: z.ZodNumber;
955
+ delta: z.ZodNumber;
956
+ }, z.core.$strip>>;
957
+ resolved: z.ZodArray<z.ZodObject<{
958
+ id: z.ZodString;
959
+ snapshotId: z.ZodNumber;
960
+ rule: z.ZodString;
961
+ tool: z.ZodString;
962
+ severity: z.ZodString;
963
+ node: z.ZodObject<{
964
+ id: z.ZodString;
965
+ kind: z.ZodString;
966
+ name: z.ZodString;
967
+ path: z.ZodString;
968
+ span: z.ZodOptional<z.ZodObject<{
969
+ startLine: z.ZodNumber;
970
+ endLine: z.ZodNumber;
971
+ }, z.core.$strip>>;
972
+ }, z.core.$strip>;
973
+ destination: z.ZodOptional<z.ZodObject<{
974
+ id: z.ZodString;
975
+ kind: z.ZodString;
976
+ name: z.ZodString;
977
+ path: z.ZodString;
978
+ span: z.ZodOptional<z.ZodObject<{
979
+ startLine: z.ZodNumber;
980
+ endLine: z.ZodNumber;
981
+ }, z.core.$strip>>;
982
+ }, z.core.$strip>>;
983
+ range: z.ZodOptional<z.ZodObject<{
984
+ startLine: z.ZodNumber;
985
+ endLine: z.ZodNumber;
986
+ }, z.core.$strip>>;
987
+ metric: z.ZodOptional<z.ZodString>;
988
+ value: z.ZodOptional<z.ZodNumber>;
989
+ threshold: z.ZodOptional<z.ZodNumber>;
990
+ excess: z.ZodNullable<z.ZodNumber>;
991
+ status: z.ZodOptional<z.ZodEnum<{
992
+ new: "new";
993
+ carryover: "carryover";
994
+ resolved: "resolved";
995
+ worsened: "worsened";
996
+ improved: "improved";
997
+ }>>;
998
+ message: z.ZodString;
999
+ provenance: z.ZodObject<{
1000
+ kind: z.ZodEnum<{
1001
+ measured: "measured";
1002
+ derived: "derived";
1003
+ model: "model";
1004
+ }>;
1005
+ source: z.ZodString;
1006
+ at: z.ZodOptional<z.ZodString>;
1007
+ }, z.core.$strip>;
1008
+ }, z.core.$strip>>;
1009
+ }, z.core.$strip>;
1010
+ coupling: z.ZodObject<{
1011
+ measured: z.ZodBoolean;
1012
+ added: z.ZodArray<z.ZodObject<{
1013
+ a: z.ZodObject<{
1014
+ id: z.ZodString;
1015
+ kind: z.ZodString;
1016
+ name: z.ZodString;
1017
+ path: z.ZodString;
1018
+ span: z.ZodOptional<z.ZodObject<{
1019
+ startLine: z.ZodNumber;
1020
+ endLine: z.ZodNumber;
1021
+ }, z.core.$strip>>;
1022
+ }, z.core.$strip>;
1023
+ b: z.ZodObject<{
1024
+ id: z.ZodString;
1025
+ kind: z.ZodString;
1026
+ name: z.ZodString;
1027
+ path: z.ZodString;
1028
+ span: z.ZodOptional<z.ZodObject<{
1029
+ startLine: z.ZodNumber;
1030
+ endLine: z.ZodNumber;
1031
+ }, z.core.$strip>>;
1032
+ }, z.core.$strip>;
1033
+ count: z.ZodNumber;
1034
+ }, z.core.$strip>>;
1035
+ }, z.core.$strip>;
1036
+ regressions: z.ZodArray<z.ZodObject<{
1037
+ node: z.ZodObject<{
1038
+ id: z.ZodString;
1039
+ kind: z.ZodString;
1040
+ name: z.ZodString;
1041
+ path: z.ZodString;
1042
+ span: z.ZodOptional<z.ZodObject<{
1043
+ startLine: z.ZodNumber;
1044
+ endLine: z.ZodNumber;
1045
+ }, z.core.$strip>>;
1046
+ }, z.core.$strip>;
1047
+ before: z.ZodNumber;
1048
+ after: z.ZodNumber;
1049
+ delta: z.ZodNumber;
1050
+ findings: z.ZodArray<z.ZodString>;
1051
+ }, z.core.$strip>>;
1052
+ counts: z.ZodObject<{
1053
+ crossedCutoff: z.ZodNumber;
1054
+ newFiles: z.ZodNumber;
1055
+ newFindings: z.ZodNumber;
1056
+ worsened: z.ZodNumber;
1057
+ improved: z.ZodNumber;
1058
+ resolved: z.ZodNumber;
1059
+ newCoupling: z.ZodNumber;
1060
+ regressions: z.ZodNumber;
1061
+ }, z.core.$strip>;
1062
+ }, z.core.$strip>;
1063
+ };
1064
+ readonly "paths.impact": {
1065
+ readonly description: string;
1066
+ readonly args: z.ZodObject<{
1067
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1068
+ baseline: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1069
+ paths: z.ZodArray<z.ZodString>;
1070
+ root: z.ZodOptional<z.ZodString>;
1071
+ window: z.ZodDefault<z.ZodString>;
1072
+ }, z.core.$strip>;
1073
+ readonly result: z.ZodObject<{
1074
+ rows: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1075
+ status: z.ZodLiteral<"indexed">;
1076
+ input: z.ZodString;
1077
+ path: z.ZodString;
1078
+ node: z.ZodObject<{
1079
+ id: z.ZodString;
1080
+ kind: z.ZodString;
1081
+ name: z.ZodString;
1082
+ path: z.ZodString;
1083
+ span: z.ZodOptional<z.ZodObject<{
1084
+ startLine: z.ZodNumber;
1085
+ endLine: z.ZodNumber;
1086
+ }, z.core.$strip>>;
1087
+ }, z.core.$strip>;
1088
+ complexity: z.ZodNullable<z.ZodNumber>;
1089
+ hotspot: z.ZodObject<{
1090
+ score: z.ZodNumber;
1091
+ rank: z.ZodNullable<z.ZodNumber>;
1092
+ }, z.core.$strip>;
1093
+ findings: z.ZodArray<z.ZodObject<{
1094
+ id: z.ZodString;
1095
+ snapshotId: z.ZodNumber;
1096
+ rule: z.ZodString;
1097
+ tool: z.ZodString;
1098
+ severity: z.ZodString;
1099
+ node: z.ZodObject<{
1100
+ id: z.ZodString;
1101
+ kind: z.ZodString;
1102
+ name: z.ZodString;
1103
+ path: z.ZodString;
1104
+ span: z.ZodOptional<z.ZodObject<{
1105
+ startLine: z.ZodNumber;
1106
+ endLine: z.ZodNumber;
1107
+ }, z.core.$strip>>;
1108
+ }, z.core.$strip>;
1109
+ destination: z.ZodOptional<z.ZodObject<{
1110
+ id: z.ZodString;
1111
+ kind: z.ZodString;
1112
+ name: z.ZodString;
1113
+ path: z.ZodString;
1114
+ span: z.ZodOptional<z.ZodObject<{
1115
+ startLine: z.ZodNumber;
1116
+ endLine: z.ZodNumber;
1117
+ }, z.core.$strip>>;
1118
+ }, z.core.$strip>>;
1119
+ range: z.ZodOptional<z.ZodObject<{
1120
+ startLine: z.ZodNumber;
1121
+ endLine: z.ZodNumber;
1122
+ }, z.core.$strip>>;
1123
+ metric: z.ZodOptional<z.ZodString>;
1124
+ value: z.ZodOptional<z.ZodNumber>;
1125
+ threshold: z.ZodOptional<z.ZodNumber>;
1126
+ excess: z.ZodNullable<z.ZodNumber>;
1127
+ status: z.ZodOptional<z.ZodEnum<{
1128
+ new: "new";
1129
+ carryover: "carryover";
1130
+ resolved: "resolved";
1131
+ worsened: "worsened";
1132
+ improved: "improved";
1133
+ }>>;
1134
+ message: z.ZodString;
1135
+ provenance: z.ZodObject<{
1136
+ kind: z.ZodEnum<{
1137
+ measured: "measured";
1138
+ derived: "derived";
1139
+ model: "model";
1140
+ }>;
1141
+ source: z.ZodString;
1142
+ at: z.ZodOptional<z.ZodString>;
1143
+ }, z.core.$strip>;
1144
+ }, z.core.$strip>>;
1145
+ delta: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1146
+ inBaseline: z.ZodBoolean;
1147
+ scoreBefore: z.ZodNullable<z.ZodNumber>;
1148
+ score: z.ZodNullable<z.ZodNumber>;
1149
+ complexityBefore: z.ZodNullable<z.ZodNumber>;
1150
+ complexity: z.ZodNullable<z.ZodNumber>;
1151
+ findings: z.ZodObject<{
1152
+ new: z.ZodNumber;
1153
+ worsened: z.ZodNumber;
1154
+ improved: z.ZodNumber;
1155
+ resolved: z.ZodNumber;
1156
+ }, z.core.$strip>;
1157
+ }, z.core.$strip>>>;
1158
+ }, z.core.$strip>, z.ZodObject<{
1159
+ status: z.ZodLiteral<"not-indexed">;
1160
+ input: z.ZodString;
1161
+ path: z.ZodString;
1162
+ }, z.core.$strip>, z.ZodObject<{
1163
+ status: z.ZodLiteral<"outside-repo">;
1164
+ input: z.ZodString;
1165
+ }, z.core.$strip>], "status">>;
1166
+ ranked: z.ZodNumber;
1167
+ rollup: z.ZodObject<{
1168
+ indexed: z.ZodNumber;
1169
+ notIndexed: z.ZodNumber;
1170
+ outsideRepo: z.ZodNumber;
1171
+ score: z.ZodNumber;
1172
+ maxComplexity: z.ZodNullable<z.ZodNumber>;
1173
+ topRank: z.ZodNullable<z.ZodNumber>;
1174
+ openFindings: z.ZodNumber;
1175
+ delta: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1176
+ score: z.ZodNumber;
1177
+ findings: z.ZodObject<{
1178
+ new: z.ZodNumber;
1179
+ worsened: z.ZodNumber;
1180
+ improved: z.ZodNumber;
1181
+ resolved: z.ZodNumber;
1182
+ }, z.core.$strip>;
1183
+ }, z.core.$strip>>>;
1184
+ }, z.core.$strip>;
1185
+ baselineSnapshotId: z.ZodOptional<z.ZodNumber>;
1186
+ comparable: z.ZodOptional<z.ZodBoolean>;
1187
+ snapshotId: z.ZodNumber;
1188
+ }, z.core.$strip>;
1189
+ };
1190
+ readonly "packages.stats": {
1191
+ readonly description: string;
1192
+ readonly args: z.ZodObject<{
1193
+ snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
1194
+ packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
1195
+ }, z.core.$strip>;
1196
+ readonly result: z.ZodObject<{
1197
+ snapshotId: z.ZodNumber;
1198
+ packagesFrom: z.ZodEnum<{
1199
+ none: "none";
1200
+ args: "args";
1201
+ tiers: "tiers";
1202
+ }>;
1203
+ modularity: z.ZodNumber;
1204
+ totalEdges: z.ZodNumber;
1205
+ unassignedFiles: z.ZodNumber;
1206
+ packages: z.ZodArray<z.ZodObject<{
1207
+ id: z.ZodString;
1208
+ name: z.ZodString;
1209
+ fileCount: z.ZodNumber;
1210
+ internalEdges: z.ZodNumber;
1211
+ outgoingEdges: z.ZodNumber;
1212
+ incomingEdges: z.ZodNumber;
1213
+ cohesion: z.ZodNumber;
1214
+ instability: z.ZodNumber;
1215
+ abstractness: z.ZodNumber;
1216
+ band: z.ZodEnum<{
1217
+ foundation: "foundation";
1218
+ middle: "middle";
1219
+ top: "top";
1220
+ }>;
1221
+ flags: z.ZodArray<z.ZodString>;
1222
+ layer: z.ZodDiscriminatedUnion<[z.ZodObject<{
1223
+ status: z.ZodLiteral<"declared">;
1224
+ tier: z.ZodNumber;
1225
+ rule: z.ZodString;
1226
+ }, z.core.$strip>, z.ZodObject<{
1227
+ status: z.ZodLiteral<"undeclared">;
1228
+ }, z.core.$strip>], "status">;
1229
+ }, z.core.$strip>>;
1230
+ crossEdges: z.ZodArray<z.ZodObject<{
1231
+ from: z.ZodString;
1232
+ to: z.ZodString;
1233
+ edges: z.ZodNumber;
1234
+ intensity: z.ZodNumber;
1235
+ flag: z.ZodEnum<{
1236
+ none: "none";
1237
+ tight: "tight";
1238
+ moderate: "moderate";
1239
+ }>;
1240
+ }, z.core.$strip>>;
1241
+ }, z.core.$strip>;
1242
+ };
543
1243
  };
544
1244
  type CommandName = keyof typeof CONTRACT;
545
1245
  type CommandArgs<N extends CommandName> = z.output<(typeof CONTRACT)[N]["args"]>;
@@ -568,6 +1268,134 @@ declare function serializeContract(): SerializedContract;
568
1268
  /** The row cap on `hierarchy.get`; past it the result says `truncated` and the shallowest rows are kept. */
569
1269
  declare const HIERARCHY_ROW_CAP = 5000;
570
1270
 
1271
+ /** A declared symbol of the file; code-graph's dossier keeps the top 8 exported and the top 8 internal. */
1272
+ declare const ExportRow: z.ZodObject<{
1273
+ name: z.ZodString;
1274
+ utilization: z.ZodNumber;
1275
+ cognitive: z.ZodNullable<z.ZodNumber>;
1276
+ consumers: z.ZodNumber;
1277
+ exported: z.ZodBoolean;
1278
+ }, z.core.$strip>;
1279
+ /** The hotspot score at the node's grain, with the factors it multiplies; the factors are absent at a score of 0. */
1280
+ declare const ScoreBreakdown: z.ZodObject<{
1281
+ grain: z.ZodEnum<{
1282
+ symbol: "symbol";
1283
+ file: "file";
1284
+ }>;
1285
+ window: z.ZodString;
1286
+ score: z.ZodNumber;
1287
+ churn: z.ZodOptional<z.ZodNumber>;
1288
+ complexity: z.ZodOptional<z.ZodNumber>;
1289
+ recency: z.ZodOptional<z.ZodNumber>;
1290
+ utilization: z.ZodOptional<z.ZodNumber>;
1291
+ rank: z.ZodNullable<z.ZodNumber>;
1292
+ ranked: z.ZodNumber;
1293
+ }, z.core.$strip>;
1294
+ /** PageRank over files and structural edges, as the reading order ranks them; null for generated code, which it leaves out. */
1295
+ declare const Centrality: z.ZodObject<{
1296
+ score: z.ZodNullable<z.ZodNumber>;
1297
+ rank: z.ZodNullable<z.ZodNumber>;
1298
+ of: z.ZodNumber;
1299
+ }, z.core.$strip>;
1300
+ declare const CoupledPartners: z.ZodObject<{
1301
+ measured: z.ZodBoolean;
1302
+ partners: z.ZodArray<z.ZodObject<{
1303
+ node: z.ZodObject<{
1304
+ id: z.ZodString;
1305
+ kind: z.ZodString;
1306
+ name: z.ZodString;
1307
+ path: z.ZodString;
1308
+ span: z.ZodOptional<z.ZodObject<{
1309
+ startLine: z.ZodNumber;
1310
+ endLine: z.ZodNumber;
1311
+ }, z.core.$strip>>;
1312
+ }, z.core.$strip>;
1313
+ count: z.ZodNumber;
1314
+ }, z.core.$strip>>;
1315
+ }, z.core.$strip>;
1316
+ declare const LinkedTests: z.ZodObject<{
1317
+ tests: z.ZodArray<z.ZodObject<{
1318
+ id: z.ZodString;
1319
+ kind: z.ZodString;
1320
+ name: z.ZodString;
1321
+ path: z.ZodString;
1322
+ span: z.ZodOptional<z.ZodObject<{
1323
+ startLine: z.ZodNumber;
1324
+ endLine: z.ZodNumber;
1325
+ }, z.core.$strip>>;
1326
+ }, z.core.$strip>>;
1327
+ indexedCount: z.ZodNullable<z.ZodNumber>;
1328
+ coEditMeasured: z.ZodBoolean;
1329
+ }, z.core.$strip>;
1330
+ declare const NodeLens: z.ZodEnum<{
1331
+ score: "score";
1332
+ exports: "exports";
1333
+ centrality: "centrality";
1334
+ coupling: "coupling";
1335
+ tests: "tests";
1336
+ }>;
1337
+ type NodeLens = z.infer<typeof NodeLens>;
1338
+ /** Each requested lens; null when it does not describe the node's kind. Only `score` describes symbols; none describes directories. */
1339
+ declare const NodeLenses: z.ZodObject<{
1340
+ exports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1341
+ name: z.ZodString;
1342
+ utilization: z.ZodNumber;
1343
+ cognitive: z.ZodNullable<z.ZodNumber>;
1344
+ consumers: z.ZodNumber;
1345
+ exported: z.ZodBoolean;
1346
+ }, z.core.$strip>>>>;
1347
+ score: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1348
+ grain: z.ZodEnum<{
1349
+ symbol: "symbol";
1350
+ file: "file";
1351
+ }>;
1352
+ window: z.ZodString;
1353
+ score: z.ZodNumber;
1354
+ churn: z.ZodOptional<z.ZodNumber>;
1355
+ complexity: z.ZodOptional<z.ZodNumber>;
1356
+ recency: z.ZodOptional<z.ZodNumber>;
1357
+ utilization: z.ZodOptional<z.ZodNumber>;
1358
+ rank: z.ZodNullable<z.ZodNumber>;
1359
+ ranked: z.ZodNumber;
1360
+ }, z.core.$strip>>>;
1361
+ centrality: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1362
+ score: z.ZodNullable<z.ZodNumber>;
1363
+ rank: z.ZodNullable<z.ZodNumber>;
1364
+ of: z.ZodNumber;
1365
+ }, z.core.$strip>>>;
1366
+ coupling: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1367
+ measured: z.ZodBoolean;
1368
+ partners: z.ZodArray<z.ZodObject<{
1369
+ node: z.ZodObject<{
1370
+ id: z.ZodString;
1371
+ kind: z.ZodString;
1372
+ name: z.ZodString;
1373
+ path: z.ZodString;
1374
+ span: z.ZodOptional<z.ZodObject<{
1375
+ startLine: z.ZodNumber;
1376
+ endLine: z.ZodNumber;
1377
+ }, z.core.$strip>>;
1378
+ }, z.core.$strip>;
1379
+ count: z.ZodNumber;
1380
+ }, z.core.$strip>>;
1381
+ }, z.core.$strip>>>;
1382
+ tests: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1383
+ tests: z.ZodArray<z.ZodObject<{
1384
+ id: z.ZodString;
1385
+ kind: z.ZodString;
1386
+ name: z.ZodString;
1387
+ path: z.ZodString;
1388
+ span: z.ZodOptional<z.ZodObject<{
1389
+ startLine: z.ZodNumber;
1390
+ endLine: z.ZodNumber;
1391
+ }, z.core.$strip>>;
1392
+ }, z.core.$strip>>;
1393
+ indexedCount: z.ZodNullable<z.ZodNumber>;
1394
+ coEditMeasured: z.ZodBoolean;
1395
+ }, z.core.$strip>>>;
1396
+ }, z.core.$strip>;
1397
+ type NodeLenses = z.infer<typeof NodeLenses>;
1398
+
571
1399
  /** Most rows one `findings.list` page returns; a table pages with `offset`. */
572
1400
  declare const FINDINGS_PAGE_MAX = 500;
573
1401
  /** Most lines one excerpt carries, whatever the flagged range and context ask for. */
@@ -652,6 +1480,420 @@ declare const SourceExcerpt: z.ZodObject<{
652
1480
  }, z.core.$strip>;
653
1481
  type SourceExcerpt = z.infer<typeof SourceExcerpt>;
654
1482
 
1483
+ /** Most rows one `hotspots.list` page returns; a table pages with `offset`. */
1484
+ declare const HOTSPOTS_PAGE_MAX = 500;
1485
+ /** A window as metric descriptors name it: "30d", or "lifetime" for all of git history. code-graph stores 30d, 90d, and 180d by default. */
1486
+ declare const ChurnWindow: z.ZodString;
1487
+ declare const Hotspot: z.ZodObject<{
1488
+ node: z.ZodObject<{
1489
+ id: z.ZodString;
1490
+ kind: z.ZodString;
1491
+ name: z.ZodString;
1492
+ path: z.ZodString;
1493
+ span: z.ZodOptional<z.ZodObject<{
1494
+ startLine: z.ZodNumber;
1495
+ endLine: z.ZodNumber;
1496
+ }, z.core.$strip>>;
1497
+ }, z.core.$strip>;
1498
+ churn: z.ZodNumber;
1499
+ complexity: z.ZodNumber;
1500
+ recency: z.ZodNumber;
1501
+ score: z.ZodNumber;
1502
+ utilization: z.ZodOptional<z.ZodNumber>;
1503
+ baselineScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1504
+ mark: z.ZodOptional<z.ZodEnum<{
1505
+ new: "new";
1506
+ worsened: "worsened";
1507
+ }>>;
1508
+ }, z.core.$strip>;
1509
+ type Hotspot = z.infer<typeof Hotspot>;
1510
+ declare const HotspotMark: z.ZodEnum<{
1511
+ new: "new";
1512
+ worsened: "worsened";
1513
+ }>;
1514
+ type HotspotMark = z.infer<typeof HotspotMark>;
1515
+
1516
+ /** Most rows the reading order or the look-first list returns. */
1517
+ declare const OVERVIEW_ROWS_MAX = 50;
1518
+ /** One named signal of where attention is due, with the points the caller's weights give it. */
1519
+ declare const AttentionSignal: z.ZodObject<{
1520
+ key: z.ZodEnum<{
1521
+ findings: "findings";
1522
+ complexity: "complexity";
1523
+ hotspots: "hotspots";
1524
+ "hidden-coupling": "hidden-coupling";
1525
+ }>;
1526
+ label: z.ZodString;
1527
+ penalty: z.ZodNumber;
1528
+ cap: z.ZodNumber;
1529
+ measured: z.ZodBoolean;
1530
+ detail: z.ZodString;
1531
+ }, z.core.$strip>;
1532
+ type AttentionSignal = z.infer<typeof AttentionSignal>;
1533
+ declare const LookFirstRow: z.ZodObject<{
1534
+ node: z.ZodObject<{
1535
+ id: z.ZodString;
1536
+ kind: z.ZodString;
1537
+ name: z.ZodString;
1538
+ path: z.ZodString;
1539
+ span: z.ZodOptional<z.ZodObject<{
1540
+ startLine: z.ZodNumber;
1541
+ endLine: z.ZodNumber;
1542
+ }, z.core.$strip>>;
1543
+ }, z.core.$strip>;
1544
+ score: z.ZodNumber;
1545
+ churn: z.ZodNumber;
1546
+ complexity: z.ZodNumber;
1547
+ recency: z.ZodNumber;
1548
+ reasons: z.ZodArray<z.ZodEnum<{
1549
+ findings: "findings";
1550
+ "over-cutoff": "over-cutoff";
1551
+ "churn-complexity": "churn-complexity";
1552
+ }>>;
1553
+ }, z.core.$strip>;
1554
+ type LookFirstRow = z.infer<typeof LookFirstRow>;
1555
+ declare const ReadingOrderRow: z.ZodObject<{
1556
+ node: z.ZodObject<{
1557
+ id: z.ZodString;
1558
+ kind: z.ZodString;
1559
+ name: z.ZodString;
1560
+ path: z.ZodString;
1561
+ span: z.ZodOptional<z.ZodObject<{
1562
+ startLine: z.ZodNumber;
1563
+ endLine: z.ZodNumber;
1564
+ }, z.core.$strip>>;
1565
+ }, z.core.$strip>;
1566
+ centrality: z.ZodNumber;
1567
+ }, z.core.$strip>;
1568
+ type ReadingOrderRow = z.infer<typeof ReadingOrderRow>;
1569
+
1570
+ /** Most paths one `paths.impact` call takes. */
1571
+ declare const PATHS_IMPACT_MAX = 500;
1572
+ declare const PathImpact: z.ZodDiscriminatedUnion<[z.ZodObject<{
1573
+ status: z.ZodLiteral<"indexed">;
1574
+ input: z.ZodString;
1575
+ path: z.ZodString;
1576
+ node: z.ZodObject<{
1577
+ id: z.ZodString;
1578
+ kind: z.ZodString;
1579
+ name: z.ZodString;
1580
+ path: z.ZodString;
1581
+ span: z.ZodOptional<z.ZodObject<{
1582
+ startLine: z.ZodNumber;
1583
+ endLine: z.ZodNumber;
1584
+ }, z.core.$strip>>;
1585
+ }, z.core.$strip>;
1586
+ complexity: z.ZodNullable<z.ZodNumber>;
1587
+ hotspot: z.ZodObject<{
1588
+ score: z.ZodNumber;
1589
+ rank: z.ZodNullable<z.ZodNumber>;
1590
+ }, z.core.$strip>;
1591
+ findings: z.ZodArray<z.ZodObject<{
1592
+ id: z.ZodString;
1593
+ snapshotId: z.ZodNumber;
1594
+ rule: z.ZodString;
1595
+ tool: z.ZodString;
1596
+ severity: z.ZodString;
1597
+ node: z.ZodObject<{
1598
+ id: z.ZodString;
1599
+ kind: z.ZodString;
1600
+ name: z.ZodString;
1601
+ path: z.ZodString;
1602
+ span: z.ZodOptional<z.ZodObject<{
1603
+ startLine: z.ZodNumber;
1604
+ endLine: z.ZodNumber;
1605
+ }, z.core.$strip>>;
1606
+ }, z.core.$strip>;
1607
+ destination: z.ZodOptional<z.ZodObject<{
1608
+ id: z.ZodString;
1609
+ kind: z.ZodString;
1610
+ name: z.ZodString;
1611
+ path: z.ZodString;
1612
+ span: z.ZodOptional<z.ZodObject<{
1613
+ startLine: z.ZodNumber;
1614
+ endLine: z.ZodNumber;
1615
+ }, z.core.$strip>>;
1616
+ }, z.core.$strip>>;
1617
+ range: z.ZodOptional<z.ZodObject<{
1618
+ startLine: z.ZodNumber;
1619
+ endLine: z.ZodNumber;
1620
+ }, z.core.$strip>>;
1621
+ metric: z.ZodOptional<z.ZodString>;
1622
+ value: z.ZodOptional<z.ZodNumber>;
1623
+ threshold: z.ZodOptional<z.ZodNumber>;
1624
+ excess: z.ZodNullable<z.ZodNumber>;
1625
+ status: z.ZodOptional<z.ZodEnum<{
1626
+ new: "new";
1627
+ carryover: "carryover";
1628
+ resolved: "resolved";
1629
+ worsened: "worsened";
1630
+ improved: "improved";
1631
+ }>>;
1632
+ message: z.ZodString;
1633
+ provenance: z.ZodObject<{
1634
+ kind: z.ZodEnum<{
1635
+ measured: "measured";
1636
+ derived: "derived";
1637
+ model: "model";
1638
+ }>;
1639
+ source: z.ZodString;
1640
+ at: z.ZodOptional<z.ZodString>;
1641
+ }, z.core.$strip>;
1642
+ }, z.core.$strip>>;
1643
+ delta: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1644
+ inBaseline: z.ZodBoolean;
1645
+ scoreBefore: z.ZodNullable<z.ZodNumber>;
1646
+ score: z.ZodNullable<z.ZodNumber>;
1647
+ complexityBefore: z.ZodNullable<z.ZodNumber>;
1648
+ complexity: z.ZodNullable<z.ZodNumber>;
1649
+ findings: z.ZodObject<{
1650
+ new: z.ZodNumber;
1651
+ worsened: z.ZodNumber;
1652
+ improved: z.ZodNumber;
1653
+ resolved: z.ZodNumber;
1654
+ }, z.core.$strip>;
1655
+ }, z.core.$strip>>>;
1656
+ }, z.core.$strip>, z.ZodObject<{
1657
+ status: z.ZodLiteral<"not-indexed">;
1658
+ input: z.ZodString;
1659
+ path: z.ZodString;
1660
+ }, z.core.$strip>, z.ZodObject<{
1661
+ status: z.ZodLiteral<"outside-repo">;
1662
+ input: z.ZodString;
1663
+ }, z.core.$strip>], "status">;
1664
+ type PathImpact = z.infer<typeof PathImpact>;
1665
+ /** An indexed file against the baseline. Every `before` is null when the baseline does not hold the file. */
1666
+ declare const PathDelta: z.ZodObject<{
1667
+ inBaseline: z.ZodBoolean;
1668
+ scoreBefore: z.ZodNullable<z.ZodNumber>;
1669
+ score: z.ZodNullable<z.ZodNumber>;
1670
+ complexityBefore: z.ZodNullable<z.ZodNumber>;
1671
+ complexity: z.ZodNullable<z.ZodNumber>;
1672
+ findings: z.ZodObject<{
1673
+ new: z.ZodNumber;
1674
+ worsened: z.ZodNumber;
1675
+ improved: z.ZodNumber;
1676
+ resolved: z.ZodNumber;
1677
+ }, z.core.$strip>;
1678
+ }, z.core.$strip>;
1679
+ type PathDelta = z.infer<typeof PathDelta>;
1680
+ declare const PathHotspot: z.ZodObject<{
1681
+ score: z.ZodNumber;
1682
+ rank: z.ZodNullable<z.ZodNumber>;
1683
+ }, z.core.$strip>;
1684
+ type PathHotspot = z.infer<typeof PathHotspot>;
1685
+ /** A file's findings against the baseline, bucketed as `changes.get` buckets them; counts only. */
1686
+ declare const FindingDelta: z.ZodObject<{
1687
+ new: z.ZodNumber;
1688
+ worsened: z.ZodNumber;
1689
+ improved: z.ZodNumber;
1690
+ resolved: z.ZodNumber;
1691
+ }, z.core.$strip>;
1692
+ type FindingDelta = z.infer<typeof FindingDelta>;
1693
+ declare const ImpactRollup: z.ZodObject<{
1694
+ indexed: z.ZodNumber;
1695
+ notIndexed: z.ZodNumber;
1696
+ outsideRepo: z.ZodNumber;
1697
+ score: z.ZodNumber;
1698
+ maxComplexity: z.ZodNullable<z.ZodNumber>;
1699
+ topRank: z.ZodNullable<z.ZodNumber>;
1700
+ openFindings: z.ZodNumber;
1701
+ delta: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1702
+ score: z.ZodNumber;
1703
+ findings: z.ZodObject<{
1704
+ new: z.ZodNumber;
1705
+ worsened: z.ZodNumber;
1706
+ improved: z.ZodNumber;
1707
+ resolved: z.ZodNumber;
1708
+ }, z.core.$strip>;
1709
+ }, z.core.$strip>>>;
1710
+ }, z.core.$strip>;
1711
+ type ImpactRollup = z.infer<typeof ImpactRollup>;
1712
+
1713
+ /** Most package roots one `packages.stats` call takes. */
1714
+ declare const PACKAGES_MAX = 500;
1715
+ /** The package's tier in a `layered-deps` rule, 0 the lowest; a package no such rule names is `undeclared`. */
1716
+ declare const PackageLayer: z.ZodDiscriminatedUnion<[z.ZodObject<{
1717
+ status: z.ZodLiteral<"declared">;
1718
+ tier: z.ZodNumber;
1719
+ rule: z.ZodString;
1720
+ }, z.core.$strip>, z.ZodObject<{
1721
+ status: z.ZodLiteral<"undeclared">;
1722
+ }, z.core.$strip>], "status">;
1723
+ type PackageLayer = z.infer<typeof PackageLayer>;
1724
+ declare const PackageStatsRow: z.ZodObject<{
1725
+ id: z.ZodString;
1726
+ name: z.ZodString;
1727
+ fileCount: z.ZodNumber;
1728
+ internalEdges: z.ZodNumber;
1729
+ outgoingEdges: z.ZodNumber;
1730
+ incomingEdges: z.ZodNumber;
1731
+ cohesion: z.ZodNumber;
1732
+ instability: z.ZodNumber;
1733
+ abstractness: z.ZodNumber;
1734
+ band: z.ZodEnum<{
1735
+ foundation: "foundation";
1736
+ middle: "middle";
1737
+ top: "top";
1738
+ }>;
1739
+ flags: z.ZodArray<z.ZodString>;
1740
+ layer: z.ZodDiscriminatedUnion<[z.ZodObject<{
1741
+ status: z.ZodLiteral<"declared">;
1742
+ tier: z.ZodNumber;
1743
+ rule: z.ZodString;
1744
+ }, z.core.$strip>, z.ZodObject<{
1745
+ status: z.ZodLiteral<"undeclared">;
1746
+ }, z.core.$strip>], "status">;
1747
+ }, z.core.$strip>;
1748
+ type PackageStatsRow = z.infer<typeof PackageStatsRow>;
1749
+ /** Edges from one package into another, with their share of the source package's files. */
1750
+ declare const CrossEdge: z.ZodObject<{
1751
+ from: z.ZodString;
1752
+ to: z.ZodString;
1753
+ edges: z.ZodNumber;
1754
+ intensity: z.ZodNumber;
1755
+ flag: z.ZodEnum<{
1756
+ none: "none";
1757
+ tight: "tight";
1758
+ moderate: "moderate";
1759
+ }>;
1760
+ }, z.core.$strip>;
1761
+ type CrossEdge = z.infer<typeof CrossEdge>;
1762
+
1763
+ /** Most rows each list of a `changes.get` result returns; `counts` always holds the full sizes. */
1764
+ declare const CHANGES_ROWS_MAX = 500;
1765
+ /** A file present at both snapshots whose hotspot score moved; a file with no score counts as 0. */
1766
+ declare const ScoreChange: z.ZodObject<{
1767
+ node: z.ZodObject<{
1768
+ id: z.ZodString;
1769
+ kind: z.ZodString;
1770
+ name: z.ZodString;
1771
+ path: z.ZodString;
1772
+ span: z.ZodOptional<z.ZodObject<{
1773
+ startLine: z.ZodNumber;
1774
+ endLine: z.ZodNumber;
1775
+ }, z.core.$strip>>;
1776
+ }, z.core.$strip>;
1777
+ before: z.ZodNumber;
1778
+ after: z.ZodNumber;
1779
+ delta: z.ZodNumber;
1780
+ }, z.core.$strip>;
1781
+ type ScoreChange = z.infer<typeof ScoreChange>;
1782
+ declare const NewFile: z.ZodObject<{
1783
+ node: z.ZodObject<{
1784
+ id: z.ZodString;
1785
+ kind: z.ZodString;
1786
+ name: z.ZodString;
1787
+ path: z.ZodString;
1788
+ span: z.ZodOptional<z.ZodObject<{
1789
+ startLine: z.ZodNumber;
1790
+ endLine: z.ZodNumber;
1791
+ }, z.core.$strip>>;
1792
+ }, z.core.$strip>;
1793
+ score: z.ZodNumber;
1794
+ }, z.core.$strip>;
1795
+ type NewFile = z.infer<typeof NewFile>;
1796
+ /** A finding open at both snapshots whose measured value moved; `delta` is current value minus baseline value. */
1797
+ declare const FindingChange: z.ZodObject<{
1798
+ finding: z.ZodObject<{
1799
+ id: z.ZodString;
1800
+ snapshotId: z.ZodNumber;
1801
+ rule: z.ZodString;
1802
+ tool: z.ZodString;
1803
+ severity: z.ZodString;
1804
+ node: z.ZodObject<{
1805
+ id: z.ZodString;
1806
+ kind: z.ZodString;
1807
+ name: z.ZodString;
1808
+ path: z.ZodString;
1809
+ span: z.ZodOptional<z.ZodObject<{
1810
+ startLine: z.ZodNumber;
1811
+ endLine: z.ZodNumber;
1812
+ }, z.core.$strip>>;
1813
+ }, z.core.$strip>;
1814
+ destination: z.ZodOptional<z.ZodObject<{
1815
+ id: z.ZodString;
1816
+ kind: z.ZodString;
1817
+ name: z.ZodString;
1818
+ path: z.ZodString;
1819
+ span: z.ZodOptional<z.ZodObject<{
1820
+ startLine: z.ZodNumber;
1821
+ endLine: z.ZodNumber;
1822
+ }, z.core.$strip>>;
1823
+ }, z.core.$strip>>;
1824
+ range: z.ZodOptional<z.ZodObject<{
1825
+ startLine: z.ZodNumber;
1826
+ endLine: z.ZodNumber;
1827
+ }, z.core.$strip>>;
1828
+ metric: z.ZodOptional<z.ZodString>;
1829
+ value: z.ZodOptional<z.ZodNumber>;
1830
+ threshold: z.ZodOptional<z.ZodNumber>;
1831
+ excess: z.ZodNullable<z.ZodNumber>;
1832
+ status: z.ZodOptional<z.ZodEnum<{
1833
+ new: "new";
1834
+ carryover: "carryover";
1835
+ resolved: "resolved";
1836
+ worsened: "worsened";
1837
+ improved: "improved";
1838
+ }>>;
1839
+ message: z.ZodString;
1840
+ provenance: z.ZodObject<{
1841
+ kind: z.ZodEnum<{
1842
+ measured: "measured";
1843
+ derived: "derived";
1844
+ model: "model";
1845
+ }>;
1846
+ source: z.ZodString;
1847
+ at: z.ZodOptional<z.ZodString>;
1848
+ }, z.core.$strip>;
1849
+ }, z.core.$strip>;
1850
+ before: z.ZodNumber;
1851
+ delta: z.ZodNumber;
1852
+ }, z.core.$strip>;
1853
+ type FindingChange = z.infer<typeof FindingChange>;
1854
+ /** A file whose hotspot score rose since the baseline and that carries an open finding now. */
1855
+ declare const Regression: z.ZodObject<{
1856
+ node: z.ZodObject<{
1857
+ id: z.ZodString;
1858
+ kind: z.ZodString;
1859
+ name: z.ZodString;
1860
+ path: z.ZodString;
1861
+ span: z.ZodOptional<z.ZodObject<{
1862
+ startLine: z.ZodNumber;
1863
+ endLine: z.ZodNumber;
1864
+ }, z.core.$strip>>;
1865
+ }, z.core.$strip>;
1866
+ before: z.ZodNumber;
1867
+ after: z.ZodNumber;
1868
+ delta: z.ZodNumber;
1869
+ findings: z.ZodArray<z.ZodString>;
1870
+ }, z.core.$strip>;
1871
+ type Regression = z.infer<typeof Regression>;
1872
+ declare const CoChangePair: z.ZodObject<{
1873
+ a: z.ZodObject<{
1874
+ id: z.ZodString;
1875
+ kind: z.ZodString;
1876
+ name: z.ZodString;
1877
+ path: z.ZodString;
1878
+ span: z.ZodOptional<z.ZodObject<{
1879
+ startLine: z.ZodNumber;
1880
+ endLine: z.ZodNumber;
1881
+ }, z.core.$strip>>;
1882
+ }, z.core.$strip>;
1883
+ b: z.ZodObject<{
1884
+ id: z.ZodString;
1885
+ kind: z.ZodString;
1886
+ name: z.ZodString;
1887
+ path: z.ZodString;
1888
+ span: z.ZodOptional<z.ZodObject<{
1889
+ startLine: z.ZodNumber;
1890
+ endLine: z.ZodNumber;
1891
+ }, z.core.$strip>>;
1892
+ }, z.core.$strip>;
1893
+ count: z.ZodNumber;
1894
+ }, z.core.$strip>;
1895
+ type CoChangePair = z.infer<typeof CoChangePair>;
1896
+
655
1897
  /** Open string: "repo" | "package" | "directory" | "file" | "symbol" today; consumers tolerate unknown kinds. */
656
1898
  declare const NodeKind: z.ZodString;
657
1899
  /** Open string: "error" | "warning" | "info" today. */
@@ -797,6 +2039,8 @@ interface ModelRule {
797
2039
  type: string;
798
2040
  severity: string;
799
2041
  text: string;
2042
+ /** A `layered-deps` rule's tiers of package roots, lowest first; the repo's tier config. */
2043
+ layers?: readonly (readonly string[])[];
800
2044
  }
801
2045
  /** One check-rule violation, keyed by the ratchet's `violationKey`; `ranges` are the flagged lines, absent for a whole-node finding. */
802
2046
  interface ModelFinding {
@@ -886,6 +2130,8 @@ interface ReadSource {
886
2130
  model(snapshotId: number): ReadModel;
887
2131
  /** A file's text at the snapshot; absent when the source holds no source text at all. */
888
2132
  readSource?(snapshotId: number, path: string): SourceRead;
2133
+ /** The directory the snapshots were indexed from; absent or null when the source does not know it (a static export). */
2134
+ repoRoot?: string | null;
889
2135
  }
890
2136
  /** A failure carrying the sysexits code every surface reports, so the registry's `describeError` maps it as is. */
891
2137
  declare class ReadError extends Error {
@@ -927,10 +2173,42 @@ declare function getNode(source: ReadSource, args: CommandArgs<"node.get">): Nod
927
2173
  /** `node.resolve`: a path, path:line, symbol name, or qualified id to ranked candidate nodes. */
928
2174
  declare function resolveNode(source: ReadSource, args: CommandArgs<"node.resolve">): CommandResult<"node.resolve">;
929
2175
 
930
- type ListArgs = CommandArgs<"findings.list">;
931
- type ListResult = CommandResult<"findings.list">;
2176
+ type ListArgs$1 = CommandArgs<"findings.list">;
2177
+ type ListResult$1 = CommandResult<"findings.list">;
932
2178
  /** `findings.list`: a snapshot's findings, filtered, ordered by a total order, and cut to one page. */
933
- declare function listFindings(source: ReadSource, args: ListArgs): ListResult;
2179
+ declare function listFindings(source: ReadSource, args: ListArgs$1): ListResult$1;
2180
+
2181
+ type ListArgs = CommandArgs<"hotspots.list">;
2182
+ type ListResult = CommandResult<"hotspots.list">;
2183
+ /** `hotspots.list`: a snapshot's hotspots at one grain, cut at `cutoff`, optionally marked against a baseline, and paged. */
2184
+ declare function listHotspots(source: ReadSource, args: ListArgs): ListResult;
2185
+
2186
+ type OverviewArgs = CommandArgs<"overview.get">;
2187
+ type OverviewResult = CommandResult<"overview.get">;
2188
+ /** `overview.get`: KPIs, weighted attention signals, the reading order, and where to look first, for one snapshot. */
2189
+ declare function getOverview(source: ReadSource, args: OverviewArgs): OverviewResult;
2190
+
2191
+ type ChangesArgs = CommandArgs<"changes.get">;
2192
+ type ChangesResult = CommandResult<"changes.get">;
2193
+ /** `changes.get`: what moved between a baseline snapshot and this one, or `comparable: false` across index versions. */
2194
+ declare function getChanges(source: ReadSource, args: ChangesArgs): ChangesResult;
2195
+
2196
+ type ImpactArgs = CommandArgs<"paths.impact">;
2197
+ type ImpactResult = CommandResult<"paths.impact">;
2198
+ /** Repo-relative form of a path, or null when it lies outside the repo. Absolute paths count only under `root`. */
2199
+ declare function repoRelative(input: string, root: string | undefined): string | null;
2200
+ /** `paths.impact`: complexity, hotspot rank, and open findings for each given file, optionally against a baseline. */
2201
+ declare function pathsImpact(source: ReadSource, args: ImpactArgs): ImpactResult;
2202
+
2203
+ type StatsArgs = CommandArgs<"packages.stats">;
2204
+ type StatsResult = CommandResult<"packages.stats">;
2205
+ type Declared = Extract<PackageLayer, {
2206
+ status: "declared";
2207
+ }>;
2208
+ /** Package root to its tier; a root two rules name keeps the first rule's tier. */
2209
+ declare function declaredTiers(rules: readonly ModelRule[]): Map<string, Declared>;
2210
+ /** `packages.stats`: code-graph's partition quality over the package roots, each with its declared tier. */
2211
+ declare function packagesStats(source: ReadSource, args: StatsArgs): StatsResult;
934
2212
 
935
2213
  type GetResult = CommandResult<"finding.get">;
936
2214
  /** Findings shown beside the one asked for: the same node's, then the same rule's on graph neighbours. */
@@ -950,4 +2228,4 @@ type QueryResolver = (name: string, args: unknown) => JsonEnvelope<unknown>;
950
2228
  /** Validate, run, and envelope one command against a source, exactly as the daemon's registry does. */
951
2229
  declare function createQueryResolver(source: ReadSource): QueryResolver;
952
2230
 
953
- export { AGENT_COMMANDS, CODE_READ_API_VERSION, COMMAND_NAMES, CONTRACT, Capabilities, type CatalogueEntry, type CodeReadCommandMap, type CommandArgs, type CommandContract, type CommandInput, type CommandName, type CommandResult, EXCERPT_LINE_CAP, FINDINGS_PAGE_MAX, Finding, FindingStatus, HIERARCHY_ROW_CAP, MetricDescriptor, type MetricValue, type Missing, MissingReason, type ModelAlias, type ModelEdge, type ModelFinding, type ModelMetric, type ModelNode, type ModelRule, NodeKind, NodeRef, Provenance, ProvenanceKind, QUERIES, type QueryFn, type QueryResolver, RELATED_CAP, ReadError, type ReadModel, type ReadModelParts, type ReadSource, RuleSummary, type SerializedContract, Severity, SnapshotInfo, SnapshotRef, SourceExcerpt, type SourceFacts, type SourceOrigin, type SourceRead, type SourceWindow, Span, buildReadModel, createQueryResolver, describeApi, excessOf, findingNotFound, getFinding, getHierarchy, getNeighbors, getNode, invalidArgs, listFindings, listSnapshots, nodeNotFound, resolveNode, resolveSnapshot, serializeContract, snapshotNotFound };
2231
+ export { AGENT_COMMANDS, AttentionSignal, CHANGES_ROWS_MAX, CODE_READ_API_VERSION, COMMAND_NAMES, CONTRACT, Capabilities, type CatalogueEntry, Centrality, ChurnWindow, CoChangePair, type CodeReadCommandMap, type CommandArgs, type CommandContract, type CommandInput, type CommandName, type CommandResult, CoupledPartners, CrossEdge, EXCERPT_LINE_CAP, ExportRow, FINDINGS_PAGE_MAX, Finding, FindingChange, FindingDelta, FindingStatus, HIERARCHY_ROW_CAP, HOTSPOTS_PAGE_MAX, Hotspot, HotspotMark, ImpactRollup, LinkedTests, LookFirstRow, MetricDescriptor, type MetricValue, type Missing, MissingReason, type ModelAlias, type ModelEdge, type ModelFinding, type ModelMetric, type ModelNode, type ModelRule, NewFile, NodeKind, NodeLens, NodeLenses, NodeRef, OVERVIEW_ROWS_MAX, PACKAGES_MAX, PATHS_IMPACT_MAX, PackageLayer, PackageStatsRow, PathDelta, PathHotspot, PathImpact, Provenance, ProvenanceKind, QUERIES, type QueryFn, type QueryResolver, RELATED_CAP, ReadError, type ReadModel, type ReadModelParts, type ReadSource, ReadingOrderRow, Regression, RuleSummary, ScoreBreakdown, ScoreChange, type SerializedContract, Severity, SnapshotInfo, SnapshotRef, SourceExcerpt, type SourceFacts, type SourceOrigin, type SourceRead, type SourceWindow, Span, buildReadModel, createQueryResolver, declaredTiers, describeApi, excessOf, findingNotFound, getChanges, getFinding, getHierarchy, getNeighbors, getNode, getOverview, invalidArgs, listFindings, listHotspots, listSnapshots, nodeNotFound, packagesStats, pathsImpact, repoRelative, resolveNode, resolveSnapshot, serializeContract, snapshotNotFound };