@agent-finops/core 0.7.0 → 0.7.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.
- package/dist/agentEconomicsReceipt.d.ts +934 -0
- package/dist/agentEconomicsReceipt.js +1005 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AGENT_ECONOMICS_RECEIPT_KIND: "aibill.agent_economics_receipt";
|
|
3
|
+
export declare const AGENT_ECONOMICS_RECEIPT_V0_VERSION: "0.1.0";
|
|
4
|
+
declare const financialEvidenceWithAmountSchema: z.ZodEnum<{
|
|
5
|
+
verified: "verified";
|
|
6
|
+
estimated: "estimated";
|
|
7
|
+
detected_unverified: "detected_unverified";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const receiptModeValues: readonly ["local", "connected", "mixed", "sample"];
|
|
10
|
+
export declare const receiptModeSchema: z.ZodEnum<{
|
|
11
|
+
local: "local";
|
|
12
|
+
mixed: "mixed";
|
|
13
|
+
sample: "sample";
|
|
14
|
+
connected: "connected";
|
|
15
|
+
}>;
|
|
16
|
+
export type ReceiptMode = z.infer<typeof receiptModeSchema>;
|
|
17
|
+
export declare const receiptSourceKindValues: readonly ["local_agent_log", "provider_billing_api", "provider_usage_api", "user_declaration", "sample_fixture"];
|
|
18
|
+
export declare const receiptSourceKindSchema: z.ZodEnum<{
|
|
19
|
+
local_agent_log: "local_agent_log";
|
|
20
|
+
provider_billing_api: "provider_billing_api";
|
|
21
|
+
provider_usage_api: "provider_usage_api";
|
|
22
|
+
user_declaration: "user_declaration";
|
|
23
|
+
sample_fixture: "sample_fixture";
|
|
24
|
+
}>;
|
|
25
|
+
export type ReceiptSourceKind = z.infer<typeof receiptSourceKindSchema>;
|
|
26
|
+
export declare const receiptProvenanceOriginValues: readonly ["provider_reported", "locally_observed", "user_declared", "sample"];
|
|
27
|
+
export declare const receiptProvenanceOriginSchema: z.ZodEnum<{
|
|
28
|
+
sample: "sample";
|
|
29
|
+
provider_reported: "provider_reported";
|
|
30
|
+
locally_observed: "locally_observed";
|
|
31
|
+
user_declared: "user_declared";
|
|
32
|
+
}>;
|
|
33
|
+
export type ReceiptProvenanceOrigin = z.infer<typeof receiptProvenanceOriginSchema>;
|
|
34
|
+
export declare const receiptTransformationValues: readonly ["normalized", "aggregated", "api_rate_estimated"];
|
|
35
|
+
export declare const receiptTransformationSchema: z.ZodEnum<{
|
|
36
|
+
normalized: "normalized";
|
|
37
|
+
aggregated: "aggregated";
|
|
38
|
+
api_rate_estimated: "api_rate_estimated";
|
|
39
|
+
}>;
|
|
40
|
+
export type ReceiptTransformation = z.infer<typeof receiptTransformationSchema>;
|
|
41
|
+
export declare const receiptAccountingBasisValues: readonly ["provider_billed", "api_equivalent", "user_declared"];
|
|
42
|
+
export declare const receiptAccountingBasisSchema: z.ZodEnum<{
|
|
43
|
+
api_equivalent: "api_equivalent";
|
|
44
|
+
provider_billed: "provider_billed";
|
|
45
|
+
user_declared: "user_declared";
|
|
46
|
+
}>;
|
|
47
|
+
export type ReceiptAccountingBasis = z.infer<typeof receiptAccountingBasisSchema>;
|
|
48
|
+
export declare const receiptMappingGapCodeValues: readonly ["cost_unsplit", "cost_unpriced", "model_unmapped", "provider_unmapped", "source_record_unmapped"];
|
|
49
|
+
export declare const receiptMappingGapCodeSchema: z.ZodEnum<{
|
|
50
|
+
cost_unsplit: "cost_unsplit";
|
|
51
|
+
cost_unpriced: "cost_unpriced";
|
|
52
|
+
model_unmapped: "model_unmapped";
|
|
53
|
+
provider_unmapped: "provider_unmapped";
|
|
54
|
+
source_record_unmapped: "source_record_unmapped";
|
|
55
|
+
}>;
|
|
56
|
+
export type ReceiptMappingGapCode = z.infer<typeof receiptMappingGapCodeSchema>;
|
|
57
|
+
export declare const receiptFreshnessSchema: z.ZodPipe<z.ZodObject<{
|
|
58
|
+
status: z.ZodEnum<{
|
|
59
|
+
error: "error";
|
|
60
|
+
fresh: "fresh";
|
|
61
|
+
stale: "stale";
|
|
62
|
+
not_checked: "not_checked";
|
|
63
|
+
}>;
|
|
64
|
+
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
65
|
+
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
66
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
68
|
+
errorCode?: string | undefined;
|
|
69
|
+
latestEvidenceAt?: string | undefined;
|
|
70
|
+
checkedAt?: string | undefined;
|
|
71
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
72
|
+
}, {
|
|
73
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
74
|
+
checkedAt?: string | undefined;
|
|
75
|
+
latestEvidenceAt?: string | undefined;
|
|
76
|
+
errorCode?: string | undefined;
|
|
77
|
+
}>>;
|
|
78
|
+
export type ReceiptFreshness = z.infer<typeof receiptFreshnessSchema>;
|
|
79
|
+
export declare const receiptSourceSchema: z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
kind: z.ZodEnum<{
|
|
82
|
+
local_agent_log: "local_agent_log";
|
|
83
|
+
provider_billing_api: "provider_billing_api";
|
|
84
|
+
provider_usage_api: "provider_usage_api";
|
|
85
|
+
user_declaration: "user_declaration";
|
|
86
|
+
sample_fixture: "sample_fixture";
|
|
87
|
+
}>;
|
|
88
|
+
provider: z.ZodString;
|
|
89
|
+
validationCoverage: z.ZodDefault<z.ZodEnum<{
|
|
90
|
+
live_verified: "live_verified";
|
|
91
|
+
fixture_verified: "fixture_verified";
|
|
92
|
+
untested: "untested";
|
|
93
|
+
failed: "failed";
|
|
94
|
+
}>>;
|
|
95
|
+
freshness: z.ZodPipe<z.ZodObject<{
|
|
96
|
+
status: z.ZodEnum<{
|
|
97
|
+
error: "error";
|
|
98
|
+
fresh: "fresh";
|
|
99
|
+
stale: "stale";
|
|
100
|
+
not_checked: "not_checked";
|
|
101
|
+
}>;
|
|
102
|
+
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
103
|
+
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
104
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
105
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
106
|
+
errorCode?: string | undefined;
|
|
107
|
+
latestEvidenceAt?: string | undefined;
|
|
108
|
+
checkedAt?: string | undefined;
|
|
109
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
110
|
+
}, {
|
|
111
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
112
|
+
checkedAt?: string | undefined;
|
|
113
|
+
latestEvidenceAt?: string | undefined;
|
|
114
|
+
errorCode?: string | undefined;
|
|
115
|
+
}>>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
export type ReceiptSource = z.infer<typeof receiptSourceSchema>;
|
|
118
|
+
export declare const receiptSourceRecordReferenceSchema: z.ZodObject<{
|
|
119
|
+
sourceId: z.ZodString;
|
|
120
|
+
recordId: z.ZodString;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
export type ReceiptSourceRecordReference = z.infer<typeof receiptSourceRecordReferenceSchema>;
|
|
123
|
+
/** Convert a source-native identifier into the only reference form persisted in a receipt. */
|
|
124
|
+
export declare function createReceiptSourceRecordReference(sourceId: string, sourceRecordId: string): ReceiptSourceRecordReference;
|
|
125
|
+
export declare const receiptProvenanceSchema: z.ZodObject<{
|
|
126
|
+
origin: z.ZodEnum<{
|
|
127
|
+
sample: "sample";
|
|
128
|
+
provider_reported: "provider_reported";
|
|
129
|
+
locally_observed: "locally_observed";
|
|
130
|
+
user_declared: "user_declared";
|
|
131
|
+
}>;
|
|
132
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
133
|
+
normalized: "normalized";
|
|
134
|
+
aggregated: "aggregated";
|
|
135
|
+
api_rate_estimated: "api_rate_estimated";
|
|
136
|
+
}>>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
export type ReceiptProvenance = z.infer<typeof receiptProvenanceSchema>;
|
|
139
|
+
export declare const receiptTokenUsageLineSchema: z.ZodObject<{
|
|
140
|
+
kind: z.ZodLiteral<"token_usage">;
|
|
141
|
+
provider: z.ZodString;
|
|
142
|
+
model: z.ZodString;
|
|
143
|
+
requestedModel: z.ZodOptional<z.ZodString>;
|
|
144
|
+
inputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
145
|
+
outputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
sourceId: z.ZodString;
|
|
148
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
149
|
+
granularity: z.ZodEnum<{
|
|
150
|
+
call: "call";
|
|
151
|
+
invocation: "invocation";
|
|
152
|
+
session: "session";
|
|
153
|
+
daily_aggregate: "daily_aggregate";
|
|
154
|
+
usage_bucket: "usage_bucket";
|
|
155
|
+
billing_bucket: "billing_bucket";
|
|
156
|
+
seat: "seat";
|
|
157
|
+
user_aggregate: "user_aggregate";
|
|
158
|
+
}>;
|
|
159
|
+
provenance: z.ZodObject<{
|
|
160
|
+
origin: z.ZodEnum<{
|
|
161
|
+
sample: "sample";
|
|
162
|
+
provider_reported: "provider_reported";
|
|
163
|
+
locally_observed: "locally_observed";
|
|
164
|
+
user_declared: "user_declared";
|
|
165
|
+
}>;
|
|
166
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
167
|
+
normalized: "normalized";
|
|
168
|
+
aggregated: "aggregated";
|
|
169
|
+
api_rate_estimated: "api_rate_estimated";
|
|
170
|
+
}>>;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
173
|
+
sourceId: z.ZodString;
|
|
174
|
+
recordId: z.ZodString;
|
|
175
|
+
}, z.core.$strict>>;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
export type ReceiptTokenUsageLine = z.infer<typeof receiptTokenUsageLineSchema>;
|
|
178
|
+
export declare const receiptFinancialCostLineSchema: z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"financial_cost">;
|
|
180
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
181
|
+
currency: z.ZodLiteral<"USD">;
|
|
182
|
+
accountingBasis: z.ZodEnum<{
|
|
183
|
+
api_equivalent: "api_equivalent";
|
|
184
|
+
provider_billed: "provider_billed";
|
|
185
|
+
user_declared: "user_declared";
|
|
186
|
+
}>;
|
|
187
|
+
financialEvidence: z.ZodEnum<{
|
|
188
|
+
verified: "verified";
|
|
189
|
+
estimated: "estimated";
|
|
190
|
+
detected_unverified: "detected_unverified";
|
|
191
|
+
}>;
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
sourceId: z.ZodString;
|
|
194
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
195
|
+
granularity: z.ZodEnum<{
|
|
196
|
+
call: "call";
|
|
197
|
+
invocation: "invocation";
|
|
198
|
+
session: "session";
|
|
199
|
+
daily_aggregate: "daily_aggregate";
|
|
200
|
+
usage_bucket: "usage_bucket";
|
|
201
|
+
billing_bucket: "billing_bucket";
|
|
202
|
+
seat: "seat";
|
|
203
|
+
user_aggregate: "user_aggregate";
|
|
204
|
+
}>;
|
|
205
|
+
provenance: z.ZodObject<{
|
|
206
|
+
origin: z.ZodEnum<{
|
|
207
|
+
sample: "sample";
|
|
208
|
+
provider_reported: "provider_reported";
|
|
209
|
+
locally_observed: "locally_observed";
|
|
210
|
+
user_declared: "user_declared";
|
|
211
|
+
}>;
|
|
212
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
213
|
+
normalized: "normalized";
|
|
214
|
+
aggregated: "aggregated";
|
|
215
|
+
api_rate_estimated: "api_rate_estimated";
|
|
216
|
+
}>>;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
219
|
+
sourceId: z.ZodString;
|
|
220
|
+
recordId: z.ZodString;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
export type ReceiptFinancialCostLine = z.infer<typeof receiptFinancialCostLineSchema>;
|
|
224
|
+
export declare const receiptLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
225
|
+
kind: z.ZodLiteral<"token_usage">;
|
|
226
|
+
provider: z.ZodString;
|
|
227
|
+
model: z.ZodString;
|
|
228
|
+
requestedModel: z.ZodOptional<z.ZodString>;
|
|
229
|
+
inputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
230
|
+
outputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
sourceId: z.ZodString;
|
|
233
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
234
|
+
granularity: z.ZodEnum<{
|
|
235
|
+
call: "call";
|
|
236
|
+
invocation: "invocation";
|
|
237
|
+
session: "session";
|
|
238
|
+
daily_aggregate: "daily_aggregate";
|
|
239
|
+
usage_bucket: "usage_bucket";
|
|
240
|
+
billing_bucket: "billing_bucket";
|
|
241
|
+
seat: "seat";
|
|
242
|
+
user_aggregate: "user_aggregate";
|
|
243
|
+
}>;
|
|
244
|
+
provenance: z.ZodObject<{
|
|
245
|
+
origin: z.ZodEnum<{
|
|
246
|
+
sample: "sample";
|
|
247
|
+
provider_reported: "provider_reported";
|
|
248
|
+
locally_observed: "locally_observed";
|
|
249
|
+
user_declared: "user_declared";
|
|
250
|
+
}>;
|
|
251
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
252
|
+
normalized: "normalized";
|
|
253
|
+
aggregated: "aggregated";
|
|
254
|
+
api_rate_estimated: "api_rate_estimated";
|
|
255
|
+
}>>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
258
|
+
sourceId: z.ZodString;
|
|
259
|
+
recordId: z.ZodString;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
262
|
+
kind: z.ZodLiteral<"financial_cost">;
|
|
263
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
264
|
+
currency: z.ZodLiteral<"USD">;
|
|
265
|
+
accountingBasis: z.ZodEnum<{
|
|
266
|
+
api_equivalent: "api_equivalent";
|
|
267
|
+
provider_billed: "provider_billed";
|
|
268
|
+
user_declared: "user_declared";
|
|
269
|
+
}>;
|
|
270
|
+
financialEvidence: z.ZodEnum<{
|
|
271
|
+
verified: "verified";
|
|
272
|
+
estimated: "estimated";
|
|
273
|
+
detected_unverified: "detected_unverified";
|
|
274
|
+
}>;
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
sourceId: z.ZodString;
|
|
277
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
278
|
+
granularity: z.ZodEnum<{
|
|
279
|
+
call: "call";
|
|
280
|
+
invocation: "invocation";
|
|
281
|
+
session: "session";
|
|
282
|
+
daily_aggregate: "daily_aggregate";
|
|
283
|
+
usage_bucket: "usage_bucket";
|
|
284
|
+
billing_bucket: "billing_bucket";
|
|
285
|
+
seat: "seat";
|
|
286
|
+
user_aggregate: "user_aggregate";
|
|
287
|
+
}>;
|
|
288
|
+
provenance: z.ZodObject<{
|
|
289
|
+
origin: z.ZodEnum<{
|
|
290
|
+
sample: "sample";
|
|
291
|
+
provider_reported: "provider_reported";
|
|
292
|
+
locally_observed: "locally_observed";
|
|
293
|
+
user_declared: "user_declared";
|
|
294
|
+
}>;
|
|
295
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
296
|
+
normalized: "normalized";
|
|
297
|
+
aggregated: "aggregated";
|
|
298
|
+
api_rate_estimated: "api_rate_estimated";
|
|
299
|
+
}>>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
302
|
+
sourceId: z.ZodString;
|
|
303
|
+
recordId: z.ZodString;
|
|
304
|
+
}, z.core.$strict>>;
|
|
305
|
+
}, z.core.$strict>], "kind">;
|
|
306
|
+
export type ReceiptLine = z.infer<typeof receiptLineSchema>;
|
|
307
|
+
export declare const receiptMappingGapSchema: z.ZodPipe<z.ZodObject<{
|
|
308
|
+
code: z.ZodEnum<{
|
|
309
|
+
cost_unsplit: "cost_unsplit";
|
|
310
|
+
cost_unpriced: "cost_unpriced";
|
|
311
|
+
model_unmapped: "model_unmapped";
|
|
312
|
+
provider_unmapped: "provider_unmapped";
|
|
313
|
+
source_record_unmapped: "source_record_unmapped";
|
|
314
|
+
}>;
|
|
315
|
+
lineId: z.ZodOptional<z.ZodString>;
|
|
316
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
317
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
318
|
+
sourceId?: string | undefined;
|
|
319
|
+
lineId?: string | undefined;
|
|
320
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
321
|
+
}, {
|
|
322
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
323
|
+
lineId?: string | undefined;
|
|
324
|
+
sourceId?: string | undefined;
|
|
325
|
+
}>>;
|
|
326
|
+
export type ReceiptMappingGap = z.infer<typeof receiptMappingGapSchema>;
|
|
327
|
+
export declare const receiptCostTotalSchema: z.ZodObject<{
|
|
328
|
+
accountingBasis: z.ZodEnum<{
|
|
329
|
+
api_equivalent: "api_equivalent";
|
|
330
|
+
provider_billed: "provider_billed";
|
|
331
|
+
user_declared: "user_declared";
|
|
332
|
+
}>;
|
|
333
|
+
financialEvidence: z.ZodEnum<{
|
|
334
|
+
verified: "verified";
|
|
335
|
+
estimated: "estimated";
|
|
336
|
+
detected_unverified: "detected_unverified";
|
|
337
|
+
}>;
|
|
338
|
+
currency: z.ZodLiteral<"USD">;
|
|
339
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
340
|
+
lineCount: z.ZodNumber;
|
|
341
|
+
}, z.core.$strict>;
|
|
342
|
+
export type ReceiptCostTotal = z.infer<typeof receiptCostTotalSchema>;
|
|
343
|
+
declare const receiptBodyObjectSchema: z.ZodObject<{
|
|
344
|
+
kind: z.ZodLiteral<"aibill.agent_economics_receipt">;
|
|
345
|
+
schemaVersion: z.ZodLiteral<"0.1.0">;
|
|
346
|
+
generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
347
|
+
mode: z.ZodEnum<{
|
|
348
|
+
local: "local";
|
|
349
|
+
mixed: "mixed";
|
|
350
|
+
sample: "sample";
|
|
351
|
+
connected: "connected";
|
|
352
|
+
}>;
|
|
353
|
+
demoOnly: z.ZodBoolean;
|
|
354
|
+
window: z.ZodObject<{
|
|
355
|
+
start: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
356
|
+
end: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
357
|
+
}, z.core.$strict>;
|
|
358
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
359
|
+
id: z.ZodString;
|
|
360
|
+
kind: z.ZodEnum<{
|
|
361
|
+
local_agent_log: "local_agent_log";
|
|
362
|
+
provider_billing_api: "provider_billing_api";
|
|
363
|
+
provider_usage_api: "provider_usage_api";
|
|
364
|
+
user_declaration: "user_declaration";
|
|
365
|
+
sample_fixture: "sample_fixture";
|
|
366
|
+
}>;
|
|
367
|
+
provider: z.ZodString;
|
|
368
|
+
validationCoverage: z.ZodDefault<z.ZodEnum<{
|
|
369
|
+
live_verified: "live_verified";
|
|
370
|
+
fixture_verified: "fixture_verified";
|
|
371
|
+
untested: "untested";
|
|
372
|
+
failed: "failed";
|
|
373
|
+
}>>;
|
|
374
|
+
freshness: z.ZodPipe<z.ZodObject<{
|
|
375
|
+
status: z.ZodEnum<{
|
|
376
|
+
error: "error";
|
|
377
|
+
fresh: "fresh";
|
|
378
|
+
stale: "stale";
|
|
379
|
+
not_checked: "not_checked";
|
|
380
|
+
}>;
|
|
381
|
+
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
382
|
+
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
383
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
385
|
+
errorCode?: string | undefined;
|
|
386
|
+
latestEvidenceAt?: string | undefined;
|
|
387
|
+
checkedAt?: string | undefined;
|
|
388
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
389
|
+
}, {
|
|
390
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
391
|
+
checkedAt?: string | undefined;
|
|
392
|
+
latestEvidenceAt?: string | undefined;
|
|
393
|
+
errorCode?: string | undefined;
|
|
394
|
+
}>>;
|
|
395
|
+
}, z.core.$strict>>;
|
|
396
|
+
lines: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
397
|
+
kind: z.ZodLiteral<"token_usage">;
|
|
398
|
+
provider: z.ZodString;
|
|
399
|
+
model: z.ZodString;
|
|
400
|
+
requestedModel: z.ZodOptional<z.ZodString>;
|
|
401
|
+
inputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
402
|
+
outputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
403
|
+
id: z.ZodString;
|
|
404
|
+
sourceId: z.ZodString;
|
|
405
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
406
|
+
granularity: z.ZodEnum<{
|
|
407
|
+
call: "call";
|
|
408
|
+
invocation: "invocation";
|
|
409
|
+
session: "session";
|
|
410
|
+
daily_aggregate: "daily_aggregate";
|
|
411
|
+
usage_bucket: "usage_bucket";
|
|
412
|
+
billing_bucket: "billing_bucket";
|
|
413
|
+
seat: "seat";
|
|
414
|
+
user_aggregate: "user_aggregate";
|
|
415
|
+
}>;
|
|
416
|
+
provenance: z.ZodObject<{
|
|
417
|
+
origin: z.ZodEnum<{
|
|
418
|
+
sample: "sample";
|
|
419
|
+
provider_reported: "provider_reported";
|
|
420
|
+
locally_observed: "locally_observed";
|
|
421
|
+
user_declared: "user_declared";
|
|
422
|
+
}>;
|
|
423
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
424
|
+
normalized: "normalized";
|
|
425
|
+
aggregated: "aggregated";
|
|
426
|
+
api_rate_estimated: "api_rate_estimated";
|
|
427
|
+
}>>;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
430
|
+
sourceId: z.ZodString;
|
|
431
|
+
recordId: z.ZodString;
|
|
432
|
+
}, z.core.$strict>>;
|
|
433
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
434
|
+
kind: z.ZodLiteral<"financial_cost">;
|
|
435
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
436
|
+
currency: z.ZodLiteral<"USD">;
|
|
437
|
+
accountingBasis: z.ZodEnum<{
|
|
438
|
+
api_equivalent: "api_equivalent";
|
|
439
|
+
provider_billed: "provider_billed";
|
|
440
|
+
user_declared: "user_declared";
|
|
441
|
+
}>;
|
|
442
|
+
financialEvidence: z.ZodEnum<{
|
|
443
|
+
verified: "verified";
|
|
444
|
+
estimated: "estimated";
|
|
445
|
+
detected_unverified: "detected_unverified";
|
|
446
|
+
}>;
|
|
447
|
+
id: z.ZodString;
|
|
448
|
+
sourceId: z.ZodString;
|
|
449
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
450
|
+
granularity: z.ZodEnum<{
|
|
451
|
+
call: "call";
|
|
452
|
+
invocation: "invocation";
|
|
453
|
+
session: "session";
|
|
454
|
+
daily_aggregate: "daily_aggregate";
|
|
455
|
+
usage_bucket: "usage_bucket";
|
|
456
|
+
billing_bucket: "billing_bucket";
|
|
457
|
+
seat: "seat";
|
|
458
|
+
user_aggregate: "user_aggregate";
|
|
459
|
+
}>;
|
|
460
|
+
provenance: z.ZodObject<{
|
|
461
|
+
origin: z.ZodEnum<{
|
|
462
|
+
sample: "sample";
|
|
463
|
+
provider_reported: "provider_reported";
|
|
464
|
+
locally_observed: "locally_observed";
|
|
465
|
+
user_declared: "user_declared";
|
|
466
|
+
}>;
|
|
467
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
468
|
+
normalized: "normalized";
|
|
469
|
+
aggregated: "aggregated";
|
|
470
|
+
api_rate_estimated: "api_rate_estimated";
|
|
471
|
+
}>>;
|
|
472
|
+
}, z.core.$strict>;
|
|
473
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
474
|
+
sourceId: z.ZodString;
|
|
475
|
+
recordId: z.ZodString;
|
|
476
|
+
}, z.core.$strict>>;
|
|
477
|
+
}, z.core.$strict>], "kind">>;
|
|
478
|
+
mappingGaps: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
479
|
+
code: z.ZodEnum<{
|
|
480
|
+
cost_unsplit: "cost_unsplit";
|
|
481
|
+
cost_unpriced: "cost_unpriced";
|
|
482
|
+
model_unmapped: "model_unmapped";
|
|
483
|
+
provider_unmapped: "provider_unmapped";
|
|
484
|
+
source_record_unmapped: "source_record_unmapped";
|
|
485
|
+
}>;
|
|
486
|
+
lineId: z.ZodOptional<z.ZodString>;
|
|
487
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
488
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
489
|
+
sourceId?: string | undefined;
|
|
490
|
+
lineId?: string | undefined;
|
|
491
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
492
|
+
}, {
|
|
493
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
494
|
+
lineId?: string | undefined;
|
|
495
|
+
sourceId?: string | undefined;
|
|
496
|
+
}>>>;
|
|
497
|
+
}, z.core.$strict>;
|
|
498
|
+
export declare const agentEconomicsReceiptV0DraftSchema: z.ZodObject<{
|
|
499
|
+
kind: z.ZodLiteral<"aibill.agent_economics_receipt">;
|
|
500
|
+
schemaVersion: z.ZodLiteral<"0.1.0">;
|
|
501
|
+
generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
502
|
+
mode: z.ZodEnum<{
|
|
503
|
+
local: "local";
|
|
504
|
+
mixed: "mixed";
|
|
505
|
+
sample: "sample";
|
|
506
|
+
connected: "connected";
|
|
507
|
+
}>;
|
|
508
|
+
demoOnly: z.ZodBoolean;
|
|
509
|
+
window: z.ZodObject<{
|
|
510
|
+
start: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
511
|
+
end: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
512
|
+
}, z.core.$strict>;
|
|
513
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
514
|
+
id: z.ZodString;
|
|
515
|
+
kind: z.ZodEnum<{
|
|
516
|
+
local_agent_log: "local_agent_log";
|
|
517
|
+
provider_billing_api: "provider_billing_api";
|
|
518
|
+
provider_usage_api: "provider_usage_api";
|
|
519
|
+
user_declaration: "user_declaration";
|
|
520
|
+
sample_fixture: "sample_fixture";
|
|
521
|
+
}>;
|
|
522
|
+
provider: z.ZodString;
|
|
523
|
+
validationCoverage: z.ZodDefault<z.ZodEnum<{
|
|
524
|
+
live_verified: "live_verified";
|
|
525
|
+
fixture_verified: "fixture_verified";
|
|
526
|
+
untested: "untested";
|
|
527
|
+
failed: "failed";
|
|
528
|
+
}>>;
|
|
529
|
+
freshness: z.ZodPipe<z.ZodObject<{
|
|
530
|
+
status: z.ZodEnum<{
|
|
531
|
+
error: "error";
|
|
532
|
+
fresh: "fresh";
|
|
533
|
+
stale: "stale";
|
|
534
|
+
not_checked: "not_checked";
|
|
535
|
+
}>;
|
|
536
|
+
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
537
|
+
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
538
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
539
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
540
|
+
errorCode?: string | undefined;
|
|
541
|
+
latestEvidenceAt?: string | undefined;
|
|
542
|
+
checkedAt?: string | undefined;
|
|
543
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
544
|
+
}, {
|
|
545
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
546
|
+
checkedAt?: string | undefined;
|
|
547
|
+
latestEvidenceAt?: string | undefined;
|
|
548
|
+
errorCode?: string | undefined;
|
|
549
|
+
}>>;
|
|
550
|
+
}, z.core.$strict>>;
|
|
551
|
+
lines: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
552
|
+
kind: z.ZodLiteral<"token_usage">;
|
|
553
|
+
provider: z.ZodString;
|
|
554
|
+
model: z.ZodString;
|
|
555
|
+
requestedModel: z.ZodOptional<z.ZodString>;
|
|
556
|
+
inputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
557
|
+
outputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
558
|
+
id: z.ZodString;
|
|
559
|
+
sourceId: z.ZodString;
|
|
560
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
561
|
+
granularity: z.ZodEnum<{
|
|
562
|
+
call: "call";
|
|
563
|
+
invocation: "invocation";
|
|
564
|
+
session: "session";
|
|
565
|
+
daily_aggregate: "daily_aggregate";
|
|
566
|
+
usage_bucket: "usage_bucket";
|
|
567
|
+
billing_bucket: "billing_bucket";
|
|
568
|
+
seat: "seat";
|
|
569
|
+
user_aggregate: "user_aggregate";
|
|
570
|
+
}>;
|
|
571
|
+
provenance: z.ZodObject<{
|
|
572
|
+
origin: z.ZodEnum<{
|
|
573
|
+
sample: "sample";
|
|
574
|
+
provider_reported: "provider_reported";
|
|
575
|
+
locally_observed: "locally_observed";
|
|
576
|
+
user_declared: "user_declared";
|
|
577
|
+
}>;
|
|
578
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
579
|
+
normalized: "normalized";
|
|
580
|
+
aggregated: "aggregated";
|
|
581
|
+
api_rate_estimated: "api_rate_estimated";
|
|
582
|
+
}>>;
|
|
583
|
+
}, z.core.$strict>;
|
|
584
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
585
|
+
sourceId: z.ZodString;
|
|
586
|
+
recordId: z.ZodString;
|
|
587
|
+
}, z.core.$strict>>;
|
|
588
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
589
|
+
kind: z.ZodLiteral<"financial_cost">;
|
|
590
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
591
|
+
currency: z.ZodLiteral<"USD">;
|
|
592
|
+
accountingBasis: z.ZodEnum<{
|
|
593
|
+
api_equivalent: "api_equivalent";
|
|
594
|
+
provider_billed: "provider_billed";
|
|
595
|
+
user_declared: "user_declared";
|
|
596
|
+
}>;
|
|
597
|
+
financialEvidence: z.ZodEnum<{
|
|
598
|
+
verified: "verified";
|
|
599
|
+
estimated: "estimated";
|
|
600
|
+
detected_unverified: "detected_unverified";
|
|
601
|
+
}>;
|
|
602
|
+
id: z.ZodString;
|
|
603
|
+
sourceId: z.ZodString;
|
|
604
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
605
|
+
granularity: z.ZodEnum<{
|
|
606
|
+
call: "call";
|
|
607
|
+
invocation: "invocation";
|
|
608
|
+
session: "session";
|
|
609
|
+
daily_aggregate: "daily_aggregate";
|
|
610
|
+
usage_bucket: "usage_bucket";
|
|
611
|
+
billing_bucket: "billing_bucket";
|
|
612
|
+
seat: "seat";
|
|
613
|
+
user_aggregate: "user_aggregate";
|
|
614
|
+
}>;
|
|
615
|
+
provenance: z.ZodObject<{
|
|
616
|
+
origin: z.ZodEnum<{
|
|
617
|
+
sample: "sample";
|
|
618
|
+
provider_reported: "provider_reported";
|
|
619
|
+
locally_observed: "locally_observed";
|
|
620
|
+
user_declared: "user_declared";
|
|
621
|
+
}>;
|
|
622
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
623
|
+
normalized: "normalized";
|
|
624
|
+
aggregated: "aggregated";
|
|
625
|
+
api_rate_estimated: "api_rate_estimated";
|
|
626
|
+
}>>;
|
|
627
|
+
}, z.core.$strict>;
|
|
628
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
629
|
+
sourceId: z.ZodString;
|
|
630
|
+
recordId: z.ZodString;
|
|
631
|
+
}, z.core.$strict>>;
|
|
632
|
+
}, z.core.$strict>], "kind">>;
|
|
633
|
+
mappingGaps: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
634
|
+
code: z.ZodEnum<{
|
|
635
|
+
cost_unsplit: "cost_unsplit";
|
|
636
|
+
cost_unpriced: "cost_unpriced";
|
|
637
|
+
model_unmapped: "model_unmapped";
|
|
638
|
+
provider_unmapped: "provider_unmapped";
|
|
639
|
+
source_record_unmapped: "source_record_unmapped";
|
|
640
|
+
}>;
|
|
641
|
+
lineId: z.ZodOptional<z.ZodString>;
|
|
642
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
643
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
644
|
+
sourceId?: string | undefined;
|
|
645
|
+
lineId?: string | undefined;
|
|
646
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
647
|
+
}, {
|
|
648
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
649
|
+
lineId?: string | undefined;
|
|
650
|
+
sourceId?: string | undefined;
|
|
651
|
+
}>>>;
|
|
652
|
+
}, z.core.$strict>;
|
|
653
|
+
export type AgentEconomicsReceiptV0Draft = z.infer<typeof agentEconomicsReceiptV0DraftSchema>;
|
|
654
|
+
export type AgentEconomicsReceiptV0DraftInput = z.input<typeof receiptBodyObjectSchema>;
|
|
655
|
+
export declare const agentEconomicsReceiptV0Schema: z.ZodObject<{
|
|
656
|
+
kind: z.ZodLiteral<"aibill.agent_economics_receipt">;
|
|
657
|
+
schemaVersion: z.ZodLiteral<"0.1.0">;
|
|
658
|
+
generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
659
|
+
mode: z.ZodEnum<{
|
|
660
|
+
local: "local";
|
|
661
|
+
mixed: "mixed";
|
|
662
|
+
sample: "sample";
|
|
663
|
+
connected: "connected";
|
|
664
|
+
}>;
|
|
665
|
+
demoOnly: z.ZodBoolean;
|
|
666
|
+
window: z.ZodObject<{
|
|
667
|
+
start: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
668
|
+
end: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
669
|
+
}, z.core.$strict>;
|
|
670
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
671
|
+
id: z.ZodString;
|
|
672
|
+
kind: z.ZodEnum<{
|
|
673
|
+
local_agent_log: "local_agent_log";
|
|
674
|
+
provider_billing_api: "provider_billing_api";
|
|
675
|
+
provider_usage_api: "provider_usage_api";
|
|
676
|
+
user_declaration: "user_declaration";
|
|
677
|
+
sample_fixture: "sample_fixture";
|
|
678
|
+
}>;
|
|
679
|
+
provider: z.ZodString;
|
|
680
|
+
validationCoverage: z.ZodDefault<z.ZodEnum<{
|
|
681
|
+
live_verified: "live_verified";
|
|
682
|
+
fixture_verified: "fixture_verified";
|
|
683
|
+
untested: "untested";
|
|
684
|
+
failed: "failed";
|
|
685
|
+
}>>;
|
|
686
|
+
freshness: z.ZodPipe<z.ZodObject<{
|
|
687
|
+
status: z.ZodEnum<{
|
|
688
|
+
error: "error";
|
|
689
|
+
fresh: "fresh";
|
|
690
|
+
stale: "stale";
|
|
691
|
+
not_checked: "not_checked";
|
|
692
|
+
}>;
|
|
693
|
+
checkedAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
694
|
+
latestEvidenceAt: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
695
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
696
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
697
|
+
errorCode?: string | undefined;
|
|
698
|
+
latestEvidenceAt?: string | undefined;
|
|
699
|
+
checkedAt?: string | undefined;
|
|
700
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
701
|
+
}, {
|
|
702
|
+
status: "error" | "fresh" | "stale" | "not_checked";
|
|
703
|
+
checkedAt?: string | undefined;
|
|
704
|
+
latestEvidenceAt?: string | undefined;
|
|
705
|
+
errorCode?: string | undefined;
|
|
706
|
+
}>>;
|
|
707
|
+
}, z.core.$strict>>;
|
|
708
|
+
lines: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
709
|
+
kind: z.ZodLiteral<"token_usage">;
|
|
710
|
+
provider: z.ZodString;
|
|
711
|
+
model: z.ZodString;
|
|
712
|
+
requestedModel: z.ZodOptional<z.ZodString>;
|
|
713
|
+
inputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
714
|
+
outputTokens: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
715
|
+
id: z.ZodString;
|
|
716
|
+
sourceId: z.ZodString;
|
|
717
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
718
|
+
granularity: z.ZodEnum<{
|
|
719
|
+
call: "call";
|
|
720
|
+
invocation: "invocation";
|
|
721
|
+
session: "session";
|
|
722
|
+
daily_aggregate: "daily_aggregate";
|
|
723
|
+
usage_bucket: "usage_bucket";
|
|
724
|
+
billing_bucket: "billing_bucket";
|
|
725
|
+
seat: "seat";
|
|
726
|
+
user_aggregate: "user_aggregate";
|
|
727
|
+
}>;
|
|
728
|
+
provenance: z.ZodObject<{
|
|
729
|
+
origin: z.ZodEnum<{
|
|
730
|
+
sample: "sample";
|
|
731
|
+
provider_reported: "provider_reported";
|
|
732
|
+
locally_observed: "locally_observed";
|
|
733
|
+
user_declared: "user_declared";
|
|
734
|
+
}>;
|
|
735
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
736
|
+
normalized: "normalized";
|
|
737
|
+
aggregated: "aggregated";
|
|
738
|
+
api_rate_estimated: "api_rate_estimated";
|
|
739
|
+
}>>;
|
|
740
|
+
}, z.core.$strict>;
|
|
741
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
742
|
+
sourceId: z.ZodString;
|
|
743
|
+
recordId: z.ZodString;
|
|
744
|
+
}, z.core.$strict>>;
|
|
745
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
746
|
+
kind: z.ZodLiteral<"financial_cost">;
|
|
747
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
748
|
+
currency: z.ZodLiteral<"USD">;
|
|
749
|
+
accountingBasis: z.ZodEnum<{
|
|
750
|
+
api_equivalent: "api_equivalent";
|
|
751
|
+
provider_billed: "provider_billed";
|
|
752
|
+
user_declared: "user_declared";
|
|
753
|
+
}>;
|
|
754
|
+
financialEvidence: z.ZodEnum<{
|
|
755
|
+
verified: "verified";
|
|
756
|
+
estimated: "estimated";
|
|
757
|
+
detected_unverified: "detected_unverified";
|
|
758
|
+
}>;
|
|
759
|
+
id: z.ZodString;
|
|
760
|
+
sourceId: z.ZodString;
|
|
761
|
+
observedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
762
|
+
granularity: z.ZodEnum<{
|
|
763
|
+
call: "call";
|
|
764
|
+
invocation: "invocation";
|
|
765
|
+
session: "session";
|
|
766
|
+
daily_aggregate: "daily_aggregate";
|
|
767
|
+
usage_bucket: "usage_bucket";
|
|
768
|
+
billing_bucket: "billing_bucket";
|
|
769
|
+
seat: "seat";
|
|
770
|
+
user_aggregate: "user_aggregate";
|
|
771
|
+
}>;
|
|
772
|
+
provenance: z.ZodObject<{
|
|
773
|
+
origin: z.ZodEnum<{
|
|
774
|
+
sample: "sample";
|
|
775
|
+
provider_reported: "provider_reported";
|
|
776
|
+
locally_observed: "locally_observed";
|
|
777
|
+
user_declared: "user_declared";
|
|
778
|
+
}>;
|
|
779
|
+
transformations: z.ZodArray<z.ZodEnum<{
|
|
780
|
+
normalized: "normalized";
|
|
781
|
+
aggregated: "aggregated";
|
|
782
|
+
api_rate_estimated: "api_rate_estimated";
|
|
783
|
+
}>>;
|
|
784
|
+
}, z.core.$strict>;
|
|
785
|
+
sourceRecordReferences: z.ZodArray<z.ZodObject<{
|
|
786
|
+
sourceId: z.ZodString;
|
|
787
|
+
recordId: z.ZodString;
|
|
788
|
+
}, z.core.$strict>>;
|
|
789
|
+
}, z.core.$strict>], "kind">>;
|
|
790
|
+
mappingGaps: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
791
|
+
code: z.ZodEnum<{
|
|
792
|
+
cost_unsplit: "cost_unsplit";
|
|
793
|
+
cost_unpriced: "cost_unpriced";
|
|
794
|
+
model_unmapped: "model_unmapped";
|
|
795
|
+
provider_unmapped: "provider_unmapped";
|
|
796
|
+
source_record_unmapped: "source_record_unmapped";
|
|
797
|
+
}>;
|
|
798
|
+
lineId: z.ZodOptional<z.ZodString>;
|
|
799
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
800
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
801
|
+
sourceId?: string | undefined;
|
|
802
|
+
lineId?: string | undefined;
|
|
803
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
804
|
+
}, {
|
|
805
|
+
code: "cost_unsplit" | "cost_unpriced" | "model_unmapped" | "provider_unmapped" | "source_record_unmapped";
|
|
806
|
+
lineId?: string | undefined;
|
|
807
|
+
sourceId?: string | undefined;
|
|
808
|
+
}>>>;
|
|
809
|
+
id: z.ZodString;
|
|
810
|
+
costTotals: z.ZodArray<z.ZodObject<{
|
|
811
|
+
accountingBasis: z.ZodEnum<{
|
|
812
|
+
api_equivalent: "api_equivalent";
|
|
813
|
+
provider_billed: "provider_billed";
|
|
814
|
+
user_declared: "user_declared";
|
|
815
|
+
}>;
|
|
816
|
+
financialEvidence: z.ZodEnum<{
|
|
817
|
+
verified: "verified";
|
|
818
|
+
estimated: "estimated";
|
|
819
|
+
detected_unverified: "detected_unverified";
|
|
820
|
+
}>;
|
|
821
|
+
currency: z.ZodLiteral<"USD">;
|
|
822
|
+
amountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
|
|
823
|
+
lineCount: z.ZodNumber;
|
|
824
|
+
}, z.core.$strict>>;
|
|
825
|
+
}, z.core.$strict>;
|
|
826
|
+
export type AgentEconomicsReceiptV0 = z.infer<typeof agentEconomicsReceiptV0Schema>;
|
|
827
|
+
/** Build a canonical, content-addressed v0 receipt from validated evidence lines. */
|
|
828
|
+
export declare function createAgentEconomicsReceiptV0(input: AgentEconomicsReceiptV0DraftInput): AgentEconomicsReceiptV0;
|
|
829
|
+
/** Parse and re-canonicalize a serialized receipt, rejecting stale IDs or totals. */
|
|
830
|
+
export declare function parseAgentEconomicsReceiptV0(value: unknown): AgentEconomicsReceiptV0;
|
|
831
|
+
export declare const FOCUS_1_4_PIN: Readonly<{
|
|
832
|
+
readonly standard: "FOCUS";
|
|
833
|
+
readonly version: "1.4";
|
|
834
|
+
readonly status: "ratified";
|
|
835
|
+
}>;
|
|
836
|
+
export declare const FOCUS_1_5_WORKING_DRAFT_PIN: Readonly<{
|
|
837
|
+
readonly standard: "FOCUS";
|
|
838
|
+
readonly version: "1.5";
|
|
839
|
+
readonly status: "working_draft";
|
|
840
|
+
readonly draftAsOf: "2026-08-08";
|
|
841
|
+
}>;
|
|
842
|
+
export declare const focusProjectionTargetSchema: z.ZodEnum<{
|
|
843
|
+
focus_1_4: "focus_1_4";
|
|
844
|
+
focus_1_5_working_draft: "focus_1_5_working_draft";
|
|
845
|
+
}>;
|
|
846
|
+
export type FocusProjectionTarget = z.infer<typeof focusProjectionTargetSchema>;
|
|
847
|
+
export type FocusProjectionGap = {
|
|
848
|
+
code: ReceiptMappingGapCode | "focus_1_4_token_dimensions_unavailable" | "api_equivalent_not_billed_cost" | "user_declared_not_billed_cost";
|
|
849
|
+
lineId?: string;
|
|
850
|
+
sourceId?: string;
|
|
851
|
+
};
|
|
852
|
+
export type FocusTokenProjectionRow = {
|
|
853
|
+
kind: "token_usage";
|
|
854
|
+
rowId: string;
|
|
855
|
+
sourceLineId: string;
|
|
856
|
+
provider: string;
|
|
857
|
+
model: string;
|
|
858
|
+
ConsumedQuantity: number;
|
|
859
|
+
ConsumedUnit: "input_token" | "output_token";
|
|
860
|
+
mapping: "aibill_extension" | "focus_1_5_working_draft";
|
|
861
|
+
sourceRecordReferences: ReceiptSourceRecordReference[];
|
|
862
|
+
};
|
|
863
|
+
export type FocusCostProjectionRow = {
|
|
864
|
+
kind: "financial_cost";
|
|
865
|
+
rowId: string;
|
|
866
|
+
sourceLineId: string;
|
|
867
|
+
provider: string;
|
|
868
|
+
BillingCurrency: "USD";
|
|
869
|
+
BilledCost: number | null;
|
|
870
|
+
extensions: {
|
|
871
|
+
"x_aibill.api_equivalent_cost_usd"?: number;
|
|
872
|
+
"x_aibill.user_declared_cost_usd"?: number;
|
|
873
|
+
};
|
|
874
|
+
accountingBasis: ReceiptAccountingBasis;
|
|
875
|
+
financialEvidence: z.infer<typeof financialEvidenceWithAmountSchema>;
|
|
876
|
+
sourceRecordReferences: ReceiptSourceRecordReference[];
|
|
877
|
+
};
|
|
878
|
+
export type FocusProjection = {
|
|
879
|
+
target: typeof FOCUS_1_4_PIN | typeof FOCUS_1_5_WORKING_DRAFT_PIN;
|
|
880
|
+
receiptId: string;
|
|
881
|
+
rows: Array<FocusTokenProjectionRow | FocusCostProjectionRow>;
|
|
882
|
+
gaps: FocusProjectionGap[];
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* Version-pinned FOCUS projection. It deliberately keeps estimates out of
|
|
886
|
+
* BilledCost and treats pre-1.5 token fields as aibill extensions.
|
|
887
|
+
*/
|
|
888
|
+
export declare function projectAgentEconomicsReceiptV0ToFocus(value: AgentEconomicsReceiptV0, target: FocusProjectionTarget): FocusProjection;
|
|
889
|
+
export declare const OTEL_GENAI_DEVELOPMENT_PIN: Readonly<{
|
|
890
|
+
readonly standard: "OpenTelemetry GenAI semantic conventions";
|
|
891
|
+
readonly version: "development-2026-08-08";
|
|
892
|
+
readonly status: "development";
|
|
893
|
+
}>;
|
|
894
|
+
export type OpenTelemetryGenAiProjectionRow = {
|
|
895
|
+
sourceLineId: string;
|
|
896
|
+
representation: "span_like" | "aggregate_record";
|
|
897
|
+
conformantSpan: false;
|
|
898
|
+
attributes: {
|
|
899
|
+
"gen_ai.provider.name": string;
|
|
900
|
+
"gen_ai.request.model"?: string;
|
|
901
|
+
"gen_ai.usage.input_tokens": number;
|
|
902
|
+
"gen_ai.usage.output_tokens": number;
|
|
903
|
+
};
|
|
904
|
+
sourceRecordReferences: ReceiptSourceRecordReference[];
|
|
905
|
+
};
|
|
906
|
+
export type OpenTelemetryGenAiProjection = {
|
|
907
|
+
target: typeof OTEL_GENAI_DEVELOPMENT_PIN;
|
|
908
|
+
receiptId: string;
|
|
909
|
+
rows: OpenTelemetryGenAiProjectionRow[];
|
|
910
|
+
gaps: Array<{
|
|
911
|
+
code: ReceiptMappingGapCode | "financial_cost_not_projected" | "requested_model_unavailable";
|
|
912
|
+
lineId?: string;
|
|
913
|
+
sourceId?: string;
|
|
914
|
+
}>;
|
|
915
|
+
};
|
|
916
|
+
/** A Development-status attribute projection, never a claimed conformant span. */
|
|
917
|
+
export declare function projectAgentEconomicsReceiptV0ToOpenTelemetryGenAi(value: AgentEconomicsReceiptV0): OpenTelemetryGenAiProjection;
|
|
918
|
+
export declare const TOKENOMICS_TRACKING_PIN: Readonly<{
|
|
919
|
+
readonly standard: "Tokenomics Foundation";
|
|
920
|
+
readonly trackedAsOf: "2026-08-08";
|
|
921
|
+
readonly status: "not_published";
|
|
922
|
+
}>;
|
|
923
|
+
export type TokenomicsProjection = {
|
|
924
|
+
target: typeof TOKENOMICS_TRACKING_PIN;
|
|
925
|
+
receiptId: string;
|
|
926
|
+
rows: [];
|
|
927
|
+
gaps: [{
|
|
928
|
+
code: "technical_specification_not_published";
|
|
929
|
+
}];
|
|
930
|
+
};
|
|
931
|
+
/** No Tokenomics rows are emitted until a technical specification exists. */
|
|
932
|
+
export declare function projectAgentEconomicsReceiptV0ToTokenomics(value: AgentEconomicsReceiptV0): TokenomicsProjection;
|
|
933
|
+
export {};
|
|
934
|
+
//# sourceMappingURL=agentEconomicsReceipt.d.ts.map
|