@ash-cloud/ash-ui 0.2.0 → 0.2.2
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 +106 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -14
- package/dist/index.d.ts +50 -14
- package/dist/index.js +105 -16
- package/dist/index.js.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +52 -1
- package/dist/types.d.ts +52 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1, { ReactNode, ComponentType, DragEvent, ChangeEvent, ClipboardEvent } from 'react';
|
|
3
|
-
import { ToolInvocation, TodoStatus, TodoItem, FileAttachment as FileAttachment$2, LogEntry, ToolStatus, ActionType,
|
|
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';
|
|
3
|
+
import { ToolInvocation, RichContent, MarkdownComponents, MentionProps, TodoStatus, TodoItem, FileAttachment as FileAttachment$2, LogEntry, ToolStatus, ActionType, 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, RichContentSegment, RichMentionSegment, RichTextSegment, 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
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';
|
|
@@ -94,19 +94,21 @@ interface MessageContentProps {
|
|
|
94
94
|
}
|
|
95
95
|
declare function MessageContent({ children, className }: MessageContentProps): react_jsx_runtime.JSX.Element;
|
|
96
96
|
interface MessageResponseProps {
|
|
97
|
-
/**
|
|
98
|
-
content
|
|
97
|
+
/** Plain markdown content */
|
|
98
|
+
content?: string;
|
|
99
|
+
/** Pre-parsed rich content segments (alternative to content) */
|
|
100
|
+
richContent?: RichContent;
|
|
99
101
|
/** Whether content is still streaming */
|
|
100
102
|
isStreaming?: boolean;
|
|
101
103
|
/** Additional class name */
|
|
102
104
|
className?: string;
|
|
103
|
-
/** Custom markdown components */
|
|
104
|
-
components?:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
105
|
+
/** Custom markdown components and mention renderer */
|
|
106
|
+
components?: MarkdownComponents & {
|
|
107
|
+
/** Custom mention renderer for rich content */
|
|
108
|
+
mention?: ComponentType<MentionProps>;
|
|
109
|
+
};
|
|
108
110
|
}
|
|
109
|
-
declare function MessageResponse({ content, isStreaming, className, components, }: MessageResponseProps): react_jsx_runtime.JSX.Element | null;
|
|
111
|
+
declare function MessageResponse({ content, richContent, isStreaming, className, components, }: MessageResponseProps): react_jsx_runtime.JSX.Element | null;
|
|
110
112
|
interface MessageActionsProps {
|
|
111
113
|
/** Child elements (action buttons) */
|
|
112
114
|
children: ReactNode;
|
|
@@ -133,6 +135,27 @@ interface MessageTimestampProps {
|
|
|
133
135
|
}
|
|
134
136
|
declare function MessageTimestamp({ timestamp, className }: MessageTimestampProps): react_jsx_runtime.JSX.Element;
|
|
135
137
|
|
|
138
|
+
declare function Mention({ name, color, url }: MentionProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
|
|
140
|
+
interface RichContentProps {
|
|
141
|
+
/** Pre-parsed rich content segments */
|
|
142
|
+
content: RichContent;
|
|
143
|
+
/** Custom components for rendering */
|
|
144
|
+
components?: MarkdownComponents & {
|
|
145
|
+
/** Custom mention renderer */
|
|
146
|
+
mention?: ComponentType<MentionProps>;
|
|
147
|
+
};
|
|
148
|
+
/** Additional class name */
|
|
149
|
+
className?: string;
|
|
150
|
+
}
|
|
151
|
+
declare function RichContentRenderer({ content, components, className, }: RichContentProps): react_jsx_runtime.JSX.Element;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Tool display variant
|
|
155
|
+
* - 'default': Full-sized with expand/collapse
|
|
156
|
+
* - 'compact': Smaller with minimal padding, no expand/collapse
|
|
157
|
+
*/
|
|
158
|
+
type ToolVariant = 'default' | 'compact';
|
|
136
159
|
interface ToolContextValue {
|
|
137
160
|
/** The tool invocation data */
|
|
138
161
|
toolInvocation: ToolInvocation;
|
|
@@ -140,6 +163,8 @@ interface ToolContextValue {
|
|
|
140
163
|
isExpanded: boolean;
|
|
141
164
|
/** Toggle expansion state */
|
|
142
165
|
toggleExpanded: () => void;
|
|
166
|
+
/** Display variant */
|
|
167
|
+
variant: ToolVariant;
|
|
143
168
|
}
|
|
144
169
|
declare function useTool(): ToolContextValue;
|
|
145
170
|
interface ToolProps {
|
|
@@ -151,8 +176,10 @@ interface ToolProps {
|
|
|
151
176
|
className?: string;
|
|
152
177
|
/** Whether to start expanded */
|
|
153
178
|
defaultExpanded?: boolean;
|
|
179
|
+
/** Display variant: 'default' or 'compact' */
|
|
180
|
+
variant?: ToolVariant;
|
|
154
181
|
}
|
|
155
|
-
declare function Tool({ toolInvocation, children, className, defaultExpanded, }: ToolProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
declare function Tool({ toolInvocation, children, className, defaultExpanded, variant, }: ToolProps): react_jsx_runtime.JSX.Element;
|
|
156
183
|
interface ToolHeaderProps {
|
|
157
184
|
/** Additional class name */
|
|
158
185
|
className?: string;
|
|
@@ -183,8 +210,10 @@ interface ToolListProps {
|
|
|
183
210
|
className?: string;
|
|
184
211
|
/** Whether to show tools expanded by default */
|
|
185
212
|
defaultExpanded?: boolean;
|
|
213
|
+
/** Display variant: 'default' or 'compact' */
|
|
214
|
+
variant?: ToolVariant;
|
|
186
215
|
}
|
|
187
|
-
declare function ToolList({ toolInvocations, className, defaultExpanded, }: ToolListProps): react_jsx_runtime.JSX.Element | null;
|
|
216
|
+
declare function ToolList({ toolInvocations, className, defaultExpanded, variant, }: ToolListProps): react_jsx_runtime.JSX.Element | null;
|
|
188
217
|
|
|
189
218
|
interface ReasoningContextValue {
|
|
190
219
|
/** Whether the reasoning panel is open */
|
|
@@ -516,7 +545,7 @@ declare function OptionCards({ options, onSelect, className }: OptionCardsProps)
|
|
|
516
545
|
|
|
517
546
|
interface StatusIndicatorProps {
|
|
518
547
|
status: ToolStatus;
|
|
519
|
-
size?: 'sm' | 'md' | 'lg';
|
|
548
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
520
549
|
className?: string;
|
|
521
550
|
}
|
|
522
551
|
/**
|
|
@@ -1024,6 +1053,8 @@ interface StreamEvent {
|
|
|
1024
1053
|
result?: string;
|
|
1025
1054
|
totalCost?: number;
|
|
1026
1055
|
totalTokens?: number;
|
|
1056
|
+
/** SSE event ID (sequence number from relay) for reconnection */
|
|
1057
|
+
id?: string;
|
|
1027
1058
|
entry?: {
|
|
1028
1059
|
timestamp: string;
|
|
1029
1060
|
level: string;
|
|
@@ -1263,6 +1294,11 @@ interface UseAgentChatReturn {
|
|
|
1263
1294
|
* This replaces all entries and clears streaming state
|
|
1264
1295
|
*/
|
|
1265
1296
|
setEntries: (entries: NormalizedEntry[]) => void;
|
|
1297
|
+
/**
|
|
1298
|
+
* Last seen SSE sequence number.
|
|
1299
|
+
* Use this for reconnection via the relay endpoint: GET /sessions/:id/stream?after=lastSequence
|
|
1300
|
+
*/
|
|
1301
|
+
lastSequence: number;
|
|
1266
1302
|
}
|
|
1267
1303
|
declare function useAgentChat(options: UseAgentChatOptions): UseAgentChatReturn;
|
|
1268
1304
|
|
|
@@ -1527,4 +1563,4 @@ interface UseLongTextConversionReturn {
|
|
|
1527
1563
|
*/
|
|
1528
1564
|
declare function useLongTextConversion({ threshold, filenameTemplate, onConversion, }?: LongTextConversionOptions): UseLongTextConversionReturn;
|
|
1529
1565
|
|
|
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 };
|
|
1566
|
+
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, Mention, MentionProps, 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, RichContent, type RichContentProps, RichContentRenderer, 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 ToolVariant, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1, { ReactNode, ComponentType, DragEvent, ChangeEvent, ClipboardEvent } from 'react';
|
|
3
|
-
import { ToolInvocation, TodoStatus, TodoItem, FileAttachment as FileAttachment$2, LogEntry, ToolStatus, ActionType,
|
|
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.js';
|
|
3
|
+
import { ToolInvocation, RichContent, MarkdownComponents, MentionProps, TodoStatus, TodoItem, FileAttachment as FileAttachment$2, LogEntry, ToolStatus, ActionType, NormalizedEntry, Message as Message$1 } from './types.js';
|
|
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, RichContentSegment, RichMentionSegment, RichTextSegment, 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.js';
|
|
5
5
|
import { ParsedOption } from './utils.js';
|
|
6
6
|
export { ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, formatElapsedTime, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.js';
|
|
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.js';
|
|
@@ -94,19 +94,21 @@ interface MessageContentProps {
|
|
|
94
94
|
}
|
|
95
95
|
declare function MessageContent({ children, className }: MessageContentProps): react_jsx_runtime.JSX.Element;
|
|
96
96
|
interface MessageResponseProps {
|
|
97
|
-
/**
|
|
98
|
-
content
|
|
97
|
+
/** Plain markdown content */
|
|
98
|
+
content?: string;
|
|
99
|
+
/** Pre-parsed rich content segments (alternative to content) */
|
|
100
|
+
richContent?: RichContent;
|
|
99
101
|
/** Whether content is still streaming */
|
|
100
102
|
isStreaming?: boolean;
|
|
101
103
|
/** Additional class name */
|
|
102
104
|
className?: string;
|
|
103
|
-
/** Custom markdown components */
|
|
104
|
-
components?:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
105
|
+
/** Custom markdown components and mention renderer */
|
|
106
|
+
components?: MarkdownComponents & {
|
|
107
|
+
/** Custom mention renderer for rich content */
|
|
108
|
+
mention?: ComponentType<MentionProps>;
|
|
109
|
+
};
|
|
108
110
|
}
|
|
109
|
-
declare function MessageResponse({ content, isStreaming, className, components, }: MessageResponseProps): react_jsx_runtime.JSX.Element | null;
|
|
111
|
+
declare function MessageResponse({ content, richContent, isStreaming, className, components, }: MessageResponseProps): react_jsx_runtime.JSX.Element | null;
|
|
110
112
|
interface MessageActionsProps {
|
|
111
113
|
/** Child elements (action buttons) */
|
|
112
114
|
children: ReactNode;
|
|
@@ -133,6 +135,27 @@ interface MessageTimestampProps {
|
|
|
133
135
|
}
|
|
134
136
|
declare function MessageTimestamp({ timestamp, className }: MessageTimestampProps): react_jsx_runtime.JSX.Element;
|
|
135
137
|
|
|
138
|
+
declare function Mention({ name, color, url }: MentionProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
|
|
140
|
+
interface RichContentProps {
|
|
141
|
+
/** Pre-parsed rich content segments */
|
|
142
|
+
content: RichContent;
|
|
143
|
+
/** Custom components for rendering */
|
|
144
|
+
components?: MarkdownComponents & {
|
|
145
|
+
/** Custom mention renderer */
|
|
146
|
+
mention?: ComponentType<MentionProps>;
|
|
147
|
+
};
|
|
148
|
+
/** Additional class name */
|
|
149
|
+
className?: string;
|
|
150
|
+
}
|
|
151
|
+
declare function RichContentRenderer({ content, components, className, }: RichContentProps): react_jsx_runtime.JSX.Element;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Tool display variant
|
|
155
|
+
* - 'default': Full-sized with expand/collapse
|
|
156
|
+
* - 'compact': Smaller with minimal padding, no expand/collapse
|
|
157
|
+
*/
|
|
158
|
+
type ToolVariant = 'default' | 'compact';
|
|
136
159
|
interface ToolContextValue {
|
|
137
160
|
/** The tool invocation data */
|
|
138
161
|
toolInvocation: ToolInvocation;
|
|
@@ -140,6 +163,8 @@ interface ToolContextValue {
|
|
|
140
163
|
isExpanded: boolean;
|
|
141
164
|
/** Toggle expansion state */
|
|
142
165
|
toggleExpanded: () => void;
|
|
166
|
+
/** Display variant */
|
|
167
|
+
variant: ToolVariant;
|
|
143
168
|
}
|
|
144
169
|
declare function useTool(): ToolContextValue;
|
|
145
170
|
interface ToolProps {
|
|
@@ -151,8 +176,10 @@ interface ToolProps {
|
|
|
151
176
|
className?: string;
|
|
152
177
|
/** Whether to start expanded */
|
|
153
178
|
defaultExpanded?: boolean;
|
|
179
|
+
/** Display variant: 'default' or 'compact' */
|
|
180
|
+
variant?: ToolVariant;
|
|
154
181
|
}
|
|
155
|
-
declare function Tool({ toolInvocation, children, className, defaultExpanded, }: ToolProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
declare function Tool({ toolInvocation, children, className, defaultExpanded, variant, }: ToolProps): react_jsx_runtime.JSX.Element;
|
|
156
183
|
interface ToolHeaderProps {
|
|
157
184
|
/** Additional class name */
|
|
158
185
|
className?: string;
|
|
@@ -183,8 +210,10 @@ interface ToolListProps {
|
|
|
183
210
|
className?: string;
|
|
184
211
|
/** Whether to show tools expanded by default */
|
|
185
212
|
defaultExpanded?: boolean;
|
|
213
|
+
/** Display variant: 'default' or 'compact' */
|
|
214
|
+
variant?: ToolVariant;
|
|
186
215
|
}
|
|
187
|
-
declare function ToolList({ toolInvocations, className, defaultExpanded, }: ToolListProps): react_jsx_runtime.JSX.Element | null;
|
|
216
|
+
declare function ToolList({ toolInvocations, className, defaultExpanded, variant, }: ToolListProps): react_jsx_runtime.JSX.Element | null;
|
|
188
217
|
|
|
189
218
|
interface ReasoningContextValue {
|
|
190
219
|
/** Whether the reasoning panel is open */
|
|
@@ -516,7 +545,7 @@ declare function OptionCards({ options, onSelect, className }: OptionCardsProps)
|
|
|
516
545
|
|
|
517
546
|
interface StatusIndicatorProps {
|
|
518
547
|
status: ToolStatus;
|
|
519
|
-
size?: 'sm' | 'md' | 'lg';
|
|
548
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
520
549
|
className?: string;
|
|
521
550
|
}
|
|
522
551
|
/**
|
|
@@ -1024,6 +1053,8 @@ interface StreamEvent {
|
|
|
1024
1053
|
result?: string;
|
|
1025
1054
|
totalCost?: number;
|
|
1026
1055
|
totalTokens?: number;
|
|
1056
|
+
/** SSE event ID (sequence number from relay) for reconnection */
|
|
1057
|
+
id?: string;
|
|
1027
1058
|
entry?: {
|
|
1028
1059
|
timestamp: string;
|
|
1029
1060
|
level: string;
|
|
@@ -1263,6 +1294,11 @@ interface UseAgentChatReturn {
|
|
|
1263
1294
|
* This replaces all entries and clears streaming state
|
|
1264
1295
|
*/
|
|
1265
1296
|
setEntries: (entries: NormalizedEntry[]) => void;
|
|
1297
|
+
/**
|
|
1298
|
+
* Last seen SSE sequence number.
|
|
1299
|
+
* Use this for reconnection via the relay endpoint: GET /sessions/:id/stream?after=lastSequence
|
|
1300
|
+
*/
|
|
1301
|
+
lastSequence: number;
|
|
1266
1302
|
}
|
|
1267
1303
|
declare function useAgentChat(options: UseAgentChatOptions): UseAgentChatReturn;
|
|
1268
1304
|
|
|
@@ -1527,4 +1563,4 @@ interface UseLongTextConversionReturn {
|
|
|
1527
1563
|
*/
|
|
1528
1564
|
declare function useLongTextConversion({ threshold, filenameTemplate, onConversion, }?: LongTextConversionOptions): UseLongTextConversionReturn;
|
|
1529
1565
|
|
|
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 };
|
|
1566
|
+
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, Mention, MentionProps, 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, RichContent, type RichContentProps, RichContentRenderer, 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 ToolVariant, 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 };
|
package/dist/index.js
CHANGED
|
@@ -567,6 +567,61 @@ function LazyMarkdown({ children, fallback, components, className }) {
|
|
|
567
567
|
}
|
|
568
568
|
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("span", { className, children: fallback ?? children }), children: /* @__PURE__ */ jsx(ReactMarkdown, { components: markdownComponents, children }) });
|
|
569
569
|
}
|
|
570
|
+
function Mention({ name, color, url }) {
|
|
571
|
+
return /* @__PURE__ */ jsxs(
|
|
572
|
+
"span",
|
|
573
|
+
{
|
|
574
|
+
className: cn(
|
|
575
|
+
"ash-mention",
|
|
576
|
+
"inline-flex items-center",
|
|
577
|
+
"px-1.5 py-0.5 rounded",
|
|
578
|
+
"text-[var(--ash-font-size-sm,12px)]",
|
|
579
|
+
"font-medium"
|
|
580
|
+
),
|
|
581
|
+
style: {
|
|
582
|
+
backgroundColor: color ? `${color}20` : "var(--ash-mention-bg,rgba(255,255,255,0.1))",
|
|
583
|
+
color: color || "var(--ash-mention-text,inherit)"
|
|
584
|
+
},
|
|
585
|
+
children: [
|
|
586
|
+
url && /* @__PURE__ */ jsx(
|
|
587
|
+
"img",
|
|
588
|
+
{
|
|
589
|
+
src: url,
|
|
590
|
+
alt: "",
|
|
591
|
+
className: "w-4 h-4 rounded mr-1 object-cover"
|
|
592
|
+
}
|
|
593
|
+
),
|
|
594
|
+
"@",
|
|
595
|
+
name
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
function RichContentRenderer({
|
|
601
|
+
content,
|
|
602
|
+
components,
|
|
603
|
+
className
|
|
604
|
+
}) {
|
|
605
|
+
const MentionComponent = components?.mention || Mention;
|
|
606
|
+
return /* @__PURE__ */ jsx("span", { className: cn("ash-rich-content", className), children: content.map((segment, index) => {
|
|
607
|
+
if (segment.type === "text") {
|
|
608
|
+
return /* @__PURE__ */ jsx(LazyMarkdown, { components, children: segment.content }, index);
|
|
609
|
+
}
|
|
610
|
+
if (segment.type === "mention") {
|
|
611
|
+
return /* @__PURE__ */ jsx(
|
|
612
|
+
MentionComponent,
|
|
613
|
+
{
|
|
614
|
+
name: segment.name,
|
|
615
|
+
color: segment.color,
|
|
616
|
+
url: segment.url,
|
|
617
|
+
data: segment.data
|
|
618
|
+
},
|
|
619
|
+
index
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
return null;
|
|
623
|
+
}) });
|
|
624
|
+
}
|
|
570
625
|
var MessageContext = createContext(null);
|
|
571
626
|
function useMessage() {
|
|
572
627
|
const context = useContext(MessageContext);
|
|
@@ -679,10 +734,26 @@ function MessageContent({ children, className }) {
|
|
|
679
734
|
}
|
|
680
735
|
function MessageResponse({
|
|
681
736
|
content,
|
|
737
|
+
richContent,
|
|
682
738
|
isStreaming,
|
|
683
739
|
className,
|
|
684
740
|
components
|
|
685
741
|
}) {
|
|
742
|
+
if (richContent && richContent.length > 0) {
|
|
743
|
+
return /* @__PURE__ */ jsx(
|
|
744
|
+
"div",
|
|
745
|
+
{
|
|
746
|
+
className: cn(
|
|
747
|
+
"ash-message-response",
|
|
748
|
+
"font-[var(--ash-font-size-base,13px)]",
|
|
749
|
+
"leading-relaxed",
|
|
750
|
+
isStreaming && "animate-pulse",
|
|
751
|
+
className
|
|
752
|
+
),
|
|
753
|
+
children: /* @__PURE__ */ jsx(RichContentRenderer, { content: richContent, components })
|
|
754
|
+
}
|
|
755
|
+
);
|
|
756
|
+
}
|
|
686
757
|
if (!content) return null;
|
|
687
758
|
return /* @__PURE__ */ jsx(
|
|
688
759
|
"div",
|
|
@@ -758,6 +829,7 @@ function MessageTimestamp({ timestamp, className }) {
|
|
|
758
829
|
}
|
|
759
830
|
function StatusIndicator({ status, size = "sm", className }) {
|
|
760
831
|
const sizeClasses = {
|
|
832
|
+
xs: "w-1.5 h-1.5",
|
|
761
833
|
sm: "w-2 h-2",
|
|
762
834
|
md: "w-3 h-3",
|
|
763
835
|
lg: "w-4 h-4"
|
|
@@ -1136,14 +1208,16 @@ function Tool({
|
|
|
1136
1208
|
toolInvocation,
|
|
1137
1209
|
children,
|
|
1138
1210
|
className,
|
|
1139
|
-
defaultExpanded = false
|
|
1211
|
+
defaultExpanded = false,
|
|
1212
|
+
variant = "default"
|
|
1140
1213
|
}) {
|
|
1141
1214
|
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
|
|
1142
1215
|
const toggleExpanded = () => setIsExpanded((prev) => !prev);
|
|
1143
1216
|
const contextValue = {
|
|
1144
1217
|
toolInvocation,
|
|
1145
1218
|
isExpanded,
|
|
1146
|
-
toggleExpanded
|
|
1219
|
+
toggleExpanded,
|
|
1220
|
+
variant
|
|
1147
1221
|
};
|
|
1148
1222
|
const status = toolInvocation.state === "result" ? "success" : "pending";
|
|
1149
1223
|
const isErrorResult = Boolean(
|
|
@@ -1179,25 +1253,28 @@ function ToolHeader({
|
|
|
1179
1253
|
icon,
|
|
1180
1254
|
showToggle = true
|
|
1181
1255
|
}) {
|
|
1182
|
-
const { toolInvocation, isExpanded, toggleExpanded } = useTool();
|
|
1256
|
+
const { toolInvocation, isExpanded, toggleExpanded, variant } = useTool();
|
|
1257
|
+
const isCompact = variant === "compact";
|
|
1183
1258
|
const status = toolInvocation.state === "result" ? "success" : "pending";
|
|
1184
1259
|
const formattedName = formatToolName(toolInvocation.toolName);
|
|
1185
1260
|
const toolIcon = icon;
|
|
1261
|
+
const canToggle = showToggle && !isCompact;
|
|
1186
1262
|
return /* @__PURE__ */ jsxs(
|
|
1187
1263
|
"button",
|
|
1188
1264
|
{
|
|
1189
|
-
onClick:
|
|
1265
|
+
onClick: canToggle ? toggleExpanded : void 0,
|
|
1190
1266
|
className: cn(
|
|
1191
1267
|
"ash-tool-header",
|
|
1192
1268
|
"w-full flex items-center gap-2",
|
|
1193
|
-
"px-3 py-2",
|
|
1269
|
+
isCompact ? "px-2 py-1.5" : "px-3 py-2",
|
|
1194
1270
|
"text-left",
|
|
1195
|
-
|
|
1271
|
+
canToggle && "cursor-pointer hover:bg-white/[0.03] transition-colors",
|
|
1272
|
+
!canToggle && "cursor-default",
|
|
1196
1273
|
className
|
|
1197
1274
|
),
|
|
1198
1275
|
children: [
|
|
1199
|
-
/* @__PURE__ */ jsx(StatusIndicator, { status, size: "sm" }),
|
|
1200
|
-
toolIcon ? /* @__PURE__ */ jsx("span", { className: "text-[var(--ash-text-muted,rgba(255,255,255,0.5))]", children: toolIcon }) : /* @__PURE__ */ jsx("span", { className: "text-[var(--ash-text-muted,rgba(255,255,255,0.5))]", children: /* @__PURE__ */ jsxs("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
1276
|
+
/* @__PURE__ */ jsx(StatusIndicator, { status, size: isCompact ? "xs" : "sm" }),
|
|
1277
|
+
toolIcon ? /* @__PURE__ */ jsx("span", { className: "text-[var(--ash-text-muted,rgba(255,255,255,0.5))]", children: toolIcon }) : /* @__PURE__ */ jsx("span", { className: "text-[var(--ash-text-muted,rgba(255,255,255,0.5))]", children: /* @__PURE__ */ jsxs("svg", { className: isCompact ? "w-3 h-3" : "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
1201
1278
|
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }),
|
|
1202
1279
|
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
1203
1280
|
] }) }),
|
|
@@ -1206,7 +1283,7 @@ function ToolHeader({
|
|
|
1206
1283
|
{
|
|
1207
1284
|
className: cn(
|
|
1208
1285
|
"flex-1 font-medium",
|
|
1209
|
-
"text-[var(--ash-font-size-sm,12px)]",
|
|
1286
|
+
isCompact ? "text-[var(--ash-font-size-xs,10px)]" : "text-[var(--ash-font-size-sm,12px)]",
|
|
1210
1287
|
"text-[var(--ash-text-primary,rgba(255,255,255,0.9))]"
|
|
1211
1288
|
),
|
|
1212
1289
|
children: formattedName
|
|
@@ -1216,14 +1293,14 @@ function ToolHeader({
|
|
|
1216
1293
|
"span",
|
|
1217
1294
|
{
|
|
1218
1295
|
className: cn(
|
|
1219
|
-
"text-[var(--ash-font-size-xs,10px)]",
|
|
1296
|
+
isCompact ? "text-[9px]" : "text-[var(--ash-font-size-xs,10px)]",
|
|
1220
1297
|
"text-[var(--ash-text-muted,rgba(255,255,255,0.5))]",
|
|
1221
1298
|
"truncate max-w-[200px]"
|
|
1222
1299
|
),
|
|
1223
1300
|
children: Object.keys(toolInvocation.args).length > 0 && `(${Object.keys(toolInvocation.args).join(", ")})`
|
|
1224
1301
|
}
|
|
1225
1302
|
),
|
|
1226
|
-
|
|
1303
|
+
canToggle && /* @__PURE__ */ jsx(
|
|
1227
1304
|
"svg",
|
|
1228
1305
|
{
|
|
1229
1306
|
className: cn(
|
|
@@ -1319,24 +1396,28 @@ function ToolOutput({ className, maxHeight = 300 }) {
|
|
|
1319
1396
|
function ToolList({
|
|
1320
1397
|
toolInvocations,
|
|
1321
1398
|
className,
|
|
1322
|
-
defaultExpanded = false
|
|
1399
|
+
defaultExpanded = false,
|
|
1400
|
+
variant = "default"
|
|
1323
1401
|
}) {
|
|
1324
1402
|
if (!toolInvocations || toolInvocations.length === 0) {
|
|
1325
1403
|
return null;
|
|
1326
1404
|
}
|
|
1405
|
+
const isCompact = variant === "compact";
|
|
1327
1406
|
return /* @__PURE__ */ jsx(
|
|
1328
1407
|
"div",
|
|
1329
1408
|
{
|
|
1330
1409
|
className: cn(
|
|
1331
1410
|
"ash-tool-list",
|
|
1332
|
-
"flex flex-col
|
|
1411
|
+
"flex flex-col",
|
|
1412
|
+
isCompact ? "gap-1" : "gap-2",
|
|
1333
1413
|
className
|
|
1334
1414
|
),
|
|
1335
1415
|
children: toolInvocations.map((inv) => /* @__PURE__ */ jsx(
|
|
1336
1416
|
Tool,
|
|
1337
1417
|
{
|
|
1338
1418
|
toolInvocation: inv,
|
|
1339
|
-
defaultExpanded
|
|
1419
|
+
defaultExpanded,
|
|
1420
|
+
variant
|
|
1340
1421
|
},
|
|
1341
1422
|
inv.toolCallId
|
|
1342
1423
|
))
|
|
@@ -3534,6 +3615,7 @@ function useAgentChat(options) {
|
|
|
3534
3615
|
const eventCountRef = useRef(0);
|
|
3535
3616
|
const sessionIdRef = useRef(sessionId);
|
|
3536
3617
|
const streamingEntriesRef = useRef([]);
|
|
3618
|
+
const lastSequenceRef = useRef(0);
|
|
3537
3619
|
useEffect(() => {
|
|
3538
3620
|
sessionIdRef.current = sessionId;
|
|
3539
3621
|
}, [sessionId]);
|
|
@@ -3558,6 +3640,12 @@ function useAgentChat(options) {
|
|
|
3558
3640
|
setStreamingEntries([]);
|
|
3559
3641
|
}, []);
|
|
3560
3642
|
const processEvent = useCallback((event, streamEntries) => {
|
|
3643
|
+
if (event.id) {
|
|
3644
|
+
const seq = parseInt(event.id, 10);
|
|
3645
|
+
if (!isNaN(seq)) {
|
|
3646
|
+
lastSequenceRef.current = seq;
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3561
3649
|
const newEntries = [...streamEntries];
|
|
3562
3650
|
switch (event.type) {
|
|
3563
3651
|
case "session_start":
|
|
@@ -3894,7 +3982,8 @@ function useAgentChat(options) {
|
|
|
3894
3982
|
send,
|
|
3895
3983
|
stop,
|
|
3896
3984
|
clear,
|
|
3897
|
-
setEntries
|
|
3985
|
+
setEntries,
|
|
3986
|
+
lastSequence: lastSequenceRef.current
|
|
3898
3987
|
};
|
|
3899
3988
|
}
|
|
3900
3989
|
function generateId() {
|
|
@@ -4218,6 +4307,6 @@ function useLongTextConversion({
|
|
|
4218
4307
|
};
|
|
4219
4308
|
}
|
|
4220
4309
|
|
|
4221
|
-
export { ActionIcon, AlertCircleIcon, AlertTriangleIcon, ArrowUpIcon, Attachment, AttachmentInfo, AttachmentPreview, AttachmentRemove, Attachments, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, ClockIcon, CodeBlock, CodeIcon, Conversation, ConversationContent, ConversationEmptyState, ConversationScrollButton, CopyIcon, DEFAULT_STYLE_CONFIG, EditIcon, EnvVarsPanel, ErrorIcon, FileBadgeCompact, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, HomeIcon, InfoIcon, JsonDisplay, LazyMarkdown, ListChecksIcon, LoaderIcon, LoadingDots, LoadingSpinner, LogsPanel, Message, MessageAction, MessageActions, MessageAvatar, MessageContent, MessageResponse, MessageShimmer, MessageSquareIcon, MessageTimestamp, MicrophoneIcon, MoonIcon, OptionCards, PaperclipIcon, PlugIcon, Reasoning, ReasoningContent, ReasoningTrigger, SearchIcon, SendIcon, Shimmer, ShimmerBlock, ShimmerLine, ShimmerText, SparklesIcon, SpinnerIcon, StatusIndicator, StopCircleIcon, SunIcon, Task, TaskContent, TaskItem, TaskList, TaskTrigger, TerminalIcon, ThinkingIndicator, Tool, ToolHeader, ToolIcon, ToolInput, ToolList, ToolOutput, UserIcon, XCircleIcon, XIcon, allKeyframesCss, applyEventMiddleware, applyRequestMiddleware, borderRadius, callMiddlewareComplete, callMiddlewareError, cn, colors, createToolCall, cssVars, extractTextContent, formatElapsedTime, formatFileSize, formatFileSize2 as formatFileSizeHook, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, inlineStyles, isAgentToolAction, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry, keyframes, keyframesCss, mapToolToActionType, messageToNormalizedEntry, messagesToNormalizedEntries, normalizeToolResult, normalizedEntriesToMessages, normalizedEntryToMessage, parseCommandResult, parseMcpToolName, parseOptionsFromContent, shadows, spacing, tokensToCssVariables, transitions, truncate, typography, updateToolCallWithResult, useAgentChat, useAttachment, useChat, useConversation, useFileUpload, useLongTextConversion, useMessage, useMessageQueue, useReasoning, useStopExecution, useTask, useTool, widget, zIndex };
|
|
4310
|
+
export { ActionIcon, AlertCircleIcon, AlertTriangleIcon, ArrowUpIcon, Attachment, AttachmentInfo, AttachmentPreview, AttachmentRemove, Attachments, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, ClockIcon, CodeBlock, CodeIcon, Conversation, ConversationContent, ConversationEmptyState, ConversationScrollButton, CopyIcon, DEFAULT_STYLE_CONFIG, EditIcon, EnvVarsPanel, ErrorIcon, FileBadgeCompact, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, HomeIcon, InfoIcon, JsonDisplay, LazyMarkdown, ListChecksIcon, LoaderIcon, LoadingDots, LoadingSpinner, LogsPanel, Mention, Message, MessageAction, MessageActions, MessageAvatar, MessageContent, MessageResponse, MessageShimmer, MessageSquareIcon, MessageTimestamp, MicrophoneIcon, MoonIcon, OptionCards, PaperclipIcon, PlugIcon, Reasoning, ReasoningContent, ReasoningTrigger, RichContentRenderer, SearchIcon, SendIcon, Shimmer, ShimmerBlock, ShimmerLine, ShimmerText, SparklesIcon, SpinnerIcon, StatusIndicator, StopCircleIcon, SunIcon, Task, TaskContent, TaskItem, TaskList, TaskTrigger, TerminalIcon, ThinkingIndicator, Tool, ToolHeader, ToolIcon, ToolInput, ToolList, ToolOutput, UserIcon, XCircleIcon, XIcon, allKeyframesCss, applyEventMiddleware, applyRequestMiddleware, borderRadius, callMiddlewareComplete, callMiddlewareError, cn, colors, createToolCall, cssVars, extractTextContent, formatElapsedTime, formatFileSize, formatFileSize2 as formatFileSizeHook, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, inlineStyles, isAgentToolAction, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry, keyframes, keyframesCss, mapToolToActionType, messageToNormalizedEntry, messagesToNormalizedEntries, normalizeToolResult, normalizedEntriesToMessages, normalizedEntryToMessage, parseCommandResult, parseMcpToolName, parseOptionsFromContent, shadows, spacing, tokensToCssVariables, transitions, truncate, typography, updateToolCallWithResult, useAgentChat, useAttachment, useChat, useConversation, useFileUpload, useLongTextConversion, useMessage, useMessageQueue, useReasoning, useStopExecution, useTask, useTool, widget, zIndex };
|
|
4222
4311
|
//# sourceMappingURL=index.js.map
|
|
4223
4312
|
//# sourceMappingURL=index.js.map
|