import { completeSimple, type Api, type Model } from "@earendil-works/pi-ai";
import type { ResolvedProviderAuth } from "../../agents/model-auth.js";
import type { KaijiBotConfig } from "../../config/types.kaijibot.js";
export type StandaloneGenerateTextFn = (prompt: string) => Promise<string>;
export type StandaloneGenerateOptions = {
    maxTokens?: number;
    timeout?: number;
};
export type BatchGenerateOptions = StandaloneGenerateOptions & {
    /** Interval between batch status polls (ms). Default: 30000. */
    pollIntervalMs?: number;
    /** Max wall-clock time to wait for a batch to finish (ms). Default: 24h. */
    batchTimeoutMs?: number;
};
export declare function createStandaloneGenerateText(cfg: KaijiBotConfig, options?: StandaloneGenerateOptions): Promise<StandaloneGenerateTextFn>;
export type StandaloneGenerateDeps = {
    complete: typeof completeSimple;
    prepareModel: (cfg: KaijiBotConfig) => Promise<{
        model: Model<Api>;
        auth: ResolvedProviderAuth;
    } | {
        error: string;
    }>;
};
export declare function createStandaloneGenerateTextWithDeps(deps: StandaloneGenerateDeps, options?: StandaloneGenerateOptions): (cfg: KaijiBotConfig) => Promise<StandaloneGenerateTextFn>;
export type BatchHttpDeps = {
    fetchFn: typeof fetch;
};
/**
 * Submit one prompt to the provider's OpenAI-compatible batch API and poll
 * until it completes, returning the assistant text. Throws on any error,
 * non-completed terminal status, or timeout.
 */
export declare function runBatchGenerate(params: {
    model: Model<Api>;
    auth: ResolvedProviderAuth;
    prompt: string;
    maxTokens: number;
    requestTimeoutMs: number;
    pollIntervalMs: number;
    batchTimeoutMs: number;
    deps: BatchHttpDeps;
}): Promise<string>;
export declare function createStandaloneGenerateTextBatch(cfg: KaijiBotConfig, options?: BatchGenerateOptions): Promise<StandaloneGenerateTextFn>;
export type BackgroundGenerateDeps = {
    sync: StandaloneGenerateDeps;
    batch: StandaloneGenerateDeps & {
        run: typeof runBatchGenerate;
        http: BatchHttpDeps;
    };
};
export declare function createStandaloneGenerateTextBatchWithDeps(deps: BackgroundGenerateDeps, options?: BatchGenerateOptions): (cfg: KaijiBotConfig) => Promise<StandaloneGenerateTextFn>;
/**
 * Background pipeline dispatcher. Picks the batch variant when
 * `agents.defaults.backgroundBatch` is enabled, otherwise the synchronous
 * variant. Used by memory consolidation, correction extraction, and session
 * summary — all non-latency-sensitive single-turn LLM callers.
 */
export declare function createBackgroundGenerateText(cfg: KaijiBotConfig, options?: StandaloneGenerateOptions): Promise<StandaloneGenerateTextFn>;
