@agentxjs/ui 0.0.9 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/api/index.d.ts +2 -3
  2. package/dist/browser-Bab_T5G7.js +39 -0
  3. package/dist/browser-Bab_T5G7.js.map +1 -0
  4. package/dist/components/container/AgentList.d.ts +45 -0
  5. package/dist/components/container/Chat.d.ts +47 -0
  6. package/dist/components/container/ChatHeader.d.ts +41 -0
  7. package/dist/components/container/ToolCard.d.ts +69 -0
  8. package/dist/components/container/index.d.ts +24 -19
  9. package/dist/components/{message → container/message}/MessageList.d.ts +1 -1
  10. package/dist/components/{message → container/message}/index.d.ts +0 -1
  11. package/dist/components/{message → container/message}/items/AssistantMessage.d.ts +1 -1
  12. package/dist/components/{message → container/message}/items/ErrorAlert.d.ts +1 -1
  13. package/dist/components/{message → container/message}/items/ToolCallMessage.d.ts +1 -1
  14. package/dist/components/{message → container/message}/items/ToolResultMessage.d.ts +1 -1
  15. package/dist/components/{message → container/message}/items/ToolUseMessage.d.ts +1 -1
  16. package/dist/components/{message → container/message}/items/UserMessage.d.ts +1 -1
  17. package/dist/components/{message → container/message}/items/index.d.ts +0 -1
  18. package/dist/components/{message → container/message}/parts/ToolResultContent.d.ts +1 -1
  19. package/dist/components/element/Badge.d.ts +1 -1
  20. package/dist/components/element/Button.d.ts +2 -2
  21. package/dist/components/element/EmojiPicker.d.ts +64 -0
  22. package/dist/components/element/MessageAvatar.d.ts +1 -1
  23. package/dist/components/element/Toast.d.ts +71 -0
  24. package/dist/components/element/index.d.ts +4 -0
  25. package/dist/components/pane/InputPane.d.ts +74 -0
  26. package/dist/components/pane/InputToolBar.d.ts +74 -0
  27. package/dist/components/pane/ListPane.d.ts +128 -0
  28. package/dist/components/pane/MessagePane.d.ts +111 -0
  29. package/dist/components/pane/NavBar.d.ts +71 -0
  30. package/dist/components/pane/index.d.ts +32 -0
  31. package/dist/components/studio/Studio.d.ts +23 -28
  32. package/dist/components/studio/index.d.ts +13 -6
  33. package/dist/globals.css +1 -200
  34. package/dist/hooks/index.d.ts +27 -13
  35. package/dist/hooks/useAgent.d.ts +44 -13
  36. package/dist/hooks/useAgentX.d.ts +7 -6
  37. package/dist/hooks/useImages.d.ts +84 -0
  38. package/dist/index.js +21508 -61
  39. package/dist/index.js.map +1 -1
  40. package/package.json +6 -5
  41. package/dist/components/container/AgentPane.d.ts +0 -56
  42. package/dist/components/container/ContainerView.d.ts +0 -119
  43. package/dist/components/container/DefinitionPane.d.ts +0 -27
  44. package/dist/components/container/InputPane.d.ts +0 -44
  45. package/dist/components/container/InputToolBar.d.ts +0 -22
  46. package/dist/components/container/MessagePane.d.ts +0 -32
  47. package/dist/components/container/SessionPane.d.ts +0 -35
  48. package/dist/components/container/types.d.ts +0 -67
  49. package/dist/components/input/InputBox.d.ts +0 -43
  50. package/dist/components/input/index.d.ts +0 -1
  51. package/dist/components/message/StatusIndicator.d.ts +0 -28
  52. package/dist/components/message/items/SystemMessage.d.ts +0 -25
  53. package/dist/hooks/useSession.d.ts +0 -79
  54. package/dist/index-B8Ijbzyc.js +0 -27676
  55. package/dist/index-B8Ijbzyc.js.map +0 -1
  56. package/dist/index-BtOS4F-X.js +0 -3013
  57. package/dist/index-BtOS4F-X.js.map +0 -1
  58. /package/dist/components/{message → container/message}/parts/FileContent.d.ts +0 -0
  59. /package/dist/components/{message → container/message}/parts/ImageContent.d.ts +0 -0
  60. /package/dist/components/{message → container/message}/parts/TextContent.d.ts +0 -0
  61. /package/dist/components/{message → container/message}/parts/ThinkingContent.d.ts +0 -0
  62. /package/dist/components/{message → container/message}/parts/ToolCallContent.d.ts +0 -0
  63. /package/dist/components/{message → container/message}/parts/index.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentxjs/ui",
