@retrivora-ai/rag-engine 2.5.6 → 2.5.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 (45) hide show
  1. package/dist/ChromaDBProvider-4RPJN7Y3.mjs +8 -0
  2. package/dist/MilvusProvider-WJLLZ6TW.mjs +8 -0
  3. package/dist/MongoDBProvider-QSERELZX.mjs +8 -0
  4. package/dist/MultiTablePostgresProvider-JF2HEUDZ.mjs +9 -0
  5. package/dist/PineconeProvider-HLZL7HKU.mjs +10 -0
  6. package/dist/PostgreSQLProvider-JQMCNHRO.mjs +8 -0
  7. package/dist/QdrantProvider-6MNFPEVC.mjs +8 -0
  8. package/dist/RedisProvider-ERQL6AEB.mjs +8 -0
  9. package/dist/SimpleGraphProvider-OP3HAJJM.mjs +70 -0
  10. package/dist/UniversalVectorProvider-INM3KH5F.mjs +9 -0
  11. package/dist/WeaviateProvider-VHWWICCC.mjs +8 -0
  12. package/dist/chunk-366EFBZC.mjs +165 -0
  13. package/dist/chunk-6MGVQTU4.mjs +8883 -0
  14. package/dist/chunk-B4AXIUM7.mjs +49 -0
  15. package/dist/chunk-BEPLYQBS.mjs +89 -0
  16. package/dist/chunk-BNOPQCZW.mjs +238 -0
  17. package/dist/chunk-FJ43J4FW.mjs +654 -0
  18. package/dist/chunk-GP2AJQRQ.mjs +107 -0
  19. package/dist/chunk-IMP6FUCY.mjs +30 -0
  20. package/dist/chunk-JRQWSJNF.mjs +202 -0
  21. package/dist/chunk-LYHCKUNF.mjs +112 -0
  22. package/dist/chunk-MFIWWUC7.mjs +152 -0
  23. package/dist/chunk-MWICNCB2.mjs +157 -0
  24. package/dist/chunk-N54YTFBN.mjs +76 -0
  25. package/dist/chunk-POOWU2HR.mjs +211 -0
  26. package/dist/chunk-QGDGPOZH.mjs +217 -0
  27. package/dist/chunk-QI3FTN6G.mjs +281 -0
  28. package/dist/chunk-QJIDGVG6.mjs +334 -0
  29. package/dist/chunk-W2DKVD3G.mjs +81 -0
  30. package/dist/chunk-XHSDHPKI.mjs +336 -0
  31. package/dist/handlers/index.js +1 -1
  32. package/dist/handlers/index.mjs +24 -12052
  33. package/dist/{index-Byv5MaYi.d.mts → index-9h_ENWQn.d.mts} +16 -0
  34. package/dist/{index-DP3_OpuB.d.ts → index-Xci6GfpI.d.ts} +16 -0
  35. package/dist/index.css +112 -0
  36. package/dist/index.d.mts +176 -18
  37. package/dist/index.d.ts +176 -18
  38. package/dist/index.js +602 -104
  39. package/dist/index.min.css +1 -1
  40. package/dist/index.mjs +648 -1534
  41. package/dist/server.d.mts +2 -2
  42. package/dist/server.d.ts +2 -2
  43. package/dist/server.js +1 -1
  44. package/dist/server.mjs +372 -12608
  45. package/package.json +2 -2
@@ -65,6 +65,12 @@ interface ChatWindowProps {
65
65
  sessionId?: string;
66
66
  /** Whether to show the ChatGPT-style sidebar history management and new chat controls */
67
67
  showHistory?: boolean;
68
+ /** Whether to enable voice input (microphone) and voice output (readout) (default: true) */
69
+ enableVoice?: boolean;
70
+ /** Whether new assistant responses should automatically read aloud when received (default: false) */
71
+ autoSpeak?: boolean;
72
+ /** Language for speech recognition and synthesis (default: browser language or 'en-US') */
73
+ voiceLang?: string;
68
74
  }
