@phosphorco/bb-thread-metrics 0.2.0 → 0.2.1

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.
@@ -1,16 +1,20 @@
1
1
  import type { BbPluginApi } from '@get-bb/plugin-sdk';
2
2
  import type { PluginBrowserBbSdk } from '@get-bb/plugin-sdk/app';
3
+ import type { HeatSettingsPort } from './index.js';
3
4
  import type { RecentSnapshotInput, RecentSnapshotResult, ReadInput, ReadResult, DetailInput, DetailResult, Capabilities, OwnerErrorKind } from './index.js';
4
5
  export type MetricsSdk = {
5
6
  readonly plugins: Pick<BbPluginApi['sdk']['plugins'], 'list' | 'callRpc'>;
6
7
  } | {
7
8
  readonly plugins: Pick<PluginBrowserBbSdk['plugins'], 'list' | 'callRpc'>;
8
9
  };
10
+ export declare function registerHeatSettingsOwner(bb: Pick<BbPluginApi, 'rpc'>, port: HeatSettingsPort): void;
11
+ export declare function createHeatSettingsClient(sdk: MetricsSdk, pluginId: string): HeatSettingsPort;
9
12
  export interface MetricsPort {
10
13
  capabilities: Capabilities;
11
14
  read(input: ReadInput): Promise<ReadResult>;
12
15
  detail?(input: DetailInput): Promise<DetailResult>;
13
16
  recentSnapshot?(input: RecentSnapshotInput): Promise<RecentSnapshotResult>;
17
+ heatSettings?: HeatSettingsPort;
14
18
  }
15
19
  export declare function registerThreadMetricsOwner(bb: Pick<BbPluginApi, 'rpc'>, port: MetricsPort): void;
16
20
  export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: string): {
@@ -53,6 +57,35 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
53
57
  };
54
58
  schemaVersion: 2;
55
59
  providerWeights: Record<string, number>;
60
+ lifetimeEnabled?: boolean | undefined;
61
+ } | {
62
+ mode: "percentile";
63
+ gates: {
64
+ m20: number;
65
+ h24: number;
66
+ d7: number;
67
+ };
68
+ schemaVersion: 3;
69
+ domain: {
70
+ version: 1;
71
+ kind: "root-family";
72
+ };
73
+ providerWeights: Record<string, number>;
74
+ } | {
75
+ mode: "absolute";
76
+ thresholds: {
77
+ m20: number;
78
+ h24: number;
79
+ d7: number;
80
+ lifetime: number;
81
+ };
82
+ schemaVersion: 3;
83
+ domain: {
84
+ version: 1;
85
+ kind: "root-family";
86
+ };
87
+ providerWeights: Record<string, number>;
88
+ lifetimeEnabled?: false | undefined;
56
89
  };
57
90
  };
58
91
  coverage: "complete" | "partial" | "unknown";
@@ -284,6 +317,236 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
284
317
  h24: number | null;
285
318
  d7: number | null;
286
319
  };
