/**
 * RAG Error Types
 *
 * Provides typed errors for all RAG operations including chunking,
 * metadata extraction, embedding, vector queries, and reranking.
 * Uses the NeuroLinkFeatureError pattern for consistency.
 */
import { NeuroLinkFeatureError } from "../../core/infrastructure/index.js";
import type { RAGErrorCode } from "../../types/index.js";
/**
 * RAG error codes for all RAG-related operations
 */
export declare const RAGErrorCodes: {
    readonly CHUNKING_ERROR: "RAG_CHUNKING_ERROR";
    readonly CHUNKING_INVALID_CONFIG: "RAG_CHUNKING_INVALID_CONFIG";
    readonly CHUNKING_STRATEGY_NOT_FOUND: "RAG_CHUNKING_STRATEGY_NOT_FOUND";
    readonly CHUNKING_EMPTY_CONTENT: "RAG_CHUNKING_EMPTY_CONTENT";
    readonly CHUNKING_SIZE_EXCEEDED: "RAG_CHUNKING_SIZE_EXCEEDED";
    readonly METADATA_EXTRACTION_ERROR: "RAG_METADATA_EXTRACTION_ERROR";
    readonly METADATA_EXTRACTION_TIMEOUT: "RAG_METADATA_EXTRACTION_TIMEOUT";
    readonly METADATA_SCHEMA_INVALID: "RAG_METADATA_SCHEMA_INVALID";
    readonly METADATA_EXTRACTOR_NOT_FOUND: "RAG_METADATA_EXTRACTOR_NOT_FOUND";
    readonly EMBEDDING_ERROR: "RAG_EMBEDDING_ERROR";
    readonly EMBEDDING_DIMENSION_MISMATCH: "RAG_EMBEDDING_DIMENSION_MISMATCH";
    readonly EMBEDDING_RATE_LIMIT: "RAG_EMBEDDING_RATE_LIMIT";
    readonly EMBEDDING_PROVIDER_ERROR: "RAG_EMBEDDING_PROVIDER_ERROR";
    readonly VECTOR_QUERY_ERROR: "RAG_VECTOR_QUERY_ERROR";
    readonly VECTOR_QUERY_TIMEOUT: "RAG_VECTOR_QUERY_TIMEOUT";
    readonly VECTOR_STORE_UNAVAILABLE: "RAG_VECTOR_STORE_UNAVAILABLE";
    readonly VECTOR_STORE_CONNECTION_ERROR: "RAG_VECTOR_STORE_CONNECTION_ERROR";
    readonly VECTOR_INDEX_NOT_FOUND: "RAG_VECTOR_INDEX_NOT_FOUND";
    readonly RERANKER_ERROR: "RAG_RERANKER_ERROR";
    readonly RERANKER_NOT_FOUND: "RAG_RERANKER_NOT_FOUND";
    readonly RERANKER_API_ERROR: "RAG_RERANKER_API_ERROR";
    readonly GRAPH_RAG_ERROR: "RAG_GRAPH_ERROR";
    readonly GRAPH_TRAVERSAL_ERROR: "RAG_GRAPH_TRAVERSAL_ERROR";
    readonly GRAPH_NODE_NOT_FOUND: "RAG_GRAPH_NODE_NOT_FOUND";
    readonly PIPELINE_ERROR: "RAG_PIPELINE_ERROR";
    readonly PIPELINE_STAGE_FAILED: "RAG_PIPELINE_STAGE_FAILED";
    readonly PIPELINE_PARTIAL_FAILURE: "RAG_PIPELINE_PARTIAL_FAILURE";
    readonly CIRCUIT_BREAKER_OPEN: "RAG_CIRCUIT_BREAKER_OPEN";
    readonly CIRCUIT_BREAKER_HALF_OPEN_LIMIT: "RAG_CIRCUIT_BREAKER_HALF_OPEN_LIMIT";
    readonly OPERATION_TIMEOUT: "RAG_OPERATION_TIMEOUT";
    readonly RETRY_EXHAUSTED: "RAG_RETRY_EXHAUSTED";
    readonly INVALID_CONFIGURATION: "RAG_INVALID_CONFIGURATION";
};
/**
 * RAG error factory using the infrastructure pattern
 */