69
75
  interface ChatWidgetProps {
70
76
  /** Position of the floating button. Defaults to bottom-right. */
@@ -82,6 +88,12 @@ interface ChatWidgetProps {
82
88
  licenseKey?: string;
83
89
  /** Optional custom headers to send with the chat request */
84
90
  headers?: Record<string, string>;
91
+ /** Whether to enable voice input and readout in the embedded chat window (default: true) */
92
+ enableVoice?: boolean;
93
+ /** Whether assistant responses read aloud automatically (default: false) */
94
+ autoSpeak?: boolean;
95
+ /** Language for voice input and readout */
96
+ voiceLang?: string;
85
97
  }
86
98
  interface MessageBubbleProps {
87
99
  message: RagMessage;
@@ -95,6 +107,10 @@ interface MessageBubbleProps {
95
107
  showSources?: boolean;
96
108
  /** Called when the user clicks thumbs up or thumbs down on an assistant message */
97
109
  onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void;
110
+ /** Whether this message is currently being read aloud via Text-to-Speech */
111
+ isSpeaking?: boolean;
112
+ /** Called when the user clicks the speaker icon to play or stop voice readout */
113
+ onToggleSpeak?: (text: string, messageId: string) => void;
98
114
  }
99
115
  interface ProductCardProps {
100
116
  product: Product;
@@ -65,6 +65,12 @@ interface ChatWindowProps {
65
65
  sessionId?: string;
66
66
  /** Whether to show the ChatGPT-style sidebar history management and new chat controls */
67
67
  showHistory?: boolean;
68
+ /** Whether to enable voice input (microphone) and voice output (readout) (default: true) */
69
+ enableVoice?: boolean;
70
+ /** Whether new assistant responses should automatically read aloud when received (default: false) */
71
+ autoSpeak?: boolean;
72
+ /** Language for speech recognition and synthesis (default: browser language or 'en-US') */
73
+ voiceLang?: string;
68
74
  }
69
75
  interface ChatWidgetProps {
70
76
  /** Position of the floating button. Defaults to bottom-right. */
@@ -82,6 +88,12 @@ interface ChatWidgetProps {
82
88
  licenseKey?: string;
83
89
  /** Optional custom headers to send with the chat request */
84
90
  headers?: Record<string, string>;
91
+ /** Whether to enable voice input and readout in the embedded chat window (default: true) */
92
+ enableVoice?: boolean;
93
+ /** Whether assistant responses read aloud automatically (default: false) */
94
+ autoSpeak?: boolean;
95
+ /** Language for voice input and readout */
96
+ voiceLang?: string;
85
97
  }
86
98
  interface MessageBubbleProps {
87
99
  message: RagMessage;
@@ -95,6 +107,10 @@ interface MessageBubbleProps {
95
107
  showSources?: boolean;
96
108
  /** Called when the user clicks thumbs up or thumbs down on an assistant message */
97
109
  onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void;
110
+ /** Whether this message is currently being read aloud via Text-to-Speech */
111
+ isSpeaking?: boolean;
112
+ /** Called when the user clicks the speaker icon to play or stop voice readout */
113
+ onToggleSpeak?: (text: string, messageId: string) => void;
98
114
  }
99
115
  interface ProductCardProps {
100
116
  product: Product;
package/dist/index.css CHANGED
@@ -97,6 +97,7 @@
97
97
  --color-rose-400: oklch(71.2% 0.194 13.428);
98
98
  --color-rose-500: oklch(64.5% 0.246 16.439);
99
99
  --color-rose-600: oklch(58.6% 0.253 17.585);
100
+ --color-rose-700: oklch(51.4% 0.222 16.935);
100
101
  --color-rose-800: oklch(45.5% 0.188 13.697);
101
102
  --color-rose-900: oklch(41% 0.159 10.272);
102
103
  --color-rose-950: oklch(27.1% 0.105 12.094);
@@ -514,6 +515,9 @@
514
515
  .mb-2 {
515
516
  margin-bottom: calc(var(--spacing) * 2);
516
517
  }
518
+ .mb-2\.5 {
519
+ margin-bottom: calc(var(--spacing) * 2.5);
520
+ }
517
521
  .mb-3 {
518
522
  margin-bottom: calc(var(--spacing) * 3);
519
523
  }
@@ -577,6 +581,9 @@
577
581
  .hidden {
578
582
  display: none;
579
583
  }
584
+ .inline {
585
+ display: inline;
586
+ }
580
587
  .inline-block {
581
588
  display: inline-block;
582
589
  }
@@ -631,6 +638,9 @@
631
638
  .h-10 {
632
639
  height: calc(var(--spacing) * 10);
633
640
  }
641
+ .h-11 {
642
+ height: calc(var(--spacing) * 11);
643
+ }
634
644
  .h-12 {
635
645
  height: calc(var(--spacing) * 12);
636
646
  }
@@ -724,6 +734,9 @@
724
734
  .w-9 {
725
735
  width: calc(var(--spacing) * 9);
726
736
  }
737
+ .w-11 {
738
+ width: calc(var(--spacing) * 11);
739
+ }
727
740
  .w-12 {
728
741
  width: calc(var(--spacing) * 12);
729
742
  }
@@ -751,6 +764,9 @@
751
764
  .w-64 {
752
765
  width: calc(var(--spacing) * 64);
753
766
  }
767
+ .w-\[3px\] {
768
+ width: 3px;
769
+ }
754
770
  .w-\[400\%\] {
755
771
  width: 400%;
756
772
  }
@@ -860,6 +876,12 @@
860
876
  --tw-scale-z: 100%;
861
877
  scale: var(--tw-scale-x) var(--tw-scale-y);
862
878
  }
879
+ .scale-105 {
880
+ --tw-scale-x: 105%;
881
+ --tw-scale-y: 105%;
882
+ --tw-scale-z: 105%;
883
+ scale: var(--tw-scale-x) var(--tw-scale-y);
884
+ }
863
885
  .scale-110 {
864
886
  --tw-scale-x: 110%;
865
887
  --tw-scale-y: 110%;
@@ -982,6 +1004,9 @@
982
1004
  .gap-4 {
983
1005
  gap: calc(var(--spacing) * 4);
984
1006
  }
1007
+ .gap-\[2px\] {
1008
+ gap: 2px;
1009
+ }
985
1010
  :where(.space-y-0\.5 > :not(:last-child)) {
986
1011
  --tw-space-y-reverse: 0;
987
1012
  margin-block-start: calc(calc(var(--spacing) * 0.5) * var(--tw-space-y-reverse));
@@ -1158,6 +1183,9 @@
1158
1183
  .border-indigo-200 {
1159
1184
  border-color: var(--color-indigo-200);
1160
1185
  }
1186
+ .border-indigo-300 {
1187
+ border-color: var(--color-indigo-300);
1188
+ }
1161
1189
  .border-indigo-500 {
1162
1190
  border-color: var(--color-indigo-500);
1163
1191
  }
@@ -1814,6 +1842,9 @@
1814
1842
  .text-rose-600 {
1815
1843
  color: var(--color-rose-600);
1816
1844
  }
1845
+ .text-rose-700 {
1846
+ color: var(--color-rose-700);
1847
+ }
1817
1848
  .text-slate-100 {
1818
1849
  color: var(--color-slate-100);
1819
1850
  }
@@ -1885,6 +1916,9 @@
1885
1916
  .opacity-30 {
1886
1917
  opacity: 30%;
1887
1918
  }
1919
+ .opacity-40 {
1920
+ opacity: 40%;
1921
+ }
1888
1922
  .opacity-60 {
1889
1923
  opacity: 60%;
1890
1924
  }
@@ -1929,6 +1963,18 @@
1929
1963
  --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-rose-500) 20%, transparent) var(--tw-shadow-alpha), transparent);
1930
1964
  }
1931
1965
  }
1966
+ .ring-red-400\/40 {
1967
+ --tw-ring-color: color-mix(in srgb, oklch(70.4% 0.191 22.216) 40%, transparent);
1968
+ @supports (color: color-mix(in lab, red, red)) {
1969
+ --tw-ring-color: color-mix(in oklab, var(--color-red-400) 40%, transparent);
1970
+ }
1971
+ }
1972
+ .ring-rose-400\/50 {
1973
+ --tw-ring-color: color-mix(in srgb, oklch(71.2% 0.194 13.428) 50%, transparent);
1974
+ @supports (color: color-mix(in lab, red, red)) {
1975
+ --tw-ring-color: color-mix(in oklab, var(--color-rose-400) 50%, transparent);
1976
+ }
1977
+ }
1932
1978
  .ring-slate-200\/80 {
1933
1979
  --tw-ring-color: color-mix(in srgb, oklch(92.9% 0.013 255.508) 80%, transparent);
1934
1980
  @supports (color: color-mix(in lab, red, red)) {
@@ -2095,6 +2141,9 @@
2095
2141
  .hover\:border-emerald-200:hover {
2096
2142
  border-color: var(--color-emerald-200);
2097
2143
  }
2144
+ .hover\:border-indigo-200:hover {
2145
+ border-color: var(--color-indigo-200);
2146
+ }
2098
2147
  .hover\:border-rose-200:hover {
2099
2148
  border-color: var(--color-rose-200);
2100
2149
  }
@@ -2115,9 +2164,15 @@
2115
2164
  .hover\:bg-emerald-50:hover {
2116
2165
  background-color: var(--color-emerald-50);
2117
2166
  }
2167
+ .hover\:bg-indigo-50:hover {
2168
+ background-color: var(--color-indigo-50);
2169
+ }
2118
2170
  .hover\:bg-rose-50:hover {
2119
2171
  background-color: var(--color-rose-50);
2120
2172
  }
2173
+ .hover\:bg-rose-100:hover {
2174
+ background-color: var(--color-rose-100);
2175
+ }
2121
2176
  .hover\:bg-rose-600:hover {
2122
2177
  background-color: var(--color-rose-600);
2123
2178
  }
@@ -2180,6 +2235,9 @@
2180
2235
  .hover\:text-indigo-500:hover {
2181
2236
  color: var(--color-indigo-500);
2182
2237
  }
2238
+ .hover\:text-indigo-600:hover {
2239
+ color: var(--color-indigo-600);
2240
+ }
2183
2241
  .hover\:text-rose-500:hover {
2184
2242
  color: var(--color-rose-500);
2185
2243
  }
@@ -2271,6 +2329,9 @@
2271
2329
  scale: var(--tw-scale-x) var(--tw-scale-y);
2272
2330
  }
2273
2331
  @media (width >= 40rem) {
2332
+ .sm\:inline {
2333
+ display: inline;
2334
+ }
2274
2335
  .sm\:grid-cols-2 {
2275
2336
  grid-template-columns: repeat(2, minmax(0, 1fr));
2276
2337
  }
@@ -2362,6 +2423,14 @@
2362
2423
  border-color: color-mix(in oklab, var(--color-indigo-500) 20%, transparent);
2363
2424
  }
2364
2425
  }
2426
+ .dark\:border-indigo-500\/40 {
2427
+ border-color: color-mix(in srgb, oklch(58.5% 0.233 277.117) 40%, transparent);
2428
+ }
2429
+ @supports (color: color-mix(in lab, red, red)) {
2430
+ .dark\:border-indigo-500\/40 {
2431
+ border-color: color-mix(in oklab, var(--color-indigo-500) 40%, transparent);
2432
+ }
2433
+ }
2365
2434
  .dark\:border-red-500\/20 {
2366
2435
  border-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 20%, transparent);
2367
2436
  }
@@ -2645,6 +2714,14 @@
2645
2714
  background-color: color-mix(in oklab, var(--color-indigo-500) 10%, transparent);
2646
2715
  }
