@agent-finops/core 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +5 -3
  2. package/dist/actionPlanner.d.ts +140 -0
  3. package/dist/actionPlanner.js +938 -0
  4. package/dist/actionVerification.d.ts +1240 -0
  5. package/dist/actionVerification.js +1028 -0
  6. package/dist/activitySnapshot.d.ts +101 -9
  7. package/dist/activitySnapshot.js +145 -6
  8. package/dist/activitySnapshotCache.d.ts +8 -1
  9. package/dist/activitySnapshotCache.js +103 -7
  10. package/dist/agentEconomicsReceipt.d.ts +58 -58
  11. package/dist/analyze.js +3 -1
  12. package/dist/cutList.js +1 -1
  13. package/dist/glance.d.ts +30 -2
  14. package/dist/glance.js +265 -84
  15. package/dist/index.d.ts +11 -2
  16. package/dist/index.js +10 -1
  17. package/dist/insights.js +3 -1
  18. package/dist/localAgentFormats/gemini.js +2 -2
  19. package/dist/localAgentFormats/registry.js +6 -2
  20. package/dist/localAgentFormats/runtimeRegistry.js +5 -2
  21. package/dist/localAgentFormats/types.d.ts +2 -1
  22. package/dist/localAgentLogs.d.ts +362 -3
  23. package/dist/localAgentLogs.js +1964 -165
  24. package/dist/modelPricing.d.ts +1 -1
  25. package/dist/modelPricing.js +4 -1
  26. package/dist/planMath.js +12 -7
  27. package/dist/projectEconomics.d.ts +617 -0
  28. package/dist/projectEconomics.js +620 -0
  29. package/dist/projectEconomicsBuilder.d.ts +89 -0
  30. package/dist/projectEconomicsBuilder.js +473 -0
  31. package/dist/projectIndexStore.d.ts +545 -0
  32. package/dist/projectIndexStore.js +606 -0
  33. package/dist/providerConnectors.d.ts +59 -1
  34. package/dist/providerConnectors.js +192 -12
  35. package/dist/qualitativeIndexCache.d.ts +494 -0
  36. package/dist/qualitativeIndexCache.js +930 -0
  37. package/dist/resultCard.d.ts +350 -0
  38. package/dist/resultCard.js +604 -0
  39. package/dist/runtimeCommands.d.ts +21 -0
  40. package/dist/runtimeCommands.js +27 -0
  41. package/dist/scanGuard.d.ts +3 -1
  42. package/dist/scanGuard.js +164 -4
  43. package/dist/schema.d.ts +31 -31
  44. package/dist/sessionVitals.d.ts +145 -0
  45. package/dist/sessionVitals.js +521 -0
  46. package/dist/sourceRegistry.js +90 -52
  47. package/dist/toolInvocations.d.ts +40 -1
  48. package/dist/toolInvocations.js +101 -20
  49. package/package.json +1 -1