export declare const RAGErrorFactory: {
    codes: {
        readonly CHUNKING_ERROR: "RAG_CHUNKING_ERROR";
        readonly CHUNKING_INVALID_CONFIG: "RAG_CHUNKING_INVALID_CONFIG";
        readonly CHUNKING_STRATEGY_NOT_FOUND: "RAG_CHUNKING_STRATEGY_NOT_FOUND";
        readonly CHUNKING_EMPTY_CONTENT: "RAG_CHUNKING_EMPTY_CONTENT";
        readonly CHUNKING_SIZE_EXCEEDED: "RAG_CHUNKING_SIZE_EXCEEDED";
        readonly METADATA_EXTRACTION_ERROR: "RAG_METADATA_EXTRACTION_ERROR";
        readonly METADATA_EXTRACTION_TIMEOUT: "RAG_METADATA_EXTRACTION_TIMEOUT";
        readonly METADATA_SCHEMA_INVALID: "RAG_METADATA_SCHEMA_INVALID";
        readonly METADATA_EXTRACTOR_NOT_FOUND: "RAG_METADATA_EXTRACTOR_NOT_FOUND";
        readonly EMBEDDING_ERROR: "RAG_EMBEDDING_ERROR";
        readonly EMBEDDING_DIMENSION_MISMATCH: "RAG_EMBEDDING_DIMENSION_MISMATCH";
        readonly EMBEDDING_RATE_LIMIT: "RAG_EMBEDDING_RATE_LIMIT";
        readonly EMBEDDING_PROVIDER_ERROR: "RAG_EMBEDDING_PROVIDER_ERROR";
        readonly VECTOR_QUERY_ERROR: "RAG_VECTOR_QUERY_ERROR";
        readonly VECTOR_QUERY_TIMEOUT: "RAG_VECTOR_QUERY_TIMEOUT";
        readonly VECTOR_STORE_UNAVAILABLE: "RAG_VECTOR_STORE_UNAVAILABLE";
        readonly VECTOR_STORE_CONNECTION_ERROR: "RAG_VECTOR_STORE_CONNECTION_ERROR";
        readonly VECTOR_INDEX_NOT_FOUND: "RAG_VECTOR_INDEX_NOT_FOUND";
        readonly RERANKER_ERROR: "RAG_RERANKER_ERROR";
        readonly RERANKER_NOT_FOUND: "RAG_RERANKER_NOT_FOUND";
        readonly RERANKER_API_ERROR: "RAG_RERANKER_API_ERROR";
        readonly GRAPH_RAG_ERROR: "RAG_GRAPH_ERROR";
        readonly GRAPH_TRAVERSAL_ERROR: "RAG_GRAPH_TRAVERSAL_ERROR";
        readonly GRAPH_NODE_NOT_FOUND: "RAG_GRAPH_NODE_NOT_FOUND";
        readonly PIPELINE_ERROR: "RAG_PIPELINE_ERROR";
        readonly PIPELINE_STAGE_FAILED: "RAG_PIPELINE_STAGE_FAILED";
        readonly PIPELINE_PARTIAL_FAILURE: "RAG_PIPELINE_PARTIAL_FAILURE";
        readonly CIRCUIT_BREAKER_OPEN: "RAG_CIRCUIT_BREAKER_OPEN";
        readonly CIRCUIT_BREAKER_HALF_OPEN_LIMIT: "RAG_CIRCUIT_BREAKER_HALF_OPEN_LIMIT";
        readonly OPERATION_TIMEOUT: "RAG_OPERATION_TIMEOUT";
        readonly RETRY_EXHAUSTED: "RAG_RETRY_EXHAUSTED";
        readonly INVALID_CONFIGURATION: "RAG_INVALID_CONFIGURATION";
    };
    create: (code: "INVALID_CONFIGURATION" | "CHUNKING_ERROR" | "CHUNKING_INVALID_CONFIG" | "CHUNKING_STRATEGY_NOT_FOUND" | "CHUNKING_EMPTY_CONTENT" | "CHUNKING_SIZE_EXCEEDED" | "METADATA_EXTRACTION_ERROR" | "METADATA_EXTRACTION_TIMEOUT" | "METADATA_SCHEMA_INVALID" | "METADATA_EXTRACTOR_NOT_FOUND" | "EMBEDDING_ERROR" | "EMBEDDING_DIMENSION_MISMATCH" | "EMBEDDING_RATE_LIMIT" | "EMBEDDING_PROVIDER_ERROR" | "VECTOR_QUERY_ERROR" | "VECTOR_QUERY_TIMEOUT" | "VECTOR_STORE_UNAVAILABLE" | "VECTOR_STORE_CONNECTION_ERROR" | "VECTOR_INDEX_NOT_FOUND" | "RERANKER_ERROR" | "RERANKER_NOT_FOUND" | "RERANKER_API_ERROR" | "GRAPH_RAG_ERROR" | "GRAPH_TRAVERSAL_ERROR" | "GRAPH_NODE_NOT_FOUND" | "PIPELINE_ERROR" | "PIPELINE_STAGE_FAILED" | "PIPELINE_PARTIAL_FAILURE" | "CIRCUIT_BREAKER_OPEN" | "CIRCUIT_BREAKER_HALF_OPEN_LIMIT" | "OPERATION_TIMEOUT" | "RETRY_EXHAUSTED", message: string, options?: {
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
    } | undefined) => NeuroLinkFeatureError;
};
/**
 * Base RAG error class extending NeuroLinkFeatureError
 */