320
+ usage?: {
321
+ windows: {
322
+ m20: {
323
+ kind: "estimate";
324
+ value: {
325
+ inputUncached: number;
326
+ cacheRead: number;
327
+ cacheWrite: number;
328
+ output: number;
329
+ };
330
+ } | {
331
+ kind: "floor";
332
+ value: {
333
+ inputUncached: number;
334
+ cacheRead: number;
335
+ cacheWrite: number;
336
+ output: number;
337
+ };
338
+ } | {
339
+ kind: "unavailable";
340
+ value: null;
341
+ };
342
+ h24: {
343
+ kind: "estimate";
344
+ value: {
345
+ inputUncached: number;
346
+ cacheRead: number;
347
+ cacheWrite: number;
348
+ output: number;
349
+ };
350
+ } | {
351
+ kind: "floor";
352
+ value: {
353
+ inputUncached: number;
354
+ cacheRead: number;
355
+ cacheWrite: number;
356
+ output: number;
357
+ };
358
+ } | {
359
+ kind: "unavailable";
360
+ value: null;
361
+ };
362
+ d7: {
363
+ kind: "estimate";
364
+ value: {
365
+ inputUncached: number;
366
+ cacheRead: number;
367
+ cacheWrite: number;
368
+ output: number;
369
+ };
370
+ } | {
371
+ kind: "floor";
372
+ value: {
373
+ inputUncached: number;
374
+ cacheRead: number;
375
+ cacheWrite: number;
376
+ output: number;
377
+ };
378
+ } | {
379
+ kind: "unavailable";
380
+ value: null;
381
+ };
382
+ lifetime: {
383
+ kind: "estimate";
384
+ value: {
385
+ inputUncached: number;
386
+ cacheRead: number;
387
+ cacheWrite: number;
388
+ output: number;
389
+ };
390
+ } | {
391
+ kind: "floor";
392
+ value: {
393
+ inputUncached: number;
394
+ cacheRead: number;
395
+ cacheWrite: number;
396
+ output: number;
397
+ };
398
+ } | {
399
+ kind: "unavailable";
400
+ value: null;
401
+ };
402
+ };
403
+ providers: {
404
+ providerId: string;
405
+ windows: {
406
+ m20: {
407
+ kind: "estimate";
408
+ value: {
409
+ inputUncached: number;
410
+ cacheRead: number;
411
+ cacheWrite: number;
412
+ output: number;
413
+ };
414
+ } | {
415
+ kind: "floor";
416
+ value: {
417
+ inputUncached: number;
418
+ cacheRead: number;
419
+ cacheWrite: number;
420
+ output: number;
421
+ };
422
+ } | {
423
+ kind: "unavailable";
424
+ value: null;
425
+ };
426
+ h24: {
427
+ kind: "estimate";
428
+ value: {
429
+ inputUncached: number;
430
+ cacheRead: number;
431
+ cacheWrite: number;
432
+ output: number;
433
+ };
434
+ } | {
435
+ kind: "floor";
436
+ value: {
437
+ inputUncached: number;
438
+ cacheRead: number;
439
+ cacheWrite: number;
440
+ output: number;
441
+ };
442
+ } | {
443
+ kind: "unavailable";
444
+ value: null;
445
+ };
446
+ d7: {
447
+ kind: "estimate";
448
+ value: {
449
+ inputUncached: number;
450
+ cacheRead: number;
451
+ cacheWrite: number;
452
+ output: number;
453
+ };
454
+ } | {
455
+ kind: "floor";
456
+ value: {
457
+ inputUncached: number;
458
+ cacheRead: number;
459
+ cacheWrite: number;
460
+ output: number;
461
+ };
462
+ } | {
463
+ kind: "unavailable";
464
+ value: null;
465
+ };
466
+ lifetime: {
467
+ kind: "estimate";
468
+ value: {
469
+ inputUncached: number;
470
+ cacheRead: number;
471
+ cacheWrite: number;
472
+ output: number;
473
+ };
474
+ } | {
475
+ kind: "floor";
476
+ value: {
477
+ inputUncached: number;
478
+ cacheRead: number;
479
+ cacheWrite: number;
480
+ output: number;
481
+ };
482
+ } | {
483
+ kind: "unavailable";
484
+ value: null;
485
+ };
486
+ };
487
+ }[];
488
+ omittedProviders: number;
489
+ descendants: {
490
+ count: number;
491
+ exact: boolean;
492
+ };
493
+ } | undefined;
494
+ attribution?: {
495
+ unknownProvider: {
496
+ m20: {
497
+ kind: "estimate";
498
+ amount: number;
499
+ } | {
500
+ kind: "floor";
501
+ amount: number;
502
+ } | {
503
+ kind: "unavailable";
504
+ amount: null;
505
+ };
506
+ h24: {
507
+ kind: "estimate";
508
+ amount: number;
509
+ } | {
510
+ kind: "floor";
511
+ amount: number;
512
+ } | {
513
+ kind: "unavailable";
514
+ amount: null;
515
+ };
516
+ d7: {
517
+ kind: "estimate";
518
+ amount: number;
519
+ } | {
520
+ kind: "floor";
521
+ amount: number;
522
+ } | {
523
+ kind: "unavailable";
524
+ amount: null;
525
+ };
526
+ lifetime: {
527
+ kind: "estimate";
528
+ amount: number;
529
+ } | {
530
+ kind: "floor";
531
+ amount: number;
532
+ } | {
533
+ kind: "unavailable";
534
+ amount: null;
535
+ };
536
+ };
537
+ attributionComplete: {
538
+ m20: boolean;
539
+ h24: boolean;
540
+ d7: boolean;
541
+ lifetime: boolean;
542
+ };
543
+ unpriced: {
544
+ m20: boolean;
545
+ h24: boolean;
546
+ d7: boolean;
547
+ lifetime: boolean;
548
+ };
549
+ } | undefined;
287
550
  };
288
551
  family: {
289
552
  memberCount: number;
@@ -438,8 +701,799 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
438
701
  h24: number | null;
439
702
  d7: number | null;
440
703
  };
