@retrivora-ai/rag-engine 2.5.6 → 2.5.8

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/index.d.mts CHANGED
@@ -1,8 +1,8 @@
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';
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
- 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';
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-CAGGPyI7.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-CAGGPyI7.mjs';
4
+ import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-B2N3lMBc.mjs';
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-B2N3lMBc.mjs';
6
6
 
7
7
  /**
8
8
  * ChatWidget — Floating Action Button (FAB) that toggles the chat window.
@@ -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, uploadUrl, 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, uploadUrl, 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 };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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-DP3_OpuB.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-DP3_OpuB.js';
4
- import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-DwFj0h2u.js';
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.js';
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-DdQxoIpu.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-DdQxoIpu.js';
4
+ import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-B2N3lMBc.js';
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-B2N3lMBc.js';
6
6
 
7
7
  /**
8
8
  * ChatWidget — Floating Action Button (FAB) that toggles the chat window.
@@ -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, uploadUrl, 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, uploadUrl, 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 };