export interface FetchError extends Error { response?: { status: number; statusText: string; data: any; headers: Record; } | undefined; config?: { url: string; method?: string; } | undefined; } export declare const isFetchError: (error: any) => error is FetchError; export declare const isAuthFailureStatus: (status: number | undefined) => boolean; /** * Guidance shown when a request fails with 401 and the CLI/client did not * attach an Authorization header. 401 means the request had no credentials * at all, so this is unambiguous. */ export declare const MISSING_AUTH_GUIDANCE: string; /** * Guidance shown when a request fails with 403 and the CLI/client did not * attach an Authorization header. Unlike 401, a 403 here can also mean an * intermediary (e.g. an egress proxy in a sandboxed agent environment) * injected a credential of the wrong type for this endpoint (e.g. a project * API token against an OAuth-only route) — not that credentials were * missing entirely. */ export declare const WRONG_CREDENTIAL_TYPE_GUIDANCE: string; export declare const maybeEnrichFetchError: (error: T) => T; /** * When a request was made without an Authorization header and the server * responded 401/403, rewrite the error message with missing-auth guidance. * Returns the original error unchanged otherwise. */ export declare const maybeEnrichMissingAuthFetchError: (error: T, hadAuthorizationHeader: boolean) => T; //# sourceMappingURL=errors.d.ts.map