@agentxjs/ui 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/components/container/Chat.d.ts +3 -9
  3. package/dist/components/container/ChatHeader.d.ts +2 -1
  4. package/dist/components/element/Badge.d.ts +1 -1
  5. package/dist/components/element/MessageAvatar.d.ts +1 -1
  6. package/dist/components/entry/AssistantEntry.d.ts +86 -0
  7. package/dist/components/entry/AssistantToolbar.d.ts +53 -0
  8. package/dist/components/entry/ErrorEntry.d.ts +35 -0
  9. package/dist/components/entry/UserEntry.d.ts +35 -0
  10. package/dist/components/entry/blocks/TextBlock.d.ts +21 -0
  11. package/dist/components/entry/blocks/ToolBlock.d.ts +20 -0
  12. package/dist/components/entry/blocks/index.d.ts +8 -0
  13. package/dist/components/entry/index.d.ts +15 -0
  14. package/dist/components/entry/types.d.ts +152 -0
  15. package/dist/components/message/AssistantMessage.d.ts +35 -0
  16. package/dist/components/message/ErrorMessage.d.ts +24 -0
  17. package/dist/components/message/MessageAvatar.d.ts +21 -0
  18. package/dist/components/message/MessageContent.d.ts +25 -0
  19. package/dist/components/message/ToolMessage.d.ts +41 -0
  20. package/dist/components/message/UserMessage.d.ts +30 -0
  21. package/dist/components/message/index.d.ts +39 -0
  22. package/dist/components/mobile/MobileAgentList.d.ts +51 -0
  23. package/dist/components/mobile/MobileChat.d.ts +47 -0
  24. package/dist/components/mobile/MobileDrawer.d.ts +32 -0
  25. package/dist/components/mobile/MobileHeader.d.ts +41 -0
  26. package/dist/components/mobile/MobileInputPane.d.ts +41 -0
  27. package/dist/components/mobile/MobileMessagePane.d.ts +33 -0
  28. package/dist/components/mobile/index.d.ts +6 -0
  29. package/dist/components/pane/MessagePane.d.ts +31 -83
  30. package/dist/components/pane/index.d.ts +1 -1
  31. package/dist/components/studio/MobileStudio.d.ts +31 -0
  32. package/dist/components/studio/ResponsiveStudio.d.ts +46 -0
  33. package/dist/components/studio/index.d.ts +4 -0
  34. package/dist/globals.css +1 -1
  35. package/dist/hooks/index.d.ts +31 -13
  36. package/dist/hooks/useAgent/conversationReducer.d.ts +9 -0
  37. package/dist/hooks/useAgent/index.d.ts +7 -0
  38. package/dist/hooks/useAgent/types.d.ts +134 -0
  39. package/dist/hooks/useIsMobile.d.ts +22 -0
  40. package/dist/index-Bye0TcnJ.js +271 -0
  41. package/dist/index-Bye0TcnJ.js.map +1 -0
  42. package/dist/index-CHvoau9l.js +26216 -0
  43. package/dist/index-CHvoau9l.js.map +1 -0
  44. package/dist/index.js +61 -21968
  45. package/dist/index.js.map +1 -1
  46. package/package.json +19 -18
  47. package/LICENSE +0 -21
  48. package/dist/components/container/message/MessageList.d.ts +0 -16
  49. package/dist/components/container/message/index.d.ts +0 -3
  50. package/dist/components/container/message/items/AssistantMessage.d.ts +0 -33
  51. package/dist/components/container/message/items/ErrorAlert.d.ts +0 -33
  52. package/dist/components/container/message/items/ToolCallMessage.d.ts +0 -31
  53. package/dist/components/container/message/items/ToolResultMessage.d.ts +0 -33
  54. package/dist/components/container/message/items/ToolUseMessage.d.ts +0 -30
  55. package/dist/components/container/message/items/UserMessage.d.ts +0 -27
  56. package/dist/components/container/message/items/index.d.ts +0 -6
  57. package/dist/components/container/message/parts/FileContent.d.ts +0 -24
  58. package/dist/components/container/message/parts/ImageContent.d.ts +0 -32
  59. package/dist/components/container/message/parts/TextContent.d.ts +0 -20
  60. package/dist/components/container/message/parts/ThinkingContent.d.ts +0 -28
  61. package/dist/components/container/message/parts/ToolCallContent.d.ts +0 -31
  62. package/dist/components/container/message/parts/ToolResultContent.d.ts +0 -32
  63. package/dist/components/container/message/parts/index.d.ts +0 -6
  64. package/dist/hooks/useAgent.d.ts +0 -102
