import { type SharedRetryNotifier } from "./retry/shared-engine.js"; export type FetchLike = (request: Request | URL | string, init?: RequestInit) => Promise; export type CopilotRetryNotifier = SharedRetryNotifier; type JsonRecord = Record; export type AccountSwitchCleanupResult = { payload: JsonRecord; changed: boolean; strategy: "bulk" | "targeted-fallback" | "none"; }; type AccountSwitchCleanupPhaseResult = { payload: JsonRecord; changed: boolean; patchedSessionState?: boolean; }; export type AccountSwitchCleanupInput = { payload: JsonRecord; bulkCleanup?: (input: { payload: JsonRecord; }) => Promise; targetedCleanup?: (input: { payload: JsonRecord; }) => Promise; }; export type RateLimitEvidence = { matched: boolean; retryAfterMs?: number; }; export type CopilotRetryContext = { client?: { session?: { get?: (input: { path: { id: string; }; query?: { directory?: string; }; throwOnError?: boolean; }) => Promise<{ data?: { parentID?: string; }; }>; messages?: (input: { path: { id: string; }; }) => Promise<{ data?: Array<{ info?: { id?: string; role?: string; }; parts?: Array; }>; }>; message?: (input: { path: { id: string; messageID: string; }; }) => Promise<{ data?: { parts?: Array; }; }>; }; part?: { update?: (input: { sessionID: string; messageID: string; partID: string; directory?: string; part?: JsonRecord; }) => Promise; }; tui?: { showToast?: (options: { body: { title?: string; message: string; variant: "info" | "success" | "warning" | "error"; duration?: number; }; query?: undefined; }) => Promise; }; }; directory?: string; serverUrl?: URL; lastAccountSwitchAt?: number; clearAccountSwitchContext?: () => Promise; wait?: (ms: number) => Promise; patchPart?: (request: { url: string; init: RequestInit; }) => Promise; notifier?: CopilotRetryNotifier; }; export declare const INTERNAL_SESSION_CONTEXT_KEY = "__opencodeInternalSessionID"; export declare function cleanupLongIdsForAccountSwitch(input: AccountSwitchCleanupInput): Promise; export declare function detectRateLimitEvidence(response: Response): Promise; export declare function isRetryableCopilotFetchError(error: unknown): boolean; export declare function createCopilotRetryingFetch(baseFetch: FetchLike, options?: CopilotRetryContext): (request: Request | URL | string, init?: RequestInit) => Promise; export {};