704
+ usage?: {
705
+ windows: {
706
+ m20: {
707
+ kind: "estimate";
708
+ value: {
709
+ inputUncached: number;
710
+ cacheRead: number;
711
+ cacheWrite: number;
712
+ output: number;
713
+ };
714
+ } | {
715
+ kind: "floor";
716
+ value: {
717
+ inputUncached: number;
718
+ cacheRead: number;
719
+ cacheWrite: number;
720
+ output: number;
721
+ };
722
+ } | {
723
+ kind: "unavailable";
724
+ value: null;
725
+ };
726
+ h24: {
727
+ kind: "estimate";
728
+ value: {
729
+ inputUncached: number;
730
+ cacheRead: number;
731
+ cacheWrite: number;
732
+ output: number;
733
+ };
734
+ } | {
735
+ kind: "floor";
736
+ value: {
737
+ inputUncached: number;
738
+ cacheRead: number;
739
+ cacheWrite: number;
740
+ output: number;
741
+ };
742
+ } | {
743
+ kind: "unavailable";
744
+ value: null;
745
+ };
746
+ d7: {
747
+ kind: "estimate";
748
+ value: {
749
+ inputUncached: number;
750
+ cacheRead: number;
751
+ cacheWrite: number;
752
+ output: number;
753
+ };
754
+ } | {
755
+ kind: "floor";
756
+ value: {
757
+ inputUncached: number;
758
+ cacheRead: number;
759
+ cacheWrite: number;
760
+ output: number;
761
+ };
762
+ } | {
763
+ kind: "unavailable";
764
+ value: null;
765
+ };
766
+ lifetime: {
767
+ kind: "estimate";
768
+ value: {
769
+ inputUncached: number;
770
+ cacheRead: number;
771
+ cacheWrite: number;
772
+ output: number;
773
+ };
774
+ } | {
775
+ kind: "floor";
776
+ value: {
777
+ inputUncached: number;
778
+ cacheRead: number;
779
+ cacheWrite: number;
780
+ output: number;
781
+ };
782
+ } | {
783
+ kind: "unavailable";
784
+ value: null;
785
+ };
786
+ };
787
+ providers: {
788
+ providerId: string;
789
+ windows: {
790
+ m20: {
791
+ kind: "estimate";
792
+ value: {
793
+ inputUncached: number;
794
+ cacheRead: number;
795
+ cacheWrite: number;
796
+ output: number;
797
+ };
798
+ } | {
799
+ kind: "floor";
800
+ value: {
801
+ inputUncached: number;
802
+ cacheRead: number;
803
+ cacheWrite: number;
804
+ output: number;
805
+ };
806
+ } | {
807
+ kind: "unavailable";
808
+ value: null;
809
+ };
810
+ h24: {
811
+ kind: "estimate";
812
+ value: {
813
+ inputUncached: number;
814
+ cacheRead: number;
815
+ cacheWrite: number;
816
+ output: number;
817
+ };
818
+ } | {
819
+ kind: "floor";
820
+ value: {
821
+ inputUncached: number;
822
+ cacheRead: number;
823
+ cacheWrite: number;
824
+ output: number;
825
+ };
826
+ } | {
827
+ kind: "unavailable";
828
+ value: null;
829
+ };
830
+ d7: {
831
+ kind: "estimate";
832
+ value: {
833
+ inputUncached: number;
834
+ cacheRead: number;
835
+ cacheWrite: number;
836
+ output: number;
837
+ };
838
+ } | {
839
+ kind: "floor";
840
+ value: {
841
+ inputUncached: number;
842
+ cacheRead: number;
843
+ cacheWrite: number;
844
+ output: number;
845
+ };
846
+ } | {
847
+ kind: "unavailable";
848
+ value: null;
849
+ };
850
+ lifetime: {
851
+ kind: "estimate";
852
+ value: {
853
+ inputUncached: number;
854
+ cacheRead: number;
855
+ cacheWrite: number;
856
+ output: number;
857
+ };
858
+ } | {
859
+ kind: "floor";
860
+ value: {
861
+ inputUncached: number;
862
+ cacheRead: number;
863
+ cacheWrite: number;
864
+ output: number;
865
+ };
866
+ } | {
867
+ kind: "unavailable";
868
+ value: null;
869
+ };
870
+ };
871
+ }[];
872
+ omittedProviders: number;
873
+ descendants: {
874
+ count: number;
875
+ exact: boolean;
876
+ };
877
+ } | undefined;
878
+ attribution?: {
879
+ unknownProvider: {
880
+ m20: {
881
+ kind: "estimate";
882
+ amount: number;
883
+ } | {
884
+ kind: "floor";
885
+ amount: number;
886
+ } | {
887
+ kind: "unavailable";
888
+ amount: null;
889
+ };
890
+ h24: {
891
+ kind: "estimate";
892
+ amount: number;
893
+ } | {
894
+ kind: "floor";
895
+ amount: number;
896
+ } | {
897
+ kind: "unavailable";
898
+ amount: null;
899
+ };
900
+ d7: {
901
+ kind: "estimate";
902
+ amount: number;
903
+ } | {
904
+ kind: "floor";
905
+ amount: number;
906
+ } | {
907
+ kind: "unavailable";
908
+ amount: null;
909
+ };
910
+ lifetime: {
911
+ kind: "estimate";
912
+ amount: number;
913
+ } | {
914
+ kind: "floor";
915
+ amount: number;
916
+ } | {
917
+ kind: "unavailable";
918
+ amount: null;
919
+ };
920
+ };
921
+ attributionComplete: {
922
+ m20: boolean;
923
+ h24: boolean;
924
+ d7: boolean;
925
+ lifetime: boolean;
926
+ };
927
+ unpriced: {
928
+ m20: boolean;
929
+ h24: boolean;
930
+ d7: boolean;
931
+ lifetime: boolean;
932
+ };
933
+ } | undefined;
441
934
  };
