@retrivora-ai/rag-engine 2.4.5 → 2.4.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.
@@ -1,5 +1,5 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { n as RagConfig, I as ILLMProvider, C as ChatMessage, c as ChatResponse, f as IngestDocument } from './ILLMProvider-Y6aL5N8J.mjs';
2
+ import { p as RagConfig, I as ILLMProvider, C as ChatMessage, e as ChatResponse, h as IngestDocument } from './ILLMProvider-BYQd0Nys.mjs';
3
3
 
4
4
  interface ValidationError {
5
5
  field: string;
@@ -1,5 +1,5 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { n as RagConfig, I as ILLMProvider, C as ChatMessage, c as ChatResponse, f as IngestDocument } from './ILLMProvider-Y6aL5N8J.js';
2
+ import { p as RagConfig, I as ILLMProvider, C as ChatMessage, e as ChatResponse, h as IngestDocument } from './ILLMProvider-BYQd0Nys.js';
3
3
 
4
4
  interface ValidationError {
5
5
  field: string;
package/dist/index.css CHANGED
@@ -630,6 +630,9 @@
630
630
  .h-9 {
631
631
  height: calc(var(--spacing) * 9);
632
632
  }
633
+ .h-10 {
634
+ height: calc(var(--spacing) * 10);
635
+ }
633
636
  .h-12 {
634
637
  height: calc(var(--spacing) * 12);
635
638
  }
@@ -1519,6 +1522,9 @@
1519
1522
  .p-4 {
1520
1523
  padding: calc(var(--spacing) * 4);
1521
1524
  }
1525
+ .p-5 {
1526
+ padding: calc(var(--spacing) * 5);
1527
+ }
1522
1528
  .p-6 {
1523
1529
  padding: calc(var(--spacing) * 6);
1524
1530
  }
@@ -1999,6 +2005,11 @@
1999
2005
  -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
2000
2006
  backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
2001
2007
  }
2008
+ .transition {
2009
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
2010
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
2011
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
2012
+ }
2002
2013
  .transition-all {
2003
2014
  transition-property: all;
2004
2015
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -2069,6 +2080,14 @@
2069
2080
  .\[animation-delay\:300ms\] {
2070
2081
  animation-delay: 300ms;
2071
2082
  }
2083
+ .group-hover\:translate-x-0\.5 {
2084
+ &:is(:where(.group):hover *) {
2085
+ @media (hover: hover) {
2086
+ --tw-translate-x: calc(var(--spacing) * 0.5);
2087
+ translate: var(--tw-translate-x) var(--tw-translate-y);
2088
+ }
2089
+ }
2090
+ }
2072
2091
  .group-hover\:scale-100 {
2073
2092
  &:is(:where(.group):hover *) {
2074
2093
  @media (hover: hover) {
@@ -2370,6 +2389,13 @@
2370
2389
  }
2371
2390
  }
2372
2391
  }
2392
+ .hover\:opacity-95 {
2393
+ &:hover {
2394
+ @media (hover: hover) {
2395
+ opacity: 95%;
2396
+ }
2397
+ }
2398
+ }
2373
2399
  .hover\:shadow-lg {
2374
2400
  &:hover {
2375
2401
  @media (hover: hover) {
@@ -2391,11 +2417,28 @@
2391
2417
  border-color: var(--color-emerald-500);
2392
2418
  }
2393
2419
  }
2420
+ .focus\:ring-1 {
2421
+ &:focus {
2422
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
2423
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2424
+ }
2425
+ }
2394
2426
  .focus\:ring-blue-500 {
2395
2427
  &:focus {
2396
2428
  --tw-ring-color: var(--color-blue-500);
2397
2429
  }
2398
2430
  }
2431
+ .focus\:ring-indigo-500 {
2432
+ &:focus {
2433
+ --tw-ring-color: var(--color-indigo-500);
2434
+ }
2435
+ }
2436
+ .focus\:outline-none {
2437
+ &:focus {
2438
+ --tw-outline-style: none;
2439
+ outline-style: none;
2440
+ }
2441
+ }
2399
2442
  .active\:scale-95 {
2400
2443
  &:active {
2401
2444
  --tw-scale-x: 95%;
@@ -2877,6 +2920,14 @@
2877
2920
  }
2878
2921
  }
2879
2922
  }
2923
+ .dark\:bg-emerald-950\/20 {
2924
+ @media (prefers-color-scheme: dark) {
2925
+ background-color: color-mix(in srgb, oklch(26.2% 0.051 172.552) 20%, transparent);
2926
+ @supports (color: color-mix(in lab, red, red)) {
2927
+ background-color: color-mix(in oklab, var(--color-emerald-950) 20%, transparent);
2928
+ }
2929
+ }
2930
+ }
2880
2931
  .dark\:bg-emerald-950\/40 {
2881
2932
  @media (prefers-color-scheme: dark) {
2882
2933
  background-color: color-mix(in srgb, oklch(26.2% 0.051 172.552) 40%, transparent);
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
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, R as RemoteConfig } from './BatchProcessor-Csy_K1qQ.mjs';
3
- export { A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, h as Chunk, i as ChunkOptions, j as ConfigFetcher, k as ConfigurationException, l as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, m as IRendererStrategy, n as IntentCategory, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, s as ProviderCredentials, t as ProviderNotFoundException, u as RateLimitException, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, y as RenderDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, O as isTransientError } from './BatchProcessor-Csy_K1qQ.mjs';
4
- import { O as ObservabilityTrace, U as UseRagChatOptions, a as UseRagChatReturn, P as ProjectChatSettings } from './ILLMProvider-Y6aL5N8J.mjs';
5
- export { A as AuthMode, C as ChatMessage, b as ChatOptions, c as ChatResponse, E as EmbedOptions, d as EmbeddingConfig, e as EmbeddingProvider, I as ILLMProvider, f as IngestDocument, L as LLMConfig, g as LLMProvider, h as LatencyBreakdown, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, R as RAGConfig, n as RagConfig, o as RagMessage, p as RetrievalConfig, q as RetrievedChunk, T as ThemeMode, r as TokenUsage, s as UIConfig, t as UniversalRagConfig, u as UpsertDocument, V as VectorDBConfig, v as VectorDBProvider, w as VectorMatch, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-Y6aL5N8J.mjs';
6
- import '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 './BatchProcessor-BZhwvT6o.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 './BatchProcessor-BZhwvT6o.mjs';
4
+ import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-BYQd0Nys.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-BYQd0Nys.mjs';
6
+ import React from 'react';
7
7
 
8
8
  /**
9
9
  * ChatWidget — Floating Action Button (FAB) that toggles the chat window.
@@ -76,6 +76,74 @@ declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCard
76
76
 
77
77
  declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): react_jsx_runtime.JSX.Element | null;
78
78
 
79
+ declare function UIDispatcher({ rawContent, primaryColor, accentColor, isStreaming, onAddToCart, viewportSize }: {
80
+ rawContent: string;
81
+ primaryColor?: string;
82
+ accentColor?: string;
83
+ isStreaming?: boolean;
84
+ onAddToCart?: (product: Product) => void;
85
+ viewportSize?: ChatViewportSize;
86
+ }): react_jsx_runtime.JSX.Element | null;
87
+
88
+ interface VisualizationRendererProps {
89
+ data: UITransformationResponse;
90
+ className?: string;
91
+ primaryColor?: string;
92
+ onAddToCart?: (product: Product) => void;
93
+ isStreaming?: boolean;
94
+ }
95
+ /**
96
+ * VisualizationRenderer — Renders UI transformations as React components.
97
+ *
98
+ * Dynamically selects the appropriate visualization component based on the
99
+ * transformation type returned by UITransformer. All charts are rendered via
100
+ * Recharts (chart.js has been removed).
101
+ *
102
+ * Supported types: bar_chart · line_chart · pie_chart · table · product_carousel · text
103
+ *
104
+ * @example
105
+ * const transformation = await UITransformer.analyzeAndDecide(query, sources, llm);
106
+ * return <VisualizationRenderer data={transformation} />;
107
+ */
108
+ declare function VisualizationRenderer({ data, className, primaryColor, onAddToCart, isStreaming, }: VisualizationRendererProps): react_jsx_runtime.JSX.Element;
109
+
110
+ interface UIBlock {
111
+ view: 'carousel' | 'table' | 'chart' | 'form' | 'actions' | string;
112
+ title?: string;
113
+ description?: string;
114
+ data?: any;
115
+ columns?: string[];
116
+ chartType?: 'bar' | 'line' | 'pie' | 'scatter';
117
+ xAxisKey?: string;
118
+ dataKeys?: string[];
119
+ colors?: string[];
120
+ fields?: Array<{
121
+ name: string;
122
+ type: 'text' | 'email' | 'number' | 'textarea' | 'checkbox';
123
+ label: string;
124
+ required?: boolean;
125
+ placeholder?: string;
126
+ }>;
127
+ submitText?: string;
128
+ buttons?: Array<{
129
+ label: string;
130
+ action: 'trigger_workflow' | 'open_url' | 'send_message' | string;
131
+ payload?: Record<string, any>;
132
+ }>;
133
+ [key: string]: any;
134
+ }
135
+ interface UIBlockRendererProps {
136
+ block: UIBlock | unknown;
137
+ customRenderers?: Record<string, (data: any) => React.ReactNode>;
138
+ primaryColor?: string;
139
+ accentColor?: string;
140
+ onAddToCart?: (product: Product) => void;
141
+ onActionTriggered?: (action: string, payload: any) => void;
142
+ onFormSubmit?: (formData: Record<string, any>) => void | Promise<void>;
143
+ isStreaming?: boolean;
144
+ }
145
+ declare function UIBlockRenderer({ block, customRenderers, primaryColor, accentColor, onAddToCart, onActionTriggered, onFormSubmit, isStreaming, }: UIBlockRendererProps): react_jsx_runtime.JSX.Element | null;
146
+
79
147
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
80
148
 
81
149
  interface UseProjectSettingsOptions {
@@ -98,28 +166,4 @@ declare function useProjectSettings(projectId: string, options?: UseProjectSetti
98
166
  */
99
167
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
100
168
 
101
- type CircuitState = 'closed' | 'open' | 'half-open';
102
- interface CircuitBreakerOptions {
103
- failureThreshold?: number;
104
- resetTimeoutMs?: number;
105
- halfOpenMaxCalls?: number;
106
- }
107
- declare class CircuitBreaker {
108
- private state;
109
- private failureCount;
110
- private successCount;
111
- private lastFailureAt;
112
- private halfOpenCalls;
113
- private readonly failureThreshold;
114
- private readonly resetTimeoutMs;
115
- private readonly halfOpenMaxCalls;
116
- constructor(options?: CircuitBreakerOptions);
117
- record(success: boolean): void;
118
- canExecute(): boolean;
119
- wrap<T>(fn: () => Promise<T>): Promise<T>;
120
- getState(): CircuitState;
121
- getFailureCount(): number;
122
- reset(): void;
123
- }
124
-
125
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, CircuitBreaker, type CircuitBreakerOptions, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, addSynonyms, useConfig, useProjectSettings, useRagChat };
169
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, useConfig, useProjectSettings, useRagChat };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
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, R as RemoteConfig } from './BatchProcessor-Dg18zZGk.js';
3
- export { A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, h as Chunk, i as ChunkOptions, j as ConfigFetcher, k as ConfigurationException, l as DecisionContext, E as EmbeddingFailedException, I as IRenderRule, m as IRendererStrategy, n as IntentCategory, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, s as ProviderCredentials, t as ProviderNotFoundException, u as RateLimitException, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, y as RenderDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, O as isTransientError } from './BatchProcessor-Dg18zZGk.js';
4
- import { O as ObservabilityTrace, U as UseRagChatOptions, a as UseRagChatReturn, P as ProjectChatSettings } from './ILLMProvider-Y6aL5N8J.js';
5
- export { A as AuthMode, C as ChatMessage, b as ChatOptions, c as ChatResponse, E as EmbedOptions, d as EmbeddingConfig, e as EmbeddingProvider, I as ILLMProvider, f as IngestDocument, L as LLMConfig, g as LLMProvider, h as LatencyBreakdown, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, R as RAGConfig, n as RagConfig, o as RagMessage, p as RetrievalConfig, q as RetrievedChunk, T as ThemeMode, r as TokenUsage, s as UIConfig, t as UniversalRagConfig, u as UpsertDocument, V as VectorDBConfig, v as VectorDBProvider, w as VectorMatch, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-Y6aL5N8J.js';
6
- import '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 './BatchProcessor-DlAkfGbv.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 './BatchProcessor-DlAkfGbv.js';
4
+ import { O as ObservabilityTrace, P as Product, U as UITransformationResponse, a as UseRagChatOptions, b as UseRagChatReturn, c as ProjectChatSettings } from './ILLMProvider-BYQd0Nys.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-BYQd0Nys.js';
6
+ import React from 'react';
7
7
 
8
8
  /**
9
9
  * ChatWidget — Floating Action Button (FAB) that toggles the chat window.
@@ -76,6 +76,74 @@ declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCard
76
76
 
77
77
  declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): react_jsx_runtime.JSX.Element | null;
78
78
 
79
+ declare function UIDispatcher({ rawContent, primaryColor, accentColor, isStreaming, onAddToCart, viewportSize }: {
80
+ rawContent: string;
81
+ primaryColor?: string;
82
+ accentColor?: string;
83
+ isStreaming?: boolean;
84
+ onAddToCart?: (product: Product) => void;
85
+ viewportSize?: ChatViewportSize;
86
+ }): react_jsx_runtime.JSX.Element | null;
87
+
88
+ interface VisualizationRendererProps {
89
+ data: UITransformationResponse;
90
+ className?: string;
91
+ primaryColor?: string;
92
+ onAddToCart?: (product: Product) => void;
93
+ isStreaming?: boolean;
94
+ }
95
+ /**
96
+ * VisualizationRenderer — Renders UI transformations as React components.
97
+ *
98
+ * Dynamically selects the appropriate visualization component based on the
99
+ * transformation type returned by UITransformer. All charts are rendered via
100
+ * Recharts (chart.js has been removed).
101
+ *
102
+ * Supported types: bar_chart · line_chart · pie_chart · table · product_carousel · text
103
+ *
104
+ * @example
105
+ * const transformation = await UITransformer.analyzeAndDecide(query, sources, llm);
106
+ * return <VisualizationRenderer data={transformation} />;
107
+ */
108
+ declare function VisualizationRenderer({ data, className, primaryColor, onAddToCart, isStreaming, }: VisualizationRendererProps): react_jsx_runtime.JSX.Element;
109
+
110
+ interface UIBlock {
111
+ view: 'carousel' | 'table' | 'chart' | 'form' | 'actions' | string;
112
+ title?: string;
113
+ description?: string;
114
+ data?: any;
115
+ columns?: string[];
116
+ chartType?: 'bar' | 'line' | 'pie' | 'scatter';
117
+ xAxisKey?: string;
118
+ dataKeys?: string[];
119
+ colors?: string[];
120
+ fields?: Array<{
121
+ name: string;
122
+ type: 'text' | 'email' | 'number' | 'textarea' | 'checkbox';
123
+ label: string;
124
+ required?: boolean;
125
+ placeholder?: string;
126
+ }>;
127
+ submitText?: string;
128
+ buttons?: Array<{
129
+ label: string;
130
+ action: 'trigger_workflow' | 'open_url' | 'send_message' | string;
131
+ payload?: Record<string, any>;
132
+ }>;
133
+ [key: string]: any;
134
+ }
135
+ interface UIBlockRendererProps {
136
+ block: UIBlock | unknown;
137
+ customRenderers?: Record<string, (data: any) => React.ReactNode>;
138
+ primaryColor?: string;
139
+ accentColor?: string;
140
+ onAddToCart?: (product: Product) => void;
141
+ onActionTriggered?: (action: string, payload: any) => void;
142
+ onFormSubmit?: (formData: Record<string, any>) => void | Promise<void>;
143
+ isStreaming?: boolean;
144
+ }
145
+ declare function UIBlockRenderer({ block, customRenderers, primaryColor, accentColor, onAddToCart, onActionTriggered, onFormSubmit, isStreaming, }: UIBlockRendererProps): react_jsx_runtime.JSX.Element | null;
146
+
79
147
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
80
148
 
81
149
  interface UseProjectSettingsOptions {
@@ -98,28 +166,4 @@ declare function useProjectSettings(projectId: string, options?: UseProjectSetti
98
166
  */
99
167
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
100
168
 
101
- type CircuitState = 'closed' | 'open' | 'half-open';
102
- interface CircuitBreakerOptions {
103
- failureThreshold?: number;
104
- resetTimeoutMs?: number;
105
- halfOpenMaxCalls?: number;
106
- }
107
- declare class CircuitBreaker {
108
- private state;
109
- private failureCount;
110
- private successCount;
111
- private lastFailureAt;
112
- private halfOpenCalls;
113
- private readonly failureThreshold;
114
- private readonly resetTimeoutMs;
115
- private readonly halfOpenMaxCalls;
116
- constructor(options?: CircuitBreakerOptions);
117
- record(success: boolean): void;
118
- canExecute(): boolean;
119
- wrap<T>(fn: () => Promise<T>): Promise<T>;
120
- getState(): CircuitState;
121
- getFailureCount(): number;
122
- reset(): void;
123
- }
124
-
125
- export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, CircuitBreaker, type CircuitBreakerOptions, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, addSynonyms, useConfig, useProjectSettings, useRagChat };
169
+ export { ChatWidget, ChatWidgetProps, ChatWindow, ChatWindowProps, ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, DocumentUploadProps, MessageBubble, MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, ProductCardProps, ProductCarousel, ProductCarouselProps, ProjectChatSettings, RemoteConfig, SourceCard, SourceCardProps, type UIBlock, UIBlockRenderer, UIDispatcher, type UseProjectSettingsOptions, type UseProjectSettingsReturn, UseRagChatOptions, UseRagChatReturn, VisualizationRenderer, addSynonyms, useConfig, useProjectSettings, useRagChat };