/** * Custom error classes for openlore with helpful user-facing messages */ export type ErrorCode = 'NO_API_KEY' | 'NOT_A_REPOSITORY' | 'OPENSPEC_EXISTS' | 'ANALYSIS_TOO_OLD' | 'NO_HIGH_VALUE_FILES' | 'LLM_RATE_LIMIT' | 'OPENSPEC_VALIDATION_FAILED' | 'ANALYSIS_FAILED' | 'GENERATION_FAILED' | 'VERIFICATION_FAILED' | 'CONFIG_NOT_FOUND' | 'INVALID_CONFIG' | 'FILE_WRITE_ERROR' | 'FILE_READ_ERROR' | 'DRIFT_DETECTED' | 'NO_SPECS_FOUND' | 'UNKNOWN_ERROR'; /** * Base error class for openlore with code and suggestion */ export declare class OpenLoreError extends Error { code: ErrorCode; suggestion?: string | undefined; constructor(message: string, code: ErrorCode, suggestion?: string | undefined); /** * Format error for CLI display with color support */ format(useColor?: boolean): string; } /** * Error factory functions with predefined messages and suggestions */ export declare const errors: { noApiKey(): OpenLoreError; notARepository(): OpenLoreError; openspecExists(path: string): OpenLoreError; analysisTooOld(ageHours: number): OpenLoreError; noHighValueFiles(): OpenLoreError; llmRateLimit(attempt: number, maxAttempts: number): OpenLoreError; openspecValidationFailed(details?: string): OpenLoreError; analysisFailed(reason: string): OpenLoreError; generationFailed(reason: string): OpenLoreError; verificationFailed(reason: string): OpenLoreError; configNotFound(path: string): OpenLoreError; invalidConfig(path: string, details?: string): OpenLoreError; fileWriteError(path: string, reason?: string): OpenLoreError; fileReadError(path: string, reason?: string): OpenLoreError; driftDetected(issueCount: number): OpenLoreError; noSpecsFound(): OpenLoreError; unknown(error: unknown): OpenLoreError; }; /** * Type guard to check if an error is a OpenLoreError */ export declare function isOpenLoreError(error: unknown): error is OpenLoreError; /** * Format any error for CLI display */ export declare function formatError(error: unknown, useColor?: boolean): string; /** * Handle errors in CLI commands by formatting and logging them */ export declare function handleError(error: unknown, exit?: boolean): never | void; //# sourceMappingURL=errors.d.ts.map