@agentxjs/ui 0.0.1
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/LICENSE +21 -0
- package/README.md +78 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/components/container/AgentPane.d.ts +56 -0
- package/dist/components/container/ContainerView.d.ts +119 -0
- package/dist/components/container/DefinitionPane.d.ts +27 -0
- package/dist/components/container/InputPane.d.ts +44 -0
- package/dist/components/container/InputToolBar.d.ts +22 -0
- package/dist/components/container/MessagePane.d.ts +32 -0
- package/dist/components/container/SessionPane.d.ts +35 -0
- package/dist/components/container/index.d.ts +22 -0
- package/dist/components/container/types.d.ts +67 -0
- package/dist/components/element/ActionBar.d.ts +43 -0
- package/dist/components/element/AgentLogo.d.ts +21 -0
- package/dist/components/element/AppHeader.d.ts +84 -0
- package/dist/components/element/Badge.d.ts +9 -0
- package/dist/components/element/Button.d.ts +11 -0
- package/dist/components/element/EmptyState.d.ts +56 -0
- package/dist/components/element/ImageAttachment.d.ts +50 -0
- package/dist/components/element/Input.d.ts +5 -0
- package/dist/components/element/ListItem.d.ts +106 -0
- package/dist/components/element/LoadingState.d.ts +51 -0
- package/dist/components/element/MessageAvatar.d.ts +61 -0
- package/dist/components/element/PageHeader.d.ts +90 -0
- package/dist/components/element/Popover.d.ts +20 -0
- package/dist/components/element/ScrollArea.d.ts +6 -0
- package/dist/components/element/SearchInput.d.ts +75 -0
- package/dist/components/element/TabNavigation.d.ts +91 -0
- package/dist/components/element/TimeAgo.d.ts +46 -0
- package/dist/components/element/TokenUsagePie.d.ts +33 -0
- package/dist/components/element/index.d.ts +18 -0
- package/dist/components/input/InputBox.d.ts +43 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/layout/ActivityBar.d.ts +62 -0
- package/dist/components/layout/Header.d.ts +36 -0
- package/dist/components/layout/MainContent.d.ts +21 -0
- package/dist/components/layout/Panel.d.ts +44 -0
- package/dist/components/layout/RightSidebar.d.ts +43 -0
- package/dist/components/layout/Sidebar.d.ts +34 -0
- package/dist/components/layout/StatusBar.d.ts +66 -0
- package/dist/components/layout/index.d.ts +7 -0
- package/dist/components/message/MessageList.d.ts +16 -0
- package/dist/components/message/StatusIndicator.d.ts +28 -0
- package/dist/components/message/index.d.ts +4 -0
- package/dist/components/message/items/AssistantMessage.d.ts +33 -0
- package/dist/components/message/items/ErrorAlert.d.ts +33 -0
- package/dist/components/message/items/SystemMessage.d.ts +25 -0
- package/dist/components/message/items/ToolCallMessage.d.ts +31 -0
- package/dist/components/message/items/ToolResultMessage.d.ts +33 -0
- package/dist/components/message/items/ToolUseMessage.d.ts +30 -0
- package/dist/components/message/items/UserMessage.d.ts +27 -0
- package/dist/components/message/items/index.d.ts +7 -0
- package/dist/components/message/parts/FileContent.d.ts +24 -0
- package/dist/components/message/parts/ImageContent.d.ts +32 -0
- package/dist/components/message/parts/TextContent.d.ts +20 -0
- package/dist/components/message/parts/ThinkingContent.d.ts +28 -0
- package/dist/components/message/parts/ToolCallContent.d.ts +31 -0
- package/dist/components/message/parts/ToolResultContent.d.ts +32 -0
- package/dist/components/message/parts/index.d.ts +6 -0
- package/dist/components/studio/Studio.d.ts +47 -0
- package/dist/components/studio/index.d.ts +9 -0
- package/dist/components/typography/DiffViewer.d.ts +41 -0
- package/dist/components/typography/JSONRenderer.d.ts +23 -0
- package/dist/components/typography/MarkdownText.d.ts +25 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/globals.css +201 -0
- package/dist/hooks/index.d.ts +28 -0
- package/dist/hooks/useAgent.d.ts +71 -0
- package/dist/hooks/useAgentX.d.ts +10 -0
- package/dist/hooks/useSession.d.ts +79 -0
- package/dist/index-CB5mSMCj.js +3041 -0
- package/dist/index-CB5mSMCj.js.map +1 -0
- package/dist/index-CyXGvO5F.js +27676 -0
- package/dist/index-CyXGvO5F.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/eventBus.d.ts +93 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/timeUtils.d.ts +14 -0
- package/dist/utils/utils.d.ts +13 -0
- package/package.json +87 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UserMessage as UserMessageType } from '@agentxjs/types';
|
|
2
|
+
export interface UserMessageProps {
|
|
3
|
+
/**
|
|
4
|
+
* User message data
|
|
5
|
+
*/
|
|
6
|
+
message: UserMessageType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* UserMessage - Display a user message
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - User avatar (amber color)
|
|
13
|
+
* - Text content rendering
|
|
14
|
+
* - Image parts support
|
|
15
|
+
* - File parts support
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <UserMessage message={{
|
|
20
|
+
* id: '1',
|
|
21
|
+
* role: 'user',
|
|
22
|
+
* content: 'Hello, how are you?',
|
|
23
|
+
* timestamp: Date.now()
|
|
24
|
+
* }} />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function UserMessage({ message }: UserMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { UserMessage, type UserMessageProps } from './UserMessage';
|
|
2
|
+
export { AssistantMessage, type AssistantMessageProps } from './AssistantMessage';
|
|
3
|
+
export { SystemMessage, type SystemMessageProps } from './SystemMessage';
|
|
4
|
+
export { ToolCallMessage } from './ToolCallMessage';
|
|
5
|
+
export { ToolResultMessage } from './ToolResultMessage';
|
|
6
|
+
export { ToolUseMessage, type ToolUseMessageProps } from './ToolUseMessage';
|
|
7
|
+
export { ErrorAlert, type ErrorAlertProps } from './ErrorAlert';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface FileContentProps {
|
|
2
|
+
/**
|
|
3
|
+
* File data (base64-encoded string or URL)
|
|
4
|
+
*/
|
|
5
|
+
data: string;
|
|
6
|
+
/**
|
|
7
|
+
* File MIME type (IANA media type)
|
|
8
|
+
*/
|
|
9
|
+
mediaType: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional filename
|
|
12
|
+
*/
|
|
13
|
+
filename?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* FileContent - Render file attachment with download
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <FileContent data="data:application/pdf;base64,..." mediaType="application/pdf" filename="document.pdf" />
|
|
21
|
+
* <FileContent data="https://example.com/file.xlsx" mediaType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" filename="data.xlsx" />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function FileContent({ data, mediaType, filename }: FileContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ImageContentProps {
|
|
2
|
+
/**
|
|
3
|
+
* Image data (base64-encoded string or URL)
|
|
4
|
+
*/
|
|
5
|
+
data: string;
|
|
6
|
+
/**
|
|
7
|
+
* Image MIME type
|
|
8
|
+
*/
|
|
9
|
+
mediaType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
|
|
10
|
+
/**
|
|
11
|
+
* Optional image name/filename
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional max width (CSS value)
|
|
16
|
+
*/
|
|
17
|
+
maxWidth?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional max height (CSS value)
|
|
20
|
+
*/
|
|
21
|
+
maxHeight?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ImageContent - Render image with preview and modal
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <ImageContent data="data:image/png;base64,..." mediaType="image/png" />
|
|
29
|
+
* <ImageContent data="https://example.com/image.jpg" mediaType="image/jpeg" name="screenshot.jpg" />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function ImageContent({ data, mediaType: _mediaType, name, maxWidth, maxHeight, }: ImageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TextContentProps {
|
|
2
|
+
/**
|
|
3
|
+
* Text content (supports Markdown)
|
|
4
|
+
*/
|
|
5
|
+
text: string;
|
|
6
|
+
/**
|
|
7
|
+
* Whether this text is currently streaming
|
|
8
|
+
*/
|
|
9
|
+
isStreaming?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* TextContent - Render text with Markdown support
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <TextContent text="Hello **world**" />
|
|
17
|
+
* <TextContent text="Streaming..." isStreaming />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function TextContent({ text, isStreaming }: TextContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ThinkingContentProps {
|
|
2
|
+
/**
|
|
3
|
+
* AI reasoning text
|
|
4
|
+
*/
|
|
5
|
+
reasoning: string;
|
|
6
|
+
/**
|
|
7
|
+
* Token count for thinking (optional)
|
|
8
|
+
*/
|
|
9
|
+
tokenCount?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Whether this thinking is currently streaming
|
|
12
|
+
*/
|
|
13
|
+
isStreaming?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to show collapsed by default
|
|
16
|
+
*/
|
|
17
|
+
defaultCollapsed?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ThinkingContent - Render AI's extended thinking/reasoning process
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <ThinkingContent reasoning="Let me analyze this..." tokenCount={150} />
|
|
25
|
+
* <ThinkingContent reasoning="Thinking..." isStreaming />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function ThinkingContent({ reasoning, tokenCount, isStreaming, defaultCollapsed, }: ThinkingContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface ToolCallContentProps {
|
|
2
|
+
/**
|
|
3
|
+
* Unique identifier for this tool call
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Tool name
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Tool input parameters
|
|
12
|
+
*/
|
|
13
|
+
input: Record<string, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to show collapsed by default
|
|
16
|
+
*/
|
|
17
|
+
defaultCollapsed?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ToolCallContent - Render AI's tool invocation request
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <ToolCallContent
|
|
25
|
+
* id="call_123"
|
|
26
|
+
* name="get_weather"
|
|
27
|
+
* input={{ location: "San Francisco", unit: "celsius" }}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function ToolCallContent({ id, name, input, defaultCollapsed, }: ToolCallContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ToolResultOutput } from '@agentxjs/types';
|
|
2
|
+
export interface ToolResultContentProps {
|
|
3
|
+
/**
|
|
4
|
+
* Tool call ID this result corresponds to
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Tool name
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Tool execution output
|
|
13
|
+
*/
|
|
14
|
+
output: ToolResultOutput;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to show collapsed by default
|
|
17
|
+
*/
|
|
18
|
+
defaultCollapsed?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ToolResultContent - Render tool execution result
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <ToolResultContent
|
|
26
|
+
* id="call_123"
|
|
27
|
+
* name="get_weather"
|
|
28
|
+
* output={{ type: "text", value: "Temperature: 72°F" }}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function ToolResultContent({ id, name, output, defaultCollapsed, }: ToolResultContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { TextContent, type TextContentProps } from './TextContent';
|
|
2
|
+
export { ImageContent, type ImageContentProps } from './ImageContent';
|
|
3
|
+
export { FileContent, type FileContentProps } from './FileContent';
|
|
4
|
+
export { ThinkingContent, type ThinkingContentProps } from './ThinkingContent';
|
|
5
|
+
export { ToolCallContent, type ToolCallContentProps } from './ToolCallContent';
|
|
6
|
+
export { ToolResultContent, type ToolResultContentProps } from './ToolResultContent';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AgentX } from '@agentxjs/types';
|
|
2
|
+
import { SessionItem } from '../../hooks/useSession';
|
|
3
|
+
import { AgentDefinitionItem } from '../container/types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for Studio component
|
|
6
|
+
*/
|
|
7
|
+
export interface StudioProps {
|
|
8
|
+
/**
|
|
9
|
+
* AgentX instance for backend communication
|
|
10
|
+
*/
|
|
11
|
+
agentx: AgentX;
|
|
12
|
+
/**
|
|
13
|
+
* Current user ID
|
|
14
|
+
*/
|
|
15
|
+
userId: string;
|
|
16
|
+
/**
|
|
17
|
+
* User's dedicated Container ID
|
|
18
|
+
* All agent operations will use this container
|
|
19
|
+
*/
|
|
20
|
+
containerId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Available agent definitions
|
|
23
|
+
*/
|
|
24
|
+
definitions: AgentDefinitionItem[];
|
|
25
|
+
/**
|
|
26
|
+
* Optional callback when session changes
|
|
27
|
+
*/
|
|
28
|
+
onSessionChange?: (session: SessionItem | null) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Optional callback when definition changes
|
|
31
|
+
*/
|
|
32
|
+
onDefinitionChange?: (definition: AgentDefinitionItem | null) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Optional custom className
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Studio - Integration layer component
|
|
40
|
+
*
|
|
41
|
+
* Integrates:
|
|
42
|
+
* - useSession for session management (maps to agentx.sessions)
|
|
43
|
+
* - useAgent for agent state (maps to agentx.agents)
|
|
44
|
+
* - ContainerView layout components
|
|
45
|
+
*/
|
|
46
|
+
export declare function Studio({ agentx, userId, containerId, definitions, onSessionChange, onDefinitionChange, className, }: StudioProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export default Studio;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio - Integration layer for multi-agent chat UI
|
|
3
|
+
*
|
|
4
|
+
* Studio is the frontend-specific concept that integrates:
|
|
5
|
+
* - useSession (maps to agentx.sessions)
|
|
6
|
+
* - useAgent (maps to agentx.agents)
|
|
7
|
+
* - ContainerView (pure UI layout)
|
|
8
|
+
*/
|
|
9
|
+
export { Studio, type StudioProps } from './Studio';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface DiffViewerProps {
|
|
2
|
+
/**
|
|
3
|
+
* Diff content in unified diff format
|
|
4
|
+
*/
|
|
5
|
+
diff: string;
|
|
6
|
+
/**
|
|
7
|
+
* Optional file name (currently unused, for future enhancement)
|
|
8
|
+
*/
|
|
9
|
+
fileName?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Enable mobile-friendly text wrapping
|
|
12
|
+
*/
|
|
13
|
+
isMobile?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Force text wrapping
|
|
16
|
+
*/
|
|
17
|
+
wrapText?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Additional CSS classes
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* DiffViewer - Display code diff with syntax highlighting
|
|
25
|
+
*
|
|
26
|
+
* Single Responsibility: Render diff content with color-coded additions/deletions
|
|
27
|
+
*
|
|
28
|
+
* Color coding:
|
|
29
|
+
* - Green: Additions (+)
|
|
30
|
+
* - Red: Deletions (-)
|
|
31
|
+
* - Blue: Headers (@@)
|
|
32
|
+
* - Gray: Context lines
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <DiffViewer
|
|
37
|
+
* diff="+ console.log('added');\n- console.log('removed');"
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function DiffViewer({ diff, fileName: _fileName, isMobile, wrapText, className, }: DiffViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface JSONRendererProps {
|
|
2
|
+
/**
|
|
3
|
+
* JSON string to parse and display
|
|
4
|
+
*/
|
|
5
|
+
content: string;
|
|
6
|
+
/**
|
|
7
|
+
* Additional CSS classes
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* JSONRenderer - Format and display JSON content
|
|
13
|
+
*
|
|
14
|
+
* Single Responsibility: Parse JSON string and render formatted output
|
|
15
|
+
*
|
|
16
|
+
* Returns null if content is not valid JSON
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <JSONRenderer content='{"name": "Agent", "version": "1.0"}' />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function JSONRenderer({ content, className }: JSONRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface MarkdownTextProps {
|
|
2
|
+
/**
|
|
3
|
+
* Markdown content to render
|
|
4
|
+
*/
|
|
5
|
+
children: string;
|
|
6
|
+
/**
|
|
7
|
+
* Additional CSS classes
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* MarkdownText - Renders markdown content with syntax highlighting and custom styling
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <MarkdownText>
|
|
17
|
+
* # Hello World
|
|
18
|
+
* This is **bold** and this is `code`
|
|
19
|
+
* </MarkdownText>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const MarkdownText: {
|
|
23
|
+
({ children, className }: MarkdownTextProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|