@retrivora-ai/rag-engine 2.5.0 → 2.5.2

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.
@@ -318,7 +318,7 @@ var init_package = __esm({
318
318
  "package.json"() {
319
319
  package_default = {
320
320
  name: "@retrivora-ai/rag-engine",
321
- version: "2.5.0",
321
+ version: "2.5.2",
322
322
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
323
323
  author: "Abhinav Alkuchi",
324
324
  license: "UNLICENSED",
@@ -2811,18 +2811,34 @@ var _LicenseVerifier = class _LicenseVerifier {
2811
2811
  baseUrl = process.env.TELEMETRY_URL.replace(/\/api\/telemetry\/?$/, "");
2812
2812
  }
2813
2813
  const endpoint = `${baseUrl}/api/v1/license/validate`;
2814
- const response = await fetch(endpoint, {
2815
- method: "POST",
2816
- headers: {
2817
- "Content-Type": "application/json",
2818
- "x-license-key": licenseKey
2819
- },
2820
- body: JSON.stringify({
2821
- licenseKey,
2822
- projectId: currentProjectId,
2823
- provider
2824
- })
2825
- });
2814
+ let response;
2815
+ try {
2816
+ response = await fetch(endpoint, {
2817
+ method: "POST",
2818
+ headers: {
2819
+ "Content-Type": "application/json",
2820
+ "x-license-key": licenseKey
2821
+ },
2822
+ body: JSON.stringify({
2823
+ licenseKey,
2824
+ projectId: currentProjectId,
2825
+ provider
2826
+ })
2827
+ });
2828
+ } catch (fetchErr) {
2829
+ if (!isProduction) {
2830
+ console.warn(
2831
+ `[Retrivora SDK] WARNING: License validation via API failed due to network error (${fetchErr.message}). Falling back to local development license.`
2832
+ );
2833
+ return {
2834
+ projectId: currentProjectId,
2835
+ expiresAt: Math.floor(Date.now() / 1e3) + 86400 * 365 * 10,
2836
+ // 10 years
2837
+ tier: "hobby"
2838
+ };
2839
+ }
2840
+ throw fetchErr;
2841
+ }
2826
2842
  if (!response.ok) {
2827
2843
  let errMessage = `HTTP ${response.status}`;
2828
2844
  try {
@@ -312,7 +312,7 @@ var init_package = __esm({
312
312
  "package.json"() {
313
313
  package_default = {
314
314
  name: "@retrivora-ai/rag-engine",
315
- version: "2.5.0",
315
+ version: "2.5.2",
316
316
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
317
317
  author: "Abhinav Alkuchi",
318
318
  license: "UNLICENSED",
@@ -2784,18 +2784,34 @@ var _LicenseVerifier = class _LicenseVerifier {
2784
2784
  baseUrl = process.env.TELEMETRY_URL.replace(/\/api\/telemetry\/?$/, "");
2785
2785
  }
2786
2786
  const endpoint = `${baseUrl}/api/v1/license/validate`;
2787
- const response = await fetch(endpoint, {
2788
- method: "POST",
2789
- headers: {
2790
- "Content-Type": "application/json",
2791
- "x-license-key": licenseKey
2792
- },
2793
- body: JSON.stringify({
2794
- licenseKey,
2795
- projectId: currentProjectId,
2796
- provider
2797
- })
2798
- });
2787
+ let response;
2788
+ try {
2789
+ response = await fetch(endpoint, {
2790
+ method: "POST",
2791
+ headers: {
2792
+ "Content-Type": "application/json",
2793
+ "x-license-key": licenseKey
2794
+ },
2795
+ body: JSON.stringify({
2796
+ licenseKey,
2797
+ projectId: currentProjectId,
2798
+ provider
2799
+ })
2800
+ });
2801
+ } catch (fetchErr) {
2802
+ if (!isProduction) {
2803
+ console.warn(
2804
+ `[Retrivora SDK] WARNING: License validation via API failed due to network error (${fetchErr.message}). Falling back to local development license.`
2805
+ );
2806
+ return {
2807
+ projectId: currentProjectId,
2808
+ expiresAt: Math.floor(Date.now() / 1e3) + 86400 * 365 * 10,
2809
+ // 10 years
2810
+ tier: "hobby"
2811
+ };
2812
+ }
2813
+ throw fetchErr;
2814
+ }
2799
2815
  if (!response.ok) {
2800
2816
  let errMessage = `HTTP ${response.status}`;
2801
2817
  try {
package/dist/index.d.mts CHANGED
@@ -166,36 +166,4 @@ declare function useProjectSettings(projectId: string, options?: UseProjectSetti
166
166
  */
167
167
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
168
168
 
169
- interface RetrivoraInitOptions {
170
- projectId: string;
171
- licenseKey: string;
172
- apiBase?: string;
173
- primaryColor?: string;
174
- secondaryColor?: string;
175
- theme?: string;
176
- }
177
- declare class RetrivoraBrowserClient {
178
- projectId: string;
179
- licenseKey: string;
180
- apiBase: string;
181
- primaryColor?: string;
182
- secondaryColor?: string;
183
- theme?: string;
184
- constructor(options?: RetrivoraInitOptions);
185
- init(options: RetrivoraInitOptions): void;
186
- chat(message: string, options?: {
187
- history?: any[];
188
- namespace?: string;
189
- }): Promise<{
190
- reply: any;
191
- sources: any;
192
- trace: any;
193
- ui_transformation: any;
194
- }>;
195
- upload(file: File): Promise<any>;
196
- suggest(query: string): Promise<any>;
197
- private ensureInitialized;
198
- }
199
- declare const retrivora: RetrivoraBrowserClient;
200
-
201
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, type RetrivoraInitOptions, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, retrivora, useConfig, useProjectSettings, useRagChat };
169
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, useConfig, useProjectSettings, useRagChat };
package/dist/index.d.ts CHANGED
@@ -166,36 +166,4 @@ declare function useProjectSettings(projectId: string, options?: UseProjectSetti
166
166
  */
167
167
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
168
168
 
169
- interface RetrivoraInitOptions {
170
- projectId: string;
171
- licenseKey: string;
172
- apiBase?: string;
173
- primaryColor?: string;
174
- secondaryColor?: string;
175
- theme?: string;
176
- }
177
- declare class RetrivoraBrowserClient {
178
- projectId: string;
179
- licenseKey: string;
180
- apiBase: string;
181
- primaryColor?: string;
182
- secondaryColor?: string;
183
- theme?: string;
184
- constructor(options?: RetrivoraInitOptions);
185
- init(options: RetrivoraInitOptions): void;
186
- chat(message: string, options?: {
187
- history?: any[];
188
- namespace?: string;
189
- }): Promise<{
190
- reply: any;
191
- sources: any;
192
- trace: any;
193
- ui_transformation: any;
194
- }>;
195
- upload(file: File): Promise<any>;
196
- suggest(query: string): Promise<any>;
197
- private ensureInitialized;
198
- }
199
- declare const retrivora: RetrivoraBrowserClient;
200
-
201
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, type RetrivoraInitOptions, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, retrivora, useConfig, useProjectSettings, useRagChat };
169
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, useConfig, useProjectSettings, useRagChat };
package/dist/index.js CHANGED
@@ -92,7 +92,6 @@ __export(index_exports, {
92
92
  isTransientError: () => isTransientError,
93
93
  normalizeProjectSettings: () => normalizeProjectSettings,
94
94
  projectSettingsToUiConfig: () => projectSettingsToUiConfig,
95
- retrivora: () => retrivora,
96
95
  useConfig: () => useConfig,
97
96
  useProjectSettings: () => useProjectSettings,
98
97
  useRagChat: () => useRagChat
@@ -357,7 +356,7 @@ function projectSettingsToUiConfig(settings) {
357
356
  // package.json
358
357
  var package_default = {
359
358
  name: "@retrivora-ai/rag-engine",
360
- version: "2.5.0",
359
+ version: "2.5.2",
361
360
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
362
361
  author: "Abhinav Alkuchi",
363
362
  license: "UNLICENSED",
@@ -3996,18 +3995,34 @@ var _LicenseVerifier = class _LicenseVerifier {
3996
3995
  baseUrl = process.env.TELEMETRY_URL.replace(/\/api\/telemetry\/?$/, "");
3997
3996
  }
3998
3997
  const endpoint = `${baseUrl}/api/v1/license/validate`;
3999
- const response = await fetch(endpoint, {
4000
- method: "POST",
4001
- headers: {
4002
- "Content-Type": "application/json",
4003
- "x-license-key": licenseKey
4004
- },
4005
- body: JSON.stringify({
4006
- licenseKey,
4007
- projectId: currentProjectId,
4008
- provider
4009
- })
4010
- });
3998
+ let response;
3999
+ try {
4000
+ response = await fetch(endpoint, {
4001
+ method: "POST",
4002
+ headers: {
4003
+ "Content-Type": "application/json",
4004
+ "x-license-key": licenseKey
4005
+ },
4006
+ body: JSON.stringify({
4007
+ licenseKey,
4008
+ projectId: currentProjectId,
4009
+ provider
4010
+ })
4011
+ });
4012
+ } catch (fetchErr) {
4013
+ if (!isProduction) {
4014
+ console.warn(
4015
+ `[Retrivora SDK] WARNING: License validation via API failed due to network error (${fetchErr.message}). Falling back to local development license.`
4016
+ );
4017
+ return {
4018
+ projectId: currentProjectId,
4019
+ expiresAt: Math.floor(Date.now() / 1e3) + 86400 * 365 * 10,
4020
+ // 10 years
4021
+ tier: "hobby"
4022
+ };
4023
+ }
4024
+ throw fetchErr;
4025
+ }
4011
4026
  if (!response.ok) {
4012
4027
  let errMessage = `HTTP ${response.status}`;
4013
4028
  try {
@@ -5825,98 +5840,6 @@ ${errorMessages}`
5825
5840
  return { results, errors, totalProcessed, totalFailed };
5826
5841
  }
5827
5842
  };
5828
-
5829
- // src/core/RetrivoraBrowserClient.ts
5830
- var RetrivoraBrowserClient = class {
5831
- constructor(options) {
5832
- this.projectId = "";
5833
- this.licenseKey = "";
5834
- this.apiBase = "https://www.retrivora.com/api";
5835
- if (options) {
5836
- this.init(options);
5837
- }
5838
- }
5839
- init(options) {
5840
- this.projectId = options.projectId;
5841
- this.licenseKey = options.licenseKey;
5842
- this.primaryColor = options.primaryColor;
5843
- this.secondaryColor = options.secondaryColor;
5844
- this.theme = options.theme;
5845
- if (options.apiBase) {
5846
- this.apiBase = options.apiBase;
5847
- } else if (typeof window !== "undefined") {
5848
- this.apiBase = `${window.location.origin}/api`;
5849
- }
5850
- }
5851
- async chat(message, options) {
5852
- var _a, _b, _c;
5853
- this.ensureInitialized();
5854
- const res = await fetch(`${this.apiBase}/v1/chat/completions`, {
5855
- method: "POST",
5856
- headers: {
5857
- "Content-Type": "application/json",
5858
- "Authorization": `Bearer ${this.licenseKey}`,
5859
- "X-Project-Id": this.projectId
5860
- },
5861
- body: JSON.stringify({
5862
- messages: [
5863
- ...(options == null ? void 0 : options.history) || [],
5864
- { role: "user", content: message }
5865
- ],
5866
- model: "llama-3.1-8b-instant",
5867
- stream: false
5868
- })
5869
- });
5870
- if (!res.ok) {
5871
- const errData = await res.json().catch(() => ({}));
5872
- throw new Error(errData.error || `Chat completions failed with status: ${res.status}`);
5873
- }
5874
- const data = await res.json();
5875
- return {
5876
- reply: ((_c = (_b = (_a = data.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.message) == null ? void 0 : _c.content) || "",
5877
- sources: data.sources || [],
5878
- trace: data.trace || null,
5879
- ui_transformation: data.ui_transformation || null
5880
- };
5881
- }
5882
- async upload(file) {
5883
- this.ensureInitialized();
5884
- const formData = new FormData();
5885
- formData.append("file", file);
5886
- formData.append("projectId", this.projectId);
5887
- const res = await fetch(`${this.apiBase}/upload`, {
5888
- method: "POST",
5889
- headers: {
5890
- "Authorization": `Bearer ${this.licenseKey}`
5891
- },
5892
- body: formData
5893
- });
5894
- if (!res.ok) {
5895
- const errData = await res.json().catch(() => ({}));
5896
- throw new Error(errData.error || `Upload failed with status: ${res.status}`);
5897
- }
5898
- return res.json();
5899
- }
5900
- async suggest(query) {
5901
- this.ensureInitialized();
5902
- const res = await fetch(`${this.apiBase}/suggestions?q=${encodeURIComponent(query)}&projectId=${this.projectId}`, {
5903
- headers: {
5904
- "Authorization": `Bearer ${this.licenseKey}`
5905
- }
5906
- });
5907
- if (!res.ok) {
5908
- const errData = await res.json().catch(() => ({}));
5909
- throw new Error(errData.error || `Suggestions fetch failed with status: ${res.status}`);
5910
- }
5911
- return res.json();
5912
- }
5913
- ensureInitialized() {
5914
- if (!this.projectId || !this.licenseKey) {
5915
- throw new Error("[Retrivora SDK] Client not initialized. Run retrivora.init({ projectId, licenseKey }) first.");
5916
- }
5917
- }
5918
- };
5919
- var retrivora = new RetrivoraBrowserClient();
5920
5843
  // Annotate the CommonJS export names for ESM import in node:
5921
5844
  0 && (module.exports = {
5922
5845
  AuthenticationException,
@@ -5951,7 +5874,6 @@ var retrivora = new RetrivoraBrowserClient();
5951
5874
  isTransientError,
5952
5875
  normalizeProjectSettings,
5953
5876
  projectSettingsToUiConfig,
5954
- retrivora,
5955
5877
  useConfig,
5956
5878
  useProjectSettings,
5957
5879
  useRagChat
package/dist/index.mjs CHANGED
@@ -312,7 +312,7 @@ function projectSettingsToUiConfig(settings) {
312
312
  // package.json
313
313
  var package_default = {
314
314
  name: "@retrivora-ai/rag-engine",
315
- version: "2.5.0",
315
+ version: "2.5.2",
316
316
  description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
317
317
  author: "Abhinav Alkuchi",
318
318
  license: "UNLICENSED",
@@ -3997,18 +3997,34 @@ var _LicenseVerifier = class _LicenseVerifier {
3997
3997
  baseUrl = process.env.TELEMETRY_URL.replace(/\/api\/telemetry\/?$/, "");
3998
3998
  }
3999
3999
  const endpoint = `${baseUrl}/api/v1/license/validate`;
4000
- const response = await fetch(endpoint, {
4001
- method: "POST",
4002
- headers: {
4003
- "Content-Type": "application/json",
4004
- "x-license-key": licenseKey
4005
- },
4006
- body: JSON.stringify({
4007
- licenseKey,
4008
- projectId: currentProjectId,
4009
- provider
4010
- })
4011
- });
4000
+ let response;
4001
+ try {
4002
+ response = await fetch(endpoint, {
4003
+ method: "POST",
4004
+ headers: {
4005
+ "Content-Type": "application/json",
4006
+ "x-license-key": licenseKey
4007
+ },
4008
+ body: JSON.stringify({
4009
+ licenseKey,
4010
+ projectId: currentProjectId,
4011
+ provider
4012
+ })
4013
+ });
4014
+ } catch (fetchErr) {
4015
+ if (!isProduction) {
4016
+ console.warn(
4017
+ `[Retrivora SDK] WARNING: License validation via API failed due to network error (${fetchErr.message}). Falling back to local development license.`
4018
+ );
4019
+ return {
4020
+ projectId: currentProjectId,
4021
+ expiresAt: Math.floor(Date.now() / 1e3) + 86400 * 365 * 10,
4022
+ // 10 years
4023
+ tier: "hobby"
4024
+ };
4025
+ }
4026
+ throw fetchErr;
4027
+ }
4012
4028
  if (!response.ok) {
4013
4029
  let errMessage = `HTTP ${response.status}`;
4014
4030
  try {
@@ -5826,98 +5842,6 @@ ${errorMessages}`
5826
5842
  return { results, errors, totalProcessed, totalFailed };
5827
5843
  }
5828
5844
  };
5829
-
5830
- // src/core/RetrivoraBrowserClient.ts
5831
- var RetrivoraBrowserClient = class {
5832
- constructor(options) {
5833
- this.projectId = "";
5834
- this.licenseKey = "";
5835
- this.apiBase = "https://www.retrivora.com/api";
5836
- if (options) {
5837
- this.init(options);
5838
- }
5839
- }
5840
- init(options) {
5841
- this.projectId = options.projectId;
5842
- this.licenseKey = options.licenseKey;
5843
- this.primaryColor = options.primaryColor;
5844
- this.secondaryColor = options.secondaryColor;
5845
- this.theme = options.theme;
5846
- if (options.apiBase) {
5847
- this.apiBase = options.apiBase;
5848
- } else if (typeof window !== "undefined") {
5849
- this.apiBase = `${window.location.origin}/api`;
5850
- }
5851
- }
5852
- async chat(message, options) {
5853
- var _a, _b, _c;
5854
- this.ensureInitialized();
5855
- const res = await fetch(`${this.apiBase}/v1/chat/completions`, {
5856
- method: "POST",
5857
- headers: {
5858
- "Content-Type": "application/json",
5859
- "Authorization": `Bearer ${this.licenseKey}`,
5860
- "X-Project-Id": this.projectId
5861
- },
5862
- body: JSON.stringify({
5863
- messages: [
5864
- ...(options == null ? void 0 : options.history) || [],
5865
- { role: "user", content: message }
5866
- ],
5867
- model: "llama-3.1-8b-instant",
5868
- stream: false
5869
- })
5870
- });
5871
- if (!res.ok) {
5872
- const errData = await res.json().catch(() => ({}));
5873
- throw new Error(errData.error || `Chat completions failed with status: ${res.status}`);
5874
- }
5875
- const data = await res.json();
5876
- return {
5877
- reply: ((_c = (_b = (_a = data.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.message) == null ? void 0 : _c.content) || "",
5878
- sources: data.sources || [],
5879
- trace: data.trace || null,
5880
- ui_transformation: data.ui_transformation || null
5881
- };
5882
- }
5883
- async upload(file) {
5884
- this.ensureInitialized();
5885
- const formData = new FormData();
5886
- formData.append("file", file);
5887
- formData.append("projectId", this.projectId);
5888
- const res = await fetch(`${this.apiBase}/upload`, {
5889
- method: "POST",
5890
- headers: {
5891
- "Authorization": `Bearer ${this.licenseKey}`
5892
- },
5893
- body: formData
5894
- });
5895
- if (!res.ok) {
5896
- const errData = await res.json().catch(() => ({}));
5897
- throw new Error(errData.error || `Upload failed with status: ${res.status}`);
5898
- }
5899
- return res.json();
5900
- }
5901
- async suggest(query) {
5902
- this.ensureInitialized();
5903
- const res = await fetch(`${this.apiBase}/suggestions?q=${encodeURIComponent(query)}&projectId=${this.projectId}`, {
5904
- headers: {
5905
- "Authorization": `Bearer ${this.licenseKey}`
5906
- }
5907
- });
5908
- if (!res.ok) {
5909
- const errData = await res.json().catch(() => ({}));
5910
- throw new Error(errData.error || `Suggestions fetch failed with status: ${res.status}`);
5911
- }
5912
- return res.json();
5913
- }
5914
- ensureInitialized() {
5915
- if (!this.projectId || !this.licenseKey) {
5916
- throw new Error("[Retrivora SDK] Client not initialized. Run retrivora.init({ projectId, licenseKey }) first.");
5917
- }
5918
- }
5919
- };
5920
- var retrivora = new RetrivoraBrowserClient();
5921
5845
  export {
5922
5846
  AuthenticationException,
5923
5847
  BatchProcessor,
@@ -5951,7 +5875,6 @@ export {
5951
5875
  isTransientError,
5952
5876
  normalizeProjectSettings,
5953
5877
  projectSettingsToUiConfig,
5954
- retrivora,
5955
5878
  useConfig,
5956
5879
  useProjectSettings,
5957
5880
  useRagChat
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.0",
335
+ version: "2.5.2",
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",
@@ -2910,18 +2910,34 @@ var _LicenseVerifier = class _LicenseVerifier {
2910
2910
  baseUrl = process.env.TELEMETRY_URL.replace(/\/api\/telemetry\/?$/, "");
2911
2911
  }
2912
2912
  const endpoint = `${baseUrl}/api/v1/license/validate`;
2913
- const response = await fetch(endpoint, {
2914
- method: "POST",
2915
- headers: {
2916
- "Content-Type": "application/json",
2917
- "x-license-key": licenseKey
2918
- },
2919
- body: JSON.stringify({
2920
- licenseKey,
2921
- projectId: currentProjectId,
2922
- provider
2923
- })
2924
- });
2913
+ let response;
2914
+ try {
2915
+ response = await fetch(endpoint, {
2916
+ method: "POST",
2917
+ headers: {
2918
+ "Content-Type": "application/json",
2919
+ "x-license-key": licenseKey
2920
+ },
2921
+ body: JSON.stringify({
2922
+ licenseKey,
2923
+ projectId: currentProjectId,
2924
+ provider
2925
+ })
2926
+ });
2927
+ } catch (fetchErr) {
2928
+ if (!isProduction) {
2929
+ console.warn(
2930
+ `[Retrivora SDK] WARNING: License validation via API failed due to network error (${fetchErr.message}). Falling back to local development license.`
2931
+ );
2932
+ return {
2933
+ projectId: currentProjectId,
2934
+ expiresAt: Math.floor(Date.now() / 1e3) + 86400 * 365 * 10,
2935
+ // 10 years
2936
+ tier: "hobby"
2937
+ };
2938
+ }
2939
+ throw fetchErr;
2940
+ }
2925
2941
  if (!response.ok) {
2926
2942
  let errMessage = `HTTP ${response.status}`;
2927
2943
  try {
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.0",
329
+ version: "2.5.2",
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",
@@ -2805,18 +2805,34 @@ var _LicenseVerifier = class _LicenseVerifier {
2805
2805
  baseUrl = process.env.TELEMETRY_URL.replace(/\/api\/telemetry\/?$/, "");
2806
2806
  }
2807
2807
  const endpoint = `${baseUrl}/api/v1/license/validate`;
2808
- const response = await fetch(endpoint, {
2809
- method: "POST",
2810
- headers: {
2811
- "Content-Type": "application/json",
2812
- "x-license-key": licenseKey
2813
- },
2814
- body: JSON.stringify({
2815
- licenseKey,
2816
- projectId: currentProjectId,
2817
- provider
2818
- })
2819
- });
2808
+ let response;
2809
+ try {
2810
+ response = await fetch(endpoint, {
2811
+ method: "POST",
2812
+ headers: {
2813
+ "Content-Type": "application/json",
2814
+ "x-license-key": licenseKey
2815
+ },
2816
+ body: JSON.stringify({
2817
+ licenseKey,
2818
+ projectId: currentProjectId,
2819
+ provider
2820
+ })
2821
+ });
2822
+ } catch (fetchErr) {
2823
+ if (!isProduction) {
2824
+ console.warn(
2825
+ `[Retrivora SDK] WARNING: License validation via API failed due to network error (${fetchErr.message}). Falling back to local development license.`
2826
+ );
2827
+ return {
2828
+ projectId: currentProjectId,
2829
+ expiresAt: Math.floor(Date.now() / 1e3) + 86400 * 365 * 10,
2830
+ // 10 years
2831
+ tier: "hobby"
2832
+ };
2833
+ }
2834
+ throw fetchErr;
2835
+ }
2820
2836
  if (!response.ok) {
2821
2837
  let errMessage = `HTTP ${response.status}`;
2822
2838
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
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",