@distri/react 0.2.5 → 0.2.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.
- package/dist/globals.css +2 -61
- package/dist/globals.d.cts +2 -0
- package/dist/globals.d.ts +2 -0
- package/dist/index.cjs +9 -30
- package/dist/index.css +2 -61
- package/dist/index.d.cts +738 -0
- package/dist/index.d.ts +738 -0
- package/dist/index.js +9 -29
- package/package.json +2 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,738 @@
|
|
|
1
|
+
import { Agent as Agent$1, DistriChatMessage, DistriBaseTool, ToolExecutionOptions, DistriMessage, DistriPart, AgentDefinition, DistriThread, DistriFnTool, ToolCall, ToolResult, PlanStep, DistriConfiguration, DistriClientConfig, DistriClient, SpeechToTextConfig, StreamingTranscriptionOptions, ConfigurationMeta, ConfigurationResponse, DistriEvent, ImagePart } from '@distri/core';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import * as zustand from 'zustand';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
7
|
+
import { VariantProps } from 'class-variance-authority';
|
|
8
|
+
import * as _radix_ui_react_separator from '@radix-ui/react-separator';
|
|
9
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
10
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
11
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
12
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
13
|
+
|
|
14
|
+
interface UseChatOptions {
|
|
15
|
+
threadId: string;
|
|
16
|
+
agent?: Agent$1;
|
|
17
|
+
onMessage?: (message: DistriChatMessage) => void;
|
|
18
|
+
onError?: (error: Error) => void;
|
|
19
|
+
getMetadata?: () => Promise<Record<string, unknown>>;
|
|
20
|
+
externalTools?: DistriBaseTool[];
|
|
21
|
+
executionOptions?: ToolExecutionOptions;
|
|
22
|
+
initialMessages?: (DistriChatMessage)[];
|
|
23
|
+
beforeSendMessage?: (msg: DistriMessage) => Promise<DistriMessage>;
|
|
24
|
+
}
|
|
25
|
+
interface UseChatReturn {
|
|
26
|
+
messages: (DistriChatMessage)[];
|
|
27
|
+
isStreaming: boolean;
|
|
28
|
+
sendMessage: (content: string | DistriPart[]) => Promise<void>;
|
|
29
|
+
sendMessageStream: (content: string | DistriPart[]) => Promise<void>;
|
|
30
|
+
isLoading: boolean;
|
|
31
|
+
error: Error | null;
|
|
32
|
+
hasPendingToolCalls: () => boolean;
|
|
33
|
+
stopStreaming: () => void;
|
|
34
|
+
addMessage: (message: DistriChatMessage) => void;
|
|
35
|
+
}
|
|
36
|
+
declare function useChat({ threadId, onError, getMetadata, agent, externalTools, beforeSendMessage, initialMessages, }: UseChatOptions): UseChatReturn;
|
|
37
|
+
|
|
38
|
+
interface UseAgentOptions {
|
|
39
|
+
agentIdOrDef: string | AgentDefinition;
|
|
40
|
+
}
|
|
41
|
+
interface UseAgentResult {
|
|
42
|
+
agent: Agent$1 | null;
|
|
43
|
+
loading: boolean;
|
|
44
|
+
error: Error | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* useAgent is for agent configuration and invocation.
|
|
48
|
+
* For chat UIs, use useChat instead.
|
|
49
|
+
*/
|
|
50
|
+
declare function useAgent({ agentIdOrDef, }: UseAgentOptions): UseAgentResult;
|
|
51
|
+
|
|
52
|
+
interface UseAgentsResult {
|
|
53
|
+
agents: AgentDefinition[];
|
|
54
|
+
loading: boolean;
|
|
55
|
+
error: Error | null;
|
|
56
|
+
refetch: () => Promise<void>;
|
|
57
|
+
getAgent: (agentId: string) => Promise<AgentDefinition>;
|
|
58
|
+
}
|
|
59
|
+
declare function useAgentDefinitions(): UseAgentsResult;
|
|
60
|
+
|
|
61
|
+
interface UseThreadsResult {
|
|
62
|
+
threads: DistriThread[];
|
|
63
|
+
loading: boolean;
|
|
64
|
+
error: Error | null;
|
|
65
|
+
refetch: () => Promise<void>;
|
|
66
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
67
|
+
fetchThread: (threadId: string) => Promise<DistriThread>;
|
|
68
|
+
updateThread: (threadId: string, localId?: string) => Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
declare function useThreads(): UseThreadsResult;
|
|
71
|
+
interface UseThreadMessagesOptions {
|
|
72
|
+
threadId: string | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type ToolCallStatus = 'pending' | 'running' | 'completed' | 'error' | 'user_action_required';
|
|
76
|
+
type DistriAnyTool = DistriFnTool | DistriUiTool;
|
|
77
|
+
interface DistriUiTool extends DistriBaseTool {
|
|
78
|
+
type: 'ui';
|
|
79
|
+
component: (props: UiToolProps) => React__default.ReactNode;
|
|
80
|
+
}
|
|
81
|
+
type UiToolProps = {
|
|
82
|
+
toolCall: ToolCall;
|
|
83
|
+
toolCallState?: ToolCallState;
|
|
84
|
+
completeTool: (result: ToolResult) => void;
|
|
85
|
+
tool: DistriBaseTool;
|
|
86
|
+
};
|
|
87
|
+
type ToolRendererProps = {
|
|
88
|
+
toolCall: ToolCall;
|
|
89
|
+
state?: ToolCallState;
|
|
90
|
+
};
|
|
91
|
+
type ToolRendererMap = Record<string, (props: ToolRendererProps) => React__default.ReactNode>;
|
|
92
|
+
type ChatCustomRenderers = never;
|
|
93
|
+
|
|
94
|
+
type StreamingIndicator = 'typing' | 'thinking' | 'generating';
|
|
95
|
+
interface ThinkingRendererProps {
|
|
96
|
+
indicator: StreamingIndicator;
|
|
97
|
+
className?: string;
|
|
98
|
+
avatar?: React__default.ReactNode;
|
|
99
|
+
name?: string;
|
|
100
|
+
thoughtText?: string;
|
|
101
|
+
}
|
|
102
|
+
declare const LoadingShimmer: ({ text, className }: {
|
|
103
|
+
text: string;
|
|
104
|
+
className?: string;
|
|
105
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
106
|
+
declare const ThinkingRenderer: React__default.FC<ThinkingRendererProps>;
|
|
107
|
+
|
|
108
|
+
interface TaskState {
|
|
109
|
+
id: string;
|
|
110
|
+
runId?: string;
|
|
111
|
+
planId?: string;
|
|
112
|
+
title: string;
|
|
113
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
114
|
+
startTime?: number;
|
|
115
|
+
endTime?: number;
|
|
116
|
+
toolCalls?: ToolCall[];
|
|
117
|
+
results?: ToolResult[];
|
|
118
|
+
error?: string;
|
|
119
|
+
metadata?: Record<string, unknown>;
|
|
120
|
+
}
|
|
121
|
+
interface PlanState {
|
|
122
|
+
id: string;
|
|
123
|
+
runId?: string;
|
|
124
|
+
taskId?: string;
|
|
125
|
+
steps: PlanStep[];
|
|
126
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
127
|
+
startTime?: number;
|
|
128
|
+
endTime?: number;
|
|
129
|
+
reasoning?: string;
|
|
130
|
+
thinkingDuration?: number;
|
|
131
|
+
}
|
|
132
|
+
interface StepState {
|
|
133
|
+
id: string;
|
|
134
|
+
title: string;
|
|
135
|
+
index: number;
|
|
136
|
+
status: 'running' | 'completed' | 'failed';
|
|
137
|
+
startTime?: number;
|
|
138
|
+
endTime?: number;
|
|
139
|
+
}
|
|
140
|
+
interface ToolCallState {
|
|
141
|
+
tool_call_id: string;
|
|
142
|
+
tool_name: string;
|
|
143
|
+
input: Record<string, unknown>;
|
|
144
|
+
status: ToolCallStatus;
|
|
145
|
+
result?: ToolResult;
|
|
146
|
+
error?: string;
|
|
147
|
+
startTime?: number;
|
|
148
|
+
endTime?: number;
|
|
149
|
+
component?: React__default.ReactNode;
|
|
150
|
+
isExternal?: boolean;
|
|
151
|
+
isLiveStream?: boolean;
|
|
152
|
+
resultSent?: boolean;
|
|
153
|
+
}
|
|
154
|
+
interface ChatState {
|
|
155
|
+
isStreaming: boolean;
|
|
156
|
+
isLoading: boolean;
|
|
157
|
+
error: Error | null;
|
|
158
|
+
debug: boolean;
|
|
159
|
+
tasks: Map<string, TaskState>;
|
|
160
|
+
plans: Map<string, PlanState>;
|
|
161
|
+
steps: Map<string, StepState>;
|
|
162
|
+
toolCalls: Map<string, ToolCallState>;
|
|
163
|
+
currentRunId?: string;
|
|
164
|
+
currentTaskId?: string;
|
|
165
|
+
currentPlanId?: string;
|
|
166
|
+
messages: DistriChatMessage[];
|
|
167
|
+
streamingIndicator: StreamingIndicator | undefined;
|
|
168
|
+
currentThought?: string;
|
|
169
|
+
agent?: Agent$1;
|
|
170
|
+
externalTools?: DistriAnyTool[];
|
|
171
|
+
wrapOptions?: {
|
|
172
|
+
autoExecute?: boolean;
|
|
173
|
+
};
|
|
174
|
+
browserFrame?: string;
|
|
175
|
+
browserFrameFormat?: string;
|
|
176
|
+
browserFrameUpdatedAt?: number;
|
|
177
|
+
}
|
|
178
|
+
type ChatStateTool = DistriAnyTool & {
|
|
179
|
+
executionType: 'backend' | 'external';
|
|
180
|
+
};
|
|
181
|
+
interface ChatStateStore extends ChatState {
|
|
182
|
+
setStreaming: (isStreaming: boolean) => void;
|
|
183
|
+
setLoading: (isLoading: boolean) => void;
|
|
184
|
+
setError: (error: Error | null) => void;
|
|
185
|
+
setDebug: (debug: boolean) => void;
|
|
186
|
+
setStreamingIndicator: (indicator: StreamingIndicator | undefined) => void;
|
|
187
|
+
setCurrentThought: (thought: string | undefined) => void;
|
|
188
|
+
setBrowserFrame: (frameSrc: string, format?: string) => void;
|
|
189
|
+
addMessage: (message: DistriChatMessage) => void;
|
|
190
|
+
processMessage: (message: DistriChatMessage, isFromStream?: boolean) => void;
|
|
191
|
+
clearAllStates: () => void;
|
|
192
|
+
clearTask: (taskId: string) => void;
|
|
193
|
+
clearBrowserFrame: () => void;
|
|
194
|
+
getToolByName: (toolName: string) => ChatStateTool | undefined;
|
|
195
|
+
completeRunningSteps: () => void;
|
|
196
|
+
resetStreamingStates: () => void;
|
|
197
|
+
initToolCall: (toolCall: ToolCall, timestamp?: number, isFromStream?: boolean) => void;
|
|
198
|
+
updateToolCallStatus: (toolCallId: string, status: Partial<ToolCallState>) => void;
|
|
199
|
+
getToolCallById: (toolCallId: string) => ToolCallState | null;
|
|
200
|
+
getPendingToolCalls: () => ToolCallState[];
|
|
201
|
+
getCompletedToolCalls: () => ToolCallState[];
|
|
202
|
+
completeTool: (toolCall: ToolCall, result: ToolResult) => Promise<void>;
|
|
203
|
+
executeTool: (toolCall: ToolCall, distriTool: DistriAnyTool) => void;
|
|
204
|
+
hasPendingToolCalls: () => boolean;
|
|
205
|
+
clearToolResults: () => void;
|
|
206
|
+
getExternalToolResponses: () => ToolResult[];
|
|
207
|
+
getCurrentTask: () => TaskState | null;
|
|
208
|
+
getCurrentPlan: () => PlanState | null;
|
|
209
|
+
getCurrentTasks: () => TaskState[];
|
|
210
|
+
getTaskById: (taskId: string) => TaskState | null;
|
|
211
|
+
getPlanById: (planId: string) => PlanState | null;
|
|
212
|
+
updateTask: (taskId: string, updates: Partial<TaskState>) => void;
|
|
213
|
+
updatePlan: (planId: string, updates: Partial<PlanState>) => void;
|
|
214
|
+
updateStep: (stepId: string, updates: Partial<StepState>) => void;
|
|
215
|
+
setAgent: (agent: Agent$1) => void;
|
|
216
|
+
setExternalTools: (tools: DistriAnyTool[]) => void;
|
|
217
|
+
setWrapOptions: (options: {
|
|
218
|
+
autoExecute?: boolean;
|
|
219
|
+
}) => void;
|
|
220
|
+
}
|
|
221
|
+
declare const useChatStateStore: zustand.UseBoundStore<zustand.StoreApi<ChatStateStore>>;
|
|
222
|
+
|
|
223
|
+
interface ChatEmptyStateStarter {
|
|
224
|
+
id?: string;
|
|
225
|
+
label: string;
|
|
226
|
+
prompt?: string;
|
|
227
|
+
description?: string;
|
|
228
|
+
autoSend?: boolean;
|
|
229
|
+
}
|
|
230
|
+
interface ChatEmptyStateCategory {
|
|
231
|
+
id: string;
|
|
232
|
+
title?: string;
|
|
233
|
+
description?: string;
|
|
234
|
+
starters?: ChatEmptyStateStarter[];
|
|
235
|
+
}
|
|
236
|
+
interface ChatEmptyStateOptions {
|
|
237
|
+
eyebrow?: string;
|
|
238
|
+
description?: string;
|
|
239
|
+
promptPlaceholder?: string;
|
|
240
|
+
promptHelperText?: string;
|
|
241
|
+
categoriesLabel?: string;
|
|
242
|
+
startersLabel?: string;
|
|
243
|
+
categories?: ChatEmptyStateCategory[];
|
|
244
|
+
autoSendOnStarterClick?: boolean;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
interface ModelOption {
|
|
248
|
+
id: string;
|
|
249
|
+
name: string;
|
|
250
|
+
}
|
|
251
|
+
interface ChatInstance {
|
|
252
|
+
sendMessage: (content: string | DistriPart[]) => Promise<void>;
|
|
253
|
+
stopStreaming: () => void;
|
|
254
|
+
triggerTool: (toolName: string, input: any) => Promise<void>;
|
|
255
|
+
isStreaming: boolean;
|
|
256
|
+
isLoading: boolean;
|
|
257
|
+
startStreamingVoice?: () => void;
|
|
258
|
+
stopStreamingVoice?: () => void;
|
|
259
|
+
isStreamingVoice?: boolean;
|
|
260
|
+
streamingTranscript?: string;
|
|
261
|
+
}
|
|
262
|
+
interface ChatEmptyStateController {
|
|
263
|
+
input: string;
|
|
264
|
+
setInput: (value: string) => void;
|
|
265
|
+
submit: (content?: string | DistriPart[]) => Promise<void>;
|
|
266
|
+
isLoading: boolean;
|
|
267
|
+
isStreaming: boolean;
|
|
268
|
+
composer?: React__default.ReactNode;
|
|
269
|
+
}
|
|
270
|
+
interface ChatProps {
|
|
271
|
+
threadId: string;
|
|
272
|
+
agent?: Agent$1;
|
|
273
|
+
onMessage?: (message: DistriChatMessage) => void;
|
|
274
|
+
beforeSendMessage?: (content: DistriMessage) => Promise<DistriMessage>;
|
|
275
|
+
onError?: (error: Error) => void;
|
|
276
|
+
getMetadata?: () => Promise<any>;
|
|
277
|
+
externalTools?: DistriAnyTool[];
|
|
278
|
+
toolRenderers?: ToolRendererMap;
|
|
279
|
+
executionOptions?: ToolExecutionOptions;
|
|
280
|
+
initialMessages?: (DistriChatMessage)[];
|
|
281
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
282
|
+
models?: ModelOption[];
|
|
283
|
+
selectedModelId?: string;
|
|
284
|
+
onModelChange?: (modelId: string) => void;
|
|
285
|
+
onChatInstanceReady?: (instance: ChatInstance) => void;
|
|
286
|
+
onChatStateChange?: (state: ChatState) => void;
|
|
287
|
+
onTaskFinish?: (task: TaskState) => void;
|
|
288
|
+
renderEmptyState?: (controller: ChatEmptyStateController) => React__default.ReactNode;
|
|
289
|
+
emptyState?: ChatEmptyStateOptions;
|
|
290
|
+
voiceEnabled?: boolean;
|
|
291
|
+
useSpeechRecognition?: boolean;
|
|
292
|
+
ttsConfig?: {
|
|
293
|
+
model: 'openai' | 'gemini';
|
|
294
|
+
voice?: string;
|
|
295
|
+
speed?: number;
|
|
296
|
+
};
|
|
297
|
+
initialInput?: string;
|
|
298
|
+
allowBrowserPreview?: boolean;
|
|
299
|
+
maxWidth?: string;
|
|
300
|
+
}
|
|
301
|
+
declare const Chat: React__default.ForwardRefExoticComponent<ChatProps & React__default.RefAttributes<ChatInstance>>;
|
|
302
|
+
|
|
303
|
+
interface Agent {
|
|
304
|
+
id: string;
|
|
305
|
+
name: string;
|
|
306
|
+
description?: string;
|
|
307
|
+
}
|
|
308
|
+
interface AgentSelectProps {
|
|
309
|
+
agents: Agent[];
|
|
310
|
+
selectedAgentId?: string;
|
|
311
|
+
onAgentSelect: (agentId: string) => void;
|
|
312
|
+
className?: string;
|
|
313
|
+
placeholder?: string;
|
|
314
|
+
disabled?: boolean;
|
|
315
|
+
}
|
|
316
|
+
declare const AgentSelect: React__default.FC<AgentSelectProps>;
|
|
317
|
+
|
|
318
|
+
interface AppSidebarProps {
|
|
319
|
+
selectedThreadId: string;
|
|
320
|
+
currentPage: 'chat' | 'agents';
|
|
321
|
+
onNewChat: () => void;
|
|
322
|
+
onThreadSelect: (threadId: string) => void;
|
|
323
|
+
onThreadDelete: (threadId: string) => void;
|
|
324
|
+
onThreadRename: (threadId: string, newTitle: string) => void;
|
|
325
|
+
onLogoClick?: () => void;
|
|
326
|
+
onPageChange: (page: 'chat' | 'agents') => void;
|
|
327
|
+
}
|
|
328
|
+
declare function AppSidebar({ selectedThreadId, currentPage, onNewChat, onThreadSelect, onThreadDelete, onThreadRename, onLogoClick, onPageChange, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
329
|
+
|
|
330
|
+
interface AttachedImage {
|
|
331
|
+
id: string;
|
|
332
|
+
file: File;
|
|
333
|
+
preview: string;
|
|
334
|
+
name: string;
|
|
335
|
+
}
|
|
336
|
+
interface ChatInputProps {
|
|
337
|
+
value: string;
|
|
338
|
+
onChange: (value: string) => void;
|
|
339
|
+
onSend: (content: string | DistriPart[]) => void;
|
|
340
|
+
onStop?: () => void;
|
|
341
|
+
browserEnabled?: boolean;
|
|
342
|
+
onToggleBrowser?: (enabled: boolean) => void;
|
|
343
|
+
placeholder?: string;
|
|
344
|
+
disabled?: boolean;
|
|
345
|
+
isStreaming?: boolean;
|
|
346
|
+
className?: string;
|
|
347
|
+
attachedImages?: AttachedImage[];
|
|
348
|
+
onRemoveImage?: (id: string) => void;
|
|
349
|
+
onAddImages?: (files: FileList | File[]) => void;
|
|
350
|
+
voiceEnabled?: boolean;
|
|
351
|
+
onVoiceRecord?: (audioBlob: Blob) => void;
|
|
352
|
+
onStartStreamingVoice?: () => void;
|
|
353
|
+
isStreamingVoice?: boolean;
|
|
354
|
+
useSpeechRecognition?: boolean;
|
|
355
|
+
onSpeechTranscript?: (text: string) => void;
|
|
356
|
+
variant?: 'default' | 'hero';
|
|
357
|
+
}
|
|
358
|
+
declare const ChatInput: React__default.FC<ChatInputProps>;
|
|
359
|
+
|
|
360
|
+
interface VoiceInputProps {
|
|
361
|
+
onTranscript: (text: string) => void;
|
|
362
|
+
onError?: (error: string) => void;
|
|
363
|
+
className?: string;
|
|
364
|
+
disabled?: boolean;
|
|
365
|
+
language?: string;
|
|
366
|
+
interimResults?: boolean;
|
|
367
|
+
useBrowserSpeechRecognition?: boolean;
|
|
368
|
+
}
|
|
369
|
+
declare const VoiceInput: React__default.FC<VoiceInputProps>;
|
|
370
|
+
|
|
371
|
+
interface BrowserPreviewPanelProps {
|
|
372
|
+
frameSrc: string;
|
|
373
|
+
timestampLabel?: string | null;
|
|
374
|
+
className?: string;
|
|
375
|
+
}
|
|
376
|
+
declare const BrowserPreviewPanel: React__default.FC<BrowserPreviewPanelProps>;
|
|
377
|
+
|
|
378
|
+
interface BrowserViewportProps {
|
|
379
|
+
className?: string;
|
|
380
|
+
emptyState?: React__default.ReactNode;
|
|
381
|
+
showTimestamp?: boolean;
|
|
382
|
+
}
|
|
383
|
+
declare const BrowserViewport: React__default.FC<BrowserViewportProps>;
|
|
384
|
+
|
|
385
|
+
type ConfigurationPanelProps = {
|
|
386
|
+
className?: string;
|
|
387
|
+
onSaved?: (configuration: DistriConfiguration) => void;
|
|
388
|
+
title?: string;
|
|
389
|
+
};
|
|
390
|
+
declare function ConfigurationPanel({ className, title }: ConfigurationPanelProps): react_jsx_runtime.JSX.Element;
|
|
391
|
+
|
|
392
|
+
type Theme = 'dark' | 'light' | 'system';
|
|
393
|
+
interface ThemeProviderProps {
|
|
394
|
+
children: React__default.ReactNode;
|
|
395
|
+
defaultTheme?: Theme;
|
|
396
|
+
storageKey?: string;
|
|
397
|
+
}
|
|
398
|
+
interface ThemeProviderState {
|
|
399
|
+
theme: Theme;
|
|
400
|
+
setTheme: (theme: Theme) => void;
|
|
401
|
+
}
|
|
402
|
+
declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
declare const useTheme: () => ThemeProviderState;
|
|
404
|
+
|
|
405
|
+
declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
406
|
+
|
|
407
|
+
interface DistriContextValue {
|
|
408
|
+
client: DistriClient | null;
|
|
409
|
+
error: Error | null;
|
|
410
|
+
isLoading: boolean;
|
|
411
|
+
}
|
|
412
|
+
interface DistriProviderProps {
|
|
413
|
+
config: DistriClientConfig;
|
|
414
|
+
children: ReactNode;
|
|
415
|
+
defaultTheme?: 'dark' | 'light' | 'system';
|
|
416
|
+
}
|
|
417
|
+
declare function DistriProvider({ config, children, defaultTheme }: DistriProviderProps): react_jsx_runtime.JSX.Element;
|
|
418
|
+
declare function useDistri(): DistriContextValue;
|
|
419
|
+
|
|
420
|
+
interface UseChatMessagesOptions {
|
|
421
|
+
initialMessages?: DistriChatMessage[];
|
|
422
|
+
agent?: Agent$1;
|
|
423
|
+
threadId?: string;
|
|
424
|
+
onError?: (error: Error) => void;
|
|
425
|
+
}
|
|
426
|
+
interface UseChatMessagesReturn {
|
|
427
|
+
messages: DistriChatMessage[];
|
|
428
|
+
addMessage: (message: DistriChatMessage) => void;
|
|
429
|
+
clearMessages: () => void;
|
|
430
|
+
fetchMessages: () => Promise<void>;
|
|
431
|
+
isLoading: boolean;
|
|
432
|
+
error: Error | null;
|
|
433
|
+
}
|
|
434
|
+
declare function useChatMessages({ initialMessages, threadId, onError, }?: UseChatMessagesOptions): UseChatMessagesReturn;
|
|
435
|
+
|
|
436
|
+
interface TtsRequest {
|
|
437
|
+
text: string;
|
|
438
|
+
model: 'openai' | 'gemini';
|
|
439
|
+
voice?: string;
|
|
440
|
+
speed?: number;
|
|
441
|
+
}
|
|
442
|
+
interface TtsConfig {
|
|
443
|
+
baseUrl?: string;
|
|
444
|
+
accessToken?: string;
|
|
445
|
+
}
|
|
446
|
+
interface StreamingTtsOptions {
|
|
447
|
+
onAudioChunk?: (audioData: Uint8Array) => void;
|
|
448
|
+
onTextChunk?: (text: string, isFinal: boolean) => void;
|
|
449
|
+
onError?: (error: Error) => void;
|
|
450
|
+
onStart?: () => void;
|
|
451
|
+
onEnd?: () => void;
|
|
452
|
+
voice?: string;
|
|
453
|
+
speed?: number;
|
|
454
|
+
}
|
|
455
|
+
declare const useTts: (config?: TtsConfig) => {
|
|
456
|
+
synthesize: (request: TtsRequest) => Promise<Blob>;
|
|
457
|
+
getAvailableVoices: () => Promise<any>;
|
|
458
|
+
playAudio: (audioBlob: Blob) => Promise<void>;
|
|
459
|
+
streamingPlayAudio: (audioChunks: Uint8Array[]) => Promise<void>;
|
|
460
|
+
startStreamingTts: (options?: StreamingTtsOptions) => {
|
|
461
|
+
sendText: (text: string) => void;
|
|
462
|
+
stop: () => void;
|
|
463
|
+
};
|
|
464
|
+
stopStreamingTts: () => void;
|
|
465
|
+
isSynthesizing: boolean;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
declare const useSpeechToText: () => {
|
|
469
|
+
transcribe: (audioBlob: Blob, config?: SpeechToTextConfig) => Promise<string>;
|
|
470
|
+
isTranscribing: boolean;
|
|
471
|
+
startStreamingTranscription: (options?: StreamingTranscriptionOptions) => Promise<{
|
|
472
|
+
sendAudio: (audioData: ArrayBuffer) => void;
|
|
473
|
+
sendText: (text: string) => void;
|
|
474
|
+
stop: () => void;
|
|
475
|
+
close: () => void;
|
|
476
|
+
}>;
|
|
477
|
+
stopStreamingTranscription: () => void;
|
|
478
|
+
sendAudio: (audioData: ArrayBuffer) => void;
|
|
479
|
+
sendText: (text: string) => void;
|
|
480
|
+
isStreaming: boolean;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
type UseConfigurationResult = {
|
|
484
|
+
configuration: DistriConfiguration | null;
|
|
485
|
+
meta: ConfigurationMeta | null;
|
|
486
|
+
loading: boolean;
|
|
487
|
+
error: string | null;
|
|
488
|
+
refresh: () => Promise<void>;
|
|
489
|
+
saveConfiguration: (config: DistriConfiguration) => Promise<ConfigurationResponse>;
|
|
490
|
+
setConfiguration: (config: DistriConfiguration | null) => void;
|
|
491
|
+
};
|
|
492
|
+
declare function useConfiguration(): UseConfigurationResult;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Wraps a DistriFnTool as a DistriUiTool with DefaultToolActions component
|
|
496
|
+
*/
|
|
497
|
+
declare function wrapFnToolAsUiTool(fnTool: DistriFnTool, options?: ToolExecutionOptions): DistriUiTool;
|
|
498
|
+
/**
|
|
499
|
+
* Automatically wraps an array of tools, converting DistriFnTools to DistriUiTools
|
|
500
|
+
*/
|
|
501
|
+
declare function wrapTools(tools: (DistriFnTool | DistriUiTool)[], options?: ToolExecutionOptions): DistriUiTool[];
|
|
502
|
+
|
|
503
|
+
declare const buttonVariants: {
|
|
504
|
+
variant: {
|
|
505
|
+
default: string;
|
|
506
|
+
destructive: string;
|
|
507
|
+
outline: string;
|
|
508
|
+
secondary: string;
|
|
509
|
+
ghost: string;
|
|
510
|
+
link: string;
|
|
511
|
+
};
|
|
512
|
+
size: {
|
|
513
|
+
default: string;
|
|
514
|
+
sm: string;
|
|
515
|
+
lg: string;
|
|
516
|
+
icon: string;
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
520
|
+
variant?: keyof typeof buttonVariants.variant;
|
|
521
|
+
size?: keyof typeof buttonVariants.size;
|
|
522
|
+
}
|
|
523
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
524
|
+
|
|
525
|
+
interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
|
|
526
|
+
}
|
|
527
|
+
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
528
|
+
|
|
529
|
+
declare const Card: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
530
|
+
declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
531
|
+
declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
532
|
+
declare const CardDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
533
|
+
declare const CardContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
534
|
+
declare const CardFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
535
|
+
|
|
536
|
+
declare const badgeVariants: (props?: ({
|
|
537
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
538
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
539
|
+
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
540
|
+
}
|
|
541
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
542
|
+
|
|
543
|
+
interface DialogProps {
|
|
544
|
+
open?: boolean;
|
|
545
|
+
onOpenChange?: (open: boolean) => void;
|
|
546
|
+
children: React$1.ReactNode;
|
|
547
|
+
}
|
|
548
|
+
declare const DialogRoot: React$1.FC<DialogProps>;
|
|
549
|
+
declare const DialogTrigger: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttributes<HTMLButtonElement> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
550
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
551
|
+
declare const DialogHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
552
|
+
declare const DialogTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
553
|
+
|
|
554
|
+
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
555
|
+
}
|
|
556
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
557
|
+
|
|
558
|
+
declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
559
|
+
declare const Tooltip: React$1.FC<TooltipPrimitive.TooltipProps>;
|
|
560
|
+
declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
561
|
+
declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
562
|
+
|
|
563
|
+
type SidebarContext = {
|
|
564
|
+
state: "expanded" | "collapsed";
|
|
565
|
+
open: boolean;
|
|
566
|
+
setOpen: (open: boolean) => void;
|
|
567
|
+
openMobile: boolean;
|
|
568
|
+
setOpenMobile: (open: boolean) => void;
|
|
569
|
+
isMobile: boolean;
|
|
570
|
+
toggleSidebar: () => void;
|
|
571
|
+
};
|
|
572
|
+
declare const SidebarContext: React$1.Context<SidebarContext | null>;
|
|
573
|
+
declare function useSidebar(): SidebarContext;
|
|
574
|
+
declare const SidebarProvider: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
|
|
575
|
+
defaultOpen?: boolean;
|
|
576
|
+
open?: boolean;
|
|
577
|
+
onOpenChange?: (open: boolean) => void;
|
|
578
|
+
}, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
579
|
+
declare const Sidebar: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
|
|
580
|
+
side?: "left" | "right";
|
|
581
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
582
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
583
|
+
}, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
584
|
+
declare const SidebarTrigger: React$1.ForwardRefExoticComponent<Omit<ButtonProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
585
|
+
declare const SidebarRail: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
586
|
+
declare const SidebarInset: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
587
|
+
declare const SidebarHeader: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
588
|
+
declare const SidebarFooter: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
589
|
+
declare const SidebarSeparator: React$1.ForwardRefExoticComponent<Omit<Omit<_radix_ui_react_separator.SeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
590
|
+
declare const SidebarContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
591
|
+
declare const SidebarGroup: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
592
|
+
declare const SidebarGroupLabel: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
|
|
593
|
+
asChild?: boolean;
|
|
594
|
+
}, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
595
|
+
declare const SidebarGroupAction: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLButtonElement> & React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
596
|
+
asChild?: boolean;
|
|
597
|
+
}, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
598
|
+
declare const SidebarGroupContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
599
|
+
declare const SidebarMenu: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
|
|
600
|
+
declare const SidebarMenuItem: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React$1.RefAttributes<HTMLLIElement>>;
|
|
601
|
+
declare const SidebarMenuButton: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLButtonElement> & React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
602
|
+
asChild?: boolean;
|
|
603
|
+
isActive?: boolean;
|
|
604
|
+
tooltip?: string | React$1.ComponentProps<typeof TooltipContent>;
|
|
605
|
+
} & VariantProps<(props?: ({
|
|
606
|
+
variant?: "default" | "outline" | null | undefined;
|
|
607
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
608
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
609
|
+
declare const SidebarMenuAction: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLButtonElement> & React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
610
|
+
asChild?: boolean;
|
|
611
|
+
showOnHover?: boolean;
|
|
612
|
+
}, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
613
|
+
declare const SidebarMenuBadge: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
614
|
+
declare const SidebarMenuSkeleton: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
|
|
615
|
+
showIcon?: boolean;
|
|
616
|
+
}, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
617
|
+
declare const SidebarMenuSub: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
|
|
618
|
+
declare const SidebarMenuSubItem: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React$1.RefAttributes<HTMLLIElement>>;
|
|
619
|
+
declare const SidebarMenuSubButton: React$1.ForwardRefExoticComponent<Omit<React$1.ClassAttributes<HTMLAnchorElement> & React$1.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
620
|
+
asChild?: boolean;
|
|
621
|
+
size?: "sm" | "md";
|
|
622
|
+
isActive?: boolean;
|
|
623
|
+
}, "ref"> & React$1.RefAttributes<HTMLAnchorElement>>;
|
|
624
|
+
|
|
625
|
+
declare const Separator: React$1.ForwardRefExoticComponent<Omit<_radix_ui_react_separator.SeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
626
|
+
|
|
627
|
+
declare const Sheet: React$1.FC<SheetPrimitive.DialogProps>;
|
|
628
|
+
declare const sheetVariants: (props?: ({
|
|
629
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
630
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
631
|
+
interface SheetContentProps extends React$1.ComponentProps<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
632
|
+
}
|
|
633
|
+
declare const SheetContent: React$1.ForwardRefExoticComponent<Omit<SheetContentProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
634
|
+
declare const SheetHeader: {
|
|
635
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
636
|
+
displayName: string;
|
|
637
|
+
};
|
|
638
|
+
declare const SheetFooter: {
|
|
639
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
640
|
+
displayName: string;
|
|
641
|
+
};
|
|
642
|
+
declare const SheetTitle: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
643
|
+
declare const SheetDescription: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
644
|
+
|
|
645
|
+
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
646
|
+
|
|
647
|
+
declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
|
|
648
|
+
declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
649
|
+
declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
650
|
+
declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
651
|
+
declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
652
|
+
declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
653
|
+
declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
654
|
+
declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
655
|
+
declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
656
|
+
declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
657
|
+
|
|
658
|
+
declare const DropdownMenu: React$1.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
659
|
+
declare const DropdownMenuTrigger: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
660
|
+
declare const DropdownMenuGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
661
|
+
declare const DropdownMenuPortal: React$1.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
662
|
+
declare const DropdownMenuSub: React$1.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
663
|
+
declare const DropdownMenuRadioGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
664
|
+
declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
665
|
+
inset?: boolean;
|
|
666
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
667
|
+
declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
668
|
+
declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
669
|
+
declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
670
|
+
inset?: boolean;
|
|
671
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
672
|
+
declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
673
|
+
declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
674
|
+
declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
675
|
+
inset?: boolean;
|
|
676
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
677
|
+
declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
678
|
+
declare const DropdownMenuShortcut: {
|
|
679
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
680
|
+
displayName: string;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
interface AssistantMessageRendererProps {
|
|
684
|
+
message: DistriMessage | DistriEvent;
|
|
685
|
+
className?: string;
|
|
686
|
+
avatar?: React__default.ReactNode;
|
|
687
|
+
name?: string;
|
|
688
|
+
}
|
|
689
|
+
declare const AssistantMessageRenderer: React__default.FC<AssistantMessageRendererProps>;
|
|
690
|
+
|
|
691
|
+
interface ImageRendererProps {
|
|
692
|
+
imageParts: ImagePart[];
|
|
693
|
+
className?: string;
|
|
694
|
+
}
|
|
695
|
+
declare const ImageRenderer: React__default.FC<ImageRendererProps>;
|
|
696
|
+
|
|
697
|
+
interface MessageRendererProps {
|
|
698
|
+
message: DistriChatMessage;
|
|
699
|
+
index: number;
|
|
700
|
+
isExpanded?: boolean;
|
|
701
|
+
onToggle?: () => void;
|
|
702
|
+
toolRenderers?: ToolRendererMap;
|
|
703
|
+
}
|
|
704
|
+
declare function MessageRenderer({ message, index, toolRenderers, }: MessageRendererProps): React__default.ReactNode;
|
|
705
|
+
|
|
706
|
+
interface StepBasedRendererProps {
|
|
707
|
+
message: DistriMessage;
|
|
708
|
+
}
|
|
709
|
+
declare const StepBasedRenderer: React__default.FC<StepBasedRendererProps>;
|
|
710
|
+
|
|
711
|
+
interface StreamingTextRendererProps {
|
|
712
|
+
text: string;
|
|
713
|
+
isStreaming?: boolean;
|
|
714
|
+
className?: string;
|
|
715
|
+
}
|
|
716
|
+
declare const StreamingTextRenderer: React__default.FC<StreamingTextRendererProps>;
|
|
717
|
+
|
|
718
|
+
interface ExtractedContent {
|
|
719
|
+
text: string;
|
|
720
|
+
hasMarkdown: boolean;
|
|
721
|
+
hasCode: boolean;
|
|
722
|
+
hasLinks: boolean;
|
|
723
|
+
hasImages: boolean;
|
|
724
|
+
imageParts: ImagePart[];
|
|
725
|
+
rawContent: DistriMessage | DistriEvent;
|
|
726
|
+
}
|
|
727
|
+
declare function extractContent(message: DistriMessage | DistriEvent): ExtractedContent;
|
|
728
|
+
|
|
729
|
+
declare const TypingIndicator: React__default.FC;
|
|
730
|
+
|
|
731
|
+
interface UserMessageRendererProps {
|
|
732
|
+
message: DistriMessage;
|
|
733
|
+
className?: string;
|
|
734
|
+
avatar?: React__default.ReactNode;
|
|
735
|
+
}
|
|
736
|
+
declare const UserMessageRenderer: React__default.FC<UserMessageRendererProps>;
|
|
737
|
+
|
|
738
|
+
export { AgentSelect, AppSidebar, AssistantMessageRenderer, type AssistantMessageRendererProps, type AttachedImage, Badge, BrowserPreviewPanel, BrowserViewport, type BrowserViewportProps, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Chat, type ChatCustomRenderers, type ChatEmptyStateCategory, type ChatEmptyStateController, type ChatEmptyStateOptions, type ChatEmptyStateStarter, ChatInput, type ChatInputProps, type ChatInstance, type ChatProps, type ChatState, type ChatStateStore, ConfigurationPanel, DialogRoot as Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, type DistriAnyTool, DistriProvider, type DistriUiTool, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ExtractedContent, ImageRenderer, type ImageRendererProps, Input, LoadingShimmer, MessageRenderer, type MessageRendererProps, type ModelOption, type PlanState, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StepBasedRenderer, type StepBasedRendererProps, type StepState, type StreamingIndicator, StreamingTextRenderer, type StreamingTtsOptions, type TaskState, Textarea, ThemeProvider, ThemeToggle, ThinkingRenderer, type ThinkingRendererProps, type ToolCallState, type ToolCallStatus, type ToolRendererMap, type ToolRendererProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TtsConfig, type TtsRequest, TypingIndicator, type UiToolProps, type UseAgentOptions, type UseAgentResult, type UseAgentsResult, type UseChatMessagesOptions, type UseChatMessagesReturn, type UseChatOptions, type UseChatReturn, type UseConfigurationResult, type UseThreadMessagesOptions, type UseThreadsResult, UserMessageRenderer, type UserMessageRendererProps, VoiceInput, type VoiceInputProps, extractContent, useAgent, useAgentDefinitions, useChat, useChatMessages, useChatStateStore, useConfiguration, useDistri, useSidebar, useSpeechToText, useTheme, useThreads, useTts, wrapFnToolAsUiTool, wrapTools };
|