/**
 * CLIProxy Usage Transformer
 *
 * Transforms CLIProxy's usage API response into DailyUsage/HourlyUsage/MonthlyUsage
 * types compatible with the CCS analytics dashboard.
 */
import type { CliproxyUsageApiResponse } from '../../cliproxy/services/stats-fetcher';
import type { DailyUsage, HourlyUsage, MonthlyUsage } from './types';
/** Persisted request detail used to rebuild historical CLIProxy analytics buckets */
export interface CliproxyUsageHistoryDetail {
    model: string;
    provider?: string;
    timestamp: string;
    source: string;
    authIndex: string;
    inputTokens: number;
    outputTokens: number;
    cacheReadTokens: number;
    requestCount: number;
    cost: number;
    failed: boolean;
}
/**
 * Flatten the nested response.usage.apis[provider].models[model].details[]
 * structure into normalized history details. Failed requests are retained only
 * when they still report tracked token usage that analytics can account for.
 */
export declare function extractCliproxyUsageHistoryDetails(response: CliproxyUsageApiResponse): CliproxyUsageHistoryDetail[];
export declare function mergeCliproxyUsageHistoryDetails(existing: CliproxyUsageHistoryDetail[], incoming: CliproxyUsageHistoryDetail[]): CliproxyUsageHistoryDetail[];
export declare function pruneCliproxyUsageHistoryDetails(details: CliproxyUsageHistoryDetail[], oldestTimestamp: number): CliproxyUsageHistoryDetail[];
/** Transform CLIProxy usage response into DailyUsage array (sorted descending by date) */
export declare function transformCliproxyToDailyUsage(response: CliproxyUsageApiResponse): DailyUsage[];
/** Transform CLIProxy usage response into HourlyUsage array (sorted descending by hour) */
export declare function transformCliproxyToHourlyUsage(response: CliproxyUsageApiResponse): HourlyUsage[];
/** Transform CLIProxy usage response into MonthlyUsage array (sorted descending by month) */
export declare function transformCliproxyToMonthlyUsage(response: CliproxyUsageApiResponse): MonthlyUsage[];
export declare function buildCliproxyUsageHistoryAggregates(details: CliproxyUsageHistoryDetail[]): {
    daily: DailyUsage[];
    hourly: HourlyUsage[];
    monthly: MonthlyUsage[];
};
//# sourceMappingURL=cliproxy-usage-transformer.d.ts.map