/**
 * Primary chat model + `agents.defaults.model.fallbacks`: one user turn with rollback on failure.
 * Used by channel orchestrator, gateway webchat stream, and direct CLI-style turns.
 */
import type { Agent, AgentMessage } from '@earendil-works/pi-agent-core';
import type { Config } from '../../config/schema.js';
import type { ModelManager } from '../models/index.js';
import { resolveAgentTurnTimeoutMs } from './run-agent-turn-with-timeout.js';
export { resolveAgentTurnTimeoutMs };
type FallbackLog = {
    info: (obj: Record<string, unknown>, msg: string) => void;
    warn: (obj: Record<string, unknown>, msg: string) => void;
    debug?: (obj: Record<string, unknown>, msg: string) => void;
};
export declare function runAgentTurnWithModelFallbacks(params: {
    agent: Agent;
    sessionKey: string;
    modelManager: ModelManager;
    userMessage: AgentMessage;
    log: FallbackLog;
    /** Before `prompt` adds the user message (e.g. background-review nudge counters). */
    beforeUserPrompt?: () => void | Promise<void>;
    /** After `prompt` adds the user message; before `waitForIdle`. */
    afterUserPrompt?: () => Promise<void>;
    /** Overrides {@link resolveAgentTurnTimeoutMs} when set. */
    timeoutMs?: number;
    /** Supplies `agents.defaults.maxTaskDurationMs` for the default turn limit. */
    getConfig?: () => Config | undefined;
}): Promise<void>;
