@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
@@ -104,20 +104,33 @@ export class PineconeProvider extends BaseVectorProvider {
104
104
  const projectId = process.env.RAG_PROJECT_ID || process.env.NEXT_PUBLIC_RAG_PROJECT_ID || jwtProjectId || this.projectId || 'default';
105
105
 
106
106
  const remoteConfig = await ConfigFetcher.fetchRemoteVectorConfig(projectId, licenseKey);
107
- if (remoteConfig?.apiKey) {
108
- key = remoteConfig.apiKey;
109
- this.apiKey = key;
107
+
108
+ // The config API does NOT return the Pinecone API key (server-only secret).
109
+ // We still use the remote config for indexName and namespace/workspace info.
110
+ if (remoteConfig) {
111
+ if (remoteConfig.apiKey) {
112
+ key = remoteConfig.apiKey;
113
+ this.apiKey = key;
114
+ }
110
115
  if (remoteConfig.indexName) {
111
116
  this.indexName = remoteConfig.indexName;
112
117
  }
113
118
  if (remoteConfig.projectId) {
114
119
  this.projectId = remoteConfig.projectId;
115
120
  }
121
+ if (remoteConfig.namespace) {
122
+ // Store namespace for use in queries — ensures workspace isolation
123
+ (this as any).namespace = remoteConfig.namespace;
124
+ }
116
125
  }
117
126
  }
118
127
 
119
128
  if (!key) {
120
- console.warn('[PineconeProvider] Warning: No Pinecone API key available locally or remotely.');
129
+ console.warn(
130
+ '[PineconeProvider] Warning: No Pinecone API key available. ' +
131
+ 'Set PINECONE_API_KEY in your environment, or ensure the Retrivora Control Plane ' +
132
+ '(https://www.retrivora.com) is reachable for proxy-based vector operations.'
133
+ );
121
134
  return;
122
135
  }
123
136
 
package/src/server.ts CHANGED
@@ -40,6 +40,29 @@ export { LicenseVerifier } from './core/LicenseVerifier';
40
40
  export { SDK_VERSION } from './version';
41
41
  export { ProviderHealthCheck } from './core/ProviderHealthCheck';
42
42
  export { BatchProcessor } from './core/BatchProcessor';
43
+ export { ConfigFetcher } from './core/ConfigFetcher';
44
+ export {
45
+ createDefaultProjectSettings,
46
+ normalizeProjectSettings,
47
+ projectSettingsToUiConfig,
48
+ } from './core/ProjectSettings';
49
+ export type {
50
+ RemoteConfig,
51
+ RemoteVectorConfig,
52
+ RemoteEmbeddingConfig,
53
+ RemoteLLMConfig,
54
+ } from './core/ConfigFetcher';
55
+ export type {
56
+ AuthMode,
57
+ ProjectAiSettings,
58
+ ProjectAuthSettings,
59
+ ProjectBrandingSettings,
60
+ ProjectChatSettings,
61
+ ProjectTelemetrySettings,
62
+ ProjectWidgetSettings,
63
+ ThemeMode,
64
+ WidgetPosition,
65
+ } from './core/ProjectSettings';
43
66
 
44
67
  // ── Configuration Helpers ──────────────────────────────────────
45
68
  export { getRagConfig } from './config/serverConfig';
@@ -109,4 +132,3 @@ export {
109
132
  LicenseValidationError,
110
133
  wrapError,
111
134
  } from './exceptions';
112
-
@@ -2,6 +2,7 @@ import { ReactNode, CSSProperties, MouseEvent, ElementType } from 'react';
2
2
  import { Product, VectorMatch } from './index';
3
3
  import { RagMessage } from './chat';
4
4
  import { UIConfig } from '../config/RagConfig';
5
+ import { ProjectChatSettings, WidgetPosition } from '../core/ProjectSettings';
5
6
 
6
7
  export interface ArchitectureCardProps {
7
8
  icon: ReactNode;
@@ -69,7 +70,7 @@ export interface ChatWindowProps {
69
70
 
70
71
  export interface ChatWidgetProps {
71
72
  /** Position of the floating button. Defaults to bottom-right. */
72
- position?: 'bottom-right' | 'bottom-left';
73
+ position?: WidgetPosition;
73
74
  /** Called when the user clicks 'Add to Cart' on a product */
74
75
  onAddToCart?: (product: Product) => void;
75
76
  /** Optional custom API URL to send chat messages to */
@@ -134,13 +135,24 @@ export interface ClientConfig {
134
135
  model?: string;
135
136
  dimensions?: number;
136
137
  };
138
+ licenseKey?: string;
139
+ headers?: Record<string, string>;
140
+ retrivoraApiBase?: string;
141
+ projectSettings?: ProjectChatSettings;
142
+ autoLoadProjectSettings?: boolean;
143
+ isProjectSettingsLoading?: boolean;
137
144
  }
138
145
 
139
146
  export interface ConfigProviderProps {
140
147
  config?: {
141
148
  projectId?: string;
142
149
  ui?: Partial<UIConfig>;
143
- embedding?: { model?: string; dimensions?: number }
150
+ embedding?: { model?: string; dimensions?: number };
151
+ licenseKey?: string;
152
+ headers?: Record<string, string>;
153
+ retrivoraApiBase?: string;
154
+ projectSettings?: Partial<ProjectChatSettings>;
155
+ autoLoadProjectSettings?: boolean;
144
156
  };
145
157
  children: ReactNode;
146
158
  }