import { type CacheState } from "../cache.js";
import type { CliProvider, SummarizeConfig } from "../config.js";
import type { ExtractedLinkContent } from "../content/index.js";
import type { StreamMode } from "../flags.js";
import type { OutputLanguage } from "../language.js";
import type { FixedModelSpec } from "../model-spec.js";
import type { RunApiStatus } from "../shared/run-api-status.js";
import type { SummaryLengthArg } from "../shared/summary-length.js";
import type { SummaryStreamHandler } from "./events.js";
import type { createModelExecutor } from "./model-executor.js";
import { buildModelMetaFromAttempt } from "./model-meta.js";
import type { ModelAttempt } from "./types.js";
type SlidesResult = Awaited<ReturnType<typeof import("../slides/index.js").extractSlidesForSource>>;
export type WebSummaryContext = {
    io: {
        envForRun: Record<string, string | undefined>;
        fetch: typeof fetch;
    };
    flags: {
        timeoutMs: number;
        lengthArg: SummaryLengthArg;
        outputLanguage: OutputLanguage;
        summaryCacheBypass: boolean;
        forceSummary: boolean;
        maxOutputTokensArg: number | null;
        json: boolean;
        slides: unknown;
        streamMode: StreamMode;
        streamingEnabled: boolean;
    };
    model: {
        requestedModelInput: string;
        fixedModelSpec: FixedModelSpec | null;
        isFallbackModel: boolean;
        isImplicitAutoSelection: boolean;
        allowAutoCliFallback: boolean;
        isNamedModelSelection: boolean;
        wantsFreeNamedModel: boolean;
        desiredOutputTokens: number | null;
        configForModelSelection: SummarizeConfig | null;
        envForAuto: Record<string, string | undefined>;
        cliAvailability: Partial<Record<CliProvider, boolean>>;
        apiStatus: Pick<RunApiStatus, "zaiApiKey" | "zaiBaseUrl" | "nvidiaApiKey" | "nvidiaBaseUrl" | "minimaxApiKey" | "minimaxBaseUrl" | "ollamaBaseUrl">;
        summaryEngine: ReturnType<typeof createModelExecutor>;
        summaryStream: SummaryStreamHandler | null;
        getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import("../pricing/litellm.js").loadLiteLlmCatalog>>["catalog"]>;
    };
    cache: CacheState;
};
export type WebSummaryRuntime = {
    log?: ((message: string) => void) | null;
    trace?: ((name: string, detail?: string | null) => void) | null;
    onSummaryCached?: ((cached: boolean) => void) | null;
    readLastSuccessfulCliProvider?: (() => Promise<CliProvider | null>) | null;
    rememberCliProvider?: ((provider: CliProvider) => Promise<void>) | null;
};
type SummaryResolutionUseExtracted = {
    kind: "use-extracted";
    footerLabel: string;
    verboseMessage: string | null;
};
type SummaryResolutionSummary = {
    kind: "summary";
    normalizedSummary: string;
    summaryEmitted: boolean;
    summaryFromCache: boolean;
    usedAttempt: ModelAttempt;
    modelMeta: ReturnType<typeof buildModelMetaFromAttempt>;
    maxOutputTokensForCall: number | null;
};
export type UrlSummaryResolution = SummaryResolutionUseExtracted | SummaryResolutionSummary;
export declare function resolveUrlSummaryExecution({ ctx, url, extracted, prompt, onModelChosen, slides, streamHandler, runtime, }: {
    ctx: WebSummaryContext;
    url: string;
    extracted: ExtractedLinkContent;
    prompt: string;
    onModelChosen?: ((modelId: string) => void) | null;
    slides?: SlidesResult | null;
    streamHandler?: SummaryStreamHandler | null;
    runtime?: WebSummaryRuntime;
}): Promise<UrlSummaryResolution>;
export {};