2647
2716
  }
2717
+ .dark\:bg-indigo-500\/20 {
2718
+ background-color: color-mix(in srgb, oklch(58.5% 0.233 277.117) 20%, transparent);
2719
+ }
2720
+ @supports (color: color-mix(in lab, red, red)) {
2721
+ .dark\:bg-indigo-500\/20 {
2722
+ background-color: color-mix(in oklab, var(--color-indigo-500) 20%, transparent);
2723
+ }
2724
+ }
2648
2725
  .dark\:bg-indigo-700\/40 {
2649
2726
  background-color: color-mix(in srgb, oklch(45.7% 0.24 277.023) 40%, transparent);
2650
2727
  }
@@ -2781,6 +2858,14 @@
2781
2858
  background-color: color-mix(in oklab, var(--color-rose-950) 20%, transparent);
2782
2859
  }
2783
2860
  }
2861
+ .dark\:bg-rose-950\/30 {
2862
+ background-color: color-mix(in srgb, oklch(27.1% 0.105 12.094) 30%, transparent);
2863
+ }
2864
+ @supports (color: color-mix(in lab, red, red)) {
2865
+ .dark\:bg-rose-950\/30 {
2866
+ background-color: color-mix(in oklab, var(--color-rose-950) 30%, transparent);
2867
+ }
2868
+ }
2784
2869
  .dark\:bg-slate-700 {
2785
2870
  background-color: var(--color-slate-700);
2786
2871
  }
