@omniviewdev/ai-ui 0.1.0
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/ai-ui.css +1 -0
- package/dist/index.d.ts +785 -0
- package/dist/index.js +49611 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
import { ComponentSize } from '../../../../base-ui/src/index.ts';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { ComponentVariant } from '../../../../base-ui/src/index.ts';
|
|
4
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
5
|
+
import { HTMLAttributes } from 'react';
|
|
6
|
+
import { JSX } from 'react/jsx-runtime';
|
|
7
|
+
import { NamedExoticComponent } from 'react';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import { RefAttributes } from 'react';
|
|
10
|
+
|
|
11
|
+
export declare const AgentControls: ForwardRefExoticComponent<AgentControlsProps & RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
export declare interface AgentControlsProps extends HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
/** Current agent status */
|
|
15
|
+
status: AgentStatus;
|
|
16
|
+
onStart?: () => void;
|
|
17
|
+
onStop?: () => void;
|
|
18
|
+
onPause?: () => void;
|
|
19
|
+
onResume?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare type AgentStatus = 'idle' | 'running' | 'paused' | 'complete' | 'error';
|
|
23
|
+
|
|
24
|
+
export declare const AgentStatusItem: ForwardRefExoticComponent<AgentStatusItemProps & RefAttributes<HTMLDivElement>>;
|
|
25
|
+
|
|
26
|
+
export declare interface AgentStatusItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
/** Task label */
|
|
28
|
+
label: string;
|
|
29
|
+
/** Current status */
|
|
30
|
+
status: AgentStatus;
|
|
31
|
+
/** Optional detail text */
|
|
32
|
+
detail?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare interface AgentTask {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
status: AgentStatus;
|
|
39
|
+
detail?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare const AgentTaskList: ForwardRefExoticComponent<AgentTaskListProps & RefAttributes<HTMLDivElement>>;
|
|
43
|
+
|
|
44
|
+
export declare interface AgentTaskListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
45
|
+
/** List of agent tasks */
|
|
46
|
+
tasks: AgentTask[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export declare const AIActionConfirmation: ForwardRefExoticComponent<AIActionConfirmationProps & RefAttributes<HTMLDivElement>>;
|
|
50
|
+
|
|
51
|
+
export declare interface AIActionConfirmationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
52
|
+
/** Action title */
|
|
53
|
+
title: string;
|
|
54
|
+
/** Description of the action */
|
|
55
|
+
description: string;
|
|
56
|
+
/** Whether this is a destructive action */
|
|
57
|
+
destructive?: boolean;
|
|
58
|
+
/** Optional resource identifier (e.g. "production/web-deploy") */
|
|
59
|
+
resource?: string;
|
|
60
|
+
/** Optional custom icon override */
|
|
61
|
+
icon?: ReactNode;
|
|
62
|
+
/** Confirm button label. Default: "Apply" (or "Confirm" for destructive). */
|
|
63
|
+
confirmLabel?: string;
|
|
64
|
+
/** Cancel button label. Default: "Cancel". */
|
|
65
|
+
cancelLabel?: string;
|
|
66
|
+
/** Confirm callback */
|
|
67
|
+
onConfirm: () => void;
|
|
68
|
+
/** Cancel callback */
|
|
69
|
+
onCancel: () => void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare const AIArtifact: ForwardRefExoticComponent<AIArtifactProps & RefAttributes<HTMLDivElement>>;
|
|
73
|
+
|
|
74
|
+
export declare const AIArtifactAction: ForwardRefExoticComponent<AIArtifactActionProps & RefAttributes<HTMLButtonElement>>;
|
|
75
|
+
|
|
76
|
+
export declare interface AIArtifactActionProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
|
|
77
|
+
/** Tooltip text */
|
|
78
|
+
tooltip?: string;
|
|
79
|
+
/** Button label (for accessibility, may be visually hidden) */
|
|
80
|
+
label: string;
|
|
81
|
+
/** Icon component */
|
|
82
|
+
icon?: ComponentType<{
|
|
83
|
+
size?: number;
|
|
84
|
+
}>;
|
|
85
|
+
/** Destructive action styling */
|
|
86
|
+
destructive?: boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export declare const AIArtifactActions: ForwardRefExoticComponent<AIArtifactActionsProps & RefAttributes<HTMLDivElement>>;
|
|
90
|
+
|
|
91
|
+
export declare interface AIArtifactActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
92
|
+
children: ReactNode;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare const AIArtifactClose: ForwardRefExoticComponent<AIArtifactCloseProps & RefAttributes<HTMLButtonElement>>;
|
|
96
|
+
|
|
97
|
+
export declare interface AIArtifactCloseProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export declare const AIArtifactContent: ForwardRefExoticComponent<AIArtifactContentProps & RefAttributes<HTMLDivElement>>;
|
|
101
|
+
|
|
102
|
+
export declare interface AIArtifactContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
103
|
+
children: ReactNode;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export declare const AIArtifactDescription: ForwardRefExoticComponent<AIArtifactDescriptionProps & RefAttributes<HTMLParagraphElement>>;
|
|
107
|
+
|
|
108
|
+
export declare interface AIArtifactDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
109
|
+
children: ReactNode;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare const AIArtifactHeader: ForwardRefExoticComponent<AIArtifactHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
113
|
+
|
|
114
|
+
export declare interface AIArtifactHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
115
|
+
children: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export declare interface AIArtifactProps extends HTMLAttributes<HTMLDivElement> {
|
|
119
|
+
/** Whether the artifact panel is open (for panel mode) */
|
|
120
|
+
open?: boolean;
|
|
121
|
+
/** Visual mode */
|
|
122
|
+
variant?: 'embedded' | 'panel';
|
|
123
|
+
children: ReactNode;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare const AIArtifactTitle: ForwardRefExoticComponent<AIArtifactTitleProps & RefAttributes<HTMLHeadingElement>>;
|
|
127
|
+
|
|
128
|
+
export declare interface AIArtifactTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
129
|
+
children: ReactNode;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare const AIAttachment: ForwardRefExoticComponent<AIAttachmentProps & RefAttributes<HTMLDivElement>>;
|
|
133
|
+
|
|
134
|
+
export declare interface AIAttachmentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
135
|
+
/** File name */
|
|
136
|
+
name: string;
|
|
137
|
+
/** File size in bytes */
|
|
138
|
+
size?: number;
|
|
139
|
+
/** File type category */
|
|
140
|
+
type: 'file' | 'image' | 'code' | 'document';
|
|
141
|
+
/** Preview URL (for images) */
|
|
142
|
+
previewUrl?: string;
|
|
143
|
+
/** Remove callback */
|
|
144
|
+
onRemove?: () => void;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export declare const AIBranch: ForwardRefExoticComponent<AIBranchProps & RefAttributes<HTMLDivElement>>;
|
|
148
|
+
|
|
149
|
+
export declare const AIBranchContent: ForwardRefExoticComponent<AIBranchContentProps & RefAttributes<HTMLDivElement>>;
|
|
150
|
+
|
|
151
|
+
export declare interface AIBranchContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
152
|
+
/** Branch index this content belongs to */
|
|
153
|
+
index: number;
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare const AIBranchIndicator: ForwardRefExoticComponent<AIBranchIndicatorProps & RefAttributes<HTMLSpanElement>>;
|
|
158
|
+
|
|
159
|
+
export declare interface AIBranchIndicatorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare const AIBranchNext: ForwardRefExoticComponent<AIBranchNextProps & RefAttributes<HTMLElement>>;
|
|
163
|
+
|
|
164
|
+
export declare interface AIBranchNextProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export declare const AIBranchPrevious: ForwardRefExoticComponent<AIBranchPreviousProps & RefAttributes<HTMLElement>>;
|
|
168
|
+
|
|
169
|
+
export declare interface AIBranchPreviousProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export declare interface AIBranchProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
173
|
+
/** Total number of branches */
|
|
174
|
+
count: number;
|
|
175
|
+
/** Currently active branch index (0-based) */
|
|
176
|
+
active: number;
|
|
177
|
+
/** Called when the user navigates to a different branch */
|
|
178
|
+
onChange?: (index: number) => void;
|
|
179
|
+
children: ReactNode;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare const AIBranchSelector: ForwardRefExoticComponent<AIBranchSelectorProps & RefAttributes<HTMLDivElement>>;
|
|
183
|
+
|
|
184
|
+
export declare interface AIBranchSelectorProps extends HTMLAttributes<HTMLDivElement> {
|
|
185
|
+
/** Alignment hint for positioning */
|
|
186
|
+
align?: 'start' | 'end';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export declare const AICodeBlock: ForwardRefExoticComponent<AICodeBlockProps & RefAttributes<HTMLDivElement>>;
|
|
190
|
+
|
|
191
|
+
export declare interface AICodeBlockProps extends HTMLAttributes<HTMLDivElement> {
|
|
192
|
+
/** Code content */
|
|
193
|
+
code: string;
|
|
194
|
+
/** Programming language */
|
|
195
|
+
language?: string;
|
|
196
|
+
/** Optional filename header */
|
|
197
|
+
filename?: string;
|
|
198
|
+
/** Show line numbers (default: false) */
|
|
199
|
+
showLineNumbers?: boolean;
|
|
200
|
+
/** Action buttons (copy, apply, insert) */
|
|
201
|
+
actions?: ReactNode;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export declare const AICommandSuggestion: ForwardRefExoticComponent<AICommandSuggestionProps & RefAttributes<HTMLDivElement>>;
|
|
205
|
+
|
|
206
|
+
export declare interface AICommandSuggestionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
207
|
+
/** The command to suggest */
|
|
208
|
+
command: string;
|
|
209
|
+
/** Description of what the command does */
|
|
210
|
+
description?: string;
|
|
211
|
+
/** Whether the command is destructive */
|
|
212
|
+
destructive?: boolean;
|
|
213
|
+
/** Apply/execute callback */
|
|
214
|
+
onApply?: () => void;
|
|
215
|
+
/** Copy callback */
|
|
216
|
+
onCopy?: () => void;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare const AIContextIndicator: ForwardRefExoticComponent<AIContextIndicatorProps & RefAttributes<HTMLDivElement>>;
|
|
220
|
+
|
|
221
|
+
export declare interface AIContextIndicatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
222
|
+
/** Context items available */
|
|
223
|
+
items: ContextItem[];
|
|
224
|
+
/** Max items to show before "+N more" (default: 3) */
|
|
225
|
+
maxVisible?: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export declare const AIConversationHeader: ForwardRefExoticComponent<AIConversationHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
229
|
+
|
|
230
|
+
export declare interface AIConversationHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
231
|
+
/** Conversation title */
|
|
232
|
+
title: string;
|
|
233
|
+
/** Model name or info */
|
|
234
|
+
model?: string;
|
|
235
|
+
/** New chat callback */
|
|
236
|
+
onNewChat?: () => void;
|
|
237
|
+
/** Settings callback */
|
|
238
|
+
onSettings?: () => void;
|
|
239
|
+
/** Additional actions slot */
|
|
240
|
+
actions?: ReactNode;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export declare const AICostIndicator: ForwardRefExoticComponent<AICostIndicatorProps & RefAttributes<HTMLSpanElement>>;
|
|
244
|
+
|
|
245
|
+
export declare interface AICostIndicatorProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
|
|
246
|
+
/** Cost value */
|
|
247
|
+
cost: number;
|
|
248
|
+
/** Currency symbol (default: "$") */
|
|
249
|
+
currency?: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export declare const AIErrorMessage: ForwardRefExoticComponent<AIErrorMessageProps & RefAttributes<HTMLDivElement>>;
|
|
253
|
+
|
|
254
|
+
export declare interface AIErrorMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
255
|
+
/** Error title (default: "Generation failed") */
|
|
256
|
+
title?: string;
|
|
257
|
+
/** Error message/description */
|
|
258
|
+
message: string;
|
|
259
|
+
/** Retry callback */
|
|
260
|
+
onRetry?: () => void;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export declare const AIFollowUp: ForwardRefExoticComponent<AIFollowUpProps & RefAttributes<HTMLDivElement>>;
|
|
264
|
+
|
|
265
|
+
export declare interface AIFollowUpProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onSelect'> {
|
|
266
|
+
/** Suggested follow-up questions */
|
|
267
|
+
suggestions: string[];
|
|
268
|
+
/** Called when a suggestion is selected */
|
|
269
|
+
onSelect?: (suggestion: string) => void;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export declare const AIImageGeneration: ForwardRefExoticComponent<AIImageGenerationProps & RefAttributes<HTMLDivElement>>;
|
|
273
|
+
|
|
274
|
+
export declare interface AIImageGenerationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
275
|
+
/** Generated image URL */
|
|
276
|
+
src?: string;
|
|
277
|
+
/** Alt text */
|
|
278
|
+
alt: string;
|
|
279
|
+
/** Whether image is still generating */
|
|
280
|
+
loading?: boolean;
|
|
281
|
+
/** Image prompt used */
|
|
282
|
+
prompt?: string;
|
|
283
|
+
/** Expected aspect ratio (width / height). Default: 1 (square). */
|
|
284
|
+
aspectRatio?: number;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export declare const AIInferenceStats: ForwardRefExoticComponent<AIInferenceStatsProps & RefAttributes<HTMLDivElement>>;
|
|
288
|
+
|
|
289
|
+
export declare interface AIInferenceStatsProps extends HTMLAttributes<HTMLDivElement> {
|
|
290
|
+
/** Tokens per second throughput */
|
|
291
|
+
throughput?: number;
|
|
292
|
+
/** Total tokens generated */
|
|
293
|
+
tokenCount?: number;
|
|
294
|
+
/** Latency in seconds */
|
|
295
|
+
latency?: number;
|
|
296
|
+
/** Stop reason (e.g. "EOS Token Found", "max_tokens") */
|
|
297
|
+
stopReason?: string;
|
|
298
|
+
/** Optional input token breakdown */
|
|
299
|
+
inputTokens?: number;
|
|
300
|
+
/** Optional output token breakdown */
|
|
301
|
+
outputTokens?: number;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export declare const AIInlineCitation: ForwardRefExoticComponent<AIInlineCitationProps & RefAttributes<HTMLSpanElement>>;
|
|
305
|
+
|
|
306
|
+
export declare interface AIInlineCitationProps extends HTMLAttributes<HTMLSpanElement> {
|
|
307
|
+
/** Citation index number */
|
|
308
|
+
index: number;
|
|
309
|
+
/** Source label (shown in tooltip) */
|
|
310
|
+
source?: string;
|
|
311
|
+
/** Click handler to navigate to source */
|
|
312
|
+
onNavigate?: () => void;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export declare const AIMarkdown: ForwardRefExoticComponent<AIMarkdownProps & RefAttributes<HTMLDivElement>>;
|
|
316
|
+
|
|
317
|
+
export declare interface AIMarkdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
318
|
+
/** Async iterable that yields markdown chunks (e.g., from an LLM API) */
|
|
319
|
+
stream?: AsyncIterable<string>;
|
|
320
|
+
/** Static markdown content */
|
|
321
|
+
content?: string;
|
|
322
|
+
/** Whether content is still actively streaming (only needed when using content prop directly) */
|
|
323
|
+
streaming?: boolean;
|
|
324
|
+
/** Show blinking cursor while streaming (default: true) */
|
|
325
|
+
cursor?: boolean;
|
|
326
|
+
/** Callback when streaming completes */
|
|
327
|
+
onComplete?: () => void;
|
|
328
|
+
/** Callback with accumulated markdown on each chunk */
|
|
329
|
+
onChunk?: (accumulated: string) => void;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export declare const AIMessageActions: ForwardRefExoticComponent<AIMessageActionsProps & RefAttributes<HTMLDivElement>>;
|
|
333
|
+
|
|
334
|
+
export declare interface AIMessageActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
335
|
+
/** Copy message content */
|
|
336
|
+
onCopy?: () => void;
|
|
337
|
+
/** Regenerate response */
|
|
338
|
+
onRegenerate?: () => void;
|
|
339
|
+
/** Edit message */
|
|
340
|
+
onEdit?: () => void;
|
|
341
|
+
/** Share or forward message */
|
|
342
|
+
onShare?: () => void;
|
|
343
|
+
/** Branch/fork conversation from this message */
|
|
344
|
+
onBranch?: () => void;
|
|
345
|
+
/** Delete message */
|
|
346
|
+
onDelete?: () => void;
|
|
347
|
+
/** Feedback value: 'positive' | 'negative' | null */
|
|
348
|
+
feedback?: 'positive' | 'negative' | null;
|
|
349
|
+
/** Feedback callback */
|
|
350
|
+
onFeedback?: (value: 'positive' | 'negative') => void;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export declare const AIMessageEditor: ForwardRefExoticComponent<AIMessageEditorProps & RefAttributes<HTMLDivElement>>;
|
|
354
|
+
|
|
355
|
+
export declare interface AIMessageEditorProps extends HTMLAttributes<HTMLDivElement> {
|
|
356
|
+
/** Initial text content to edit */
|
|
357
|
+
defaultValue: string;
|
|
358
|
+
/** Called with the edited text when the user saves */
|
|
359
|
+
onSave: (value: string) => void;
|
|
360
|
+
/** Called when the user cancels editing */
|
|
361
|
+
onCancel: () => void;
|
|
362
|
+
/** Placeholder text */
|
|
363
|
+
placeholder?: string;
|
|
364
|
+
/** Whether the save action is in progress (disables controls) */
|
|
365
|
+
saving?: boolean;
|
|
366
|
+
/** Auto-focus the textarea on mount (default: true) */
|
|
367
|
+
autoFocus?: boolean;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export declare const AIMessageGroup: ForwardRefExoticComponent<AIMessageGroupProps & RefAttributes<HTMLDivElement>>;
|
|
371
|
+
|
|
372
|
+
export declare interface AIMessageGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
373
|
+
/** Chat role for the group */
|
|
374
|
+
role: ChatRole;
|
|
375
|
+
/** Avatar to show once for the group */
|
|
376
|
+
avatar?: ReactNode;
|
|
377
|
+
children: ReactNode;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export declare interface AIModel {
|
|
381
|
+
id: string;
|
|
382
|
+
name: string;
|
|
383
|
+
description?: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export declare const AIModelSelector: ForwardRefExoticComponent<AIModelSelectorProps & RefAttributes<HTMLDivElement>>;
|
|
387
|
+
|
|
388
|
+
export declare interface AIModelSelectorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {
|
|
389
|
+
/** Available models */
|
|
390
|
+
models: AIModel[];
|
|
391
|
+
/** Currently selected model ID */
|
|
392
|
+
value?: string;
|
|
393
|
+
/** Selection callback */
|
|
394
|
+
onChange?: (modelId: string) => void;
|
|
395
|
+
/** Disabled state */
|
|
396
|
+
disabled?: boolean;
|
|
397
|
+
/** Size variant. Default: 'sm'. */
|
|
398
|
+
size?: ComponentSize;
|
|
399
|
+
/** Visual variant. Default: 'outline'. */
|
|
400
|
+
variant?: ComponentVariant;
|
|
401
|
+
/** Whether to show the bot icon. Default: true. */
|
|
402
|
+
showIcon?: boolean;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export declare const AIRetryButton: ForwardRefExoticComponent<AIRetryButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
406
|
+
|
|
407
|
+
export declare interface AIRetryButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
|
|
408
|
+
/** Retry callback */
|
|
409
|
+
onRetry: () => void;
|
|
410
|
+
/** Whether retry is in progress */
|
|
411
|
+
retrying?: boolean;
|
|
412
|
+
/** Label (default: "Retry") */
|
|
413
|
+
label?: string;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export declare interface AISource {
|
|
417
|
+
id: string;
|
|
418
|
+
label: string;
|
|
419
|
+
url?: string;
|
|
420
|
+
detail?: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export declare const AISources: ForwardRefExoticComponent<AISourcesProps & RefAttributes<HTMLDivElement>>;
|
|
424
|
+
|
|
425
|
+
export declare interface AISourcesProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
426
|
+
/** List of sources */
|
|
427
|
+
sources: AISource[];
|
|
428
|
+
/** Called when a source is clicked */
|
|
429
|
+
onNavigate?: (source: AISource) => void;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export declare const AIStopButton: ForwardRefExoticComponent<AIStopButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
433
|
+
|
|
434
|
+
export declare interface AIStopButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color'> {
|
|
435
|
+
/** Click handler to stop generation */
|
|
436
|
+
onStop: () => void;
|
|
437
|
+
/** Whether stop is in progress */
|
|
438
|
+
stopping?: boolean;
|
|
439
|
+
/** Button label (default: "Stop generating") */
|
|
440
|
+
label?: string;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export declare const AITokenUsage: ForwardRefExoticComponent<AITokenUsageProps & RefAttributes<HTMLDivElement>>;
|
|
444
|
+
|
|
445
|
+
export declare interface AITokenUsageProps extends HTMLAttributes<HTMLDivElement> {
|
|
446
|
+
/** Input/prompt token count */
|
|
447
|
+
inputTokens: number;
|
|
448
|
+
/** Output/completion token count */
|
|
449
|
+
outputTokens: number;
|
|
450
|
+
/** Optional total (defaults to input + output) */
|
|
451
|
+
total?: number;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Brain icon used by ThinkingBlock and ChainOfThought for visual consistency.
|
|
456
|
+
* Inline SVG to avoid dependency on a specific icon library for the "thinking" look.
|
|
457
|
+
*/
|
|
458
|
+
declare const BrainIcon: NamedExoticComponent< {
|
|
459
|
+
size?: number;
|
|
460
|
+
}>;
|
|
461
|
+
export { BrainIcon }
|
|
462
|
+
export { BrainIcon as ThinkingBrainIcon }
|
|
463
|
+
|
|
464
|
+
export declare const ChainOfThought: ForwardRefExoticComponent<ChainOfThoughtProps & RefAttributes<HTMLDivElement>>;
|
|
465
|
+
|
|
466
|
+
export declare const ChainOfThoughtFile: NamedExoticComponent<ChainOfThoughtFileProps>;
|
|
467
|
+
|
|
468
|
+
export declare interface ChainOfThoughtFileProps {
|
|
469
|
+
/** Display name (filename, resource name, etc.) */
|
|
470
|
+
name: string;
|
|
471
|
+
/** Resource type — determines the icon */
|
|
472
|
+
type?: 'file' | 'resource' | 'log' | 'config' | 'query' | 'url';
|
|
473
|
+
/** Full path or identifier (shown in tooltip) */
|
|
474
|
+
path?: string;
|
|
475
|
+
/** Click handler (e.g., navigate to resource) */
|
|
476
|
+
onClick?: () => void;
|
|
477
|
+
className?: string;
|
|
478
|
+
style?: React.CSSProperties;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export declare function ChainOfThoughtFiles({ children, className, ...rest }: ChainOfThoughtFilesProps): JSX.Element;
|
|
482
|
+
|
|
483
|
+
export declare interface ChainOfThoughtFilesProps extends HTMLAttributes<HTMLDivElement> {
|
|
484
|
+
children: ReactNode;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export declare function ChainOfThoughtHeader({ children, className, ...rest }: ChainOfThoughtHeaderProps): JSX.Element;
|
|
488
|
+
|
|
489
|
+
export declare interface ChainOfThoughtHeaderProps extends HTMLAttributes<HTMLButtonElement> {
|
|
490
|
+
children?: ReactNode;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export declare function ChainOfThoughtImage({ caption, children, className, ...rest }: ChainOfThoughtImageProps): JSX.Element;
|
|
494
|
+
|
|
495
|
+
export declare interface ChainOfThoughtImageProps extends HTMLAttributes<HTMLDivElement> {
|
|
496
|
+
caption?: string;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export declare interface ChainOfThoughtProps extends HTMLAttributes<HTMLDivElement> {
|
|
500
|
+
/** Declarative steps API (alternative to using children) */
|
|
501
|
+
steps?: ChainOfThoughtStepData[];
|
|
502
|
+
/** Start expanded (default: false) */
|
|
503
|
+
defaultOpen?: boolean;
|
|
504
|
+
/** Controlled open state */
|
|
505
|
+
open?: boolean;
|
|
506
|
+
/** Header text (default: "Chain of Thought") */
|
|
507
|
+
header?: string;
|
|
508
|
+
/** Custom header content (overrides header text) */
|
|
509
|
+
headerContent?: ReactNode;
|
|
510
|
+
/** Child elements (for compound component pattern) */
|
|
511
|
+
children?: ReactNode;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export declare function ChainOfThoughtSearchResult({ label, children, className, }: ChainOfThoughtSearchResultProps): JSX.Element;
|
|
515
|
+
|
|
516
|
+
declare interface ChainOfThoughtSearchResultProps {
|
|
517
|
+
/** Text label for the chip */
|
|
518
|
+
label?: string;
|
|
519
|
+
children?: ReactNode;
|
|
520
|
+
className?: string;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export declare function ChainOfThoughtSearchResults({ children, className, ...rest }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
524
|
+
|
|
525
|
+
export declare function ChainOfThoughtStep({ icon: Icon, label, description, status, tags, children, className, ...rest }: ChainOfThoughtStepProps): JSX.Element;
|
|
526
|
+
|
|
527
|
+
export declare interface ChainOfThoughtStepData {
|
|
528
|
+
id: string;
|
|
529
|
+
label: string;
|
|
530
|
+
content?: string;
|
|
531
|
+
description?: string;
|
|
532
|
+
status: StepStatus;
|
|
533
|
+
/** Icon component override */
|
|
534
|
+
icon?: ComponentType<{
|
|
535
|
+
size?: number | string;
|
|
536
|
+
className?: string;
|
|
537
|
+
}>;
|
|
538
|
+
/** Tags/chips to show under the step */
|
|
539
|
+
tags?: string[];
|
|
540
|
+
/** Arbitrary children rendered after description/tags */
|
|
541
|
+
children?: ReactNode;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export declare interface ChainOfThoughtStepProps extends HTMLAttributes<HTMLDivElement> {
|
|
545
|
+
/** Icon component for the step */
|
|
546
|
+
icon?: ComponentType<{
|
|
547
|
+
size?: number | string;
|
|
548
|
+
className?: string;
|
|
549
|
+
}>;
|
|
550
|
+
/** Step label text */
|
|
551
|
+
label: string;
|
|
552
|
+
/** Description text below label */
|
|
553
|
+
description?: string;
|
|
554
|
+
/** Step status */
|
|
555
|
+
status?: StepStatus;
|
|
556
|
+
/** Tags/chips to display */
|
|
557
|
+
tags?: string[];
|
|
558
|
+
/** Arbitrary children (rendered after description and tags) */
|
|
559
|
+
children?: ReactNode;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export declare const ChatAvatar: ForwardRefExoticComponent<ChatAvatarProps & RefAttributes<HTMLDivElement>>;
|
|
563
|
+
|
|
564
|
+
export declare interface ChatAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
565
|
+
/** Role determines default icon/color */
|
|
566
|
+
role: ChatRole;
|
|
567
|
+
/** Image source for the avatar */
|
|
568
|
+
src?: string;
|
|
569
|
+
/** Display name (used for initials fallback) */
|
|
570
|
+
name?: string;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export declare const ChatBubble: ForwardRefExoticComponent<ChatBubbleProps & RefAttributes<HTMLDivElement>>;
|
|
574
|
+
|
|
575
|
+
export declare interface ChatBubbleProps extends HTMLAttributes<HTMLDivElement> {
|
|
576
|
+
/** Message role determines alignment and styling */
|
|
577
|
+
role: ChatRole;
|
|
578
|
+
/** Avatar node rendered beside the bubble */
|
|
579
|
+
avatar?: ReactNode;
|
|
580
|
+
/** Timestamp of the message */
|
|
581
|
+
timestamp?: Date;
|
|
582
|
+
/** Action buttons (copy, retry, edit) shown on hover */
|
|
583
|
+
actions?: ReactNode;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export declare const ChatInput: ForwardRefExoticComponent<ChatInputProps & RefAttributes<HTMLDivElement>>;
|
|
587
|
+
|
|
588
|
+
export declare interface ChatInputProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onSubmit'> {
|
|
589
|
+
/** Current input value */
|
|
590
|
+
value: string;
|
|
591
|
+
/** Callback when value changes */
|
|
592
|
+
onChange: (value: string) => void;
|
|
593
|
+
/** Callback when user submits (Enter without Shift) */
|
|
594
|
+
onSubmit: (value: string) => void;
|
|
595
|
+
/** Placeholder text */
|
|
596
|
+
placeholder?: string;
|
|
597
|
+
/** Disable input */
|
|
598
|
+
disabled?: boolean;
|
|
599
|
+
/** Auto-focus textarea on mount (default: false) */
|
|
600
|
+
autoFocus?: boolean;
|
|
601
|
+
/** Re-focus textarea when `disabled` transitions from true → false (default: true) */
|
|
602
|
+
focusOnEnable?: boolean;
|
|
603
|
+
/** Re-focus textarea when the window regains focus (default: true) */
|
|
604
|
+
focusOnWindowFocus?: boolean;
|
|
605
|
+
/** Left-aligned toolbar items (e.g. attachment button, model selector, capability chips) */
|
|
606
|
+
startActions?: ReactNode;
|
|
607
|
+
/** Right-aligned toolbar items (e.g. token counter, send/stop button) */
|
|
608
|
+
endActions?: ReactNode;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export declare const ChatMessageList: ForwardRefExoticComponent<ChatMessageListProps & RefAttributes<ChatMessageListHandle>>;
|
|
612
|
+
|
|
613
|
+
export declare interface ChatMessageListHandle {
|
|
614
|
+
scrollToBottom: () => void;
|
|
615
|
+
scrollToIndex: (index: number) => void;
|
|
616
|
+
getScrollElement: () => HTMLDivElement | null;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export declare interface ChatMessageListProps extends HTMLAttributes<HTMLDivElement> {
|
|
620
|
+
/** Auto-scroll to bottom on new children (default: true) */
|
|
621
|
+
autoScroll?: boolean;
|
|
622
|
+
/** Callback when user scrolls to top (for loading older messages) */
|
|
623
|
+
onScrollToTop?: () => void;
|
|
624
|
+
/** Total number of items for virtualization */
|
|
625
|
+
count: number;
|
|
626
|
+
/** Estimated height per item in pixels (default: 80) */
|
|
627
|
+
estimateSize?: number;
|
|
628
|
+
/** Render function for each item by index */
|
|
629
|
+
renderItem: (index: number) => React.ReactNode;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export declare type ChatRole = 'user' | 'assistant' | 'system';
|
|
633
|
+
|
|
634
|
+
export declare interface ChatSuggestion {
|
|
635
|
+
label: string;
|
|
636
|
+
value: string;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export declare const ChatSuggestions: ForwardRefExoticComponent<ChatSuggestionsProps & RefAttributes<HTMLDivElement>>;
|
|
640
|
+
|
|
641
|
+
export declare interface ChatSuggestionsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
642
|
+
/** List of suggested prompts */
|
|
643
|
+
suggestions: ChatSuggestion[];
|
|
644
|
+
/** Called when a suggestion is selected */
|
|
645
|
+
onSelect: (value: string) => void;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export declare interface ContextItem {
|
|
649
|
+
type: 'file' | 'tool' | 'database' | 'custom';
|
|
650
|
+
label: string;
|
|
651
|
+
icon?: ReactNode;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
export declare const PermissionRequest: ForwardRefExoticComponent<PermissionRequestProps & RefAttributes<HTMLDivElement>>;
|
|
655
|
+
|
|
656
|
+
export declare interface PermissionRequestProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
657
|
+
/** Tool requesting permission */
|
|
658
|
+
tool: string;
|
|
659
|
+
/** Human-readable description of the action */
|
|
660
|
+
description: string;
|
|
661
|
+
/** Permission scope (e.g. "workspace", "file:/path") */
|
|
662
|
+
scope: string;
|
|
663
|
+
/** Raw content to review — shell command, file path, script, etc. */
|
|
664
|
+
content?: string;
|
|
665
|
+
/** Allow this specific action */
|
|
666
|
+
onAllow: () => void;
|
|
667
|
+
/** Deny this action */
|
|
668
|
+
onDeny: () => void;
|
|
669
|
+
/** Allow permanently for this tool */
|
|
670
|
+
onAllowAlways?: () => void;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
export declare type StepStatus = 'pending' | 'active' | 'complete' | 'error';
|
|
674
|
+
|
|
675
|
+
export declare const StreamingText: ForwardRefExoticComponent<StreamingTextProps & RefAttributes<HTMLDivElement>>;
|
|
676
|
+
|
|
677
|
+
export declare interface StreamingTextProps extends HTMLAttributes<HTMLDivElement> {
|
|
678
|
+
/** Async iterable that yields text chunks (e.g., from an LLM API) */
|
|
679
|
+
stream?: AsyncIterable<string>;
|
|
680
|
+
/** Static content to display (no streaming animation) */
|
|
681
|
+
content?: string;
|
|
682
|
+
/** Show blinking cursor while streaming (default: true) */
|
|
683
|
+
cursor?: boolean;
|
|
684
|
+
/** Callback when streaming completes */
|
|
685
|
+
onComplete?: () => void;
|
|
686
|
+
/** Callback with accumulated text on each chunk */
|
|
687
|
+
onChunk?: (accumulated: string) => void;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export declare const ThinkingBlock: ForwardRefExoticComponent<ThinkingBlockProps & RefAttributes<HTMLDivElement>>;
|
|
691
|
+
|
|
692
|
+
export declare interface ThinkingBlockProps extends HTMLAttributes<HTMLDivElement> {
|
|
693
|
+
/** Static reasoning text content (use `stream` for incremental input) */
|
|
694
|
+
content?: string;
|
|
695
|
+
/** Async iterable that yields thinking text chunks — the primary API for
|
|
696
|
+
* real model integrations where thinking tokens arrive incrementally.
|
|
697
|
+
* Automatically manages streaming state and duration measurement. */
|
|
698
|
+
stream?: AsyncIterable<string>;
|
|
699
|
+
/** Start expanded (default: false) */
|
|
700
|
+
defaultExpanded?: boolean;
|
|
701
|
+
/** Whether content is still streaming in (only needed with `content` prop;
|
|
702
|
+
* automatically managed when using `stream`) */
|
|
703
|
+
streaming?: boolean;
|
|
704
|
+
/** Thinking duration in ms (automatically measured when using `stream`) */
|
|
705
|
+
duration?: number;
|
|
706
|
+
/** Callback fired when the stream finishes */
|
|
707
|
+
onComplete?: () => void;
|
|
708
|
+
/** Auto-close after streaming completes (default: true) */
|
|
709
|
+
autoClose?: boolean;
|
|
710
|
+
/** Delay before auto-closing in ms (default: 1000) */
|
|
711
|
+
autoCloseDelay?: number;
|
|
712
|
+
/** Custom trigger content (replaces default trigger) */
|
|
713
|
+
trigger?: ReactNode;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export declare function ThinkingTrigger({ children, className, ...rest }: HTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
717
|
+
|
|
718
|
+
export declare const ToolCall: ForwardRefExoticComponent<ToolCallProps & RefAttributes<HTMLDivElement>>;
|
|
719
|
+
|
|
720
|
+
export declare const ToolCallList: ForwardRefExoticComponent<ToolCallListProps & RefAttributes<HTMLDivElement>>;
|
|
721
|
+
|
|
722
|
+
export declare interface ToolCallListItem {
|
|
723
|
+
id: string;
|
|
724
|
+
name: string;
|
|
725
|
+
arguments?: Record<string, unknown>;
|
|
726
|
+
status: ToolCallStatus;
|
|
727
|
+
duration?: number;
|
|
728
|
+
/** Result content — can be a static ReactNode or a streaming component.
|
|
729
|
+
* Rendered inside the ToolCall's collapsible children area. */
|
|
730
|
+
result?: ReactNode;
|
|
731
|
+
resultStatus?: 'success' | 'error';
|
|
732
|
+
/** Whether the item should be expanded (default: auto — expands when running
|
|
733
|
+
* with result content, collapses when complete) */
|
|
734
|
+
expanded?: boolean;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
export declare interface ToolCallListProps extends HTMLAttributes<HTMLDivElement> {
|
|
738
|
+
/** List of tool calls with optional results */
|
|
739
|
+
calls: ToolCallListItem[];
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export declare interface ToolCallProps extends HTMLAttributes<HTMLDivElement> {
|
|
743
|
+
/** Tool function name */
|
|
744
|
+
name: string;
|
|
745
|
+
/** Tool arguments (shown in collapsible detail section) */
|
|
746
|
+
arguments?: Record<string, unknown>;
|
|
747
|
+
/** Current execution status */
|
|
748
|
+
status: ToolCallStatus;
|
|
749
|
+
/** Execution duration in ms */
|
|
750
|
+
duration?: number;
|
|
751
|
+
/** Whether the detail section (args + children) starts expanded.
|
|
752
|
+
* Defaults to false. Automatically opens when status transitions to
|
|
753
|
+
* 'running' if there are children to show. */
|
|
754
|
+
defaultExpanded?: boolean;
|
|
755
|
+
/** Controlled expanded state (overrides internal state) */
|
|
756
|
+
expanded?: boolean;
|
|
757
|
+
/** Result content rendered below the arguments. Use this for tool output —
|
|
758
|
+
* can be a static ReactNode or a streaming component like
|
|
759
|
+
* `<StreamingText stream={...} />`. Content is visible when expanded. */
|
|
760
|
+
children?: ReactNode;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export declare type ToolCallStatus = 'pending' | 'running' | 'success' | 'error';
|
|
764
|
+
|
|
765
|
+
export declare const ToolResult: ForwardRefExoticComponent<ToolResultProps & RefAttributes<HTMLDivElement>>;
|
|
766
|
+
|
|
767
|
+
export declare interface ToolResultProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content' | 'color'> {
|
|
768
|
+
/** Result content */
|
|
769
|
+
content: ReactNode;
|
|
770
|
+
/** Result status */
|
|
771
|
+
status: 'success' | 'error';
|
|
772
|
+
/** Whether the content is truncated */
|
|
773
|
+
truncated?: boolean;
|
|
774
|
+
/** Callback to expand truncated content */
|
|
775
|
+
onExpand?: () => void;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export declare const TypingIndicator: ForwardRefExoticComponent<TypingIndicatorProps & RefAttributes<HTMLSpanElement>>;
|
|
779
|
+
|
|
780
|
+
export declare interface TypingIndicatorProps extends HTMLAttributes<HTMLSpanElement> {
|
|
781
|
+
/** Optional label text beside the dots (e.g. "Claude is thinking...") */
|
|
782
|
+
label?: string;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export { }
|