@retrivora-ai/rag-engine 2.3.5 → 2.3.7

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 (41) hide show
  1. package/dist/{BatchProcessor-tVzb9CdE.d.mts → BatchProcessor-BhLczWj5.d.mts} +179 -3
  2. package/dist/{BatchProcessor-CQDtlggz.d.ts → BatchProcessor-C42_RVWO.d.ts} +179 -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 +493 -217
  8. package/dist/handlers/index.mjs +493 -217
  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 +643 -207
  15. package/dist/index.mjs +683 -252
  16. package/dist/server.d.mts +253 -7
  17. package/dist/server.d.ts +253 -7
  18. package/dist/server.js +1145 -230
  19. package/dist/server.mjs +1131 -230
  20. package/package.json +1 -1
  21. package/src/LicensedRetrivora.ts +273 -0
  22. package/src/components/ChatWidget.tsx +44 -19
  23. package/src/components/ChatWindow.tsx +30 -14
  24. package/src/components/ConfigProvider.tsx +86 -6
  25. package/src/components/DocumentUpload.tsx +8 -2
  26. package/src/config/LicenseConfigResolver.ts +296 -0
  27. package/src/config/RagConfig.ts +4 -0
  28. package/src/config/serverConfig.ts +74 -14
  29. package/src/core/ConfigFetcher.ts +10 -1
  30. package/src/core/ConfigResolver.ts +1 -0
  31. package/src/core/LicenseValidator.ts +21 -12
  32. package/src/core/LicenseVerifier.ts +7 -11
  33. package/src/core/ProjectSettings.ts +247 -0
  34. package/src/handlers/index.ts +65 -5
  35. package/src/hooks/useProjectSettings.ts +105 -0
  36. package/src/index.css +9 -0
  37. package/src/index.ts +37 -0
  38. package/src/llm/providers/UniversalLLMAdapter.ts +67 -12
  39. package/src/server.ts +46 -2
  40. package/src/telemetry/TelemetryService.ts +330 -0
  41. package/src/types/props.ts +14 -2
@@ -1,5 +1,5 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { i as RagConfig, I as ILLMProvider, C as ChatMessage, c as ChatResponse, f as IngestDocument } from './ILLMProvider-CcJ5N6XD.js';
2
+ import { n as RagConfig, I as ILLMProvider, C as ChatMessage, c as ChatResponse, f as IngestDocument } from './ILLMProvider-B8TAVx3j.js';
3
3
 
