import type { Usage } from "@caupulican/pi-ai"; import type { AttemptUsageSnapshot } from "./contracts.ts"; export declare const EMPTY_ATTEMPT_USAGE: AttemptUsageSnapshot; /** Parse an untrusted provider-neutral usage report into a closed, known-field value. */ export declare function validateProviderUsage(value: unknown, label?: string): Usage; /** Validate the one durable cumulative usage shape shared by checkpoints, recovery, and results. */ export declare function validateAttemptUsageSnapshot(usage: AttemptUsageSnapshot, label?: string): AttemptUsageSnapshot; export declare function attemptUsageFromGatewayUsage(usage: { toolCalls: number; inputTokens: number; outputTokens: number; cacheReadTokens: number; cacheWriteTokens: number; totalTokens: number; costUsd: number; wallClockMs: number; }): AttemptUsageSnapshot; export declare function addAttemptUsage(base: AttemptUsageSnapshot, delta: AttemptUsageSnapshot, label?: string): AttemptUsageSnapshot; /** * Recover the strongest cumulative evidence across an atomic checkpoint and its durable transcript. * Both inputs are cumulative views of the same attempt, so summing would double-count; component * maxima close append-before-checkpoint crash windows conservatively. */ export declare function reconcileAttemptUsage(checkpoint: AttemptUsageSnapshot, transcript: AttemptUsageSnapshot): AttemptUsageSnapshot; export declare function remainingTokenBudget(maxTokens: number | undefined, usage: AttemptUsageSnapshot): number | undefined; /** Convert durable cumulative accounting into the provider-neutral report shape exactly once. */ export declare function providerUsageFromAttemptUsage(usage: AttemptUsageSnapshot): Usage; //# sourceMappingURL=attempt-usage.d.ts.map