import { CSSProperties, MouseEvent, ReactNode, ElementType } from 'react'; import { W as WidgetPosition, P as Product, u as UIConfig, c as ProjectChatSettings, q as RagMessage, y as VectorMatch, p as RagConfig, I as ILLMProvider, h as IngestDocument, C as ChatMessage, e as ChatResponse, _ as RetrievalResult, v as UniversalRagConfig, U as UITransformationResponse, L as LLMConfig, f as EmbeddingConfig, V as VectorDBConfig } from './ILLMProvider-DO5gj-e5.mjs'; interface ArchitectureCardProps { icon: ReactNode; title: string; description: string; badge: string; badgeColor: string; } interface Snippet { id: string; title: string; description: string; code: string; language: string; } interface PipelineStep { step: string; Icon: ElementType; title: string; desc: string; colors: { from: string; to: string; }; } interface ProviderPill { Icon: ElementType; label: string; } type ChatViewportSize = 'compact' | 'medium' | 'large'; interface ChatWindowProps { /** Additional className for the wrapper div */ className?: string; /** Inline styles for the wrapper div */ style?: CSSProperties; /** Called when the close button is clicked (for widget mode) */ onClose?: () => void; /** Whether to show a close (X) button in the header */ showClose?: boolean; /** Called when the user starts dragging the resize handle */ onResizeStart?: (e: MouseEvent) => void; /** Called when the user clicks the reset size button */ onResetResize?: () => void; /** Whether the window has been resized from its default */ isResized?: boolean; /** Called when the user clicks the maximize/minimize button */ onMaximize?: () => void; /** Whether the window is currently maximized */ isMaximized?: boolean; /** Called when the user clicks 'Add to Cart' on a product */ onAddToCart?: (product: Product) => void; /** Optional custom API URL to send chat messages to */ apiUrl?: string; /** Base URL for Retrivora SDK history/feedback/sessions endpoints. * Defaults to '/api/retrivora'. Set this to match your catch-all route location. */ retrivoraApiBase?: string; /** Optional Retrivora license key override */ licenseKey?: string; /** Optional custom headers to send with the chat request */ headers?: Record; /** Optional session ID to load conversation history from the server */ sessionId?: string; /** Whether to show the ChatGPT-style sidebar history management and new chat controls */ showHistory?: boolean; } interface ChatWidgetProps { /** Position of the floating button. Defaults to bottom-right. */ position?: WidgetPosition; /** Called when the user clicks 'Add to Cart' on a product */ onAddToCart?: (product: Product) => void; /** Optional custom API URL to send chat messages to */ apiUrl?: string; /** * Base URL for Retrivora SDK history/feedback/sessions endpoints. * Defaults to '/api/retrivora'. */ retrivoraApiBase?: string; /** Optional Retrivora license key override */ licenseKey?: string; /** Optional custom headers to send with the chat request */ headers?: Record; } interface MessageBubbleProps { message: RagMessage; sources?: VectorMatch[]; isStreaming?: boolean; primaryColor: string; accentColor: string; onAddToCart?: (product: Product) => void; viewportSize?: ChatViewportSize; /** Whether to show the sources toggle and cards (respects dashboard citations setting) */ showSources?: boolean; /** Called when the user clicks thumbs up or thumbs down on an assistant message */ onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void; } interface ProductCardProps { product: Product; primaryColor?: string; onAddToCart?: (product: Product) => void; } interface ProductCarouselProps { products: Product[]; primaryColor?: string; onAddToCart?: (product: Product) => void; } interface DocumentUploadProps { /** Optional namespace for the upload */ namespace?: string; /** Custom upload API endpoint URL (defaults to /api/retrivora/upload or /api/upload) */ uploadUrl?: string; /** Base URL for Retrivora SDK endpoints (defaults to /api/retrivora) */ retrivoraApiBase?: string; /** Callback when upload completes */ onUploadComplete?: (results: unknown) => void; /** Additional className */ className?: string; } interface SourceCardProps { source: VectorMatch; index: number; } interface ClientConfig { projectId: string; ui: Required; embedding?: { model?: string; dimensions?: number; }; licenseKey?: string; headers?: Record; retrivoraApiBase?: string; projectSettings?: ProjectChatSettings; autoLoadProjectSettings?: boolean; /** True while validate + /config are still in-flight. ChatWidget shows nothing until false. */ isProjectSettingsLoading?: boolean; /** True once /validate succeeds. False if license is expired/invalid/revoked. */ isLicenseValid?: boolean; /** True once /config returns 200 and config is populated. False if /config call failed. */ isConfigLoaded?: boolean; /** Human-readable error from the init sequence (license error or config fetch error). */ initError?: string; } interface ConfigProviderProps { config?: { projectId?: string; ui?: Partial; embedding?: { model?: string; dimensions?: number; }; licenseKey?: string; headers?: Record; retrivoraApiBase?: string; projectSettings?: Partial; autoLoadProjectSettings?: boolean; primaryColor?: string; secondaryColor?: string; accentColor?: string; theme?: 'light' | 'dark' | 'system'; borderRadius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'; visualStyle?: 'solid' | 'glass'; }; children: ReactNode; } /** * DocumentChunker — splits long text into overlapping chunks * suitable for vector embedding and retrieval. * * Strategy: sentence-aware sliding window * 1. Split on sentence boundaries * 2. Accumulate sentences into chunks up to `chunkSize` characters * 3. Carry over `chunkOverlap` characters from the previous chunk */ interface Chunk { id: string; content: string; metadata?: Record; } interface ChunkOptions { /** Target chunk size in characters (default 1000) */ chunkSize?: number; /** Overlap between consecutive chunks in characters (default 200) */ chunkOverlap?: number; /** Source document identifier used as ID prefix */ docId?: string | number; /** Extra metadata to attach to every chunk */ metadata?: Record; /** Characters used to split text, in order of priority */ separators?: string[]; } declare class DocumentChunker { private readonly chunkSize; private readonly chunkOverlap; private readonly separators; constructor(chunkSize?: number, chunkOverlap?: number, separators?: string[]); /** * Split a single text string into overlapping chunks using a recursive strategy. * Preserves structural boundaries (Markdown headers) where possible. */ chunk(text: string, options?: ChunkOptions): Chunk[]; private recursiveSplit; chunkMany(documents: Array<{ content: string; docId?: string | number; metadata?: Record; }>): Chunk[]; } type CircuitState = 'closed' | 'open' | 'half-open'; interface CircuitBreakerOptions { failureThreshold?: number; resetTimeoutMs?: number; halfOpenMaxCalls?: number; } declare class CircuitBreaker { private state; private failureCount; private successCount; private lastFailureAt; private halfOpenCalls; private readonly failureThreshold; readonly resetTimeoutMs: number; private readonly halfOpenMaxCalls; constructor(options?: CircuitBreakerOptions); record(success: boolean): void; canExecute(): boolean; /** * Increments the half-open probe counter when a call is attempted in * half-open state. Must be called after `canExecute()` returns true and * the state is half-open. Safe to call in other states (no-op). */ incrementHalfOpen(): void; /** * Returns the number of milliseconds the caller should wait before retrying. * Returns 0 when the circuit is closed or half-open (i.e., calls are allowed). * * Fix TYPE-1: replaces direct access to private `lastFailureAt` field via * `(cb as any).lastFailureAt` in BatchProcessor. */ retryAfterMs(): number; wrap(fn: () => Promise): Promise; getState(): CircuitState; getFailureCount(): number; reset(): void; } /** * BatchProcessor.ts — Handles batch operations with retry logic. * * Provides exponential backoff, partial failure tracking, and * configurable batch sizing for efficient bulk operations. * * Fix ARCH-3: BatchProcessor no longer holds a static module-level * CircuitBreaker that was shared across all callers. Each call site * that needs circuit-breaking should create its own CircuitBreaker * and pass it via BatchOptions.circuitBreaker so failures in one * upstream (e.g., Pinecone) do not trip the breaker for unrelated * upstreams (e.g., PostgreSQL). */ interface BatchOptions { /** Maximum number of items per batch */ batchSize?: number; /** Maximum number of retries for transient failures */ maxRetries?: number; /** Initial delay before retry in milliseconds */ initialDelayMs?: number; /** Maximum delay between retries in milliseconds */ maxDelayMs?: number; /** Multiplier for exponential backoff */ backoffMultiplier?: number; /** Whether to throw on any partial failure */ throwOnPartialFailure?: boolean; /** * Optional circuit breaker scoped to the upstream being called. * * Fix ARCH-3: provide your own CircuitBreaker instance per upstream so * failures in one provider (e.g., Pinecone) do not trip the breaker for * unrelated providers (e.g., PostgreSQL). When omitted, calls are made * directly without circuit-breaking. */ circuitBreaker?: CircuitBreaker; } interface BatchResult { results: T[]; errors: Array<{ index: number; error: Error; itemCount?: number; }>; totalProcessed: number; totalFailed: number; } /** * Determines if an error is transient (should retry) */ declare function isTransientError(error: unknown): boolean; declare class BatchProcessor { /** * Execute a processor call, optionally through a caller-provided circuit * breaker. Only transient failures count toward opening the circuit. * * Fix ARCH-3: removed the static module-level `cb` field. Callers must * supply their own CircuitBreaker via BatchOptions.circuitBreaker. * Fix TYPE-1: uses the public retryAfterMs() and incrementHalfOpen() * API instead of accessing private fields via `as any`. */ private static executeWithCircuitBreaker; /** * Processes an array of items in configurable batches with retry logic. * * @param items - Items to process * @param processor - Async function that processes a batch of items * @param options - Configuration for batch size, retries, etc. * @returns Object with results, errors, and statistics * * @example * const docs = [...]; * const result = await BatchProcessor.processBatch( * docs, * (batch) => vectorDB.batchUpsert(batch), * { batchSize: 100, maxRetries: 3 } * ); */ static processBatch(items: T[], processor: (batch: T[]) => Promise, options?: BatchOptions): Promise>; /** * Processes items sequentially (one at a time) with retry logic. * Useful for operations that don't support batching or when granular * error tracking is needed. */ static processSequential(items: T[], processor: (item: T) => Promise, options?: BatchOptions): Promise>; /** * Maps over items with retry logic, returning results in order. * Like Array.map() but with async processing and automatic retries. */ static mapWithRetry(items: T[], mapper: (item: T) => Promise, options?: BatchOptions): Promise; /** * Parallel processor with concurrency limit. * Processes up to `concurrency` items at the same time. */ static processConcurrent(items: T[], processor: (item: T) => Promise, concurrency?: number, options?: BatchOptions): Promise>; } /** * Pipeline — orchestrates the RAG flow: Embed → Search → Augment → Generate. * * Features: * - Lazy initialization of providers * - Batch processing with retry logic * - Smart embedding strategy (integrated / separate / external) * - Error recovery for transient failures * - Multi-tenancy support via namespacing * - LRU-bounded embedding cache (max 500 entries, prevents memory leaks) * - Full observability tracing (latency, tokens, hallucination scoring) */ declare class Pipeline { private config; private vectorDB; private graphDB?; private llmProvider; private embeddingProvider; private llmRouter; private chunker; private llamaIngestor?; private entityExtractor?; private reranker; private agent?; private mcpRegistry?; private multiAgentCoordinator?; /** LRU-bounded cache: avoids re-embedding identical queries within the same process. */ private embeddingCache; private initialised; /** Namespace-specific static cold context cache for CAG */ private coldContexts; constructor(config: RagConfig); /** * Expose the underlying LLM provider (set after initialize()). * Used by the stream handler to pass to UITransformer.analyzeAndDecide(). */ getLLMProvider(): ILLMProvider | undefined; /** * True when multi-agent / MCP mode is active: * architecture === 'multi-agent' OR mcpServers array is non-empty. * Uses MultiAgentCoordinator (custom supervisor loop). */ private get isMultiAgentMode(); /** * True when the LangChain ReAct agent mode is selected: * architecture === 'agentic'. * Uses LangChainAgent (LangGraph-backed ReAct, optional peer dep). */ private get isLangChainAgentMode(); /** Union of both agentic execution paths — used to gate the normal RAG pipeline. */ private get isAgenticMode(); initialize(): Promise; private loadColdContext; /** * Ingest documents with automatic chunking, embedding, and batch upsert. */ ingest(documents: IngestDocument[], namespace?: string): Promise>; /** Step 1: Chunk the document content. */ private prepareChunks; /** * Step 2: Generate embeddings for chunks with retry logic. * Uses batchEmbed when available for efficiency; falls back to sequential embedding. */ private processEmbeddings; /** Step 3: Upsert chunks to vector database with retry logic. */ private processUpserts; /** Step 4: Optional graph-based entity extraction and ingestion. */ private processGraphIngestion; runNormalQuery(question: string, history?: ChatMessage[], namespace?: string): Promise<{ reply: string; sources: any[]; }>; ask(question: string, history?: ChatMessage[], namespace?: string): Promise; askStream(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable; /** * High-performance streaming RAG flow. * Yields text chunks first, then the retrieval metadata + observability trace at the end. * * Latency optimizations: * - Strategy classification runs in parallel with query embedding (saves ~400ms) * - Hallucination scoring is fire-and-forget (doesn't block metadata yield) * - UITransformation is computed after text streaming and emitted with metadata * - SchemaMapper.train runs while answer generation streams */ askStreamInternal(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable; /** * Universal retrieval method combining all enabled providers. * Uses an LRU-bounded embedding cache to avoid re-embedding the same query. */ private generateUiTransformation; private applyStructuredFilters; private resolveNumericPredicateValue; private extractNumericValueFromContent; private matchesNumericPredicate; private normalizeComparableField; private fieldSimilarityScore; private fieldTokens; private toFiniteNumber; retrieve(query: string, options: { namespace?: string; topK?: number; filter?: Record; }): Promise; /** Rewrite the user query for better retrieval performance. */ private rewriteQuery; /** Generate 3-5 short, relevant questions based on the vector database content. */ getSuggestions(query: string, namespace?: string): Promise; } /** * Public SDK facade matching the prompt-level Retrivora API. * * It keeps provider details behind configuration and delegates execution to the * existing Pipeline implementation. */ declare class Retrivora { private readonly pipeline; readonly config: RagConfig; constructor(config?: UniversalRagConfig); initialize(): Promise; ingest(documents: IngestDocument[], namespace?: string): Promise>; ask(question: string, history?: ChatMessage[], namespace?: string): Promise; askStream(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable; getPipeline(): Pipeline; } /** * Dynamically resolved SDK Version from package.json */ declare const SDK_VERSION: string; /** * ConfigFetcher.ts — Dynamically fetches project credentials from Retrivora Control Plane * without hardcoding plain-text master keys in NPM package binaries. * * SECURITY: The SDK must ONLY call the Retrivora Control Plane at https://www.retrivora.com. * It must never call the end user's own localhost or any other endpoint. * LLM and embedding calls are proxied through https://www.retrivora.com/api/v1 which * forwards to https://llm.retrivora.com with the server-side LITELLM_MASTER_KEY. */ interface RemoteVectorConfig { apiKey: string; indexName: string; provider: string; projectId?: string; namespace?: string; } interface RemoteEmbeddingConfig { provider: string; model: string; baseUrl: string; apiKey: string; profile?: string; } interface RemoteLLMConfig { provider: string; model: string; baseUrl: string; apiKey: string; profile?: string; } interface RemoteConfig { projectId?: string; tier?: string; isActive?: boolean; expiresAt?: string; allowedModels?: string[]; vectorDb: RemoteVectorConfig; embedding: RemoteEmbeddingConfig; llm: RemoteLLMConfig; workspace?: { namespace: string; indexName: string; }; projectSettings?: ProjectChatSettings; } declare class ConfigFetcher { private static cache; /** In-flight deduplication: concurrent callers for the same key share one network request */ private static inflight; private static readonly TTL_MS; /** * Fetch full project configuration (vectorDb + embedding + llm + workspace) from Retrivora Control Plane. * * The SDK calls https://www.retrivora.com/api/v1/config with the project ID and license key. * The server validates the license against the database and returns: * - validity (tier, isActive, expiresAt) * - LLM model info * - embedding model info * - Pinecone index name and workspace/namespace * * The Pinecone API key is NOT returned (server-only). The SDK uses local * PINECONE_API_KEY if available, or vector operations are handled server-side. */ static fetchRemoteConfig(projectId: string, licenseKey?: string): Promise; /** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */ private static _doFetch; /** Convenience: fetch only vector DB config (backwards compat). */ static fetchRemoteVectorConfig(projectId: string, licenseKey?: string): Promise; } /** * Primary rendering outcome types supported by the decision engine. */ type RenderType = 'text' | 'table' | 'carousel' | 'chart' | 'mixed' | 'card' | 'none'; /** * Chart sub-types available when renderType === 'chart'. */ type ChartType = 'bar' | 'line' | 'pie' | 'scatter'; /** * High-level intent classification categories. */ type IntentCategory = 'information_lookup' | 'product_search' | 'recommendation' | 'comparison' | 'analytics' | 'trend_analysis' | 'ranking' | 'summarization'; /** * Individual section specifier for multi-section (mixed) responses. */ interface RenderSectionDecision { type: RenderType; chartType?: ChartType; title?: string; } /** * Final decision produced by the Visualization Decision Engine. */ interface RenderDecision { /** Primary rendering format selected */ renderType: RenderType; /** Specific chart sub-type if renderType === 'chart' */ chartType?: ChartType; /** Confidence score between 0.0 and 1.0 */ confidence: number; /** Human-readable explanation of why this decision was reached */ reason: string; /** Sub-sections if renderType === 'mixed' */ sections?: RenderSectionDecision[]; } /** * Context provided to the intent classifier & decision engine rules. */ interface DecisionContext { /** Original user prompt/query string */ userQuery: string; /** Vector DB retrieved documents / context records */ retrievedDocuments?: VectorMatch[]; /** Optional LLM text response if already available */ llmResponse?: string; /** Additional custom metadata or config settings */ metadata?: Record; } /** * Interface implemented by rule strategies in the Rule Engine. */ interface IRenderRule { /** Unique name of the decision rule */ name: string; /** Precedence score (higher priority rules run first) */ priority: number; /** Evaluate the rule against current query context and classified intent */ evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null; } /** * Interface implemented by pluggable Renderer Strategies in RendererRegistry. */ interface IRendererStrategy { /** Render type identifier handled by this strategy */ type: RenderType | string; /** Transform input data into a standardized UITransformationResponse payload */ render(data: unknown, options?: Record): UITransformationResponse; } /** * Input contract for `LicenseValidator.validate()`. * * At least one source must yield a license key: `licenseKey` field, an * `x-license-key` entry in `headers`, or the process environment variables * (NEXT_PUBLIC_RETRIVORA_LICENSE_KEY / RETRIVORA_LICENSE_KEY). */ interface LicenseValidationRequest { /** Explicit `rtv_`-prefixed license key passed as a prop (highest priority). */ licenseKey: string; /** Project ID the caller is running under, checked for license binding match. */ projectId?: string; /** SDK version reported for minimum-supported-version enforcement (defaults to SDK_VERSION). */ sdkVersion?: string; /** SDK package identifier sent to server for observability. */ sdk?: string; /** browser | node — reported for observability only. */ platform?: string; /** Override base URL of the Retrivora API endpoint. Defaults to env or '/api/retrivora'. */ retrivoraApiBase?: string; /** Custom headers that may contain `x-license-key` or `Authorization: Bearer`. */ headers?: Record; } /** * Response contract returned from `LicenseValidator.validate()`. * * Status enumerations are ordered — anything other than ACTIVE means the * widget/chat must be disabled and must not pass server-side handler checks. */ interface LicenseValidationResponse { /** True only when `licenseStatus` is ACTIVE and SDK version is supported. */ valid: boolean; /** Lifecycle state of the license record. TERMINATED/SUSPENDED/EXPIRED/REVOKED must block chat. */ licenseStatus: 'ACTIVE' | 'SUSPENDED' | 'TERMINATED' | 'EXPIRED' | 'REVOKED'; /** Minimum SDK version that the server will accept (semver-compare). */ minimumSupportedVersion: string; /** Latest generally-available SDK version (for upgrade prompts). */ latestVersion: string; /** True when the SDK version is older than minimumSupportedVersion — UI must force upgrade. */ forceUpgrade: boolean; /** RFC3339 expiration timestamp or null for perpetual licenses. */ expiresAt: string | null; /** Human-readable status/reason string, suitable for tooltips/toasts. */ message: string; } /** * Client-side orchestrator for license validation. * * Flow: * 1. Resolve the license key (prop → header → env) * 2. Return any fresh (< 5 min old) successful cached result * 3. POST to `{retrivoraApiBase}/v1/license/validate` for server-side DB-backed status * 4. On network or HTTP error, fall back to zero-latency local RSA signature * verification via `LicenseVerifier.verify()`. * * Caching policy: * - ONLY successful (valid + ACTIVE + !forceUpgrade) responses are cached * - Any failed validation immediately purges the cache entry * - TTL is 5 minutes for success cache to allow TERMINATED/REVOKED status * changes on the server to propagate quickly. * * Thread safety: Singleton pattern via `getInstance()`. Used by ChatWidget, * useRagChat hook, and the server-side `createLicenseHandler` indirectly through * its own `LicenseVerifier.verify()` path. */ declare class LicenseValidator { private static instance; private cache; /** In-flight deduplication: concurrent calls for same key share one network request */ private inflight; private static readonly SUCCESS_CACHE_TTL_MS; private constructor(); /** @returns Singleton instance of the validator (shared cache across all consumers). */ static getInstance(): LicenseValidator; /** * Purge entries from the local success cache. * * @param licenseKey - Optional. If provided, only that key's cache entry is * removed. If omitted the entire cache is cleared. * Callers use this after any 401/403 to ensure the next * validate() call re-validates against the server. */ purgeCache(licenseKey?: string): void; /** * Primary validation entry-point for UI / hook consumers. * * Resolves the license key, consults the local success cache, performs a * server POST for authoritative status, and falls back to local RSA * signature verification if the server can't be reached. * * @throws LicenseValidationError - When no key is provided OR both the * server call AND the local-RSA fallback report an invalid/expired key. * @throws SDKVersionUnsupportedError - When server reports forceUpgrade=true. * @returns A `LicenseValidationResponse` that the UI can use to enable or * lock the chat widget. */ validate(request: LicenseValidationRequest): Promise; /** Performs the actual network request. Called once; result shared by in-flight dedup. */ private _doNetworkValidate; } /** * LicenseConfigResolver — Resolves LLM and embedding configuration * based on the user's license tier from Retrivora admin dashboard. * * The end-user SDK only needs: * - licenseKey (JWT token from Retrivora) * - projectId (workspace identifier) * * Configuration includes: * 1. Tier-based model selection (/api/v1/config) * 2. Provider API credentials (/api/v1/credentials) * 3. Vector DB and rate limit settings * * All provider API keys (Gemini, Groq, Pinecone) are stored on Retrivora backend * and never exposed to end-users directly. */ interface LicenseTierConfig { tier: 'free_trial' | 'free' | 'hobby' | 'pro' | 'enterprise'; llmModel: string; embeddingModel: string; embeddingDimensions: number; maxTokens: number; chunkSize: number; chunkOverlap: number; topK: number; vectorDb: { provider: string; indexName: string; }; rateLimit?: { requestsPerMinute: number; tokensPerDay: number; }; systemPrompt?: string; } interface ProviderCredentials { geminiApiKey?: string; groqApiKey?: string; pineconeApiKey?: string; textEmbeddingProvider?: string; } interface ProviderCredentials { geminiApiKey?: string; groqApiKey?: string; pineconeApiKey?: string; textEmbeddingProvider?: string; } /** * Resolver for license-based configuration. * This is called by the end-user SDK after they instantiate with licenseKey + projectId. */ declare class LicenseConfigResolver { private static readonly RETRIVORA_CONFIG_URL; private static readonly RETRIVORA_CREDENTIALS_URL; private static readonly CACHE_TTL_MS; private static configCache; /** * Validate and resolve configuration from license key * @param licenseKey JWT token from Retrivora (format: rtv_eyJ...) * @param projectId Workspace identifier * @returns Resolved LLM and embedding configs with provider credentials */ static resolveFromLicense(licenseKey: string, projectId: string): Promise<{ llmConfig: LLMConfig; embeddingConfig: EmbeddingConfig; vectorDbConfig: VectorDBConfig; tierConfig: LicenseTierConfig; credentials: ProviderCredentials; }>; /** * Fetch tier configuration from Retrivora config API */ private static fetchTierConfig; /** * Fetch provider credentials from Retrivora credentials API */ private static fetchProviderCredentials; /** * Build LLM, embedding, and vector DB configs from tier and credentials */ private static buildConfigs; /** * Get provider-specific vector DB options */ private static getVectorDbOptions; /** * Clear configuration cache (useful for testing or manual refresh) */ static clearCache(): void; /** * Get cache stats for debugging */ static getCacheStats(): { size: number; entries: string[]; }; } /** * Named SDK exceptions make failures machine-readable for host applications. */ type RetrivoraErrorCode = 'PROVIDER_NOT_FOUND' | 'EMBEDDING_FAILED' | 'RETRIEVAL_FAILED' | 'RATE_LIMITED' | 'CONFIGURATION_ERROR' | 'AUTHENTICATION_ERROR' | 'SDK_VERSION_UNSUPPORTED' | 'LICENSE_VALIDATION_ERROR'; declare class RetrivoraError extends Error { readonly code: RetrivoraErrorCode; readonly details?: unknown; constructor(message: string, code: RetrivoraErrorCode, details?: unknown); } declare class ProviderNotFoundException extends RetrivoraError { constructor(providerType: string, provider: string, details?: unknown); } declare class EmbeddingFailedException extends RetrivoraError { constructor(message?: string, details?: unknown); } declare class RetrievalException extends RetrivoraError { constructor(message?: string, details?: unknown); } declare class RateLimitException extends RetrivoraError { constructor(message?: string, details?: unknown); } declare class ConfigurationException extends RetrivoraError { constructor(message: string, details?: unknown); } declare class AuthenticationException extends RetrivoraError { constructor(message?: string, details?: unknown); } declare class SDKVersionUnsupportedError extends RetrivoraError { constructor(message?: string, details?: unknown); } declare class LicenseValidationError extends RetrivoraError { constructor(message?: string, details?: unknown); } /** * Wraps any unknown error into an appropriate RetrivoraError subclass. */ declare function wrapError(err: unknown, defaultCode: RetrivoraErrorCode, defaultMessage?: string): RetrivoraError; export { type RenderSectionDecision as $, AuthenticationException as A, type BatchOptions as B, type ChatWidgetProps as C, type DocumentUploadProps as D, EmbeddingFailedException as E, type RemoteVectorConfig as F, type RenderDecision as G, type RenderType as H, type IRenderRule as I, RetrievalException as J, Retrivora as K, type LicenseTierConfig as L, type MessageBubbleProps as M, RetrivoraError as N, type RetrivoraErrorCode as O, type ProductCardProps as P, SDKVersionUnsupportedError as Q, type RemoteConfig as R, type SourceCardProps as S, SDK_VERSION as T, isTransientError as U, type ArchitectureCardProps as V, DocumentChunker as W, LicenseConfigResolver as X, Pipeline as Y, type PipelineStep as Z, type ProviderPill as _, type ChatWindowProps as a, type Snippet as a0, wrapError as a1, type ConfigProviderProps as b, type ClientConfig as c, type ProductCarouselProps as d, type ChatViewportSize as e, BatchProcessor as f, type BatchResult as g, type ChartType as h, type Chunk as i, type ChunkOptions as j, CircuitBreaker as k, type CircuitBreakerOptions as l, ConfigFetcher as m, ConfigurationException as n, type DecisionContext as o, type IRendererStrategy as p, type IntentCategory as q, LicenseValidationError as r, type LicenseValidationRequest as s, type LicenseValidationResponse as t, LicenseValidator as u, type ProviderCredentials as v, ProviderNotFoundException as w, RateLimitException as x, type RemoteEmbeddingConfig as y, type RemoteLLMConfig as z };