import type { SessionEntry } from "../config/sessions.js";
/**
 * One attempt at running an agent turn against a specific provider+model.
 * The runtime falls back to alternate models when the selected one fails;
 * each attempt is captured here for telemetry, the user-visible fallback
 * notice, and persistence in the session entry's fallbackNotice* fields.
 */
export type RuntimeFallbackAttempt = {
    provider: string;
    model: string;
    reason?: string;
    code?: string;
    status?: number;
    error?: string;
};
export type FallbackNoticeState = Pick<SessionEntry, "fallbackNoticeSelectedModel" | "fallbackNoticeActiveModel" | "fallbackNoticeReason">;
export declare function normalizeFallbackModelRef(value?: string): string | undefined;
export declare function formatFallbackAttemptReason(attempt: RuntimeFallbackAttempt): string;
export declare function buildFallbackReasonSummary(attempts: RuntimeFallbackAttempt[]): string;
export declare function buildFallbackAttemptSummaries(attempts: RuntimeFallbackAttempt[]): string[];
export declare function buildFallbackNotice(params: {
    selectedProvider: string;
    selectedModel: string;
    activeProvider: string;
    activeModel: string;
    attempts: RuntimeFallbackAttempt[];
}): string | null;
export declare function buildFallbackClearedNotice(params: {
    selectedProvider: string;
    selectedModel: string;
    previousActiveModel?: string;
}): string;
export declare function resolveActiveFallbackState(params: {
    selectedModelRef: string;
    activeModelRef: string;
    state?: FallbackNoticeState;
}): {
    active: boolean;
    reason?: string;
};
export type ResolvedFallbackTransition = {
    selectedModelRef: string;
    activeModelRef: string;
    fallbackActive: boolean;
    fallbackTransitioned: boolean;
    fallbackCleared: boolean;
    reasonSummary: string;
    attemptSummaries: string[];
    previousState: {
        selectedModel?: string;
        activeModel?: string;
        reason?: string;
    };
    nextState: {
        selectedModel?: string;
        activeModel?: string;
        reason?: string;
    };
    stateChanged: boolean;
};
export declare function resolveFallbackTransition(params: {
    selectedProvider: string;
    selectedModel: string;
    activeProvider: string;
    activeModel: string;
    attempts: RuntimeFallbackAttempt[];
    state?: FallbackNoticeState;
}): ResolvedFallbackTransition;
