@agent-finops/core 0.6.0 → 0.6.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/activitySnapshot.d.ts +676 -0
- package/dist/activitySnapshot.js +1220 -0
- package/dist/activitySnapshotCache.d.ts +54 -0
- package/dist/activitySnapshotCache.js +489 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/localAgentLogs.d.ts +30 -0
- package/dist/localAgentLogs.js +805 -56
- package/dist/providerConnectors.d.ts +10 -0
- package/dist/providerConnectors.js +43 -6
- package/package.json +1 -1
|
@@ -0,0 +1,676 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type LocalAgentCall, type LocalAgentSourceScan } from "./localAgentLogs.js";
|
|
3
|
+
import type { DetectedPlan } from "./planDetection.js";
|
|
4
|
+
import { type UsageRecord } from "./schema.js";
|
|
5
|
+
import { type SourceValidationCoverage } from "./sourceStatus.js";
|
|
6
|
+
export declare const activitySnapshotAgentValues: readonly ["claude-code", "codex"];
|
|
7
|
+
export type ActivitySnapshotAgent = typeof activitySnapshotAgentValues[number];
|
|
8
|
+
export declare const activitySnapshotPlanIdValues: readonly ["claude-pro", "claude-max-5x", "claude-max-20x", "chatgpt-plus", "chatgpt-pro"];
|
|
9
|
+
export type ActivitySnapshotPlanId = typeof activitySnapshotPlanIdValues[number];
|
|
10
|
+
export declare const activitySnapshotProviderValues: readonly ["openai", "anthropic", "cursor", "github-copilot", "other"];
|
|
11
|
+
export type ActivitySnapshotProvider = typeof activitySnapshotProviderValues[number];
|
|
12
|
+
export declare const activitySnapshotModeValues: readonly ["metered", "subscription", "mixed", "unresolved", "empty", "error"];
|
|
13
|
+
export type ActivitySnapshotMode = typeof activitySnapshotModeValues[number];
|
|
14
|
+
export declare const activitySnapshotRefreshErrorCodeValues: readonly ["scan_failed", "source_unreadable", "invalid_evidence", "timeout", "cache_write_failed", "unknown"];
|
|
15
|
+
export type ActivitySnapshotRefreshErrorCode = typeof activitySnapshotRefreshErrorCodeValues[number];
|
|
16
|
+
export declare const activitySnapshotProviderCoverageStatusValues: readonly ["complete", "partial", "unavailable", "error"];
|
|
17
|
+
export type ActivitySnapshotProviderCoverageStatus = typeof activitySnapshotProviderCoverageStatusValues[number];
|
|
18
|
+
export type ActivitySnapshotProviderCoverageInput = {
|
|
19
|
+
provider: ActivitySnapshotProvider;
|
|
20
|
+
status: ActivitySnapshotProviderCoverageStatus;
|
|
21
|
+
validationCoverage: SourceValidationCoverage;
|
|
22
|
+
checkedAt?: string;
|
|
23
|
+
latestEvidenceAt?: string;
|
|
24
|
+
/** Receipt-bound provider interval; required before an empty window can prove $0. */
|
|
25
|
+
coverageStart?: string;
|
|
26
|
+
coverageEnd?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ActivitySnapshotBuildInput = {
|
|
29
|
+
/** One timestamp shared by every rolling window. */
|
|
30
|
+
asOf: string;
|
|
31
|
+
/** Explicit scan-completion time; keeps the pure builder deterministic. */
|
|
32
|
+
generatedAt: string;
|
|
33
|
+
records: readonly UsageRecord[];
|
|
34
|
+
/** Calls are used only for activity presence and transcript-reported limits. */
|
|
35
|
+
calls?: readonly LocalAgentCall[];
|
|
36
|
+
detectedPlans?: readonly DetectedPlan[];
|
|
37
|
+
sourceScans?: readonly LocalAgentSourceScan[];
|
|
38
|
+
/** Only externally trust-validated, provider-reported records belong here. */
|
|
39
|
+
trustedProviderRecordIds?: readonly string[];
|
|
40
|
+
/** Explicit provider-billed overage records; must also be trusted. */
|
|
41
|
+
billedOverageRecordIds?: readonly string[];
|
|
42
|
+
providerCoverage?: readonly ActivitySnapshotProviderCoverageInput[];
|
|
43
|
+
pricingAsOf?: string;
|
|
44
|
+
/** Deliberately accepts only false; a runtime true is rejected as defense in depth. */
|
|
45
|
+
sampleData?: false;
|
|
46
|
+
};
|
|
47
|
+
export declare const activitySnapshotApiEquivalentWindowSchema: z.ZodObject<{
|
|
48
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
49
|
+
recordCount: z.ZodNumber;
|
|
50
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
51
|
+
financialEvidence: z.ZodEnum<{
|
|
52
|
+
estimated: "estimated";
|
|
53
|
+
missing: "missing";
|
|
54
|
+
}>;
|
|
55
|
+
coverage: z.ZodEnum<{
|
|
56
|
+
complete: "complete";
|
|
57
|
+
partial: "partial";
|
|
58
|
+
missing: "missing";
|
|
59
|
+
}>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type ActivitySnapshotApiEquivalentWindow = z.infer<typeof activitySnapshotApiEquivalentWindowSchema>;
|
|
62
|
+
export declare const activitySnapshotBilledWindowSchema: z.ZodObject<{
|
|
63
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
64
|
+
recordCount: z.ZodNumber;
|
|
65
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
66
|
+
financialEvidence: z.ZodEnum<{
|
|
67
|
+
missing: "missing";
|
|
68
|
+
verified: "verified";
|
|
69
|
+
}>;
|
|
70
|
+
coverage: z.ZodEnum<{
|
|
71
|
+
complete: "complete";
|
|
72
|
+
partial: "partial";
|
|
73
|
+
missing: "missing";
|
|
74
|
+
}>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
export type ActivitySnapshotBilledWindow = z.infer<typeof activitySnapshotBilledWindowSchema>;
|
|
77
|
+
export declare const activitySnapshotApiEquivalentWindowsSchema: z.ZodObject<{
|
|
78
|
+
oneDay: z.ZodObject<{
|
|
79
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
80
|
+
recordCount: z.ZodNumber;
|
|
81
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
82
|
+
financialEvidence: z.ZodEnum<{
|
|
83
|
+
estimated: "estimated";
|
|
84
|
+
missing: "missing";
|
|
85
|
+
}>;
|
|
86
|
+
coverage: z.ZodEnum<{
|
|
87
|
+
complete: "complete";
|
|
88
|
+
partial: "partial";
|
|
89
|
+
missing: "missing";
|
|
90
|
+
}>;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
sevenDays: z.ZodObject<{
|
|
93
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
94
|
+
recordCount: z.ZodNumber;
|
|
95
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
96
|
+
financialEvidence: z.ZodEnum<{
|
|
97
|
+
estimated: "estimated";
|
|
98
|
+
missing: "missing";
|
|
99
|
+
}>;
|
|
100
|
+
coverage: z.ZodEnum<{
|
|
101
|
+
complete: "complete";
|
|
102
|
+
partial: "partial";
|
|
103
|
+
missing: "missing";
|
|
104
|
+
}>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
thirtyDays: z.ZodObject<{
|
|
107
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
108
|
+
recordCount: z.ZodNumber;
|
|
109
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
110
|
+
financialEvidence: z.ZodEnum<{
|
|
111
|
+
estimated: "estimated";
|
|
112
|
+
missing: "missing";
|
|
113
|
+
}>;
|
|
114
|
+
coverage: z.ZodEnum<{
|
|
115
|
+
complete: "complete";
|
|
116
|
+
partial: "partial";
|
|
117
|
+
missing: "missing";
|
|
118
|
+
}>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
export type ActivitySnapshotApiEquivalentWindows = z.infer<typeof activitySnapshotApiEquivalentWindowsSchema>;
|
|
122
|
+
export declare const activitySnapshotBilledWindowsSchema: z.ZodObject<{
|
|
123
|
+
oneDay: z.ZodObject<{
|
|
124
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
125
|
+
recordCount: z.ZodNumber;
|
|
126
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
127
|
+
financialEvidence: z.ZodEnum<{
|
|
128
|
+
missing: "missing";
|
|
129
|
+
verified: "verified";
|
|
130
|
+
}>;
|
|
131
|
+
coverage: z.ZodEnum<{
|
|
132
|
+
complete: "complete";
|
|
133
|
+
partial: "partial";
|
|
134
|
+
missing: "missing";
|
|
135
|
+
}>;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
sevenDays: z.ZodObject<{
|
|
138
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
139
|
+
recordCount: z.ZodNumber;
|
|
140
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
141
|
+
financialEvidence: z.ZodEnum<{
|
|
142
|
+
missing: "missing";
|
|
143
|
+
verified: "verified";
|
|
144
|
+
}>;
|
|
145
|
+
coverage: z.ZodEnum<{
|
|
146
|
+
complete: "complete";
|
|
147
|
+
partial: "partial";
|
|
148
|
+
missing: "missing";
|
|
149
|
+
}>;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
thirtyDays: z.ZodObject<{
|
|
152
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
153
|
+
recordCount: z.ZodNumber;
|
|
154
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
155
|
+
financialEvidence: z.ZodEnum<{
|
|
156
|
+
missing: "missing";
|
|
157
|
+
verified: "verified";
|
|
158
|
+
}>;
|
|
159
|
+
coverage: z.ZodEnum<{
|
|
160
|
+
complete: "complete";
|
|
161
|
+
partial: "partial";
|
|
162
|
+
missing: "missing";
|
|
163
|
+
}>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
export type ActivitySnapshotBilledWindows = z.infer<typeof activitySnapshotBilledWindowsSchema>;
|
|
167
|
+
export declare const activitySnapshotLimitSchema: z.ZodObject<{
|
|
168
|
+
kind: z.ZodEnum<{
|
|
169
|
+
"five-hour": "five-hour";
|
|
170
|
+
weekly: "weekly";
|
|
171
|
+
}>;
|
|
172
|
+
usedPercent: z.ZodNumber;
|
|
173
|
+
remainingPercent: z.ZodNumber;
|
|
174
|
+
observedAt: z.ZodString;
|
|
175
|
+
resetsAt: z.ZodString;
|
|
176
|
+
source: z.ZodLiteral<"transcript_reported">;
|
|
177
|
+
}, z.core.$strict>;
|
|
178
|
+
export type ActivitySnapshotLimit = z.infer<typeof activitySnapshotLimitSchema>;
|
|
179
|
+
export declare const activitySnapshotSubscriptionAgentSchema: z.ZodObject<{
|
|
180
|
+
agent: z.ZodEnum<{
|
|
181
|
+
"claude-code": "claude-code";
|
|
182
|
+
codex: "codex";
|
|
183
|
+
}>;
|
|
184
|
+
billing: z.ZodLiteral<"subscription">;
|
|
185
|
+
planId: z.ZodNullable<z.ZodEnum<{
|
|
186
|
+
"claude-pro": "claude-pro";
|
|
187
|
+
"claude-max-5x": "claude-max-5x";
|
|
188
|
+
"claude-max-20x": "claude-max-20x";
|
|
189
|
+
"chatgpt-plus": "chatgpt-plus";
|
|
190
|
+
"chatgpt-pro": "chatgpt-pro";
|
|
191
|
+
}>>;
|
|
192
|
+
apiEquivalent: z.ZodObject<{
|
|
193
|
+
oneDay: z.ZodObject<{
|
|
194
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
195
|
+
recordCount: z.ZodNumber;
|
|
196
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
197
|
+
financialEvidence: z.ZodEnum<{
|
|
198
|
+
estimated: "estimated";
|
|
199
|
+
missing: "missing";
|
|
200
|
+
}>;
|
|
201
|
+
coverage: z.ZodEnum<{
|
|
202
|
+
complete: "complete";
|
|
203
|
+
partial: "partial";
|
|
204
|
+
missing: "missing";
|
|
205
|
+
}>;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
sevenDays: z.ZodObject<{
|
|
208
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
209
|
+
recordCount: z.ZodNumber;
|
|
210
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
211
|
+
financialEvidence: z.ZodEnum<{
|
|
212
|
+
estimated: "estimated";
|
|
213
|
+
missing: "missing";
|
|
214
|
+
}>;
|
|
215
|
+
coverage: z.ZodEnum<{
|
|
216
|
+
complete: "complete";
|
|
217
|
+
partial: "partial";
|
|
218
|
+
missing: "missing";
|
|
219
|
+
}>;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
thirtyDays: z.ZodObject<{
|
|
222
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
223
|
+
recordCount: z.ZodNumber;
|
|
224
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
225
|
+
financialEvidence: z.ZodEnum<{
|
|
226
|
+
estimated: "estimated";
|
|
227
|
+
missing: "missing";
|
|
228
|
+
}>;
|
|
229
|
+
coverage: z.ZodEnum<{
|
|
230
|
+
complete: "complete";
|
|
231
|
+
partial: "partial";
|
|
232
|
+
missing: "missing";
|
|
233
|
+
}>;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
limits: z.ZodArray<z.ZodObject<{
|
|
237
|
+
kind: z.ZodEnum<{
|
|
238
|
+
"five-hour": "five-hour";
|
|
239
|
+
weekly: "weekly";
|
|
240
|
+
}>;
|
|
241
|
+
usedPercent: z.ZodNumber;
|
|
242
|
+
remainingPercent: z.ZodNumber;
|
|
243
|
+
observedAt: z.ZodString;
|
|
244
|
+
resetsAt: z.ZodString;
|
|
245
|
+
source: z.ZodLiteral<"transcript_reported">;
|
|
246
|
+
}, z.core.$strict>>;
|
|
247
|
+
pressure: z.ZodNullable<z.ZodEnum<{
|
|
248
|
+
extra_usage_credits_exhausted: "extra_usage_credits_exhausted";
|
|
249
|
+
}>>;
|
|
250
|
+
}, z.core.$strict>;
|
|
251
|
+
export type ActivitySnapshotSubscriptionAgent = z.infer<typeof activitySnapshotSubscriptionAgentSchema>;
|
|
252
|
+
export declare const activitySnapshotOverageSchema: z.ZodObject<{
|
|
253
|
+
amountUsd: z.ZodNumber;
|
|
254
|
+
currency: z.ZodLiteral<"USD">;
|
|
255
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
256
|
+
financialEvidence: z.ZodLiteral<"verified">;
|
|
257
|
+
alertEligible: z.ZodLiteral<true>;
|
|
258
|
+
recordCount: z.ZodNumber;
|
|
259
|
+
}, z.core.$strict>;
|
|
260
|
+
export type ActivitySnapshotOverage = z.infer<typeof activitySnapshotOverageSchema>;
|
|
261
|
+
export declare const activitySnapshotCoverageSchema: z.ZodObject<{
|
|
262
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
263
|
+
agent: z.ZodEnum<{
|
|
264
|
+
"claude-code": "claude-code";
|
|
265
|
+
codex: "codex";
|
|
266
|
+
}>;
|
|
267
|
+
directoryStatus: z.ZodEnum<{
|
|
268
|
+
missing: "missing";
|
|
269
|
+
readable: "readable";
|
|
270
|
+
unreadable: "unreadable";
|
|
271
|
+
}>;
|
|
272
|
+
filesDiscovered: z.ZodNumber;
|
|
273
|
+
filesParsed: z.ZodNumber;
|
|
274
|
+
malformedLines: z.ZodNumber;
|
|
275
|
+
unreadableFiles: z.ZodNumber;
|
|
276
|
+
unsupportedUsageSnapshots: z.ZodNumber;
|
|
277
|
+
filesSkippedBeforeWindow: z.ZodNumber;
|
|
278
|
+
filesReadFinancially: z.ZodNumber;
|
|
279
|
+
bytesSkippedAsNonFinancialHistory: z.ZodNumber;
|
|
280
|
+
nonFinancialLinesPrefiltered: z.ZodNumber;
|
|
281
|
+
nonFinancialBytesPrefiltered: z.ZodNumber;
|
|
282
|
+
jsonlValidationCoverage: z.ZodEnum<{
|
|
283
|
+
complete: "complete";
|
|
284
|
+
financial_events_only: "financial_events_only";
|
|
285
|
+
not_reported: "not_reported";
|
|
286
|
+
}>;
|
|
287
|
+
}, z.core.$strict>>;
|
|
288
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
289
|
+
provider: z.ZodEnum<{
|
|
290
|
+
openai: "openai";
|
|
291
|
+
anthropic: "anthropic";
|
|
292
|
+
cursor: "cursor";
|
|
293
|
+
"github-copilot": "github-copilot";
|
|
294
|
+
other: "other";
|
|
295
|
+
}>;
|
|
296
|
+
status: z.ZodEnum<{
|
|
297
|
+
error: "error";
|
|
298
|
+
complete: "complete";
|
|
299
|
+
partial: "partial";
|
|
300
|
+
unavailable: "unavailable";
|
|
301
|
+
}>;
|
|
302
|
+
validationCoverage: z.ZodEnum<{
|
|
303
|
+
live_verified: "live_verified";
|
|
304
|
+
fixture_verified: "fixture_verified";
|
|
305
|
+
untested: "untested";
|
|
306
|
+
failed: "failed";
|
|
307
|
+
}>;
|
|
308
|
+
checkedAt: z.ZodNullable<z.ZodString>;
|
|
309
|
+
latestEvidenceAt: z.ZodNullable<z.ZodString>;
|
|
310
|
+
coverageStart: z.ZodNullable<z.ZodString>;
|
|
311
|
+
coverageEnd: z.ZodNullable<z.ZodString>;
|
|
312
|
+
}, z.core.$strict>>;
|
|
313
|
+
recordsParsed: z.ZodNumber;
|
|
314
|
+
recordsPriced: z.ZodNumber;
|
|
315
|
+
recordsUnpriced: z.ZodNumber;
|
|
316
|
+
validationStatus: z.ZodEnum<{
|
|
317
|
+
complete: "complete";
|
|
318
|
+
partial: "partial";
|
|
319
|
+
failed: "failed";
|
|
320
|
+
not_checked: "not_checked";
|
|
321
|
+
}>;
|
|
322
|
+
pricingAsOf: z.ZodString;
|
|
323
|
+
networkUploaded: z.ZodLiteral<false>;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
export type ActivitySnapshotCoverage = z.infer<typeof activitySnapshotCoverageSchema>;
|
|
326
|
+
export declare const activitySnapshotSchema: z.ZodObject<{
|
|
327
|
+
kind: z.ZodLiteral<"aibill.activity_snapshot">;
|
|
328
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
329
|
+
currency: z.ZodLiteral<"USD">;
|
|
330
|
+
asOf: z.ZodString;
|
|
331
|
+
generatedAt: z.ZodString;
|
|
332
|
+
lastAttemptAt: z.ZodString;
|
|
333
|
+
lastSuccessAt: z.ZodNullable<z.ZodString>;
|
|
334
|
+
refresh: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
335
|
+
status: z.ZodLiteral<"ok">;
|
|
336
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
337
|
+
status: z.ZodLiteral<"error">;
|
|
338
|
+
errorCode: z.ZodEnum<{
|
|
339
|
+
scan_failed: "scan_failed";
|
|
340
|
+
source_unreadable: "source_unreadable";
|
|
341
|
+
invalid_evidence: "invalid_evidence";
|
|
342
|
+
timeout: "timeout";
|
|
343
|
+
cache_write_failed: "cache_write_failed";
|
|
344
|
+
unknown: "unknown";
|
|
345
|
+
}>;
|
|
346
|
+
}, z.core.$strict>], "status">;
|
|
347
|
+
mode: z.ZodEnum<{
|
|
348
|
+
metered: "metered";
|
|
349
|
+
subscription: "subscription";
|
|
350
|
+
mixed: "mixed";
|
|
351
|
+
unresolved: "unresolved";
|
|
352
|
+
empty: "empty";
|
|
353
|
+
error: "error";
|
|
354
|
+
}>;
|
|
355
|
+
subscription: z.ZodNullable<z.ZodObject<{
|
|
356
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
357
|
+
agent: z.ZodEnum<{
|
|
358
|
+
"claude-code": "claude-code";
|
|
359
|
+
codex: "codex";
|
|
360
|
+
}>;
|
|
361
|
+
billing: z.ZodLiteral<"subscription">;
|
|
362
|
+
planId: z.ZodNullable<z.ZodEnum<{
|
|
363
|
+
"claude-pro": "claude-pro";
|
|
364
|
+
"claude-max-5x": "claude-max-5x";
|
|
365
|
+
"claude-max-20x": "claude-max-20x";
|
|
366
|
+
"chatgpt-plus": "chatgpt-plus";
|
|
367
|
+
"chatgpt-pro": "chatgpt-pro";
|
|
368
|
+
}>>;
|
|
369
|
+
apiEquivalent: z.ZodObject<{
|
|
370
|
+
oneDay: z.ZodObject<{
|
|
371
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
372
|
+
recordCount: z.ZodNumber;
|
|
373
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
374
|
+
financialEvidence: z.ZodEnum<{
|
|
375
|
+
estimated: "estimated";
|
|
376
|
+
missing: "missing";
|
|
377
|
+
}>;
|
|
378
|
+
coverage: z.ZodEnum<{
|
|
379
|
+
complete: "complete";
|
|
380
|
+
partial: "partial";
|
|
381
|
+
missing: "missing";
|
|
382
|
+
}>;
|
|
383
|
+
}, z.core.$strict>;
|
|
384
|
+
sevenDays: z.ZodObject<{
|
|
385
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
386
|
+
recordCount: z.ZodNumber;
|
|
387
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
388
|
+
financialEvidence: z.ZodEnum<{
|
|
389
|
+
estimated: "estimated";
|
|
390
|
+
missing: "missing";
|
|
391
|
+
}>;
|
|
392
|
+
coverage: z.ZodEnum<{
|
|
393
|
+
complete: "complete";
|
|
394
|
+
partial: "partial";
|
|
395
|
+
missing: "missing";
|
|
396
|
+
}>;
|
|
397
|
+
}, z.core.$strict>;
|
|
398
|
+
thirtyDays: z.ZodObject<{
|
|
399
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
400
|
+
recordCount: z.ZodNumber;
|
|
401
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
402
|
+
financialEvidence: z.ZodEnum<{
|
|
403
|
+
estimated: "estimated";
|
|
404
|
+
missing: "missing";
|
|
405
|
+
}>;
|
|
406
|
+
coverage: z.ZodEnum<{
|
|
407
|
+
complete: "complete";
|
|
408
|
+
partial: "partial";
|
|
409
|
+
missing: "missing";
|
|
410
|
+
}>;
|
|
411
|
+
}, z.core.$strict>;
|
|
412
|
+
}, z.core.$strict>;
|
|
413
|
+
limits: z.ZodArray<z.ZodObject<{
|
|
414
|
+
kind: z.ZodEnum<{
|
|
415
|
+
"five-hour": "five-hour";
|
|
416
|
+
weekly: "weekly";
|
|
417
|
+
}>;
|
|
418
|
+
usedPercent: z.ZodNumber;
|
|
419
|
+
remainingPercent: z.ZodNumber;
|
|
420
|
+
observedAt: z.ZodString;
|
|
421
|
+
resetsAt: z.ZodString;
|
|
422
|
+
source: z.ZodLiteral<"transcript_reported">;
|
|
423
|
+
}, z.core.$strict>>;
|
|
424
|
+
pressure: z.ZodNullable<z.ZodEnum<{
|
|
425
|
+
extra_usage_credits_exhausted: "extra_usage_credits_exhausted";
|
|
426
|
+
}>>;
|
|
427
|
+
}, z.core.$strict>>;
|
|
428
|
+
}, z.core.$strict>>;
|
|
429
|
+
metered: z.ZodNullable<z.ZodObject<{
|
|
430
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
431
|
+
agent: z.ZodEnum<{
|
|
432
|
+
"claude-code": "claude-code";
|
|
433
|
+
codex: "codex";
|
|
434
|
+
}>;
|
|
435
|
+
billing: z.ZodLiteral<"api_key">;
|
|
436
|
+
planId: z.ZodNullable<z.ZodEnum<{
|
|
437
|
+
"claude-pro": "claude-pro";
|
|
438
|
+
"claude-max-5x": "claude-max-5x";
|
|
439
|
+
"claude-max-20x": "claude-max-20x";
|
|
440
|
+
"chatgpt-plus": "chatgpt-plus";
|
|
441
|
+
"chatgpt-pro": "chatgpt-pro";
|
|
442
|
+
}>>;
|
|
443
|
+
}, z.core.$strict>>;
|
|
444
|
+
apiEquivalent: z.ZodObject<{
|
|
445
|
+
oneDay: z.ZodObject<{
|
|
446
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
447
|
+
recordCount: z.ZodNumber;
|
|
448
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
449
|
+
financialEvidence: z.ZodEnum<{
|
|
450
|
+
estimated: "estimated";
|
|
451
|
+
missing: "missing";
|
|
452
|
+
}>;
|
|
453
|
+
coverage: z.ZodEnum<{
|
|
454
|
+
complete: "complete";
|
|
455
|
+
partial: "partial";
|
|
456
|
+
missing: "missing";
|
|
457
|
+
}>;
|
|
458
|
+
}, z.core.$strict>;
|
|
459
|
+
sevenDays: z.ZodObject<{
|
|
460
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
461
|
+
recordCount: z.ZodNumber;
|
|
462
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
463
|
+
financialEvidence: z.ZodEnum<{
|
|
464
|
+
estimated: "estimated";
|
|
465
|
+
missing: "missing";
|
|
466
|
+
}>;
|
|
467
|
+
coverage: z.ZodEnum<{
|
|
468
|
+
complete: "complete";
|
|
469
|
+
partial: "partial";
|
|
470
|
+
missing: "missing";
|
|
471
|
+
}>;
|
|
472
|
+
}, z.core.$strict>;
|
|
473
|
+
thirtyDays: z.ZodObject<{
|
|
474
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
475
|
+
recordCount: z.ZodNumber;
|
|
476
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
477
|
+
financialEvidence: z.ZodEnum<{
|
|
478
|
+
estimated: "estimated";
|
|
479
|
+
missing: "missing";
|
|
480
|
+
}>;
|
|
481
|
+
coverage: z.ZodEnum<{
|
|
482
|
+
complete: "complete";
|
|
483
|
+
partial: "partial";
|
|
484
|
+
missing: "missing";
|
|
485
|
+
}>;
|
|
486
|
+
}, z.core.$strict>;
|
|
487
|
+
}, z.core.$strict>;
|
|
488
|
+
providerBilled: z.ZodObject<{
|
|
489
|
+
oneDay: z.ZodObject<{
|
|
490
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
491
|
+
recordCount: z.ZodNumber;
|
|
492
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
493
|
+
financialEvidence: z.ZodEnum<{
|
|
494
|
+
missing: "missing";
|
|
495
|
+
verified: "verified";
|
|
496
|
+
}>;
|
|
497
|
+
coverage: z.ZodEnum<{
|
|
498
|
+
complete: "complete";
|
|
499
|
+
partial: "partial";
|
|
500
|
+
missing: "missing";
|
|
501
|
+
}>;
|
|
502
|
+
}, z.core.$strict>;
|
|
503
|
+
sevenDays: z.ZodObject<{
|
|
504
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
505
|
+
recordCount: z.ZodNumber;
|
|
506
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
507
|
+
financialEvidence: z.ZodEnum<{
|
|
508
|
+
missing: "missing";
|
|
509
|
+
verified: "verified";
|
|
510
|
+
}>;
|
|
511
|
+
coverage: z.ZodEnum<{
|
|
512
|
+
complete: "complete";
|
|
513
|
+
partial: "partial";
|
|
514
|
+
missing: "missing";
|
|
515
|
+
}>;
|
|
516
|
+
}, z.core.$strict>;
|
|
517
|
+
thirtyDays: z.ZodObject<{
|
|
518
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
519
|
+
recordCount: z.ZodNumber;
|
|
520
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
521
|
+
financialEvidence: z.ZodEnum<{
|
|
522
|
+
missing: "missing";
|
|
523
|
+
verified: "verified";
|
|
524
|
+
}>;
|
|
525
|
+
coverage: z.ZodEnum<{
|
|
526
|
+
complete: "complete";
|
|
527
|
+
partial: "partial";
|
|
528
|
+
missing: "missing";
|
|
529
|
+
}>;
|
|
530
|
+
}, z.core.$strict>;
|
|
531
|
+
}, z.core.$strict>;
|
|
532
|
+
}, z.core.$strict>>;
|
|
533
|
+
unresolved: z.ZodNullable<z.ZodObject<{
|
|
534
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
535
|
+
agent: z.ZodEnum<{
|
|
536
|
+
"claude-code": "claude-code";
|
|
537
|
+
codex: "codex";
|
|
538
|
+
}>;
|
|
539
|
+
billing: z.ZodLiteral<"unknown">;
|
|
540
|
+
planId: z.ZodNullable<z.ZodEnum<{
|
|
541
|
+
"claude-pro": "claude-pro";
|
|
542
|
+
"claude-max-5x": "claude-max-5x";
|
|
543
|
+
"claude-max-20x": "claude-max-20x";
|
|
544
|
+
"chatgpt-plus": "chatgpt-plus";
|
|
545
|
+
"chatgpt-pro": "chatgpt-pro";
|
|
546
|
+
}>>;
|
|
547
|
+
}, z.core.$strict>>;
|
|
548
|
+
apiEquivalent: z.ZodObject<{
|
|
549
|
+
oneDay: z.ZodObject<{
|
|
550
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
551
|
+
recordCount: z.ZodNumber;
|
|
552
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
553
|
+
financialEvidence: z.ZodEnum<{
|
|
554
|
+
estimated: "estimated";
|
|
555
|
+
missing: "missing";
|
|
556
|
+
}>;
|
|
557
|
+
coverage: z.ZodEnum<{
|
|
558
|
+
complete: "complete";
|
|
559
|
+
partial: "partial";
|
|
560
|
+
missing: "missing";
|
|
561
|
+
}>;
|
|
562
|
+
}, z.core.$strict>;
|
|
563
|
+
sevenDays: z.ZodObject<{
|
|
564
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
565
|
+
recordCount: z.ZodNumber;
|
|
566
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
567
|
+
financialEvidence: z.ZodEnum<{
|
|
568
|
+
estimated: "estimated";
|
|
569
|
+
missing: "missing";
|
|
570
|
+
}>;
|
|
571
|
+
coverage: z.ZodEnum<{
|
|
572
|
+
complete: "complete";
|
|
573
|
+
partial: "partial";
|
|
574
|
+
missing: "missing";
|
|
575
|
+
}>;
|
|
576
|
+
}, z.core.$strict>;
|
|
577
|
+
thirtyDays: z.ZodObject<{
|
|
578
|
+
amountUsd: z.ZodNullable<z.ZodNumber>;
|
|
579
|
+
recordCount: z.ZodNumber;
|
|
580
|
+
basis: z.ZodLiteral<"api_equivalent">;
|
|
581
|
+
financialEvidence: z.ZodEnum<{
|
|
582
|
+
estimated: "estimated";
|
|
583
|
+
missing: "missing";
|
|
584
|
+
}>;
|
|
585
|
+
coverage: z.ZodEnum<{
|
|
586
|
+
complete: "complete";
|
|
587
|
+
partial: "partial";
|
|
588
|
+
missing: "missing";
|
|
589
|
+
}>;
|
|
590
|
+
}, z.core.$strict>;
|
|
591
|
+
}, z.core.$strict>;
|
|
592
|
+
}, z.core.$strict>>;
|
|
593
|
+
overage: z.ZodNullable<z.ZodObject<{
|
|
594
|
+
amountUsd: z.ZodNumber;
|
|
595
|
+
currency: z.ZodLiteral<"USD">;
|
|
596
|
+
basis: z.ZodLiteral<"provider_billed">;
|
|
597
|
+
financialEvidence: z.ZodLiteral<"verified">;
|
|
598
|
+
alertEligible: z.ZodLiteral<true>;
|
|
599
|
+
recordCount: z.ZodNumber;
|
|
600
|
+
}, z.core.$strict>>;
|
|
601
|
+
coverage: z.ZodObject<{
|
|
602
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
603
|
+
agent: z.ZodEnum<{
|
|
604
|
+
"claude-code": "claude-code";
|
|
605
|
+
codex: "codex";
|
|
606
|
+
}>;
|
|
607
|
+
directoryStatus: z.ZodEnum<{
|
|
608
|
+
missing: "missing";
|
|
609
|
+
readable: "readable";
|
|
610
|
+
unreadable: "unreadable";
|
|
611
|
+
}>;
|
|
612
|
+
filesDiscovered: z.ZodNumber;
|
|
613
|
+
filesParsed: z.ZodNumber;
|
|
614
|
+
malformedLines: z.ZodNumber;
|
|
615
|
+
unreadableFiles: z.ZodNumber;
|
|
616
|
+
unsupportedUsageSnapshots: z.ZodNumber;
|
|
617
|
+
filesSkippedBeforeWindow: z.ZodNumber;
|
|
618
|
+
filesReadFinancially: z.ZodNumber;
|
|
619
|
+
bytesSkippedAsNonFinancialHistory: z.ZodNumber;
|
|
620
|
+
nonFinancialLinesPrefiltered: z.ZodNumber;
|
|
621
|
+
nonFinancialBytesPrefiltered: z.ZodNumber;
|
|
622
|
+
jsonlValidationCoverage: z.ZodEnum<{
|
|
623
|
+
complete: "complete";
|
|
624
|
+
financial_events_only: "financial_events_only";
|
|
625
|
+
not_reported: "not_reported";
|
|
626
|
+
}>;
|
|
627
|
+
}, z.core.$strict>>;
|
|
628
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
629
|
+
provider: z.ZodEnum<{
|
|
630
|
+
openai: "openai";
|
|
631
|
+
anthropic: "anthropic";
|
|
632
|
+
cursor: "cursor";
|
|
633
|
+
"github-copilot": "github-copilot";
|
|
634
|
+
other: "other";
|
|
635
|
+
}>;
|
|
636
|
+
status: z.ZodEnum<{
|
|
637
|
+
error: "error";
|
|
638
|
+
complete: "complete";
|
|
639
|
+
partial: "partial";
|
|
640
|
+
unavailable: "unavailable";
|
|
641
|
+
}>;
|
|
642
|
+
validationCoverage: z.ZodEnum<{
|
|
643
|
+
live_verified: "live_verified";
|
|
644
|
+
fixture_verified: "fixture_verified";
|
|
645
|
+
untested: "untested";
|
|
646
|
+
failed: "failed";
|
|
647
|
+
}>;
|
|
648
|
+
checkedAt: z.ZodNullable<z.ZodString>;
|
|
649
|
+
latestEvidenceAt: z.ZodNullable<z.ZodString>;
|
|
650
|
+
coverageStart: z.ZodNullable<z.ZodString>;
|
|
651
|
+
coverageEnd: z.ZodNullable<z.ZodString>;
|
|
652
|
+
}, z.core.$strict>>;
|
|
653
|
+
recordsParsed: z.ZodNumber;
|
|
654
|
+
recordsPriced: z.ZodNumber;
|
|
655
|
+
recordsUnpriced: z.ZodNumber;
|
|
656
|
+
validationStatus: z.ZodEnum<{
|
|
657
|
+
complete: "complete";
|
|
658
|
+
partial: "partial";
|
|
659
|
+
failed: "failed";
|
|
660
|
+
not_checked: "not_checked";
|
|
661
|
+
}>;
|
|
662
|
+
pricingAsOf: z.ZodString;
|
|
663
|
+
networkUploaded: z.ZodLiteral<false>;
|
|
664
|
+
}, z.core.$strict>;
|
|
665
|
+
networkUploaded: z.ZodLiteral<false>;
|
|
666
|
+
}, z.core.$strict>;
|
|
667
|
+
export type ActivitySnapshot = z.infer<typeof activitySnapshotSchema>;
|
|
668
|
+
/**
|
|
669
|
+
* Build the privacy-bounded, plan-aware snapshot consumed by the status line.
|
|
670
|
+
* This function never trusts provider billing implicitly: the caller must pass
|
|
671
|
+
* IDs already validated by the external connected-state trust receipt.
|
|
672
|
+
*/
|
|
673
|
+
export declare function buildActivitySnapshot(input: ActivitySnapshotBuildInput): ActivitySnapshot;
|
|
674
|
+
/** A bounded no-evidence state for an initial failed refresh. */
|
|
675
|
+
export declare function createActivitySnapshotError(attemptedAt: string, errorCode: ActivitySnapshotRefreshErrorCode): ActivitySnapshot;
|
|
676
|
+
//# sourceMappingURL=activitySnapshot.d.ts.map
|