/**
 * Cost tracker — token + USD accounting per scenario and per run.
 *
 * Adapted from generic usage-event accounting. Every
 * optimizer needs to know "is the quality gain worth the cost delta?",
 * and every dashboard needs dollars-per-completed-task. MODEL_PRICING
 * from metrics.ts stays authoritative for estimate math; this module
 * adds the aggregation + per-scenario roll-up that was duplicated
 * across 4 verticals.
 */
export interface TokenSpec {
    inputTokens: number;
    outputTokens: number;
    cachedTokens?: number;
    reasoningTokens?: number;
}
export interface CostEntry extends TokenSpec {
    scenarioId: string;
    model: string;
    /** Override estimate with an observed cost (e.g. from provider response). */
    actualCostUsd?: number;
    timestamp: number;
    /** Free-form tags (variant id, round #, etc.). */
    tags?: Record<string, string>;
}
export interface ScenarioCost {
    scenarioId: string;
    entries: CostEntry[];
    totalInputTokens: number;
    totalOutputTokens: number;
    totalCachedTokens: number;
    totalCostUsd: number;
    /** Pass flag — set by consumer via markOutcome; used for cost-per-completed-task. */
    completed?: boolean;
}
export declare class CostTracker {
    private byScenario;
    record(entry: Omit<CostEntry, 'timestamp'> & {
        timestamp?: number;
    }): CostEntry;
    markOutcome(scenarioId: string, completed: boolean): void;
    /**
     * Convenience: record + markOutcome in one call from a
     * `{ usage, verdict }`-shaped response (starter-foundry's
     * `invokeMetaJudge` returns this shape; consumers that wrap any
     * judge/critic can follow the same convention).
     *
     * `usage.model` must be present in `MODEL_PRICING` for cost math to
     * populate; otherwise totalCostUsd stays at 0 for the entry but
     * tokens still aggregate.
     */
    recordVerdict(verdict: {
        usage?: {
            inputTokens: number;
            outputTokens: number;
            model: string;
            cachedTokens?: number;
            reasoningTokens?: number;
        };
        verdict?: 'pass' | 'fail' | 'borderline' | string;
    }, scenarioId: string, tags?: Record<string, string>): CostEntry | null;
    get(scenarioId: string): ScenarioCost | undefined;
    list(): ScenarioCost[];
    summary(): CostSummary;
}
export interface CostSummary {
    scenarioCount: number;
    completedCount: number;
    totalInputTokens: number;
    totalOutputTokens: number;
    totalCostUsd: number;
    avgCostPerScenarioUsd: number;
    /** Total USD / completed scenarios — null when nothing completed. */
    costPerCompletedTaskUsd: number | null;
}
//# sourceMappingURL=cost-tracker.d.ts.map