export declare class RAGError extends NeuroLinkFeatureError {
    constructor(message: string, code: RAGErrorCode, options?: {
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
    });
}
/**
 * Chunking-specific error
 */
export declare class ChunkingError extends RAGError {
    readonly strategy?: string;
    readonly contentLength?: number;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        strategy?: string;
        contentLength?: number;
    });
}
/**
 * Metadata extraction error
 */
export declare class MetadataExtractionError extends RAGError {
    readonly extractorType?: string;
    readonly chunkId?: string;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        extractorType?: string;
        chunkId?: string;
    });
}
/**
 * Embedding error
 */
export declare class EmbeddingError extends RAGError {
    readonly provider?: string;
    readonly batchSize?: number;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        provider?: string;
        batchSize?: number;
    });
}
/**
 * Vector query error
 */
export declare class VectorQueryError extends RAGError {
    readonly storeType?: string;
    readonly queryLength?: number;
    readonly indexName?: string;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        storeType?: string;
        queryLength?: number;
        indexName?: string;
    });
}
/**
 * Reranker error
 */
export declare class RerankerError extends RAGError {
    readonly rerankerType?: string;
    readonly documentCount?: number;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        rerankerType?: string;
        documentCount?: number;
    });
}
/**
 * Graph RAG error
 */
export declare class GraphRAGError extends RAGError {
    readonly traversalStrategy?: string;
    readonly nodeId?: string;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        traversalStrategy?: string;
        nodeId?: string;
    });
}
/**
 * Pipeline error with partial failure support
 */
export declare class PipelineError extends RAGError {
    readonly stageName?: string;
    readonly successfulChunks?: number;
    readonly failedChunks?: number;
    readonly partialResults?: unknown[];
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        retryable?: boolean;
        details?: Record<string, unknown>;
        cause?: Error;
        stageName?: string;
        successfulChunks?: number;
        failedChunks?: number;
        partialResults?: unknown[];
    });
    /**
     * Check if this is a partial failure (some chunks succeeded)
     */
    isPartialFailure(): boolean;
    /**
     * Get success rate as a percentage
     */
    getSuccessRate(): number;
}
/**
 * Circuit breaker specific error for RAG operations
 */
export declare class RAGCircuitBreakerError extends RAGError {
    readonly circuitName?: string;
    readonly nextRetryTime?: Date;
    constructor(message: string, options?: {
        code?: RAGErrorCode;
        details?: Record<string, unknown>;
        circuitName?: string;
        nextRetryTime?: Date;
    });
}
/**
 * Type guard for RAG errors
 */
export declare function isRAGError(error: unknown): error is RAGError;
/**
 * Type guard for retryable errors
 */
export declare function isRetryableRAGError(error: unknown): boolean;
/**
 * Type guard for partial failure errors
 */
export declare function isPartialFailure(error: unknown): error is PipelineError;
