/** MCP error codes for Google Docs operations */ export type GoogleDocsMcpErrorCode = 'RATE_LIMIT' | 'PERMISSION_DENIED' | 'NOT_FOUND' | 'INVALID_REQUEST' | 'REVISION_CONFLICT' | 'SERVER_ERROR' | 'UNSUPPORTED_FOR_PROVIDER' | 'AUTH_ERROR' | 'ANCHOR_NOT_FOUND' | 'TEXT_NOT_FOUND' | 'MULTIPLE_MATCHES' | 'EDIT_ERROR' | 'SESSION_STALE'; /** Whether an error is retriable */ export type RetryStrategy = { retriable: boolean; baseDelayMs: number; maxDelayMs: number; maxRetries: number; useJitter: boolean; }; /** Error mapping entry */ export type ErrorMapping = { httpCode: number; mcpCode: GoogleDocsMcpErrorCode; retry: RetryStrategy; sessionAction: 'valid' | 'invalidated' | 'cache_invalidated' | 'degraded'; }; /** Google API error to MCP error mapping */ export declare const ERROR_MAP: Record; /** Map a Google API error to an MCP error */ export declare function mapGoogleError(error: unknown): { code: GoogleDocsMcpErrorCode; message: string; hint?: string; mapping: ErrorMapping | null; }; /** Calculate delay for exponential backoff with jitter */ export declare function calculateBackoffDelay(attempt: number, strategy: RetryStrategy): number; /** Sleep for a given number of milliseconds */ export declare function sleep(ms: number): Promise; /** Execute a function with retry logic, honoring per-status maxRetries and Retry-After */ export declare function withRetry(fn: () => Promise, options?: { maxRetries?: number; onRetry?: (attempt: number, error: unknown) => void; /** @internal Injectable sleep for testing */ _sleepFn?: (ms: number) => Promise; }): Promise; //# sourceMappingURL=errors.d.ts.map