3
- "version": "0.0.9",
3
+ "version": "0.1.2",
4
4
  "description": "AgentX UI Components - React component library for building AI agent interfaces",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,6 +29,8 @@
29
29
  "README.md"
30
30
  ],
31
31
  "dependencies": {
32
+ "@emoji-mart/data": "^1.2.1",
33
+ "@emoji-mart/react": "^1.1.1",
32
34
  "allotment": "^1.20.4",
33
35
  "class-variance-authority": "^0.7.1",
34
36
  "clsx": "^2.1.1",
@@ -41,8 +43,7 @@
41
43
  "remark-gfm": "^4.0.1",
42
44
  "tailwind-merge": "^2.5.5",
43
45
  "zustand": "^5.0.2",
44
- "agentxjs": "0.0.9",
45
- "@agentxjs/types": "0.0.9"
46
+ "agentxjs": "0.1.2"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@storybook/addon-a11y": "^8.4.7",
@@ -69,8 +70,8 @@
69
70
  "vite": "^6.0.5",
70
71
  "vite-plugin-dts": "^4.3.0",
71
72
  "ws": "^8.18.0",
72
- "@agentxjs/common": "0.0.9",
73
- "@agentxjs/node-runtime": "0.0.9"
73
+ "@agentxjs/common": "0.1.0",
74
+ "@agentxjs/runtime": "0.1.2"
74
75
  },