@@ -3099,6 +3184,14 @@
3099
3184
  border-color: color-mix(in oklab, var(--color-emerald-500) 20%, transparent);
3100
3185
  }
3101
3186
  }
3187
+ .dark\:hover\:border-indigo-500\/20:hover {
3188
+ border-color: color-mix(in srgb, oklch(58.5% 0.233 277.117) 20%, transparent);
3189
+ }
3190
+ @supports (color: color-mix(in lab, red, red)) {
3191
+ .dark\:hover\:border-indigo-500\/20:hover {
3192
+ border-color: color-mix(in oklab, var(--color-indigo-500) 20%, transparent);
3193
+ }
3194
+ }
3102
3195
  .dark\:hover\:border-rose-500\/20:hover {
3103
3196
  border-color: color-mix(in srgb, oklch(64.5% 0.246 16.439) 20%, transparent);
3104
3197
  }
@@ -3131,6 +3224,14 @@
3131
3224
  background-color: color-mix(in oklab, var(--color-emerald-500) 10%, transparent);
3132
3225
  }
3133
3226
  }
3227
+ .dark\:hover\:bg-indigo-500\/10:hover {
3228
+ background-color: color-mix(in srgb, oklch(58.5% 0.233 277.117) 10%, transparent);
3229
+ }
3230
+ @supports (color: color-mix(in lab, red, red)) {
3231
+ .dark\:hover\:bg-indigo-500\/10:hover {
3232
+ background-color: color-mix(in oklab, var(--color-indigo-500) 10%, transparent);
3233
+ }
3234
+ }
3134
3235
  .dark\:hover\:bg-rose-500\/10:hover {
3135
3236
  background-color: color-mix(in srgb, oklch(64.5% 0.246 16.439) 10%, transparent);
3136
3237
  }