@@ -0,0 +1,617 @@
1
+ import { z } from "zod";
2
+ export declare const OWNERSHIP_SUGGESTION_V0_KIND: "aibill.ownership_suggestion";
3
+ export declare const CONFIRMED_OWNERSHIP_V0_KIND: "aibill.confirmed_ownership";
4
+ export declare const APPROVAL_EVENT_V0_KIND: "aibill.approval_event";
5
+ export declare const ACCEPTED_OUTCOME_V0_KIND: "aibill.accepted_outcome";
6
+ export declare const PROJECT_ECONOMICS_RECEIPT_V0_KIND: "aibill.project_economics_receipt";
7
+ export declare const PROJECT_ECONOMICS_V0_VERSION: "0.1.0";
8
+ export declare const MAX_APPROVAL_EVENTS_V0 = 256;
9
+ export declare const MAX_OUTCOME_CHECK_REFS_V0 = 64;
10
+ export declare const MAX_PROJECT_COST_LINES_V0 = 32;
11
+ /** Opaque privacy-reduced reference; the source-native value is never persisted. */
12
+ export declare const projectEconomicsReferenceSchema: z.ZodString;
13
+ export declare const projectEconomicsEvidenceValues: readonly ["verified", "observed", "calculated", "user_declared", "modeled", "missing"];
14
+ export declare const projectEconomicsEvidenceSchema: z.ZodEnum<{
15
+ verified: "verified";
16
+ missing: "missing";
17
+ observed: "observed";
18
+ calculated: "calculated";
19
+ user_declared: "user_declared";
20
+ modeled: "modeled";
21
+ }>;
22
+ export type ProjectEconomicsEvidence = z.infer<typeof projectEconomicsEvidenceSchema>;
23
+ declare const ownershipSuggestionBodySchema: z.ZodObject<{
24
+ kind: z.ZodLiteral<"aibill.ownership_suggestion">;
25
+ schemaVersion: z.ZodLiteral<"0.1.0">;
26
+ status: z.ZodLiteral<"suggested">;
27
+ generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
28
+ projectRef: z.ZodString;
29
+ suggestedHumanRef: z.ZodOptional<z.ZodString>;
30
+ suggestedTeamRef: z.ZodOptional<z.ZodString>;
31
+ suggestedClientRef: z.ZodOptional<z.ZodString>;
32
+ suggestedCostCenterRef: z.ZodOptional<z.ZodString>;
33
+ source: z.ZodEnum<{
34
+ git_metadata: "git_metadata";
35
+ codeowners: "codeowners";
36
+ repository_metadata: "repository_metadata";
37
+ }>;
38
+ evidence: z.ZodLiteral<"observed">;
39
+ requiresUserConfirmation: z.ZodLiteral<true>;
40
+ }, z.core.$strict>;
41
+ export type OwnershipSuggestionV0DraftInput = z.input<typeof ownershipSuggestionBodySchema>;
42
+ export declare const ownershipSuggestionV0Schema: z.ZodObject<{
43
+ kind: z.ZodLiteral<"aibill.ownership_suggestion">;
44
+ schemaVersion: z.ZodLiteral<"0.1.0">;
45
+ status: z.ZodLiteral<"suggested">;
46
+ generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
47
+ projectRef: z.ZodString;
48
+ suggestedHumanRef: z.ZodOptional<z.ZodString>;
49
+ suggestedTeamRef: z.ZodOptional<z.ZodString>;
50
+ suggestedClientRef: z.ZodOptional<z.ZodString>;
51
+ suggestedCostCenterRef: z.ZodOptional<z.ZodString>;
52
+ source: z.ZodEnum<{
53
+ git_metadata: "git_metadata";
54
+ codeowners: "codeowners";
55
+ repository_metadata: "repository_metadata";
56
+ }>;
57
+ evidence: z.ZodLiteral<"observed">;
58
+ requiresUserConfirmation: z.ZodLiteral<true>;
59
+ id: z.ZodString;
60
+ }, z.core.$strict>;
61
+ export type OwnershipSuggestionV0 = z.infer<typeof ownershipSuggestionV0Schema>;
62
+ declare const confirmedOwnershipBodySchema: z.ZodObject<{
63
+ kind: z.ZodLiteral<"aibill.confirmed_ownership">;
64
+ schemaVersion: z.ZodLiteral<"0.1.0">;
65
+ status: z.ZodLiteral<"confirmed">;
66
+ projectRef: z.ZodString;
67
+ humanOwnerRef: z.ZodString;
68
+ teamRef: z.ZodString;
69
+ clientRef: z.ZodOptional<z.ZodString>;
70
+ costCenterRef: z.ZodOptional<z.ZodString>;
71
+ confirmation: z.ZodObject<{
72
+ evidence: z.ZodLiteral<"user_declared">;
73
+ confirmedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
74
+ confirmedByRef: z.ZodString;
75
+ locallyStored: z.ZodLiteral<true>;
76
+ }, z.core.$strict>;
77
+ }, z.core.$strict>;
78
+ export type ConfirmedOwnershipV0DraftInput = z.input<typeof confirmedOwnershipBodySchema>;
79
+ export declare const confirmedOwnershipV0Schema: z.ZodObject<{
80
+ kind: z.ZodLiteral<"aibill.confirmed_ownership">;
81
+ schemaVersion: z.ZodLiteral<"0.1.0">;
82
+ status: z.ZodLiteral<"confirmed">;
83
+ projectRef: z.ZodString;
84
+ humanOwnerRef: z.ZodString;
85
+ teamRef: z.ZodString;
86
+ clientRef: z.ZodOptional<z.ZodString>;
87
+ costCenterRef: z.ZodOptional<z.ZodString>;
88
+ confirmation: z.ZodObject<{
89
+ evidence: z.ZodLiteral<"user_declared">;
90
+ confirmedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
91
+ confirmedByRef: z.ZodString;
92
+ locallyStored: z.ZodLiteral<true>;
93
+ }, z.core.$strict>;
94
+ id: z.ZodString;
95
+ }, z.core.$strict>;
96
+ export type ConfirmedOwnershipV0 = z.infer<typeof confirmedOwnershipV0Schema>;
97
+ declare const approvalEventBodySchema: z.ZodObject<{
98
+ kind: z.ZodLiteral<"aibill.approval_event">;
99
+ schemaVersion: z.ZodLiteral<"0.1.0">;
100
+ sequence: z.ZodNumber;
101
+ previousEventId: z.ZodNullable<z.ZodString>;
102
+ approvedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
103
+ decision: z.ZodLiteral<"approved">;
104
+ attestation: z.ZodObject<{
105
+ scope: z.ZodLiteral<"local_self_attested">;
106
+ evidence: z.ZodLiteral<"user_declared">;
107
+ approverIdentityRef: z.ZodString;
108
+ approverRoleRef: z.ZodString;
109
+ rbacVerified: z.ZodLiteral<false>;
110
+ }, z.core.$strict>;
111
+ references: z.ZodObject<{
112
+ actionRef: z.ZodString;
113
+ changeRef: z.ZodString;
114
+ rollbackRef: z.ZodString;
115
+ canaryRef: z.ZodString;
116
+ }, z.core.$strict>;
117
+ }, z.core.$strict>;
118
+ export type ApprovalEventV0DraftInput = z.input<typeof approvalEventBodySchema>;
119
+ export declare const approvalEventV0Schema: z.ZodObject<{
120
+ kind: z.ZodLiteral<"aibill.approval_event">;
121
+ schemaVersion: z.ZodLiteral<"0.1.0">;
122
+ sequence: z.ZodNumber;
123
+ previousEventId: z.ZodNullable<z.ZodString>;
124
+ approvedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
125
+ decision: z.ZodLiteral<"approved">;
126
+ attestation: z.ZodObject<{
127
+ scope: z.ZodLiteral<"local_self_attested">;
128
+ evidence: z.ZodLiteral<"user_declared">;
129
+ approverIdentityRef: z.ZodString;
130
+ approverRoleRef: z.ZodString;
131
+ rbacVerified: z.ZodLiteral<false>;
132
+ }, z.core.$strict>;
133
+ references: z.ZodObject<{
134
+ actionRef: z.ZodString;
135
+ changeRef: z.ZodString;
136
+ rollbackRef: z.ZodString;
137
+ canaryRef: z.ZodString;
138
+ }, z.core.$strict>;
139
+ id: z.ZodString;
140
+ }, z.core.$strict>;
141
+ export type ApprovalEventV0 = z.infer<typeof approvalEventV0Schema>;
142
+ declare const acceptedOutcomeBodySchema: z.ZodObject<{
143
+ kind: z.ZodLiteral<"aibill.accepted_outcome">;
144
+ schemaVersion: z.ZodLiteral<"0.1.0">;
145
+ platform: z.ZodLiteral<"github">;
146
+ outcomeType: z.ZodEnum<{
147
+ task: "task";
148
+ pull_request: "pull_request";
149
+ }>;
150
+ repositoryRef: z.ZodString;
151
+ workUnitRef: z.ZodString;
152
+ state: z.ZodEnum<{
153
+ merged: "merged";
154
+ accepted: "accepted";
155
+ }>;
156
+ stateEvidence: z.ZodEnum<{
157
+ verified: "verified";
158
+ observed: "observed";
159
+ user_declared: "user_declared";
160
+ }>;
161
+ acceptedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
162
+ commit: z.ZodObject<{
163
+ commitRef: z.ZodString;
164
+ evidence: z.ZodEnum<{
165
+ verified: "verified";
166
+ observed: "observed";
167
+ }>;
168
+ }, z.core.$strict>;
169
+ checks: z.ZodObject<{
170
+ status: z.ZodLiteral<"passed">;
171
+ evidence: z.ZodEnum<{
172
+ verified: "verified";
173
+ observed: "observed";
174
+ }>;
175
+ evidenceRefs: z.ZodArray<z.ZodString>;
176
+ }, z.core.$strict>;
177
+ businessDescription: z.ZodOptional<z.ZodObject<{
178
+ value: z.ZodString;
179
+ evidence: z.ZodLiteral<"user_declared">;
180
+ }, z.core.$strict>>;
181
+ }, z.core.$strict>;
182
+ export type AcceptedOutcomeV0DraftInput = z.input<typeof acceptedOutcomeBodySchema>;
183
+ export declare const acceptedOutcomeV0Schema: z.ZodObject<{
184
+ kind: z.ZodLiteral<"aibill.accepted_outcome">;
185
+ schemaVersion: z.ZodLiteral<"0.1.0">;
186
+ platform: z.ZodLiteral<"github">;
187
+ outcomeType: z.ZodEnum<{
188
+ task: "task";
189
+ pull_request: "pull_request";
190
+ }>;
191
+ repositoryRef: z.ZodString;
192
+ workUnitRef: z.ZodString;
193
+ state: z.ZodEnum<{
194
+ merged: "merged";
195
+ accepted: "accepted";
196
+ }>;
197
+ stateEvidence: z.ZodEnum<{
198
+ verified: "verified";
199
+ observed: "observed";
200
+ user_declared: "user_declared";
201
+ }>;
202
+ acceptedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
203
+ commit: z.ZodObject<{
204
+ commitRef: z.ZodString;
205
+ evidence: z.ZodEnum<{
206
+ verified: "verified";
207
+ observed: "observed";
208
+ }>;
209
+ }, z.core.$strict>;
210
+ checks: z.ZodObject<{
211
+ status: z.ZodLiteral<"passed">;
212
+ evidence: z.ZodEnum<{
213
+ verified: "verified";
214
+ observed: "observed";
215
+ }>;
216
+ evidenceRefs: z.ZodArray<z.ZodString>;
217
+ }, z.core.$strict>;
218
+ businessDescription: z.ZodOptional<z.ZodObject<{
219
+ value: z.ZodString;
220
+ evidence: z.ZodLiteral<"user_declared">;
221
+ }, z.core.$strict>>;
222
+ id: z.ZodString;
223
+ }, z.core.$strict>;
224
+ export type AcceptedOutcomeV0 = z.infer<typeof acceptedOutcomeV0Schema>;
225
+ export declare const projectCostBasisValues: readonly ["provider_billed", "subscription_included", "api_equivalent_estimate", "user_declared", "missing"];
226
+ export declare const projectCostBasisSchema: z.ZodEnum<{
227
+ missing: "missing";
228
+ user_declared: "user_declared";
229
+ provider_billed: "provider_billed";
230
+ subscription_included: "subscription_included";
231
+ api_equivalent_estimate: "api_equivalent_estimate";
232
+ }>;
233
+ export type ProjectCostBasis = z.infer<typeof projectCostBasisSchema>;
234
+ declare const projectEconomicsReceiptBodySchema: z.ZodObject<{
235
+ kind: z.ZodLiteral<"aibill.project_economics_receipt">;
236
+ schemaVersion: z.ZodLiteral<"0.1.0">;
237
+ generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
238
+ scope: z.ZodObject<{
239
+ projectRef: z.ZodString;
240
+ workUnitRef: z.ZodString;
241
+ }, z.core.$strict>;
242
+ ownership: z.ZodObject<{
243
+ kind: z.ZodLiteral<"aibill.confirmed_ownership">;
244
+ schemaVersion: z.ZodLiteral<"0.1.0">;
245
+ status: z.ZodLiteral<"confirmed">;
246
+ projectRef: z.ZodString;
247
+ humanOwnerRef: z.ZodString;
248
+ teamRef: z.ZodString;
249
+ clientRef: z.ZodOptional<z.ZodString>;
250
+ costCenterRef: z.ZodOptional<z.ZodString>;
251
+ confirmation: z.ZodObject<{
252
+ evidence: z.ZodLiteral<"user_declared">;
253
+ confirmedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
254
+ confirmedByRef: z.ZodString;
255
+ locallyStored: z.ZodLiteral<true>;
256
+ }, z.core.$strict>;
257
+ id: z.ZodString;
258
+ }, z.core.$strict>;
259
+ costs: z.ZodObject<{
260
+ lines: z.ZodArray<z.ZodObject<{
261
+ sourceRef: z.ZodString;
262
+ basis: z.ZodEnum<{
263
+ missing: "missing";
264
+ user_declared: "user_declared";
265
+ provider_billed: "provider_billed";
266
+ subscription_included: "subscription_included";
267
+ api_equivalent_estimate: "api_equivalent_estimate";
268
+ }>;
269
+ amountUsd: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>>;
270
+ evidence: z.ZodEnum<{
271
+ verified: "verified";
272
+ missing: "missing";
273
+ observed: "observed";
274
+ calculated: "calculated";
275
+ user_declared: "user_declared";
276
+ modeled: "modeled";
277
+ }>;
278
+ }, z.core.$strict>>;
279
+ coverage: z.ZodObject<{
280
+ status: z.ZodEnum<{
281
+ missing: "missing";
282
+ complete: "complete";
283
+ partial: "partial";
284
+ }>;
285
+ coveredRecords: z.ZodNumber;
286
+ eligibleRecords: z.ZodNumber;
287
+ evidence: z.ZodEnum<{
288
+ verified: "verified";
289
+ missing: "missing";
290
+ observed: "observed";
291
+ calculated: "calculated";
292
+ }>;
293
+ }, z.core.$strict>;
294
+ }, z.core.$strict>;
295
+ action: z.ZodObject<{
296
+ wasteFindingRef: z.ZodString;
297
+ tokenExperimentRef: z.ZodString;
298
+ tokenExperimentRevisionRef: z.ZodString;
299
+ approvalEvent: z.ZodObject<{
300
+ kind: z.ZodLiteral<"aibill.approval_event">;
301
+ schemaVersion: z.ZodLiteral<"0.1.0">;
302
+ sequence: z.ZodNumber;
303
+ previousEventId: z.ZodNullable<z.ZodString>;
304
+ approvedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
305
+ decision: z.ZodLiteral<"approved">;
306
+ attestation: z.ZodObject<{
307
+ scope: z.ZodLiteral<"local_self_attested">;
308
+ evidence: z.ZodLiteral<"user_declared">;
309
+ approverIdentityRef: z.ZodString;
310
+ approverRoleRef: z.ZodString;
311
+ rbacVerified: z.ZodLiteral<false>;
312
+ }, z.core.$strict>;
313
+ references: z.ZodObject<{
314
+ actionRef: z.ZodString;
315
+ changeRef: z.ZodString;
316
+ rollbackRef: z.ZodString;
317
+ canaryRef: z.ZodString;
318
+ }, z.core.$strict>;
319
+ id: z.ZodString;
320
+ }, z.core.$strict>;
321
+ }, z.core.$strict>;
322
+ outcome: z.ZodObject<{
323
+ kind: z.ZodLiteral<"aibill.accepted_outcome">;
324
+ schemaVersion: z.ZodLiteral<"0.1.0">;
325
+ platform: z.ZodLiteral<"github">;
326
+ outcomeType: z.ZodEnum<{
327
+ task: "task";
328
+ pull_request: "pull_request";
329
+ }>;
330
+ repositoryRef: z.ZodString;
331
+ workUnitRef: z.ZodString;
332
+ state: z.ZodEnum<{
333
+ merged: "merged";
334
+ accepted: "accepted";
335
+ }>;
336
+ stateEvidence: z.ZodEnum<{
337
+ verified: "verified";
338
+ observed: "observed";
339
+ user_declared: "user_declared";
340
+ }>;
341
+ acceptedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
342
+ commit: z.ZodObject<{
343
+ commitRef: z.ZodString;
344
+ evidence: z.ZodEnum<{
345
+ verified: "verified";
346
+ observed: "observed";
347
+ }>;
348
+ }, z.core.$strict>;
349
+ checks: z.ZodObject<{
350
+ status: z.ZodLiteral<"passed">;
351
+ evidence: z.ZodEnum<{
352
+ verified: "verified";
353
+ observed: "observed";
354
+ }>;
355
+ evidenceRefs: z.ZodArray<z.ZodString>;
356
+ }, z.core.$strict>;
357
+ businessDescription: z.ZodOptional<z.ZodObject<{
358
+ value: z.ZodString;
359
+ evidence: z.ZodLiteral<"user_declared">;
360
+ }, z.core.$strict>>;
361
+ id: z.ZodString;
362
+ }, z.core.$strict>;
363
+ measuredTokenResult: z.ZodObject<{
364
+ status: z.ZodEnum<{
365
+ measured_token_reduction: "measured_token_reduction";
366
+ no_measured_change: "no_measured_change";
367
+ regressed: "regressed";
368
+ inconclusive: "inconclusive";
369
+ }>;
370
+ baselineMedianTokens: z.ZodNullable<z.ZodNumber>;
371
+ postChangeMedianTokens: z.ZodNullable<z.ZodNumber>;
372
+ baselineSessions: z.ZodNumber;
373
+ postChangeSessions: z.ZodNumber;
374
+ reductionPercent: z.ZodNullable<z.ZodNumber>;
375
+ metricEvidence: z.ZodEnum<{
376
+ missing: "missing";
377
+ calculated: "calculated";
378
+ }>;
379
+ matchingEvidence: z.ZodEnum<{
380
+ verified: "verified";
381
+ missing: "missing";
382
+ observed: "observed";
383
+ user_declared: "user_declared";
384
+ }>;
385
+ qualityStatus: z.ZodEnum<{
386
+ regressed: "regressed";
387
+ held: "held";
388
+ insufficient: "insufficient";
389
+ }>;
390
+ qualityEvidence: z.ZodEnum<{
391
+ verified: "verified";
392
+ missing: "missing";
393
+ observed: "observed";
394
+ user_declared: "user_declared";
395
+ }>;
396
+ }, z.core.$strict>;
397
+ billReconciliation: z.ZodDiscriminatedUnion<[z.ZodObject<{
398
+ status: z.ZodLiteral<"not_attempted">;
399
+ evidence: z.ZodLiteral<"missing">;
400
+ }, z.core.$strict>, z.ZodObject<{
401
+ status: z.ZodLiteral<"partial">;
402
+ evidence: z.ZodLiteral<"verified">;
403
+ providerBillRef: z.ZodString;
404
+ coveragePercent: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
405
+ matchedAmountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
406
+ varianceUsd: z.ZodOptional<z.ZodNumber>;
407
+ }, z.core.$strict>], "status">;
408
+ claims: z.ZodObject<{
409
+ roi: z.ZodLiteral<"not_claimed">;
410
+ invoiceReconciled: z.ZodLiteral<false>;
411
+ rbacVerified: z.ZodLiteral<false>;
412
+ }, z.core.$strict>;
413
+ }, z.core.$strict>;
414
+ export type ProjectEconomicsReceiptV0DraftInput = z.input<typeof projectEconomicsReceiptBodySchema>;
415
+ export declare const projectEconomicsReceiptV0Schema: z.ZodObject<{
416
+ kind: z.ZodLiteral<"aibill.project_economics_receipt">;
417
+ schemaVersion: z.ZodLiteral<"0.1.0">;
418
+ generatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
419
+ scope: z.ZodObject<{
420
+ projectRef: z.ZodString;
421
+ workUnitRef: z.ZodString;
422
+ }, z.core.$strict>;
423
+ ownership: z.ZodObject<{
424
+ kind: z.ZodLiteral<"aibill.confirmed_ownership">;
425
+ schemaVersion: z.ZodLiteral<"0.1.0">;
426
+ status: z.ZodLiteral<"confirmed">;
427
+ projectRef: z.ZodString;
428
+ humanOwnerRef: z.ZodString;
429
+ teamRef: z.ZodString;
430
+ clientRef: z.ZodOptional<z.ZodString>;
431
+ costCenterRef: z.ZodOptional<z.ZodString>;
432
+ confirmation: z.ZodObject<{
433
+ evidence: z.ZodLiteral<"user_declared">;
434
+ confirmedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
435
+ confirmedByRef: z.ZodString;
436
+ locallyStored: z.ZodLiteral<true>;
437
+ }, z.core.$strict>;
438
+ id: z.ZodString;
439
+ }, z.core.$strict>;
440
+ costs: z.ZodObject<{
441
+ lines: z.ZodArray<z.ZodObject<{
442
+ sourceRef: z.ZodString;
443
+ basis: z.ZodEnum<{
444
+ missing: "missing";
445
+ user_declared: "user_declared";
446
+ provider_billed: "provider_billed";
447
+ subscription_included: "subscription_included";
448
+ api_equivalent_estimate: "api_equivalent_estimate";
449
+ }>;
450
+ amountUsd: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>>;
451
+ evidence: z.ZodEnum<{
452
+ verified: "verified";
453
+ missing: "missing";
454
+ observed: "observed";
455
+ calculated: "calculated";
456
+ user_declared: "user_declared";
457
+ modeled: "modeled";
458
+ }>;
459
+ }, z.core.$strict>>;
460
+ coverage: z.ZodObject<{
461
+ status: z.ZodEnum<{
462
+ missing: "missing";
463
+ complete: "complete";
464
+ partial: "partial";
465
+ }>;
466
+ coveredRecords: z.ZodNumber;
467
+ eligibleRecords: z.ZodNumber;
468
+ evidence: z.ZodEnum<{
469
+ verified: "verified";
470
+ missing: "missing";
471
+ observed: "observed";
472
+ calculated: "calculated";
473
+ }>;
474
+ }, z.core.$strict>;
475
+ }, z.core.$strict>;
476
+ action: z.ZodObject<{
477
+ wasteFindingRef: z.ZodString;
478
+ tokenExperimentRef: z.ZodString;
479
+ tokenExperimentRevisionRef: z.ZodString;
480
+ approvalEvent: z.ZodObject<{
481
+ kind: z.ZodLiteral<"aibill.approval_event">;
482
+ schemaVersion: z.ZodLiteral<"0.1.0">;
483
+ sequence: z.ZodNumber;
484
+ previousEventId: z.ZodNullable<z.ZodString>;
485
+ approvedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
486
+ decision: z.ZodLiteral<"approved">;
487
+ attestation: z.ZodObject<{
488
+ scope: z.ZodLiteral<"local_self_attested">;
489
+ evidence: z.ZodLiteral<"user_declared">;
490
+ approverIdentityRef: z.ZodString;
491
+ approverRoleRef: z.ZodString;
492
+ rbacVerified: z.ZodLiteral<false>;
493
+ }, z.core.$strict>;
494
+ references: z.ZodObject<{
495
+ actionRef: z.ZodString;
496
+ changeRef: z.ZodString;
497
+ rollbackRef: z.ZodString;
498
+ canaryRef: z.ZodString;
499
+ }, z.core.$strict>;
500
+ id: z.ZodString;
501
+ }, z.core.$strict>;
502
+ }, z.core.$strict>;
503
+ outcome: z.ZodObject<{
504
+ kind: z.ZodLiteral<"aibill.accepted_outcome">;
505
+ schemaVersion: z.ZodLiteral<"0.1.0">;
506
+ platform: z.ZodLiteral<"github">;
507
+ outcomeType: z.ZodEnum<{
508
+ task: "task";
509
+ pull_request: "pull_request";
510
+ }>;
511
+ repositoryRef: z.ZodString;
512
+ workUnitRef: z.ZodString;
513
+ state: z.ZodEnum<{
514
+ merged: "merged";
515
+ accepted: "accepted";
516
+ }>;
517
+ stateEvidence: z.ZodEnum<{
518
+ verified: "verified";
519
+ observed: "observed";
520
+ user_declared: "user_declared";
521
+ }>;
522
+ acceptedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
523
+ commit: z.ZodObject<{
524
+ commitRef: z.ZodString;
525
+ evidence: z.ZodEnum<{
526
+ verified: "verified";
527
+ observed: "observed";
528
+ }>;
529
+ }, z.core.$strict>;
530
+ checks: z.ZodObject<{
531
+ status: z.ZodLiteral<"passed">;
532
+ evidence: z.ZodEnum<{
533
+ verified: "verified";
534
+ observed: "observed";
535
+ }>;
536
+ evidenceRefs: z.ZodArray<z.ZodString>;
537
+ }, z.core.$strict>;
538
+ businessDescription: z.ZodOptional<z.ZodObject<{
539
+ value: z.ZodString;
540
+ evidence: z.ZodLiteral<"user_declared">;
541
+ }, z.core.$strict>>;
542
+ id: z.ZodString;
543
+ }, z.core.$strict>;
544
+ measuredTokenResult: z.ZodObject<{
545
+ status: z.ZodEnum<{
546
+ measured_token_reduction: "measured_token_reduction";
547
+ no_measured_change: "no_measured_change";
548
+ regressed: "regressed";
549
+ inconclusive: "inconclusive";
550
+ }>;
551
+ baselineMedianTokens: z.ZodNullable<z.ZodNumber>;
552
+ postChangeMedianTokens: z.ZodNullable<z.ZodNumber>;
553
+ baselineSessions: z.ZodNumber;
554
+ postChangeSessions: z.ZodNumber;
555
+ reductionPercent: z.ZodNullable<z.ZodNumber>;
556
+ metricEvidence: z.ZodEnum<{
557
+ missing: "missing";
558
+ calculated: "calculated";
559
+ }>;
560
+ matchingEvidence: z.ZodEnum<{
561
+ verified: "verified";
562
+ missing: "missing";
563
+ observed: "observed";
564
+ user_declared: "user_declared";
565
+ }>;
566
+ qualityStatus: z.ZodEnum<{
567
+ regressed: "regressed";
568
+ held: "held";
569
+ insufficient: "insufficient";
570
+ }>;
571
+ qualityEvidence: z.ZodEnum<{
572
+ verified: "verified";
573
+ missing: "missing";
574
+ observed: "observed";
575
+ user_declared: "user_declared";
576
+ }>;
577
+ }, z.core.$strict>;
578
+ billReconciliation: z.ZodDiscriminatedUnion<[z.ZodObject<{
579
+ status: z.ZodLiteral<"not_attempted">;
580
+ evidence: z.ZodLiteral<"missing">;
581
+ }, z.core.$strict>, z.ZodObject<{
582
+ status: z.ZodLiteral<"partial">;
583
+ evidence: z.ZodLiteral<"verified">;
584
+ providerBillRef: z.ZodString;
585
+ coveragePercent: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
586
+ matchedAmountUsd: z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>;
587
+ varianceUsd: z.ZodOptional<z.ZodNumber>;
588
+ }, z.core.$strict>], "status">;
589
+ claims: z.ZodObject<{
590
+ roi: z.ZodLiteral<"not_claimed">;
591
+ invoiceReconciled: z.ZodLiteral<false>;
592
+ rbacVerified: z.ZodLiteral<false>;
593
+ }, z.core.$strict>;
594
+ id: z.ZodString;
595
+ }, z.core.$strict>;
596
+ export type ProjectEconomicsReceiptV0 = z.infer<typeof projectEconomicsReceiptV0Schema>;
597
+ export declare function createProjectEconomicsReference(namespace: string, sourceNativeValue: string): string;
598
+ export declare function createOwnershipSuggestionV0(input: OwnershipSuggestionV0DraftInput): OwnershipSuggestionV0;
599
+ export declare function parseOwnershipSuggestionV0(value: unknown): OwnershipSuggestionV0;
600
+ export declare function createConfirmedOwnershipV0(input: ConfirmedOwnershipV0DraftInput): ConfirmedOwnershipV0;
601
+ export declare function parseConfirmedOwnershipV0(value: unknown): ConfirmedOwnershipV0;
602
+ export declare function createApprovalEventV0(input: ApprovalEventV0DraftInput): ApprovalEventV0;
603
+ export declare function parseApprovalEventV0(value: unknown): ApprovalEventV0;
604
+ /**
605
+ * Append one event without mutating history. Sequence, previous digest, and
606
+ * monotonic time are derived from the already-validated append-only chain.
607
+ */
608
+ export declare function appendApprovalEventV0(history: readonly ApprovalEventV0[], input: Omit<ApprovalEventV0DraftInput, "sequence" | "previousEventId">): ApprovalEventV0[];
609
+ export declare function createAcceptedOutcomeV0(input: AcceptedOutcomeV0DraftInput): AcceptedOutcomeV0;
610
+ export declare function parseAcceptedOutcomeV0(value: unknown): AcceptedOutcomeV0;
611
+ export declare function createProjectEconomicsReceiptV0(input: ProjectEconomicsReceiptV0DraftInput): ProjectEconomicsReceiptV0;
612
+ export declare function parseProjectEconomicsReceiptV0(value: unknown): ProjectEconomicsReceiptV0;
613
+ /** Stable one-line JSON for local persistence or transport. */
614
+ export declare function serializeProjectEconomicsReceiptV0(receipt: ProjectEconomicsReceiptV0): string;
615
+ export declare function deserializeProjectEconomicsReceiptV0(serialized: string): ProjectEconomicsReceiptV0;
616
+ export {};
617
+ //# sourceMappingURL=projectEconomics.d.ts.map