75
76
  "peerDependencies": {
76
77
  "react": "^18.0.0",
@@ -1,56 +0,0 @@
1
- import { AgentError, AgentState, Message } from '@agentxjs/types';
2
- import { AgentDefinitionItem, SessionItem } from './types';
3
- export interface AgentPaneProps {
4
- /**
5
- * Current agent definition (for display)
6
- */
7
- definition: AgentDefinitionItem | null;
8
- /**
9
- * Current session (for display)
10
- */
11
- session: SessionItem | null;
12
- /**
13
- * Current agent ID (for display)
14
- */
15
- agentId?: string | null;
16
- /**
17
- * Messages to display
18
- */
19
- messages?: Message[];
20
- /**
21
- * Streaming message content
22
- */
23
- streaming?: string;
24
- /**
25
- * Error messages
26
- */
27
- errors?: AgentError[];
28
- /**
29
- * Agent status
30
- */
31
- status?: AgentState;
32
- /**
33
- * Loading state
34
- */
35
- isLoading?: boolean;
36
- /**
37
- * Callback to abort current request
38
- */
39
- onAbort?: () => void;
40
- /**
41
- * Callback to create a new session
42
- */
43
- onCreateSession?: () => void;
44
- /**
45
- * Custom className
46
- */
47
- className?: string;
48
- }
49
- /**
50
- * AgentPane - Agent message display area (pure presentation)
51
- *
52
- * States:
53
- * 1. isLoading + no messages → Connecting/Loading
54
- * 2. Ready → Show MessagePane (may be empty)
55
- */
56
- export declare function AgentPane({ definition, session, agentId, messages, streaming, errors, status, isLoading, onAbort, className, }: AgentPaneProps): import("react/jsx-runtime").JSX.Element;
@@ -1,119 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Message, AgentError } from '@agentxjs/types';
3
- import { AgentDefinitionItem } from './types';
4
- import { SessionItem } from '../../hooks/useSession';
5
- /**
6
- * Props for ContainerView component
7
- *
8
- * All data is passed in, no internal state management.
9
- */
10
- export interface ContainerViewProps {
11
- /**
12
- * Available agent definitions
13
- */
14
- definitions: AgentDefinitionItem[];
15
- /**
16
- * User's sessions
17
- */
18
- sessions: SessionItem[];
19
- /**
20
- * Currently selected definition
21
- */
22
- currentDefinition: AgentDefinitionItem | null;
23
- /**
24
- * Currently selected session
25
- */
26
- currentSession: SessionItem | null;
27
- /**
28
- * Messages in current conversation
29
- */
30
- messages: Message[];
31
- /**
32
- * Current streaming text (assistant response in progress)
33
- */
34
- streaming?: string;
35
- /**
36
- * Errors from agent
37
- */
38
- errors?: AgentError[];
39
- /**
40
- * Whether agent is processing
41
- */
42
- isLoading: boolean;
43
- /**
44
- * Called when user selects a definition
45
- */
46
- onSelectDefinition: (definition: AgentDefinitionItem) => void;
47
- /**
48
- * Called when user selects a session
49
- */
50
- onSelectSession: (session: SessionItem) => void;
51
- /**
52
- * Called when user wants to create a new session
53
- */
54
- onCreateSession: () => void;
55
- /**
56
- * Called when user sends a message
57
- */
58
- onSend: (text: string) => void;
59
- /**
60
- * Called when user wants to abort current response
61
- */
62
- onAbort?: () => void;
63
- /**
64
- * Called when user wants to add a definition
65
- */
66
- onAddDefinition?: () => void;
67
- /**
68
- * Called when user wants to delete a session
69
- */
70
- onDeleteSession?: (sessionId: string) => void;
71
- /**
72
- * Custom render for the entire layout
73
- * If provided, takes full control of rendering
74
- */
75
- children?: (props: ContainerViewRenderProps) => ReactNode;
76
- /**
77
- * Custom className for container
78
- */
79
- className?: string;
80
- }
81
- /**
82
- * Props passed to custom render function
83
- */
84
- export interface ContainerViewRenderProps {
85
- definitions: AgentDefinitionItem[];
86
- sessions: SessionItem[];
87
- currentDefinition: AgentDefinitionItem | null;
88
- currentSession: SessionItem | null;
89
- messages: Message[];
90
- streaming?: string;
91
- errors?: AgentError[];
92
- isLoading: boolean;
93
- onSelectDefinition: (definition: AgentDefinitionItem) => void;
94
- onSelectSession: (session: SessionItem) => void;
95
- onCreateSession: () => void;
96
- onSend: (text: string) => void;
97
- onAbort?: () => void;
98
- onAddDefinition?: () => void;
99
- onDeleteSession?: (sessionId: string) => void;
100
- }
101
- /**
102
- * ContainerView - Pure UI layout component
103
- *
104
- * Default layout (3-column):
105
- * ```
106
- * ┌──────────┬────────────┬──────────────────────────┐
107
- * │ │ │ │
108
- * │ Def.Pane │ Sess.Pane │ AgentPane │
109
- * │ (60px) │ (240px) │ │
110
- * │ │ ├──────────────────────────┤
111
- * │ │ │ InputPane │
112
- * └──────────┴────────────┴──────────────────────────┘
113
- * ```
114
- *
115
- * When `children` is provided, it acts as a render props container.
116
- */
117
- export declare function ContainerView({ definitions, sessions, currentDefinition, currentSession, messages, streaming, errors, isLoading, onSelectDefinition, onSelectSession, onCreateSession, onSend, onAbort, onAddDefinition, onDeleteSession, children, className, }: ContainerViewProps): import("react/jsx-runtime").JSX.Element;
118
- export type { AgentDefinitionItem } from './types';
119
- export type { SessionItem } from '../../hooks/useSession';
@@ -1,27 +0,0 @@
1
- import { AgentDefinitionItem } from './types';
2
- export interface DefinitionPaneProps {
3
- /**
4
- * Available agent definitions
5
- */
6
- definitions: AgentDefinitionItem[];
7
- /**
8
- * Currently selected definition
9
- */
10
- current: AgentDefinitionItem | null;
11
- /**
12
- * Callback when an agent is selected
13
- */
14
- onSelect: (definition: AgentDefinitionItem) => void;
15
- /**
16
- * Callback when settings button is clicked
17
- */
18
- onSettings?: () => void;
19
- /**
20
- * Custom className
21
- */
22
- className?: string;
23
- }
24
- /**
25
- * DefinitionPane - Agent selection for ActivityBar
26
- */
27
- export declare function DefinitionPane({ definitions, current, onSelect, onSettings, className, }: DefinitionPaneProps): import("react/jsx-runtime").JSX.Element;
@@ -1,44 +0,0 @@
1
- /**
2
- * InputPane - Business container for user input
3
- *
4
- * Expanded input area with toolbar and full-width input box.
5
- * Designed to be used inside a resizable Panel.
6
- *
7
- * @example
8
- * ```tsx
9
- * <Allotment.Pane minSize={120} maxSize={600}>
10
- * <InputPane
11
- * onSend={send}
12
- * onFileAttach={handleFiles}
13
- * disabled={isLoading}
14
- * />
15
- * </Allotment.Pane>
16
- * ```
17
- */
18
- export interface InputPaneProps {
19
- /**
20
- * Callback when user sends a message
21
- */
22
- onSend: (text: string) => void;
23
- /**
24
- * Whether input is disabled
25
- */
26
- disabled?: boolean;
27
- /**
28
- * Placeholder text
29
- */
30
- placeholder?: string;
31
- /**
32
- * Callback when user uploads files via toolbar
33
- */
34
- onFileAttach?: (files: File[]) => void;
35
- /**
36
- * Show toolbar
37
- */
38
- showToolbar?: boolean;
39
- /**
40
- * Custom className
41
- */
42
- className?: string;
43
- }
44
- export declare function InputPane({ onSend, disabled, placeholder, onFileAttach, showToolbar, className, }: InputPaneProps): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +0,0 @@
1
- /**
2
- * InputToolBar - Toolbar for input area with file upload and other tools
3
- *
4
- * Provides utility buttons for the input pane:
5
- * - File upload (read files)
6
- * - Future: Model selector, settings, etc.
7
- */
8
- export interface InputToolBarProps {
9
- /**
10
- * Callback when user uploads files
11
- */
12
- onFileAttach?: (files: File[]) => void;
13
- /**
14
- * Whether the toolbar is disabled
15
- */
16
- disabled?: boolean;
17
- /**
18
- * Custom className
19
- */
20
- className?: string;
21
- }
22
- export declare function InputToolBar({ onFileAttach, disabled, className, }: InputToolBarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,32 +0,0 @@
1
- import { Message, AgentError, AgentState } from '@agentxjs/types';
2
- export interface MessagePaneProps {
3
- /**
4
- * Messages to display
5
- */
6
- messages: Message[];
7
- /**
8
- * Current streaming text
9
- */
10
- streaming?: string;
11
- /**
12
- * Errors to display
13
- */
14
- errors?: AgentError[];
15
- /**
16
- * Current agent state
17
- */
18
- status?: AgentState;
19
- /**
20
- * Whether agent is loading
21
- */
22
- isLoading?: boolean;
23
- /**
24
- * Callback to abort current operation
25
- */
26
- onAbort?: () => void;
27
- /**
28
- * Custom className
29
- */
30
- className?: string;
31
- }
32
- export declare function MessagePane({ messages, streaming, errors, status, isLoading, onAbort, className, }: MessagePaneProps): import("react/jsx-runtime").JSX.Element;
@@ -1,35 +0,0 @@
1
- import { SessionItem } from './types';
2
- export interface SessionPaneProps {
3
- /**
4
- * Sessions to display
5
- */
6
- sessions: SessionItem[];
7
- /**
8
- * Currently selected session
9
- */
10
- current: SessionItem | null;
11
- /**
12
- * Agent name for header display
13
- */
14
- agentName?: string;
15
- /**
16
- * Callback when a session is selected
17
- */
18
- onSelect: (session: SessionItem) => void;
19
- /**
20
- * Callback when create button is clicked
21
- */
22
- onCreate?: () => void;
23
- /**
24
- * Callback when delete is requested
25
- */
26
- onDelete?: (sessionId: string) => void;
27
- /**
28
- * Custom className
29
- */
30
- className?: string;
31
- }
32
- /**
33
- * SessionPane - Session list for Sidebar
34
- */
35
- export declare function SessionPane({ sessions, current, agentName: _agentName, onSelect, onCreate, onDelete, className, }: SessionPaneProps): import("react/jsx-runtime").JSX.Element;
@@ -1,67 +0,0 @@
1
- import { AgentDefinition } from '@agentxjs/types';
2
- /**
3
- * Session item for UI display (pure data, no methods)
4
- *
5
- * Core fields come from Session interface (Docker-style architecture).
6
- * Additional fields (preview, unreadCount) are computed/derived by UI.
7
- *
8
- * Part of Docker-style layered architecture:
9
- * Definition → build → Image → run → Agent
10
- * ↓
11
- * Session (userId + imageId)
12
- */
13
- export interface SessionItem {
14
- /**
15
- * Unique session identifier
16
- */
17
- sessionId: string;
18
- /**
19
- * Owner user ID
20
- */
21
- userId: string;
22
- /**
23
- * Associated image ID (frozen runtime snapshot)
24
- */
25
- imageId: string;
26
- /**
27
- * Display title (can be AI-generated summary)
28
- */
29
- title: string | null;
30
- /**
31
- * Session creation timestamp (Unix ms)
32
- */
33
- createdAt: number;
34
- /**
35
- * Last update timestamp (Unix ms)
36
- */
37
- updatedAt: number;
38
- /**
39
- * Preview text (last message snippet) - computed from messages
40
- */
41
- preview?: string;
42
- /**
43
- * Unread message count - computed by UI
44
- */
45
- unreadCount?: number;
46
- }
47
- /**
48
- * Extended AgentDefinition with UI metadata
49
- */
50
- export interface AgentDefinitionItem extends AgentDefinition {
51
- /**
52
- * Icon identifier or emoji
53
- */
54
- icon?: string;
55
- /**
56
- * Badge color for visual distinction
57
- */
58
- color?: string;
59
- /**
60
- * Whether this agent is online/available
61
- */
62
- isOnline?: boolean;
63
- /**
64
- * Number of active sessions
65
- */
66
- activeSessionCount?: number;
67
- }
@@ -1,43 +0,0 @@
1
- /**
2
- * InputBox - Full-height textarea with send button
3
- *
4
- * Pure UI component for text input that fills available space.
5
- *
6
- * Features:
7
- * - Full-height textarea (fills container)
8
- * - Enter to send, Shift+Enter for new line
9
- * - Send button at bottom right
10
- * - Minimal design, no borders or decorations
11
- *
12
- * @example
13
- * ```tsx
14
- * <InputBox
15
- * onSend={(text) => console.log('Send:', text)}
16
- * disabled={isLoading}
17
- * placeholder="Type a message..."
18
- * />
19
- * ```
20
- */
21
- export interface InputBoxProps {
22
- /**
23
- * Callback when user sends a message
24
- */
25
- onSend: (text: string) => void;
26
- /**
27
- * Whether the input is disabled (e.g., while AI is responding)
28
- */
29
- disabled?: boolean;
30
- /**
31
- * Placeholder text
32
- */
33
- placeholder?: string;
34
- /**
35
- * Initial value
36
- */
37
- defaultValue?: string;
38
- /**
39
- * Custom className
40
- */
41
- className?: string;
42
- }
43
- export declare function InputBox({ onSend, disabled, placeholder, defaultValue, className, }: InputBoxProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export { InputBox, type InputBoxProps } from './InputBox';
@@ -1,28 +0,0 @@
1
- import { AgentState } from '@agentxjs/types';
2
- export interface StatusIndicatorProps {
3
- /**
4
- * Current agent state
5
- */
6
- status: AgentState;
7
- /**
8
- * Whether the agent is currently processing
9
- */
10
- isLoading: boolean;
11
- /**
12
- * Callback to abort/interrupt the current operation
13
- */
14
- onAbort?: () => void;
15
- /**
16
- * Whether to show the abort button
17
- * @default true
18
- */
19
- showAbortButton?: boolean;
20
- /**
21
- * Custom className
22
- */
23
- className?: string;
24
- }
25
- /**
26
- * StatusIndicator - Displays status with animations
27
- */
28
- export declare function StatusIndicator({ status, isLoading, onAbort, showAbortButton, className, }: StatusIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,25 +0,0 @@
1
- import { SystemMessage as SystemMessageType } from '@agentxjs/types';
2
- export interface SystemMessageProps {
3
- /**
4
- * System message data
5
- */
6
- message: SystemMessageType;
7
- }
8
- /**
9
- * SystemMessage - Display a system message
10
- *
11
- * Features:
12
- * - System avatar (neutral gray)
13
- * - System prompt or notification display
14
- *
15
- * @example
16
- * ```tsx
17
- * <SystemMessage message={{
18
- * id: '0',
19
- * role: 'system',
20
- * content: 'You are a helpful assistant',
21
- * timestamp: Date.now()
22
- * }} />
23
- * ```
24
- */
25
- export declare function SystemMessage({ message }: SystemMessageProps): import("react/jsx-runtime").JSX.Element;
@@ -1,79 +0,0 @@
1
- import { AgentX } from '@agentxjs/types';
2
- import { SessionItem } from '../components/container/types';
3
- export type { SessionItem } from '../components/container/types';
4
- /**
5
- * Return type of useSession hook
6
- */
7
- export interface UseSessionResult {
8
- /**
9
- * All sessions for the current user
10
- */
11
- sessions: SessionItem[];
12
- /**
13
- * Currently selected session
14
- */
15
- currentSession: SessionItem | null;
16
- /**
17
- * Select a session
18
- */
19
- selectSession: (session: SessionItem | null) => void;
20
- /**
21
- * Create a new session (does NOT auto-select)
22
- *
23
- * After creating, caller should explicitly handle agent creation
24
- * and then call selectSession() when ready.
25
- *
26
- * @param imageId - Image to create session from
27
- * @param title - Optional session title
28
- */
29
- createSession: (imageId: string, title?: string) => Promise<SessionItem>;
30
- /**
31
- * Delete a session
32
- */
33
- deleteSession: (sessionId: string) => Promise<void>;
34
- /**
35
- * Update session title
36
- */
37
- setSessionTitle: (sessionId: string, title: string) => Promise<void>;
38
- /**
39
- * Refresh sessions from server
40
- */
41
- refresh: () => Promise<void>;
42
- /**
43
- * Loading state
44
- */
45
- isLoading: boolean;
46
- /**
47
- * Error state
48
- */
49
- error: Error | null;
50
- }
51
- /**
52
- * Options for useSession hook
53
- */
54
- export interface UseSessionOptions {
55
- /**
56
- * Auto-load sessions on mount
57
- * @default true
58
- */
59
- autoLoad?: boolean;
60
- /**
61
- * Callback when session selection changes
62
- */
63
- onSessionChange?: (session: SessionItem | null) => void;
64
- /**
65
- * Callback when sessions list changes
66
- */
67
- onSessionsChange?: (sessions: SessionItem[]) => void;
68
- }
69
- /**
70
- * React hook for session management
71
- *
72
- * Maps to agentx.sessions API.
73
- *
74
- * @param agentx - AgentX instance
75
- * @param userId - Current user ID
76
- * @param options - Optional configuration
77
- * @returns Session state and operations
78
- */
79
- export declare function useSession(agentx: AgentX | null, userId: string, options?: UseSessionOptions): UseSessionResult;