@@ -3139,6 +3240,14 @@
3139
3240
  background-color: color-mix(in oklab, var(--color-rose-500) 10%, transparent);
3140
3241
  }
3141
3242
  }
3243
+ .dark\:hover\:bg-rose-900\/40:hover {
3244
+ background-color: color-mix(in srgb, oklch(41% 0.159 10.272) 40%, transparent);
3245
+ }
3246
+ @supports (color: color-mix(in lab, red, red)) {
3247
+ .dark\:hover\:bg-rose-900\/40:hover {
3248
+ background-color: color-mix(in oklab, var(--color-rose-900) 40%, transparent);
3249
+ }
3250
+ }
3142
3251
  .dark\:hover\:bg-white\/5:hover {
3143
3252
  background-color: color-mix(in srgb, #fff 5%, transparent);
3144
3253
  }
@@ -3181,6 +3290,9 @@
3181
3290
  .dark\:hover\:text-slate-200:hover {
3182
3291
  color: var(--color-slate-200);
3183
3292
  }
3293
+ .dark\:hover\:text-white:hover {
3294
+ color: var(--color-white);
3295
+ }
3184
3296
  .dark\:hover\:text-white\/60:hover {
3185
3297
  color: color-mix(in srgb, #fff 60%, transparent);
3186
3298
  }
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
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-Byv5MaYi.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-Byv5MaYi.mjs';
1
+ import React$1 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-9h_ENWQn.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-9h_ENWQn.mjs';
4
4
  import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-DwFj0h2u.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-DwFj0h2u.mjs';
6
6
 
@@ -17,7 +17,7 @@ export { A as AuthMode, C as ChatMessage, d as ChatOptions, e as ChatResponse, E
17
17
  *
18
18
  * No additional network calls are made by ChatWidget itself.
19
19
  */
20
- declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, licenseKey: licenseKeyProp, headers }: ChatWidgetProps): React.JSX.Element | null;
20
+ declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, licenseKey: licenseKeyProp, headers, enableVoice, autoSpeak, voiceLang, }: ChatWidgetProps): React$1.JSX.Element | null;
21
21
 
22
22
  /**
23
23
  * ChatWindow — The primary chat interface container component.
@@ -50,19 +50,19 @@ declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, l
50
50
  * @param licenseKey - Override license key (highest priority; falls back to headers/env).
51
51
  * @param headers - Custom headers forwarded with every network request.
52
52
  */
53
- declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, retrivoraApiBase, licenseKey: licenseKeyProp, headers, sessionId: sessionIdProp, showHistory, }: ChatWindowProps): React.JSX.Element;
53
+ declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, retrivoraApiBase, licenseKey: licenseKeyProp, headers, sessionId: sessionIdProp, showHistory, enableVoice, autoSpeak: autoSpeakProp, voiceLang, }: ChatWindowProps): React$1.JSX.Element;
54
54
 
55
- declare function DocumentUpload({ namespace, uploadUrl, retrivoraApiBase, onUploadComplete, className }: DocumentUploadProps): React.JSX.Element;
55
+ declare function DocumentUpload({ namespace, uploadUrl, retrivoraApiBase, onUploadComplete, className }: DocumentUploadProps): React$1.JSX.Element;
56
56
 
