import type { TelemetryRecord } from "./types.js"; export interface TelemetryStats { totalAudits: number; totalFeedback: number; avgDurationMs: number | null; avgScore: number | null; avgFindings: number | null; avgPages: number | null; /** Audits where ai.enabled was true (success + failure). */ triageAttempts: number; /** Audits where triage returned a result (excludes skipped/failed). */ triageUsed: number; /** Breakdown of skip reasons from failed attempts. */ triageSkipReasons: Record; triageCacheHits: number; totalTokenInput: number; totalTokenOutput: number; totalEstimatedCostUsd: number; feedbackBreakdown: { helpful: number; unhelpful: number; skipped: number; }; firstRun: string | null; lastRun: string | null; } /** * Pure summary function over a set of telemetry records. Splits audits and * feedback, averages the audit-level metrics, and sums triage aggregates over * just the audits that included triage. */ export declare function aggregateTelemetry(records: TelemetryRecord[]): TelemetryStats; /** * Sum estimated USD cost for successful triages that fell on the given UTC date * (defaults to today). Used to enforce a daily budget before a new triage call. * Returns 0 when the telemetry file is missing or empty. * * **Cache hits are excluded** — they did not incur a real API call, so they must * not count toward today's spend. Without this filter, re-running the same audit * multiple times per day would over-report spend and falsely trip a budget cap. * * The "UTC day" window is a calendar day in UTC (YYYY-MM-DD from the timestamp). * Users in non-UTC timezones see "today" roll over at their local time offset * from UTC midnight — documented in the README. */ export declare function todayTriageSpendUsd(telemetryPath: string, now?: Date): Promise; //# sourceMappingURL=aggregator.d.ts.map