export interface ModelSynthesisRecord {
    fired: number;
    total: number;
    lastFired?: string;
    /** Exponential moving average of wall-clock milliseconds per turn.
     * Updated after each session to drive adaptive time budgets. */
    avgTurnMs?: number;
    /** Total model-requested tool calls observed across sessions. */
    toolCalls?: number;
    /** Successful tool dispatches observed across sessions. */
    toolSuccesses?: number;
    /** Sessions where at least one tool was requested. */
    toolSessions?: number;
    /** Sessions that ended with visible assistant text. */
    finalTextResponses?: number;
    /** Sessions that ended without visible assistant text. */
    emptyTextResponses?: number;
    /** Tool calls recovered from inline JSON fallback parsing, when known. */
    parserLiftedToolCalls?: number;
}
export type SynthesisStatsMap = Record<string, ModelSynthesisRecord>;
export declare function loadSynthesisStats(projectDir: string): Promise<SynthesisStatsMap>;
export declare function recordSynthesisFired(projectDir: string, model: string): Promise<void>;
export declare function recordSessionCompleted(projectDir: string, model: string): Promise<void>;
export declare function clearSynthesisStats(projectDir: string, model?: string): Promise<void>;
/**
 * Compute an adaptive maxTurns for a model based on its synthesis history.
 * If a model triggers synthesis more than 40% of the time, it gets extra
 * turns (up to a cap). Models with no history use the default.
 */
export declare function adaptiveMaxTurns(stats: SynthesisStatsMap, model: string, defaultMax: number): number;
/**
 * Record the average turn duration for a model session. Uses an
 * exponential moving average (α = 0.3) so recent sessions have more
 * weight than old ones, and a single outlier doesn't dominate.
 */
export declare function recordAvgTurnDuration(projectDir: string, model: string, avgTurnMs: number): Promise<void>;
export interface ToolUseStatsInput {
    toolCalls: number;
    toolSuccesses: number;
    finalTextResponse: boolean;
    parserLiftedToolCalls?: number;
}
export declare function recordToolUseStats(projectDir: string, model: string, input: ToolUseStatsInput): Promise<void>;
/**
 * Compute an adaptive time budget for a model based on its measured
 * average turn duration. Targets ~TARGET_TURNS turns, clamped to
 * [MIN_BUDGET_MS, MAX_BUDGET_MS].
 *
 * Falls back to the provided default when no turn history exists.
 */
export declare function adaptiveTimeBudget(stats: SynthesisStatsMap, model: string, defaultBudgetMs: number): number;
//# sourceMappingURL=synthesisStats.d.ts.map