@wrenautomation/birdwatch 0.30.2 → 0.30.3

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.
@@ -9,15 +9,15 @@ export type From = z.infer<typeof From>;
9
9
  /** The steps, in order. An edge's `to` names one of the first five. */
10
10
  export declare const Step: z.ZodEnum<{
11
11
  check: "check";
12
+ extract: "extract";
12
13
  plan: "plan";
13
14
  fetch: "fetch";
14
15
  triage: "triage";
15
16
  read: "read";
16
- extract: "extract";
17
17
  review: "review";
18
18
  }>;
19
19
  export type Step = z.infer<typeof Step>;
20
- export declare const STEPS: ("check" | "plan" | "fetch" | "triage" | "read" | "extract" | "review")[];
20
+ export declare const STEPS: ("check" | "extract" | "plan" | "fetch" | "triage" | "read" | "review")[];
21
21
  export declare const RECORD_TYPES: readonly ["query", "hit", "document", "finding", "verdict", "call", "spend", "snapshot", "edge", "done", "steer", "gap", "check", "pattern", "found", "draft", "class", "dead", "judge", "person"];
22
22
  export declare const RecordType: z.ZodEnum<{
23
23
  check: "check";
@@ -49,11 +49,11 @@ export declare const Envelope: z.ZodObject<{
49
49
  round: z.ZodNumber;
50
50
  step: z.ZodOptional<z.ZodEnum<{
51
51
  check: "check";
52
+ extract: "extract";
52
53
  plan: "plan";
53
54
  fetch: "fetch";
54
55
  triage: "triage";
55
56
  read: "read";
56
- extract: "extract";
57
57
  review: "review";
58
58
  }>>;
59
59
  at: z.ZodString;
@@ -81,11 +81,11 @@ export declare const QueryRecord: z.ZodObject<{
81
81
  round: z.ZodNumber;
82
82
  step: z.ZodOptional<z.ZodEnum<{
83
83
  check: "check";
84
+ extract: "extract";
84
85
  plan: "plan";
85
86
  fetch: "fetch";
86
87
  triage: "triage";
87
88
  read: "read";
88
- extract: "extract";
89
89
  review: "review";
90
90
  }>>;
91
91
  at: z.ZodString;
@@ -128,11 +128,11 @@ export declare const HitRecord: z.ZodObject<{
128
128
  round: z.ZodNumber;
129
129
  step: z.ZodOptional<z.ZodEnum<{
130
130
  check: "check";
131
+ extract: "extract";
131
132
  plan: "plan";
132
133
  fetch: "fetch";
133
134
  triage: "triage";
134
135
  read: "read";
135
- extract: "extract";
136
136
  review: "review";
137
137
  }>>;
138
138
  at: z.ZodString;
@@ -162,11 +162,11 @@ export declare const DocumentRecord: z.ZodObject<{
162
162
  round: z.ZodNumber;
163
163
  step: z.ZodOptional<z.ZodEnum<{
164
164
  check: "check";
165
+ extract: "extract";
165
166
  plan: "plan";
166
167
  fetch: "fetch";
167
168
  triage: "triage";
168
169
  read: "read";
169
- extract: "extract";
170
170
  review: "review";
171
171
  }>>;
172
172
  at: z.ZodString;
@@ -200,11 +200,11 @@ export declare const FindingRecord: z.ZodObject<{
200
200
  round: z.ZodNumber;
201
201
  step: z.ZodOptional<z.ZodEnum<{
202
202
  check: "check";
203
+ extract: "extract";
203
204
  plan: "plan";
204
205
  fetch: "fetch";
205
206
  triage: "triage";
206
207
  read: "read";
207
- extract: "extract";
208
208
  review: "review";
209
209
  }>>;
210
210
  at: z.ZodString;
@@ -239,11 +239,11 @@ export declare const VerdictRecord: z.ZodObject<{
239
239
  round: z.ZodNumber;
240
240
  step: z.ZodOptional<z.ZodEnum<{
241
241
  check: "check";
242
+ extract: "extract";
242
243
  plan: "plan";
243
244
  fetch: "fetch";
244
245
  triage: "triage";
245
246
  read: "read";
246
- extract: "extract";
247
247
  review: "review";
248
248
  }>>;
249
249
  at: z.ZodString;
@@ -274,11 +274,11 @@ export declare const CallRecord: z.ZodObject<{
274
274
  round: z.ZodNumber;
275
275
  step: z.ZodOptional<z.ZodEnum<{
276
276
  check: "check";
277
+ extract: "extract";
277
278
  plan: "plan";
278
279
  fetch: "fetch";
279
280
  triage: "triage";
280
281
  read: "read";
281
- extract: "extract";
282
282
  review: "review";
283
283
  }>>;
284
284
  at: z.ZodString;
@@ -310,11 +310,11 @@ export declare const SpendRecord: z.ZodObject<{
310
310
  round: z.ZodNumber;
311
311
  step: z.ZodOptional<z.ZodEnum<{
312
312
  check: "check";
313
+ extract: "extract";
313
314
  plan: "plan";
314
315
  fetch: "fetch";
315
316
  triage: "triage";
316
317
  read: "read";
317
- extract: "extract";
318
318
  review: "review";
319
319
  }>>;
320
320
  at: z.ZodString;
@@ -356,11 +356,11 @@ export declare const SnapshotRecord: z.ZodObject<{
356
356
  round: z.ZodNumber;
357
357
  step: z.ZodOptional<z.ZodEnum<{
358
358
  check: "check";
359
+ extract: "extract";
359
360
  plan: "plan";
360
361
  fetch: "fetch";
361
362
  triage: "triage";
362
363
  read: "read";
363
- extract: "extract";
364
364
  review: "review";
365
365
  }>>;
366
366
  at: z.ZodString;
@@ -420,11 +420,11 @@ export declare const EdgeRecord: z.ZodObject<{
420
420
  round: z.ZodNumber;
421
421
  step: z.ZodOptional<z.ZodEnum<{
422
422
  check: "check";
423
+ extract: "extract";
423
424
  plan: "plan";
424
425
  fetch: "fetch";
425
426
  triage: "triage";
426
427
  read: "read";
427
- extract: "extract";
428
428
  review: "review";
429
429
  }>>;
430
430
  at: z.ZodString;
@@ -442,11 +442,11 @@ export declare const EdgeRecord: z.ZodObject<{
442
442
  back: "back";
443
443
  }>;
444
444
  to: z.ZodOptional<z.ZodEnum<{
445
+ extract: "extract";
445
446
  plan: "plan";
446
447
  fetch: "fetch";
447
448
  triage: "triage";
448
449
  read: "read";
449
- extract: "extract";
450
450
  }>>;
451
451
  }, z.core.$strip>;
452
452
  export type EdgeRecord = z.infer<typeof EdgeRecord>;
@@ -465,11 +465,11 @@ export declare const DoneRecord: z.ZodObject<{
465
465
  type: z.ZodLiteral<"done">;
466
466
  step: z.ZodEnum<{
467
467
  check: "check";
468
+ extract: "extract";
468
469
  plan: "plan";
469
470
  fetch: "fetch";
470
471
  triage: "triage";
471
472
  read: "read";
472
- extract: "extract";
473
473
  review: "review";
474
474
  }>;
475
475
  ok: z.ZodBoolean;
@@ -486,11 +486,11 @@ export declare const SteerRecord: z.ZodObject<{
486
486
  round: z.ZodNumber;
487
487
  step: z.ZodOptional<z.ZodEnum<{
488
488
  check: "check";
489
+ extract: "extract";
489
490
  plan: "plan";
490
491
  fetch: "fetch";
491
492
  triage: "triage";
492
493
  read: "read";
493
- extract: "extract";
494
494
  review: "review";
495
495
  }>>;
496
496
  at: z.ZodString;
@@ -515,11 +515,11 @@ export declare const GapRecord: z.ZodObject<{
515
515
  round: z.ZodNumber;
516
516
  step: z.ZodOptional<z.ZodEnum<{
517
517
  check: "check";
518
+ extract: "extract";
518
519
  plan: "plan";
519
520
  fetch: "fetch";
520
521
  triage: "triage";
521
522
  read: "read";
522
- extract: "extract";
523
523
  review: "review";
524
524
  }>>;
525
525
  at: z.ZodString;
@@ -544,11 +544,11 @@ export declare const CheckRecord: z.ZodObject<{
544
544
  round: z.ZodNumber;
545
545
  step: z.ZodOptional<z.ZodEnum<{
546
546
  check: "check";
547
+ extract: "extract";
547
548
  plan: "plan";
548
549
  fetch: "fetch";
549
550
  triage: "triage";
550
551
  read: "read";
551
- extract: "extract";
552
552
  review: "review";
553
553
  }>>;
554
554
  at: z.ZodString;
@@ -575,11 +575,11 @@ export declare const PatternRecord: z.ZodObject<{
575
575
  round: z.ZodNumber;
576
576
  step: z.ZodOptional<z.ZodEnum<{
577
577
  check: "check";
578
+ extract: "extract";
578
579
  plan: "plan";
579
580
  fetch: "fetch";
580
581
  triage: "triage";
581
582
  read: "read";
582
- extract: "extract";
583
583
  review: "review";
584
584
  }>>;
585
585
  at: z.ZodString;
@@ -605,11 +605,11 @@ export declare const FoundRecord: z.ZodObject<{
605
605
  round: z.ZodNumber;
606
606
  step: z.ZodOptional<z.ZodEnum<{
607
607
  check: "check";
608
+ extract: "extract";
608
609
  plan: "plan";
609
610
  fetch: "fetch";
610
611
  triage: "triage";
611
612
  read: "read";
612
- extract: "extract";
613
613
  review: "review";
614
614
  }>>;
615
615
  at: z.ZodString;
@@ -636,11 +636,11 @@ export declare const DraftRecord: z.ZodObject<{
636
636
  round: z.ZodNumber;
637
637
  step: z.ZodOptional<z.ZodEnum<{
638
638
  check: "check";
639
+ extract: "extract";
639
640
  plan: "plan";
640
641
  fetch: "fetch";
641
642
  triage: "triage";
642
643
  read: "read";
643
- extract: "extract";
644
644
  review: "review";
645
645
  }>>;
646
646
  at: z.ZodString;
@@ -686,11 +686,11 @@ export declare const ClassRecord: z.ZodObject<{
686
686
  round: z.ZodNumber;
687
687
  step: z.ZodOptional<z.ZodEnum<{
688
688
  check: "check";
689
+ extract: "extract";
689
690
  plan: "plan";
690
691
  fetch: "fetch";
691
692
  triage: "triage";
692
693
  read: "read";
693
- extract: "extract";
694
694
  review: "review";
695
695
  }>>;
696
696
  at: z.ZodString;
@@ -724,11 +724,11 @@ export declare const DeadRecord: z.ZodObject<{
724
724
  round: z.ZodNumber;
725
725
  step: z.ZodOptional<z.ZodEnum<{
726
726
  check: "check";
727
+ extract: "extract";
727
728
  plan: "plan";
728
729
  fetch: "fetch";
729
730
  triage: "triage";
730
731
  read: "read";
731
- extract: "extract";
732
732
  review: "review";
733
733
  }>>;
734
734
  at: z.ZodString;
@@ -754,11 +754,11 @@ export declare const JudgeRecord: z.ZodObject<{
754
754
  round: z.ZodNumber;
755
755
  step: z.ZodOptional<z.ZodEnum<{
756
756
  check: "check";
757
+ extract: "extract";
757
758
  plan: "plan";
758
759
  fetch: "fetch";
759
760
  triage: "triage";
760
761
  read: "read";
761
- extract: "extract";
762
762
  review: "review";
763
763
  }>>;
764
764
  at: z.ZodString;
@@ -784,11 +784,11 @@ export declare const PersonRecord: z.ZodObject<{
784
784
  round: z.ZodNumber;
785
785
  step: z.ZodOptional<z.ZodEnum<{
786
786
  check: "check";
787
+ extract: "extract";
787
788
  plan: "plan";
788
789
  fetch: "fetch";
789
790
  triage: "triage";
790
791
  read: "read";
791
- extract: "extract";
792
792
  review: "review";
793
793
  }>>;
794
794
  at: z.ZodString;
@@ -811,11 +811,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
811
811
  round: z.ZodNumber;
812
812
  step: z.ZodOptional<z.ZodEnum<{
813
813
  check: "check";
814
+ extract: "extract";
814
815
  plan: "plan";
815
816
  fetch: "fetch";
816
817
  triage: "triage";
817
818
  read: "read";
818
- extract: "extract";
819
819
  review: "review";
820
820
  }>>;
821
821
  at: z.ZodString;
@@ -855,11 +855,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
855
855
  round: z.ZodNumber;
856
856
  step: z.ZodOptional<z.ZodEnum<{
857
857
  check: "check";
858
+ extract: "extract";
858
859
  plan: "plan";
859
860
  fetch: "fetch";
860
861
  triage: "triage";
861
862
  read: "read";
862
- extract: "extract";
863
863
  review: "review";
864
864
  }>>;
865
865
  at: z.ZodString;
@@ -886,11 +886,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
886
886
  round: z.ZodNumber;
887
887
  step: z.ZodOptional<z.ZodEnum<{
888
888
  check: "check";
889
+ extract: "extract";
889
890
  plan: "plan";
890
891
  fetch: "fetch";
891
892
  triage: "triage";
892
893
  read: "read";
893
- extract: "extract";
894
894
  review: "review";
895
895
  }>>;
896
896
  at: z.ZodString;
@@ -921,11 +921,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
921
921
  round: z.ZodNumber;
922
922
  step: z.ZodOptional<z.ZodEnum<{
923
923
  check: "check";
924
+ extract: "extract";
924
925
  plan: "plan";
925
926
  fetch: "fetch";
926
927
  triage: "triage";
927
928
  read: "read";
928
- extract: "extract";
929
929
  review: "review";
930
930
  }>>;
931
931
  at: z.ZodString;
@@ -953,11 +953,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
953
953
  round: z.ZodNumber;
954
954
  step: z.ZodOptional<z.ZodEnum<{
955
955
  check: "check";
956
+ extract: "extract";
956
957
  plan: "plan";
957
958
  fetch: "fetch";
958
959
  triage: "triage";
959
960
  read: "read";
960
- extract: "extract";
961
961
  review: "review";
962
962
  }>>;
963
963
  at: z.ZodString;
@@ -982,11 +982,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
982
982
  round: z.ZodNumber;
983
983
  step: z.ZodOptional<z.ZodEnum<{
984
984
  check: "check";
985
+ extract: "extract";
985
986
  plan: "plan";
986
987
  fetch: "fetch";
987
988
  triage: "triage";
988
989
  read: "read";
989
- extract: "extract";
990
990
  review: "review";
991
991
  }>>;
992
992
  at: z.ZodString;
@@ -1009,11 +1009,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1009
1009
  round: z.ZodNumber;
1010
1010
  step: z.ZodOptional<z.ZodEnum<{
1011
1011
  check: "check";
1012
+ extract: "extract";
1012
1013
  plan: "plan";
1013
1014
  fetch: "fetch";
1014
1015
  triage: "triage";
1015
1016
  read: "read";
1016
- extract: "extract";
1017
1017
  review: "review";
1018
1018
  }>>;
1019
1019
  at: z.ZodString;
@@ -1052,11 +1052,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1052
1052
  round: z.ZodNumber;
1053
1053
  step: z.ZodOptional<z.ZodEnum<{
1054
1054
  check: "check";
1055
+ extract: "extract";
1055
1056
  plan: "plan";
1056
1057
  fetch: "fetch";
1057
1058
  triage: "triage";
1058
1059
  read: "read";
1059
- extract: "extract";
1060
1060
  review: "review";
1061
1061
  }>>;
1062
1062
  at: z.ZodString;
@@ -1113,11 +1113,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1113
1113
  round: z.ZodNumber;
1114
1114
  step: z.ZodOptional<z.ZodEnum<{
1115
1115
  check: "check";
1116
+ extract: "extract";
1116
1117
  plan: "plan";
1117
1118
  fetch: "fetch";
1118
1119
  triage: "triage";
1119
1120
  read: "read";
1120
- extract: "extract";
1121
1121
  review: "review";
1122
1122
  }>>;
1123
1123
  at: z.ZodString;
@@ -1135,11 +1135,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1135
1135
  back: "back";
1136
1136
  }>;
1137
1137
  to: z.ZodOptional<z.ZodEnum<{
1138
+ extract: "extract";
1138
1139
  plan: "plan";
1139
1140
  fetch: "fetch";
1140
1141
  triage: "triage";
1141
1142
  read: "read";
1142
- extract: "extract";
1143
1143
  }>>;
1144
1144
  }, z.core.$strip>, z.ZodObject<{
1145
1145
  id: z.ZodString;
@@ -1155,11 +1155,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1155
1155
  type: z.ZodLiteral<"done">;
1156
1156
  step: z.ZodEnum<{
1157
1157
  check: "check";
1158
+ extract: "extract";
1158
1159
  plan: "plan";
1159
1160
  fetch: "fetch";
1160
1161
  triage: "triage";
1161
1162
  read: "read";
1162
- extract: "extract";
1163
1163
  review: "review";
1164
1164
  }>;
1165
1165
  ok: z.ZodBoolean;
@@ -1170,11 +1170,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1170
1170
  round: z.ZodNumber;
1171
1171
  step: z.ZodOptional<z.ZodEnum<{
1172
1172
  check: "check";
1173
+ extract: "extract";
1173
1174
  plan: "plan";
1174
1175
  fetch: "fetch";
1175
1176
  triage: "triage";
1176
1177
  read: "read";
1177
- extract: "extract";
1178
1178
  review: "review";
1179
1179
  }>>;
1180
1180
  at: z.ZodString;
@@ -1192,11 +1192,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1192
1192
  round: z.ZodNumber;
1193
1193
  step: z.ZodOptional<z.ZodEnum<{
1194
1194
  check: "check";
1195
+ extract: "extract";
1195
1196
  plan: "plan";
1196
1197
  fetch: "fetch";
1197
1198
  triage: "triage";
1198
1199
  read: "read";
1199
- extract: "extract";
1200
1200
  review: "review";
1201
1201
  }>>;
1202
1202
  at: z.ZodString;
@@ -1215,11 +1215,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1215
1215
  round: z.ZodNumber;
1216
1216
  step: z.ZodOptional<z.ZodEnum<{
1217
1217
  check: "check";
1218
+ extract: "extract";
1218
1219
  plan: "plan";
1219
1220
  fetch: "fetch";
1220
1221
  triage: "triage";
1221
1222
  read: "read";
1222
- extract: "extract";
1223
1223
  review: "review";
1224
1224
  }>>;
1225
1225
  at: z.ZodString;
@@ -1239,11 +1239,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1239
1239
  round: z.ZodNumber;
1240
1240
  step: z.ZodOptional<z.ZodEnum<{
1241
1241
  check: "check";
1242
+ extract: "extract";
1242
1243
  plan: "plan";
1243
1244
  fetch: "fetch";
1244
1245
  triage: "triage";
1245
1246
  read: "read";
1246
- extract: "extract";
1247
1247
  review: "review";
1248
1248
  }>>;
1249
1249
  at: z.ZodString;
@@ -1263,11 +1263,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1263
1263
  round: z.ZodNumber;
1264
1264
  step: z.ZodOptional<z.ZodEnum<{
1265
1265
  check: "check";
1266
+ extract: "extract";
1266
1267
  plan: "plan";
1267
1268
  fetch: "fetch";
1268
1269
  triage: "triage";
1269
1270
  read: "read";
1270
- extract: "extract";
1271
1271
  review: "review";
1272
1272
  }>>;
1273
1273
  at: z.ZodString;
@@ -1286,11 +1286,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1286
1286
  round: z.ZodNumber;
1287
1287
  step: z.ZodOptional<z.ZodEnum<{
1288
1288
  check: "check";
1289
+ extract: "extract";
1289
1290
  plan: "plan";
1290
1291
  fetch: "fetch";
1291
1292
  triage: "triage";
1292
1293
  read: "read";
1293
- extract: "extract";
1294
1294
  review: "review";
1295
1295
  }>>;
1296
1296
  at: z.ZodString;
@@ -1317,11 +1317,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1317
1317
  round: z.ZodNumber;
1318
1318
  step: z.ZodOptional<z.ZodEnum<{
1319
1319
  check: "check";
1320
+ extract: "extract";
1320
1321
  plan: "plan";
1321
1322
  fetch: "fetch";
1322
1323
  triage: "triage";
1323
1324
  read: "read";
1324
- extract: "extract";
1325
1325
  review: "review";
1326
1326
  }>>;
1327
1327
  at: z.ZodString;
@@ -1349,11 +1349,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1349
1349
  round: z.ZodNumber;
1350
1350
  step: z.ZodOptional<z.ZodEnum<{
1351
1351
  check: "check";
1352
+ extract: "extract";
1352
1353
  plan: "plan";
1353
1354
  fetch: "fetch";
1354
1355
  triage: "triage";
1355
1356
  read: "read";
1356
- extract: "extract";
1357
1357
  review: "review";
1358
1358
  }>>;
1359
1359
  at: z.ZodString;
@@ -1372,11 +1372,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1372
1372
  round: z.ZodNumber;
1373
1373
  step: z.ZodOptional<z.ZodEnum<{
1374
1374
  check: "check";
1375
+ extract: "extract";
1375
1376
  plan: "plan";
1376
1377
  fetch: "fetch";
1377
1378
  triage: "triage";
1378
1379
  read: "read";
1379
- extract: "extract";
1380
1380
  review: "review";
1381
1381
  }>>;
1382
1382
  at: z.ZodString;
@@ -1395,11 +1395,11 @@ export declare const LedgerRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
1395
1395
  round: z.ZodNumber;
1396
1396
  step: z.ZodOptional<z.ZodEnum<{
1397
1397
  check: "check";
1398
+ extract: "extract";
1398
1399
  plan: "plan";
1399
1400
  fetch: "fetch";
1400
1401
  triage: "triage";
1401
1402
  read: "read";
1402
- extract: "extract";
1403
1403
  review: "review";
1404
1404
  }>>;
1405
1405
  at: z.ZodString;
@@ -34,7 +34,10 @@ export function exa(o) {
34
34
  if (!res.ok)
35
35
  throw httpError("exa", res);
36
36
  const out = (await res.json());
37
- return (out.results ?? []).map(hitOf);
37
+ const hits = (out.results ?? []).map(hitOf);
38
+ // the spend reads it: Exa prices each call itself
39
+ const usd = out.costDollars?.total;
40
+ return typeof usd === "number" ? Object.assign(hits, { usd }) : hits;
38
41
  };
39
42
  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8,6 +8,11 @@ import type { VideoRead } from "@wrenautomation/read/video";
8
8
  import { flatPlaylist, pageInfo, readYoutube, type YtDlpEntry } from "@wrenautomation/read/video";
9
9
  import type { Document } from "../document/index.js";
10
10
  import type { Source } from "../engine/ports.js";
11
+ /** The model, with the sum of what its calls cost; undefined once a call came back unpriced. */
12
+ export declare function pricedOf(m: Model): {
13
+ model: Model;
14
+ usd: () => number | undefined;
15
+ };
11
16
  export declare const videoDocument: (r: VideoRead) => Document;
12
17
  /** One listed entry as a hit; `youtube` builds the watch URL from the id, other sites keep theirs. */
13
18
  export declare const entryHit: (e: YtDlpEntry, site?: "youtube" | "other") => {
@@ -5,6 +5,29 @@
5
5
  */
6
6
  import { flatPlaylist, pageInfo, readYoutube } from "@wrenautomation/read/video";
7
7
  import { youtubeId } from "../engine/canonical.js";
8
+ /** The model, with the sum of what its calls cost; undefined once a call came back unpriced. */
9
+ export function pricedOf(m) {
10
+ let sum = 0;
11
+ const add = (usd) => {
12
+ sum = sum === undefined || usd === undefined ? undefined : sum + usd;
13
+ };
14
+ const model = {
15
+ id: m.id,
16
+ provider: m.provider,
17
+ takes: m.takes,
18
+ async complete(r) {
19
+ const reply = await m.complete(r);
20
+ add(reply.usage?.usd);
21
+ return reply;
22
+ },
23
+ async ask(prompt, shape, o) {
24
+ const a = await m.ask(prompt, shape, o);
25
+ add(a.usage?.usd);
26
+ return a;
27
+ },
28
+ };
29
+ return { model, usd: () => sum };
30
+ }
8
31
  export const videoDocument = (r) => ({
9
32
  url: r.url,
10
33
  media: "video",
@@ -107,10 +130,15 @@ export function ytdlpSource(o) {
107
130
  async open(h) {
108
131
  if (!isYoutube(h.url))
109
132
  throw new Error(`youtube: not a YouTube page: ${h.url}`);
110
- return videoDocument(await read(h.url, {
111
- ytDlp: o.ytDlp,
112
- ...(o.video ? { video: await videoModel(o.video) } : {}),
113
- }));
133
+ const model = o.video ? await videoModel(o.video) : null;
134
+ const priced = model ? pricedOf(model) : null;
135
+ const doc = videoDocument(await read(h.url, { ytDlp: o.ytDlp, ...(priced ? { video: priced.model } : {}) }));
136
+ // captions: free; heard: the model's priced calls; an unpriced call leaves it unpriced
137
+ const usd = priced ? priced.usd() : 0;
138
+ // hidden: the spend reads it, the stored document never carries it
139
+ if (usd !== undefined)
140
+ Object.defineProperty(doc, "usd", { value: usd, enumerable: false });
141
+ return doc;
114
142
  },
115
143
  };
116
144
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ytdlp.js","sourceRoot":"","sources":["../../src/sources/ytdlp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAmB,MAAM,4BAA4B,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAY,EAAY,EAAE,CAAC,CAAC;IACxD,GAAG,EAAE,CAAC,CAAC,GAAG;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,CAAC,CAAC,KAAK;IACd,IAAI,EAAE,CAAC,CAAC,IAAI;IACZ,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,GAAG,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC;AAEH,sGAAsG;AACtG,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAa,EAAE,OAA4B,SAAS,EAAE,EAAE;IAC/E,MAAM,GAAG,GAAG,CAAC,CAAC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