@retrivora-ai/rag-engine 2.3.4 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/{BatchProcessor-CQDtlggz.d.ts → BatchProcessor-ByBl-1MA.d.ts} +81 -3
  2. package/dist/{BatchProcessor-tVzb9CdE.d.mts → BatchProcessor-Dfn23VAd.d.mts} +81 -3
  3. package/dist/{ILLMProvider-CcJ5N6XD.d.mts → ILLMProvider-B8TAVx3j.d.mts} +63 -1
  4. package/dist/{ILLMProvider-CcJ5N6XD.d.ts → ILLMProvider-B8TAVx3j.d.ts} +63 -1
  5. package/dist/handlers/index.d.mts +2 -2
  6. package/dist/handlers/index.d.ts +2 -2
  7. package/dist/handlers/index.js +419 -169
  8. package/dist/handlers/index.mjs +419 -169
  9. package/dist/{index-BwmyPJHp.d.ts → index-ejOWsaqb.d.ts} +1 -1
  10. package/dist/{index-CL-zF6bD.d.mts → index-xxQOFx-u.d.mts} +1 -1
  11. package/dist/index.css +9 -0
  12. package/dist/index.d.mts +19 -5
  13. package/dist/index.d.ts +19 -5
  14. package/dist/index.js +638 -189
  15. package/dist/index.mjs +678 -234
  16. package/dist/server.d.mts +6 -6
  17. package/dist/server.d.ts +6 -6
  18. package/dist/server.js +461 -173
  19. package/dist/server.mjs +457 -173
  20. package/package.json +2 -2
  21. package/src/components/ChatWidget.tsx +44 -19
  22. package/src/components/ChatWindow.tsx +30 -14
  23. package/src/components/ConfigProvider.tsx +86 -6
  24. package/src/components/DocumentUpload.tsx +8 -2
  25. package/src/config/RagConfig.ts +4 -0
  26. package/src/core/ConfigFetcher.ts +73 -11
  27. package/src/core/ConfigResolver.ts +1 -0
  28. package/src/core/LicenseValidator.ts +31 -13
  29. package/src/core/ProjectSettings.ts +247 -0
  30. package/src/handlers/index.ts +63 -7
  31. package/src/hooks/useProjectSettings.ts +105 -0
  32. package/src/index.css +9 -0
  33. package/src/index.ts +28 -0
  34. package/src/providers/vectordb/PineconeProvider.ts +17 -4
  35. package/src/server.ts +23 -1
  36. package/src/types/props.ts +14 -2
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, MouseEvent, ReactNode, ElementType } from 'react';
2
- import { z as Product, m as UIConfig, j as RagMessage, q as VectorMatch, u as UITransformationResponse, i as RagConfig, I as ILLMProvider, f as IngestDocument, C as ChatMessage, c as ChatResponse, A as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-CcJ5N6XD.js';
2
+ import { W as WidgetPosition, Z as Product, s as UIConfig, P as ProjectChatSettings, o as RagMessage, w as VectorMatch, J as UITransformationResponse, n as RagConfig, I as ILLMProvider, f as IngestDocument, C as ChatMessage, c as ChatResponse, _ as RetrievalResult, t as UniversalRagConfig } from './ILLMProvider-B8TAVx3j.js';
3
3
 
4
4
  interface ArchitectureCardProps {
5
5
  icon: ReactNode;
@@ -64,7 +64,7 @@ interface ChatWindowProps {
64
64
  }
65
65
  interface ChatWidgetProps {
66
66
  /** Position of the floating button. Defaults to bottom-right. */
67
- position?: 'bottom-right' | 'bottom-left';
67
+ position?: WidgetPosition;
68
68
  /** Called when the user clicks 'Add to Cart' on a product */
69
69
  onAddToCart?: (product: Product) => void;
70
70
  /** Optional custom API URL to send chat messages to */
@@ -123,6 +123,12 @@ interface ClientConfig {
123
123
  model?: string;
124
124
  dimensions?: number;
125
125
  };
126
+ licenseKey?: string;
127
+ headers?: Record<string, string>;
128
+ retrivoraApiBase?: string;
129
+ projectSettings?: ProjectChatSettings;
130
+ autoLoadProjectSettings?: boolean;
131
+ isProjectSettingsLoading?: boolean;
126
132
  }
127
133
  interface ConfigProviderProps {
128
134
  config?: {
@@ -132,6 +138,11 @@ interface ConfigProviderProps {
132
138
  model?: string;
133
139
  dimensions?: number;
134
140
  };
141
+ licenseKey?: string;
142
+ headers?: Record<string, string>;
143
+ retrivoraApiBase?: string;
144
+ projectSettings?: Partial<ProjectChatSettings>;
145
+ autoLoadProjectSettings?: boolean;
135
146
  };
136
147
  children: ReactNode;
137
148
  }
@@ -141,6 +152,73 @@ interface ConfigProviderProps {
141
152
  */
142
153
  declare const SDK_VERSION: string;
143
154
 
155
+ /**
156
+ * ConfigFetcher.ts — Dynamically fetches project credentials from Retrivora Control Plane
157
+ * without hardcoding plain-text master keys in NPM package binaries.
158
+ *
159
+ * SECURITY: The SDK must ONLY call the Retrivora Control Plane at https://www.retrivora.com.
160
+ * It must never call the end user's own localhost or any other endpoint.
161
+ * LLM and embedding calls are proxied through https://www.retrivora.com/api/v1 which
162
+ * forwards to https://llm.retrivora.com with the server-side LITELLM_MASTER_KEY.
163
+ */
164
+
165
+ interface RemoteVectorConfig {
166
+ apiKey: string;
167
+ indexName: string;
168
+ provider: string;
169
+ projectId?: string;
170
+ namespace?: string;
171
+ }
172
+ interface RemoteEmbeddingConfig {
173
+ provider: string;
174
+ model: string;
175
+ baseUrl: string;
176
+ apiKey: string;
177
+ profile?: string;
178
+ }
179
+ interface RemoteLLMConfig {
180
+ provider: string;
181
+ model: string;
182
+ baseUrl: string;
183
+ apiKey: string;
184
+ profile?: string;
185
+ }
186
+ interface RemoteConfig {
187
+ projectId?: string;
188
+ tier?: string;
189
+ isActive?: boolean;
190
+ expiresAt?: string;
191
+ vectorDb: RemoteVectorConfig;
192
+ embedding: RemoteEmbeddingConfig;
193
+ llm: RemoteLLMConfig;
194
+ workspace?: {
195
+ namespace: string;
196
+ indexName: string;
197
+ };
198
+ projectSettings?: ProjectChatSettings;
199
+ }
200
+
201
+ declare class ConfigFetcher {
202
+ private static cache;
203
+ private static readonly TTL_MS;
204
+ /**
205
+ * Fetch full project configuration (vectorDb + embedding + llm + workspace) from Retrivora Control Plane.
206
+ *
207
+ * The SDK calls https://www.retrivora.com/api/v1/config with the project ID and license key.
208
+ * The server validates the license against the database and returns:
209
+ * - validity (tier, isActive, expiresAt)
210
+ * - LLM model info
211
+ * - embedding model info
212
+ * - Pinecone index name and workspace/namespace
213
+ *
214
+ * The Pinecone API key is NOT returned (server-only). The SDK uses local
215
+ * PINECONE_API_KEY if available, or vector operations are handled server-side.
216
+ */
217
+ static fetchRemoteConfig(projectId: string, licenseKey?: string): Promise<RemoteConfig | null>;
218
+ /** Convenience: fetch only vector DB config (backwards compat). */
219
+ static fetchRemoteVectorConfig(projectId: string, licenseKey?: string): Promise<RemoteVectorConfig | null>;
220
+ }
221
+
144
222
  /**
145
223
  * Primary rendering outcome types supported by the decision engine.
146
224
  */
@@ -583,4 +661,4 @@ declare class BatchProcessor {
583
661
  static processConcurrent<T, R>(items: T[], processor: (item: T) => Promise<R>, concurrency?: number, options?: BatchOptions): Promise<BatchResult<R>>;
584
662
  }
585
663
 
586
- export { AuthenticationException as A, type BatchOptions as B, type ChatWidgetProps as C, type DocumentUploadProps as D, EmbeddingFailedException as E, type ArchitectureCardProps as F, type ChatViewportSize as G, DocumentChunker as H, type IRenderRule as I, Pipeline as J, type PipelineStep as K, LicenseValidationError as L, type MessageBubbleProps as M, type ProviderPill as N, type RenderSectionDecision as O, type ProductCardProps as P, type Snippet as Q, RateLimitException as R, type SourceCardProps as S, wrapError as T, type ChatWindowProps as a, type ConfigProviderProps as b, type ClientConfig as c, type ProductCarouselProps as d, BatchProcessor as e, type BatchResult as f, type ChartType as g, type Chunk as h, type ChunkOptions as i, ConfigurationException as j, type DecisionContext as k, type IRendererStrategy as l, type IntentCategory as m, type LicenseValidationRequest as n, type LicenseValidationResponse as o, LicenseValidator as p, ProviderNotFoundException as q, type RenderDecision as r, type RenderType as s, RetrievalException as t, Retrivora as u, RetrivoraError as v, type RetrivoraErrorCode as w, SDKVersionUnsupportedError as x, SDK_VERSION as y, isTransientError as z };
664
+ export { AuthenticationException as A, type BatchOptions as B, type ChatWidgetProps as C, type DocumentUploadProps as D, EmbeddingFailedException as E, RetrivoraError as F, type RetrivoraErrorCode as G, SDKVersionUnsupportedError as H, type IRenderRule as I, SDK_VERSION as J, isTransientError as K, LicenseValidationError as L, type MessageBubbleProps as M, type ArchitectureCardProps as N, type ChatViewportSize as O, type ProductCardProps as P, DocumentChunker as Q, type RemoteConfig as R, type SourceCardProps as S, Pipeline as T, type PipelineStep as U, type ProviderPill as V, type RenderSectionDecision as W, type Snippet as X, wrapError as Y, type ChatWindowProps as a, type ConfigProviderProps as b, type ClientConfig as c, type ProductCarouselProps as d, BatchProcessor as e, type BatchResult as f, type ChartType as g, type Chunk as h, type ChunkOptions as i, ConfigFetcher as j, ConfigurationException as k, type DecisionContext as l, type IRendererStrategy as m, type IntentCategory as n, type LicenseValidationRequest as o, type LicenseValidationResponse as p, LicenseValidator as q, ProviderNotFoundException as r, RateLimitException as s, type RemoteEmbeddingConfig as t, type RemoteLLMConfig as u, type RemoteVectorConfig as v, type RenderDecision as w, type RenderType as x, RetrievalException as y, Retrivora as z };
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, MouseEvent, ReactNode, ElementType } from 'react';
2
- import { z as Product, m as UIConfig, j as RagMessage, q as VectorMatch, u as UITransformationResponse, i as RagConfig, I as ILLMProvider, f as IngestDocument, C as ChatMessage, c as ChatResponse, A as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-CcJ5N6XD.mjs';
2
+ import { W as WidgetPosition, Z as Product, s as UIConfig, P as ProjectChatSettings, o as RagMessage, w as VectorMatch, J as UITransformationResponse, n as RagConfig, I as ILLMProvider, f as IngestDocument, C as ChatMessage, c as ChatResponse, _ as RetrievalResult, t as UniversalRagConfig } from './ILLMProvider-B8TAVx3j.mjs';
3
3
 
4
4
  interface ArchitectureCardProps {
5
5
  icon: ReactNode;
@@ -64,7 +64,7 @@ interface ChatWindowProps {
64
64
  }
65
65
  interface ChatWidgetProps {
66
66
  /** Position of the floating button. Defaults to bottom-right. */
67
- position?: 'bottom-right' | 'bottom-left';
67
+ position?: WidgetPosition;
68
68
  /** Called when the user clicks 'Add to Cart' on a product */
69
69
  onAddToCart?: (product: Product) => void;
70
70
  /** Optional custom API URL to send chat messages to */
@@ -123,6 +123,12 @@ interface ClientConfig {
123
123
  model?: string;
124
124
  dimensions?: number;
125
125
  };
126
+ licenseKey?: string;
127
+ headers?: Record<string, string>;
128
+ retrivoraApiBase?: string;
129
+ projectSettings?: ProjectChatSettings;
130
+ autoLoadProjectSettings?: boolean;
131
+ isProjectSettingsLoading?: boolean;
126
132
  }
127
133
  interface ConfigProviderProps {
128
134
  config?: {
@@ -132,6 +138,11 @@ interface ConfigProviderProps {
132
138
  model?: string;
133
139
  dimensions?: number;
134
140
  };
141
+ licenseKey?: string;
142
+ headers?: Record<string, string>;
143
+ retrivoraApiBase?: string;
144
+ projectSettings?: Partial<ProjectChatSettings>;
145
+ autoLoadProjectSettings?: boolean;
135
146
  };
136
147
  children: ReactNode;
137
148
  }
@@ -141,6 +152,73 @@ interface ConfigProviderProps {
141
152
  */
142
153
  declare const SDK_VERSION: string;
143
154
 
155
+ /**
156
+ * ConfigFetcher.ts — Dynamically fetches project credentials from Retrivora Control Plane
157
+ * without hardcoding plain-text master keys in NPM package binaries.
158
+ *
159
+ * SECURITY: The SDK must ONLY call the Retrivora Control Plane at https://www.retrivora.com.
160
+ * It must never call the end user's own localhost or any other endpoint.
161
+ * LLM and embedding calls are proxied through https://www.retrivora.com/api/v1 which
162
+ * forwards to https://llm.retrivora.com with the server-side LITELLM_MASTER_KEY.
163
+ */
164
+
165
+ interface RemoteVectorConfig {
166
+ apiKey: string;
167
+ indexName: string;
168
+ provider: string;
169
+ projectId?: string;
170
+ namespace?: string;
171
+ }
172
+ interface RemoteEmbeddingConfig {
173
+ provider: string;
174
+ model: string;
175
+ baseUrl: string;
176
+ apiKey: string;
177
+ profile?: string;
178
+ }
179
+ interface RemoteLLMConfig {
180
+ provider: string;
181
+ model: string;
182
+ baseUrl: string;
183
+ apiKey: string;
184
+ profile?: string;
185
+ }
186
+ interface RemoteConfig {
187
+ projectId?: string;
188
+ tier?: string;
189
+ isActive?: boolean;
190
+ expiresAt?: string;
191
+ vectorDb: RemoteVectorConfig;
192
+ embedding: RemoteEmbeddingConfig;
193
+ llm: RemoteLLMConfig;
194
+ workspace?: {
195
+ namespace: string;
196
+ indexName: string;
197
+ };
198
+ projectSettings?: ProjectChatSettings;
199
+ }
200
+
201
+ declare class ConfigFetcher {
202
+ private static cache;
203
+ private static readonly TTL_MS;
204
+ /**
205
+ * Fetch full project configuration (vectorDb + embedding + llm + workspace) from Retrivora Control Plane.
206
+ *
207
+ * The SDK calls https://www.retrivora.com/api/v1/config with the project ID and license key.
208
+ * The server validates the license against the database and returns:
209
+ * - validity (tier, isActive, expiresAt)
210
+ * - LLM model info
211
+ * - embedding model info
212
+ * - Pinecone index name and workspace/namespace
213
+ *
214
+ * The Pinecone API key is NOT returned (server-only). The SDK uses local
215
+ * PINECONE_API_KEY if available, or vector operations are handled server-side.
216
+ */
217
+ static fetchRemoteConfig(projectId: string, licenseKey?: string): Promise<RemoteConfig | null>;
218
+ /** Convenience: fetch only vector DB config (backwards compat). */
219
+ static fetchRemoteVectorConfig(projectId: string, licenseKey?: string): Promise<RemoteVectorConfig | null>;
220
+ }
221
+
144
222
  /**
145
223
  * Primary rendering outcome types supported by the decision engine.
146
224
  */
@@ -583,4 +661,4 @@ declare class BatchProcessor {
583
661
  static processConcurrent<T, R>(items: T[], processor: (item: T) => Promise<R>, concurrency?: number, options?: BatchOptions): Promise<BatchResult<R>>;
584
662
  }
585
663
 
586
- export { AuthenticationException as A, type BatchOptions as B, type ChatWidgetProps as C, type DocumentUploadProps as D, EmbeddingFailedException as E, type ArchitectureCardProps as F, type ChatViewportSize as G, DocumentChunker as H, type IRenderRule as I, Pipeline as J, type PipelineStep as K, LicenseValidationError as L, type MessageBubbleProps as M, type ProviderPill as N, type RenderSectionDecision as O, type ProductCardProps as P, type Snippet as Q, RateLimitException as R, type SourceCardProps as S, wrapError as T, type ChatWindowProps as a, type ConfigProviderProps as b, type ClientConfig as c, type ProductCarouselProps as d, BatchProcessor as e, type BatchResult as f, type ChartType as g, type Chunk as h, type ChunkOptions as i, ConfigurationException as j, type DecisionContext as k, type IRendererStrategy as l, type IntentCategory as m, type LicenseValidationRequest as n, type LicenseValidationResponse as o, LicenseValidator as p, ProviderNotFoundException as q, type RenderDecision as r, type RenderType as s, RetrievalException as t, Retrivora as u, RetrivoraError as v, type RetrivoraErrorCode as w, SDKVersionUnsupportedError as x, SDK_VERSION as y, isTransientError as z };
664
+ export { AuthenticationException as A, type BatchOptions as B, type ChatWidgetProps as C, type DocumentUploadProps as D, EmbeddingFailedException as E, RetrivoraError as F, type RetrivoraErrorCode as G, SDKVersionUnsupportedError as H, type IRenderRule as I, SDK_VERSION as J, isTransientError as K, LicenseValidationError as L, type MessageBubbleProps as M, type ArchitectureCardProps as N, type ChatViewportSize as O, type ProductCardProps as P, DocumentChunker as Q, type RemoteConfig as R, type SourceCardProps as S, Pipeline as T, type PipelineStep as U, type ProviderPill as V, type RenderSectionDecision as W, type Snippet as X, wrapError as Y, type ChatWindowProps as a, type ConfigProviderProps as b, type ClientConfig as c, type ProductCarouselProps as d, BatchProcessor as e, type BatchResult as f, type ChartType as g, type Chunk as h, type ChunkOptions as i, ConfigFetcher as j, ConfigurationException as k, type DecisionContext as l, type IRendererStrategy as m, type IntentCategory as n, type LicenseValidationRequest as o, type LicenseValidationResponse as p, LicenseValidator as q, ProviderNotFoundException as r, RateLimitException as s, type RemoteEmbeddingConfig as t, type RemoteLLMConfig as u, type RemoteVectorConfig as v, type RenderDecision as w, type RenderType as x, RetrievalException as y, Retrivora as z };
@@ -86,6 +86,66 @@ declare const LLM_PROVIDERS: readonly ["openai", "anthropic", "ollama", "gemini"
86
86
  declare const EMBEDDING_PROVIDERS: readonly ["openai", "ollama", "gemini", "qwen", "rest", "universal_rest", "custom"];
87
87
  declare const GRAPH_DB_PROVIDERS: readonly ["neo4j", "memgraph", "simple", "custom"];
88
88
 
89
+ type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
90
+ type ThemeMode = 'light' | 'dark' | 'system';
91
+ type AuthMode = 'public' | 'anonymous' | 'jwt' | 'oauth' | 'okta' | 'auth0' | 'supabase' | 'firebase' | 'sso' | 'custom_token';
92
+ interface ProjectBrandingSettings {
93
+ companyName: string;
94
+ botName: string;
95
+ welcomeMessage: string;
96
+ primaryColor: string;
97
+ secondaryColor: string;
98
+ fontFamily: string;
99
+ borderRadius: number;
100
+ logoUrl: string;
101
+ avatarUrl: string;
102
+ customCss: string;
103
+ }
104
+ interface ProjectAiSettings {
105
+ defaultModel: string;
106
+ embeddingModel: string;
107
+ systemPrompt: string;
108
+ memoryEnabled: boolean;
109
+ multiModelEnabled: boolean;
110
+ citationsEnabled: boolean;
111
+ fileUploadEnabled: boolean;
112
+ }
113
+ interface ProjectAuthSettings {
114
+ mode: AuthMode;
115
+ allowedOrigins: string[];
116
+ requireVerifiedEmail: boolean;
117
+ sessionTtlMinutes: number;
118
+ }
119
+ interface ProjectWidgetSettings {
120
+ position: WidgetPosition;
121
+ theme: ThemeMode;
122
+ lazyLoad: boolean;
123
+ autoReconnect: boolean;
124
+ persistConversations: boolean;
125
+ showRetrivoraBranding: boolean;
126
+ }
127
+ interface ProjectTelemetrySettings {
128
+ enabled: boolean;
129
+ collectBrowser: boolean;
130
+ collectCountry: boolean;
131
+ redactPii: boolean;
132
+ retentionDays: number;
133
+ }
134
+ interface ProjectChatSettings {
135
+ projectId: string;
136
+ branding: ProjectBrandingSettings;
137
+ ai: ProjectAiSettings;
138
+ auth: ProjectAuthSettings;
139
+ widget: ProjectWidgetSettings;
140
+ telemetry: ProjectTelemetrySettings;
141
+ lifecycleHooks: string[];
142
+ conversationFeatures: string[];
143
+ updatedAt?: string;
144
+ }
145
+ declare function createDefaultProjectSettings(projectId: string): ProjectChatSettings;
146
+ declare function normalizeProjectSettings(projectId: string, input: Partial<ProjectChatSettings> | null | undefined): ProjectChatSettings;
147
+ declare function projectSettingsToUiConfig(settings: ProjectChatSettings): Partial<UIConfig>;
148
+
89
149
  /**
90
150
  * Master configuration interface for Retrivora AI.
91
151
  * Each consuming project provides one RagConfig object to drive
@@ -312,6 +372,8 @@ interface RagConfig {
312
372
  embedding: EmbeddingConfig;
313
373
  /** Optional UI branding overrides */
314
374
  ui?: UIConfig;
375
+ /** Optional dashboard-managed project chat settings */
376
+ projectSettings?: ProjectChatSettings;
315
377
  /** Optional RAG pipeline tuning knobs */
316
378
  rag?: RAGConfig;
317
379
  /** Optional Graph database configuration */
@@ -616,4 +678,4 @@ interface ILLMProvider {
616
678
  ping(): Promise<boolean>;
617
679
  }
618
680
 
619
- export type { RetrievalResult as A, BarChartData as B, ChatMessage as C, RetrivoraChunkMetadata as D, EmbedOptions as E, RetrivoraIngestedDocument as F, GraphDBConfig as G, SuggestionsResponse as H, ILLMProvider as I, TableData as J, VisualizationType as K, LLMConfig as L, MessageRole as M, ObservabilityTrace as O, PieChartData as P, RAGConfig as R, ScatterPlotDataPoint as S, TokenUsage as T, UseRagChatOptions as U, VectorDBConfig as V, WorkflowConfig as W, UseRagChatReturn as a, ChatOptions as b, ChatResponse as c, EmbeddingConfig as d, EmbeddingProvider as e, IngestDocument as f, LLMProvider as g, LatencyBreakdown as h, RagConfig as i, RagMessage as j, RetrievalConfig as k, RetrievedChunk as l, UIConfig as m, UniversalRagConfig as n, UpsertDocument as o, VectorDBProvider as p, VectorMatch as q, GraphNode as r, Edge as s, GraphSearchResult as t, UITransformationResponse as u, CarouselProduct as v, IRetriever as w, LineChartDataPoint as x, MetricCardData as y, Product as z };
681
+ export { type RetrivoraChunkMetadata as $, type AuthMode as A, projectSettingsToUiConfig as B, type ChatMessage as C, type GraphNode as D, type EmbedOptions as E, type Edge as F, type GraphDBConfig as G, type GraphSearchResult as H, type ILLMProvider as I, type UITransformationResponse as J, type BarChartData as K, type LLMConfig as L, type CarouselProduct as M, type IRetriever as N, type ObservabilityTrace as O, type ProjectChatSettings as P, type LineChartDataPoint as Q, type RAGConfig as R, type MessageRole as S, type ThemeMode as T, type UseRagChatOptions as U, type VectorDBConfig as V, type WidgetPosition as W, type MetricCardData as X, type PieChartData as Y, type Product as Z, type RetrievalResult as _, type UseRagChatReturn as a, type RetrivoraIngestedDocument as a0, type ScatterPlotDataPoint as a1, type SuggestionsResponse as a2, type TableData as a3, type VisualizationType as a4, type ChatOptions as b, type ChatResponse as c, type EmbeddingConfig as d, type EmbeddingProvider as e, type IngestDocument as f, type LLMProvider as g, type LatencyBreakdown as h, type ProjectAiSettings as i, type ProjectAuthSettings as j, type ProjectBrandingSettings as k, type ProjectTelemetrySettings as l, type ProjectWidgetSettings as m, type RagConfig as n, type RagMessage as o, type RetrievalConfig as p, type RetrievedChunk as q, type TokenUsage as r, type UIConfig as s, type UniversalRagConfig as t, type UpsertDocument as u, type VectorDBProvider as v, type VectorMatch as w, type WorkflowConfig as x, createDefaultProjectSettings as y, normalizeProjectSettings as z };
@@ -86,6 +86,66 @@ declare const LLM_PROVIDERS: readonly ["openai", "anthropic", "ollama", "gemini"
86
86
  declare const EMBEDDING_PROVIDERS: readonly ["openai", "ollama", "gemini", "qwen", "rest", "universal_rest", "custom"];
87
87
  declare const GRAPH_DB_PROVIDERS: readonly ["neo4j", "memgraph", "simple", "custom"];
88
88
 
89
+ type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
90
+ type ThemeMode = 'light' | 'dark' | 'system';
91
+ type AuthMode = 'public' | 'anonymous' | 'jwt' | 'oauth' | 'okta' | 'auth0' | 'supabase' | 'firebase' | 'sso' | 'custom_token';
92
+ interface ProjectBrandingSettings {
93
+ companyName: string;
94
+ botName: string;
95
+ welcomeMessage: string;
96
+ primaryColor: string;
97
+ secondaryColor: string;
98
+ fontFamily: string;
99
+ borderRadius: number;
100
+ logoUrl: string;
101
+ avatarUrl: string;
102
+ customCss: string;
103
+ }
104
+ interface ProjectAiSettings {
105
+ defaultModel: string;
106
+ embeddingModel: string;
107
+ systemPrompt: string;
108
+ memoryEnabled: boolean;
109
+ multiModelEnabled: boolean;
110
+ citationsEnabled: boolean;
111
+ fileUploadEnabled: boolean;
112
+ }
113
+ interface ProjectAuthSettings {
114
+ mode: AuthMode;
115
+ allowedOrigins: string[];
116
+ requireVerifiedEmail: boolean;
117
+ sessionTtlMinutes: number;
118
+ }
119
+ interface ProjectWidgetSettings {
120
+ position: WidgetPosition;
121
+ theme: ThemeMode;
122
+ lazyLoad: boolean;
123
+ autoReconnect: boolean;
124
+ persistConversations: boolean;
125
+ showRetrivoraBranding: boolean;
126
+ }
127
+ interface ProjectTelemetrySettings {
128
+ enabled: boolean;
129
+ collectBrowser: boolean;
130
+ collectCountry: boolean;
131
+ redactPii: boolean;
132
+ retentionDays: number;
133
+ }
134
+ interface ProjectChatSettings {
135
+ projectId: string;
136
+ branding: ProjectBrandingSettings;
137
+ ai: ProjectAiSettings;
138
+ auth: ProjectAuthSettings;
139
+ widget: ProjectWidgetSettings;
140
+ telemetry: ProjectTelemetrySettings;
141
+ lifecycleHooks: string[];
142
+ conversationFeatures: string[];
143
+ updatedAt?: string;
144
+ }
145
+ declare function createDefaultProjectSettings(projectId: string): ProjectChatSettings;
146
+ declare function normalizeProjectSettings(projectId: string, input: Partial<ProjectChatSettings> | null | undefined): ProjectChatSettings;
147
+ declare function projectSettingsToUiConfig(settings: ProjectChatSettings): Partial<UIConfig>;
148
+
89
149
  /**
90
150
  * Master configuration interface for Retrivora AI.
91
151
  * Each consuming project provides one RagConfig object to drive
@@ -312,6 +372,8 @@ interface RagConfig {
312
372
  embedding: EmbeddingConfig;
313
373
  /** Optional UI branding overrides */
314
374
  ui?: UIConfig;
375
+ /** Optional dashboard-managed project chat settings */
376
+ projectSettings?: ProjectChatSettings;
315
377
  /** Optional RAG pipeline tuning knobs */
316
378
  rag?: RAGConfig;
317
379
  /** Optional Graph database configuration */
@@ -616,4 +678,4 @@ interface ILLMProvider {
616
678
  ping(): Promise<boolean>;
617
679
  }
618
680
 
619
- export type { RetrievalResult as A, BarChartData as B, ChatMessage as C, RetrivoraChunkMetadata as D, EmbedOptions as E, RetrivoraIngestedDocument as F, GraphDBConfig as G, SuggestionsResponse as H, ILLMProvider as I, TableData as J, VisualizationType as K, LLMConfig as L, MessageRole as M, ObservabilityTrace as O, PieChartData as P, RAGConfig as R, ScatterPlotDataPoint as S, TokenUsage as T, UseRagChatOptions as U, VectorDBConfig as V, WorkflowConfig as W, UseRagChatReturn as a, ChatOptions as b, ChatResponse as c, EmbeddingConfig as d, EmbeddingProvider as e, IngestDocument as f, LLMProvider as g, LatencyBreakdown as h, RagConfig as i, RagMessage as j, RetrievalConfig as k, RetrievedChunk as l, UIConfig as m, UniversalRagConfig as n, UpsertDocument as o, VectorDBProvider as p, VectorMatch as q, GraphNode as r, Edge as s, GraphSearchResult as t, UITransformationResponse as u, CarouselProduct as v, IRetriever as w, LineChartDataPoint as x, MetricCardData as y, Product as z };
681
+ export { type RetrivoraChunkMetadata as $, type AuthMode as A, projectSettingsToUiConfig as B, type ChatMessage as C, type GraphNode as D, type EmbedOptions as E, type Edge as F, type GraphDBConfig as G, type GraphSearchResult as H, type ILLMProvider as I, type UITransformationResponse as J, type BarChartData as K, type LLMConfig as L, type CarouselProduct as M, type IRetriever as N, type ObservabilityTrace as O, type ProjectChatSettings as P, type LineChartDataPoint as Q, type RAGConfig as R, type MessageRole as S, type ThemeMode as T, type UseRagChatOptions as U, type VectorDBConfig as V, type WidgetPosition as W, type MetricCardData as X, type PieChartData as Y, type Product as Z, type RetrievalResult as _, type UseRagChatReturn as a, type RetrivoraIngestedDocument as a0, type ScatterPlotDataPoint as a1, type SuggestionsResponse as a2, type TableData as a3, type VisualizationType as a4, type ChatOptions as b, type ChatResponse as c, type EmbeddingConfig as d, type EmbeddingProvider as e, type IngestDocument as f, type LLMProvider as g, type LatencyBreakdown as h, type ProjectAiSettings as i, type ProjectAuthSettings as j, type ProjectBrandingSettings as k, type ProjectTelemetrySettings as l, type ProjectWidgetSettings as m, type RagConfig as n, type RagMessage as o, type RetrievalConfig as p, type RetrievedChunk as q, type TokenUsage as r, type UIConfig as s, type UniversalRagConfig as t, type UpsertDocument as u, type VectorDBProvider as v, type VectorMatch as w, type WorkflowConfig as x, createDefaultProjectSettings as y, normalizeProjectSettings as z };
@@ -1,3 +1,3 @@
1
1
  import 'next/server';
2
- export { b as HandlerOptions, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, p as createLicenseHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, q as createSuggestionsHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, r as sseObservabilityFrame, o as sseTextFrame, t as sseUIFrame } from '../index-CL-zF6bD.mjs';
3
- import '../ILLMProvider-CcJ5N6XD.mjs';
2
+ export { b as HandlerOptions, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, p as createLicenseHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, q as createSuggestionsHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, r as sseObservabilityFrame, o as sseTextFrame, t as sseUIFrame } from '../index-xxQOFx-u.mjs';
3
+ import '../ILLMProvider-B8TAVx3j.mjs';
@@ -1,3 +1,3 @@
1
1
  import 'next/server';
2
- export { b as HandlerOptions, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, p as createLicenseHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, q as createSuggestionsHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, r as sseObservabilityFrame, o as sseTextFrame, t as sseUIFrame } from '../index-BwmyPJHp.js';
3
- import '../ILLMProvider-CcJ5N6XD.js';
2
+ export { b as HandlerOptions, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, p as createLicenseHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, q as createSuggestionsHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, r as sseObservabilityFrame, o as sseTextFrame, t as sseUIFrame } from '../index-ejOWsaqb.js';
3
+ import '../ILLMProvider-B8TAVx3j.js';