935
+ presentation?: {
936
+ title: string | null;
937
+ navigation: {
938
+ kind: "personal";
939
+ } | {
940
+ kind: "project";
941
+ projectId: string;
942
+ } | null;
943
+ } | undefined;
944
+ heat?: {
945
+ topology: {
946
+ kind: "attested";
947
+ parentThreadId: string | null;
948
+ lifecycleOwnerThreadId: string | null;
949
+ deleted: boolean;
950
+ } | {
951
+ kind: "unknown";
952
+ reasons: string[];
953
+ };
954
+ rootDollarRanks: {
955
+ m20: number | null;
956
+ h24: number | null;
957
+ d7: number | null;
958
+ };
959
+ rootScoreRanks: {
960
+ m20: number | null;
961
+ h24: number | null;
962
+ d7: number | null;
963
+ };
964
+ decisions: {
965
+ contextRevision: string;
966
+ signals: {
967
+ m20: {
968
+ decision: "unavailable" | "qualifies" | "below" | "suppressed";
969
+ reason: "deleted" | "threshold-met" | "below-threshold" | "gate-met" | "below-gate" | "not-root" | "topology-unknown" | "unsupported-value" | "zero" | "insufficient-population" | "rank-unavailable" | "context-unavailable";
970
+ };
971
+ h24: {
972
+ decision: "unavailable" | "qualifies" | "below" | "suppressed";
973
+ reason: "deleted" | "threshold-met" | "below-threshold" | "gate-met" | "below-gate" | "not-root" | "topology-unknown" | "unsupported-value" | "zero" | "insufficient-population" | "rank-unavailable" | "context-unavailable";
974
+ };
975
+ d7: {
976
+ decision: "unavailable" | "qualifies" | "below" | "suppressed";
977
+ reason: "deleted" | "threshold-met" | "below-threshold" | "gate-met" | "below-gate" | "not-root" | "topology-unknown" | "unsupported-value" | "zero" | "insufficient-population" | "rank-unavailable" | "context-unavailable";
978
+ };
979
+ };
980
+ winner: "on-fire" | "hot" | "heavy" | null;
981
+ };
982
+ } | undefined;
442
983
  }[];
