/**
 * applyReviewModelOverrides — centralised helper for binding a review/QA
 * sub-session to the user's preferred review model.
 *
 * Behavior:
 *   - Parse `default.reviewModel` as `<provider>/<modelId>`.
 *   - Call `rpc.setModel(provider, modelId)` with up to 2 attempts (250ms delay).
 *   - Call `rpc.getState()` and assert the bound model matches.
 *   - Throw on malformed pref, setModel failure, or read-back mismatch.
 *   - Resolve silently when the pref is unset.
 *   - Persist via sessionManager when both sessionManager and sessionId are provided.
 *
 * applyModelString — sibling helper for binding a session to a literal
 * "<provider>/<modelId>" string (e.g. sourced from a role override). Same
 * hard-fail-on-mismatch contract as applyReviewModelOverrides.
 */
interface ModelShape {
    id?: string;
    provider?: string;
}
/**
 * The real RpcBridge.getState() resolves to `{ success, data: { model, ... } }`
 * (see src/server/agent/rpc-bridge.ts). Some unit-test mocks return the
 * `{ model }` shape directly. Accept both so the helper works in both places.
 */
export interface ReviewModelRpc {
    setModel(provider: string, modelId: string): Promise<unknown>;
    getState(): Promise<{
        success?: boolean;
        data?: {
            model?: ModelShape;
        };
    } | {
        model?: ModelShape;
    } | undefined>;
}
export interface ReviewModelPrefs {
    get(key: string): string | undefined;
}
export interface ReviewModelPersister {
    persistSessionModel(sessionId: string, provider: string, modelId: string): void;
}
export interface ApplyReviewModelOptions {
    prefs: ReviewModelPrefs;
    sessionManager?: ReviewModelPersister | null;
    sessionId?: string | null;
    role?: "reviewer" | "qa" | "subsession";
    /** Pref key to read. Defaults to "default.reviewModel". */
    prefKey?: string;
    /** Retry attempts for setModel. Defaults to 2. */
    maxAttempts?: number;
    /** Delay between retries in ms. Defaults to 250. */
    retryDelayMs?: number;
    /**
     * Skip the `setModel` RPC and go straight to read-back verification.
     * Use when the agent was spawned with `--model <provider>/<modelId>`
     * already — the read-back still hard-fails on mismatch, preserving the
     * contract.
     */
    skipSetModel?: boolean;
}
export interface ApplyModelStringOptions {
    sessionManager?: ReviewModelPersister | null;
    sessionId?: string | null;
    /** Label used in error messages, e.g. "role.coder.model". */
    contextLabel?: string;
    /** Retry attempts for setModel. Defaults to 2. */
    maxAttempts?: number;
    /** Delay between retries in ms. Defaults to 250. */
    retryDelayMs?: number;
    /**
     * Skip the `setModel` RPC and go straight to read-back verification.
     * Use when the agent was spawned with `--model <provider>/<modelId>`
     * already — the read-back still hard-fails on mismatch.
     */
    skipSetModel?: boolean;
}
/**
 * Bind an RPC client to a literal `<provider>/<modelId>` model string.
 *
 * Hard-fail contract: throws on malformed input, setModel failure (after
 * retries), or read-back mismatch. Caller is responsible for converting the
 * thrown error into the appropriate user-visible failure (e.g. failed gate,
 * red Unavailable badge).
 */
export declare function applyModelString(rpc: ReviewModelRpc, modelString: string, opts?: ApplyModelStringOptions): Promise<void>;
export declare function applyReviewModelOverrides(rpc: ReviewModelRpc, opts: ApplyReviewModelOptions): Promise<void>;
export {};
//# sourceMappingURL=review-model-override.d.ts.map