import type { NetworkRetryPolicy } from "../network-retry-engine.js"; import { type RetryableApiCallError } from "./common-policy.js"; export declare const COPILOT_RETRYABLE_MESSAGES: string[]; export type RetryableErrorGroup = "transport" | "status" | "stream"; type CopilotStreamErrorInput = { error: unknown; request: Request | URL | string; statusCode?: number; responseHeaders?: Headers; }; type JsonRecord = Record; export type CopilotRepairDecision = { kind: "skip"; } | { kind: "connection-mismatch"; responseText: string; shouldAttemptSessionRepair: boolean; } | { kind: "input-id-too-long"; responseText: string; serverReportedIndex?: number; reportedLength?: number; shouldAttemptSessionRepair: boolean; }; export type CopilotRetryPolicy = NetworkRetryPolicy & { shouldRunResponseRepair: (request: Request | URL | string) => boolean; decideResponseRepair: (input: { request: Request | URL | string; response: Response; requestPayload: JsonRecord | undefined; sessionID?: string; }) => Promise; normalizeStreamError: (input: CopilotStreamErrorInput) => unknown; }; type CreateCopilotRetryPolicyOptions = { extraRetryableClassifier?: (error: unknown) => boolean; }; export declare function isCopilotUrl(request: Request | URL | string): boolean; export declare function isRetryableCopilotTransportError(error: unknown): boolean; export declare function toRetryableApiCallError(error: unknown, request: { url: string; body?: string; }, options?: { group?: RetryableErrorGroup; requestBodyValues?: unknown; statusCode?: number; responseHeaders?: Headers | Record; responseBody?: string; }): RetryableApiCallError; export declare function isRetryableApiCallError(error: unknown): error is RetryableApiCallError; export declare function createCopilotRetryPolicy(options?: CreateCopilotRetryPolicyOptions): CopilotRetryPolicy; export {};