984
+ publication?: {
985
+ instance: string;
986
+ sequence: number;
987
+ } | undefined;
988
+ heat?: {
989
+ version: 1;
990
+ domain: {
991
+ version: 1;
992
+ kind: "root-family";
993
+ };
994
+ contextRevision: string;
995
+ configRevision: string;
996
+ topologyRevision: string;
997
+ rankRevision: string;
998
+ rankAsOf: number;
999
+ windows: {
1000
+ m20: {
1001
+ start: number;
1002
+ end: number;
1003
+ };
1004
+ h24: {
1005
+ start: number;
1006
+ end: number;
1007
+ };
1008
+ d7: {
1009
+ start: number;
1010
+ end: number;
1011
+ };
1012
+ };
1013
+ population: {
1014
+ dollars: {
1015
+ m20: {
1016
+ count: number;
1017
+ coverage: "complete" | "partial" | "unknown";
1018
+ reasons: string[];
1019
+ };
1020
+ h24: {
1021
+ count: number;
1022
+ coverage: "complete" | "partial" | "unknown";
1023
+ reasons: string[];
1024
+ };
1025
+ d7: {
1026
+ count: number;
1027
+ coverage: "complete" | "partial" | "unknown";
1028
+ reasons: string[];
1029
+ };
1030
+ };
1031
+ scores: {
1032
+ m20: {
1033
+ count: number;
1034
+ coverage: "complete" | "partial" | "unknown";
1035
+ reasons: string[];
1036
+ };
1037
+ h24: {
1038
+ count: number;
1039
+ coverage: "complete" | "partial" | "unknown";
1040
+ reasons: string[];
1041
+ };
1042
+ d7: {
1043
+ count: number;
1044
+ coverage: "complete" | "partial" | "unknown";
1045
+ reasons: string[];
1046
+ };
1047
+ };
1048
+ };
1049
+ } | undefined;
1050
+ heatInputs?: {
1051
+ contextRevision: string;
1052
+ topologyRevision: string;
1053
+ cohortComplete: boolean;
1054
+ pending: number;
1055
+ omitted: {
1056
+ count: number;
1057
+ exact: boolean;
1058
+ };
1059
+ rows: {
1060
+ threadId: string;
1061
+ asOf: number;
1062
+ configRevision: string;
1063
+ family: {
1064
+ memberCount: number;
1065
+ coverage: "complete" | "partial" | "unknown";
1066
+ coverageReasons: string[];
1067
+ priceVersion: string;
1068
+ approximation: {
1069
+ approximate: boolean;
1070
+ reasons: ("closest-model" | "provider-default" | "model-attribution" | "bucket-boundary" | "missing-price" | "source-gap")[];
1071
+ };
1072
+ windows: {
1073
+ m20: {
1074
+ kind: "estimate";
1075
+ amount: number;
1076
+ } | {
1077
+ kind: "floor";
1078
+ amount: number;
1079
+ } | {
1080
+ kind: "unavailable";
1081
+ amount: null;
1082
+ };
1083
+ h24: {
1084
+ kind: "estimate";
1085
+ amount: number;
1086
+ } | {
1087
+ kind: "floor";
1088
+ amount: number;
1089
+ } | {
1090
+ kind: "unavailable";
1091
+ amount: null;
1092
+ };
1093
+ d7: {
1094
+ kind: "estimate";
1095
+ amount: number;
1096
+ } | {
1097
+ kind: "floor";
1098
+ amount: number;
1099
+ } | {
1100
+ kind: "unavailable";
1101
+ amount: null;
1102
+ };
1103
+ lifetime: {
1104
+ kind: "estimate";
1105
+ amount: number;
1106
+ } | {
1107
+ kind: "floor";
1108
+ amount: number;
1109
+ } | {
1110
+ kind: "unavailable";
1111
+ amount: null;
1112
+ };
1113
+ };
1114
+ scores: {
1115
+ m20: {
1116
+ kind: "estimate";
1117
+ amount: number;
1118
+ } | {
1119
+ kind: "floor";
1120
+ amount: number;
1121
+ } | {
1122
+ kind: "unavailable";
1123
+ amount: null;
1124
+ };
1125
+ h24: {
1126
+ kind: "estimate";
1127
+ amount: number;
1128
+ } | {
1129
+ kind: "floor";
1130
+ amount: number;
1131
+ } | {
1132
+ kind: "unavailable";
1133
+ amount: null;
1134
+ };
1135
+ d7: {
1136
+ kind: "estimate";
1137
+ amount: number;
1138
+ } | {
1139
+ kind: "floor";
1140
+ amount: number;
1141
+ } | {
1142
+ kind: "unavailable";
1143
+ amount: null;
1144
+ };
1145
+ lifetime: {
1146
+ kind: "estimate";
1147
+ amount: number;
1148
+ } | {
1149
+ kind: "floor";
1150
+ amount: number;
1151
+ } | {
1152
+ kind: "unavailable";
1153
+ amount: null;
1154
+ };
1155
+ };
1156
+ providers: {
1157
+ providerId: string;
1158
+ windows: {
1159
+ m20: {
1160
+ kind: "estimate";
1161
+ amount: number;
1162
+ } | {
1163
+ kind: "floor";
1164
+ amount: number;
1165
+ } | {
1166
+ kind: "unavailable";
1167
+ amount: null;
1168
+ };
1169
+ h24: {
1170
+ kind: "estimate";
1171
+ amount: number;
1172
+ } | {
1173
+ kind: "floor";
1174
+ amount: number;
1175
+ } | {
1176
+ kind: "unavailable";
1177
+ amount: null;
1178
+ };
1179
+ d7: {
1180
+ kind: "estimate";
1181
+ amount: number;
1182
+ } | {
1183
+ kind: "floor";
1184
+ amount: number;
1185
+ } | {
1186
+ kind: "unavailable";
1187
+ amount: null;
1188
+ };
1189
+ lifetime: {
1190
+ kind: "estimate";
1191
+ amount: number;
1192
+ } | {
1193
+ kind: "floor";
1194
+ amount: number;
1195
+ } | {
1196
+ kind: "unavailable";
1197
+ amount: null;
1198
+ };
1199
+ };
1200
+ approximation: {
1201
+ approximate: boolean;
1202
+ reasons: ("closest-model" | "provider-default" | "model-attribution" | "bucket-boundary" | "missing-price" | "source-gap")[];
1203
+ };
1204
+ }[];
1205
+ omittedProviders: number;
1206
+ dollarRanks: {
1207
+ m20: number | null;
1208
+ h24: number | null;
1209
+ d7: number | null;
1210
+ };
1211
+ scoreRanks: {
1212
+ m20: number | null;
1213
+ h24: number | null;
1214
+ d7: number | null;
1215
+ };
1216
+ usage?: {
1217
+ windows: {
1218
+ m20: {
1219
+ kind: "estimate";
1220
+ value: {
1221
+ inputUncached: number;
1222
+ cacheRead: number;
1223
+ cacheWrite: number;
1224
+ output: number;
1225
+ };
1226
+ } | {
1227
+ kind: "floor";
1228
+ value: {
1229
+ inputUncached: number;
1230
+ cacheRead: number;
1231
+ cacheWrite: number;
1232
+ output: number;
1233
+ };
1234
+ } | {
1235
+ kind: "unavailable";
1236
+ value: null;
1237
+ };
1238
+ h24: {
1239
+ kind: "estimate";
1240
+ value: {
1241
+ inputUncached: number;
1242
+ cacheRead: number;
1243
+ cacheWrite: number;
1244
+ output: number;
1245
+ };
1246
+ } | {
1247
+ kind: "floor";
1248
+ value: {
1249
+ inputUncached: number;
1250
+ cacheRead: number;
1251
+ cacheWrite: number;
1252
+ output: number;
1253
+ };
1254
+ } | {
1255
+ kind: "unavailable";
1256
+ value: null;
1257
+ };
1258
+ d7: {
1259
+ kind: "estimate";
1260
+ value: {
1261
+ inputUncached: number;
1262
+ cacheRead: number;
1263
+ cacheWrite: number;
1264
+ output: number;
1265
+ };
1266
+ } | {
1267
+ kind: "floor";
1268
+ value: {
1269
+ inputUncached: number;
1270
+ cacheRead: number;
1271
+ cacheWrite: number;
1272
+ output: number;
1273
+ };
1274
+ } | {
1275
+ kind: "unavailable";
1276
+ value: null;
1277
+ };
1278
+ lifetime: {
1279
+ kind: "estimate";
1280
+ value: {
1281
+ inputUncached: number;
1282
+ cacheRead: number;
1283
+ cacheWrite: number;
1284
+ output: number;
1285
+ };
1286
+ } | {
1287
+ kind: "floor";
1288
+ value: {
1289
+ inputUncached: number;
1290
+ cacheRead: number;
1291
+ cacheWrite: number;
1292
+ output: number;
1293
+ };
1294
+ } | {
1295
+ kind: "unavailable";
1296
+ value: null;
1297
+ };
1298
+ };
1299
+ providers: {
1300
+ providerId: string;
1301
+ windows: {
1302
+ m20: {
1303
+ kind: "estimate";
1304
+ value: {
1305
+ inputUncached: number;
1306
+ cacheRead: number;
1307
+ cacheWrite: number;
1308
+ output: number;
1309
+ };
1310
+ } | {
1311
+ kind: "floor";
1312
+ value: {
1313
+ inputUncached: number;
1314
+ cacheRead: number;
1315
+ cacheWrite: number;
1316
+ output: number;
1317
+ };
1318
+ } | {
1319
+ kind: "unavailable";
1320
+ value: null;
1321
+ };
1322
+ h24: {
1323
+ kind: "estimate";
1324
+ value: {
1325
+ inputUncached: number;
1326
+ cacheRead: number;
1327
+ cacheWrite: number;
1328
+ output: number;
1329
+ };
1330
+ } | {
1331
+ kind: "floor";
1332
+ value: {
1333
+ inputUncached: number;
1334
+ cacheRead: number;
1335
+ cacheWrite: number;
1336
+ output: number;
1337
+ };
1338
+ } | {
1339
+ kind: "unavailable";
1340
+ value: null;
1341
+ };
1342
+ d7: {
1343
+ kind: "estimate";
1344
+ value: {
1345
+ inputUncached: number;
1346
+ cacheRead: number;
1347
+ cacheWrite: number;
1348
+ output: number;
1349
+ };
1350
+ } | {
1351
+ kind: "floor";
1352
+ value: {
1353
+ inputUncached: number;
1354
+ cacheRead: number;
1355
+ cacheWrite: number;
1356
+ output: number;
1357
+ };
1358
+ } | {
1359
+ kind: "unavailable";
1360
+ value: null;
1361
+ };
1362
+ lifetime: {
1363
+ kind: "estimate";
1364
+ value: {
1365
+ inputUncached: number;
1366
+ cacheRead: number;
1367
+ cacheWrite: number;
1368
+ output: number;
1369
+ };
1370
+ } | {
1371
+ kind: "floor";
1372
+ value: {
1373
+ inputUncached: number;
1374
+ cacheRead: number;
1375
+ cacheWrite: number;
1376
+ output: number;
1377
+ };
1378
+ } | {
1379
+ kind: "unavailable";
1380
+ value: null;
1381
+ };
1382
+ };
1383
+ }[];
1384
+ omittedProviders: number;
1385
+ descendants: {
1386
+ count: number;
1387
+ exact: boolean;
1388
+ };
1389
+ } | undefined;
1390
+ attribution?: {
1391
+ unknownProvider: {
1392
+ m20: {
1393
+ kind: "estimate";
1394
+ amount: number;
1395
+ } | {
1396
+ kind: "floor";
1397
+ amount: number;
1398
+ } | {
1399
+ kind: "unavailable";
1400
+ amount: null;
1401
+ };
1402
+ h24: {
1403
+ kind: "estimate";
1404
+ amount: number;
1405
+ } | {
1406
+ kind: "floor";
1407
+ amount: number;
1408
+ } | {
1409
+ kind: "unavailable";
1410
+ amount: null;
1411
+ };
1412
+ d7: {
1413
+ kind: "estimate";
1414
+ amount: number;
1415
+ } | {
1416
+ kind: "floor";
1417
+ amount: number;
1418
+ } | {
1419
+ kind: "unavailable";
1420
+ amount: null;
1421
+ };
1422
+ lifetime: {
1423
+ kind: "estimate";
1424
+ amount: number;
1425
+ } | {
1426
+ kind: "floor";
1427
+ amount: number;
1428
+ } | {
1429
+ kind: "unavailable";
1430
+ amount: null;
1431
+ };
1432
+ };
1433
+ attributionComplete: {
1434
+ m20: boolean;
1435
+ h24: boolean;
1436
+ d7: boolean;
1437
+ lifetime: boolean;
1438
+ };
1439
+ unpriced: {
1440
+ m20: boolean;
1441
+ h24: boolean;
1442
+ d7: boolean;
1443
+ lifetime: boolean;
1444
+ };
1445
+ } | undefined;
1446
+ };
1447
+ heat: {
1448
+ topology: {
1449
+ kind: "attested";
1450
+ parentThreadId: string | null;
1451
+ lifecycleOwnerThreadId: string | null;
1452
+ deleted: boolean;
1453
+ } | {
1454
+ kind: "unknown";
1455
+ reasons: string[];
1456
+ };
1457
+ rootDollarRanks: {
1458
+ m20: number | null;
1459
+ h24: number | null;
1460
+ d7: number | null;
1461
+ };
1462
+ rootScoreRanks: {
1463
+ m20: number | null;
1464
+ h24: number | null;
1465
+ d7: number | null;
1466
+ };
1467
+ decisions: {
1468
+ contextRevision: string;
1469
+ signals: {
1470
+ m20: {
1471
+ decision: "unavailable" | "qualifies" | "below" | "suppressed";
1472
+ reason: "deleted" | "threshold-met" | "below-threshold" | "gate-met" | "below-gate" | "not-root" | "topology-unknown" | "unsupported-value" | "zero" | "insufficient-population" | "rank-unavailable" | "context-unavailable";
1473
+ };
1474
+ h24: {
1475
+ decision: "unavailable" | "qualifies" | "below" | "suppressed";
1476
+ reason: "deleted" | "threshold-met" | "below-threshold" | "gate-met" | "below-gate" | "not-root" | "topology-unknown" | "unsupported-value" | "zero" | "insufficient-population" | "rank-unavailable" | "context-unavailable";
1477
+ };
1478
+ d7: {
1479
+ decision: "unavailable" | "qualifies" | "below" | "suppressed";
1480
+ reason: "deleted" | "threshold-met" | "below-threshold" | "gate-met" | "below-gate" | "not-root" | "topology-unknown" | "unsupported-value" | "zero" | "insufficient-population" | "rank-unavailable" | "context-unavailable";
1481
+ };
1482
+ };
1483
+ winner: "on-fire" | "hot" | "heavy" | null;
1484
+ };
1485
+ };
1486
+ presentation?: {
1487
+ title: string | null;
1488
+ navigation: {
1489
+ kind: "personal";
1490
+ } | {
1491
+ kind: "project";
1492
+ projectId: string;
1493
+ } | null;
1494
+ } | undefined;
1495
+ }[];
1496
+ } | undefined;
443
1497
  } | {
444
1498
  version: 1;
445
1499
  revision: string;
@@ -491,7 +1545,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
491
1545
  scope: "own" | "family";
492
1546
  memberCount: number;
493
1547
  coverage: "complete" | "partial" | "unknown";
494
- coverageReasons: ("source-gap" | "unpriced" | "root-unattested" | "history-unavailable" | "missing-thread" | "member-cap" | "depth-cap" | "edge-cap" | "retention" | "row-cap" | "pagination" | "population-incomplete")[];
1548
+ coverageReasons: ("unpriced" | "source-gap" | "root-unattested" | "history-unavailable" | "missing-thread" | "member-cap" | "depth-cap" | "edge-cap" | "retention" | "row-cap" | "pagination" | "population-incomplete")[];
495
1549
  asOf: number;
496
1550
  revision: string;
497
1551
  priceVersion: string;
@@ -504,7 +1558,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
504
1558
  providerId: string;
505
1559
  modelId: string;
506
1560
  rateId: string | null;
507
- basis: "closest-model" | "provider-default" | "unpriced" | "matched";
1561
+ basis: "unpriced" | "closest-model" | "provider-default" | "matched";
508
1562
  }[] | undefined;
