@rdmind/webui 0.2.4-alpha.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.
@@ -0,0 +1,1690 @@
1
+ import { Context } from 'react';
2
+ import { default as default_2 } from 'react';
3
+ import { FC } from 'react';
4
+ import { ForwardRefExoticComponent } from 'react';
5
+ import { JSX } from 'react/jsx-runtime';
6
+ import { NamedExoticComponent } from 'react';
7
+ import { PropsWithChildren } from 'react';
8
+ import { ReactNode } from 'react';
9
+ import { RefAttributes } from 'react';
10
+ import { SVGProps } from 'react';
11
+
12
+ /**
13
+ * ACP message format (vscode-ide-companion input)
14
+ */
15
+ export declare interface ACPMessage {
16
+ type: 'message' | 'in-progress-tool-call' | 'completed-tool-call';
17
+ data: ACPMessageData | ToolCallData;
18
+ }
19
+
20
+ /**
21
+ * ACP text message data
22
+ */
23
+ export declare interface ACPMessageData {
24
+ role: 'user' | 'assistant' | 'thinking';
25
+ content: string;
26
+ timestamp?: number;
27
+ fileContext?: FileContext[];
28
+ }
29
+
30
+ /**
31
+ * Adapt ACP messages to unified format
32
+ *
33
+ * @param messages - Array of ACP messages from vscode-ide-companion
34
+ * @returns Array of unified messages with timeline positions calculated
35
+ */
36
+ export declare function adaptACPMessages(messages: ACPMessage[]): UnifiedMessage[];
37
+
38
+ /**
39
+ * Adapt JSONL messages to unified format
40
+ *
41
+ * @param messages - Array of JSONL messages
42
+ * @returns Array of unified messages with timeline positions calculated
43
+ */
44
+ export declare function adaptJSONLMessages(messages: JSONLMessage[]): UnifiedMessage[];
45
+
46
+ /**
47
+ * Arrow up icon (20x20)
48
+ * Used for send message button
49
+ */
50
+ export declare const ArrowUpIcon: FC<IconProps_2>;
51
+
52
+ /**
53
+ * AssistantMessage component - renders AI responses with styling
54
+ * Supports different states: default, success, error, warning, loading
55
+ */
56
+ export declare const AssistantMessage: FC<AssistantMessageProps>;
57
+
58
+ export declare interface AssistantMessageProps {
59
+ content: string;
60
+ timestamp?: number;
61
+ onFileClick?: (path: string) => void;
62
+ status?: AssistantMessageStatus;
63
+ /** When true, render without the left status bullet (no ::before dot) */
64
+ hideStatusIcon?: boolean;
65
+ /** Whether this is the first item in an AI response sequence (for timeline) */
66
+ isFirst?: boolean;
67
+ /** Whether this is the last item in an AI response sequence (for timeline) */
68
+ isLast?: boolean;
69
+ }
70
+
71
+ export declare type AssistantMessageStatus = 'default' | 'success' | 'error' | 'warning' | 'loading';
72
+
73
+ /**
74
+ * Auto/fast-forward icon (16x16)
75
+ * Used for "Edit automatically" mode
76
+ */
77
+ export declare const AutoEditIcon: FC<IconProps_2>;
78
+
79
+ /**
80
+ * Base props for all tool call components
81
+ */
82
+ export declare interface BaseToolCallProps {
83
+ toolCall: ToolCallData;
84
+ isFirst?: boolean;
85
+ isLast?: boolean;
86
+ }
87
+
88
+ /**
89
+ * Button component with multiple variants and sizes
90
+ *
91
+ * @example
92
+ * ```tsx
93
+ * <Button variant="primary" size="md" onClick={handleClick}>
94
+ * Click me
95
+ * </Button>
96
+ * ```
97
+ */
98
+ export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
99
+
100
+ /**
101
+ * Button component props interface
102
+ */
103
+ declare interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
104
+ /** Button content */
105
+ children: ReactNode;
106
+ /** Visual style variant */
107
+ variant?: ButtonVariant;
108
+ /** Button size */
109
+ size?: ButtonSize;
110
+ /** Loading state - shows spinner and disables button */
111
+ loading?: boolean;
112
+ /** Icon to display before children */
113
+ leftIcon?: ReactNode;
114
+ /** Icon to display after children */
115
+ rightIcon?: ReactNode;
116
+ /** Full width button */
117
+ fullWidth?: boolean;
118
+ }
119
+
120
+ /**
121
+ * Button size types
122
+ */
123
+ declare type ButtonSize = 'sm' | 'md' | 'lg';
124
+
125
+ /**
126
+ * Button variant types
127
+ */
128
+ declare type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost' | 'outline';
129
+
130
+ /**
131
+ * ChatHeader component
132
+ *
133
+ * Features:
134
+ * - Displays current session title with dropdown indicator
135
+ * - Button to view past conversations
136
+ * - Button to create new session
137
+ *
138
+ * @example
139
+ * ```tsx
140
+ * <ChatHeader
141
+ * currentSessionTitle="My Chat"
142
+ * onLoadSessions={() => console.log('Load sessions')}
143
+ * onNewSession={() => console.log('New session')}
144
+ * />
145
+ * ```
146
+ */
147
+ export declare const ChatHeader: FC<ChatHeaderProps>;
148
+
149
+ /**
150
+ * Props for ChatHeader component
151
+ */
152
+ export declare interface ChatHeaderProps {
153
+ /** Current session title to display */
154
+ currentSessionTitle: string;
155
+ /** Callback when user clicks to load session list */
156
+ onLoadSessions: () => void;
157
+ /** Callback when user clicks to create new session */
158
+ onNewSession: () => void;
159
+ }
160
+
161
+ /**
162
+ * Basic chat message structure
163
+ */
164
+ export declare interface ChatMessage {
165
+ role: MessageRole;
166
+ content: string;
167
+ timestamp: number;
168
+ }
169
+
170
+ /**
171
+ * Single chat message from JSONL format
172
+ * Supports both Qwen format and Claude format
173
+ */
174
+ export declare interface ChatMessageData {
175
+ uuid: string;
176
+ parentUuid?: string | null;
177
+ sessionId?: string;
178
+ timestamp: string;
179
+ type: 'user' | 'assistant' | 'system' | 'tool_call';
180
+ message?: {
181
+ role?: string;
182
+ parts?: MessagePart[];
183
+ content?: string | ClaudeContentItem[];
184
+ };
185
+ model?: string;
186
+ toolCall?: ChatViewerToolCallData;
187
+ cwd?: string;
188
+ gitBranch?: string;
189
+ }
190
+
191
+ /**
192
+ * ChatViewer - A standalone component for displaying chat conversations
193
+ *
194
+ * Renders a conversation flow from JSONL-formatted data using existing
195
+ * message components (UserMessage, AssistantMessage, ThinkingMessage).
196
+ * This is a pure UI component without VSCode or external dependencies.
197
+ *
198
+ * @example
199
+ * ```tsx
200
+ * const messages = [
201
+ * { uuid: '1', type: 'user', message: { role: 'user', parts: [{ text: 'Hello!' }] }, ... },
202
+ * { uuid: '2', type: 'assistant', message: { role: 'model', parts: [{ text: 'Hi there!' }] }, ... },
203
+ * ];
204
+ *
205
+ * <ChatViewer messages={messages} onFileClick={(path) => console.log(path)} />
206
+ * ```
207
+ *
208
+ * @example With ref for programmatic control
209
+ * ```tsx
210
+ * const chatRef = useRef<ChatViewerHandle>(null);
211
+ *
212
+ * // Scroll to bottom programmatically
213
+ * chatRef.current?.scrollToBottom('smooth');
214
+ *
215
+ * <ChatViewer ref={chatRef} messages={messages} />
216
+ * ```
217
+ */
218
+ declare const ChatViewer: ForwardRefExoticComponent<ChatViewerProps & RefAttributes<ChatViewerHandle>>;
219
+ export { ChatViewer }
220
+ export { ChatViewer as ChatViewerDefault }
221
+
222
+ /**
223
+ * ChatViewer ref handle for programmatic control
224
+ */
225
+ export declare interface ChatViewerHandle {
226
+ /** Scroll to the bottom of the messages */
227
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
228
+ /** Scroll to the top of the messages */
229
+ scrollToTop: (behavior?: ScrollBehavior) => void;
230
+ /** Get the scroll container element */
231
+ getScrollContainer: () => HTMLDivElement | null;
232
+ }
233
+
234
+ /**
235
+ * ChatViewer component props
236
+ */
237
+ export declare interface ChatViewerProps {
238
+ /** Array of chat messages in JSONL format */
239
+ messages: ChatMessageData[];
240
+ /** Optional additional CSS class name */
241
+ className?: string;
242
+ /** Optional callback when a file path is clicked */
243
+ onFileClick?: (path: string) => void;
244
+ /** Optional empty state message */
245
+ emptyMessage?: string;
246
+ /** Whether to auto-scroll to bottom when new messages arrive (default: true) */
247
+ autoScroll?: boolean;
248
+ /** Theme variant: 'dark' | 'light' | 'auto' (default: 'auto') */
249
+ theme?: 'dark' | 'light' | 'auto';
250
+ /** Show empty state icon (default: true) */
251
+ showEmptyIcon?: boolean;
252
+ }
253
+
254
+ /**
255
+ * Tool call data for rendering tool call UI
256
+ */
257
+ export declare type ChatViewerToolCallData = ToolCallData;
258
+
259
+ /**
260
+ * Display-only checkbox styled via Tailwind classes.
261
+ * - Renders a custom-looking checkbox using appearance-none and pseudo-elements.
262
+ * - Supports indeterminate (middle) state using a data- attribute.
263
+ * - Intended for read-only display (disabled by default).
264
+ */
265
+ export declare const CheckboxDisplay: FC<CheckboxDisplayProps>;
266
+
267
+ export declare interface CheckboxDisplayProps {
268
+ checked?: boolean;
269
+ indeterminate?: boolean;
270
+ disabled?: boolean;
271
+ className?: string;
272
+ style?: React.CSSProperties;
273
+ title?: string;
274
+ }
275
+
276
+ /**
277
+ * Chevron down icon (20x20)
278
+ * Used for dropdown arrows
279
+ */
280
+ export declare const ChevronDownIcon: FC<IconProps_2>;
281
+
282
+ /**
283
+ * Claude format content item
284
+ */
285
+ export declare interface ClaudeContentItem {
286
+ type: 'text' | 'tool_use' | 'tool_result';
287
+ text?: string;
288
+ name?: string;
289
+ input?: unknown;
290
+ }
291
+
292
+ export declare const CloseIcon: FC<CloseIconProps>;
293
+
294
+ declare interface CloseIconProps {
295
+ size?: number;
296
+ color?: string;
297
+ className?: string;
298
+ }
299
+
300
+ export declare const CloseSmallIcon: FC<IconProps_2>;
301
+
302
+ /**
303
+ * Close X icon (14x14)
304
+ * Used for close buttons in banners and dialogs
305
+ */
306
+ export declare const CloseXIcon: FC<IconProps_2>;
307
+
308
+ /**
309
+ * CodeBlock - Code block for displaying formatted code or output
310
+ */
311
+ export declare const CodeBlock: FC<CodeBlockProps>;
312
+
313
+ /**
314
+ * Props for CodeBlock
315
+ */
316
+ declare interface CodeBlockProps {
317
+ children: string;
318
+ }
319
+
320
+ /**
321
+ * Code brackets icon (20x20)
322
+ * Used for active file indicator
323
+ */
324
+ export declare const CodeBracketsIcon: FC<IconProps_2>;
325
+
326
+ /**
327
+ * CollapsibleFileContent - Renders content with collapsible file references
328
+ *
329
+ * Detects file reference patterns in user messages and renders them as
330
+ * collapsible blocks to improve readability.
331
+ */
332
+ export declare const CollapsibleFileContent: FC<CollapsibleFileContentProps>;
333
+
334
+ /**
335
+ * Props for CollapsibleFileContent
336
+ */
337
+ export declare interface CollapsibleFileContentProps {
338
+ content: string;
339
+ onFileClick?: (path: string) => void;
340
+ enableFileLinks?: boolean;
341
+ }
342
+
343
+ /**
344
+ * Completion item for autocomplete menus
345
+ */
346
+ export declare interface CompletionItem {
347
+ /** Unique identifier */
348
+ id: string;
349
+ /** Display label */
350
+ label: string;
351
+ /** Optional description shown below label */
352
+ description?: string;
353
+ /** Optional icon to display */
354
+ icon?: ReactNode;
355
+ /** Type of completion item */
356
+ type: CompletionItemType;
357
+ /** Value inserted into the input when selected (e.g., filename or command) */
358
+ value?: string;
359
+ /** Optional full path for files (used to build @filename -> full path mapping) */
360
+ path?: string;
361
+ /** Optional group name for grouping items in the completion menu */
362
+ group?: string;
363
+ }
364
+
365
+ /**
366
+ * Completion item type categories
367
+ */
368
+ export declare type CompletionItemType = 'file' | 'folder' | 'symbol' | 'command' | 'variable' | 'info';
369
+
370
+ /**
371
+ * CompletionMenu component
372
+ *
373
+ * Features:
374
+ * - Keyboard navigation (Arrow Up/Down, Enter, Escape)
375
+ * - Mouse hover selection
376
+ * - Click outside to close
377
+ * - Auto-scroll to selected item
378
+ * - Smooth enter animation
379
+ * - Item grouping support
380
+ *
381
+ * @example
382
+ * ```tsx
383
+ * <CompletionMenu
384
+ * items={[
385
+ * { id: '1', label: 'file.ts', type: 'file' },
386
+ * { id: '2', label: 'folder', type: 'folder', group: 'Folders' }
387
+ * ]}
388
+ * onSelect={(item) => console.log('Selected:', item)}
389
+ * onClose={() => console.log('Closed')}
390
+ * />
391
+ * ```
392
+ */
393
+ export declare const CompletionMenu: FC<CompletionMenuProps>;
394
+
395
+ /**
396
+ * Props for CompletionMenu component
397
+ */
398
+ export declare interface CompletionMenuProps {
399
+ /** List of completion items to display */
400
+ items: CompletionItem[];
401
+ /** Callback when an item is selected */
402
+ onSelect: (item: CompletionItem) => void;
403
+ /** Callback when menu should close */
404
+ onClose: () => void;
405
+ /** Optional section title */
406
+ title?: string;
407
+ /** Initial selected index */
408
+ selectedIndex?: number;
409
+ }
410
+
411
+ export declare const Container: FC<ContainerProps>;
412
+
413
+ declare interface ContainerProps {
414
+ children: React.ReactNode;
415
+ className?: string;
416
+ }
417
+
418
+ /**
419
+ * Container status type for styling
420
+ */
421
+ export declare type ContainerStatus = 'success' | 'error' | 'warning' | 'loading' | 'default';
422
+
423
+ /**
424
+ * Parsed segment of user message content
425
+ */
426
+ export declare interface ContentSegment {
427
+ type: 'text' | 'file_reference';
428
+ content: string;
429
+ /** File path for file_reference type */
430
+ filePath?: string;
431
+ /** File name extracted from path */
432
+ fileName?: string;
433
+ }
434
+
435
+ /**
436
+ * ContextIndicator component
437
+ *
438
+ * Features:
439
+ * - Circular progress indicator showing context usage
440
+ * - Tooltip with detailed usage information
441
+ * - Accessible with proper ARIA labels
442
+ *
443
+ * @example
444
+ * ```tsx
445
+ * <ContextIndicator
446
+ * contextUsage={{
447
+ * percentLeft: 75,
448
+ * usedTokens: 25000,
449
+ * tokenLimit: 100000
450
+ * }}
451
+ * />
452
+ * ```
453
+ */
454
+ export declare const ContextIndicator: FC<ContextIndicatorProps>;
455
+
456
+ /**
457
+ * Props for ContextIndicator component
458
+ */
459
+ export declare interface ContextIndicatorProps {
460
+ /** Context usage data, null to hide indicator */
461
+ contextUsage: ContextUsage | null;
462
+ }
463
+
464
+ /**
465
+ * Context usage information
466
+ */
467
+ export declare interface ContextUsage {
468
+ /** Percentage of context remaining (0-100) */
469
+ percentLeft: number;
470
+ /** Number of tokens used */
471
+ usedTokens: number;
472
+ /** Maximum token limit */
473
+ tokenLimit: number;
474
+ }
475
+
476
+ /**
477
+ * CopyButton - Shared copy button component with Tailwind styles
478
+ * Uses PlatformContext for platform-specific clipboard access with fallback
479
+ * Note: Parent element should have 'group' class for hover effect
480
+ */
481
+ export declare const CopyButton: FC<CopyButtonProps>;
482
+
483
+ /**
484
+ * Copy button component props
485
+ */
486
+ declare interface CopyButtonProps {
487
+ text: string;
488
+ }
489
+
490
+ /**
491
+ * Built-in icon types for edit modes
492
+ */
493
+ export declare type EditModeIconType = 'edit' | 'auto' | 'plan' | 'yolo';
494
+
495
+ /**
496
+ * Edit mode display information
497
+ */
498
+ export declare interface EditModeInfo {
499
+ /** Display label */
500
+ label: string;
501
+ /** Tooltip text */
502
+ title: string;
503
+ /** Icon to display */
504
+ icon: ReactNode;
505
+ }
506
+
507
+ /**
508
+ * Edit pencil icon (16x16)
509
+ * Used for "Ask before edits" mode
510
+ */
511
+ export declare const EditPencilIcon: FC<IconProps_2>;
512
+
513
+ /**
514
+ * Specialized component for Edit tool calls
515
+ * Optimized for displaying file editing operations with diffs
516
+ */
517
+ export declare const EditToolCall: React.FC<BaseToolCallProps>;
518
+
519
+ /**
520
+ * EmptyState component
521
+ *
522
+ * Features:
523
+ * - Displays app logo (from platform resources or custom URL)
524
+ * - Shows contextual welcome message based on auth state
525
+ * - Loading state support
526
+ * - Graceful fallback if logo fails to load
527
+ *
528
+ * @example
529
+ * ```tsx
530
+ * <EmptyState
531
+ * isAuthenticated={true}
532
+ * appName="Qwen Code"
533
+ * />
534
+ * ```
535
+ */
536
+ export declare const EmptyState: FC<EmptyStateProps>;
537
+
538
+ /**
539
+ * Props for EmptyState component
540
+ */
541
+ export declare interface EmptyStateProps {
542
+ /** Whether user is authenticated */
543
+ isAuthenticated?: boolean;
544
+ /** Optional loading message to display */
545
+ loadingMessage?: string;
546
+ /** Optional custom logo URL (overrides platform resource) */
547
+ logoUrl?: string;
548
+ /** App name for welcome message */
549
+ appName?: string;
550
+ }
551
+
552
+ /**
553
+ * Extract output from command execution result text
554
+ * Handles both JSON format and structured text format
555
+ *
556
+ * Example structured text:
557
+ * ```
558
+ * Command: lsof -i :5173
559
+ * Directory: (root)
560
+ * Output: COMMAND PID USER...
561
+ * Error: (none)
562
+ * Exit Code: 0
563
+ * ```
564
+ */
565
+ export declare const extractCommandOutput: (text: string) => string;
566
+
567
+ export declare interface FileContext {
568
+ fileName: string;
569
+ filePath: string;
570
+ startLine?: number;
571
+ endLine?: number;
572
+ }
573
+
574
+ /**
575
+ * File document icon (16x16)
576
+ * Used for file completion menu
577
+ */
578
+ export declare const FileIcon: FC<IconProps_2>;
579
+
580
+ /**
581
+ * FileLink component - Clickable file link
582
+ *
583
+ * Features:
584
+ * - Click to open file using platform-specific handler
585
+ * - Support line and column number navigation
586
+ * - Hover to show full path
587
+ * - Optional display mode (full path vs filename only)
588
+ * - Full keyboard accessibility (Enter and Space keys)
589
+ *
590
+ * @example
591
+ * ```tsx
592
+ * <FileLink path="/src/App.tsx" line={42} />
593
+ * <FileLink path="/src/components/Button.tsx" line={10} column={5} showFullPath={true} />
594
+ * ```
595
+ */
596
+ export declare const FileLink: FC<FileLinkProps>;
597
+
598
+ /**
599
+ * Props for FileLink component
600
+ */
601
+ export declare interface FileLinkProps {
602
+ /** File path */
603
+ path: string;
604
+ /** Optional line number (starting from 1) */
605
+ line?: number | null;
606
+ /** Optional column number (starting from 1) */
607
+ column?: number | null;
608
+ /** Whether to show full path, default false (show filename only) */
609
+ showFullPath?: boolean;
610
+ /** Optional custom class name */
611
+ className?: string;
612
+ /** Whether to disable click behavior (use when parent element handles clicks) */
613
+ disableClick?: boolean;
614
+ }
615
+
616
+ export declare const FileListIcon: FC<IconProps_2>;
617
+
618
+ /**
619
+ * Filter out empty messages (except tool calls)
620
+ */
621
+ export declare function filterEmptyMessages(messages: UnifiedMessage[]): UnifiedMessage[];
622
+
623
+ /**
624
+ * Folder icon (16x16)
625
+ * Useful for directory entries in completion lists
626
+ */
627
+ export declare const FolderIcon: FC<IconProps_2>;
628
+
629
+ export declare const Footer: FC;
630
+
631
+ /**
632
+ * Format any value to a string for display
633
+ */
634
+ export declare const formatValue: (value: unknown) => string;
635
+
636
+ /**
637
+ * Generic tool call component that can display any tool call type
638
+ * Used as fallback for unknown tool call kinds
639
+ * Minimal display: show description and outcome
640
+ */
641
+ export declare const GenericToolCall: FC<BaseToolCallProps>;
642
+
643
+ /**
644
+ * Get icon component for edit mode type
645
+ */
646
+ export declare const getEditModeIcon: (iconType: EditModeIconType) => ReactNode;
647
+
648
+ /**
649
+ * Format timestamp as relative time string
650
+ *
651
+ * @param timestamp - ISO timestamp string
652
+ * @returns Formatted relative time (e.g., "now", "5m", "2h", "Yesterday", "3d", or date)
653
+ *
654
+ * @example
655
+ * ```ts
656
+ * getTimeAgo(new Date().toISOString()) // "now"
657
+ * getTimeAgo(thirtyMinutesAgo.toISOString()) // "30m"
658
+ * getTimeAgo(twoHoursAgo.toISOString()) // "2h"
659
+ * ```
660
+ */
661
+ export declare const getTimeAgo: (timestamp: string) => string;
662
+
663
+ /**
664
+ * Group tool call content by type to avoid duplicate labels
665
+ * Error detection logic:
666
+ * - If contentObj.error is set (not null/undefined), treat as error
667
+ * - If contentObj.type === 'error' AND has content (text or error), treat as error
668
+ * This avoids false positives from empty error markers while not missing real errors
669
+ */
670
+ export declare const groupContent: (content?: ToolCallContent[]) => GroupedContent;
671
+
672
+ /**
673
+ * Grouped content structure for rendering
674
+ */
675
+ export declare interface GroupedContent {
676
+ textOutputs: string[];
677
+ errors: string[];
678
+ diffs: ToolCallContent[];
679
+ otherData: unknown[];
680
+ }
681
+
682
+ /**
683
+ * Group sessions by date
684
+ *
685
+ * Categories:
686
+ * - Today: Sessions from today
687
+ * - Yesterday: Sessions from yesterday
688
+ * - This Week: Sessions from the last 7 days (excluding today/yesterday)
689
+ * - Older: Sessions older than a week
690
+ *
691
+ * @param sessions - Array of session objects (must have lastUpdated or startTime)
692
+ * @returns Array of grouped sessions, only includes non-empty groups
693
+ *
694
+ * @example
695
+ * ```ts
696
+ * const grouped = groupSessionsByDate(sessions);
697
+ * // [{ label: 'Today', sessions: [...] }, { label: 'Older', sessions: [...] }]
698
+ * ```
699
+ */
700
+ export declare const groupSessionsByDate: (sessions: Array<Record<string, unknown>>) => SessionGroup[];
701
+
702
+ /**
703
+ * Handle copy to clipboard using platform-specific API with fallback
704
+ * @param text Text to copy
705
+ * @param event Mouse event to stop propagation
706
+ * @param platformCopy Optional platform-specific copy function
707
+ */
708
+ export declare const handleCopyToClipboard: (text: string, event: React.MouseEvent, platformCopy?: (text: string) => Promise<void>) => Promise<void>;
709
+
710
+ /**
711
+ * Check if a tool call has actual output to display
712
+ * Returns false for tool calls that completed successfully but have no visible output
713
+ */
714
+ export declare const hasToolCallOutput: (toolCall: ToolCallData) => boolean;
715
+
716
+ export declare const Header: FC;
717
+
718
+ /**
719
+ * Hide context (eye slash) icon (20x20)
720
+ * Used to indicate the active selection will NOT be auto-loaded into context
721
+ */
722
+ export declare const HideContextIcon: FC<IconProps_2>;
723
+
724
+ export declare const Icon: FC<IconProps>;
725
+
726
+ declare interface IconProps {
727
+ name: string;
728
+ size?: number;
729
+ color?: string;
730
+ className?: string;
731
+ }
732
+
733
+ declare interface IconProps_2 extends SVGProps<SVGSVGElement> {
734
+ /**
735
+ * Icon size (width and height)
736
+ * @default 16
737
+ */
738
+ size?: number;
739
+ /**
740
+ * Additional CSS classes
741
+ */
742
+ className?: string;
743
+ }
744
+
745
+ /**
746
+ * Input component with multiple sizes and states
747
+ *
748
+ * @example
749
+ * ```tsx
750
+ * <Input
751
+ * label="Email"
752
+ * placeholder="Enter your email"
753
+ * error={!!errors.email}
754
+ * errorMessage={errors.email}
755
+ * />
756
+ * ```
757
+ */
758
+ export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
759
+
760
+ /**
761
+ * InputForm component
762
+ *
763
+ * Features:
764
+ * - ContentEditable input with placeholder
765
+ * - Edit mode toggle with customizable icons
766
+ * - Active file/selection indicator
767
+ * - Context usage display
768
+ * - Command and attach buttons
769
+ * - Send/Stop button based on state
770
+ * - Completion menu integration
771
+ *
772
+ * @example
773
+ * ```tsx
774
+ * <InputForm
775
+ * inputText={text}
776
+ * inputFieldRef={inputRef}
777
+ * isStreaming={false}
778
+ * isWaitingForResponse={false}
779
+ * isComposing={false}
780
+ * editModeInfo={{ label: 'Auto', title: 'Auto mode', icon: <AutoEditIcon /> }}
781
+ * // ... other props
782
+ * />
783
+ * ```
784
+ */
785
+ export declare const InputForm: FC<InputFormProps>;
786
+
787
+ /**
788
+ * Props for InputForm component
789
+ */
790
+ export declare interface InputFormProps {
791
+ /** Current input text */
792
+ inputText: string;
793
+ /** Ref for the input field */
794
+ inputFieldRef: React.RefObject<HTMLDivElement>;
795
+ /** Whether AI is currently generating */
796
+ isStreaming: boolean;
797
+ /** Whether waiting for response */
798
+ isWaitingForResponse: boolean;
799
+ /** Whether IME composition is in progress */
800
+ isComposing: boolean;
801
+ /** Edit mode display information */
802
+ editModeInfo: EditModeInfo;
803
+ /** Whether thinking mode is enabled */
804
+ thinkingEnabled: boolean;
805
+ /** Active file name (from editor) */
806
+ activeFileName: string | null;
807
+ /** Active selection range */
808
+ activeSelection: {
809
+ startLine: number;
810
+ endLine: number;
811
+ } | null;
812
+ /** Whether to skip auto-loading active context */
813
+ skipAutoActiveContext: boolean;
814
+ /** Context usage information */
815
+ contextUsage: ContextUsage | null;
816
+ /** Input change callback */
817
+ onInputChange: (text: string) => void;
818
+ /** Composition start callback */
819
+ onCompositionStart: () => void;
820
+ /** Composition end callback */
821
+ onCompositionEnd: () => void;
822
+ /** Key down callback */
823
+ onKeyDown: (e: React.KeyboardEvent) => void;
824
+ /** Submit callback */
825
+ onSubmit: (e: React.FormEvent) => void;
826
+ /** Cancel callback */
827
+ onCancel: () => void;
828
+ /** Toggle edit mode callback */
829
+ onToggleEditMode: () => void;
830
+ /** Toggle thinking callback */
831
+ onToggleThinking: () => void;
832
+ /** Focus active editor callback */
833
+ onFocusActiveEditor?: () => void;
834
+ /** Toggle skip auto context callback */
835
+ onToggleSkipAutoActiveContext: () => void;
836
+ /** Show command menu callback */
837
+ onShowCommandMenu: () => void;
838
+ /** Attach context callback */
839
+ onAttachContext: () => void;
840
+ /** Whether completion menu is open */
841
+ completionIsOpen: boolean;
842
+ /** Completion items */
843
+ completionItems?: CompletionItem[];
844
+ /** Completion select callback */
845
+ onCompletionSelect?: (item: CompletionItem) => void;
846
+ /** Completion close callback */
847
+ onCompletionClose?: () => void;
848
+ /** Placeholder text */
849
+ placeholder?: string;
850
+ }
851
+
852
+ /**
853
+ * Input component props interface
854
+ */
855
+ declare interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
856
+ /** Input size */
857
+ size?: InputSize;
858
+ /** Error state */
859
+ error?: boolean;
860
+ /** Error message to display */
861
+ errorMessage?: string;
862
+ /** Label for the input */
863
+ label?: string;
864
+ /** Helper text below input */
865
+ helperText?: string;
866
+ /** Left icon/element */
867
+ leftElement?: ReactNode;
868
+ /** Right icon/element */
869
+ rightElement?: ReactNode;
870
+ /** Full width input */
871
+ fullWidth?: boolean;
872
+ }
873
+
874
+ /**
875
+ * Input size types
876
+ */
877
+ declare type InputSize = 'sm' | 'md' | 'lg';
878
+
879
+ export declare const InterruptedMessage: FC<InterruptedMessageProps>;
880
+
881
+ declare interface InterruptedMessageProps {
882
+ text?: string;
883
+ }
884
+
885
+ /**
886
+ * Type guard to check if data is a message
887
+ */
888
+ export declare function isMessageData(data: unknown): data is ACPMessageData;
889
+
890
+ /**
891
+ * Type guard to check if data is a tool call
892
+ */
893
+ export declare function isToolCallData(data: unknown): data is ToolCallData;
894
+
895
+ /**
896
+ * JSONL chat message format (ChatViewer input)
897
+ */
898
+ export declare interface JSONLMessage {
899
+ uuid: string;
900
+ parentUuid?: string | null;
901
+ sessionId?: string;
902
+ timestamp: string;
903
+ type: 'user' | 'assistant' | 'system' | 'tool_call';
904
+ message?: {
905
+ role?: string;
906
+ parts?: Array<{
907
+ text: string;
908
+ }>;
909
+ content?: string | unknown[];
910
+ };
911
+ model?: string;
912
+ toolCall?: ToolCallData;
913
+ }
914
+
915
+ /**
916
+ * Link/attachment icon (20x20)
917
+ * Used for attach context button
918
+ */
919
+ export declare const LinkIcon: FC<IconProps_2>;
920
+
921
+ /**
922
+ * LocationsList - List of file locations with clickable links
923
+ */
924
+ export declare const LocationsList: FC<LocationsListProps>;
925
+
926
+ /**
927
+ * Props for LocationsList
928
+ */
929
+ declare interface LocationsListProps {
930
+ locations: Array<{
931
+ path: string;
932
+ line?: number | null;
933
+ }>;
934
+ }
935
+
936
+ export declare const Main: FC;
937
+
938
+ /**
939
+ * Map a tool call status to a ToolCallContainer status (bullet color)
940
+ * - pending/in_progress -> loading
941
+ * - completed -> success
942
+ * - failed -> error
943
+ * - default fallback
944
+ */
945
+ export declare const mapToolStatusToContainerStatus: (status: ToolCallStatus) => ContainerStatus;
946
+
947
+ /**
948
+ * MarkdownRenderer component - renders markdown content with enhanced features
949
+ */
950
+ export declare const MarkdownRenderer: FC<MarkdownRendererProps>;
951
+
952
+ export declare interface MarkdownRendererProps {
953
+ content: string;
954
+ onFileClick?: (filePath: string) => void;
955
+ /** When false, do not convert file paths into clickable links. Default: true */
956
+ enableFileLinks?: boolean;
957
+ }
958
+
959
+ export declare const Message: FC<MessageProps_2>;
960
+
961
+ export declare const MessageContent: NamedExoticComponent<MessageContentProps>;
962
+
963
+ /**
964
+ * @license
965
+ * Copyright 2025 Qwen Team
966
+ * SPDX-License-Identifier: Apache-2.0
967
+ */
968
+ export declare interface MessageContentProps {
969
+ content: string;
970
+ onFileClick?: (filePath: string) => void;
971
+ enableFileLinks?: boolean;
972
+ }
973
+
974
+ export declare const MessageInput: FC;
975
+
976
+ export declare const MessageList: FC;
977
+
978
+ /**
979
+ * Message part containing text content (Qwen format)
980
+ */
981
+ export declare interface MessagePart {
982
+ text: string;
983
+ }
984
+
985
+ /**
986
+ * @license
987
+ * Copyright 2025 Qwen Team
988
+ * SPDX-License-Identifier: Apache-2.0
989
+ */
990
+ export declare interface MessageProps {
991
+ id: string;
992
+ content: string;
993
+ sender: 'user' | 'system' | 'assistant';
994
+ timestamp?: Date;
995
+ className?: string;
996
+ }
997
+
998
+ declare interface MessageProps_2 {
999
+ id: string;
1000
+ content: string;
1001
+ sender: 'user' | 'system' | 'assistant';
1002
+ timestamp?: Date;
1003
+ className?: string;
1004
+ }
1005
+
1006
+ /**
1007
+ * @license
1008
+ * Copyright 2025 Qwen Team
1009
+ * SPDX-License-Identifier: Apache-2.0
1010
+ */
1011
+ /**
1012
+ * Chat message role types
1013
+ */
1014
+ export declare type MessageRole = 'user' | 'assistant' | 'system';
1015
+
1016
+ /**
1017
+ * Onboarding - Welcome screen for new users
1018
+ * Pure presentational component
1019
+ */
1020
+ export declare const Onboarding: FC<OnboardingProps>;
1021
+
1022
+ export declare interface OnboardingProps {
1023
+ /** URL of the application icon */
1024
+ iconUrl?: string;
1025
+ /** Callback when user clicks the get started button */
1026
+ onGetStarted: () => void;
1027
+ /** Application name (defaults to "Qwen Code") */
1028
+ appName?: string;
1029
+ /** Welcome message subtitle */
1030
+ subtitle?: string;
1031
+ /** Button text (defaults to "Get Started with Qwen Code") */
1032
+ buttonText?: string;
1033
+ }
1034
+
1035
+ /**
1036
+ * Open diff icon (16x16)
1037
+ * Used for opening diff in VS Code
1038
+ */
1039
+ export declare const OpenDiffIcon: FC<IconProps_2>;
1040
+
1041
+ /**
1042
+ * Parse content to identify file references and regular text
1043
+ * @param content - The raw content string
1044
+ * @returns Array of content segments
1045
+ */
1046
+ export declare function parseContentWithFileReferences(content: string): ContentSegment[];
1047
+
1048
+ export declare const PermissionDrawer: FC<PermissionDrawerProps>;
1049
+
1050
+ export declare interface PermissionDrawerProps {
1051
+ isOpen: boolean;
1052
+ options: PermissionOption[];
1053
+ toolCall: PermissionToolCall;
1054
+ onResponse: (optionId: string) => void;
1055
+ onClose?: () => void;
1056
+ }
1057
+
1058
+ export declare interface PermissionOption {
1059
+ name: string;
1060
+ kind: string;
1061
+ optionId: string;
1062
+ }
1063
+
1064
+ export declare interface PermissionToolCall {
1065
+ title?: string;
1066
+ kind?: string;
1067
+ toolCallId?: string;
1068
+ rawInput?: {
1069
+ command?: string;
1070
+ description?: string;
1071
+ [key: string]: unknown;
1072
+ };
1073
+ content?: Array<{
1074
+ type: string;
1075
+ [key: string]: unknown;
1076
+ }>;
1077
+ locations?: Array<{
1078
+ path: string;
1079
+ line?: number | null;
1080
+ }>;
1081
+ status?: string;
1082
+ }
1083
+
1084
+ /**
1085
+ * Plan completed icon (14x14)
1086
+ * Used for completed plan items
1087
+ */
1088
+ export declare const PlanCompletedIcon: FC<IconProps_2>;
1089
+
1090
+ /**
1091
+ * Plan entry for task tracking
1092
+ */
1093
+ export declare interface PlanEntry {
1094
+ content: string;
1095
+ priority?: 'high' | 'medium' | 'low';
1096
+ status: 'pending' | 'in_progress' | 'completed';
1097
+ }
1098
+
1099
+ /**
1100
+ * Plan entry status type
1101
+ */
1102
+ export declare type PlanEntryStatus = 'pending' | 'in_progress' | 'completed';
1103
+
1104
+ /**
1105
+ * Plan in progress icon (14x14)
1106
+ * Used for in-progress plan items
1107
+ */
1108
+ export declare const PlanInProgressIcon: FC<IconProps_2>;
1109
+
1110
+ /**
1111
+ * Plan mode/bars icon (16x16)
1112
+ * Used for "Plan mode"
1113
+ */
1114
+ export declare const PlanModeIcon: FC<IconProps_2>;
1115
+
1116
+ /**
1117
+ * Plan pending icon (14x14)
1118
+ * Used for pending plan items
1119
+ */
1120
+ export declare const PlanPendingIcon: FC<IconProps_2>;
1121
+
1122
+ /**
1123
+ * Platform context for accessing platform-specific capabilities
1124
+ */
1125
+ export declare const PlatformContext: Context<PlatformContextValue>;
1126
+
1127
+ /**
1128
+ * Platform context interface for cross-platform component reuse.
1129
+ * Each platform adapter implements this interface.
1130
+ */
1131
+ export declare interface PlatformContextValue {
1132
+ /** Current platform identifier */
1133
+ platform: PlatformType;
1134
+ /** Send message to platform host */
1135
+ postMessage: (message: unknown) => void;
1136
+ /** Subscribe to messages from platform host */
1137
+ onMessage: (handler: (message: unknown) => void) => () => void;
1138
+ /** Open a file in the platform's editor (optional) */
1139
+ openFile?: (path: string) => void;
1140
+ /** Open a diff view for a file (optional) */
1141
+ openDiff?: (path: string, oldText: string | null | undefined, newText: string | undefined) => void;
1142
+ /** Open a temporary file with given content (optional) */
1143
+ openTempFile?: (content: string, fileName?: string) => void;
1144
+ /** Trigger file attachment dialog (optional) */
1145
+ attachFile?: () => void;
1146
+ /** Trigger platform login flow (optional) */
1147
+ login?: () => void;
1148
+ /** Copy text to clipboard */
1149
+ copyToClipboard?: (text: string) => Promise<void>;
1150
+ /** Get resource URL for platform-specific assets (e.g., icons) */
1151
+ getResourceUrl?: (resourceName: string) => string | undefined;
1152
+ /** Platform-specific feature flags */
1153
+ features?: {
1154
+ canOpenFile?: boolean;
1155
+ canOpenDiff?: boolean;
1156
+ canOpenTempFile?: boolean;
1157
+ canAttachFile?: boolean;
1158
+ canLogin?: boolean;
1159
+ canCopy?: boolean;
1160
+ };
1161
+ }
1162
+
1163
+ /**
1164
+ * Platform context provider component
1165
+ */
1166
+ export declare function PlatformProvider({ children, value }: PlatformProviderProps): JSX.Element;
1167
+
1168
+ /**
1169
+ * Provider component props
1170
+ */
1171
+ export declare interface PlatformProviderProps {
1172
+ children: ReactNode;
1173
+ value: PlatformContextValue;
1174
+ }
1175
+
1176
+ /**
1177
+ * Platform types supported by the webui library
1178
+ */
1179
+ export declare type PlatformType = 'vscode' | 'chrome' | 'web' | 'share';
1180
+
1181
+ /**
1182
+ * Plus icon (20x20)
1183
+ * Used for new session button
1184
+ */
1185
+ export declare const PlusIcon: FC<IconProps_2>;
1186
+
1187
+ /**
1188
+ * Small plus icon (16x16)
1189
+ * Used for default attachment type
1190
+ */
1191
+ export declare const PlusSmallIcon: FC<IconProps_2>;
1192
+
1193
+ /**
1194
+ * ReadToolCall - displays file reading operations
1195
+ * Shows: Read filename (no content preview)
1196
+ */
1197
+ export declare const ReadToolCall: FC<BaseToolCallProps>;
1198
+
1199
+ /**
1200
+ * Refresh/reload icon (16x16)
1201
+ * Used for refresh session list
1202
+ */
1203
+ export declare const RefreshIcon: FC<IconProps_2>;
1204
+
1205
+ /**
1206
+ * Safely convert title to string, handling object types
1207
+ * Returns empty string if no meaningful title
1208
+ * Uses try/catch to handle circular references safely
1209
+ */
1210
+ export declare const safeTitle: (title: unknown) => string;
1211
+
1212
+ /**
1213
+ * Save document icon (16x16)
1214
+ * Used for save session button
1215
+ */
1216
+ export declare const SaveDocumentIcon: FC<IconProps_2>;
1217
+
1218
+ /**
1219
+ * SaveMemory tool call component
1220
+ * Displays saved memory content in a simple text format
1221
+ */
1222
+ export declare const SaveMemoryToolCall: FC<BaseToolCallProps>;
1223
+
1224
+ /**
1225
+ * Search/magnifying glass icon (20x20)
1226
+ * Used for search input
1227
+ */
1228
+ export declare const SearchIcon: FC<IconProps_2>;
1229
+
1230
+ /**
1231
+ * Specialized component for Search tool calls
1232
+ * Optimized for displaying search operations and results
1233
+ */
1234
+ export declare const SearchToolCall: FC<BaseToolCallProps>;
1235
+
1236
+ export declare const SelectionIcon: FC<IconProps_2>;
1237
+
1238
+ export declare const SendIcon: FC<SendIconProps>;
1239
+
1240
+ declare interface SendIconProps {
1241
+ size?: number;
1242
+ color?: string;
1243
+ className?: string;
1244
+ }
1245
+
1246
+ /**
1247
+ * @license
1248
+ * Copyright 2025 Qwen Team
1249
+ * SPDX-License-Identifier: Apache-2.0
1250
+ *
1251
+ * Session grouping utilities
1252
+ * Functions for organizing sessions by date and formatting time ago
1253
+ */
1254
+ /**
1255
+ * Session group structure
1256
+ */
1257
+ export declare interface SessionGroup {
1258
+ /** Group label (e.g., "Today", "Yesterday") */
1259
+ label: string;
1260
+ /** Sessions in this group */
1261
+ sessions: Array<Record<string, unknown>>;
1262
+ }
1263
+
1264
+ /**
1265
+ * SessionSelector component
1266
+ *
1267
+ * Features:
1268
+ * - Sessions grouped by date (Today, Yesterday, This Week, Older)
1269
+ * - Search filtering
1270
+ * - Infinite scroll to load more sessions
1271
+ * - Click outside to close
1272
+ * - Active session highlighting
1273
+ *
1274
+ * @example
1275
+ * ```tsx
1276
+ * <SessionSelector
1277
+ * visible={true}
1278
+ * sessions={sessions}
1279
+ * currentSessionId="abc123"
1280
+ * searchQuery=""
1281
+ * onSearchChange={(q) => setQuery(q)}
1282
+ * onSelectSession={(id) => loadSession(id)}
1283
+ * onClose={() => setVisible(false)}
1284
+ * />
1285
+ * ```
1286
+ */
1287
+ export declare const SessionSelector: FC<SessionSelectorProps>;
1288
+
1289
+ /**
1290
+ * Props for SessionSelector component
1291
+ */
1292
+ export declare interface SessionSelectorProps {
1293
+ /** Whether the selector is visible */
1294
+ visible: boolean;
1295
+ /** List of session objects */
1296
+ sessions: Array<Record<string, unknown>>;
1297
+ /** Currently selected session ID */
1298
+ currentSessionId: string | null;
1299
+ /** Current search query */
1300
+ searchQuery: string;
1301
+ /** Callback when search query changes */
1302
+ onSearchChange: (query: string) => void;
1303
+ /** Callback when a session is selected */
1304
+ onSelectSession: (sessionId: string) => void;
1305
+ /** Callback when selector should close */
1306
+ onClose: () => void;
1307
+ /** Whether there are more sessions to load */
1308
+ hasMore?: boolean;
1309
+ /** Whether loading is in progress */
1310
+ isLoading?: boolean;
1311
+ /** Callback to load more sessions */
1312
+ onLoadMore?: () => void;
1313
+ }
1314
+
1315
+ /**
1316
+ * ShellToolCall - displays bash/execute command tool calls
1317
+ * Shows command input and output with IN/OUT cards
1318
+ */
1319
+ export declare const ShellToolCall: FC<BaseToolCallProps>;
1320
+
1321
+ /**
1322
+ * Check if a tool call should be displayed
1323
+ * Hides internal tool calls
1324
+ */
1325
+ export declare const shouldShowToolCall: (kind: string) => boolean;
1326
+
1327
+ export declare const Sidebar: FC;
1328
+
1329
+ /**
1330
+ * Slash command icon (20x20)
1331
+ * Used for command menu button
1332
+ */
1333
+ export declare const SlashCommandIcon: FC<IconProps_2>;
1334
+
1335
+ /**
1336
+ * StatusIndicator - Status indicator with colored dot
1337
+ */
1338
+ export declare const StatusIndicator: FC<StatusIndicatorProps>;
1339
+
1340
+ /**
1341
+ * Props for StatusIndicator
1342
+ */
1343
+ declare interface StatusIndicatorProps {
1344
+ status: 'pending' | 'in_progress' | 'completed' | 'failed';
1345
+ text: string;
1346
+ }
1347
+
1348
+ /**
1349
+ * Stop/square icon (16x16)
1350
+ * Used for stop/cancel operations
1351
+ */
1352
+ export declare const StopIcon: FC<IconProps_2>;
1353
+
1354
+ export declare const SymbolIcon: FC<IconProps_2>;
1355
+
1356
+ export declare const TerminalIcon: FC<IconProps_2>;
1357
+
1358
+ /**
1359
+ * @license
1360
+ * Copyright 2025 Qwen Team
1361
+ * SPDX-License-Identifier: Apache-2.0
1362
+ */
1363
+ export declare type Theme = 'light' | 'dark' | 'auto';
1364
+
1365
+ export declare const ThinkingIcon: FC<ThinkingIconProps>;
1366
+
1367
+ declare interface ThinkingIconProps extends IconProps_2 {
1368
+ /**
1369
+ * Whether thinking is enabled (affects styling)
1370
+ */
1371
+ enabled?: boolean;
1372
+ }
1373
+
1374
+ /**
1375
+ * ThinkingMessage - Collapsible thinking message component
1376
+ *
1377
+ * Displays the LLM's thinking process, collapsed by default, click to expand and view details.
1378
+ * Style reference from Claude Code's thinking message design:
1379
+ * - Collapsed: gray dot + "Thinking" + down arrow
1380
+ * - Expanded: solid dot + "Thinking" + up arrow + thinking content
1381
+ * - Aligned with other message items, with status icon and connector line
1382
+ */
1383
+ export declare const ThinkingMessage: FC<ThinkingMessageProps>;
1384
+
1385
+ /**
1386
+ * ThinkingMessage component props interface
1387
+ */
1388
+ export declare interface ThinkingMessageProps {
1389
+ /** Thinking content */
1390
+ content: string;
1391
+ /** Message timestamp */
1392
+ timestamp: number;
1393
+ /** File click callback */
1394
+ onFileClick?: (path: string) => void;
1395
+ /** Whether to expand by default, defaults to false */
1396
+ defaultExpanded?: boolean;
1397
+ /** Status: 'loading' means thinking in progress, 'default' means thinking complete */
1398
+ status?: 'loading' | 'default';
1399
+ }
1400
+
1401
+ /**
1402
+ * Specialized component for Think tool calls
1403
+ * Optimized for displaying AI reasoning and thought processes
1404
+ * Minimal display: just show the thoughts (no context)
1405
+ */
1406
+ export declare const ThinkToolCall: FC<BaseToolCallProps>;
1407
+
1408
+ /**
1409
+ * ToolCallCard - Legacy card wrapper for complex layouts like diffs
1410
+ */
1411
+ export declare const ToolCallCard: FC<ToolCallCardProps>;
1412
+
1413
+ /**
1414
+ * Props for ToolCallCard
1415
+ */
1416
+ declare interface ToolCallCardProps {
1417
+ icon: string;
1418
+ children: React.ReactNode;
1419
+ }
1420
+
1421
+ /**
1422
+ * ToolCallContainer - Main container for tool call displays
1423
+ * Features timeline connector line and status bullet
1424
+ */
1425
+ export declare const ToolCallContainer: FC<ToolCallContainerProps>;
1426
+
1427
+ /**
1428
+ * Props for ToolCallContainer
1429
+ */
1430
+ export declare interface ToolCallContainerProps {
1431
+ /** Operation label (e.g., "Read", "Write", "Search") */
1432
+ label: string;
1433
+ /** Status for bullet color: 'success' | 'error' | 'warning' | 'loading' | 'default' */
1434
+ status?: 'success' | 'error' | 'warning' | 'loading' | 'default';
1435
+ /** Main content to display (optional - some tool calls only show title) */
1436
+ children?: React.ReactNode;
1437
+ /** Tool call ID for debugging */
1438
+ toolCallId?: string;
1439
+ /** Optional trailing content rendered next to label (e.g., clickable filename) */
1440
+ labelSuffix?: React.ReactNode;
1441
+ /** Optional custom class name */
1442
+ className?: string;
1443
+ /** Whether this is the first item in an AI response sequence (for timeline) */
1444
+ isFirst?: boolean;
1445
+ /** Whether this is the last item in an AI response sequence (for timeline) */
1446
+ isLast?: boolean;
1447
+ }
1448
+
1449
+ /**
1450
+ * @license
1451
+ * Copyright 2025 Qwen Team
1452
+ * SPDX-License-Identifier: Apache-2.0
1453
+ *
1454
+ * Shared types for tool call components
1455
+ */
1456
+ /**
1457
+ * Tool call content types
1458
+ */
1459
+ export declare interface ToolCallContent {
1460
+ type: 'content' | 'diff';
1461
+ content?: {
1462
+ type: string;
1463
+ text?: string;
1464
+ error?: unknown;
1465
+ [key: string]: unknown;
1466
+ };
1467
+ path?: string;
1468
+ oldText?: string | null;
1469
+ newText?: string;
1470
+ }
1471
+
1472
+ /**
1473
+ * Tool call content item
1474
+ */
1475
+ export declare interface ToolCallContentItem {
1476
+ type: 'content' | 'diff';
1477
+ content?: {
1478
+ type: string;
1479
+ text?: string;
1480
+ [key: string]: unknown;
1481
+ };
1482
+ path?: string;
1483
+ oldText?: string | null;
1484
+ newText?: string;
1485
+ [key: string]: unknown;
1486
+ }
1487
+
1488
+ /**
1489
+ * Base tool call data interface
1490
+ */
1491
+ export declare interface ToolCallData {
1492
+ toolCallId: string;
1493
+ kind: string;
1494
+ title: string | object;
1495
+ status: ToolCallStatus;
1496
+ rawInput?: string | object;
1497
+ content?: ToolCallContent[];
1498
+ locations?: ToolCallLocation[];
1499
+ timestamp?: number;
1500
+ }
1501
+
1502
+ /**
1503
+ * Tool call location type
1504
+ */
1505
+ export declare interface ToolCallLocation {
1506
+ path: string;
1507
+ line?: number | null;
1508
+ }
1509
+
1510
+ /**
1511
+ * Tool call location reference
1512
+ */
1513
+ declare interface ToolCallLocation_2 {
1514
+ path: string;
1515
+ line?: number | null;
1516
+ }
1517
+
1518
+ /**
1519
+ * ToolCallRow - A single row in the tool call grid (legacy - for complex layouts)
1520
+ */
1521
+ export declare const ToolCallRow: FC<ToolCallRowProps>;
1522
+
1523
+ /**
1524
+ * Props for ToolCallRow
1525
+ */
1526
+ declare interface ToolCallRowProps {
1527
+ label: string;
1528
+ children: React.ReactNode;
1529
+ }
1530
+
1531
+ /**
1532
+ * Tool call status type
1533
+ */
1534
+ export declare type ToolCallStatus = 'pending' | 'in_progress' | 'completed' | 'failed';
1535
+
1536
+ /**
1537
+ * @license
1538
+ * Copyright 2025 Qwen Team
1539
+ * SPDX-License-Identifier: Apache-2.0
1540
+ */
1541
+ /**
1542
+ * Tool call status
1543
+ */
1544
+ declare type ToolCallStatus_2 = 'pending' | 'in_progress' | 'completed' | 'failed';
1545
+
1546
+ /**
1547
+ * Tool call update data
1548
+ */
1549
+ export declare interface ToolCallUpdate {
1550
+ toolCallId: string;
1551
+ kind?: string;
1552
+ title?: string;
1553
+ status?: ToolCallStatus_2;
1554
+ rawInput?: unknown;
1555
+ content?: ToolCallContentItem[];
1556
+ locations?: ToolCallLocation_2[];
1557
+ timestamp?: number;
1558
+ }
1559
+
1560
+ /**
1561
+ * Tooltip component using CSS group-hover for display
1562
+ * Supports CSS variables for theming
1563
+ */
1564
+ export declare const Tooltip: FC<TooltipProps>;
1565
+
1566
+ /**
1567
+ * Tooltip component props
1568
+ */
1569
+ export declare interface TooltipProps {
1570
+ /** Content to wrap with tooltip */
1571
+ children: React.ReactNode;
1572
+ /** Tooltip content (can be string or ReactNode) */
1573
+ content: React.ReactNode;
1574
+ /** Tooltip position relative to children */
1575
+ position?: 'top' | 'bottom' | 'left' | 'right';
1576
+ }
1577
+
1578
+ /**
1579
+ * Undo edit icon (16x16)
1580
+ * Used for undoing edits in diff views
1581
+ */
1582
+ export declare const UndoIcon: FC<IconProps_2>;
1583
+
1584
+ /**
1585
+ * Unified message format - normalized from ACP or JSONL sources
1586
+ */
1587
+ export declare interface UnifiedMessage {
1588
+ /** Unique identifier */
1589
+ id: string;
1590
+ /** Message type */
1591
+ type: UnifiedMessageType;
1592
+ /** Timestamp in milliseconds */
1593
+ timestamp: number;
1594
+ /** Text content (for user/assistant/thinking messages) */
1595
+ content?: string;
1596
+ /** Tool call data (for tool_call type) */
1597
+ toolCall?: ToolCallData;
1598
+ /** Whether this is the first item in an AI response sequence */
1599
+ isFirst: boolean;
1600
+ /** Whether this is the last item in an AI response sequence */
1601
+ isLast: boolean;
1602
+ /** File context for user messages */
1603
+ fileContext?: FileContext[];
1604
+ }
1605
+
1606
+ /**
1607
+ * Unified message type used by all webui components
1608
+ */
1609
+ export declare type UnifiedMessageType = 'user' | 'assistant' | 'tool_call' | 'thinking';
1610
+
1611
+ /**
1612
+ * Specialized component for UpdatedPlan tool calls
1613
+ * Optimized for displaying plan update operations
1614
+ */
1615
+ export declare const UpdatedPlanToolCall: FC<BaseToolCallProps>;
1616
+
1617
+ /**
1618
+ * @license
1619
+ * Copyright 2025 Qwen Team
1620
+ * SPDX-License-Identifier: Apache-2.0
1621
+ */
1622
+ export declare const useLocalStorage: <T>(key: string, initialValue: T) => readonly [T, (value: T | ((val: T) => T)) => void];
1623
+
1624
+ /**
1625
+ * Hook to access platform context
1626
+ */
1627
+ export declare function usePlatform(): PlatformContextValue;
1628
+
1629
+ /**
1630
+ * User profile icon (16x16)
1631
+ * Used for login command
1632
+ */
1633
+ export declare const UserIcon: FC<IconProps_2>;
1634
+
1635
+ export declare const UserMessage: FC<UserMessageProps>;
1636
+
1637
+ export declare interface UserMessageProps {
1638
+ content: string;
1639
+ timestamp: number;
1640
+ onFileClick?: (path: string) => void;
1641
+ fileContext?: FileContext;
1642
+ }
1643
+
1644
+ /**
1645
+ * @license
1646
+ * Copyright 2025 Qwen Team
1647
+ * SPDX-License-Identifier: Apache-2.0
1648
+ */
1649
+ export declare const useTheme: () => {
1650
+ theme: "auto" | "dark" | "light";
1651
+ toggleTheme: () => void;
1652
+ };
1653
+
1654
+ export declare const WaitingMessage: FC<WaitingMessageProps>;
1655
+
1656
+ declare interface WaitingMessageProps {
1657
+ loadingMessage: string;
1658
+ }
1659
+
1660
+ /**
1661
+ * Warning triangle icon (20x20)
1662
+ * Used for warning messages
1663
+ */
1664
+ export declare const WarningTriangleIcon: FC<IconProps_2>;
1665
+
1666
+ /**
1667
+ * WebFetchToolCall - displays web fetch/search tool calls
1668
+ * Shows URL/query and output with OUT card
1669
+ * @param props - Component props
1670
+ * @returns JSX element
1671
+ */
1672
+ export declare const WebFetchToolCall: FC<BaseToolCallProps>;
1673
+
1674
+ /**
1675
+ * A container component that provides style isolation for VSCode webviews
1676
+ * This component wraps content in a namespace to prevent style conflicts
1677
+ */
1678
+ export declare const WebviewContainer: default_2.FC<WebviewContainerProps>;
1679
+
1680
+ declare interface WebviewContainerProps extends PropsWithChildren {
1681
+ className?: string;
1682
+ }
1683
+
1684
+ /**
1685
+ * Specialized component for Write tool calls
1686
+ * Shows: Write filename + error message + content preview
1687
+ */
1688
+ export declare const WriteToolCall: FC<BaseToolCallProps>;
1689
+
1690
+ export { }