@ash-cloud/ash-ui 0.1.1 → 0.2.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/index.cjs +2058 -2074
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +568 -749
- package/dist/index.d.ts +568 -749
- package/dist/index.js +2011 -2049
- package/dist/index.js.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.cjs +236 -7
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +73 -145
- package/dist/types.d.ts +73 -145
- package/dist/types.js +233 -7
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +0 -35
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -28
- package/dist/utils.d.ts +2 -28
- package/dist/utils.js +1 -34
- package/dist/utils.js.map +1 -1
- package/package.json +10 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,587 +1,454 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import React$1, { ReactNode, ComponentType, DragEvent, ChangeEvent, ClipboardEvent } from 'react';
|
|
3
|
+
import { ToolInvocation, TodoStatus, TodoItem, FileAttachment as FileAttachment$2, LogEntry, ToolStatus, ActionType, MarkdownComponents, NormalizedEntry, Message as Message$1 } from './types.cjs';
|
|
4
|
+
export { MessageAttachment as AIMessageAttachment, AIMessageRole, AgentToolAction, AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_STYLE_CONFIG, ErrorEntry, FileEditAction, FileReadAction, FileWriteAction, GenericToolAction, GlobAction, LogCategory, LogLevel, McpToolAction, MessageMetadata, MessageStyleConfig, MessageVariant, NormalizedEntryType, NormalizedToolCall, RenderMetadataFunction, SearchAction, ThinkingEntry, TodoWriteAction, ToolCallEntry, ToolInvocationState, ToolResult, TypographyScale, UserMessageEntry, WebFetchAction, WebSearchAction, WidgetAction, WidgetEntry, WidgetRenderFunction, WidgetRenderProps, isAgentToolAction, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry, messageToNormalizedEntry, messagesToNormalizedEntries, normalizedEntriesToMessages, normalizedEntryToMessage } from './types.cjs';
|
|
5
5
|
import { ParsedOption } from './utils.cjs';
|
|
6
|
-
export {
|
|
6
|
+
export { ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, formatElapsedTime, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.cjs';
|
|
7
7
|
export { AlertCircleIcon, AlertTriangleIcon, ArrowUpIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, ClockIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, HomeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MicrophoneIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.cjs';
|
|
8
8
|
export { BorderRadius, Colors, CssVars, Keyframes, Shadows, Spacing, Transitions, Typography, Widget, ZIndex, allKeyframesCss, borderRadius, colors, cssVars, inlineStyles, keyframes, keyframesCss, shadows, spacing, tokensToCssVariables, transitions, typography, widget, zIndex } from './design-tokens.cjs';
|
|
9
9
|
|
|
10
|
-
interface
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
interface ConversationContextValue {
|
|
11
|
+
/** Reference to the scroll container */
|
|
12
|
+
containerRef: React$1.RefObject<HTMLDivElement>;
|
|
13
|
+
/** Scroll to the bottom of the conversation */
|
|
14
|
+
scrollToBottom: (behavior?: ScrollBehavior) => void;
|
|
15
|
+
/** Whether the user has scrolled up from the bottom */
|
|
16
|
+
isScrolledUp: boolean;
|
|
17
|
+
/** Whether auto-scroll is enabled */
|
|
18
|
+
autoScroll: boolean;
|
|
19
|
+
/** Set auto-scroll state */
|
|
20
|
+
setAutoScroll: (value: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
declare function useConversation(): ConversationContextValue;
|
|
23
|
+
interface ConversationProps {
|
|
24
|
+
/** Child elements */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/** Additional class name */
|
|
13
27
|
className?: string;
|
|
28
|
+
/** Whether to auto-scroll on new messages */
|
|
29
|
+
autoScroll?: boolean;
|
|
30
|
+
/** Threshold in pixels to consider "at bottom" */
|
|
31
|
+
scrollThreshold?: number;
|
|
14
32
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* - Action-specific icon in accent-colored badge
|
|
21
|
-
* - Expandable details section with smooth animation
|
|
22
|
-
* - Glassmorphism dark theme styling
|
|
23
|
-
* - Execution duration display
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* <ToolCallCard toolCall={normalizedToolCall} />
|
|
28
|
-
* <ToolCallCard toolCall={toolCall} defaultExpanded />
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
declare function ToolCallCard({ toolCall, defaultExpanded, className }: ToolCallCardProps): react_jsx_runtime.JSX.Element;
|
|
32
|
-
|
|
33
|
-
interface AgentToolCardProps {
|
|
34
|
-
/** The tool call with agent_tool action type */
|
|
35
|
-
toolCall: NormalizedToolCall;
|
|
36
|
-
/** Whether the card starts expanded */
|
|
37
|
-
defaultExpanded?: boolean;
|
|
38
|
-
/** Additional class names */
|
|
33
|
+
declare function Conversation({ children, className, autoScroll: initialAutoScroll, scrollThreshold, }: ConversationProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
interface ConversationContentProps {
|
|
35
|
+
/** Child elements */
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
/** Additional class name */
|
|
39
38
|
className?: string;
|
|
40
|
-
/** Depth level for nested rendering (0 = top level) */
|
|
41
|
-
depth?: number;
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* - Description of what the agent is doing
|
|
49
|
-
* - Tool call count that updates during streaming
|
|
50
|
-
* - Loading indicator while running (spinner)
|
|
51
|
-
* - Elapsed time display while running
|
|
52
|
-
* - Expandable to show nested tool calls
|
|
53
|
-
* - Supports deep nesting (agents within agents)
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```tsx
|
|
57
|
-
* <AgentToolCard
|
|
58
|
-
* toolCall={agentToolCall}
|
|
59
|
-
* defaultExpanded={false}
|
|
60
|
-
* />
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
declare function AgentToolCard({ toolCall, defaultExpanded, className, depth, }: AgentToolCardProps): react_jsx_runtime.JSX.Element | null;
|
|
64
|
-
|
|
65
|
-
interface MessageListProps {
|
|
66
|
-
/** Normalized conversation entries to display */
|
|
67
|
-
entries: NormalizedEntry[];
|
|
68
|
-
/** Whether a response is currently loading */
|
|
69
|
-
loading?: boolean;
|
|
70
|
-
/** Streaming text content (displayed during real-time streaming) */
|
|
71
|
-
streamingContent?: string;
|
|
72
|
-
/** Display configuration override (uses context if not provided) */
|
|
73
|
-
displayConfig?: ToolDisplayConfig;
|
|
74
|
-
/** Callback when user selects an option from assistant message */
|
|
75
|
-
onOptionSelect?: (optionText: string) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Custom render function for widget entries.
|
|
78
|
-
* When provided, widget entries will be rendered using this function.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```tsx
|
|
82
|
-
* <MessageList
|
|
83
|
-
* entries={entries}
|
|
84
|
-
* renderWidget={({ widgetType, widgetData, onAction }) => {
|
|
85
|
-
* if (widgetType === 'image-grid') {
|
|
86
|
-
* return <ImageGrid data={widgetData} onSelect={onAction} />;
|
|
87
|
-
* }
|
|
88
|
-
* return null;
|
|
89
|
-
* }}
|
|
90
|
-
* />
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
renderWidget?: WidgetRenderFunction;
|
|
94
|
-
/**
|
|
95
|
-
* Callback for widget interactions (e.g., selection, submit).
|
|
96
|
-
* Called when widgets dispatch actions via their onAction callback.
|
|
97
|
-
*/
|
|
98
|
-
onWidgetAction?: (action: WidgetAction) => void;
|
|
99
|
-
/**
|
|
100
|
-
* Enable auto-scroll to bottom when new entries are added.
|
|
101
|
-
* Scrolls within the message list container (not the page).
|
|
102
|
-
* Default: true
|
|
103
|
-
*/
|
|
104
|
-
autoScroll?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Custom renderers for rich content segments.
|
|
107
|
-
* Used when entries have `richContent` defined.
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* ```tsx
|
|
111
|
-
* <MessageList
|
|
112
|
-
* entries={entriesWithRichContent}
|
|
113
|
-
* richContentRenderers={{
|
|
114
|
-
* renderMention: ({ segment }) => (
|
|
115
|
-
* <MentionBadge
|
|
116
|
-
* name={segment.name}
|
|
117
|
-
* color={segment.color}
|
|
118
|
-
* onClick={() => scrollToEntity(segment.id)}
|
|
119
|
-
* />
|
|
120
|
-
* ),
|
|
121
|
-
* }}
|
|
122
|
-
* />
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
richContentRenderers?: RichContentRenderers;
|
|
126
|
-
/**
|
|
127
|
-
* Visual variant for user messages
|
|
128
|
-
* @default 'bubble'
|
|
129
|
-
*/
|
|
130
|
-
userVariant?: MessageVariant;
|
|
131
|
-
/**
|
|
132
|
-
* Visual variant for assistant messages
|
|
133
|
-
* @default 'bubble'
|
|
134
|
-
*/
|
|
135
|
-
assistantVariant?: MessageVariant;
|
|
136
|
-
/**
|
|
137
|
-
* Typography/density scale
|
|
138
|
-
* @default 'compact'
|
|
139
|
-
*/
|
|
140
|
-
scale?: TypographyScale;
|
|
141
|
-
/**
|
|
142
|
-
* Show avatar icons next to messages
|
|
143
|
-
* @default true
|
|
144
|
-
*/
|
|
145
|
-
showAvatars?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Show timestamps on messages
|
|
148
|
-
* @default true
|
|
149
|
-
*/
|
|
150
|
-
showTimestamp?: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Custom markdown component overrides
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```tsx
|
|
156
|
-
* <MessageList
|
|
157
|
-
* entries={entries}
|
|
158
|
-
* markdownComponents={{
|
|
159
|
-
* h2: ({ children }) => <h2 className="custom-h2">{children}</h2>,
|
|
160
|
-
* code: ({ children, className }) => <CustomCode className={className}>{children}</CustomCode>,
|
|
161
|
-
* }}
|
|
162
|
-
* />
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
markdownComponents?: MarkdownComponents;
|
|
166
|
-
/**
|
|
167
|
-
* Custom metadata renderer for messages
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```tsx
|
|
171
|
-
* <MessageList
|
|
172
|
-
* entries={entries}
|
|
173
|
-
* renderMetadata={({ entry, metadata }) => (
|
|
174
|
-
* <div className="text-xs text-gray-500">
|
|
175
|
-
* {metadata?.model} · {entry.timestamp}
|
|
176
|
-
* </div>
|
|
177
|
-
* )}
|
|
178
|
-
* />
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
renderMetadata?: RenderMetadataFunction;
|
|
182
|
-
/**
|
|
183
|
-
* Metadata to display with messages (e.g., model name)
|
|
184
|
-
*/
|
|
185
|
-
metadata?: MessageMetadata;
|
|
186
|
-
/** Additional class names */
|
|
40
|
+
declare function ConversationContent({ children, className, }: ConversationContentProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
interface ConversationEmptyStateProps {
|
|
42
|
+
/** Child elements */
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
/** Additional class name */
|
|
187
45
|
className?: string;
|
|
188
46
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
* - 'compact': Consecutive tool calls grouped into a single accordion with
|
|
198
|
-
* an animated status line showing the current tool
|
|
199
|
-
*
|
|
200
|
-
* Uses glassmorphism dark theme styling with animated entries.
|
|
201
|
-
*
|
|
202
|
-
* @example
|
|
203
|
-
* ```tsx
|
|
204
|
-
* <MessageList entries={normalizedEntries} />
|
|
205
|
-
* <MessageList entries={entries} loading streamingContent={text} />
|
|
206
|
-
* <MessageList entries={entries} displayConfig={{ mode: 'compact' }} />
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
declare function MessageList({ entries, loading, streamingContent, displayConfig: displayConfigProp, onOptionSelect, renderWidget, onWidgetAction, autoScroll, richContentRenderers, userVariant, assistantVariant, scale, showAvatars, showTimestamp, markdownComponents, renderMetadata, metadata, className, }: MessageListProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare function ConversationEmptyState({ children, className, }: ConversationEmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
interface ConversationScrollButtonProps {
|
|
49
|
+
/** Additional class name */
|
|
50
|
+
className?: string;
|
|
51
|
+
/** Custom label */
|
|
52
|
+
label?: string;
|
|
53
|
+
}
|
|
54
|
+
declare function ConversationScrollButton({ className, label, }: ConversationScrollButtonProps): react_jsx_runtime.JSX.Element | null;
|
|
210
55
|
|
|
211
|
-
interface
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
|
|
56
|
+
interface MessageContextValue {
|
|
57
|
+
/** Message role */
|
|
58
|
+
from: 'user' | 'assistant' | 'system';
|
|
59
|
+
/** Whether this message is streaming */
|
|
60
|
+
isStreaming?: boolean;
|
|
61
|
+
/** Tool invocations in this message */
|
|
62
|
+
toolInvocations?: ToolInvocation[];
|
|
63
|
+
}
|
|
64
|
+
declare function useMessage(): MessageContextValue;
|
|
65
|
+
interface MessageProps {
|
|
66
|
+
/** Message role */
|
|
67
|
+
from: 'user' | 'assistant' | 'system';
|
|
68
|
+
/** Child elements */
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
/** Additional class name */
|
|
225
71
|
className?: string;
|
|
72
|
+
/** Whether this message is streaming */
|
|
73
|
+
isStreaming?: boolean;
|
|
74
|
+
/** Tool invocations (for assistant messages) */
|
|
75
|
+
toolInvocations?: ToolInvocation[];
|
|
76
|
+
/** Message ID for data attribute */
|
|
77
|
+
id?: string;
|
|
226
78
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
interface AssistantMessageProps {
|
|
235
|
-
entry: NormalizedEntry;
|
|
236
|
-
/** Visual style variant */
|
|
237
|
-
variant?: MessageVariant;
|
|
238
|
-
/** Typography scale */
|
|
239
|
-
scale?: TypographyScale;
|
|
240
|
-
/** Show avatar */
|
|
241
|
-
showAvatar?: boolean;
|
|
242
|
-
/** Show timestamp */
|
|
243
|
-
showTimestamp?: boolean;
|
|
244
|
-
/** Callback when user selects an option */
|
|
245
|
-
onOptionSelect?: (optionText: string) => void;
|
|
246
|
-
/** Custom renderers for rich content segments */
|
|
247
|
-
richContentRenderers?: RichContentRenderers;
|
|
248
|
-
/** Custom markdown component overrides */
|
|
249
|
-
markdownComponents?: MarkdownComponents;
|
|
250
|
-
/** Custom metadata renderer */
|
|
251
|
-
renderMetadata?: RenderMetadataFunction;
|
|
252
|
-
/** Additional metadata to display */
|
|
253
|
-
metadata?: MessageMetadata;
|
|
79
|
+
declare function Message({ from, children, className, isStreaming, toolInvocations, id, }: MessageProps): react_jsx_runtime.JSX.Element;
|
|
80
|
+
interface MessageAvatarProps {
|
|
81
|
+
/** Avatar image URL */
|
|
82
|
+
src?: string;
|
|
83
|
+
/** Fallback text (initials) */
|
|
84
|
+
fallback?: string;
|
|
85
|
+
/** Additional class name */
|
|
254
86
|
className?: string;
|
|
255
87
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
* Automatically detects and renders interactive options when present.
|
|
262
|
-
* Supports rich content segments for inline rendering of mentions and custom components.
|
|
263
|
-
*/
|
|
264
|
-
declare function AssistantMessage({ entry, variant, scale, showAvatar, showTimestamp, onOptionSelect, richContentRenderers, markdownComponents, renderMetadata, metadata, className, }: AssistantMessageProps): react_jsx_runtime.JSX.Element;
|
|
265
|
-
interface ThinkingMessageProps {
|
|
266
|
-
entry: NormalizedEntry;
|
|
267
|
-
/** Typography scale */
|
|
268
|
-
scale?: TypographyScale;
|
|
269
|
-
/** Show avatar */
|
|
270
|
-
showAvatar?: boolean;
|
|
88
|
+
declare function MessageAvatar({ src, fallback, className }: MessageAvatarProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
interface MessageContentProps {
|
|
90
|
+
/** Child elements */
|
|
91
|
+
children: ReactNode;
|
|
92
|
+
/** Additional class name */
|
|
271
93
|
className?: string;
|
|
272
94
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
entry: NormalizedEntry;
|
|
281
|
-
/** Typography scale */
|
|
282
|
-
scale?: TypographyScale;
|
|
283
|
-
/** Show avatar */
|
|
284
|
-
showAvatar?: boolean;
|
|
285
|
-
defaultExpanded?: boolean;
|
|
95
|
+
declare function MessageContent({ children, className }: MessageContentProps): react_jsx_runtime.JSX.Element;
|
|
96
|
+
interface MessageResponseProps {
|
|
97
|
+
/** Text content to render as markdown */
|
|
98
|
+
content: string;
|
|
99
|
+
/** Whether content is still streaming */
|
|
100
|
+
isStreaming?: boolean;
|
|
101
|
+
/** Additional class name */
|
|
286
102
|
className?: string;
|
|
103
|
+
/** Custom markdown components */
|
|
104
|
+
components?: Record<string, ComponentType<{
|
|
105
|
+
children?: ReactNode;
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}>>;
|
|
287
108
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
*/
|
|
293
|
-
declare function ToolCallMessage({ entry, scale, showAvatar, defaultExpanded, className }: ToolCallMessageProps): react_jsx_runtime.JSX.Element | null;
|
|
294
|
-
interface ErrorMessageProps {
|
|
295
|
-
entry: NormalizedEntry;
|
|
296
|
-
/** Typography scale */
|
|
297
|
-
scale?: TypographyScale;
|
|
298
|
-
/** Show avatar */
|
|
299
|
-
showAvatar?: boolean;
|
|
109
|
+
declare function MessageResponse({ content, isStreaming, className, components, }: MessageResponseProps): react_jsx_runtime.JSX.Element | null;
|
|
110
|
+
interface MessageActionsProps {
|
|
111
|
+
/** Child elements (action buttons) */
|
|
112
|
+
children: ReactNode;
|
|
113
|
+
/** Additional class name */
|
|
300
114
|
className?: string;
|
|
301
115
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
*/
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
onOptionSelect?: (optionText: string) => void;
|
|
312
|
-
/** Whether tool calls should be expanded by default */
|
|
313
|
-
defaultExpanded?: boolean;
|
|
314
|
-
/** Custom renderers for rich content segments */
|
|
315
|
-
richContentRenderers?: RichContentRenderers;
|
|
316
|
-
/** Custom markdown component overrides */
|
|
317
|
-
markdownComponents?: MarkdownComponents;
|
|
318
|
-
/** Visual variant for user messages */
|
|
319
|
-
userVariant?: MessageVariant;
|
|
320
|
-
/** Visual variant for assistant messages */
|
|
321
|
-
assistantVariant?: MessageVariant;
|
|
322
|
-
/** Typography scale */
|
|
323
|
-
scale?: TypographyScale;
|
|
324
|
-
/** Show avatars */
|
|
325
|
-
showAvatars?: boolean;
|
|
326
|
-
/** Show timestamps */
|
|
327
|
-
showTimestamp?: boolean;
|
|
328
|
-
/** Custom metadata renderer */
|
|
329
|
-
renderMetadata?: RenderMetadataFunction;
|
|
330
|
-
/** Additional metadata to display */
|
|
331
|
-
metadata?: MessageMetadata;
|
|
116
|
+
declare function MessageActions({ children, className }: MessageActionsProps): react_jsx_runtime.JSX.Element;
|
|
117
|
+
interface MessageActionProps {
|
|
118
|
+
/** Action icon */
|
|
119
|
+
icon?: ReactNode;
|
|
120
|
+
/** Action label */
|
|
121
|
+
label: string;
|
|
122
|
+
/** Click handler */
|
|
123
|
+
onClick?: () => void;
|
|
124
|
+
/** Additional class name */
|
|
332
125
|
className?: string;
|
|
333
126
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
* easy CSS targeting.
|
|
340
|
-
*
|
|
341
|
-
* @example
|
|
342
|
-
* ```tsx
|
|
343
|
-
* {entries.map(entry => (
|
|
344
|
-
* <MessageEntry key={entry.id} entry={entry} onOptionSelect={handleSelect} />
|
|
345
|
-
* ))}
|
|
346
|
-
*
|
|
347
|
-
* // CSS targeting
|
|
348
|
-
* [data-message-role="user"] { background: #1a1a1a; }
|
|
349
|
-
* [data-message-role="assistant"] { border-left: 2px solid var(--accent); }
|
|
350
|
-
* ```
|
|
351
|
-
*/
|
|
352
|
-
declare function MessageEntry({ entry, onOptionSelect, defaultExpanded, richContentRenderers, markdownComponents, userVariant, assistantVariant, scale, showAvatars, showTimestamp, renderMetadata, metadata, className, }: MessageEntryProps): react_jsx_runtime.JSX.Element | null;
|
|
353
|
-
|
|
354
|
-
interface LogsPanelProps {
|
|
355
|
-
logs: LogEntry[];
|
|
356
|
-
title?: string;
|
|
357
|
-
isLoading?: boolean;
|
|
358
|
-
defaultCollapsed?: boolean;
|
|
359
|
-
maxHeight?: number;
|
|
127
|
+
declare function MessageAction({ icon, label, onClick, className, }: MessageActionProps): react_jsx_runtime.JSX.Element;
|
|
128
|
+
interface MessageTimestampProps {
|
|
129
|
+
/** Timestamp to display */
|
|
130
|
+
timestamp: Date | string;
|
|
131
|
+
/** Additional class name */
|
|
360
132
|
className?: string;
|
|
361
133
|
}
|
|
362
|
-
|
|
363
|
-
* LogsPanel - Collapsible panel for displaying log entries
|
|
364
|
-
*
|
|
365
|
-
* Features:
|
|
366
|
-
* - Collapsible header with log count
|
|
367
|
-
* - Error/warning count badges
|
|
368
|
-
* - Level-based coloring and icons
|
|
369
|
-
* - Expandable entries with JSON data
|
|
370
|
-
*
|
|
371
|
-
* @example
|
|
372
|
-
* ```tsx
|
|
373
|
-
* <LogsPanel logs={logEntries} />
|
|
374
|
-
* <LogsPanel logs={logs} title="Execution Logs" defaultCollapsed={false} />
|
|
375
|
-
* ```
|
|
376
|
-
*/
|
|
377
|
-
declare function LogsPanel({ logs, title, isLoading, defaultCollapsed, maxHeight, className, }: LogsPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
134
|
+
declare function MessageTimestamp({ timestamp, className }: MessageTimestampProps): react_jsx_runtime.JSX.Element;
|
|
378
135
|
|
|
379
|
-
interface
|
|
380
|
-
/**
|
|
381
|
-
|
|
382
|
-
/** Whether the
|
|
136
|
+
interface ToolContextValue {
|
|
137
|
+
/** The tool invocation data */
|
|
138
|
+
toolInvocation: ToolInvocation;
|
|
139
|
+
/** Whether the tool details are expanded */
|
|
140
|
+
isExpanded: boolean;
|
|
141
|
+
/** Toggle expansion state */
|
|
142
|
+
toggleExpanded: () => void;
|
|
143
|
+
}
|
|
144
|
+
declare function useTool(): ToolContextValue;
|
|
145
|
+
interface ToolProps {
|
|
146
|
+
/** Tool invocation data */
|
|
147
|
+
toolInvocation: ToolInvocation;
|
|
148
|
+
/** Child elements */
|
|
149
|
+
children?: ReactNode;
|
|
150
|
+
/** Additional class name */
|
|
151
|
+
className?: string;
|
|
152
|
+
/** Whether to start expanded */
|
|
383
153
|
defaultExpanded?: boolean;
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
154
|
+
}
|
|
155
|
+
declare function Tool({ toolInvocation, children, className, defaultExpanded, }: ToolProps): react_jsx_runtime.JSX.Element;
|
|
156
|
+
interface ToolHeaderProps {
|
|
157
|
+
/** Additional class name */
|
|
387
158
|
className?: string;
|
|
159
|
+
/** Custom icon */
|
|
160
|
+
icon?: ReactNode;
|
|
161
|
+
/** Show expand/collapse button */
|
|
162
|
+
showToggle?: boolean;
|
|
388
163
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
164
|
+
declare function ToolHeader({ className, icon, showToggle, }: ToolHeaderProps): react_jsx_runtime.JSX.Element;
|
|
165
|
+
interface ToolInputProps {
|
|
166
|
+
/** Additional class name */
|
|
167
|
+
className?: string;
|
|
168
|
+
/** Maximum height before scroll */
|
|
169
|
+
maxHeight?: number;
|
|
170
|
+
}
|
|
171
|
+
declare function ToolInput({ className, maxHeight }: ToolInputProps): react_jsx_runtime.JSX.Element | null;
|
|
172
|
+
interface ToolOutputProps {
|
|
173
|
+
/** Additional class name */
|
|
174
|
+
className?: string;
|
|
175
|
+
/** Maximum height before scroll */
|
|
176
|
+
maxHeight?: number;
|
|
177
|
+
}
|
|
178
|
+
declare function ToolOutput({ className, maxHeight }: ToolOutputProps): react_jsx_runtime.JSX.Element | null;
|
|
179
|
+
interface ToolListProps {
|
|
180
|
+
/** Tool invocations to render */
|
|
181
|
+
toolInvocations: ToolInvocation[];
|
|
182
|
+
/** Additional class name */
|
|
183
|
+
className?: string;
|
|
184
|
+
/** Whether to show tools expanded by default */
|
|
185
|
+
defaultExpanded?: boolean;
|
|
186
|
+
}
|
|
187
|
+
declare function ToolList({ toolInvocations, className, defaultExpanded, }: ToolListProps): react_jsx_runtime.JSX.Element | null;
|
|
405
188
|
|
|
406
|
-
interface
|
|
407
|
-
/**
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
|
|
413
|
-
/**
|
|
189
|
+
interface ReasoningContextValue {
|
|
190
|
+
/** Whether the reasoning panel is open */
|
|
191
|
+
isOpen: boolean;
|
|
192
|
+
/** Toggle open state */
|
|
193
|
+
setIsOpen: (value: boolean) => void;
|
|
194
|
+
/** Whether reasoning is currently streaming */
|
|
195
|
+
isStreaming: boolean;
|
|
196
|
+
/** Duration of thinking in seconds */
|
|
197
|
+
duration: number;
|
|
198
|
+
}
|
|
199
|
+
declare function useReasoning(): ReasoningContextValue;
|
|
200
|
+
interface ReasoningProps {
|
|
201
|
+
/** Child elements */
|
|
202
|
+
children: ReactNode;
|
|
203
|
+
/** Whether reasoning is currently streaming */
|
|
204
|
+
isStreaming?: boolean;
|
|
205
|
+
/** Additional class name */
|
|
414
206
|
className?: string;
|
|
207
|
+
/** Whether to auto-expand during streaming */
|
|
208
|
+
autoExpand?: boolean;
|
|
209
|
+
/** Whether to auto-collapse when streaming completes */
|
|
210
|
+
autoCollapse?: boolean;
|
|
211
|
+
/** Initial duration in seconds (for loaded content) */
|
|
212
|
+
initialDuration?: number;
|
|
415
213
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
214
|
+
declare function Reasoning({ children, isStreaming, className, autoExpand, autoCollapse, initialDuration, }: ReasoningProps): react_jsx_runtime.JSX.Element;
|
|
215
|
+
interface ReasoningTriggerProps {
|
|
216
|
+
/** Additional class name */
|
|
217
|
+
className?: string;
|
|
218
|
+
/** Custom label */
|
|
219
|
+
label?: string;
|
|
220
|
+
/** Show duration */
|
|
221
|
+
showDuration?: boolean;
|
|
222
|
+
}
|
|
223
|
+
declare function ReasoningTrigger({ className, label, showDuration, }: ReasoningTriggerProps): react_jsx_runtime.JSX.Element;
|
|
224
|
+
interface ReasoningContentProps {
|
|
225
|
+
/** Content to display (thinking text) */
|
|
226
|
+
children: ReactNode;
|
|
227
|
+
/** Additional class name */
|
|
228
|
+
className?: string;
|
|
229
|
+
/** Maximum height before scroll */
|
|
230
|
+
maxHeight?: number;
|
|
231
|
+
}
|
|
232
|
+
declare function ReasoningContent({ children, className, maxHeight, }: ReasoningContentProps): react_jsx_runtime.JSX.Element | null;
|
|
233
|
+
interface ThinkingIndicatorProps {
|
|
234
|
+
/** Whether thinking is active */
|
|
235
|
+
isActive?: boolean;
|
|
236
|
+
/** Label to display */
|
|
237
|
+
label?: string;
|
|
238
|
+
/** Additional class name */
|
|
239
|
+
className?: string;
|
|
240
|
+
}
|
|
241
|
+
declare function ThinkingIndicator({ isActive, label, className, }: ThinkingIndicatorProps): react_jsx_runtime.JSX.Element | null;
|
|
432
242
|
|
|
433
|
-
interface
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
243
|
+
interface TaskContextValue {
|
|
244
|
+
/** Whether the task list is open */
|
|
245
|
+
isOpen: boolean;
|
|
246
|
+
/** Toggle open state */
|
|
247
|
+
setIsOpen: (value: boolean) => void;
|
|
248
|
+
}
|
|
249
|
+
declare function useTask(): TaskContextValue;
|
|
250
|
+
interface TaskProps {
|
|
251
|
+
/** Child elements */
|
|
252
|
+
children: ReactNode;
|
|
253
|
+
/** Whether to start open */
|
|
254
|
+
defaultOpen?: boolean;
|
|
255
|
+
/** Additional class name */
|
|
437
256
|
className?: string;
|
|
438
257
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
*/
|
|
449
|
-
|
|
258
|
+
declare function Task({ children, defaultOpen, className, }: TaskProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
interface TaskTriggerProps {
|
|
260
|
+
/** Trigger content (usually task count/label) */
|
|
261
|
+
children: ReactNode;
|
|
262
|
+
/** Additional class name */
|
|
263
|
+
className?: string;
|
|
264
|
+
}
|
|
265
|
+
declare function TaskTrigger({ children, className }: TaskTriggerProps): react_jsx_runtime.JSX.Element;
|
|
266
|
+
interface TaskContentProps {
|
|
267
|
+
/** Child elements (TaskItem components) */
|
|
268
|
+
children: ReactNode;
|
|
269
|
+
/** Additional class name */
|
|
270
|
+
className?: string;
|
|
271
|
+
}
|
|
272
|
+
declare function TaskContent({ children, className }: TaskContentProps): react_jsx_runtime.JSX.Element | null;
|
|
273
|
+
interface TaskItemProps {
|
|
274
|
+
/** Task content */
|
|
275
|
+
children: ReactNode;
|
|
276
|
+
/** Task status */
|
|
277
|
+
status: TodoStatus;
|
|
278
|
+
/** Active form (shown when in_progress) */
|
|
279
|
+
activeForm?: string;
|
|
280
|
+
/** Additional class name */
|
|
281
|
+
className?: string;
|
|
282
|
+
}
|
|
283
|
+
declare function TaskItem({ children, status, activeForm, className, }: TaskItemProps): react_jsx_runtime.JSX.Element;
|
|
284
|
+
interface TaskListProps {
|
|
285
|
+
/** Todo items to display */
|
|
286
|
+
items: TodoItem[];
|
|
287
|
+
/** Whether to start open */
|
|
288
|
+
defaultOpen?: boolean;
|
|
289
|
+
/** Additional class name */
|
|
290
|
+
className?: string;
|
|
291
|
+
/** Custom title */
|
|
292
|
+
title?: string;
|
|
293
|
+
}
|
|
294
|
+
declare function TaskList({ items, defaultOpen, className, title, }: TaskListProps): react_jsx_runtime.JSX.Element;
|
|
450
295
|
|
|
296
|
+
interface AttachmentContextValue {
|
|
297
|
+
/** The file attachment data */
|
|
298
|
+
file: FileAttachment$2 | AttachmentFile;
|
|
299
|
+
/** Whether the attachment can be removed */
|
|
300
|
+
removable?: boolean;
|
|
301
|
+
/** Remove callback */
|
|
302
|
+
onRemove?: () => void;
|
|
303
|
+
}
|
|
304
|
+
declare function useAttachment(): AttachmentContextValue;
|
|
305
|
+
interface AttachmentFile {
|
|
306
|
+
/** File name */
|
|
307
|
+
name: string;
|
|
308
|
+
/** MIME type */
|
|
309
|
+
type: string;
|
|
310
|
+
/** File size in bytes */
|
|
311
|
+
size: number;
|
|
312
|
+
/** URL or data URL for preview */
|
|
313
|
+
url?: string;
|
|
314
|
+
/** Base64 data (for upload) */
|
|
315
|
+
base64?: string;
|
|
316
|
+
}
|
|
317
|
+
interface AttachmentsProps {
|
|
318
|
+
/** Child elements (Attachment components) */
|
|
319
|
+
children: ReactNode;
|
|
320
|
+
/** Layout style */
|
|
321
|
+
layout?: 'grid' | 'inline' | 'list';
|
|
322
|
+
/** Additional class name */
|
|
323
|
+
className?: string;
|
|
324
|
+
}
|
|
325
|
+
declare function Attachments({ children, layout, className, }: AttachmentsProps): react_jsx_runtime.JSX.Element;
|
|
326
|
+
interface AttachmentProps {
|
|
327
|
+
/** File data */
|
|
328
|
+
file: FileAttachment$2 | AttachmentFile;
|
|
329
|
+
/** Child elements (AttachmentPreview, etc.) */
|
|
330
|
+
children?: ReactNode;
|
|
331
|
+
/** Whether the attachment can be removed */
|
|
332
|
+
removable?: boolean;
|
|
333
|
+
/** Remove callback */
|
|
334
|
+
onRemove?: () => void;
|
|
335
|
+
/** Additional class name */
|
|
336
|
+
className?: string;
|
|
337
|
+
}
|
|
338
|
+
declare function Attachment({ file, children, removable, onRemove, className, }: AttachmentProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
interface AttachmentPreviewProps {
|
|
340
|
+
/** Additional class name */
|
|
341
|
+
className?: string;
|
|
342
|
+
/** Preview height */
|
|
343
|
+
height?: number;
|
|
344
|
+
}
|
|
345
|
+
declare function AttachmentPreview({ className, height, }: AttachmentPreviewProps): react_jsx_runtime.JSX.Element;
|
|
346
|
+
interface AttachmentInfoProps {
|
|
347
|
+
/** Additional class name */
|
|
348
|
+
className?: string;
|
|
349
|
+
/** Show file size */
|
|
350
|
+
showSize?: boolean;
|
|
351
|
+
}
|
|
352
|
+
declare function AttachmentInfo({ className, showSize, }: AttachmentInfoProps): react_jsx_runtime.JSX.Element;
|
|
353
|
+
interface AttachmentRemoveProps {
|
|
354
|
+
/** Additional class name */
|
|
355
|
+
className?: string;
|
|
356
|
+
}
|
|
357
|
+
declare function AttachmentRemove({ className }: AttachmentRemoveProps): react_jsx_runtime.JSX.Element | null;
|
|
451
358
|
interface FileBadgeProps {
|
|
452
|
-
/**
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
|
|
359
|
+
/** File data */
|
|
360
|
+
file: FileAttachment$2 | AttachmentFile;
|
|
361
|
+
/** Whether the file can be removed */
|
|
362
|
+
removable?: boolean;
|
|
363
|
+
/** Remove callback */
|
|
364
|
+
onRemove?: () => void;
|
|
365
|
+
/** Additional class name */
|
|
366
|
+
className?: string;
|
|
367
|
+
}
|
|
368
|
+
declare function FileBadgeCompact({ file, removable, onRemove, className, }: FileBadgeProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
|
|
370
|
+
interface ShimmerProps {
|
|
371
|
+
/** Child elements */
|
|
372
|
+
children?: ReactNode;
|
|
373
|
+
/** Additional class name */
|
|
374
|
+
className?: string;
|
|
375
|
+
/** Whether shimmer is active */
|
|
376
|
+
isActive?: boolean;
|
|
377
|
+
}
|
|
378
|
+
declare function Shimmer({ children, className, isActive, }: ShimmerProps): react_jsx_runtime.JSX.Element | null;
|
|
379
|
+
interface ShimmerLineProps {
|
|
380
|
+
/** Width (CSS value or percentage) */
|
|
381
|
+
width?: string | number;
|
|
382
|
+
/** Height in pixels */
|
|
383
|
+
height?: number;
|
|
384
|
+
/** Additional class name */
|
|
385
|
+
className?: string;
|
|
386
|
+
}
|
|
387
|
+
declare function ShimmerLine({ width, height, className, }: ShimmerLineProps): react_jsx_runtime.JSX.Element;
|
|
388
|
+
interface ShimmerBlockProps {
|
|
389
|
+
/** Width (CSS value or percentage) */
|
|
390
|
+
width?: string | number;
|
|
391
|
+
/** Height in pixels */
|
|
392
|
+
height?: number;
|
|
393
|
+
/** Border radius */
|
|
394
|
+
rounded?: 'sm' | 'md' | 'lg' | 'full' | 'none';
|
|
395
|
+
/** Additional class name */
|
|
396
|
+
className?: string;
|
|
397
|
+
}
|
|
398
|
+
declare function ShimmerBlock({ width, height, rounded, className, }: ShimmerBlockProps): react_jsx_runtime.JSX.Element;
|
|
399
|
+
interface ShimmerTextProps {
|
|
400
|
+
/** Number of characters to approximate width */
|
|
401
|
+
chars?: number;
|
|
402
|
+
/** Additional class name */
|
|
460
403
|
className?: string;
|
|
461
404
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
* ```tsx
|
|
469
|
-
* <FileBadge path="src/utils.ts" linesAdded={5} linesRemoved={2} />
|
|
470
|
-
* <FileBadge path="SKILL.md" linesAdded={0} linesRemoved={22} />
|
|
471
|
-
* ```
|
|
472
|
-
*/
|
|
473
|
-
declare function FileBadge({ path, linesAdded, linesRemoved, showOnlyFilename, className, }: FileBadgeProps): react_jsx_runtime.JSX.Element;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Context type for display mode configuration
|
|
477
|
-
*/
|
|
478
|
-
interface DisplayModeContextType {
|
|
479
|
-
/** Current display configuration */
|
|
480
|
-
config: ToolDisplayConfig;
|
|
481
|
-
/** Update the display mode */
|
|
482
|
-
setMode: (mode: ToolDisplayMode) => void;
|
|
483
|
-
/** Update the full configuration */
|
|
484
|
-
setConfig: (config: Partial<ToolDisplayConfig>) => void;
|
|
485
|
-
/** Toggle between 'inline' and 'compact' modes */
|
|
486
|
-
toggleMode: () => void;
|
|
487
|
-
}
|
|
488
|
-
interface DisplayModeProviderProps {
|
|
489
|
-
children: ReactNode;
|
|
490
|
-
/** Initial display configuration */
|
|
491
|
-
initialConfig?: Partial<ToolDisplayConfig>;
|
|
405
|
+
declare function ShimmerText({ chars, className, }: ShimmerTextProps): react_jsx_runtime.JSX.Element;
|
|
406
|
+
interface LoadingDotsProps {
|
|
407
|
+
/** Size variant */
|
|
408
|
+
size?: 'sm' | 'md' | 'lg';
|
|
409
|
+
/** Additional class name */
|
|
410
|
+
className?: string;
|
|
492
411
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
*
|
|
499
|
-
* @example
|
|
500
|
-
* ```tsx
|
|
501
|
-
* <DisplayModeProvider initialConfig={{ mode: 'compact' }}>
|
|
502
|
-
* <MessageList entries={entries} />
|
|
503
|
-
* </DisplayModeProvider>
|
|
504
|
-
* ```
|
|
505
|
-
*/
|
|
506
|
-
declare function DisplayModeProvider({ children, initialConfig }: DisplayModeProviderProps): react_jsx_runtime.JSX.Element;
|
|
507
|
-
/**
|
|
508
|
-
* Hook to access display mode configuration.
|
|
509
|
-
*
|
|
510
|
-
* @example
|
|
511
|
-
* ```tsx
|
|
512
|
-
* function MyComponent() {
|
|
513
|
-
* const { config, toggleMode } = useDisplayMode();
|
|
514
|
-
*
|
|
515
|
-
* return (
|
|
516
|
-
* <button onClick={toggleMode}>
|
|
517
|
-
* Mode: {config.mode}
|
|
518
|
-
* </button>
|
|
519
|
-
* );
|
|
520
|
-
* }
|
|
521
|
-
* ```
|
|
522
|
-
*/
|
|
523
|
-
declare function useDisplayMode(): DisplayModeContextType;
|
|
524
|
-
/**
|
|
525
|
-
* Hook to get just the current config (for components that only read)
|
|
526
|
-
*/
|
|
527
|
-
declare function useDisplayConfig(): ToolDisplayConfig;
|
|
528
|
-
|
|
529
|
-
interface OptionCardsProps {
|
|
530
|
-
/** Parsed options to display */
|
|
531
|
-
options: ParsedOption[];
|
|
532
|
-
/** Callback when an option is selected */
|
|
533
|
-
onSelect: (option: ParsedOption) => void;
|
|
534
|
-
/** Additional class names */
|
|
412
|
+
declare function LoadingDots({ size, className, }: LoadingDotsProps): react_jsx_runtime.JSX.Element;
|
|
413
|
+
interface LoadingSpinnerProps {
|
|
414
|
+
/** Size variant */
|
|
415
|
+
size?: 'sm' | 'md' | 'lg';
|
|
416
|
+
/** Additional class name */
|
|
535
417
|
className?: string;
|
|
536
418
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
* <OptionCards
|
|
546
|
-
* options={[
|
|
547
|
-
* { id: '1', label: 'Add Product', description: 'Upload a new product' },
|
|
548
|
-
* { id: '2', label: 'Browse Existing', description: 'View your products' },
|
|
549
|
-
* ]}
|
|
550
|
-
* onSelect={(opt) => sendMessage(opt.label)}
|
|
551
|
-
* />
|
|
552
|
-
* ```
|
|
553
|
-
*/
|
|
554
|
-
declare function OptionCards({ options, onSelect, className }: OptionCardsProps): react_jsx_runtime.JSX.Element;
|
|
419
|
+
declare function LoadingSpinner({ size, className, }: LoadingSpinnerProps): react_jsx_runtime.JSX.Element;
|
|
420
|
+
interface MessageShimmerProps {
|
|
421
|
+
/** Message role to style appropriately */
|
|
422
|
+
role?: 'user' | 'assistant';
|
|
423
|
+
/** Additional class name */
|
|
424
|
+
className?: string;
|
|
425
|
+
}
|
|
426
|
+
declare function MessageShimmer({ role, className, }: MessageShimmerProps): react_jsx_runtime.JSX.Element;
|
|
555
427
|
|
|
556
|
-
interface
|
|
557
|
-
|
|
558
|
-
todos: TodoItem[];
|
|
559
|
-
/** Optional title for the panel */
|
|
428
|
+
interface LogsPanelProps {
|
|
429
|
+
logs: LogEntry[];
|
|
560
430
|
title?: string;
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
showProgress?: boolean;
|
|
565
|
-
/** Additional class names */
|
|
431
|
+
isLoading?: boolean;
|
|
432
|
+
defaultCollapsed?: boolean;
|
|
433
|
+
maxHeight?: number;
|
|
566
434
|
className?: string;
|
|
567
435
|
}
|
|
568
436
|
/**
|
|
569
|
-
*
|
|
437
|
+
* LogsPanel - Collapsible panel for displaying log entries
|
|
570
438
|
*
|
|
571
439
|
* Features:
|
|
572
|
-
* -
|
|
573
|
-
* -
|
|
574
|
-
* -
|
|
575
|
-
* -
|
|
440
|
+
* - Collapsible header with log count
|
|
441
|
+
* - Error/warning count badges
|
|
442
|
+
* - Level-based coloring and icons
|
|
443
|
+
* - Expandable entries with JSON data
|
|
576
444
|
*
|
|
577
445
|
* @example
|
|
578
446
|
* ```tsx
|
|
579
|
-
* <
|
|
580
|
-
* <
|
|
581
|
-
* <TodoPanel todos={todos} compact />
|
|
447
|
+
* <LogsPanel logs={logEntries} />
|
|
448
|
+
* <LogsPanel logs={logs} title="Execution Logs" defaultCollapsed={false} />
|
|
582
449
|
* ```
|
|
583
450
|
*/
|
|
584
|
-
declare function
|
|
451
|
+
declare function LogsPanel({ logs, title, isLoading, defaultCollapsed, maxHeight, className, }: LogsPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
585
452
|
|
|
586
453
|
interface EnvVarsPanelProps {
|
|
587
454
|
/** Current environment variables */
|
|
@@ -620,79 +487,32 @@ interface EnvVarsPanelProps {
|
|
|
620
487
|
*/
|
|
621
488
|
declare function EnvVarsPanel({ envVars, onChange, defaultCollapsed, className, label, helperText, }: EnvVarsPanelProps): react_jsx_runtime.JSX.Element;
|
|
622
489
|
|
|
623
|
-
interface
|
|
624
|
-
/**
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
|
|
628
|
-
/** Custom labels for modes */
|
|
629
|
-
labels?: {
|
|
630
|
-
inline?: string;
|
|
631
|
-
compact?: string;
|
|
632
|
-
accordion?: string;
|
|
633
|
-
};
|
|
634
|
-
/** Which modes to cycle through (default: all three) */
|
|
635
|
-
modes?: ToolDisplayMode[];
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* DisplayModeToggle - Button to cycle through display modes
|
|
639
|
-
*
|
|
640
|
-
* Uses the DisplayModeContext to cycle through 'inline', 'compact', and 'accordion' modes.
|
|
641
|
-
* Must be used within a DisplayModeProvider.
|
|
642
|
-
*
|
|
643
|
-
* @example
|
|
644
|
-
* ```tsx
|
|
645
|
-
* function ChatHeader() {
|
|
646
|
-
* return (
|
|
647
|
-
* <header>
|
|
648
|
-
* <h1>Chat</h1>
|
|
649
|
-
* <DisplayModeToggle />
|
|
650
|
-
* </header>
|
|
651
|
-
* );
|
|
652
|
-
* }
|
|
653
|
-
*
|
|
654
|
-
* function App() {
|
|
655
|
-
* return (
|
|
656
|
-
* <DisplayModeProvider>
|
|
657
|
-
* <ChatHeader />
|
|
658
|
-
* <MessageList entries={entries} />
|
|
659
|
-
* </DisplayModeProvider>
|
|
660
|
-
* );
|
|
661
|
-
* }
|
|
662
|
-
* ```
|
|
663
|
-
*/
|
|
664
|
-
declare function DisplayModeToggle({ className, showLabel, labels, modes, }: DisplayModeToggleProps): react_jsx_runtime.JSX.Element;
|
|
665
|
-
|
|
666
|
-
type StepStatus = 'pending' | 'running' | 'success' | 'error';
|
|
667
|
-
interface StepAccordionProps {
|
|
668
|
-
/** Tool calls to display as steps */
|
|
669
|
-
toolCalls: NormalizedToolCall[];
|
|
670
|
-
/** Whether the accordion starts expanded */
|
|
671
|
-
defaultExpanded?: boolean;
|
|
672
|
-
/** Controlled expanded state */
|
|
673
|
-
isExpanded?: boolean;
|
|
674
|
-
/** Callback when expanded state changes */
|
|
675
|
-
onToggle?: () => void;
|
|
490
|
+
interface OptionCardsProps {
|
|
491
|
+
/** Parsed options to display */
|
|
492
|
+
options: ParsedOption[];
|
|
493
|
+
/** Callback when an option is selected */
|
|
494
|
+
onSelect: (option: ParsedOption) => void;
|
|
676
495
|
/** Additional class names */
|
|
677
496
|
className?: string;
|
|
678
497
|
}
|
|
679
498
|
/**
|
|
680
|
-
*
|
|
499
|
+
* OptionCards - Display clickable option cards for interactive selection
|
|
681
500
|
*
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
* - Expanded view shows CompactToolRow for each tool call
|
|
685
|
-
* - Clean, minimal design matching the compact UI style
|
|
501
|
+
* Renders a grid of glassmorphic cards that users can click to select an option.
|
|
502
|
+
* Used when assistant messages contain structured options for the user to choose from.
|
|
686
503
|
*
|
|
687
504
|
* @example
|
|
688
505
|
* ```tsx
|
|
689
|
-
* <
|
|
690
|
-
*
|
|
691
|
-
*
|
|
506
|
+
* <OptionCards
|
|
507
|
+
* options={[
|
|
508
|
+
* { id: '1', label: 'Add Product', description: 'Upload a new product' },
|
|
509
|
+
* { id: '2', label: 'Browse Existing', description: 'View your products' },
|
|
510
|
+
* ]}
|
|
511
|
+
* onSelect={(opt) => sendMessage(opt.label)}
|
|
692
512
|
* />
|
|
693
513
|
* ```
|
|
694
514
|
*/
|
|
695
|
-
declare function
|
|
515
|
+
declare function OptionCards({ options, onSelect, className }: OptionCardsProps): react_jsx_runtime.JSX.Element;
|
|
696
516
|
|
|
697
517
|
interface StatusIndicatorProps {
|
|
698
518
|
status: ToolStatus;
|
|
@@ -769,51 +589,6 @@ interface JsonDisplayProps {
|
|
|
769
589
|
*/
|
|
770
590
|
declare function JsonDisplay({ value, maxHeight, className }: JsonDisplayProps): react_jsx_runtime.JSX.Element;
|
|
771
591
|
|
|
772
|
-
interface StreamingTextProps {
|
|
773
|
-
content: string;
|
|
774
|
-
isStreaming?: boolean;
|
|
775
|
-
renderMarkdown?: boolean;
|
|
776
|
-
className?: string;
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* StreamingText - Display text that may be streaming, with optional markdown
|
|
780
|
-
*
|
|
781
|
-
* Shows a blinking cursor indicator when streaming is active.
|
|
782
|
-
* Uses glassmorphism theme styling.
|
|
783
|
-
*
|
|
784
|
-
* @example
|
|
785
|
-
* ```tsx
|
|
786
|
-
* <StreamingText content={text} isStreaming />
|
|
787
|
-
* <StreamingText content={markdown} renderMarkdown />
|
|
788
|
-
* ```
|
|
789
|
-
*/
|
|
790
|
-
declare function StreamingText({ content, isStreaming, renderMarkdown, className, }: StreamingTextProps): react_jsx_runtime.JSX.Element;
|
|
791
|
-
|
|
792
|
-
interface LoadingIndicatorProps {
|
|
793
|
-
variant?: 'dots' | 'pulse' | 'spinner' | 'cursor';
|
|
794
|
-
size?: 'sm' | 'md' | 'lg';
|
|
795
|
-
className?: string;
|
|
796
|
-
}
|
|
797
|
-
/**
|
|
798
|
-
* LoadingIndicator - Display various loading states
|
|
799
|
-
*
|
|
800
|
-
* Uses the glassmorphism theme with accent-colored animations.
|
|
801
|
-
*
|
|
802
|
-
* Variants:
|
|
803
|
-
* - dots: Three animated dots
|
|
804
|
-
* - pulse: Single pulsing dot
|
|
805
|
-
* - spinner: Rotating spinner
|
|
806
|
-
* - cursor: Blinking cursor (like in the demo)
|
|
807
|
-
*
|
|
808
|
-
* @example
|
|
809
|
-
* ```tsx
|
|
810
|
-
* <LoadingIndicator />
|
|
811
|
-
* <LoadingIndicator variant="spinner" size="lg" />
|
|
812
|
-
* <LoadingIndicator variant="cursor" />
|
|
813
|
-
* ```
|
|
814
|
-
*/
|
|
815
|
-
declare function LoadingIndicator({ variant, size, className }: LoadingIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
816
|
-
|
|
817
592
|
interface LazyMarkdownProps {
|
|
818
593
|
children: string;
|
|
819
594
|
/** Fallback content to show while loading */
|
|
@@ -845,118 +620,6 @@ interface LazyMarkdownProps {
|
|
|
845
620
|
*/
|
|
846
621
|
declare function LazyMarkdown({ children, fallback, components, className }: LazyMarkdownProps): react_jsx_runtime.JSX.Element;
|
|
847
622
|
|
|
848
|
-
interface RichContentRendererProps {
|
|
849
|
-
/** Rich content segments to render */
|
|
850
|
-
content: RichContent;
|
|
851
|
-
/** Custom renderers for segments */
|
|
852
|
-
renderers?: RichContentRenderers;
|
|
853
|
-
/** Additional class name */
|
|
854
|
-
className?: string;
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* RichContentRenderer - Renders structured rich content segments
|
|
858
|
-
*
|
|
859
|
-
* This is the preferred approach for rendering rich content within messages.
|
|
860
|
-
* Each segment type can have custom rendering via the `renderers` prop.
|
|
861
|
-
*
|
|
862
|
-
* @example
|
|
863
|
-
* ```tsx
|
|
864
|
-
* <RichContentRenderer
|
|
865
|
-
* content={[
|
|
866
|
-
* { type: 'text', content: 'Looking at ' },
|
|
867
|
-
* { type: 'mention', name: 'Scene1', color: '#ff0' },
|
|
868
|
-
* { type: 'text', content: ' timeline.' },
|
|
869
|
-
* ]}
|
|
870
|
-
* renderers={{
|
|
871
|
-
* renderMention: ({ segment }) => (
|
|
872
|
-
* <MentionBadge
|
|
873
|
-
* name={segment.name}
|
|
874
|
-
* onClick={() => scrollTo(segment.id)}
|
|
875
|
-
* />
|
|
876
|
-
* ),
|
|
877
|
-
* }}
|
|
878
|
-
* />
|
|
879
|
-
* ```
|
|
880
|
-
*/
|
|
881
|
-
declare function RichContentRenderer({ content, renderers, className, }: RichContentRendererProps): react_jsx_runtime.JSX.Element;
|
|
882
|
-
|
|
883
|
-
interface TypewriterTextProps {
|
|
884
|
-
/** Words to cycle through */
|
|
885
|
-
words?: string[];
|
|
886
|
-
/** Typing speed in ms per character */
|
|
887
|
-
typeSpeed?: number;
|
|
888
|
-
/** Pause before erasing in ms */
|
|
889
|
-
pauseBeforeErase?: number;
|
|
890
|
-
/** Erasing speed in ms per character */
|
|
891
|
-
eraseSpeed?: number;
|
|
892
|
-
/** Pause before typing next word in ms */
|
|
893
|
-
pauseBeforeType?: number;
|
|
894
|
-
/** Whether to show a blinking cursor */
|
|
895
|
-
showCursor?: boolean;
|
|
896
|
-
/** Additional class names */
|
|
897
|
-
className?: string;
|
|
898
|
-
/** Cursor class names */
|
|
899
|
-
cursorClassName?: string;
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* TypewriterText - Animated typing component that cycles through words
|
|
903
|
-
*
|
|
904
|
-
* Creates a typewriter effect that types out words character by character,
|
|
905
|
-
* pauses, then erases them before moving to the next word.
|
|
906
|
-
*
|
|
907
|
-
* @example
|
|
908
|
-
* ```tsx
|
|
909
|
-
* // Default thinking words
|
|
910
|
-
* <TypewriterText />
|
|
911
|
-
*
|
|
912
|
-
* // Custom words
|
|
913
|
-
* <TypewriterText words={['Loading', 'Processing', 'Almost done']} />
|
|
914
|
-
*
|
|
915
|
-
* // Custom speeds
|
|
916
|
-
* <TypewriterText typeSpeed={30} pauseBeforeErase={1000} />
|
|
917
|
-
* ```
|
|
918
|
-
*/
|
|
919
|
-
declare function TypewriterText({ words, typeSpeed, pauseBeforeErase, eraseSpeed, pauseBeforeType, showCursor, className, cursorClassName, }: TypewriterTextProps): react_jsx_runtime.JSX.Element;
|
|
920
|
-
|
|
921
|
-
type Theme = 'light' | 'dark';
|
|
922
|
-
interface ThemeContextType {
|
|
923
|
-
theme: Theme;
|
|
924
|
-
toggleTheme: () => void;
|
|
925
|
-
setTheme: (theme: Theme) => void;
|
|
926
|
-
}
|
|
927
|
-
interface ThemeProviderProps {
|
|
928
|
-
children: ReactNode;
|
|
929
|
-
/** Default theme to use when no stored preference exists. Defaults to system preference, then 'light'. */
|
|
930
|
-
defaultTheme?: Theme;
|
|
931
|
-
/** localStorage key for persisting theme. Defaults to 'ash-ui-theme'. */
|
|
932
|
-
storageKey?: string;
|
|
933
|
-
/** Whether to listen for system theme changes. Defaults to true. */
|
|
934
|
-
listenToSystemChanges?: boolean;
|
|
935
|
-
}
|
|
936
|
-
/**
|
|
937
|
-
* ThemeProvider - Unified theme management for agentic UIs.
|
|
938
|
-
*
|
|
939
|
-
* Features:
|
|
940
|
-
* - Persists theme choice to localStorage
|
|
941
|
-
* - Respects system preference when no stored preference exists
|
|
942
|
-
* - Listens for system theme changes (configurable)
|
|
943
|
-
* - Adds/removes 'dark' class on document root for Tailwind CSS
|
|
944
|
-
*
|
|
945
|
-
* @example
|
|
946
|
-
* ```tsx
|
|
947
|
-
* <ThemeProvider>
|
|
948
|
-
* <App />
|
|
949
|
-
* </ThemeProvider>
|
|
950
|
-
*
|
|
951
|
-
* // With custom defaults
|
|
952
|
-
* <ThemeProvider defaultTheme="dark" storageKey="my-theme">
|
|
953
|
-
* <App />
|
|
954
|
-
* </ThemeProvider>
|
|
955
|
-
* ```
|
|
956
|
-
*/
|
|
957
|
-
declare function ThemeProvider({ children, defaultTheme, storageKey, listenToSystemChanges, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
958
|
-
declare function useTheme(): ThemeContextType;
|
|
959
|
-
|
|
960
623
|
/**
|
|
961
624
|
* A queued message waiting to be sent
|
|
962
625
|
*/
|
|
@@ -1143,6 +806,10 @@ interface UseFileUploadReturn {
|
|
|
1143
806
|
/** Click handler to trigger file input */
|
|
1144
807
|
openFilePicker: () => void;
|
|
1145
808
|
}
|
|
809
|
+
/**
|
|
810
|
+
* Format file size for display
|
|
811
|
+
*/
|
|
812
|
+
declare function formatFileSize(bytes: number): string;
|
|
1146
813
|
/**
|
|
1147
814
|
* Hook for managing file uploads with drag & drop support.
|
|
1148
815
|
*
|
|
@@ -1599,6 +1266,158 @@ interface UseAgentChatReturn {
|
|
|
1599
1266
|
}
|
|
1600
1267
|
declare function useAgentChat(options: UseAgentChatOptions): UseAgentChatReturn;
|
|
1601
1268
|
|
|
1269
|
+
/**
|
|
1270
|
+
* useChat - AI SDK compatible chat hook for ash-cloud
|
|
1271
|
+
*
|
|
1272
|
+
* This hook provides an interface compatible with AI SDK's useChat hook
|
|
1273
|
+
* while using ash-cloud's streaming infrastructure under the hood.
|
|
1274
|
+
*
|
|
1275
|
+
* @example
|
|
1276
|
+
* ```tsx
|
|
1277
|
+
* import { useChat } from '@ash-cloud/ash-ui';
|
|
1278
|
+
*
|
|
1279
|
+
* function Chat() {
|
|
1280
|
+
* const {
|
|
1281
|
+
* messages,
|
|
1282
|
+
* isLoading,
|
|
1283
|
+
* append,
|
|
1284
|
+
* stop,
|
|
1285
|
+
* setMessages,
|
|
1286
|
+
* } = useChat({
|
|
1287
|
+
* createStream: (prompt, sessionId) => client.agents.run(agentId, prompt),
|
|
1288
|
+
* onToolCall: ({ toolCall }) => console.log('Tool called:', toolCall.toolName),
|
|
1289
|
+
* });
|
|
1290
|
+
*
|
|
1291
|
+
* return (
|
|
1292
|
+
* <Conversation>
|
|
1293
|
+
* {messages.map((m) => (
|
|
1294
|
+
* <Message key={m.id} from={m.role}>{m.content}</Message>
|
|
1295
|
+
* ))}
|
|
1296
|
+
* </Conversation>
|
|
1297
|
+
* );
|
|
1298
|
+
* }
|
|
1299
|
+
* ```
|
|
1300
|
+
*/
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* Message to append to the conversation
|
|
1304
|
+
*/
|
|
1305
|
+
interface CreateMessage {
|
|
1306
|
+
/** Message ID (auto-generated if not provided) */
|
|
1307
|
+
id?: string;
|
|
1308
|
+
/** Message role */
|
|
1309
|
+
role: 'user' | 'assistant' | 'system' | 'data';
|
|
1310
|
+
/** Message content */
|
|
1311
|
+
content: string;
|
|
1312
|
+
/** Tool invocations */
|
|
1313
|
+
toolInvocations?: ToolInvocation[];
|
|
1314
|
+
/** Reasoning content */
|
|
1315
|
+
reasoning?: string;
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Options for appending a message
|
|
1319
|
+
*/
|
|
1320
|
+
interface ChatRequestOptions {
|
|
1321
|
+
/** Additional data to include with the request */
|
|
1322
|
+
data?: Record<string, unknown>;
|
|
1323
|
+
/** Additional body parameters */
|
|
1324
|
+
body?: Record<string, unknown>;
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Tool call handler callback
|
|
1328
|
+
*/
|
|
1329
|
+
interface ToolCallHandler {
|
|
1330
|
+
/** The tool invocation */
|
|
1331
|
+
toolCall: ToolInvocation;
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* Options for useChat hook
|
|
1335
|
+
*/
|
|
1336
|
+
interface UseChatOptions {
|
|
1337
|
+
/**
|
|
1338
|
+
* Function to create a stream of events.
|
|
1339
|
+
* Can wrap client.agents.run() or client.sessions.send()
|
|
1340
|
+
*/
|
|
1341
|
+
createStream: CreateStreamFn;
|
|
1342
|
+
/**
|
|
1343
|
+
* Function to subscribe to an existing session for reconnection.
|
|
1344
|
+
*/
|
|
1345
|
+
subscribeToSession?: (sessionId: string, signal?: AbortSignal) => StreamGenerator;
|
|
1346
|
+
/**
|
|
1347
|
+
* Initial session ID (for resuming a conversation)
|
|
1348
|
+
*/
|
|
1349
|
+
initialSessionId?: string;
|
|
1350
|
+
/**
|
|
1351
|
+
* Initial messages to display
|
|
1352
|
+
*/
|
|
1353
|
+
initialMessages?: Message$1[];
|
|
1354
|
+
/**
|
|
1355
|
+
* Callback when a tool is called
|
|
1356
|
+
*/
|
|
1357
|
+
onToolCall?: (handler: ToolCallHandler) => void;
|
|
1358
|
+
/**
|
|
1359
|
+
* Callback when streaming finishes
|
|
1360
|
+
*/
|
|
1361
|
+
onFinish?: (message: Message$1) => void;
|
|
1362
|
+
/**
|
|
1363
|
+
* Callback when an error occurs
|
|
1364
|
+
*/
|
|
1365
|
+
onError?: (error: Error) => void;
|
|
1366
|
+
/**
|
|
1367
|
+
* Callback when session starts
|
|
1368
|
+
*/
|
|
1369
|
+
onSessionStart?: (sessionId: string) => void;
|
|
1370
|
+
/**
|
|
1371
|
+
* Maximum number of reconnection attempts
|
|
1372
|
+
*/
|
|
1373
|
+
maxReconnectAttempts?: number;
|
|
1374
|
+
/**
|
|
1375
|
+
* Base delay for exponential backoff in ms
|
|
1376
|
+
*/
|
|
1377
|
+
reconnectBaseDelay?: number;
|
|
1378
|
+
/**
|
|
1379
|
+
* Middleware for composable request/event transforms
|
|
1380
|
+
*/
|
|
1381
|
+
middleware?: ChatMiddleware[];
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Return type for useChat
|
|
1385
|
+
*/
|
|
1386
|
+
interface UseChatReturn {
|
|
1387
|
+
/** All messages in the conversation */
|
|
1388
|
+
messages: Message$1[];
|
|
1389
|
+
/** Whether a message is currently being streamed */
|
|
1390
|
+
isLoading: boolean;
|
|
1391
|
+
/** Current error (if any) */
|
|
1392
|
+
error: Error | undefined;
|
|
1393
|
+
/** Current session ID */
|
|
1394
|
+
sessionId: string | null;
|
|
1395
|
+
/** Append a message to the conversation and stream response */
|
|
1396
|
+
append: (message: CreateMessage | string, options?: ChatRequestOptions) => Promise<string | null | undefined>;
|
|
1397
|
+
/** Stop the current streaming request */
|
|
1398
|
+
stop: () => void;
|
|
1399
|
+
/** Set messages (replace all) */
|
|
1400
|
+
setMessages: (messages: Message$1[]) => void;
|
|
1401
|
+
/** Reload the last assistant message */
|
|
1402
|
+
reload: () => Promise<string | null | undefined>;
|
|
1403
|
+
/** The current input value (for controlled input) */
|
|
1404
|
+
input: string;
|
|
1405
|
+
/** Set the input value */
|
|
1406
|
+
setInput: (input: string) => void;
|
|
1407
|
+
/** Handle input change (for form inputs) */
|
|
1408
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
1409
|
+
/** Handle form submission */
|
|
1410
|
+
handleSubmit: (e?: React.FormEvent<HTMLFormElement>, options?: ChatRequestOptions) => void;
|
|
1411
|
+
/** Whether currently reconnecting after stream interruption */
|
|
1412
|
+
isReconnecting: boolean;
|
|
1413
|
+
/**
|
|
1414
|
+
* Legacy: Get entries in NormalizedEntry format
|
|
1415
|
+
* For backwards compatibility during migration
|
|
1416
|
+
*/
|
|
1417
|
+
entries: NormalizedEntry[];
|
|
1418
|
+
}
|
|
1419
|
+
declare function useChat(options: UseChatOptions): UseChatReturn;
|
|
1420
|
+
|
|
1602
1421
|
/**
|
|
1603
1422
|
* Configuration for long text auto-conversion
|
|
1604
1423
|
*/
|
|
@@ -1708,4 +1527,4 @@ interface UseLongTextConversionReturn {
|
|
|
1708
1527
|
*/
|
|
1709
1528
|
declare function useLongTextConversion({ threshold, filenameTemplate, onConversion, }?: LongTextConversionOptions): UseLongTextConversionReturn;
|
|
1710
1529
|
|
|
1711
|
-
export { ActionIcon, type ActionIconProps, ActionType, type StreamEvent as AgentStreamEvent,
|
|
1530
|
+
export { Message$1 as AIMessage, ActionIcon, type ActionIconProps, ActionType, type StreamEvent as AgentStreamEvent, Attachment, type AttachmentFile, AttachmentInfo, type AttachmentInfoProps, AttachmentPreview, type AttachmentPreviewProps, type AttachmentProps, AttachmentRemove, type AttachmentRemoveProps, Attachments, type AttachmentsProps, type BeforeSendContext, type BeforeSendResult, type FileAttachment as ChatFileAttachment, type ChatMiddleware, type ChatRequestOptions, CodeBlock, type CodeBlockProps, Conversation, ConversationContent, type ConversationContentProps, ConversationEmptyState, type ConversationEmptyStateProps, type ConversationProps, ConversationScrollButton, type ConversationScrollButtonProps, type ConversionInfo, type CreateMessage, type CreateStreamFn, type CreateStreamOptions, EnvVarsPanel, type EnvVarsPanelProps, FileAttachment$2 as FileAttachment, FileBadgeCompact, type FileBadgeProps, type FileAttachment as HookFileAttachment, JsonDisplay, type JsonDisplayProps, LazyMarkdown, type LazyMarkdownProps, LoadingDots, type LoadingDotsProps, LoadingSpinner, type LoadingSpinnerProps, LogEntry, LogsPanel, type LogsPanelProps, type LongTextConversionOptions, MarkdownComponents, Message, MessageAction, type MessageActionProps, MessageActions, type MessageActionsProps, MessageAvatar, type MessageAvatarProps, MessageContent, type MessageContentProps, type MessageProps, MessageResponse, type MessageResponseProps, MessageShimmer, type MessageShimmerProps, MessageTimestamp, type MessageTimestampProps, type MiddlewareRequest, type MiddlewareRequestResult, NormalizedEntry, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, Shimmer, ShimmerBlock, type ShimmerBlockProps, ShimmerLine, type ShimmerLineProps, type ShimmerProps, ShimmerText, type ShimmerTextProps, StatusIndicator, type StatusIndicatorProps, type StreamGenerator, Task, TaskContent, type TaskContentProps, TaskItem, type TaskItemProps, TaskList, type TaskListProps, type TaskProps, TaskTrigger, type TaskTriggerProps, type TextAttachment, ThinkingIndicator, type ThinkingIndicatorProps, TodoItem, TodoStatus, Tool, type ToolCallHandler, ToolHeader, type ToolHeaderProps, ToolInput, type ToolInputProps, ToolInvocation, ToolList, type ToolListProps, ToolOutput, type ToolOutputProps, type ToolProps, ToolStatus, type UseAgentChatOptions, type UseAgentChatReturn, type UseChatOptions, type UseChatReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseLongTextConversionReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, applyEventMiddleware, applyRequestMiddleware, callMiddlewareComplete, callMiddlewareError, formatFileSize as formatFileSizeHook, useAgentChat, useAttachment, useChat, useConversation, useFileUpload, useLongTextConversion, useMessage, useMessageQueue, useReasoning, useStopExecution, useTask, useTool };
|