509
1563
  };
510
1564
  ranks: {
@@ -545,7 +1599,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
545
1599
  scope: "own" | "family";
546
1600
  memberCount: number;
547
1601
  coverage: "complete" | "partial" | "unknown";
548
- coverageReasons: ("source-gap" | "unpriced" | "root-unattested" | "history-unavailable" | "missing-thread" | "member-cap" | "depth-cap" | "edge-cap" | "retention" | "row-cap" | "pagination" | "population-incomplete")[];
1602
+ coverageReasons: ("unpriced" | "source-gap" | "root-unattested" | "history-unavailable" | "missing-thread" | "member-cap" | "depth-cap" | "edge-cap" | "retention" | "row-cap" | "pagination" | "population-incomplete")[];
549
1603
  asOf: number;
550
1604
  revision: string;
551
1605
  priceVersion: string;
@@ -558,7 +1612,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
558
1612
  providerId: string;
559
1613
  modelId: string;
560
1614
  rateId: string | null;
561
- basis: "closest-model" | "provider-default" | "unpriced" | "matched";
1615
+ basis: "unpriced" | "closest-model" | "provider-default" | "matched";
562
1616
  }[] | undefined;
563
1617
  };
564
1618
  ranks: {
@@ -605,7 +1659,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
605
1659
  currency: "USD";
606
1660
  estimated: true;
607
1661
  coverage: "complete" | "partial" | "unknown";
608
- coverageReasons: ("source-gap" | "unpriced" | "root-unattested" | "history-unavailable" | "missing-thread" | "member-cap" | "depth-cap" | "edge-cap" | "retention" | "row-cap" | "pagination" | "population-incomplete")[];
1662
+ coverageReasons: ("unpriced" | "source-gap" | "root-unattested" | "history-unavailable" | "missing-thread" | "member-cap" | "depth-cap" | "edge-cap" | "retention" | "row-cap" | "pagination" | "population-incomplete")[];
609
1663
  approximation: {
610
1664
  approximate: boolean;
611
1665
  reasons: ("closest-model" | "provider-default" | "model-attribution" | "bucket-boundary" | "missing-price" | "source-gap")[];
@@ -613,7 +1667,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
613
1667
  providerId: string;
614
1668
  modelId: string;
615
1669
  rateId: string | null;
616
- basis: "closest-model" | "provider-default" | "unpriced" | "matched";
1670
+ basis: "unpriced" | "closest-model" | "provider-default" | "matched";
617
1671
  }[] | undefined;
618
1672
  };