57
- declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, showSources: showSourcesProp, onFeedback, }: MessageBubbleProps): React.JSX.Element;
57
+ declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, showSources: showSourcesProp, onFeedback, isSpeaking, onToggleSpeak, }: MessageBubbleProps): React$1.JSX.Element;
58
58
 
59
- declare function SourceCard({ source, index }: SourceCardProps): React.JSX.Element;
59
+ declare function SourceCard({ source, index }: SourceCardProps): React$1.JSX.Element;
60
60
 
61
61
  interface ObservabilityPanelProps {
62
62
  trace: ObservabilityTrace;
63
63
  primaryColor?: string;
64
64
  }
65
- declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelProps): React.JSX.Element;
65
+ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelProps): React$1.JSX.Element;
66
66
 
67
67
  /**
68
68
  * ConfigProvider — React Context that makes RagConfig (UI subset) available
@@ -81,7 +81,7 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
81
81
  * Only the UI-safe portions of RagConfig are exposed to the client.
82
82
  */
83
83
 
84
- declare function ConfigProvider({ config, children, }: ConfigProviderProps): React.JSX.Element;
84
+ declare function ConfigProvider({ config, children, }: ConfigProviderProps): React$1.JSX.Element;
85
85
  declare function useConfig(): ClientConfig;
86
86
 
87
87
  interface Snippet {
@@ -94,11 +94,11 @@ interface Snippet {
94
94
 
95
95
  declare function CodeViewer({ snippet }: {
96
96
  snippet: Snippet;
97
- }): React.JSX.Element;
97
+ }): React$1.JSX.Element;
98
98
 
99
- declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCardProps): React.JSX.Element;
99
+ declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCardProps): React$1.JSX.Element;
100
100
 
101
- declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): React.JSX.Element | null;
101
+ declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): React$1.JSX.Element | null;
102
102
 
103
103
  declare function UIDispatcher({ rawContent, primaryColor, accentColor, isStreaming, onAddToCart, viewportSize }: {
104
104
  rawContent: string;
@@ -107,7 +107,7 @@ declare function UIDispatcher({ rawContent, primaryColor, accentColor, isStreami
107
107
  isStreaming?: boolean;
108
108
  onAddToCart?: (product: Product) => void;
109
109
  viewportSize?: ChatViewportSize;
110
- }): React.JSX.Element | null;
110
+ }): React$1.JSX.Element | null;
111
111
 
