@retrivora-ai/rag-engine 2.5.4 → 2.5.5

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.
package/dist/server.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { p as RagConfig, v as UniversalRagConfig, V as VectorDBConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, L as LLMConfig, f as EmbeddingConfig, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, U as UITransformationResponse, C as ChatMessage, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-DO5gj-e5.mjs';
2
2
  export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-DO5gj-e5.mjs';
3
- import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-Dex_gQ3P.mjs';
4
- export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-Dex_gQ3P.mjs';
3
+ import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-BKOyhayB.mjs';
4
+ export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-BKOyhayB.mjs';
5
5
  import { I as IProviderValidator, a as IProviderHealthChecker, H as HealthCheckResult } from './index-DE8qPWpI.mjs';
6
6
  export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-DE8qPWpI.mjs';
7
7
  import 'react';
package/dist/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { p as RagConfig, v as UniversalRagConfig, V as VectorDBConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, L as LLMConfig, f as EmbeddingConfig, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, U as UITransformationResponse, C as ChatMessage, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-DO5gj-e5.js';
2
2
  export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-DO5gj-e5.js';
3
- import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index--RhMcXrt.js';
4
- export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index--RhMcXrt.js';
3
+ import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-8vijDPfT.js';
4
+ export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-8vijDPfT.js';
5
5
  import { I as IProviderValidator, a as IProviderHealthChecker, H as HealthCheckResult } from './index-DkOhRqEc.js';
6
6
  export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-DkOhRqEc.js';
7
7
  import 'react';
package/dist/server.js CHANGED
@@ -332,7 +332,7 @@ var init_package = __esm({
332
332
  "package.json"() {
333
333
  package_default = {
334
334
  name: "@retrivora-ai/rag-engine",
335
- version: "2.5.4",
335
+ version: "2.5.5",
336
336
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
337
337
  author: "Abhinav Alkuchi",
338
338
  license: "UNLICENSED",
@@ -525,13 +525,27 @@ var init_ConfigFetcher = __esm({
525
525
  * PINECONE_API_KEY if available, or vector operations are handled server-side.
526
526
  */
527
527
  static async fetchRemoteConfig(projectId, licenseKey) {
528
- var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
529
528
  const cacheKey = `${projectId}:${licenseKey || ""}`;
530
529
  const now = Date.now();
531
530
  const cached = this.cache.get(cacheKey);
532
531
  if (cached && now - cached.cachedAt < this.TTL_MS) {
533
532
  return cached.config;
534
533
  }
534
+ const existingInflight = this.inflight.get(cacheKey);
535
+ if (existingInflight) {
536
+ return existingInflight;
537
+ }
538
+ const promise = this._doFetch(projectId, licenseKey, cacheKey, now);
539
+ this.inflight.set(cacheKey, promise);
540
+ try {
541
+ return await promise;
542
+ } finally {
543
+ this.inflight.delete(cacheKey);
544
+ }
545
+ }
546
+ /** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */
547
+ static async _doFetch(projectId, licenseKey, cacheKey, now) {
548
+ var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
535
549
  const controlPlaneUrls = [
536
550
  process.env.RETRIVORA_CONTROL_PLANE_URL,
537
551
  process.env.NEXT_PUBLIC_RETRIVORA_CONTROL_PLANE_URL,
@@ -644,6 +658,8 @@ var init_ConfigFetcher = __esm({
644
658
  }
645
659
  };
646
660
  ConfigFetcher.cache = /* @__PURE__ */ new Map();
661
+ /** In-flight deduplication: concurrent callers for the same key share one network request */
662
+ ConfigFetcher.inflight = /* @__PURE__ */ new Map();
647
663
  ConfigFetcher.TTL_MS = 5 * 60 * 1e3;
648
664
  }
649
665
  });
@@ -12376,6 +12392,8 @@ var _LicenseValidator = class _LicenseValidator {
12376
12392
  // 5-minute TTL for successful validation only
12377
12393
  constructor() {
12378
12394
  this.cache = /* @__PURE__ */ new Map();
12395
+ /** In-flight deduplication: concurrent calls for same key share one network request */
12396
+ this.inflight = /* @__PURE__ */ new Map();
12379
12397
  }
12380
12398
  /** @returns Singleton instance of the validator (shared cache across all consumers). */
12381
12399
  static getInstance() {
@@ -12456,6 +12474,24 @@ var _LicenseValidator = class _LicenseValidator {
12456
12474
  this.cache.delete(effectiveLicenseKey);
12457
12475
  }
12458
12476
  }
12477
+ const inflightPromise = this._doNetworkValidate(
12478
+ effectiveLicenseKey,
12479
+ effectiveProjectId,
12480
+ sdkVersion,
12481
+ sdk,
12482
+ platform,
12483
+ retrivoraApiBase,
12484
+ customHeaders
12485
+ );
12486
+ this.inflight.set(effectiveLicenseKey, inflightPromise);
12487
+ try {
12488
+ return await inflightPromise;
12489
+ } finally {
12490
+ this.inflight.delete(effectiveLicenseKey);
12491
+ }
12492
+ }
12493
+ /** Performs the actual network request. Called once; result shared by in-flight dedup. */
12494
+ async _doNetworkValidate(effectiveLicenseKey, effectiveProjectId, sdkVersion, sdk, platform, retrivoraApiBase, customHeaders) {
12459
12495
  const base = retrivoraApiBase || (typeof process !== "undefined" ? process.env.NEXT_PUBLIC_RETRIVORA_API_BASE || process.env.RETRIVORA_API_BASE : "") || "https://www.retrivora.com/api";
12460
12496
  const validateUrl = `${base.replace(/\/$/, "")}/v1/license/validate`;
12461
12497
  let res = null;
package/dist/server.mjs CHANGED
@@ -326,7 +326,7 @@ var init_package = __esm({
326
326
  "package.json"() {
327
327
  package_default = {
328
328
  name: "@retrivora-ai/rag-engine",
329
- version: "2.5.4",
329
+ version: "2.5.5",
330
330
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
331
331
  author: "Abhinav Alkuchi",
332
332
  license: "UNLICENSED",
@@ -519,13 +519,27 @@ var init_ConfigFetcher = __esm({
519
519
  * PINECONE_API_KEY if available, or vector operations are handled server-side.
520
520
  */
521
521
  static async fetchRemoteConfig(projectId, licenseKey) {
522
- var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
523
522
  const cacheKey = `${projectId}:${licenseKey || ""}`;
524
523
  const now = Date.now();
525
524
  const cached = this.cache.get(cacheKey);
526
525
  if (cached && now - cached.cachedAt < this.TTL_MS) {
527
526
  return cached.config;
528
527
  }
528
+ const existingInflight = this.inflight.get(cacheKey);
529
+ if (existingInflight) {
530
+ return existingInflight;
531
+ }
532
+ const promise = this._doFetch(projectId, licenseKey, cacheKey, now);
533
+ this.inflight.set(cacheKey, promise);
534
+ try {
535
+ return await promise;
536
+ } finally {
537
+ this.inflight.delete(cacheKey);
538
+ }
539
+ }
540
+ /** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */
541
+ static async _doFetch(projectId, licenseKey, cacheKey, now) {
542
+ var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
529
543
  const controlPlaneUrls = [
530
544
  process.env.RETRIVORA_CONTROL_PLANE_URL,
531
545
  process.env.NEXT_PUBLIC_RETRIVORA_CONTROL_PLANE_URL,
@@ -638,6 +652,8 @@ var init_ConfigFetcher = __esm({
638
652
  }
639
653
  };
640
654
  ConfigFetcher.cache = /* @__PURE__ */ new Map();
655
+ /** In-flight deduplication: concurrent callers for the same key share one network request */
656
+ ConfigFetcher.inflight = /* @__PURE__ */ new Map();
641
657
  ConfigFetcher.TTL_MS = 5 * 60 * 1e3;
642
658
  }
643
659
  });
@@ -12272,6 +12288,8 @@ var _LicenseValidator = class _LicenseValidator {
12272
12288
  // 5-minute TTL for successful validation only
12273
12289
  constructor() {
12274
12290
  this.cache = /* @__PURE__ */ new Map();
12291
+ /** In-flight deduplication: concurrent calls for same key share one network request */
12292
+ this.inflight = /* @__PURE__ */ new Map();
12275
12293
  }
12276
12294
  /** @returns Singleton instance of the validator (shared cache across all consumers). */
12277
12295
  static getInstance() {
@@ -12352,6 +12370,24 @@ var _LicenseValidator = class _LicenseValidator {
12352
12370
  this.cache.delete(effectiveLicenseKey);
12353
12371
  }
12354
12372
  }
12373
+ const inflightPromise = this._doNetworkValidate(
12374
+ effectiveLicenseKey,
12375
+ effectiveProjectId,
12376
+ sdkVersion,
12377
+ sdk,
12378
+ platform,
12379
+ retrivoraApiBase,
12380
+ customHeaders
12381
+ );
12382
+ this.inflight.set(effectiveLicenseKey, inflightPromise);
12383
+ try {
12384
+ return await inflightPromise;
12385
+ } finally {
12386
+ this.inflight.delete(effectiveLicenseKey);
12387
+ }
12388
+ }
12389
+ /** Performs the actual network request. Called once; result shared by in-flight dedup. */
12390
+ async _doNetworkValidate(effectiveLicenseKey, effectiveProjectId, sdkVersion, sdk, platform, retrivoraApiBase, customHeaders) {
12355
12391
  const base = retrivoraApiBase || (typeof process !== "undefined" ? process.env.NEXT_PUBLIC_RETRIVORA_API_BASE || process.env.RETRIVORA_API_BASE : "") || "https://www.retrivora.com/api";
12356
12392
  const validateUrl = `${base.replace(/\/$/, "")}/v1/license/validate`;
12357
12393
  let res = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "2.5.4",
3
+ "version": "2.5.5",
4
4
  "description": "Retrivora AI is a plug-and-play AI engine for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.",
5
5
  "author": "Abhinav Alkuchi",
6
6
  "license": "UNLICENSED",