@agent-finops/core 0.9.5 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actionVerification.d.ts +54 -54
- package/dist/activitySnapshot.d.ts +57 -57
- package/dist/activitySnapshot.js +12 -3
- package/dist/agentEconomicsReceipt.d.ts +62 -62
- package/dist/glance.js +10 -6
- package/dist/localAgentLogs.d.ts +19 -3
- package/dist/localAgentLogs.js +112 -18
- package/dist/modelPricing.d.ts +17 -4
- package/dist/modelPricing.js +114 -22
- package/dist/projectIndexStore.d.ts +14 -12
- package/dist/qualitativeIndexCache.d.ts +12 -10
- package/dist/qualitativeIndexCache.js +5 -0
- package/package.json +1 -1
|
@@ -8,8 +8,8 @@ declare const financialEvidenceWithAmountSchema: z.ZodEnum<{
|
|
|
8
8
|
}>;
|
|
9
9
|
export declare const receiptModeValues: readonly ["local", "connected", "mixed", "sample"];
|
|
10
10
|
export declare const receiptModeSchema: z.ZodEnum<{
|
|
11
|
-
local: "local";
|
|
12
11
|
mixed: "mixed";
|
|
12
|
+
local: "local";
|
|
13
13
|
sample: "sample";
|
|
14
14
|
connected: "connected";
|
|
15
15
|
}>;
|
|
@@ -26,8 +26,8 @@ export type ReceiptSourceKind = z.infer<typeof receiptSourceKindSchema>;
|
|
|
26
26
|
export declare const receiptProvenanceOriginValues: readonly ["provider_reported", "locally_observed", "user_declared", "sample"];
|
|
27
27
|
export declare const receiptProvenanceOriginSchema: z.ZodEnum<{
|
|
28
28
|
provider_reported: "provider_reported";
|
|
29
|
-
user_declared: "user_declared";
|
|
30
29
|
sample: "sample";
|
|
30
|
+
user_declared: "user_declared";
|
|
31
31
|
locally_observed: "locally_observed";
|
|
32
32
|
}>;
|
|
33
33
|
export type ReceiptProvenanceOrigin = z.infer<typeof receiptProvenanceOriginSchema>;
|
|
@@ -40,9 +40,9 @@ export declare const receiptTransformationSchema: z.ZodEnum<{
|
|
|
40
40
|
export type ReceiptTransformation = z.infer<typeof receiptTransformationSchema>;
|
|
41
41
|
export declare const receiptAccountingBasisValues: readonly ["provider_billed", "api_equivalent", "user_declared"];
|
|
42
42
|
export declare const receiptAccountingBasisSchema: z.ZodEnum<{
|
|
43
|
-
user_declared: "user_declared";
|
|
44
|
-
provider_billed: "provider_billed";
|
|
45
43
|
api_equivalent: "api_equivalent";
|
|
44
|
+
provider_billed: "provider_billed";
|
|
45
|
+
user_declared: "user_declared";
|
|
46
46
|
}>;
|
|
47
47
|
export type ReceiptAccountingBasis = z.infer<typeof receiptAccountingBasisSchema>;
|
|
48
48
|
export declare const receiptMappingGapCodeValues: readonly ["cost_unsplit", "cost_unpriced", "model_unmapped", "provider_unmapped", "source_record_unmapped"];
|
|
@@ -57,9 +57,9 @@ export type ReceiptMappingGapCode = z.infer<typeof receiptMappingGapCodeSchema>;
|
|
|
57
57
|
export declare const receiptFreshnessSchema: z.ZodPipe<z.ZodObject<{
|
|
58
58
|
status: z.ZodEnum<{
|
|
59
59
|
error: "error";
|
|
60
|
-
fresh: "fresh";
|
|
61
|
-
stale: "stale";
|
|
62
60
|
not_checked: "not_checked";
|
|
61
|
+
stale: "stale";
|
|
62
|
+
fresh: "fresh";
|
|
63
63
|
}>;
|
|
64
64
|
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
65
65
|
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -68,9 +68,9 @@ export declare const receiptFreshnessSchema: z.ZodPipe<z.ZodObject<{
|
|
|
68
68
|
errorCode?: string | undefined;
|
|
69
69
|
latestEvidenceAt?: string | undefined;
|
|
70
70
|
checkedAt?: string | undefined;
|
|
71
|
-
status: "error" | "
|
|
71
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
72
72
|
}, {
|
|
73
|
-
status: "error" | "
|
|
73
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
74
74
|
checkedAt?: string | undefined;
|
|
75
75
|
latestEvidenceAt?: string | undefined;
|
|
76
76
|
errorCode?: string | undefined;
|
|
@@ -95,9 +95,9 @@ export declare const receiptSourceSchema: z.ZodObject<{
|
|
|
95
95
|
freshness: z.ZodPipe<z.ZodObject<{
|
|
96
96
|
status: z.ZodEnum<{
|
|
97
97
|
error: "error";
|
|
98
|
-
fresh: "fresh";
|
|
99
|
-
stale: "stale";
|
|
100
98
|
not_checked: "not_checked";
|
|
99
|
+
stale: "stale";
|
|
100
|
+
fresh: "fresh";
|
|
101
101
|
}>;
|
|
102
102
|
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
103
103
|
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -106,9 +106,9 @@ export declare const receiptSourceSchema: z.ZodObject<{
|
|
|
106
106
|
errorCode?: string | undefined;
|
|
107
107
|
latestEvidenceAt?: string | undefined;
|
|
108
108
|
checkedAt?: string | undefined;
|
|
109
|
-
status: "error" | "
|
|
109
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
110
110
|
}, {
|
|
111
|
-
status: "error" | "
|
|
111
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
112
112
|
checkedAt?: string | undefined;
|
|
113
113
|
latestEvidenceAt?: string | undefined;
|
|
114
114
|
errorCode?: string | undefined;
|
|
@@ -125,8 +125,8 @@ export declare function createReceiptSourceRecordReference(sourceId: string, sou
|
|
|
125
125
|
export declare const receiptProvenanceSchema: z.ZodObject<{
|
|
126
126
|
origin: z.ZodEnum<{
|
|
127
127
|
provider_reported: "provider_reported";
|
|
128
|
-
user_declared: "user_declared";
|
|
129
128
|
sample: "sample";
|
|
129
|
+
user_declared: "user_declared";
|
|
130
130
|
locally_observed: "locally_observed";
|
|
131
131
|
}>;
|
|
132
132
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -147,9 +147,9 @@ export declare const receiptTokenUsageLineSchema: z.ZodObject<{
|
|
|
147
147
|
sourceId: z.ZodString;
|
|
148
148
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
149
149
|
granularity: z.ZodEnum<{
|
|
150
|
-
session: "session";
|
|
151
150
|
call: "call";
|
|
152
151
|
invocation: "invocation";
|
|
152
|
+
session: "session";
|
|
153
153
|
daily_aggregate: "daily_aggregate";
|
|
154
154
|
usage_bucket: "usage_bucket";
|
|
155
155
|
billing_bucket: "billing_bucket";
|
|
@@ -159,8 +159,8 @@ export declare const receiptTokenUsageLineSchema: z.ZodObject<{
|
|
|
159
159
|
provenance: z.ZodObject<{
|
|
160
160
|
origin: z.ZodEnum<{
|
|
161
161
|
provider_reported: "provider_reported";
|
|
162
|
-
user_declared: "user_declared";
|
|
163
162
|
sample: "sample";
|
|
163
|
+
user_declared: "user_declared";
|
|
164
164
|
locally_observed: "locally_observed";
|
|
165
165
|
}>;
|
|
166
166
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -180,9 +180,9 @@ export declare const receiptFinancialCostLineSchema: z.ZodObject<{
|
|
|
180
180
|
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
181
181
|
currency: z.ZodLiteral<"USD">;
|
|
182
182
|
accountingBasis: z.ZodEnum<{
|
|
183
|
-
user_declared: "user_declared";
|
|
184
|
-
provider_billed: "provider_billed";
|
|
185
183
|
api_equivalent: "api_equivalent";
|
|
184
|
+
provider_billed: "provider_billed";
|
|
185
|
+
user_declared: "user_declared";
|
|
186
186
|
}>;
|
|
187
187
|
financialEvidence: z.ZodEnum<{
|
|
188
188
|
estimated: "estimated";
|
|
@@ -193,9 +193,9 @@ export declare const receiptFinancialCostLineSchema: z.ZodObject<{
|
|
|
193
193
|
sourceId: z.ZodString;
|
|
194
194
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
195
195
|
granularity: z.ZodEnum<{
|
|
196
|
-
session: "session";
|
|
197
196
|
call: "call";
|
|
198
197
|
invocation: "invocation";
|
|
198
|
+
session: "session";
|
|
199
199
|
daily_aggregate: "daily_aggregate";
|
|
200
200
|
usage_bucket: "usage_bucket";
|
|
201
201
|
billing_bucket: "billing_bucket";
|
|
@@ -205,8 +205,8 @@ export declare const receiptFinancialCostLineSchema: z.ZodObject<{
|
|
|
205
205
|
provenance: z.ZodObject<{
|
|
206
206
|
origin: z.ZodEnum<{
|
|
207
207
|
provider_reported: "provider_reported";
|
|
208
|
-
user_declared: "user_declared";
|
|
209
208
|
sample: "sample";
|
|
209
|
+
user_declared: "user_declared";
|
|
210
210
|
locally_observed: "locally_observed";
|
|
211
211
|
}>;
|
|
212
212
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -232,9 +232,9 @@ export declare const receiptLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
232
232
|
sourceId: z.ZodString;
|
|
233
233
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
234
234
|
granularity: z.ZodEnum<{
|
|
235
|
-
session: "session";
|
|
236
235
|
call: "call";
|
|
237
236
|
invocation: "invocation";
|
|
237
|
+
session: "session";
|
|
238
238
|
daily_aggregate: "daily_aggregate";
|
|
239
239
|
usage_bucket: "usage_bucket";
|
|
240
240
|
billing_bucket: "billing_bucket";
|
|
@@ -244,8 +244,8 @@ export declare const receiptLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
244
244
|
provenance: z.ZodObject<{
|
|
245
245
|
origin: z.ZodEnum<{
|
|
246
246
|
provider_reported: "provider_reported";
|
|
247
|
-
user_declared: "user_declared";
|
|
248
247
|
sample: "sample";
|
|
248
|
+
user_declared: "user_declared";
|
|
249
249
|
locally_observed: "locally_observed";
|
|
250
250
|
}>;
|
|
251
251
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -263,9 +263,9 @@ export declare const receiptLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
263
263
|
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
264
264
|
currency: z.ZodLiteral<"USD">;
|
|
265
265
|
accountingBasis: z.ZodEnum<{
|
|
266
|
-
user_declared: "user_declared";
|
|
267
|
-
provider_billed: "provider_billed";
|
|
268
266
|
api_equivalent: "api_equivalent";
|
|
267
|
+
provider_billed: "provider_billed";
|
|
268
|
+
user_declared: "user_declared";
|
|
269
269
|
}>;
|
|
270
270
|
financialEvidence: z.ZodEnum<{
|
|
271
271
|
estimated: "estimated";
|
|
@@ -276,9 +276,9 @@ export declare const receiptLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
276
276
|
sourceId: z.ZodString;
|
|
277
277
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
278
278
|
granularity: z.ZodEnum<{
|
|
279
|
-
session: "session";
|
|
280
279
|
call: "call";
|
|
281
280
|
invocation: "invocation";
|
|
281
|
+
session: "session";
|
|
282
282
|
daily_aggregate: "daily_aggregate";
|
|
283
283
|
usage_bucket: "usage_bucket";
|
|
284
284
|
billing_bucket: "billing_bucket";
|
|
@@ -288,8 +288,8 @@ export declare const receiptLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
288
288
|
provenance: z.ZodObject<{
|
|
289
289
|
origin: z.ZodEnum<{
|
|
290
290
|
provider_reported: "provider_reported";
|
|
291
|
-
user_declared: "user_declared";
|
|
292
291
|
sample: "sample";
|
|
292
|
+
user_declared: "user_declared";
|
|
293
293
|
locally_observed: "locally_observed";
|
|
294
294
|
}>;
|
|
295
295
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -326,9 +326,9 @@ export declare const receiptMappingGapSchema: z.ZodPipe<z.ZodObject<{
|
|
|
326
326
|
export type ReceiptMappingGap = z.infer<typeof receiptMappingGapSchema>;
|
|
327
327
|
export declare const receiptCostTotalSchema: z.ZodObject<{
|
|
328
328
|
accountingBasis: z.ZodEnum<{
|
|
329
|
-
user_declared: "user_declared";
|
|
330
|
-
provider_billed: "provider_billed";
|
|
331
329
|
api_equivalent: "api_equivalent";
|
|
330
|
+
provider_billed: "provider_billed";
|
|
331
|
+
user_declared: "user_declared";
|
|
332
332
|
}>;
|
|
333
333
|
financialEvidence: z.ZodEnum<{
|
|
334
334
|
estimated: "estimated";
|
|
@@ -345,8 +345,8 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
345
345
|
schemaVersion: z.ZodLiteral<"0.1.0">;
|
|
346
346
|
generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
347
347
|
mode: z.ZodEnum<{
|
|
348
|
-
local: "local";
|
|
349
348
|
mixed: "mixed";
|
|
349
|
+
local: "local";
|
|
350
350
|
sample: "sample";
|
|
351
351
|
connected: "connected";
|
|
352
352
|
}>;
|
|
@@ -374,9 +374,9 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
374
374
|
freshness: z.ZodPipe<z.ZodObject<{
|
|
375
375
|
status: z.ZodEnum<{
|
|
376
376
|
error: "error";
|
|
377
|
-
fresh: "fresh";
|
|
378
|
-
stale: "stale";
|
|
379
377
|
not_checked: "not_checked";
|
|
378
|
+
stale: "stale";
|
|
379
|
+
fresh: "fresh";
|
|
380
380
|
}>;
|
|
381
381
|
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
382
382
|
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -385,9 +385,9 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
385
385
|
errorCode?: string | undefined;
|
|
386
386
|
latestEvidenceAt?: string | undefined;
|
|
387
387
|
checkedAt?: string | undefined;
|
|
388
|
-
status: "error" | "
|
|
388
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
389
389
|
}, {
|
|
390
|
-
status: "error" | "
|
|
390
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
391
391
|
checkedAt?: string | undefined;
|
|
392
392
|
latestEvidenceAt?: string | undefined;
|
|
393
393
|
errorCode?: string | undefined;
|
|
@@ -404,9 +404,9 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
404
404
|
sourceId: z.ZodString;
|
|
405
405
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
406
406
|
granularity: z.ZodEnum<{
|
|
407
|
-
session: "session";
|
|
408
407
|
call: "call";
|
|
409
408
|
invocation: "invocation";
|
|
409
|
+
session: "session";
|
|
410
410
|
daily_aggregate: "daily_aggregate";
|
|
411
411
|
usage_bucket: "usage_bucket";
|
|
412
412
|
billing_bucket: "billing_bucket";
|
|
@@ -416,8 +416,8 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
416
416
|
provenance: z.ZodObject<{
|
|
417
417
|
origin: z.ZodEnum<{
|
|
418
418
|
provider_reported: "provider_reported";
|
|
419
|
-
user_declared: "user_declared";
|
|
420
419
|
sample: "sample";
|
|
420
|
+
user_declared: "user_declared";
|
|
421
421
|
locally_observed: "locally_observed";
|
|
422
422
|
}>;
|
|
423
423
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -435,9 +435,9 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
435
435
|
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
436
436
|
currency: z.ZodLiteral<"USD">;
|
|
437
437
|
accountingBasis: z.ZodEnum<{
|
|
438
|
-
user_declared: "user_declared";
|
|
439
|
-
provider_billed: "provider_billed";
|
|
440
438
|
api_equivalent: "api_equivalent";
|
|
439
|
+
provider_billed: "provider_billed";
|
|
440
|
+
user_declared: "user_declared";
|
|
441
441
|
}>;
|
|
442
442
|
financialEvidence: z.ZodEnum<{
|
|
443
443
|
estimated: "estimated";
|
|
@@ -448,9 +448,9 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
448
448
|
sourceId: z.ZodString;
|
|
449
449
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
450
450
|
granularity: z.ZodEnum<{
|
|
451
|
-
session: "session";
|
|
452
451
|
call: "call";
|
|
453
452
|
invocation: "invocation";
|
|
453
|
+
session: "session";
|
|
454
454
|
daily_aggregate: "daily_aggregate";
|
|
455
455
|
usage_bucket: "usage_bucket";
|
|
456
456
|
billing_bucket: "billing_bucket";
|
|
@@ -460,8 +460,8 @@ declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
|
460
460
|
provenance: z.ZodObject<{
|
|
461
461
|
origin: z.ZodEnum<{
|
|
462
462
|
provider_reported: "provider_reported";
|
|
463
|
-
user_declared: "user_declared";
|
|
464
463
|
sample: "sample";
|
|
464
|
+
user_declared: "user_declared";
|
|
465
465
|
locally_observed: "locally_observed";
|
|
466
466
|
}>;
|
|
467
467
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -500,8 +500,8 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
500
500
|
schemaVersion: z.ZodLiteral<"0.1.0">;
|
|
501
501
|
generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
502
502
|
mode: z.ZodEnum<{
|
|
503
|
-
local: "local";
|
|
504
503
|
mixed: "mixed";
|
|
504
|
+
local: "local";
|
|
505
505
|
sample: "sample";
|
|
506
506
|
connected: "connected";
|
|
507
507
|
}>;
|
|
@@ -529,9 +529,9 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
529
529
|
freshness: z.ZodPipe<z.ZodObject<{
|
|
530
530
|
status: z.ZodEnum<{
|
|
531
531
|
error: "error";
|
|
532
|
-
fresh: "fresh";
|
|
533
|
-
stale: "stale";
|
|
534
532
|
not_checked: "not_checked";
|
|
533
|
+
stale: "stale";
|
|
534
|
+
fresh: "fresh";
|
|
535
535
|
}>;
|
|
536
536
|
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
537
537
|
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -540,9 +540,9 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
540
540
|
errorCode?: string | undefined;
|
|
541
541
|
latestEvidenceAt?: string | undefined;
|
|
542
542
|
checkedAt?: string | undefined;
|
|
543
|
-
status: "error" | "
|
|
543
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
544
544
|
}, {
|
|
545
|
-
status: "error" | "
|
|
545
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
546
546
|
checkedAt?: string | undefined;
|
|
547
547
|
latestEvidenceAt?: string | undefined;
|
|
548
548
|
errorCode?: string | undefined;
|
|
@@ -559,9 +559,9 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
559
559
|
sourceId: z.ZodString;
|
|
560
560
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
561
561
|
granularity: z.ZodEnum<{
|
|
562
|
-
session: "session";
|
|
563
562
|
call: "call";
|
|
564
563
|
invocation: "invocation";
|
|
564
|
+
session: "session";
|
|
565
565
|
daily_aggregate: "daily_aggregate";
|
|
566
566
|
usage_bucket: "usage_bucket";
|
|
567
567
|
billing_bucket: "billing_bucket";
|
|
@@ -571,8 +571,8 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
571
571
|
provenance: z.ZodObject<{
|
|
572
572
|
origin: z.ZodEnum<{
|
|
573
573
|
provider_reported: "provider_reported";
|
|
574
|
-
user_declared: "user_declared";
|
|
575
574
|
sample: "sample";
|
|
575
|
+
user_declared: "user_declared";
|
|
576
576
|
locally_observed: "locally_observed";
|
|
577
577
|
}>;
|
|
578
578
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -590,9 +590,9 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
590
590
|
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
591
591
|
currency: z.ZodLiteral<"USD">;
|
|
592
592
|
accountingBasis: z.ZodEnum<{
|
|
593
|
-
user_declared: "user_declared";
|
|
594
|
-
provider_billed: "provider_billed";
|
|
595
593
|
api_equivalent: "api_equivalent";
|
|
594
|
+
provider_billed: "provider_billed";
|
|
595
|
+
user_declared: "user_declared";
|
|
596
596
|
}>;
|
|
597
597
|
financialEvidence: z.ZodEnum<{
|
|
598
598
|
estimated: "estimated";
|
|
@@ -603,9 +603,9 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
603
603
|
sourceId: z.ZodString;
|
|
604
604
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
605
605
|
granularity: z.ZodEnum<{
|
|
606
|
-
session: "session";
|
|
607
606
|
call: "call";
|
|
608
607
|
invocation: "invocation";
|
|
608
|
+
session: "session";
|
|
609
609
|
daily_aggregate: "daily_aggregate";
|
|
610
610
|
usage_bucket: "usage_bucket";
|
|
611
611
|
billing_bucket: "billing_bucket";
|
|
@@ -615,8 +615,8 @@ export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
|
615
615
|
provenance: z.ZodObject<{
|
|
616
616
|
origin: z.ZodEnum<{
|
|
617
617
|
provider_reported: "provider_reported";
|
|
618
|
-
user_declared: "user_declared";
|
|
619
618
|
sample: "sample";
|
|
619
|
+
user_declared: "user_declared";
|
|
620
620
|
locally_observed: "locally_observed";
|
|
621
621
|
}>;
|
|
622
622
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -657,8 +657,8 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
657
657
|
schemaVersion: z.ZodLiteral<"0.1.0">;
|
|
658
658
|
generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
659
659
|
mode: z.ZodEnum<{
|
|
660
|
-
local: "local";
|
|
661
660
|
mixed: "mixed";
|
|
661
|
+
local: "local";
|
|
662
662
|
sample: "sample";
|
|
663
663
|
connected: "connected";
|
|
664
664
|
}>;
|
|
@@ -686,9 +686,9 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
686
686
|
freshness: z.ZodPipe<z.ZodObject<{
|
|
687
687
|
status: z.ZodEnum<{
|
|
688
688
|
error: "error";
|
|
689
|
-
fresh: "fresh";
|
|
690
|
-
stale: "stale";
|
|
691
689
|
not_checked: "not_checked";
|
|
690
|
+
stale: "stale";
|
|
691
|
+
fresh: "fresh";
|
|
692
692
|
}>;
|
|
693
693
|
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
694
694
|
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -697,9 +697,9 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
697
697
|
errorCode?: string | undefined;
|
|
698
698
|
latestEvidenceAt?: string | undefined;
|
|
699
699
|
checkedAt?: string | undefined;
|
|
700
|
-
status: "error" | "
|
|
700
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
701
701
|
}, {
|
|
702
|
-
status: "error" | "
|
|
702
|
+
status: "error" | "not_checked" | "stale" | "fresh";
|
|
703
703
|
checkedAt?: string | undefined;
|
|
704
704
|
latestEvidenceAt?: string | undefined;
|
|
705
705
|
errorCode?: string | undefined;
|
|
@@ -716,9 +716,9 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
716
716
|
sourceId: z.ZodString;
|
|
717
717
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
718
718
|
granularity: z.ZodEnum<{
|
|
719
|
-
session: "session";
|
|
720
719
|
call: "call";
|
|
721
720
|
invocation: "invocation";
|
|
721
|
+
session: "session";
|
|
722
722
|
daily_aggregate: "daily_aggregate";
|
|
723
723
|
usage_bucket: "usage_bucket";
|
|
724
724
|
billing_bucket: "billing_bucket";
|
|
@@ -728,8 +728,8 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
728
728
|
provenance: z.ZodObject<{
|
|
729
729
|
origin: z.ZodEnum<{
|
|
730
730
|
provider_reported: "provider_reported";
|
|
731
|
-
user_declared: "user_declared";
|
|
732
731
|
sample: "sample";
|
|
732
|
+
user_declared: "user_declared";
|
|
733
733
|
locally_observed: "locally_observed";
|
|
734
734
|
}>;
|
|
735
735
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -747,9 +747,9 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
747
747
|
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
748
748
|
currency: z.ZodLiteral<"USD">;
|
|
749
749
|
accountingBasis: z.ZodEnum<{
|
|
750
|
-
user_declared: "user_declared";
|
|
751
|
-
provider_billed: "provider_billed";
|
|
752
750
|
api_equivalent: "api_equivalent";
|
|
751
|
+
provider_billed: "provider_billed";
|
|
752
|
+
user_declared: "user_declared";
|
|
753
753
|
}>;
|
|
754
754
|
financialEvidence: z.ZodEnum<{
|
|
755
755
|
estimated: "estimated";
|
|
@@ -760,9 +760,9 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
760
760
|
sourceId: z.ZodString;
|
|
761
761
|
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
762
762
|
granularity: z.ZodEnum<{
|
|
763
|
-
session: "session";
|
|
764
763
|
call: "call";
|
|
765
764
|
invocation: "invocation";
|
|
765
|
+
session: "session";
|
|
766
766
|
daily_aggregate: "daily_aggregate";
|
|
767
767
|
usage_bucket: "usage_bucket";
|
|
768
768
|
billing_bucket: "billing_bucket";
|
|
@@ -772,8 +772,8 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
772
772
|
provenance: z.ZodObject<{
|
|
773
773
|
origin: z.ZodEnum<{
|
|
774
774
|
provider_reported: "provider_reported";
|
|
775
|
-
user_declared: "user_declared";
|
|
776
775
|
sample: "sample";
|
|
776
|
+
user_declared: "user_declared";
|
|
777
777
|
locally_observed: "locally_observed";
|
|
778
778
|
}>;
|
|
779
779
|
transformations: z.ZodArray<z.ZodEnum<{
|
|
@@ -809,9 +809,9 @@ export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
|
809
809
|
id: z.ZodString;
|
|
810
810
|
costTotals: z.ZodArray<z.ZodObject<{
|
|
811
811
|
accountingBasis: z.ZodEnum<{
|
|
812
|
-
user_declared: "user_declared";
|
|
813
|
-
provider_billed: "provider_billed";
|
|
814
812
|
api_equivalent: "api_equivalent";
|
|
813
|
+
provider_billed: "provider_billed";
|
|
814
|
+
user_declared: "user_declared";
|
|
815
815
|
}>;
|
|
816
816
|
financialEvidence: z.ZodEnum<{
|
|
817
817
|
estimated: "estimated";
|
package/dist/glance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dedupeCumulativeSessionCalls, sanitizeLocalActivityText } from "./localAgentLogs.js";
|
|
2
|
-
import { canPriceTokenUsageAtScope,
|
|
2
|
+
import { canPriceTokenUsageAtScope, estimateTokenCostsUsd, PRICING_TABLE_AS_OF } from "./modelPricing.js";
|
|
3
3
|
import { subscriptionPlans } from "./planMath.js";
|
|
4
4
|
import { buildContextHealth } from "./contextHealth.js";
|
|
5
5
|
import { localAgentFormatDescriptors, localAgentFormatSupports } from "./localAgentFormats/registry.js";
|
|
@@ -106,7 +106,7 @@ export function buildUsageGlance(calls, options = {}) {
|
|
|
106
106
|
"Claude Code transcripts do not report plan headroom. Missing limits remain unavailable instead of being inferred.",
|
|
107
107
|
"Cursor and GitHub Copilot require their provider connections because their local chat stores are not treated as authoritative billing transcripts.",
|
|
108
108
|
...(qualitativeComplete ? [] : [
|
|
109
|
-
"Main focus, anomaly, and context-change handoff are unavailable because
|
|
109
|
+
"Main focus, anomaly, and context-change handoff are unavailable because some session transcripts have not been read yet; no global driver was inferred from a partly-read subset."
|
|
110
110
|
])
|
|
111
111
|
];
|
|
112
112
|
return {
|
|
@@ -202,10 +202,10 @@ function buildCoverageLimitedPrimaryAction(input) {
|
|
|
202
202
|
kind: "session_handoff",
|
|
203
203
|
intent: "inspect_current_work",
|
|
204
204
|
label: project ? `Refresh evidence · ${project}` : "Refresh evidence",
|
|
205
|
-
detail: `Main focus unavailable ·
|
|
205
|
+
detail: `Main focus unavailable · session transcripts ${status === "partial" ? "only partly read" : "not available"}`,
|
|
206
206
|
...(project ? { project } : {}),
|
|
207
207
|
agentPrompt: [
|
|
208
|
-
"
|
|
208
|
+
"Some coding-agent session transcripts have not been read yet.",
|
|
209
209
|
"Do not infer a global main focus, waste cause, or context change from the selected subset.",
|
|
210
210
|
`Run \`${aibillImproveCommandV0()}\` from the exact project root to refresh the private index, then review the new evidence before editing.`
|
|
211
211
|
].join("\n"),
|
|
@@ -793,9 +793,13 @@ function limitActionName(limit) {
|
|
|
793
793
|
function callCost(call) {
|
|
794
794
|
if (call.usageSupport === "unsupported_token_shape")
|
|
795
795
|
return undefined;
|
|
796
|
-
if (!canPriceTokenUsageAtScope(call.model, call.usage, call.usageScope === "turn" ? "request" : "aggregate"))
|
|
796
|
+
if (!canPriceTokenUsageAtScope(call.model, call.usage, call.usageScope === "turn" ? "request" : "aggregate", call.maxRequestPromptTokens))
|
|
797
797
|
return undefined;
|
|
798
|
-
|
|
798
|
+
// Tier must come from the largest single request, exactly as the report's
|
|
799
|
+
// aggregation does — otherwise the statusline and the receipt disagree on
|
|
800
|
+
// the same session (a cache-heavy Codex session voided here while the
|
|
801
|
+
// receipt prices it, or priced here at 2x).
|
|
802
|
+
return estimateTokenCostsUsd(call.model, [call.usage], [call.maxRequestPromptTokens]);
|
|
799
803
|
}
|
|
800
804
|
function inputSideTokens(call) {
|
|
801
805
|
return call.usage.inputTokens +
|
package/dist/localAgentLogs.d.ts
CHANGED
|
@@ -49,6 +49,16 @@ export type LocalAgentCall = {
|
|
|
49
49
|
latestTurnUsage?: LocalAgentTurnUsage;
|
|
50
50
|
/** Whether `usage` is one model turn or the session's cumulative financial total. */
|
|
51
51
|
usageScope?: "turn" | "session_cumulative";
|
|
52
|
+
/**
|
|
53
|
+
* Largest single-request prompt (effective input, cache reads included)
|
|
54
|
+
* observed within a `session_cumulative` `usage`. Tiered per-request pricing
|
|
55
|
+
* is selected per request, never from a cumulative sum: a cache-heavy session
|
|
56
|
+
* routinely clears a per-request tier threshold in aggregate while no single
|
|
57
|
+
* request did. This evidence lets pricing keep such a total on the base tier
|
|
58
|
+
* (exact) instead of failing closed to "missing". Absent for turn-scoped
|
|
59
|
+
* calls, which are already a single request.
|
|
60
|
+
*/
|
|
61
|
+
maxRequestPromptTokens?: number;
|
|
52
62
|
/**
|
|
53
63
|
* Whether the transcript exposed the input/output components required for
|
|
54
64
|
* pricing. A total-only snapshot is still usage evidence, but pricing it as
|
|
@@ -374,7 +384,7 @@ export type LocalAgentStreamCheckpointAdapter = {
|
|
|
374
384
|
writeStreamCheckpoint: (agent: LocalAgentFormatId, pathHash: string, checkpoint: Readonly<LocalAgentStreamCheckpointRecord>) => Promise<void>;
|
|
375
385
|
deleteStreamCheckpoint: (agent: LocalAgentFormatId, pathHash: string) => Promise<void>;
|
|
376
386
|
};
|
|
377
|
-
export declare const localAgentFinancialParserVersion =
|
|
387
|
+
export declare const localAgentFinancialParserVersion = 3;
|
|
378
388
|
/**
|
|
379
389
|
* Qualitative parser contract version. Bumped to 2 with the checkpointed
|
|
380
390
|
* streaming path (A4b): entries and checkpoints written by the pre-streaming
|
|
@@ -385,9 +395,15 @@ export declare const localAgentFinancialParserVersion = 1;
|
|
|
385
395
|
* cross-file completion evidence (`subagentCompletions`, from both Task tool
|
|
386
396
|
* results and background task-notifications): entries persisted by the
|
|
387
397
|
* collapsing parser must re-parse rather than silently keep merging subagent
|
|
388
|
-
* runs into their parent session.
|
|
398
|
+
* runs into their parent session. Bumped to 5 when Codex reducer checkpoints
|
|
399
|
+
* gained `maxTurnPromptTokens` (largest single request): a checkpoint written
|
|
400
|
+
* by v4 lacks the running per-request maximum, so restoring it could under-read
|
|
401
|
+
* the tier evidence for a cumulative session that crossed the boundary — a
|
|
402
|
+
* version mismatch discards it and re-parses from scratch instead. Bumped to 6
|
|
403
|
+
* with the user-fork inherited-baseline fix: v5 entries and checkpoints treated
|
|
404
|
+
* a fork's replayed parent history as the child's own usage and activity.
|
|
389
405
|
*/
|
|
390
|
-
export declare const localAgentQualitativeParserVersion =
|
|
406
|
+
export declare const localAgentQualitativeParserVersion = 6;
|
|
391
407
|
/**
|
|
392
408
|
* Conservative launch defaults for action-capable qualitative evidence.
|
|
393
409
|
* Callers must still inspect `qualitativeCoverage` before deriving a finding:
|