112
112
  interface VisualizationRendererProps {
113
113
  data: UITransformationResponse;
@@ -129,7 +129,7 @@ interface VisualizationRendererProps {
129
129
  * const transformation = await UITransformer.analyzeAndDecide(query, sources, llm);
130
130
  * return <VisualizationRenderer data={transformation} />;
131
131
  */
132
- declare function VisualizationRenderer({ data, className, primaryColor, onAddToCart, isStreaming, }: VisualizationRendererProps): React.JSX.Element;
132
+ declare function VisualizationRenderer({ data, className, primaryColor, onAddToCart, isStreaming, }: VisualizationRendererProps): React$1.JSX.Element;
133
133
 
134
134
  interface UIBlock {
135
135
  view: 'carousel' | 'table' | 'chart' | 'form' | 'actions' | string;
@@ -158,7 +158,7 @@ interface UIBlock {
158
158
  }
159
159
  interface UIBlockRendererProps {
160
160
  block: UIBlock | unknown;
161
- customRenderers?: Record<string, (data: any) => React.ReactNode>;
161
+ customRenderers?: Record<string, (data: any) => React$1.ReactNode>;
162
162
  primaryColor?: string;
163
163
  accentColor?: string;
164
164
  onAddToCart?: (product: Product) => void;
@@ -166,7 +166,110 @@ interface UIBlockRendererProps {
166
166
  onFormSubmit?: (formData: Record<string, any>) => void | Promise<void>;
167
167
  isStreaming?: boolean;
168
168
  }
169
- declare function UIBlockRenderer({ block, customRenderers, primaryColor, accentColor, onAddToCart, onActionTriggered, onFormSubmit, isStreaming, }: UIBlockRendererProps): React.JSX.Element | null;
169
+ declare function UIBlockRenderer({ block, customRenderers, primaryColor, accentColor, onAddToCart, onActionTriggered, onFormSubmit, isStreaming, }: UIBlockRendererProps): React$1.JSX.Element | null;
170
+
171
+ /**
172
+ * VoiceButton — Standalone mic (STT) or speaker (TTS) control button.
173
+ *
174
+ * A self-contained, individually composable voice control that developers can
175
+ * drop into any custom chat UI without needing to use ChatWindow. It renders
176
+ * a single icon button styled for light or dark surfaces.
177
+ *
178
+ * Usage:
179
+ * <VoiceButton mode="mic" isListening={isListening} onToggleListening={toggleListening} isSupported={isSupportedSTT} />
180
+ * <VoiceButton mode="speaker" isSpeaking={isSpeaking} onToggleSpeaking={stopSpeaking} />
181
+ */
182
+
183
+ interface VoiceButtonProps {
184
+ /** Which voice control to render: 'mic' for Speech-to-Text, 'speaker' for Text-to-Speech */
185
+ mode: 'mic' | 'speaker';
186
+ /** Whether the microphone is currently recording */
187
+ isListening?: boolean;
188
+ /** Called when the button is clicked to toggle mic on/off */
189
+ onToggleListening?: () => void;
190
+ /** Whether Speech Recognition is supported in this browser (hides button if false) */
191
+ isSupported?: boolean;
192
+ /** Whether audio is currently being spoken */
193
+ isSpeaking?: boolean;
194
+ /** Called when the button is clicked to toggle speaking on/off */
195
+ onToggleSpeaking?: () => void;
196
+ /** Disable the button (e.g. while the AI is generating a response) */
197
+ disabled?: boolean;
198
+ /** Primary brand colour used for the active state */
199
+ primaryColor?: string;
200
+ /** Size variant: 'sm' = 28px, 'md' = 36px (default), 'lg' = 44px */
201
+ size?: 'sm' | 'md' | 'lg';
202
+ /** Additional className applied to the outer button element */
203
+ className?: string;
204
+ /** Override tooltip label shown on hover */
205
+ title?: string;
206
+ }
207
+ declare function VoiceButton({ mode, isListening, onToggleListening, isSupported, isSpeaking, onToggleSpeaking, disabled, primaryColor, size, className, title, }: VoiceButtonProps): React$1.JSX.Element;
208
+
209
+ /**
210
+ * VoiceBar — Pre-built combined voice control strip for custom chat UIs.
211
+ *
212
+ * Encapsulates the useVoice hook and renders a ready-to-use horizontal bar with:
213
+ * 🎤 Mic toggle (Speech-to-Text) — delivers final transcript via onTranscript
214
+ * 🔊 Auto-speak toggle — when enabled, any text passed via autoSpeakText is read aloud
215
+ * as soon as a new generation completes (consumer drives this via the prop)
216
+ * 📢 Live speaking indicator with animated sound-wave bars when TTS is active
217
+ *
218
+ * Designed to be embedded into custom layouts without ChatWindow. The consumer
219
+ * is responsible for connecting the transcript output to their own input state.
220
+ *
221
+ * @example
222
+ * ```tsx
223
+ * function MyChatUI() {
224
+ * const [input, setInput] = useState('');
225
+ * const [lastResponse, setLastResponse] = useState('');
226
+ *
227
+ * return (
228
+ * <>
229
+ * <MyChatMessages />
230
+ * <VoiceBar
231
+ * onTranscript={(text) => setInput(prev => prev + ' ' + text)}
232
+ * autoSpeakText={lastResponse}
233
+ * primaryColor="#6366f1"
234
+ * />
235
+ * <MyTextInput value={input} onChange={setInput} />
236
+ * </>
237
+ * );
238
+ * }
239
+ * ```
240
+ */
241
+
242
+ interface VoiceBarProps {
243
+ /** Called with the final STT transcript text — wire this to your input state */
244
+ onTranscript?: (text: string) => void;
245
+ /** Called with interim (in-progress) recognition text for live display */
246
+ onInterimResult?: (text: string) => void;
247
+ /** Called on STT or TTS error */
248
+ onError?: (error: string) => void;
249
+ /**
250
+ * Text to automatically read aloud when autoSpeak is enabled.
251
+ * Pass the latest assistant response here; VoiceBar reads it when the value changes.
252
+ * VoiceBar tracks changes with a ref so only NEW values trigger TTS.
253
+ */
254
+ autoSpeakText?: string;
255
+ /** Language for STT recognition and TTS synthesis (default: browser language) */
256
+ lang?: string;
257
+ /** Whether auto-speak starts enabled (default: false) */
258
+ defaultAutoSpeak?: boolean;
259
+ /** Disable all controls (e.g. while the AI is generating) */
260
+ disabled?: boolean;
261
+ /** Primary brand color for active states and the speaking indicator */
262
+ primaryColor?: string;
263
+ /** Accent color used in the speaking waveform gradient */
264
+ accentColor?: string;
265
+ /** Whether to show the auto-speak toggle button (default: true) */
266
+ showAutoSpeakToggle?: boolean;
267
+ /** Whether to show the live speaking status badge (default: true) */
268
+ showSpeakingIndicator?: boolean;
269
+ /** Additional className for the outer container div */
270
+ className?: string;
271
+ }
272
+ declare function VoiceBar({ onTranscript, onInterimResult, onError, autoSpeakText, lang, defaultAutoSpeak, disabled, primaryColor, accentColor, showAutoSpeakToggle, showSpeakingIndicator, className, }: VoiceBarProps): React$1.JSX.Element | null;
170
273
 
171
274
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
172
275
 
@@ -184,10 +287,65 @@ interface UseProjectSettingsReturn {
184
287
  }
185
288
  declare function useProjectSettings(projectId: string, options?: UseProjectSettingsOptions): UseProjectSettingsReturn;
186
289
 
290
+ interface UseVoiceOptions {
291
+ /** Language for speech recognition and synthesis (default: browser language or 'en-US') */
292
+ lang?: string;
293
+ /** Whether auto-read responses is enabled by default */
294
+ autoSpeak?: boolean;
295
+ /** Speech synthesis pitch (0.5 to 2, default: 1) */
296
+ pitch?: number;
297
+ /** Speech synthesis rate / speed (0.5 to 2, default: 1) */
298
+ rate?: number;
299
+ /** Called when a final speech recognition transcript is produced */
300
+ onTranscript?: (text: string) => void;
301
+ /** Called when speech recognition produces interim text */
302
+ onInterimResult?: (text: string) => void;
303
+ /** Called when speech error occurs */
304
+ onError?: (error: string) => void;
305
+ }
306
+ interface UseVoiceReturn {
307
+ /** Whether Speech Recognition is supported in the current browser */
308
+ isSupportedSTT: boolean;
309
+ /** Whether Speech Synthesis is supported in the current browser */
310
+ isSupportedTTS: boolean;
311
+ /** Whether the microphone is currently listening */
312
+ isListening: boolean;
313
+ /** Current transcript collected during the current listening session */
314
+ transcript: string;
315
+ /** Start microphone speech recognition */
316
+ startListening: (overrideLang?: string) => void;
317
+ /** Stop microphone speech recognition */
318
+ stopListening: () => void;
319
+ /** Toggle listening state */
320
+ toggleListening: () => void;
321
+ /** Whether audio is currently being spoken */
322
+ isSpeaking: boolean;
323
+ /** ID of the message currently being spoken via TTS */
324
+ currentlySpeakingId: string | null;
325
+ /** Whether newly generated assistant replies should automatically read aloud */
326
+ autoSpeak: boolean;
327
+ /** Set or toggle autoSpeak setting */
328
+ setAutoSpeak: React.Dispatch<React.SetStateAction<boolean>>;
329
+ /** Toggle autoSpeak */
330
+ toggleAutoSpeak: () => void;
331
+ /** Speak a text string (automatically cleans markdown before speaking) */
332
+ speak: (text: string, messageId?: string) => void;
333
+ /** Stop any currently active speech synthesis readout */
334
+ stopSpeaking: () => void;
335
+ /** Toggle speaking for a specific text/messageId */
336
+ toggleSpeak: (text: string, messageId?: string) => void;
337
+ }
338
+ /**
339
+ * Strip Markdown tags, code blocks, links, and formatting symbols
340
+ * to produce clean natural prose for Speech Synthesis readout.
341
+ */
342
+ declare function cleanMarkdownForSpeech(raw: string): string;
343
+ declare function useVoice(options?: UseVoiceOptions): UseVoiceReturn;
344
+
187
345
  /**
188
346
  * Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
189
347
  * You can call this during your app initialization to support custom schema fields.
190
348
  */
191
349
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
192
350
 
193
- 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 };
351
+ 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, type UseVoiceOptions, type UseVoiceReturn, VisualizationRenderer, VoiceBar, type VoiceBarProps, VoiceButton, type VoiceButtonProps, addSynonyms, cleanMarkdownForSpeech, useConfig, useProjectSettings, useRagChat, useVoice };