@@ -4,5 +4,6 @@ export * from '../components/container';
4
4
  export * from '../components/pane';
5
5
  export * from '../components/layout';
6
6
  export * from '../components/element';
7
+ export * from '../components/mobile';
7
8
  export * from '../components/typography';
8
9
  export * from '../utils';
@@ -5,26 +5,20 @@ export interface ChatProps {
5
5
  */
6
6
  agentx: AgentX | null;
7
7
  /**
8
- * Image ID for the conversation (preferred in Image-First model)
8
+ * Image ID for the conversation
9
9
  */
10
10
  imageId?: string | null;
11
- /**
12
- * Agent ID to chat with (legacy, use imageId instead)
13
- * @deprecated Use imageId instead
14
- */
15
- agentId?: string | null;
16
11
  /**
17
12
  * Agent name to display in header
18
13
  */
19
14
  agentName?: string;
20
15
  /**
21
16
  * Callback when save button is clicked
22
- * Note: In Image-First model, messages are auto-saved
23
17
  */
24
18
  onSave?: () => void;
25
19
  /**
26
20
  * Show save button in toolbar
27
- * @default true
21
+ * @default false
28
22
  */
29
23
  showSaveButton?: boolean;
30
24
  /**
@@ -44,4 +38,4 @@ export interface ChatProps {
44
38
  /**
45
39
  * Chat component
46
40
  */
47
- export declare function Chat({ agentx, imageId, agentId: legacyAgentId, agentName, onSave, showSaveButton, placeholder, inputHeightRatio, className, }: ChatProps): import("react/jsx-runtime").JSX.Element;
41
+ export declare function Chat({ agentx, imageId, agentName, onSave, showSaveButton, placeholder, inputHeightRatio, className, }: ChatProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { AgentState } from 'agentxjs';
1
2
  /**
2
3
  * ChatHeader - Header component for Chat interface
3
4
  *
@@ -21,7 +22,7 @@ export interface ChatHeaderProps {
21
22
  /**
22
23
  * Current agent status
23
24
  */
24
- status?: "idle" | "queued" | "thinking" | "responding" | "tool_executing" | "error";
25
+ status?: AgentState;
25
26
  /**
26
27
  * Number of messages in conversation
27
28
  */
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "success" | "primary" | "info" | "secondary" | "warning" | "destructive" | "outline" | null | undefined;
4
+ variant?: "success" | "default" | "primary" | "info" | "secondary" | "warning" | "destructive" | "outline" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const avatarVariants: (props?: ({
4
- variant?: "error" | "success" | "primary" | "info" | "secondary" | "warning" | "neutral" | null | undefined;
4
+ variant?: "success" | "error" | "primary" | "info" | "secondary" | "warning" | "neutral" | null | undefined;
5
5
  size?: "sm" | "md" | "lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export interface MessageAvatarProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarVariants> {
@@ -0,0 +1,86 @@
1
+ import { AssistantConversationData } from './types';
2
+ /**
3
+ * AssistantEntry - AI assistant response entry
4
+ *
5
+ * Displays assistant's response with blocks (TextBlock, ToolBlock, etc.)
6
+ * rendered in order. Supports streaming and status indicators.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Completed entry with text and tool blocks
11
+ * <AssistantEntry
12
+ * entry={{
13
+ * type: "assistant",
14
+ * id: "conv_123",
15
+ * messageIds: ["msg_1"],
16
+ * timestamp: Date.now(),
17
+ * status: "completed",
18
+ * blocks: [
19
+ * { type: "text", id: "t1", content: "Let me check...", status: "completed" },
20
+ * { type: "tool", id: "t2", toolCallId: "tc1", name: "Bash", ... },
21
+ * { type: "text", id: "t3", content: "Done!", status: "completed" },
22
+ * ],
23
+ * }}
24
+ * />
25
+ *
26
+ * // Streaming entry
27
+ * <AssistantEntry
28
+ * entry={{
29
+ * type: "assistant",
30
+ * id: "conv_123",
31
+ * messageIds: [],
32
+ * timestamp: Date.now(),
33
+ * status: "streaming",
34
+ * blocks: [
35
+ * { type: "text", id: "text_123", content: "", status: "streaming" },
36
+ * ],
37
+ * }}
38
+ * streamingText="I'm thinking about..."
39
+ * currentTextBlockId="text_123"
40
+ * />
41
+ * ```
42
+ */
43
+ import * as React from "react";
44
+ export interface AssistantEntryProps {
45
+ /**
46
+ * Assistant conversation data
47
+ */
48
+ entry: AssistantConversationData;
49
+ /**
50
+ * Streaming text (for streaming TextBlock)
51
+ */
52
+ streamingText?: string;
53
+ /**
54
+ * Current streaming text block id
55
+ */
56
+ currentTextBlockId?: string | null;
57
+ /**
58
+ * Callback when stop is triggered
59
+ */
60
+ onStop?: () => void;
61
+ /**
62
+ * Callback when copy button is clicked
63
+ */
64
+ onCopy?: () => void;
65
+ /**
66
+ * Callback when regenerate button is clicked
67
+ */
68
+ onRegenerate?: () => void;
69
+ /**
70
+ * Callback when like button is clicked
71
+ */
72
+ onLike?: () => void;
73
+ /**
74
+ * Callback when dislike button is clicked
75
+ */
76
+ onDislike?: () => void;
77
+ /**
78
+ * Additional class name
79
+ */
80
+ className?: string;
81
+ }
82
+ /**
83
+ * AssistantEntry Component
84
+ */
85
+ export declare const AssistantEntry: React.FC<AssistantEntryProps>;
86
+ export default AssistantEntry;
@@ -0,0 +1,53 @@
1
+ import { AssistantConversationStatus } from './types';
2
+ /**
3
+ * AssistantToolbar - Toolbar for assistant message actions
4
+ *
5
+ * Displays action buttons below assistant messages:
6
+ * - Copy, regenerate, like, dislike for completed messages
7
+ * - "esc to stop" hint for streaming messages
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <AssistantToolbar
12
+ * status="completed"
13
+ * onCopy={() => handleCopy()}
14
+ * onRegenerate={() => handleRegenerate()}
15
+ * />
16
+ * ```
17
+ */
18
+ import * as React from "react";
19
+ export interface AssistantToolbarProps {
20
+ /**
21
+ * Current status of the conversation
22
+ */
23
+ status: AssistantConversationStatus;
24
+ /**
25
+ * Callback when copy button is clicked
26
+ */
27
+ onCopy?: () => void;
28
+ /**
29
+ * Callback when regenerate button is clicked
30
+ */
31
+ onRegenerate?: () => void;
32
+ /**
33
+ * Callback when like button is clicked
34
+ */
35
+ onLike?: () => void;
36
+ /**
37
+ * Callback when dislike button is clicked
38
+ */
39
+ onDislike?: () => void;
40
+ /**
41
+ * Callback when stop is triggered (click or ESC)
42
+ */
43
+ onStop?: () => void;
44
+ /**
45
+ * Additional class name
46
+ */
47
+ className?: string;
48
+ }
49
+ /**
50
+ * AssistantToolbar Component
51
+ */
52
+ export declare const AssistantToolbar: React.FC<AssistantToolbarProps>;
53
+ export default AssistantToolbar;
@@ -0,0 +1,35 @@
1
+ import { ErrorConversationData } from './types';
2
+ /**
3
+ * ErrorEntry - Error message entry
4
+ *
5
+ * Displays error message with red styling.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <ErrorEntryComponent
10
+ * entry={{
11
+ * type: "error",
12
+ * id: "err_123",
13
+ * content: "Failed to connect to server",
14
+ * timestamp: Date.now(),
15
+ * errorCode: "CONNECTION_ERROR",
16
+ * }}
17
+ * />
18
+ * ```
19
+ */
20
+ import * as React from "react";
21
+ export interface ErrorEntryProps {
22
+ /**
23
+ * Error conversation data
24
+ */
25
+ entry: ErrorConversationData;
26
+ /**
27
+ * Additional class name
28
+ */
29
+ className?: string;
30
+ }
31
+ /**
32
+ * ErrorEntry Component
33
+ */
34
+ export declare const ErrorEntry: React.FC<ErrorEntryProps>;
35
+ export default ErrorEntry;
@@ -0,0 +1,35 @@
1
+ import { UserConversationData } from './types';
2
+ /**
3
+ * UserEntry - User message entry
4
+ *
5
+ * Displays user's message with right-aligned layout and status indicator.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * <UserEntryComponent
10
+ * entry={{
11
+ * type: "user",
12
+ * id: "msg_123",
13
+ * content: "Hello, can you help me?",
14
+ * timestamp: Date.now(),
15
+ * status: "success",
16
+ * }}
17
+ * />
18
+ * ```
19
+ */
20
+ import * as React from "react";
21
+ export interface UserEntryProps {
22
+ /**
23
+ * User conversation data
24
+ */
25
+ entry: UserConversationData;
26
+ /**
27
+ * Additional class name
28
+ */
29
+ className?: string;
30
+ }
31
+ /**
32
+ * UserEntry Component
33
+ */
34
+ export declare const UserEntry: React.FC<UserEntryProps>;
35
+ export default UserEntry;
@@ -0,0 +1,21 @@
1
+ import { TextBlockData } from '../types';
2
+ export interface TextBlockProps {
3
+ /**
4
+ * Text block data
5
+ */
6
+ block: TextBlockData;
7
+ /**
8
+ * Streaming text (for streaming status)
9
+ * When provided and block.status is "streaming", shows this instead of block.content
10
+ */
11
+ streamingText?: string;
12
+ /**
13
+ * Additional class name
14
+ */
15
+ className?: string;
16
+ }
17
+ /**
18
+ * TextBlock component
19
+ */
20
+ export declare function TextBlock({ block, streamingText, className }: TextBlockProps): import("react/jsx-runtime").JSX.Element | null;
21
+ export default TextBlock;
@@ -0,0 +1,20 @@
1
+ import { ToolBlockData } from '../types';
2
+ export interface ToolBlockProps {
3
+ /**
4
+ * Tool block data
5
+ */
6
+ block: ToolBlockData;
7
+ /**
8
+ * Default expanded state
9
+ */
10
+ defaultExpanded?: boolean;
11
+ /**
12
+ * Additional class name
13
+ */
14
+ className?: string;
15
+ }
16
+ /**
17
+ * ToolBlock component
18
+ */
19
+ export declare function ToolBlock({ block, defaultExpanded, className }: ToolBlockProps): import("react/jsx-runtime").JSX.Element;
20
+ export default ToolBlock;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Block components
3
+ *
4
+ * Sub-components used within AssistantEntry.
5
+ * Each block type has its own component.
6
+ */
7
+ export { TextBlock, type TextBlockProps } from './TextBlock';
8
+ export { ToolBlock, type ToolBlockProps } from './ToolBlock';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Conversation Components
3
+ *
4
+ * Conversation-first design for chat UI rendering.
5
+ * Conversation = one party's complete utterance in a turn.
6
+ * Block = content unit within a Conversation (TextBlock, ToolBlock, etc.).
7
+ */
8
+ export type { ConversationData, UserConversationData, AssistantConversationData, ErrorConversationData, UserConversationStatus, AssistantConversationStatus, } from './types';
9
+ export type { BlockData, TextBlockData, ToolBlockData, ImageBlockData, TextBlockStatus, ToolBlockStatus, } from './types';
10
+ export { isUserConversation, isAssistantConversation, isErrorConversation, isTextBlock, isToolBlock, isImageBlock, } from './types';
11
+ export { UserEntry, type UserEntryProps } from './UserEntry';
12
+ export { AssistantEntry, type AssistantEntryProps } from './AssistantEntry';
13
+ export { ErrorEntry, type ErrorEntryProps } from './ErrorEntry';
14
+ export { TextBlock, type TextBlockProps } from './blocks';
15
+ export { ToolBlock, type ToolBlockProps } from './blocks';
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Conversation Types
3
+ *
4
+ * Conversation-first design for chat UI rendering.
5
+ * Conversation = one party's complete utterance in a turn.
6
+ * Block = content unit within a Conversation (TextBlock, ToolBlock, ImageBlock, etc.).
7
+ *
8
+ * Data flow:
9
+ * Message (backend) → Conversation (UI layer) → Block (sub-components)
10
+ *
11
+ * Terminology:
12
+ * - Turn = UserConversation + AssistantConversation
13
+ * - AssistantConversation may contain multiple backend messages (due to tool calls)
14
+ * - Blocks are rendered in order: text, tool, text, tool, ...
15
+ */
16
+ /**
17
+ * Block base interface
18
+ */
19
+ interface BlockBase {
20
+ /** Block id */
21
+ id: string;
22
+ /** Timestamp when block was created */
23
+ timestamp: number;
24
+ }
25
+ /**
26
+ * Text block status
27
+ */
28
+ export type TextBlockStatus = "streaming" | "completed";
29
+ /**
30
+ * Text block data - text content in AssistantConversation
31
+ */
32
+ export interface TextBlockData extends BlockBase {
33
+ type: "text";
34
+ /** Text content */
35
+ content: string;
36
+ /** Block status */
37
+ status: TextBlockStatus;
38
+ }
39
+ /**
40
+ * Tool block status
41
+ * - planning: AI is generating tool input (tool_use_start received, waiting for complete input)
42
+ * - executing: Tool input complete, tool is executing
43
+ * - success: Tool execution completed successfully
44
+ * - error: Tool execution failed
45
+ */
46
+ export type ToolBlockStatus = "planning" | "executing" | "success" | "error";
47
+ /**
48
+ * Tool block data - tool call in AssistantConversation
49
+ */
50
+ export interface ToolBlockData extends BlockBase {
51
+ type: "tool";
52
+ /** Tool call id (for matching result) */
53
+ toolCallId: string;
54
+ /** Tool name */
55
+ name: string;
56
+ /** Tool input parameters */
57
+ input: unknown;
58
+ /** Execution status */
59
+ status: ToolBlockStatus;
60
+ /** Tool output (when completed) */
61
+ output?: unknown;
62
+ /** Start time in milliseconds (for duration calculation) */
63
+ startTime?: number;
64
+ /** Execution duration in seconds */
65
+ duration?: number;
66
+ }
67
+ /**
68
+ * Image block data - image content (future)
69
+ */
70
+ export interface ImageBlockData extends BlockBase {
71
+ type: "image";
72
+ /** Image URL */
73
+ url: string;
74
+ /** Alt text */
75
+ alt?: string;
76
+ }
77
+ /**
78
+ * Union type for all block types
79
+ */
80
+ export type BlockData = TextBlockData | ToolBlockData | ImageBlockData;
81
+ export declare function isTextBlock(block: BlockData): block is TextBlockData;
82
+ export declare function isToolBlock(block: BlockData): block is ToolBlockData;
83
+ export declare function isImageBlock(block: BlockData): block is ImageBlockData;
84
+ /**
85
+ * User conversation status
86
+ */
87
+ export type UserConversationStatus = "pending" | "success" | "error" | "interrupted";
88
+ /**
89
+ * User conversation data - user's message
90
+ */
91
+ export interface UserConversationData {
92
+ type: "user";
93
+ /** Conversation id */
94
+ id: string;
95
+ /** Message content */
96
+ content: string;
97
+ /** Timestamp */
98
+ timestamp: number;
99
+ /** Send status */
100
+ status: UserConversationStatus;
101
+ /** Error code (if status is error) */
102
+ errorCode?: string;
103
+ }
104
+ /**
105
+ * Assistant conversation status (5-state lifecycle)
106
+ * - queued: user sent message, waiting for backend to receive
107
+ * - processing: backend received, preparing to process (conversation_start)
108
+ * - thinking: AI is thinking (conversation_thinking)
109
+ * - streaming: AI is outputting text (conversation_responding / text_delta)
110
+ * - completed: AI finished responding (conversation_end)
111
+ */
112
+ export type AssistantConversationStatus = "queued" | "processing" | "thinking" | "streaming" | "completed";
113
+ /**
114
+ * Assistant conversation data - AI's response with blocks
115
+ * One AssistantConversation may contain multiple backend messages (due to tool call loops)
116
+ * All content is stored in blocks array (TextBlock, ToolBlock, etc.)
117
+ */
118
+ export interface AssistantConversationData {
119
+ type: "assistant";
120
+ /** Conversation id - frontend instance ID, never changes once created */
121
+ id: string;
122
+ /** Backend message ids - accumulated from multiple message_start events */
123
+ messageIds: string[];
124
+ /** Timestamp */
125
+ timestamp: number;
126
+ /** Response status */
127
+ status: AssistantConversationStatus;
128
+ /** Content blocks - text, tools, images, etc. rendered in order */
129
+ blocks: BlockData[];
130
+ }
131
+ /**
132
+ * Error conversation data - error message
133
+ */
134
+ export interface ErrorConversationData {
135
+ type: "error";
136
+ /** Conversation id */
137
+ id: string;
138
+ /** Error message content */
139
+ content: string;
140
+ /** Timestamp */
141
+ timestamp: number;
142
+ /** Error code */
143
+ errorCode?: string;
144
+ }
145
+ /**
146
+ * Union type for all conversations
147
+ */
148
+ export type ConversationData = UserConversationData | AssistantConversationData | ErrorConversationData;
149
+ export declare function isUserConversation(conversation: ConversationData): conversation is UserConversationData;
150
+ export declare function isAssistantConversation(conversation: ConversationData): conversation is AssistantConversationData;
151
+ export declare function isErrorConversation(conversation: ConversationData): conversation is ErrorConversationData;
152
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * AssistantMessage - Assistant message component with 4-state lifecycle
3
+ *
4
+ * States:
5
+ * - queued: Waiting to start processing
6
+ * - thinking: AI is thinking (extended thinking block)
7
+ * - responding: AI is streaming response
8
+ * - completed: Message is complete
9
+ */
10
+ import * as React from "react";
11
+ export type AssistantMessageStatus = "queued" | "thinking" | "responding" | "completed";
12
+ export interface AssistantMessageProps {
13
+ /**
14
+ * Message status (lifecycle state)
15
+ */
16
+ status: AssistantMessageStatus;
17
+ /**
18
+ * Message content (for completed status)
19
+ */
20
+ content?: string;
21
+ /**
22
+ * Streaming text (for responding status)
23
+ */
24
+ streaming?: string;
25
+ /**
26
+ * Additional class name
27
+ */
28
+ className?: string;
29
+ }
30
+ /**
31
+ * AssistantMessage Component
32
+ *
33
+ * Single component handling all 4 lifecycle states
34
+ */
35
+ export declare const AssistantMessage: React.FC<AssistantMessageProps>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ErrorMessage - Error message component
3
+ *
4
+ * Displays error message with red styling.
5
+ */
6
+ import * as React from "react";
7
+ export interface ErrorMessageProps {
8
+ /**
9
+ * Error content
10
+ */
11
+ content: string;
12
+ /**
13
+ * Error code (optional)
14
+ */
15
+ errorCode?: string;
16
+ /**
17
+ * Additional class name
18
+ */
19
+ className?: string;
20
+ }
21
+ /**
22
+ * ErrorMessage Component
23
+ */
24
+ export declare const ErrorMessage: React.FC<ErrorMessageProps>;
@@ -0,0 +1,21 @@
1
+ import { MessageRole } from 'agentxjs';
2
+ /**
3
+ * MessageAvatar - Display avatar for different message roles
4
+ *
5
+ * Pure UI component that renders a circular avatar based on message role.
6
+ */
7
+ import * as React from "react";
8
+ export interface MessageAvatarProps {
9
+ /**
10
+ * Message role
11
+ */
12
+ role: MessageRole;
13
+ /**
14
+ * Additional class name
15
+ */
16
+ className?: string;
17
+ }
18
+ /**
19
+ * MessageAvatar Component
20
+ */
21
+ export declare const MessageAvatar: React.FC<MessageAvatarProps>;
@@ -0,0 +1,25 @@
1
+ import { ContentPart } from 'agentxjs';
2
+ /**
3
+ * MessageContent - Render message content with Markdown support
4
+ *
5
+ * Pure UI component that handles:
6
+ * - String content (renders as Markdown)
7
+ * - ContentPart array (extracts text and renders)
8
+ * - Other content (renders as JSON)
9
+ */
10
+ import * as React from "react";
11
+ export interface MessageContentProps {
12
+ /**
13
+ * Content to render
14
+ * Can be string, ContentPart array, or any other structure
15
+ */
16
+ content: string | ContentPart[] | unknown;
17
+ /**
18
+ * Additional class name
19
+ */
20
+ className?: string;
21
+ }
22
+ /**
23
+ * MessageContent Component
24
+ */
25
+ export declare const MessageContent: React.FC<MessageContentProps>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * ToolMessage - Tool call message component
3
+ *
4
+ * Displays tool call with embedded result using ToolCard.
5
+ * Result is directly embedded in props (not via metadata).
6
+ */
7
+ import * as React from "react";
8
+ /**
9
+ * @deprecated Use ToolBlock from ~/components/entry instead
10
+ */
11
+ interface EmbeddedToolResult {
12
+ output: unknown;
13
+ duration?: number;
14
+ }
15
+ export interface ToolMessageProps {
16
+ /**
17
+ * Tool call info
18
+ */
19
+ toolCall: {
20
+ id: string;
21
+ name: string;
22
+ input: unknown;
23
+ };
24
+ /**
25
+ * Tool result (embedded, not separate message)
26
+ */
27
+ toolResult?: EmbeddedToolResult;
28
+ /**
29
+ * Timestamp for calculating duration
30
+ */
31
+ timestamp: number;
32
+ /**
33
+ * Additional class name
34
+ */
35
+ className?: string;
36
+ }
37
+ /**
38
+ * ToolMessage Component
39
+ */
40
+ export declare const ToolMessage: React.FC<ToolMessageProps>;
41
+ export {};