619
1673
  total: {
@@ -643,7 +1697,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
643
1697
  providerId: string;
644
1698
  modelId: string;
645
1699
  rateId: string | null;
646
- basis: "closest-model" | "provider-default" | "unpriced" | "matched";
1700
+ basis: "unpriced" | "closest-model" | "provider-default" | "matched";
647
1701
  }[] | undefined;
648
1702
  };
649
1703
  } | {
@@ -664,7 +1718,7 @@ export declare function createThreadMetricsClient(sdk: MetricsSdk, pluginId: str
664
1718
  providerId: string;
665
1719
  modelId: string;
666
1720
  rateId: string | null;
667
- basis: "closest-model" | "provider-default" | "unpriced" | "matched";
1721
+ basis: "unpriced" | "closest-model" | "provider-default" | "matched";
668
1722
  }[] | undefined;
669
1723
  };
670
1724
  })[];
@@ -708,3 +1762,5 @@ export declare function createThreadMetricsDiscovery(sdk: MetricsSdk): {
708
1762
  readonly outstandingReads: number;
709
1763
  discover(options?: Omit<DiscoveryOptions, "sdk">): Promise<DiscoveryResult>;
710
1764
  };
1765
+ export { createRecentSnapshotSession, RecentSnapshotSessionError, RecentSnapshotNotStarted } from './recent-session.js';
1766
+ export type { RecentSnapshotSource, RecentSnapshotObservation, RecentSnapshotSession, RecentSessionClock, RecentSessionFailure } from './recent-session.js';