@ash-cloud/ash-ui 0.0.7 → 0.0.8
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/icons.cjs +7 -0
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.d.cts +2 -1
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +7 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +245 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -9
- package/dist/index.d.ts +65 -9
- package/dist/index.js +242 -10
- package/dist/index.js.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +33 -2
- package/dist/types.d.ts +33 -2
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +34 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +8 -1
- package/dist/utils.d.ts +8 -1
- package/dist/utils.js +34 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { NormalizedToolCall, NormalizedEntry, ToolDisplayConfig, WidgetRenderFunction, WidgetAction, LogEntry, ToolDisplayMode, TodoItem, ToolStatus, ActionType } from './types.cjs';
|
|
3
|
-
export { AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_DISPLAY_CONFIG, ErrorEntry, FileAttachment, FileEditAction, FileReadAction, FileWriteAction, GenericToolAction, GlobAction, LogCategory, LogLevel, McpToolAction, NormalizedEntryType, SearchAction, ThinkingEntry, TodoStatus, TodoWriteAction, ToolCallEntry, ToolExecutionGroup as ToolExecutionGroupType, ToolResult, UserMessageEntry, WebFetchAction, WebSearchAction, WidgetEntry, WidgetRenderProps, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry } from './types.cjs';
|
|
3
|
+
export { AgentToolAction, AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_DISPLAY_CONFIG, ErrorEntry, FileAttachment, FileEditAction, FileReadAction, FileWriteAction, GenericToolAction, GlobAction, LogCategory, LogLevel, McpToolAction, NormalizedEntryType, SearchAction, ThinkingEntry, TodoStatus, TodoWriteAction, ToolCallEntry, ToolExecutionGroup as ToolExecutionGroupType, ToolResult, UserMessageEntry, WebFetchAction, WebSearchAction, WidgetEntry, WidgetRenderProps, isAgentToolAction, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry } from './types.cjs';
|
|
4
4
|
import { ReactNode, DragEvent, ChangeEvent, ClipboardEvent } from 'react';
|
|
5
5
|
import { ParsedOption } from './utils.cjs';
|
|
6
|
-
export { GroupedEntry, ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, extractToolCallsFromGroup, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.cjs';
|
|
7
|
-
export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.cjs';
|
|
6
|
+
export { GroupedEntry, ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, extractToolCallsFromGroup, formatElapsedTime, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.cjs';
|
|
7
|
+
export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, ClockIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.cjs';
|
|
8
8
|
export { BorderRadius, Colors, Keyframes, Shadows, Spacing, Transitions, Typography, Widget, ZIndex, allKeyframesCss, borderRadius, colors, inlineStyles, keyframes, keyframesCss, shadows, spacing, tokensToCssVariables, transitions, typography, widget, zIndex } from './design-tokens.cjs';
|
|
9
9
|
|
|
10
10
|
interface ToolCallCardProps {
|
|
@@ -30,6 +30,38 @@ interface ToolCallCardProps {
|
|
|
30
30
|
*/
|
|
31
31
|
declare function ToolCallCard({ toolCall, defaultExpanded, className }: ToolCallCardProps): react_jsx_runtime.JSX.Element;
|
|
32
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 */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Depth level for nested rendering (0 = top level) */
|
|
41
|
+
depth?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* AgentToolCard - Display a sub-agent/Task tool call with nested tool calls
|
|
45
|
+
*
|
|
46
|
+
* Features:
|
|
47
|
+
* - Agent type badge (e.g., "Explore", "Plan", "Bash")
|
|
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
|
+
|
|
33
65
|
interface MessageListProps {
|
|
34
66
|
/** Normalized conversation entries to display */
|
|
35
67
|
entries: NormalizedEntry[];
|
|
@@ -153,6 +185,8 @@ interface MessageEntryProps {
|
|
|
153
185
|
entry: NormalizedEntry;
|
|
154
186
|
/** Callback when user selects an option from assistant message */
|
|
155
187
|
onOptionSelect?: (optionText: string) => void;
|
|
188
|
+
/** Whether tool calls should be expanded by default */
|
|
189
|
+
defaultExpanded?: boolean;
|
|
156
190
|
className?: string;
|
|
157
191
|
}
|
|
158
192
|
/**
|
|
@@ -168,7 +202,7 @@ interface MessageEntryProps {
|
|
|
168
202
|
* ))}
|
|
169
203
|
* ```
|
|
170
204
|
*/
|
|
171
|
-
declare function MessageEntry({ entry, onOptionSelect, className }: MessageEntryProps): react_jsx_runtime.JSX.Element | null;
|
|
205
|
+
declare function MessageEntry({ entry, onOptionSelect, defaultExpanded, className }: MessageEntryProps): react_jsx_runtime.JSX.Element | null;
|
|
172
206
|
|
|
173
207
|
interface LogsPanelProps {
|
|
174
208
|
logs: LogEntry[];
|
|
@@ -632,6 +666,25 @@ interface LoadingIndicatorProps {
|
|
|
632
666
|
*/
|
|
633
667
|
declare function LoadingIndicator({ variant, size, className }: LoadingIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
634
668
|
|
|
669
|
+
interface LazyMarkdownProps {
|
|
670
|
+
children: string;
|
|
671
|
+
/** Fallback content to show while loading */
|
|
672
|
+
fallback?: ReactNode;
|
|
673
|
+
className?: string;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* LazyMarkdown - SSR-safe wrapper around react-markdown
|
|
677
|
+
*
|
|
678
|
+
* This component lazy-loads react-markdown to avoid the "document is not defined"
|
|
679
|
+
* error that occurs during SSR due to the decode-named-character-reference package.
|
|
680
|
+
*
|
|
681
|
+
* @example
|
|
682
|
+
* ```tsx
|
|
683
|
+
* <LazyMarkdown>{markdownContent}</LazyMarkdown>
|
|
684
|
+
* ```
|
|
685
|
+
*/
|
|
686
|
+
declare function LazyMarkdown({ children, fallback, className }: LazyMarkdownProps): react_jsx_runtime.JSX.Element;
|
|
687
|
+
|
|
635
688
|
interface TypewriterTextProps {
|
|
636
689
|
/** Words to cycle through */
|
|
637
690
|
words?: string[];
|
|
@@ -989,6 +1042,8 @@ interface StreamEvent {
|
|
|
989
1042
|
claudeSessionId?: string;
|
|
990
1043
|
delta?: string;
|
|
991
1044
|
text?: string;
|
|
1045
|
+
/** Message content array (for 'message' events) */
|
|
1046
|
+
content?: unknown;
|
|
992
1047
|
toolId?: string;
|
|
993
1048
|
toolName?: string;
|
|
994
1049
|
input?: unknown;
|
|
@@ -1015,8 +1070,9 @@ type StreamGenerator = AsyncGenerator<StreamEvent, void, unknown>;
|
|
|
1015
1070
|
/**
|
|
1016
1071
|
* Function that creates a stream of events
|
|
1017
1072
|
* This matches the signature of client.agents.run() and client.sessions.send()
|
|
1073
|
+
* The optional signal parameter allows cancellation via AbortController
|
|
1018
1074
|
*/
|
|
1019
|
-
type CreateStreamFn = (prompt: string, sessionId?: string) => StreamGenerator;
|
|
1075
|
+
type CreateStreamFn = (prompt: string, sessionId?: string, signal?: AbortSignal) => StreamGenerator;
|
|
1020
1076
|
/**
|
|
1021
1077
|
* Options for useAgentChat
|
|
1022
1078
|
*/
|
|
@@ -1027,11 +1083,11 @@ interface UseAgentChatOptions {
|
|
|
1027
1083
|
*
|
|
1028
1084
|
* @example
|
|
1029
1085
|
* ```tsx
|
|
1030
|
-
* createStream: (prompt, sessionId) => {
|
|
1086
|
+
* createStream: (prompt, sessionId, signal) => {
|
|
1031
1087
|
* if (sessionId) {
|
|
1032
|
-
* return client.sessions.send(sessionId, prompt);
|
|
1088
|
+
* return client.sessions.send(sessionId, prompt, { signal });
|
|
1033
1089
|
* }
|
|
1034
|
-
* return client.agents.run(agentId, prompt);
|
|
1090
|
+
* return client.agents.run(agentId, prompt, { signal });
|
|
1035
1091
|
* }
|
|
1036
1092
|
* ```
|
|
1037
1093
|
*/
|
|
@@ -1211,4 +1267,4 @@ interface UseLongTextConversionReturn {
|
|
|
1211
1267
|
*/
|
|
1212
1268
|
declare function useLongTextConversion({ threshold, filenameTemplate, onConversion, }?: LongTextConversionOptions): UseLongTextConversionReturn;
|
|
1213
1269
|
|
|
1214
|
-
export { ActionIcon, type ActionIconProps, ActionType, type StreamEvent as AgentStreamEvent, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolRow, type CompactToolRowProps, CompactToolStatusLine, type CompactToolStatusLineProps, type ConversionInfo, type CreateStreamFn, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, DisplayModeToggle, type DisplayModeToggleProps, EnvVarsPanel, type EnvVarsPanelProps, ErrorMessage, type ErrorMessageProps, FileBadge, type FileBadgeProps, JsonDisplay, type JsonDisplayProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, type LongTextConversionOptions, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StepAccordion, type StepAccordionProps, type StepStatus, type StreamGenerator, StreamingText, type StreamingTextProps, type TextAttachment, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseAgentChatOptions, type UseAgentChatReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseLongTextConversionReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, WidgetAction, WidgetRenderFunction, useAgentChat, useDisplayConfig, useDisplayMode, useFileUpload, useLongTextConversion, useMessageQueue, useStopExecution, useTheme };
|
|
1270
|
+
export { ActionIcon, type ActionIconProps, ActionType, type StreamEvent as AgentStreamEvent, AgentToolCard, type AgentToolCardProps, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolRow, type CompactToolRowProps, CompactToolStatusLine, type CompactToolStatusLineProps, type ConversionInfo, type CreateStreamFn, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, DisplayModeToggle, type DisplayModeToggleProps, EnvVarsPanel, type EnvVarsPanelProps, ErrorMessage, type ErrorMessageProps, FileBadge, type FileBadgeProps, JsonDisplay, type JsonDisplayProps, LazyMarkdown, type LazyMarkdownProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, type LongTextConversionOptions, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StepAccordion, type StepAccordionProps, type StepStatus, type StreamGenerator, StreamingText, type StreamingTextProps, type TextAttachment, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseAgentChatOptions, type UseAgentChatReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseLongTextConversionReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, WidgetAction, WidgetRenderFunction, useAgentChat, useDisplayConfig, useDisplayMode, useFileUpload, useLongTextConversion, useMessageQueue, useStopExecution, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { NormalizedToolCall, NormalizedEntry, ToolDisplayConfig, WidgetRenderFunction, WidgetAction, LogEntry, ToolDisplayMode, TodoItem, ToolStatus, ActionType } from './types.js';
|
|
3
|
-
export { AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_DISPLAY_CONFIG, ErrorEntry, FileAttachment, FileEditAction, FileReadAction, FileWriteAction, GenericToolAction, GlobAction, LogCategory, LogLevel, McpToolAction, NormalizedEntryType, SearchAction, ThinkingEntry, TodoStatus, TodoWriteAction, ToolCallEntry, ToolExecutionGroup as ToolExecutionGroupType, ToolResult, UserMessageEntry, WebFetchAction, WebSearchAction, WidgetEntry, WidgetRenderProps, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry } from './types.js';
|
|
3
|
+
export { AgentToolAction, AssistantMessageEntry, CommandRunAction, CommandRunResult, DEFAULT_DISPLAY_CONFIG, ErrorEntry, FileAttachment, FileEditAction, FileReadAction, FileWriteAction, GenericToolAction, GlobAction, LogCategory, LogLevel, McpToolAction, NormalizedEntryType, SearchAction, ThinkingEntry, TodoStatus, TodoWriteAction, ToolCallEntry, ToolExecutionGroup as ToolExecutionGroupType, ToolResult, UserMessageEntry, WebFetchAction, WebSearchAction, WidgetEntry, WidgetRenderProps, isAgentToolAction, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, isWidgetEntry } from './types.js';
|
|
4
4
|
import { ReactNode, DragEvent, ChangeEvent, ClipboardEvent } from 'react';
|
|
5
5
|
import { ParsedOption } from './utils.js';
|
|
6
|
-
export { GroupedEntry, ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, extractToolCallsFromGroup, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.js';
|
|
7
|
-
export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.js';
|
|
6
|
+
export { GroupedEntry, ParsedOptionsResult, ToolUseInput, cn, createToolCall, extractTextContent, extractToolCallsFromGroup, formatElapsedTime, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, truncate, updateToolCallWithResult } from './utils.js';
|
|
7
|
+
export { AlertCircleIcon, AlertTriangleIcon, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, ClockIcon, CodeIcon, CopyIcon, EditIcon, ErrorIcon, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, IconProps, InfoIcon, ListChecksIcon, LoaderIcon, MessageSquareIcon, MoonIcon, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, SpinnerIcon, StopCircleIcon, SunIcon, TerminalIcon, ToolIcon, UserIcon, XCircleIcon, XIcon } from './icons.js';
|
|
8
8
|
export { BorderRadius, Colors, Keyframes, Shadows, Spacing, Transitions, Typography, Widget, ZIndex, allKeyframesCss, borderRadius, colors, inlineStyles, keyframes, keyframesCss, shadows, spacing, tokensToCssVariables, transitions, typography, widget, zIndex } from './design-tokens.js';
|
|
9
9
|
|
|
10
10
|
interface ToolCallCardProps {
|
|
@@ -30,6 +30,38 @@ interface ToolCallCardProps {
|
|
|
30
30
|
*/
|
|
31
31
|
declare function ToolCallCard({ toolCall, defaultExpanded, className }: ToolCallCardProps): react_jsx_runtime.JSX.Element;
|
|
32
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 */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Depth level for nested rendering (0 = top level) */
|
|
41
|
+
depth?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* AgentToolCard - Display a sub-agent/Task tool call with nested tool calls
|
|
45
|
+
*
|
|
46
|
+
* Features:
|
|
47
|
+
* - Agent type badge (e.g., "Explore", "Plan", "Bash")
|
|
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
|
+
|
|
33
65
|
interface MessageListProps {
|
|
34
66
|
/** Normalized conversation entries to display */
|
|
35
67
|
entries: NormalizedEntry[];
|
|
@@ -153,6 +185,8 @@ interface MessageEntryProps {
|
|
|
153
185
|
entry: NormalizedEntry;
|
|
154
186
|
/** Callback when user selects an option from assistant message */
|
|
155
187
|
onOptionSelect?: (optionText: string) => void;
|
|
188
|
+
/** Whether tool calls should be expanded by default */
|
|
189
|
+
defaultExpanded?: boolean;
|
|
156
190
|
className?: string;
|
|
157
191
|
}
|
|
158
192
|
/**
|
|
@@ -168,7 +202,7 @@ interface MessageEntryProps {
|
|
|
168
202
|
* ))}
|
|
169
203
|
* ```
|
|
170
204
|
*/
|
|
171
|
-
declare function MessageEntry({ entry, onOptionSelect, className }: MessageEntryProps): react_jsx_runtime.JSX.Element | null;
|
|
205
|
+
declare function MessageEntry({ entry, onOptionSelect, defaultExpanded, className }: MessageEntryProps): react_jsx_runtime.JSX.Element | null;
|
|
172
206
|
|
|
173
207
|
interface LogsPanelProps {
|
|
174
208
|
logs: LogEntry[];
|
|
@@ -632,6 +666,25 @@ interface LoadingIndicatorProps {
|
|
|
632
666
|
*/
|
|
633
667
|
declare function LoadingIndicator({ variant, size, className }: LoadingIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
634
668
|
|
|
669
|
+
interface LazyMarkdownProps {
|
|
670
|
+
children: string;
|
|
671
|
+
/** Fallback content to show while loading */
|
|
672
|
+
fallback?: ReactNode;
|
|
673
|
+
className?: string;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* LazyMarkdown - SSR-safe wrapper around react-markdown
|
|
677
|
+
*
|
|
678
|
+
* This component lazy-loads react-markdown to avoid the "document is not defined"
|
|
679
|
+
* error that occurs during SSR due to the decode-named-character-reference package.
|
|
680
|
+
*
|
|
681
|
+
* @example
|
|
682
|
+
* ```tsx
|
|
683
|
+
* <LazyMarkdown>{markdownContent}</LazyMarkdown>
|
|
684
|
+
* ```
|
|
685
|
+
*/
|
|
686
|
+
declare function LazyMarkdown({ children, fallback, className }: LazyMarkdownProps): react_jsx_runtime.JSX.Element;
|
|
687
|
+
|
|
635
688
|
interface TypewriterTextProps {
|
|
636
689
|
/** Words to cycle through */
|
|
637
690
|
words?: string[];
|
|
@@ -989,6 +1042,8 @@ interface StreamEvent {
|
|
|
989
1042
|
claudeSessionId?: string;
|
|
990
1043
|
delta?: string;
|
|
991
1044
|
text?: string;
|
|
1045
|
+
/** Message content array (for 'message' events) */
|
|
1046
|
+
content?: unknown;
|
|
992
1047
|
toolId?: string;
|
|
993
1048
|
toolName?: string;
|
|
994
1049
|
input?: unknown;
|
|
@@ -1015,8 +1070,9 @@ type StreamGenerator = AsyncGenerator<StreamEvent, void, unknown>;
|
|
|
1015
1070
|
/**
|
|
1016
1071
|
* Function that creates a stream of events
|
|
1017
1072
|
* This matches the signature of client.agents.run() and client.sessions.send()
|
|
1073
|
+
* The optional signal parameter allows cancellation via AbortController
|
|
1018
1074
|
*/
|
|
1019
|
-
type CreateStreamFn = (prompt: string, sessionId?: string) => StreamGenerator;
|
|
1075
|
+
type CreateStreamFn = (prompt: string, sessionId?: string, signal?: AbortSignal) => StreamGenerator;
|
|
1020
1076
|
/**
|
|
1021
1077
|
* Options for useAgentChat
|
|
1022
1078
|
*/
|
|
@@ -1027,11 +1083,11 @@ interface UseAgentChatOptions {
|
|
|
1027
1083
|
*
|
|
1028
1084
|
* @example
|
|
1029
1085
|
* ```tsx
|
|
1030
|
-
* createStream: (prompt, sessionId) => {
|
|
1086
|
+
* createStream: (prompt, sessionId, signal) => {
|
|
1031
1087
|
* if (sessionId) {
|
|
1032
|
-
* return client.sessions.send(sessionId, prompt);
|
|
1088
|
+
* return client.sessions.send(sessionId, prompt, { signal });
|
|
1033
1089
|
* }
|
|
1034
|
-
* return client.agents.run(agentId, prompt);
|
|
1090
|
+
* return client.agents.run(agentId, prompt, { signal });
|
|
1035
1091
|
* }
|
|
1036
1092
|
* ```
|
|
1037
1093
|
*/
|
|
@@ -1211,4 +1267,4 @@ interface UseLongTextConversionReturn {
|
|
|
1211
1267
|
*/
|
|
1212
1268
|
declare function useLongTextConversion({ threshold, filenameTemplate, onConversion, }?: LongTextConversionOptions): UseLongTextConversionReturn;
|
|
1213
1269
|
|
|
1214
|
-
export { ActionIcon, type ActionIconProps, ActionType, type StreamEvent as AgentStreamEvent, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolRow, type CompactToolRowProps, CompactToolStatusLine, type CompactToolStatusLineProps, type ConversionInfo, type CreateStreamFn, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, DisplayModeToggle, type DisplayModeToggleProps, EnvVarsPanel, type EnvVarsPanelProps, ErrorMessage, type ErrorMessageProps, FileBadge, type FileBadgeProps, JsonDisplay, type JsonDisplayProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, type LongTextConversionOptions, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StepAccordion, type StepAccordionProps, type StepStatus, type StreamGenerator, StreamingText, type StreamingTextProps, type TextAttachment, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseAgentChatOptions, type UseAgentChatReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseLongTextConversionReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, WidgetAction, WidgetRenderFunction, useAgentChat, useDisplayConfig, useDisplayMode, useFileUpload, useLongTextConversion, useMessageQueue, useStopExecution, useTheme };
|
|
1270
|
+
export { ActionIcon, type ActionIconProps, ActionType, type StreamEvent as AgentStreamEvent, AgentToolCard, type AgentToolCardProps, AssistantMessage, type AssistantMessageProps, type FileAttachment as ChatFileAttachment, CodeBlock, type CodeBlockProps, CompactToolRow, type CompactToolRowProps, CompactToolStatusLine, type CompactToolStatusLineProps, type ConversionInfo, type CreateStreamFn, type DisplayModeContextType, DisplayModeProvider, type DisplayModeProviderProps, DisplayModeToggle, type DisplayModeToggleProps, EnvVarsPanel, type EnvVarsPanelProps, ErrorMessage, type ErrorMessageProps, FileBadge, type FileBadgeProps, JsonDisplay, type JsonDisplayProps, LazyMarkdown, type LazyMarkdownProps, LoadingIndicator, type LoadingIndicatorProps, LogEntry, LogsPanel, type LogsPanelProps, type LongTextConversionOptions, MessageEntry, type MessageEntryProps, MessageList, type MessageListProps, NormalizedEntry, NormalizedToolCall, OptionCards, type OptionCardsProps, ParsedOption, type QueuedMessage, StatusIndicator, type StatusIndicatorProps, StepAccordion, type StepAccordionProps, type StepStatus, type StreamGenerator, StreamingText, type StreamingTextProps, type TextAttachment, type Theme, type ThemeContextType, ThemeProvider, type ThemeProviderProps, ThinkingMessage, type ThinkingMessageProps, TodoItem, TodoPanel, type TodoPanelProps, ToolCallCard, type ToolCallCardProps, ToolCallMessage, type ToolCallMessageProps, ToolDisplayConfig, ToolDisplayMode, ToolExecutionGroup, type ToolExecutionGroupProps, ToolStatus, TypewriterText, type TypewriterTextProps, type UseAgentChatOptions, type UseAgentChatReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseLongTextConversionReturn, type UseMessageQueueOptions, type UseMessageQueueReturn, type UseStopExecutionOptions, type UseStopExecutionReturn, UserMessage, type UserMessageProps, WidgetAction, WidgetRenderFunction, useAgentChat, useDisplayConfig, useDisplayMode, useFileUpload, useLongTextConversion, useMessageQueue, useStopExecution, useTheme };
|