export interface CLIError {
    error: string;
    details: string;
    code?: string;
    stack?: string;
    suggestions?: string[];
}
export declare class GuildCLIError extends Error {
    readonly code: string;
    readonly details?: string | undefined;
    constructor(code: string, message: string, details?: string | undefined);
}
/**
 * Common error codes
 */
export declare const ErrorCodes: {
    readonly NETWORK_ERROR: "NETWORK_ERROR";
    readonly CONN_REFUSED: "ECONNREFUSED";
    readonly TIMEOUT: "ETIMEDOUT";
    readonly DNS_ERROR: "ENOTFOUND";
    readonly REQUEST_ABORTED: "ECONNABORTED";
    readonly REQUEST_CANCELED: "ERR_CANCELED";
    readonly AUTH_FAILED: "AUTH_FAILED";
    readonly AUTH_TOKEN_EXPIRED: "AUTH_TOKEN_EXPIRED";
    readonly AUTH_TOKEN_INVALID: "AUTH_TOKEN_INVALID";
    readonly AUTH_REQUIRED: "AUTH_REQUIRED";
    readonly IAP_NOT_AUTHENTICATED: "IAP_NOT_AUTHENTICATED";
    readonly IAP_GCLOUD_NOT_FOUND: "IAP_GCLOUD_NOT_FOUND";
    readonly IAP_ACCESS_DENIED: "IAP_ACCESS_DENIED";
    readonly FORBIDDEN: "FORBIDDEN";
    readonly API_ERROR: "API_ERROR";
    readonly NOT_FOUND: "NOT_FOUND";
    readonly BAD_REQUEST: "BAD_REQUEST";
    readonly SERVER_ERROR: "SERVER_ERROR";
    readonly RESOURCE_EXISTS: "RESOURCE_EXISTS";
    readonly RESOURCE_NOT_FOUND: "RESOURCE_NOT_FOUND";
    readonly OPERATION_FAILED: "OPERATION_FAILED";
    readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
    readonly VALIDATION_ERROR: "VALIDATION_ERROR";
};
/**
 * Check if debug mode is enabled (CLI flag, config, or env var)
 */
export declare function isDebugMode(): boolean;
/**
 * Log debug message if debug mode is enabled
 */
export declare function debug(message: string, ...args: unknown[]): void;
/**
 * Format error for output
 */
export declare function formatError(error: string, details: string, code?: string, stack?: string, suggestions?: string[]): CLIError;
/**
 * Get user-friendly error message for common error codes
 */
export declare function getFriendlyErrorMessage(code: string, originalMessage: string): {
    error: string;
    details: string;
    suggestions?: string[];
};
/**
 * Handle axios error and return standardized error
 */
export declare function handleAxiosError(error: unknown): CLIError;
/**
 * Check if an error is an IAP (Google Identity-Aware Proxy) error
 */
export declare function isIapError(error: unknown): boolean;
/**
 * Check if an error is a Guild auth error
 */
export declare function isAuthError(error: unknown): boolean;
/**
 * Check if a 401 response message indicates the stored auth token should be cleared.
 * Uses exact match — only clear for known Guild auth failures.
 */
export declare function shouldClearAuthToken(responseMessage: string | undefined): boolean;
/**
 * Check if an error is fatal (should not be retried)
 *
 * Fatal errors include:
 * - IAP authentication failures (need gcloud auth login)
 * - Guild authentication failures (need guild auth login)
 * - 4xx HTTP errors (client errors, not transient)
 */
export declare function isFatalError(error: unknown): boolean;
/**
 * Check if an error is retryable (transient network/server issues)
 */
export declare function isRetryableError(error: unknown): boolean;
/**
 * Retry a function with exponential backoff
 */
export declare function retry<T>(fn: () => Promise<T>, options?: {
    maxAttempts?: number;
    initialDelay?: number;
    maxDelay?: number;
    backoffMultiplier?: number;
    shouldRetry?: (error: unknown) => boolean;
}): Promise<T>;
//# sourceMappingURL=errors.d.ts.map