@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/handlers/index.js +18 -2
- package/dist/handlers/index.mjs +18 -2
- package/dist/{index--RhMcXrt.d.ts → index-8vijDPfT.d.ts} +15 -0
- package/dist/{index-Dex_gQ3P.d.mts → index-BKOyhayB.d.mts} +15 -0
- package/dist/index.css +12 -83
- package/dist/index.d.mts +19 -14
- package/dist/index.d.ts +19 -14
- package/dist/index.js +3797 -3847
- package/dist/index.min.css +1 -1
- package/dist/index.mjs +3845 -3896
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +38 -2
- package/dist/server.mjs +38 -2
- package/package.json +1 -1
package/dist/handlers/index.js
CHANGED
|
@@ -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.
|
|
321
|
+
version: "2.5.5",
|
|
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",
|
|
@@ -511,13 +511,27 @@ var init_ConfigFetcher = __esm({
|
|
|
511
511
|
* PINECONE_API_KEY if available, or vector operations are handled server-side.
|
|
512
512
|
*/
|
|
513
513
|
static async fetchRemoteConfig(projectId, licenseKey) {
|
|
514
|
-
var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
|
|
515
514
|
const cacheKey = `${projectId}:${licenseKey || ""}`;
|
|
516
515
|
const now = Date.now();
|
|
517
516
|
const cached = this.cache.get(cacheKey);
|
|
518
517
|
if (cached && now - cached.cachedAt < this.TTL_MS) {
|
|
519
518
|
return cached.config;
|
|
520
519
|
}
|
|
520
|
+
const existingInflight = this.inflight.get(cacheKey);
|
|
521
|
+
if (existingInflight) {
|
|
522
|
+
return existingInflight;
|
|
523
|
+
}
|
|
524
|
+
const promise = this._doFetch(projectId, licenseKey, cacheKey, now);
|
|
525
|
+
this.inflight.set(cacheKey, promise);
|
|
526
|
+
try {
|
|
527
|
+
return await promise;
|
|
528
|
+
} finally {
|
|
529
|
+
this.inflight.delete(cacheKey);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
/** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */
|
|
533
|
+
static async _doFetch(projectId, licenseKey, cacheKey, now) {
|
|
534
|
+
var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
|
|
521
535
|
const controlPlaneUrls = [
|
|
522
536
|
process.env.RETRIVORA_CONTROL_PLANE_URL,
|
|
523
537
|
process.env.NEXT_PUBLIC_RETRIVORA_CONTROL_PLANE_URL,
|
|
@@ -630,6 +644,8 @@ var init_ConfigFetcher = __esm({
|
|
|
630
644
|
}
|
|
631
645
|
};
|
|
632
646
|
ConfigFetcher.cache = /* @__PURE__ */ new Map();
|
|
647
|
+
/** In-flight deduplication: concurrent callers for the same key share one network request */
|
|
648
|
+
ConfigFetcher.inflight = /* @__PURE__ */ new Map();
|
|
633
649
|
ConfigFetcher.TTL_MS = 5 * 60 * 1e3;
|
|
634
650
|
}
|
|
635
651
|
});
|
package/dist/handlers/index.mjs
CHANGED
|
@@ -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.
|
|
315
|
+
version: "2.5.5",
|
|
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",
|
|
@@ -505,13 +505,27 @@ var init_ConfigFetcher = __esm({
|
|
|
505
505
|
* PINECONE_API_KEY if available, or vector operations are handled server-side.
|
|
506
506
|
*/
|
|
507
507
|
static async fetchRemoteConfig(projectId, licenseKey) {
|
|
508
|
-
var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
|
|
509
508
|
const cacheKey = `${projectId}:${licenseKey || ""}`;
|
|
510
509
|
const now = Date.now();
|
|
511
510
|
const cached = this.cache.get(cacheKey);
|
|
512
511
|
if (cached && now - cached.cachedAt < this.TTL_MS) {
|
|
513
512
|
return cached.config;
|
|
514
513
|
}
|
|
514
|
+
const existingInflight = this.inflight.get(cacheKey);
|
|
515
|
+
if (existingInflight) {
|
|
516
|
+
return existingInflight;
|
|
517
|
+
}
|
|
518
|
+
const promise = this._doFetch(projectId, licenseKey, cacheKey, now);
|
|
519
|
+
this.inflight.set(cacheKey, promise);
|
|
520
|
+
try {
|
|
521
|
+
return await promise;
|
|
522
|
+
} finally {
|
|
523
|
+
this.inflight.delete(cacheKey);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
/** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */
|
|
527
|
+
static async _doFetch(projectId, licenseKey, cacheKey, now) {
|
|
528
|
+
var _a2, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k;
|
|
515
529
|
const controlPlaneUrls = [
|
|
516
530
|
process.env.RETRIVORA_CONTROL_PLANE_URL,
|
|
517
531
|
process.env.NEXT_PUBLIC_RETRIVORA_CONTROL_PLANE_URL,
|
|
@@ -624,6 +638,8 @@ var init_ConfigFetcher = __esm({
|
|
|
624
638
|
}
|
|
625
639
|
};
|
|
626
640
|
ConfigFetcher.cache = /* @__PURE__ */ new Map();
|
|
641
|
+
/** In-flight deduplication: concurrent callers for the same key share one network request */
|
|
642
|
+
ConfigFetcher.inflight = /* @__PURE__ */ new Map();
|
|
627
643
|
ConfigFetcher.TTL_MS = 5 * 60 * 1e3;
|
|
628
644
|
}
|
|
629
645
|
});
|
|
@@ -134,7 +134,14 @@ interface ClientConfig {
|
|
|
134
134
|
retrivoraApiBase?: string;
|
|
135
135
|
projectSettings?: ProjectChatSettings;
|
|
136
136
|
autoLoadProjectSettings?: boolean;
|
|
137
|
+
/** True while validate + /config are still in-flight. ChatWidget shows nothing until false. */
|
|
137
138
|
isProjectSettingsLoading?: boolean;
|
|
139
|
+
/** True once /validate succeeds. False if license is expired/invalid/revoked. */
|
|
140
|
+
isLicenseValid?: boolean;
|
|
141
|
+
/** True once /config returns 200 and config is populated. False if /config call failed. */
|
|
142
|
+
isConfigLoaded?: boolean;
|
|
143
|
+
/** Human-readable error from the init sequence (license error or config fetch error). */
|
|
144
|
+
initError?: string;
|
|
138
145
|
}
|
|
139
146
|
interface ConfigProviderProps {
|
|
140
147
|
config?: {
|
|
@@ -524,6 +531,8 @@ interface RemoteConfig {
|
|
|
524
531
|
|
|
525
532
|
declare class ConfigFetcher {
|
|
526
533
|
private static cache;
|
|
534
|
+
/** In-flight deduplication: concurrent callers for the same key share one network request */
|
|
535
|
+
private static inflight;
|
|
527
536
|
private static readonly TTL_MS;
|
|
528
537
|
/**
|
|
529
538
|
* Fetch full project configuration (vectorDb + embedding + llm + workspace) from Retrivora Control Plane.
|
|
@@ -539,6 +548,8 @@ declare class ConfigFetcher {
|
|
|
539
548
|
* PINECONE_API_KEY if available, or vector operations are handled server-side.
|
|
540
549
|
*/
|
|
541
550
|
static fetchRemoteConfig(projectId: string, licenseKey?: string): Promise<RemoteConfig | null>;
|
|
551
|
+
/** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */
|
|
552
|
+
private static _doFetch;
|
|
542
553
|
/** Convenience: fetch only vector DB config (backwards compat). */
|
|
543
554
|
static fetchRemoteVectorConfig(projectId: string, licenseKey?: string): Promise<RemoteVectorConfig | null>;
|
|
544
555
|
}
|
|
@@ -680,6 +691,8 @@ interface LicenseValidationResponse {
|
|
|
680
691
|
declare class LicenseValidator {
|
|
681
692
|
private static instance;
|
|
682
693
|
private cache;
|
|
694
|
+
/** In-flight deduplication: concurrent calls for same key share one network request */
|
|
695
|
+
private inflight;
|
|
683
696
|
private static readonly SUCCESS_CACHE_TTL_MS;
|
|
684
697
|
private constructor();
|
|
685
698
|
/** @returns Singleton instance of the validator (shared cache across all consumers). */
|
|
@@ -707,6 +720,8 @@ declare class LicenseValidator {
|
|
|
707
720
|
* lock the chat widget.
|
|
708
721
|
*/
|
|
709
722
|
validate(request: LicenseValidationRequest): Promise<LicenseValidationResponse>;
|
|
723
|
+
/** Performs the actual network request. Called once; result shared by in-flight dedup. */
|
|
724
|
+
private _doNetworkValidate;
|
|
710
725
|
}
|
|
711
726
|
|
|
712
727
|
/**
|
|
@@ -134,7 +134,14 @@ interface ClientConfig {
|
|
|
134
134
|
retrivoraApiBase?: string;
|
|
135
135
|
projectSettings?: ProjectChatSettings;
|
|
136
136
|
autoLoadProjectSettings?: boolean;
|
|
137
|
+
/** True while validate + /config are still in-flight. ChatWidget shows nothing until false. */
|
|
137
138
|
isProjectSettingsLoading?: boolean;
|
|
139
|
+
/** True once /validate succeeds. False if license is expired/invalid/revoked. */
|
|
140
|
+
isLicenseValid?: boolean;
|
|
141
|
+
/** True once /config returns 200 and config is populated. False if /config call failed. */
|
|
142
|
+
isConfigLoaded?: boolean;
|
|
143
|
+
/** Human-readable error from the init sequence (license error or config fetch error). */
|
|
144
|
+
initError?: string;
|
|
138
145
|
}
|
|
139
146
|
interface ConfigProviderProps {
|
|
140
147
|
config?: {
|
|
@@ -524,6 +531,8 @@ interface RemoteConfig {
|
|
|
524
531
|
|
|
525
532
|
declare class ConfigFetcher {
|
|
526
533
|
private static cache;
|
|
534
|
+
/** In-flight deduplication: concurrent callers for the same key share one network request */
|
|
535
|
+
private static inflight;
|
|
527
536
|
private static readonly TTL_MS;
|
|
528
537
|
/**
|
|
529
538
|
* Fetch full project configuration (vectorDb + embedding + llm + workspace) from Retrivora Control Plane.
|
|
@@ -539,6 +548,8 @@ declare class ConfigFetcher {
|
|
|
539
548
|
* PINECONE_API_KEY if available, or vector operations are handled server-side.
|
|
540
549
|
*/
|
|
541
550
|
static fetchRemoteConfig(projectId: string, licenseKey?: string): Promise<RemoteConfig | null>;
|
|
551
|
+
/** Internal: performs the actual HTTP fetch. Shared by all callers via inflight dedup. */
|
|
552
|
+
private static _doFetch;
|
|
542
553
|
/** Convenience: fetch only vector DB config (backwards compat). */
|
|
543
554
|
static fetchRemoteVectorConfig(projectId: string, licenseKey?: string): Promise<RemoteVectorConfig | null>;
|
|
544
555
|
}
|
|
@@ -680,6 +691,8 @@ interface LicenseValidationResponse {
|
|
|
680
691
|
declare class LicenseValidator {
|
|
681
692
|
private static instance;
|
|
682
693
|
private cache;
|
|
694
|
+
/** In-flight deduplication: concurrent calls for same key share one network request */
|
|
695
|
+
private inflight;
|
|
683
696
|
private static readonly SUCCESS_CACHE_TTL_MS;
|
|
684
697
|
private constructor();
|
|
685
698
|
/** @returns Singleton instance of the validator (shared cache across all consumers). */
|
|
@@ -707,6 +720,8 @@ declare class LicenseValidator {
|
|
|
707
720
|
* lock the chat widget.
|
|
708
721
|
*/
|
|
709
722
|
validate(request: LicenseValidationRequest): Promise<LicenseValidationResponse>;
|
|
723
|
+
/** Performs the actual network request. Called once; result shared by in-flight dedup. */
|
|
724
|
+
private _doNetworkValidate;
|
|
710
725
|
}
|
|
711
726
|
|
|
712
727
|
/**
|
package/dist/index.css
CHANGED
|
@@ -358,9 +358,6 @@
|
|
|
358
358
|
.top-20 {
|
|
359
359
|
top: calc(var(--spacing) * 20);
|
|
360
360
|
}
|
|
361
|
-
.top-24 {
|
|
362
|
-
top: calc(var(--spacing) * 24);
|
|
363
|
-
}
|
|
364
361
|
.-right-4 {
|
|
365
362
|
right: calc(var(--spacing) * -4);
|
|
366
363
|
}
|
|
@@ -388,9 +385,6 @@
|
|
|
388
385
|
.bottom-20 {
|
|
389
386
|
bottom: calc(var(--spacing) * 20);
|
|
390
387
|
}
|
|
391
|
-
.bottom-24 {
|
|
392
|
-
bottom: calc(var(--spacing) * 24);
|
|
393
|
-
}
|
|
394
388
|
.-left-4 {
|
|
395
389
|
left: calc(var(--spacing) * -4);
|
|
396
390
|
}
|
|
@@ -454,6 +448,9 @@
|
|
|
454
448
|
.mx-4 {
|
|
455
449
|
margin-inline: calc(var(--spacing) * 4);
|
|
456
450
|
}
|
|
451
|
+
.mx-6 {
|
|
452
|
+
margin-inline: calc(var(--spacing) * 6);
|
|
453
|
+
}
|
|
457
454
|
.mx-auto {
|
|
458
455
|
margin-inline: auto;
|
|
459
456
|
}
|
|
@@ -1137,12 +1134,6 @@
|
|
|
1137
1134
|
.border-amber-200 {
|
|
1138
1135
|
border-color: var(--color-amber-200);
|
|
1139
1136
|
}
|
|
1140
|
-
.border-amber-200\/80 {
|
|
1141
|
-
border-color: color-mix(in srgb, oklch(92.4% 0.12 95.746) 80%, transparent);
|
|
1142
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1143
|
-
border-color: color-mix(in oklab, var(--color-amber-200) 80%, transparent);
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
1137
|
.border-emerald-100 {
|
|
1147
1138
|
border-color: var(--color-emerald-100);
|
|
1148
1139
|
}
|
|
@@ -1179,6 +1170,12 @@
|
|
|
1179
1170
|
.border-rose-200 {
|
|
1180
1171
|
border-color: var(--color-rose-200);
|
|
1181
1172
|
}
|
|
1173
|
+
.border-rose-200\/50 {
|
|
1174
|
+
border-color: color-mix(in srgb, oklch(89.2% 0.058 10.001) 50%, transparent);
|
|
1175
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1176
|
+
border-color: color-mix(in oklab, var(--color-rose-200) 50%, transparent);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1182
1179
|
.border-rose-200\/60 {
|
|
1183
1180
|
border-color: color-mix(in srgb, oklch(89.2% 0.058 10.001) 60%, transparent);
|
|
1184
1181
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1248,12 +1245,6 @@
|
|
|
1248
1245
|
.bg-amber-50 {
|
|
1249
1246
|
background-color: var(--color-amber-50);
|
|
1250
1247
|
}
|
|
1251
|
-
.bg-amber-50\/70 {
|
|
1252
|
-
background-color: color-mix(in srgb, oklch(98.7% 0.022 95.277) 70%, transparent);
|
|
1253
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1254
|
-
background-color: color-mix(in oklab, var(--color-amber-50) 70%, transparent);
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
1248
|
.bg-amber-100 {
|
|
1258
1249
|
background-color: var(--color-amber-100);
|
|
1259
1250
|
}
|
|
@@ -1461,12 +1452,6 @@
|
|
|
1461
1452
|
background-color: color-mix(in oklab, var(--color-white) 90%, transparent);
|
|
1462
1453
|
}
|
|
1463
1454
|
}
|
|
1464
|
-
.bg-white\/95 {
|
|
1465
|
-
background-color: color-mix(in srgb, #fff 95%, transparent);
|
|
1466
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1467
|
-
background-color: color-mix(in oklab, var(--color-white) 95%, transparent);
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
1455
|
.bg-gradient-to-br {
|
|
1471
1456
|
--tw-gradient-position: to bottom right in oklab;
|
|
1472
1457
|
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
@@ -1697,9 +1682,6 @@
|
|
|
1697
1682
|
.whitespace-pre-wrap {
|
|
1698
1683
|
white-space: pre-wrap;
|
|
1699
1684
|
}
|
|
1700
|
-
.text-amber-300 {
|
|
1701
|
-
color: var(--color-amber-300);
|
|
1702
|
-
}
|
|
1703
1685
|
.text-amber-400 {
|
|
1704
1686
|
color: var(--color-amber-400);
|
|
1705
1687
|
}
|
|
@@ -1721,6 +1703,9 @@
|
|
|
1721
1703
|
.text-amber-950 {
|
|
1722
1704
|
color: var(--color-amber-950);
|
|
1723
1705
|
}
|
|
1706
|
+
.text-black {
|
|
1707
|
+
color: var(--color-black);
|
|
1708
|
+
}
|
|
1724
1709
|
.text-blue-600 {
|
|
1725
1710
|
color: var(--color-blue-600);
|
|
1726
1711
|
}
|
|
@@ -2038,10 +2023,6 @@
|
|
|
2038
2023
|
--tw-outline-style: none;
|
|
2039
2024
|
outline-style: none;
|
|
2040
2025
|
}
|
|
2041
|
-
.select-all {
|
|
2042
|
-
-webkit-user-select: all;
|
|
2043
|
-
user-select: all;
|
|
2044
|
-
}
|
|
2045
2026
|
.select-none {
|
|
2046
2027
|
-webkit-user-select: none;
|
|
2047
2028
|
user-select: none;
|
|
@@ -2341,14 +2322,6 @@
|
|
|
2341
2322
|
border-color: color-mix(in oklab, var(--color-amber-500) 20%, transparent);
|
|
2342
2323
|
}
|
|
2343
2324
|
}
|
|
2344
|
-
.dark\:border-amber-800\/40 {
|
|
2345
|
-
border-color: color-mix(in srgb, oklch(47.3% 0.137 46.201) 40%, transparent);
|
|
2346
|
-
}
|
|
2347
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2348
|
-
.dark\:border-amber-800\/40 {
|
|
2349
|
-
border-color: color-mix(in oklab, var(--color-amber-800) 40%, transparent);
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
2325
|
.dark\:border-emerald-400\/20 {
|
|
2353
2326
|
border-color: color-mix(in srgb, oklch(76.5% 0.177 163.223) 20%, transparent);
|
|
2354
2327
|
}
|
|
@@ -2429,14 +2402,6 @@
|
|
|
2429
2402
|
border-color: color-mix(in oklab, var(--color-rose-800) 40%, transparent);
|
|
2430
2403
|
}
|
|
2431
2404
|
}
|
|
2432
|
-
.dark\:border-rose-900\/60 {
|
|
2433
|
-
border-color: color-mix(in srgb, oklch(41% 0.159 10.272) 60%, transparent);
|
|
2434
|
-
}
|
|
2435
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2436
|
-
.dark\:border-rose-900\/60 {
|
|
2437
|
-
border-color: color-mix(in oklab, var(--color-rose-900) 60%, transparent);
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
2405
|
.dark\:border-slate-700 {
|
|
2441
2406
|
border-color: var(--color-slate-700);
|
|
2442
2407
|
}
|
|
@@ -2484,9 +2449,6 @@
|
|
|
2484
2449
|
.dark\:bg-\[\#0f0f1a\]\/90 {
|
|
2485
2450
|
background-color: color-mix(in oklab, #0f0f1a 90%, transparent);
|
|
2486
2451
|
}
|
|
2487
|
-
.dark\:bg-\[\#0f0f1a\]\/95 {
|
|
2488
|
-
background-color: color-mix(in oklab, #0f0f1a 95%, transparent);
|
|
2489
|
-
}
|
|
2490
2452
|
.dark\:bg-\[\#080811\] {
|
|
2491
2453
|
background-color: #080811;
|
|
2492
2454
|
}
|
|
@@ -2533,22 +2495,6 @@
|
|
|
2533
2495
|
background-color: color-mix(in oklab, var(--color-amber-900) 20%, transparent);
|
|
2534
2496
|
}
|
|
2535
2497
|
}
|
|
2536
|
-
.dark\:bg-amber-900\/40 {
|
|
2537
|
-
background-color: color-mix(in srgb, oklch(41.4% 0.112 45.904) 40%, transparent);
|
|
2538
|
-
}
|
|
2539
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2540
|
-
.dark\:bg-amber-900\/40 {
|
|
2541
|
-
background-color: color-mix(in oklab, var(--color-amber-900) 40%, transparent);
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
.dark\:bg-amber-950\/20 {
|
|
2545
|
-
background-color: color-mix(in srgb, oklch(27.9% 0.077 45.635) 20%, transparent);
|
|
2546
|
-
}
|
|
2547
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2548
|
-
.dark\:bg-amber-950\/20 {
|
|
2549
|
-
background-color: color-mix(in oklab, var(--color-amber-950) 20%, transparent);
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
2498
|
.dark\:bg-amber-950\/40 {
|
|
2553
2499
|
background-color: color-mix(in srgb, oklch(27.9% 0.077 45.635) 40%, transparent);
|
|
2554
2500
|
}
|
|
@@ -3128,12 +3074,6 @@
|
|
|
3128
3074
|
.dark\:text-zinc-500 {
|
|
3129
3075
|
color: var(--color-zinc-500);
|
|
3130
3076
|
}
|
|
3131
|
-
.dark\:placeholder-white\/30::placeholder {
|
|
3132
|
-
color: color-mix(in srgb, #fff 30%, transparent);
|
|
3133
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
3134
|
-
color: color-mix(in oklab, var(--color-white) 30%, transparent);
|
|
3135
|
-
}
|
|
3136
|
-
}
|
|
3137
3077
|
.dark\:ring-white\/10 {
|
|
3138
3078
|
--tw-ring-color: color-mix(in srgb, #fff 10%, transparent);
|
|
3139
3079
|
}
|
|
@@ -3151,14 +3091,6 @@
|
|
|
3151
3091
|
border-color: color-mix(in oklab, var(--color-white) 50%, transparent);
|
|
3152
3092
|
}
|
|
3153
3093
|
}
|
|
3154
|
-
}
|
|
3155
|
-
.dark\:focus-within\:border-white\/20:focus-within {
|
|
3156
|
-
border-color: color-mix(in srgb, #fff 20%, transparent);
|
|
3157
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
3158
|
-
border-color: color-mix(in oklab, var(--color-white) 20%, transparent);
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
@media (hover: hover) {
|
|
3162
3094
|
.dark\:hover\:border-emerald-500\/20:hover {
|
|
3163
3095
|
border-color: color-mix(in srgb, oklch(69.6% 0.17 162.48) 20%, transparent);
|
|
3164
3096
|
}
|
|
@@ -3249,9 +3181,6 @@
|
|
|
3249
3181
|
.dark\:hover\:text-slate-200:hover {
|
|
3250
3182
|
color: var(--color-slate-200);
|
|
3251
3183
|
}
|
|
3252
|
-
.dark\:hover\:text-white:hover {
|
|
3253
|
-
color: var(--color-white);
|
|
3254
|
-
}
|
|
3255
3184
|
.dark\:hover\:text-white\/60:hover {
|
|
3256
3185
|
color: color-mix(in srgb, #fff 60%, transparent);
|
|
3257
3186
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
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, e as ChatViewportSize, R as RemoteConfig } from './index-
|
|
3
|
-
export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './index-
|
|
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, e as ChatViewportSize, R as RemoteConfig } from './index-BKOyhayB.mjs';
|
|
3
|
+
export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './index-BKOyhayB.mjs';
|
|
4
4
|
import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-DO5gj-e5.mjs';
|
|
5
5
|
export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E as EmbedOptions, f as EmbeddingConfig, g as EmbeddingProvider, I as ILLMProvider, h as IngestDocument, L as LLMConfig, i as LLMProvider, j as LatencyBreakdown, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, R as RAGConfig, p as RagConfig, q as RagMessage, r as RetrievalConfig, s as RetrievedChunk, T as ThemeMode, t as TokenUsage, u as UIConfig, v as UniversalRagConfig, w as UpsertDocument, V as VectorDBConfig, x as VectorDBProvider, y as VectorMatch, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-DO5gj-e5.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ChatWidget — Floating Action Button (FAB) that toggles the chat window.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* - Proactively validates on mount to visually lock the widget when no
|
|
13
|
-
* valid license is present (TERMINATED / SUSPENDED / missing)
|
|
14
|
-
* - Manages window resize, maximize, and visual positioning
|
|
15
|
-
* - Shows an error toast when license validation fails on user attempt
|
|
10
|
+
* Initialization is handled entirely by ConfigProvider (validate → /config).
|
|
11
|
+
* ChatWidget reads the resulting context flags to decide its visual state:
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* 4. Environment variables `NEXT_PUBLIC_RETRIVORA_LICENSE_KEY` / `RETRIVORA_LICENSE_KEY`
|
|
13
|
+
* isProjectSettingsLoading → null (invisible while sequence is in-flight)
|
|
14
|
+
* !isLicenseValid → disabled/locked FAB (license expired or invalid)
|
|
15
|
+
* !isConfigLoaded → disabled/locked FAB (/config API failed)
|
|
16
|
+
* both true → active FAB that opens the chat window
|
|
22
17
|
*
|
|
23
|
-
*
|
|
18
|
+
* No additional network calls are made by ChatWidget itself.
|
|
24
19
|
*/
|
|
25
20
|
declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, licenseKey: licenseKeyProp, headers }: ChatWidgetProps): React.JSX.Element | null;
|
|
26
21
|
|
|
@@ -73,6 +68,16 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
|
|
|
73
68
|
* ConfigProvider — React Context that makes RagConfig (UI subset) available
|
|
74
69
|
* to all child components without prop drilling.
|
|
75
70
|
*
|
|
71
|
+
* Initialization sequence (sequential, short-circuits on failure):
|
|
72
|
+
* 1. POST /validate — verify the license key is ACTIVE
|
|
73
|
+
* ↳ If invalid/expired → isLicenseValid=false, isConfigLoaded=false, stop.
|
|
74
|
+
* ChatWidget shows a disabled/locked FAB immediately.
|
|
75
|
+
* 2. GET /config — fetch project credentials & settings (only if step 1 passed)
|
|
76
|
+
* ↳ If fails → isLicenseValid=true, isConfigLoaded=false.
|
|
77
|
+
* ChatWidget shows a disabled FAB (config unavailable).
|
|
78
|
+
* 3. All good → isLicenseValid=true, isConfigLoaded=true.
|
|
79
|
+
* ChatWidget shows the active FAB.
|
|
80
|
+
*
|
|
76
81
|
* Only the UI-safe portions of RagConfig are exposed to the client.
|
|
77
82
|
*/
|
|
78
83
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
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, e as ChatViewportSize, R as RemoteConfig } from './index
|
|
3
|
-
export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './index
|
|
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, e as ChatViewportSize, R as RemoteConfig } from './index-8vijDPfT.js';
|
|
3
|
+
export { A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, i as Chunk, j as ChunkOptions, k as CircuitBreaker, l as CircuitBreakerOptions, m as ConfigFetcher, n as ConfigurationException, o as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, p as IRendererStrategy, q as IntentCategory, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, v as ProviderCredentials, w as ProviderNotFoundException, x as RateLimitException, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, G as RenderDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, U as isTransientError } from './index-8vijDPfT.js';
|
|
4
4
|
import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-DO5gj-e5.js';
|
|
5
5
|
export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E as EmbedOptions, f as EmbeddingConfig, g as EmbeddingProvider, I as ILLMProvider, h as IngestDocument, L as LLMConfig, i as LLMProvider, j as LatencyBreakdown, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, R as RAGConfig, p as RagConfig, q as RagMessage, r as RetrievalConfig, s as RetrievedChunk, T as ThemeMode, t as TokenUsage, u as UIConfig, v as UniversalRagConfig, w as UpsertDocument, V as VectorDBConfig, x as VectorDBProvider, y as VectorMatch, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-DO5gj-e5.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ChatWidget — Floating Action Button (FAB) that toggles the chat window.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* - Proactively validates on mount to visually lock the widget when no
|
|
13
|
-
* valid license is present (TERMINATED / SUSPENDED / missing)
|
|
14
|
-
* - Manages window resize, maximize, and visual positioning
|
|
15
|
-
* - Shows an error toast when license validation fails on user attempt
|
|
10
|
+
* Initialization is handled entirely by ConfigProvider (validate → /config).
|
|
11
|
+
* ChatWidget reads the resulting context flags to decide its visual state:
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* 4. Environment variables `NEXT_PUBLIC_RETRIVORA_LICENSE_KEY` / `RETRIVORA_LICENSE_KEY`
|
|
13
|
+
* isProjectSettingsLoading → null (invisible while sequence is in-flight)
|
|
14
|
+
* !isLicenseValid → disabled/locked FAB (license expired or invalid)
|
|
15
|
+
* !isConfigLoaded → disabled/locked FAB (/config API failed)
|
|
16
|
+
* both true → active FAB that opens the chat window
|
|
22
17
|
*
|
|
23
|
-
*
|
|
18
|
+
* No additional network calls are made by ChatWidget itself.
|
|
24
19
|
*/
|
|
25
20
|
declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, licenseKey: licenseKeyProp, headers }: ChatWidgetProps): React.JSX.Element | null;
|
|
26
21
|
|
|
@@ -73,6 +68,16 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
|
|
|
73
68
|
* ConfigProvider — React Context that makes RagConfig (UI subset) available
|
|
74
69
|
* to all child components without prop drilling.
|
|
75
70
|
*
|
|
71
|
+
* Initialization sequence (sequential, short-circuits on failure):
|
|
72
|
+
* 1. POST /validate — verify the license key is ACTIVE
|
|
73
|
+
* ↳ If invalid/expired → isLicenseValid=false, isConfigLoaded=false, stop.
|
|
74
|
+
* ChatWidget shows a disabled/locked FAB immediately.
|
|
75
|
+
* 2. GET /config — fetch project credentials & settings (only if step 1 passed)
|
|
76
|
+
* ↳ If fails → isLicenseValid=true, isConfigLoaded=false.
|
|
77
|
+
* ChatWidget shows a disabled FAB (config unavailable).
|
|
78
|
+
* 3. All good → isLicenseValid=true, isConfigLoaded=true.
|
|
79
|
+
* ChatWidget shows the active FAB.
|
|
80
|
+
*
|
|
76
81
|
* Only the UI-safe portions of RagConfig are exposed to the client.
|
|
77
82
|
*/
|
|
78
83
|
|