import { type CacheStore } from "../cache.js";
import type { CliProvider } from "../config.js";
import type { ModelAttempt, ModelAttemptRequiredEnv } from "./types.js";
type SummaryResult = {
    summary: string;
};
type SummaryCacheConfig = {
    store: CacheStore | null;
    ttlMs: number;
    contentHash: string | null;
    promptHash: string | null;
    lengthKey: string;
    languageKey: string;
    autoSelectionModel: string | null;
};
export type SummaryExecutionFailure = {
    lastError: unknown;
    missingRequiredEnvs: Set<ModelAttemptRequiredEnv>;
    sawOpenRouterNoAllowedProviders: boolean;
};
export declare function executeSummaryAttempts<T extends SummaryResult>({ attempts, isFallbackModel, isNamedModelSelection, wantsFreeNamedModel, requestedModelInput, envHasKeyFor, formatMissingModelError, cache, verbose, onModelChosen, onCacheResolved, buildCachedResult, runAttempt, normalizeResult, onFixedModelError, fetchImpl, timeoutMs, rememberCliProvider, }: {
    attempts: ModelAttempt[];
    isFallbackModel: boolean;
    isNamedModelSelection: boolean;
    wantsFreeNamedModel: boolean;
    requestedModelInput: string;
    envHasKeyFor: (requiredEnv: ModelAttemptRequiredEnv) => boolean;
    formatMissingModelError: (attempt: ModelAttempt) => string;
    cache: SummaryCacheConfig;
    verbose: (message: string) => void;
    onModelChosen?: ((modelId: string) => void) | null;
    onCacheResolved?: ((hit: boolean) => void) | null;
    buildCachedResult: (attempt: ModelAttempt, summary: string) => T;
    runAttempt: (attempt: ModelAttempt) => Promise<T>;
    normalizeResult?: ((result: T, attempt: ModelAttempt) => T | Promise<T>) | null;
    onFixedModelError?: ((attempt: ModelAttempt, error: unknown) => never) | null;
    fetchImpl: typeof fetch;
    timeoutMs: number;
    rememberCliProvider?: ((provider: CliProvider) => Promise<void>) | null;
}): Promise<{
    result: T | null;
    usedAttempt: ModelAttempt | null;
    summaryFromCache: boolean;
    failure: SummaryExecutionFailure;
}>;
export {};
