import type { SummarizeConfig } from "../config.js";
import type { SummaryStreamHandler } from "../engine/events.js";
import { createModelExecutor, type ModelExecutorDeps } from "../engine/model-executor.js";
import type { LengthArg } from "../flags.js";
import { resolveRunApiStatus } from "./api-status.js";
import type { RunContextState } from "./context.js";
import { createRunMetrics } from "./metrics.js";
import { type ModelSelection } from "./model-selection.js";
export type ModelExecutorRequestOptions = Pick<ModelExecutorDeps, "openaiRequestOptions" | "openaiRequestOptionsOverride" | "cliReasoningEffortOverride">;
export type RunModelSpec = ModelSelection & {
    fixedModelSpec: Extract<ModelSelection["requestedModel"], {
        kind: "fixed";
    }> | null;
    desiredOutputTokens: number | null;
};
export type RunModelRuntime = {
    metrics: ReturnType<typeof createRunMetrics>;
    apiStatus: ReturnType<typeof resolveRunApiStatus>;
    summaryEngine: ReturnType<typeof createModelExecutor>;
};
export type ExecutableRunModel = RunModelSpec & ModelExecutorRequestOptions & {
    allowAutoCliFallback: boolean;
    envForAuto: RunContextState["envForAuto"];
    cliAvailability: RunContextState["cliAvailability"];
    openaiUseChatCompletions: RunContextState["openaiUseChatCompletions"];
    openaiWhisperUsdPerMinute: RunContextState["openaiWhisperUsdPerMinute"];
    apiStatus: RunModelRuntime["apiStatus"];
    summaryEngine: RunModelRuntime["summaryEngine"];
    summaryStream: SummaryStreamHandler | null;
    getLiteLlmCatalog: RunModelRuntime["metrics"]["getLiteLlmCatalog"];
    llmCalls: RunModelRuntime["metrics"]["llmCalls"];
};
export declare function resolveRunModelSpec({ context, envForRun, explicitModelArg, configForSelection, lengthArg, maxOutputTokensArg, }: {
    context: RunContextState;
    envForRun: Record<string, string | undefined>;
    explicitModelArg: string | null;
    configForSelection: SummarizeConfig | null;
    lengthArg: LengthArg;
    maxOutputTokensArg: number | null;
}): RunModelSpec;
export declare function createRunModelRuntime({ context, env, envForRun, metricsEnv, fetchImpl, execFileImpl, maxOutputTokensArg, timeoutMs, retries, streamingEnabled, requestOptions, log, trace, }: {
    context: RunContextState;
    env: Record<string, string | undefined>;
    envForRun: Record<string, string | undefined>;
    metricsEnv: Record<string, string | undefined>;
    fetchImpl: typeof fetch;
    execFileImpl: ModelExecutorDeps["execFileImpl"];
    maxOutputTokensArg: number | null;
    timeoutMs: number;
    retries: number;
    streamingEnabled: boolean;
    requestOptions?: ModelExecutorRequestOptions;
    log?: ModelExecutorDeps["log"];
    trace?: ModelExecutorDeps["trace"];
}): RunModelRuntime;
export declare function createExecutableRunModel({ spec, runtime, context, allowAutoCliFallback, summaryStream, requestOptions, }: {
    spec: RunModelSpec;
    runtime: RunModelRuntime;
    context: RunContextState;
    allowAutoCliFallback: boolean;
    summaryStream: SummaryStreamHandler | null;
    requestOptions?: ModelExecutorRequestOptions;
}): ExecutableRunModel;
