@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.
- package/dist/api/index.d.ts +1 -0
- package/dist/components/container/Chat.d.ts +3 -9
- package/dist/components/container/ChatHeader.d.ts +2 -1
- package/dist/components/element/Badge.d.ts +1 -1
- package/dist/components/element/MessageAvatar.d.ts +1 -1
- package/dist/components/entry/AssistantEntry.d.ts +86 -0
- package/dist/components/entry/AssistantToolbar.d.ts +53 -0
- package/dist/components/entry/ErrorEntry.d.ts +35 -0
- package/dist/components/entry/UserEntry.d.ts +35 -0
- package/dist/components/entry/blocks/TextBlock.d.ts +21 -0
- package/dist/components/entry/blocks/ToolBlock.d.ts +20 -0
- package/dist/components/entry/blocks/index.d.ts +8 -0
- package/dist/components/entry/index.d.ts +15 -0
- package/dist/components/entry/types.d.ts +152 -0
- package/dist/components/message/AssistantMessage.d.ts +35 -0
- package/dist/components/message/ErrorMessage.d.ts +24 -0
- package/dist/components/message/MessageAvatar.d.ts +21 -0
- package/dist/components/message/MessageContent.d.ts +25 -0
- package/dist/components/message/ToolMessage.d.ts +41 -0
- package/dist/components/message/UserMessage.d.ts +30 -0
- package/dist/components/message/index.d.ts +39 -0
- package/dist/components/mobile/MobileAgentList.d.ts +51 -0
- package/dist/components/mobile/MobileChat.d.ts +47 -0
- package/dist/components/mobile/MobileDrawer.d.ts +32 -0
- package/dist/components/mobile/MobileHeader.d.ts +41 -0
- package/dist/components/mobile/MobileInputPane.d.ts +41 -0
- package/dist/components/mobile/MobileMessagePane.d.ts +33 -0
- package/dist/components/mobile/index.d.ts +6 -0
- package/dist/components/pane/MessagePane.d.ts +31 -83
- package/dist/components/pane/index.d.ts +1 -1
- package/dist/components/studio/MobileStudio.d.ts +31 -0
- package/dist/components/studio/ResponsiveStudio.d.ts +46 -0
- package/dist/components/studio/index.d.ts +4 -0
- package/dist/globals.css +1 -1
- package/dist/hooks/index.d.ts +31 -13
- package/dist/hooks/useAgent/conversationReducer.d.ts +9 -0
- package/dist/hooks/useAgent/index.d.ts +7 -0
- package/dist/hooks/useAgent/types.d.ts +134 -0
- package/dist/hooks/useIsMobile.d.ts +22 -0
- package/dist/index-Bye0TcnJ.js +271 -0
- package/dist/index-Bye0TcnJ.js.map +1 -0
- package/dist/index-CHvoau9l.js +26216 -0
- package/dist/index-CHvoau9l.js.map +1 -0
- package/dist/index.js +61 -21968
- package/dist/index.js.map +1 -1
- package/package.json +19 -18
- package/LICENSE +0 -21
- package/dist/components/container/message/MessageList.d.ts +0 -16
- package/dist/components/container/message/index.d.ts +0 -3
- package/dist/components/container/message/items/AssistantMessage.d.ts +0 -33
- package/dist/components/container/message/items/ErrorAlert.d.ts +0 -33
- package/dist/components/container/message/items/ToolCallMessage.d.ts +0 -31
- package/dist/components/container/message/items/ToolResultMessage.d.ts +0 -33
- package/dist/components/container/message/items/ToolUseMessage.d.ts +0 -30
- package/dist/components/container/message/items/UserMessage.d.ts +0 -27
- package/dist/components/container/message/items/index.d.ts +0 -6
- package/dist/components/container/message/parts/FileContent.d.ts +0 -24
- package/dist/components/container/message/parts/ImageContent.d.ts +0 -32
- package/dist/components/container/message/parts/TextContent.d.ts +0 -20
- package/dist/components/container/message/parts/ThinkingContent.d.ts +0 -28
- package/dist/components/container/message/parts/ToolCallContent.d.ts +0 -31
- package/dist/components/container/message/parts/ToolResultContent.d.ts +0 -32
- package/dist/components/container/message/parts/index.d.ts +0 -6
- package/dist/hooks/useAgent.d.ts +0 -102
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UserConversationStatus } from '../../hooks/useAgent';
|
|
2
|
+
/**
|
|
3
|
+
* UserMessage - User message component
|
|
4
|
+
*
|
|
5
|
+
* Displays user message with right-aligned layout and status indicator.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use UserEntry from ~/components/entry instead
|
|
10
|
+
*/
|
|
11
|
+
type UserMessageStatus = UserConversationStatus;
|
|
12
|
+
export interface UserMessageProps {
|
|
13
|
+
/**
|
|
14
|
+
* Message content
|
|
15
|
+
*/
|
|
16
|
+
content: string;
|
|
17
|
+
/**
|
|
18
|
+
* Message status
|
|
19
|
+
*/
|
|
20
|
+
status: UserMessageStatus;
|
|
21
|
+
/**
|
|
22
|
+
* Additional class name
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* UserMessage Component
|
|
28
|
+
*/
|
|
29
|
+
export declare const UserMessage: React.FC<UserMessageProps>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Components
|
|
3
|
+
*
|
|
4
|
+
* Simple, direct message rendering without handler chains.
|
|
5
|
+
* Each component renders a specific message type.
|
|
6
|
+
*
|
|
7
|
+
* ## Components
|
|
8
|
+
*
|
|
9
|
+
* - UserMessage: User messages with status indicator
|
|
10
|
+
* - AssistantMessage: Assistant messages with 4-state lifecycle
|
|
11
|
+
* - ToolMessage: Tool calls with embedded results
|
|
12
|
+
* - ErrorMessage: Error display
|
|
13
|
+
*
|
|
14
|
+
* ## Usage
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { AssistantMessage, UserMessage, ToolMessage } from "~/components/message";
|
|
18
|
+
*
|
|
19
|
+
* // User message
|
|
20
|
+
* <UserMessage content="Hello" status="success" />
|
|
21
|
+
*
|
|
22
|
+
* // Assistant message with 4-state lifecycle
|
|
23
|
+
* <AssistantMessage status="completed" content="Hi there!" />
|
|
24
|
+
* <AssistantMessage status="responding" streaming="I'm thinking..." />
|
|
25
|
+
*
|
|
26
|
+
* // Tool message with embedded result
|
|
27
|
+
* <ToolMessage
|
|
28
|
+
* toolCall={{ id: "1", name: "search", input: { query: "test" } }}
|
|
29
|
+
* toolResult={{ output: "results", duration: 1.2 }}
|
|
30
|
+
* timestamp={Date.now()}
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export { UserMessage, type UserMessageProps } from './UserMessage';
|
|
35
|
+
export { AssistantMessage, type AssistantMessageProps, type AssistantMessageStatus, } from './AssistantMessage';
|
|
36
|
+
export { ToolMessage, type ToolMessageProps } from './ToolMessage';
|
|
37
|
+
export { ErrorMessage, type ErrorMessageProps } from './ErrorMessage';
|
|
38
|
+
export { MessageAvatar, type MessageAvatarProps } from './MessageAvatar';
|
|
39
|
+
export { MessageContent, type MessageContentProps } from './MessageContent';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AgentX } from 'agentxjs';
|
|
2
|
+
/**
|
|
3
|
+
* MobileAgentList - Mobile agent/conversation list
|
|
4
|
+
*
|
|
5
|
+
* A mobile-optimized list following Claude App's design:
|
|
6
|
+
* - Clean list items with good touch targets
|
|
7
|
+
* - Swipe to delete (optional)
|
|
8
|
+
* - Search at top
|
|
9
|
+
* - New conversation button
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
export interface MobileAgentListProps {
|
|
13
|
+
/**
|
|
14
|
+
* AgentX instance
|
|
15
|
+
*/
|
|
16
|
+
agentx: AgentX | null;
|
|
17
|
+
/**
|
|
18
|
+
* Container ID
|
|
19
|
+
*/
|
|
20
|
+
containerId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Selected image ID
|
|
23
|
+
*/
|
|
24
|
+
selectedId?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when selecting a conversation
|
|
27
|
+
*/
|
|
28
|
+
onSelect?: (imageId: string, agentId: string | null) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback when creating new conversation
|
|
31
|
+
*/
|
|
32
|
+
onNew?: (imageId: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Callback when drawer should close
|
|
35
|
+
*/
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Show search
|
|
39
|
+
*/
|
|
40
|
+
searchable?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Additional class name
|
|
43
|
+
*/
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* MobileAgentList Component
|
|
48
|
+
*
|
|
49
|
+
* A mobile-optimized conversation list for the drawer.
|
|
50
|
+
*/
|
|
51
|
+
export declare const MobileAgentList: React.FC<MobileAgentListProps>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AgentX } from 'agentxjs';
|
|
2
|
+
/**
|
|
3
|
+
* MobileChat - Mobile chat interface
|
|
4
|
+
*
|
|
5
|
+
* A mobile-optimized chat component following Claude App's design:
|
|
6
|
+
* - Full-screen layout
|
|
7
|
+
* - Clean header with hamburger menu
|
|
8
|
+
* - Scrollable message area
|
|
9
|
+
* - Bottom input with rounded design
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
export interface MobileChatProps {
|
|
13
|
+
/**
|
|
14
|
+
* AgentX instance
|
|
15
|
+
*/
|
|
16
|
+
agentx: AgentX | null;
|
|
17
|
+
/**
|
|
18
|
+
* Image ID for the conversation
|
|
19
|
+
*/
|
|
20
|
+
imageId?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Agent name to display in header
|
|
23
|
+
*/
|
|
24
|
+
agentName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when menu button is clicked
|
|
27
|
+
*/
|
|
28
|
+
onMenuClick?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback when new conversation button is clicked
|
|
31
|
+
*/
|
|
32
|
+
onNewConversation?: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Input placeholder text
|
|
35
|
+
*/
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Additional class name
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* MobileChat Component
|
|
44
|
+
*
|
|
45
|
+
* A full-screen mobile chat interface.
|
|
46
|
+
*/
|
|
47
|
+
export declare const MobileChat: React.FC<MobileChatProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MobileDrawer - Mobile drawer component using vaul
|
|
3
|
+
*
|
|
4
|
+
* A slide-out drawer for mobile navigation, following Claude App's minimalist design.
|
|
5
|
+
* Supports swipe gestures and provides smooth animations.
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
export interface MobileDrawerProps {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the drawer is open
|
|
11
|
+
*/
|
|
12
|
+
open: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Callback when drawer open state changes
|
|
15
|
+
*/
|
|
16
|
+
onOpenChange: (open: boolean) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Drawer content
|
|
19
|
+
*/
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Additional class name for drawer content
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* MobileDrawer Component
|
|
28
|
+
*
|
|
29
|
+
* A left-side drawer for mobile navigation using vaul library.
|
|
30
|
+
* Provides gesture support and smooth animations.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MobileDrawer: React.FC<MobileDrawerProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MobileHeader - Mobile header component
|
|
3
|
+
*
|
|
4
|
+
* A minimalist header following Claude App's design:
|
|
5
|
+
* - Hamburger menu on left
|
|
6
|
+
* - Title in center
|
|
7
|
+
* - Optional action on right
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
export interface MobileHeaderProps {
|
|
11
|
+
/**
|
|
12
|
+
* Header title
|
|
13
|
+
*/
|
|
14
|
+
title?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Callback when menu button is clicked
|
|
17
|
+
*/
|
|
18
|
+
onMenuClick?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Callback when action button is clicked
|
|
21
|
+
*/
|
|
22
|
+
onActionClick?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Custom action icon
|
|
25
|
+
*/
|
|
26
|
+
actionIcon?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to show action button
|
|
29
|
+
*/
|
|
30
|
+
showAction?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Additional class name
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* MobileHeader Component
|
|
38
|
+
*
|
|
39
|
+
* A simple, minimalist header with hamburger menu and optional action.
|
|
40
|
+
*/
|
|
41
|
+
export declare const MobileHeader: React.FC<MobileHeaderProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MobileInputPane - Mobile input area
|
|
3
|
+
*
|
|
4
|
+
* A minimalist input area following Claude App's design:
|
|
5
|
+
* - Rounded corners
|
|
6
|
+
* - Clean appearance
|
|
7
|
+
* - Mobile keyboard handling
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
export interface MobileInputPaneProps {
|
|
11
|
+
/**
|
|
12
|
+
* Callback when user sends a message
|
|
13
|
+
*/
|
|
14
|
+
onSend?: (text: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Callback when stop button is clicked
|
|
17
|
+
*/
|
|
18
|
+
onStop?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the input is disabled
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether currently loading
|
|
25
|
+
*/
|
|
26
|
+
isLoading?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Placeholder text
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Additional class name
|
|
33
|
+
*/
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* MobileInputPane Component
|
|
38
|
+
*
|
|
39
|
+
* A mobile-optimized input area with clean, minimal design.
|
|
40
|
+
*/
|
|
41
|
+
export declare const MobileInputPane: React.ForwardRefExoticComponent<MobileInputPaneProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MobileMessagePane - Mobile message display area
|
|
3
|
+
*
|
|
4
|
+
* A scrollable container for messages following Claude App's design:
|
|
5
|
+
* - Large whitespace
|
|
6
|
+
* - Hidden scrollbar
|
|
7
|
+
* - Clean empty state
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
export interface MobileMessagePaneProps {
|
|
11
|
+
/**
|
|
12
|
+
* Message content (children)
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Empty state configuration
|
|
17
|
+
*/
|
|
18
|
+
emptyState?: {
|
|
19
|
+
icon?: React.ReactNode;
|
|
20
|
+
title: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Additional class name
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* MobileMessagePane Component
|
|
30
|
+
*
|
|
31
|
+
* A mobile-optimized message container with auto-scroll and hidden scrollbar.
|
|
32
|
+
*/
|
|
33
|
+
export declare const MobileMessagePane: React.ForwardRefExoticComponent<MobileMessagePaneProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MobileDrawer, type MobileDrawerProps } from './MobileDrawer';
|
|
2
|
+
export { MobileHeader, type MobileHeaderProps } from './MobileHeader';
|
|
3
|
+
export { MobileMessagePane, type MobileMessagePaneProps } from './MobileMessagePane';
|
|
4
|
+
export { MobileInputPane, type MobileInputPaneProps } from './MobileInputPane';
|
|
5
|
+
export { MobileChat, type MobileChatProps } from './MobileChat';
|
|
6
|
+
export { MobileAgentList, type MobileAgentListProps } from './MobileAgentList';
|
|
@@ -1,99 +1,45 @@
|
|
|
1
|
-
import { ToolStatus } from '../container/ToolCard';
|
|
2
1
|
/**
|
|
3
|
-
* MessagePane -
|
|
2
|
+
* MessagePane - Pure UI scrollable container for messages
|
|
4
3
|
*
|
|
5
|
-
* A pure UI component
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - Empty state
|
|
10
|
-
* - Markdown rendering support
|
|
4
|
+
* A pure UI component that provides:
|
|
5
|
+
* - Scrollable container with auto-scroll
|
|
6
|
+
* - Empty state display
|
|
7
|
+
* - Flexible content (accepts any React children)
|
|
11
8
|
*
|
|
12
|
-
* This component knows
|
|
13
|
-
*
|
|
9
|
+
* This component knows NOTHING about:
|
|
10
|
+
* - Message types or structure
|
|
11
|
+
* - Business logic
|
|
12
|
+
* - Rendering logic for specific message types
|
|
13
|
+
*
|
|
14
|
+
* It's purely a layout/container component.
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* ```tsx
|
|
17
|
-
* <MessagePane
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* <MessagePane>
|
|
19
|
+
* {messages.map(msg => (
|
|
20
|
+
* msg.role === 'assistant' ? (
|
|
21
|
+
* <AssistantMessage
|
|
22
|
+
* key={msg.id}
|
|
23
|
+
* message={msg}
|
|
24
|
+
* status={msg.metadata?.status}
|
|
25
|
+
* streamingText={streaming}
|
|
26
|
+
* />
|
|
27
|
+
* ) : (
|
|
28
|
+
* <MessageRenderer key={msg.id} message={msg} />
|
|
29
|
+
* )
|
|
30
|
+
* ))}
|
|
31
|
+
* </MessagePane>
|
|
22
32
|
* ```
|
|
23
33
|
*/
|
|
24
34
|
import * as React from "react";
|
|
25
|
-
/**
|
|
26
|
-
* Tool metadata for ToolCard rendering
|
|
27
|
-
*/
|
|
28
|
-
export interface ToolMetadata {
|
|
29
|
-
/** Tool name (e.g., "Bash", "Read") */
|
|
30
|
-
toolName: string;
|
|
31
|
-
/** Tool call ID */
|
|
32
|
-
toolId?: string;
|
|
33
|
-
/** Tool status */
|
|
34
|
-
status: ToolStatus;
|
|
35
|
-
/** Tool input parameters */
|
|
36
|
-
input?: Record<string, unknown>;
|
|
37
|
-
/** Tool output */
|
|
38
|
-
output?: unknown;
|
|
39
|
-
/** Whether output is an error */
|
|
40
|
-
isError?: boolean;
|
|
41
|
-
/** Execution duration in seconds */
|
|
42
|
-
duration?: number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Message item data
|
|
46
|
-
*/
|
|
47
|
-
export interface MessagePaneItem {
|
|
48
|
-
/**
|
|
49
|
-
* Unique identifier
|
|
50
|
-
*/
|
|
51
|
-
id: string;
|
|
52
|
-
/**
|
|
53
|
-
* Message role
|
|
54
|
-
*/
|
|
55
|
-
role: "user" | "assistant" | "system" | "tool" | "error";
|
|
56
|
-
/**
|
|
57
|
-
* Message content (string for text, any for structured content)
|
|
58
|
-
*/
|
|
59
|
-
content: string | unknown;
|
|
60
|
-
/**
|
|
61
|
-
* Timestamp
|
|
62
|
-
*/
|
|
63
|
-
timestamp?: number;
|
|
64
|
-
/**
|
|
65
|
-
* Optional metadata (tool info for role="tool", errorCode for role="error")
|
|
66
|
-
*/
|
|
67
|
-
metadata?: Record<string, unknown>;
|
|
68
|
-
/**
|
|
69
|
-
* Tool-specific metadata (for role="tool")
|
|
70
|
-
*/
|
|
71
|
-
toolMetadata?: ToolMetadata;
|
|
72
|
-
}
|
|
73
35
|
export interface MessagePaneProps {
|
|
74
36
|
/**
|
|
75
|
-
*
|
|
76
|
-
*/
|
|
77
|
-
items: MessagePaneItem[];
|
|
78
|
-
/**
|
|
79
|
-
* Current streaming text (displays with typing indicator)
|
|
37
|
+
* Content to display (messages, indicators, etc.)
|
|
80
38
|
*/
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Whether currently loading/thinking
|
|
84
|
-
*/
|
|
85
|
-
isLoading?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Custom content renderer
|
|
88
|
-
* @default Uses MarkdownText for strings
|
|
89
|
-
*/
|
|
90
|
-
renderContent?: (content: unknown, item: MessagePaneItem) => React.ReactNode;
|
|
91
|
-
/**
|
|
92
|
-
* Custom avatar renderer
|
|
93
|
-
*/
|
|
94
|
-
renderAvatar?: (role: MessagePaneItem["role"]) => React.ReactNode;
|
|
39
|
+
children?: React.ReactNode;
|
|
95
40
|
/**
|
|
96
41
|
* Empty state configuration
|
|
42
|
+
* Shows when children is empty
|
|
97
43
|
*/
|
|
98
44
|
emptyState?: {
|
|
99
45
|
icon?: React.ReactNode;
|
|
@@ -106,6 +52,8 @@ export interface MessagePaneProps {
|
|
|
106
52
|
className?: string;
|
|
107
53
|
}
|
|
108
54
|
/**
|
|
109
|
-
* MessagePane
|
|
55
|
+
* MessagePane Component
|
|
56
|
+
*
|
|
57
|
+
* Pure UI container with auto-scroll functionality.
|
|
110
58
|
*/
|
|
111
59
|
export declare const MessagePane: React.ForwardRefExoticComponent<MessagePaneProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -25,7 +25,7 @@ export type { NavBarProps, NavBarItem } from './NavBar';
|
|
|
25
25
|
export { ListPane } from './ListPane';
|
|
26
26
|
export type { ListPaneProps, ListPaneItem } from './ListPane';
|
|
27
27
|
export { MessagePane } from './MessagePane';
|
|
28
|
-
export type { MessagePaneProps
|
|
28
|
+
export type { MessagePaneProps } from './MessagePane';
|
|
29
29
|
export { InputPane } from './InputPane';
|
|
30
30
|
export type { InputPaneProps } from './InputPane';
|
|
31
31
|
export { InputToolBar } from './InputToolBar';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AgentX } from 'agentxjs';
|
|
2
|
+
export interface MobileStudioProps {
|
|
3
|
+
/**
|
|
4
|
+
* AgentX instance
|
|
5
|
+
*/
|
|
6
|
+
agentx: AgentX | null;
|
|
7
|
+
/**
|
|
8
|
+
* Container ID for user isolation
|
|
9
|
+
* @default "default"
|
|
10
|
+
*/
|
|
11
|
+
containerId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Enable search in drawer
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
searchable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Input placeholder
|
|
19
|
+
*/
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Additional class name
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* MobileStudio Component
|
|
28
|
+
*
|
|
29
|
+
* A full-screen mobile chat workspace with drawer navigation.
|
|
30
|
+
*/
|
|
31
|
+
export declare function MobileStudio({ agentx, containerId, searchable, placeholder, className, }: MobileStudioProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AgentX } from 'agentxjs';
|
|
2
|
+
export interface ResponsiveStudioProps {
|
|
3
|
+
/**
|
|
4
|
+
* AgentX instance
|
|
5
|
+
*/
|
|
6
|
+
agentx: AgentX | null;
|
|
7
|
+
/**
|
|
8
|
+
* Container ID for user isolation
|
|
9
|
+
* @default "default"
|
|
10
|
+
*/
|
|
11
|
+
containerId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Breakpoint for mobile/desktop switch
|
|
14
|
+
* @default 768
|
|
15
|
+
*/
|
|
16
|
+
breakpoint?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Desktop: Width of the sidebar
|
|
19
|
+
* @default 280
|
|
20
|
+
*/
|
|
21
|
+
sidebarWidth?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Desktop: Enable search in AgentList
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
searchable?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Desktop: Input height ratio
|
|
29
|
+
* @default 0.25
|
|
30
|
+
*/
|
|
31
|
+
inputHeightRatio?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Mobile: Input placeholder
|
|
34
|
+
*/
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Additional class name
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ResponsiveStudio Component
|
|
43
|
+
*
|
|
44
|
+
* Automatically renders Studio or MobileStudio based on viewport width.
|
|
45
|
+
*/
|
|
46
|
+
export declare function ResponsiveStudio({ agentx, containerId, breakpoint, sidebarWidth, searchable, inputHeightRatio, placeholder, className, }: ResponsiveStudioProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,3 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export { Studio } from './Studio';
|
|
16
16
|
export type { StudioProps } from './Studio';
|
|
17
|
+
export { MobileStudio } from './MobileStudio';
|
|
18
|
+
export type { MobileStudioProps } from './MobileStudio';
|
|
19
|
+
export { ResponsiveStudio } from './ResponsiveStudio';
|
|
20
|
+
export type { ResponsiveStudioProps } from './ResponsiveStudio';
|