4
4
  interface ValidationError {
5
5
  field: string;
@@ -1,5 +1,5 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { i as RagConfig, I as ILLMProvider, C as ChatMessage, c as ChatResponse, f as IngestDocument } from './ILLMProvider-CcJ5N6XD.mjs';
2
+ import { n as RagConfig, I as ILLMProvider, C as ChatMessage, c as ChatResponse, f as IngestDocument } from './ILLMProvider-B8TAVx3j.mjs';
3
3
 
4
4
  interface ValidationError {
5
5
  field: string;
package/dist/index.css CHANGED
@@ -346,6 +346,15 @@
346
346
  .top-4 {
347
347
  top: calc(var(--spacing) * 4);
348
348
  }
349
+ .top-6 {
350
+ top: calc(var(--spacing) * 6);
351
+ }
352
+ .top-20 {
353
+ top: calc(var(--spacing) * 20);
354
+ }
355
+ .top-24 {
356
+ top: calc(var(--spacing) * 24);
357
+ }
349
358
  .-right-4 {
350
359
  right: calc(var(--spacing) * -4);
351
360
  }
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps } from './BatchProcessor-tVzb9CdE.mjs';
3
- export { A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, h as Chunk, i as ChunkOptions, j as ConfigurationException, k as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, l as IRendererStrategy, m as IntentCategory, L as LicenseValidationError, n as LicenseValidationRequest, o as LicenseValidationResponse, p as LicenseValidator, q as ProviderNotFoundException, R as RateLimitException, r as RenderDecision, s as RenderType, t as RetrievalException, u as Retrivora, v as RetrivoraError, w as RetrivoraErrorCode, x as SDKVersionUnsupportedError, y as SDK_VERSION, z as isTransientError } from './BatchProcessor-tVzb9CdE.mjs';
4
- import { O as ObservabilityTrace, U as UseRagChatOptions, a as UseRagChatReturn } from './ILLMProvider-CcJ5N6XD.mjs';
5
- export { C as ChatMessage, b as ChatOptions, c as ChatResponse, E as EmbedOptions, d as EmbeddingConfig, e as EmbeddingProvider, I as ILLMProvider, f as IngestDocument, L as LLMConfig, g as LLMProvider, h as LatencyBreakdown, R as RAGConfig, i as RagConfig, j as RagMessage, k as RetrievalConfig, l as RetrievedChunk, T as TokenUsage, m as UIConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorDBConfig, p as VectorDBProvider, q as VectorMatch, W as WorkflowConfig } from './ILLMProvider-CcJ5N6XD.mjs';
2
+ import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps, R as RemoteConfig } from './BatchProcessor-BhLczWj5.mjs';
3
+ export { A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, h as Chunk, i as ChunkOptions, j as ConfigFetcher, k as ConfigurationException, l as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, m as IRendererStrategy, n as IntentCategory, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, s as ProviderCredentials, t as ProviderNotFoundException, u as RateLimitException, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, y as RenderDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, O as isTransientError } from './BatchProcessor-BhLczWj5.mjs';
4
+ import { O as ObservabilityTrace, U as UseRagChatOptions, a as UseRagChatReturn, P as ProjectChatSettings } from './ILLMProvider-B8TAVx3j.mjs';
5
+ export { A as AuthMode, C as ChatMessage, b as ChatOptions, c as ChatResponse, E as EmbedOptions, d as EmbeddingConfig, e as EmbeddingProvider, I as ILLMProvider, f as IngestDocument, L as LLMConfig, g as LLMProvider, h as LatencyBreakdown, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, R as RAGConfig, n as RagConfig, o as RagMessage, p as RetrievalConfig, q as RetrievedChunk, T as ThemeMode, r as TokenUsage, s as UIConfig, t as UniversalRagConfig, u as UpsertDocument, V as VectorDBConfig, v as VectorDBProvider, w as VectorMatch, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-B8TAVx3j.mjs';
6
6
  import 'react';
7
7
 
8
8
  /**
@@ -78,6 +78,20 @@ declare function ProductCarousel({ products, primaryColor, onAddToCart }: Produc
78
78
 
79
79
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
80
80
 
81
+ interface UseProjectSettingsOptions {
82
+ licenseKey?: string;
83
+ enabled?: boolean;
84
+ initialSettings?: Partial<ProjectChatSettings>;
85
+ }
86
+ interface UseProjectSettingsReturn {
87
+ settings: ProjectChatSettings;
88
+ remoteConfig: RemoteConfig | null;
89
+ isLoading: boolean;
90
+ error: string | null;
91
+ reload: () => Promise<void>;
92
+ }
93
+ declare function useProjectSettings(projectId: string, options?: UseProjectSettingsOptions): UseProjectSettingsReturn;
94
+
81
95
  /**
82
96
  * Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
83
97
  * You can call this during your app initialization to support custom schema fields.
@@ -108,4 +122,4 @@ declare class CircuitBreaker {
108
122
  reset(): void;
109
123
  }
110
124
 
111
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, CircuitBreaker, type CircuitBreakerOptions, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, SourceCard, SourceCardProps, UseRagChatOptions, UseRagChatReturn, addSynonyms, useConfig, useRagChat };
125
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, CircuitBreaker, type CircuitBreakerOptions, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, addSynonyms, useConfig, useProjectSettings, useRagChat };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps } from './BatchProcessor-CQDtlggz.js';
3
- export { A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, h as Chunk, i as ChunkOptions, j as ConfigurationException, k as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, l as IRendererStrategy, m as IntentCategory, L as LicenseValidationError, n as LicenseValidationRequest, o as LicenseValidationResponse, p as LicenseValidator, q as ProviderNotFoundException, R as RateLimitException, r as RenderDecision, s as RenderType, t as RetrievalException, u as Retrivora, v as RetrivoraError, w as RetrivoraErrorCode, x as SDKVersionUnsupportedError, y as SDK_VERSION, z as isTransientError } from './BatchProcessor-CQDtlggz.js';
4
- import { O as ObservabilityTrace, U as UseRagChatOptions, a as UseRagChatReturn } from './ILLMProvider-CcJ5N6XD.js';
5
- export { C as ChatMessage, b as ChatOptions, c as ChatResponse, E as EmbedOptions, d as EmbeddingConfig, e as EmbeddingProvider, I as ILLMProvider, f as IngestDocument, L as LLMConfig, g as LLMProvider, h as LatencyBreakdown, R as RAGConfig, i as RagConfig, j as RagMessage, k as RetrievalConfig, l as RetrievedChunk, T as TokenUsage, m as UIConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorDBConfig, p as VectorDBProvider, q as VectorMatch, W as WorkflowConfig } from './ILLMProvider-CcJ5N6XD.js';
2
+ import { C as ChatWidgetProps, a as ChatWindowProps, D as DocumentUploadProps, M as MessageBubbleProps, S as SourceCardProps, b as ConfigProviderProps, c as ClientConfig, P as ProductCardProps, d as ProductCarouselProps, R as RemoteConfig } from './BatchProcessor-C42_RVWO.js';
3
+ export { A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, h as Chunk, i as ChunkOptions, j as ConfigFetcher, k as ConfigurationException, l as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, m as IRendererStrategy, n as IntentCategory, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, s as ProviderCredentials, t as ProviderNotFoundException, u as RateLimitException, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, y as RenderDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, O as isTransientError } from './BatchProcessor-C42_RVWO.js';
4
+ import { O as ObservabilityTrace, U as UseRagChatOptions, a as UseRagChatReturn, P as ProjectChatSettings } from './ILLMProvider-B8TAVx3j.js';
5
+ export { A as AuthMode, C as ChatMessage, b as ChatOptions, c as ChatResponse, E as EmbedOptions, d as EmbeddingConfig, e as EmbeddingProvider, I as ILLMProvider, f as IngestDocument, L as LLMConfig, g as LLMProvider, h as LatencyBreakdown, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, R as RAGConfig, n as RagConfig, o as RagMessage, p as RetrievalConfig, q as RetrievedChunk, T as ThemeMode, r as TokenUsage, s as UIConfig, t as UniversalRagConfig, u as UpsertDocument, V as VectorDBConfig, v as VectorDBProvider, w as VectorMatch, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-B8TAVx3j.js';
6
6
  import 'react';
7
7
 
8
8
  /**
@@ -78,6 +78,20 @@ declare function ProductCarousel({ products, primaryColor, onAddToCart }: Produc
78
78
 
79
79
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
80
80
 
81
+ interface UseProjectSettingsOptions {
82
+ licenseKey?: string;
83
+ enabled?: boolean;
84
+ initialSettings?: Partial<ProjectChatSettings>;
85
+ }
86
+ interface UseProjectSettingsReturn {
87
+ settings: ProjectChatSettings;
88
+ remoteConfig: RemoteConfig | null;
89
+ isLoading: boolean;
90
+ error: string | null;
91
+ reload: () => Promise<void>;
92
+ }
93
+ declare function useProjectSettings(projectId: string, options?: UseProjectSettingsOptions): UseProjectSettingsReturn;
94
+
81
95
  /**
82
96
  * Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
83
97
  * You can call this during your app initialization to support custom schema fields.
@@ -108,4 +122,4 @@ declare class CircuitBreaker {
108
122
  reset(): void;
109
123
  }
110
124
 
111
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, CircuitBreaker, type CircuitBreakerOptions, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, SourceCard, SourceCardProps, UseRagChatOptions, UseRagChatReturn, addSynonyms, useConfig, useRagChat };
125
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, CircuitBreaker, type CircuitBreakerOptions, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, addSynonyms, useConfig, useProjectSettings, useRagChat };