/** * Shared recovery policy for prompt refinement ("enhance") across every * surface — TUI, CLI-hosted WebUI, and the standalone WebUI server. Keeping the * timeout escalation and fallback-model resolution here means all three surfaces * apply the SAME rule: a slow first attempt (a `timeout` failure) is retried * once with a longer window before the user is asked, and the one-key "retry * with another model" offer resolves to the same model everywhere. * * Pure + framework-free so it can be unit-tested in isolation and imported by * both the React TUI and the Node WebSocket servers. */ import type { Config } from '../types/config.js'; /** Default first-attempt refine window (mirrors `enhanceUserPrompt`'s default). */ export declare const ENHANCE_BASE_TIMEOUT_MS = 90000; /** Floor for a retry window — a retry only helps if it's meaningfully longer. */ export declare const ENHANCE_MIN_RETRY_TIMEOUT_MS = 180000; /** * Dedicated provider/model configured for prompt refinement, normalized as a * `provider/model` ref. The named refiner profile has precedence over the * explicit refiner provider/model, matching `/refiner` and goal refinement. * Returns undefined only when no dedicated refiner is configured; callers may * then deliberately fall back to the live session target. */ export declare function resolveConfiguredRefinerRef(config: Config): string | undefined; /** * Timeout to use for a retry after a first attempt timed out. Prefers an * explicit `enhanceRetryTimeoutMs` config override; otherwise doubles the base * window, floored at {@link ENHANCE_MIN_RETRY_TIMEOUT_MS} so the "extra time" * is always a real increase over the (already generous) default. */ export declare function nextEnhanceTimeout(baseMs: number, config?: { enhanceRetryTimeoutMs?: number | undefined; } | undefined): number; /** * The `provider/model` ref offered as the one-key "retry with another model" * action on a refine failure, or `undefined` when nothing usable is available. * Prefers an explicit `enhanceFallbackModel`; otherwise reuses the first entry * of the agent's existing effective fallback chain (so a user who already * configured `fallbackModels` / has a smart-default chain gets a sensible * offer with zero extra config). Always normalized to `provider/model`. */ export declare function resolveEnhanceFallbackRef(config: Config): string | undefined; //# sourceMappingURL=enhance-recovery.d.ts.map