import type { DialogLlmRetryRecoveryAction } from '@longrun-ai/kernel/types/display-state';
import type { LanguageCode } from '@longrun-ai/kernel/types/language';
import type { ProviderConfig } from './client';
import type { LlmRetryStrategy } from './gen';
export type LlmFailureKind = 'retriable' | 'rejected' | 'fatal';
export declare const KIMI_CODE_API_QUIRK = "kimi-code";
export declare const MINIMAX_REASONING_DETAILS_API_QUIRK = "minimax-reasoning-details";
export declare const MINIMAX_THINKING_TYPE_API_QUIRK = "minimax-thinking-type";
export declare const SAME_CONTEXT_EMPTY_RESPONSE_API_QUIRK = "same-context-empty-response";
export declare const VOLCENGINE_INVALID_PARAMETER_AGGRESSIVE_RETRY_API_QUIRK = "volcengine-invalid-parameter-aggressive-retry";
export type LlmFailureSummary = {
    kind: LlmFailureKind;
    message: string;
    status?: number;
    code?: string;
};
export type LlmQuirkFailureHandling = {
    sourceQuirk?: string;
} & ({
    kind: 'default';
} | {
    kind: 'give_up';
    message?: string;
    summaryTextI18n?: Partial<Record<LanguageCode, string>>;
    recoveryAction?: DialogLlmRetryRecoveryAction;
} | {
    kind: 'retry_strategy';
    retryStrategy: LlmRetryStrategy;
    message?: string;
} | {
    kind: 'single_retry';
    delayMs: number;
    message?: string;
});
export type LlmQuirkRecoveryUsage = {
    action: DialogLlmRetryRecoveryAction;
    sourceQuirk?: string;
};
export type LlmFailureQuirkHandlerSession = {
    quirkName: string;
    onRequestContext?: (contextKey: string) => void;
    onFailure: (args: {
        provider: string;
        providerConfig: ProviderConfig;
        failure: LlmFailureSummary;
        error: unknown;
    }) => LlmQuirkFailureHandling;
    onRequestSucceeded?: () => void;
    onRecoveryActionUsed?: (usage: LlmQuirkRecoveryUsage) => void;
};
export declare const XCODE_BEST_STREAM_INTERNAL_ERROR_CODE = "XCODE_BEST_STREAM_INTERNAL_ERROR";
export declare function normalizeProviderApiQuirks(providerConfig: ProviderConfig): Set<string>;
export declare function createLlmFailureQuirkHandlerSession(providerConfig: ProviderConfig): LlmFailureQuirkHandlerSession | undefined;
