@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
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { x, s, y, A, z, h, B, G, C, D, a1, J, E, F, H, K, n, N, r, I, d, a2, O, Q, t, a3, V, f, M, W, P, X, R, Y, Z, S, v, w, g, e, j, _, m, o, $, a0, p, T, q, k, l, U, a6, a7, a4, a5, a8, u, a, b } from "./index-CyXGvO5F.js";
|
|
2
|
+
export {
|
|
3
|
+
x as ActionBar,
|
|
4
|
+
s as ActivityBar,
|
|
5
|
+
y as AgentLogo,
|
|
6
|
+
A as AgentPane,
|
|
7
|
+
z as AppHeader,
|
|
8
|
+
h as AssistantMessage,
|
|
9
|
+
B as Badge,
|
|
10
|
+
G as Button,
|
|
11
|
+
C as ContainerView,
|
|
12
|
+
D as DefinitionPane,
|
|
13
|
+
a1 as DiffViewer,
|
|
14
|
+
J as EmptyState,
|
|
15
|
+
E as ErrorAlert,
|
|
16
|
+
F as FileContent,
|
|
17
|
+
H as Header,
|
|
18
|
+
K as ImageAttachment,
|
|
19
|
+
n as ImageContent,
|
|
20
|
+
N as Input,
|
|
21
|
+
r as InputBox,
|
|
22
|
+
I as InputPane,
|
|
23
|
+
d as InputToolBar,
|
|
24
|
+
a2 as JSONRenderer,
|
|
25
|
+
O as ListItem,
|
|
26
|
+
Q as LoadingState,
|
|
27
|
+
t as MainContent,
|
|
28
|
+
a3 as MarkdownText,
|
|
29
|
+
V as MessageAvatar,
|
|
30
|
+
f as MessageList,
|
|
31
|
+
M as MessagePane,
|
|
32
|
+
W as PageHeader,
|
|
33
|
+
P as Panel,
|
|
34
|
+
X as Popover,
|
|
35
|
+
R as RightSidebar,
|
|
36
|
+
Y as ScrollArea,
|
|
37
|
+
Z as SearchInput,
|
|
38
|
+
S as SessionPane,
|
|
39
|
+
v as Sidebar,
|
|
40
|
+
w as StatusBar,
|
|
41
|
+
g as StatusIndicator,
|
|
42
|
+
e as Studio,
|
|
43
|
+
j as SystemMessage,
|
|
44
|
+
_ as TabNavigation,
|
|
45
|
+
m as TextContent,
|
|
46
|
+
o as ThinkingContent,
|
|
47
|
+
$ as TimeAgo,
|
|
48
|
+
a0 as TokenUsagePie,
|
|
49
|
+
p as ToolCallContent,
|
|
50
|
+
T as ToolCallMessage,
|
|
51
|
+
q as ToolResultContent,
|
|
52
|
+
k as ToolResultMessage,
|
|
53
|
+
l as ToolUseMessage,
|
|
54
|
+
U as UserMessage,
|
|
55
|
+
a6 as cn,
|
|
56
|
+
a7 as decodeHtmlEntities,
|
|
57
|
+
a4 as eventBus,
|
|
58
|
+
a5 as formatTimeAgo,
|
|
59
|
+
a8 as formatUsageLimitText,
|
|
60
|
+
u as useAgent,
|
|
61
|
+
a as useAgentX,
|
|
62
|
+
b as useSession
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBus - Lightweight event system using mitt
|
|
3
|
+
* Replaces heavy RxJS dependency with a simple, type-safe event emitter
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Application Events
|
|
7
|
+
* Define all possible events with their payload types
|
|
8
|
+
*/
|
|
9
|
+
export type AppEvents = {
|
|
10
|
+
"session:created": {
|
|
11
|
+
sessionId: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
};
|
|
14
|
+
"session:selected": {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
};
|
|
17
|
+
"session:deleted": {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
};
|
|
20
|
+
"session:updated": {
|
|
21
|
+
sessionId: string;
|
|
22
|
+
updates: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
"message:received": {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
content: string;
|
|
27
|
+
role: string;
|
|
28
|
+
};
|
|
29
|
+
"message:sent": {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
content: string;
|
|
32
|
+
};
|
|
33
|
+
"message:streaming": {
|
|
34
|
+
sessionId: string;
|
|
35
|
+
delta: string;
|
|
36
|
+
};
|
|
37
|
+
"notification:show": {
|
|
38
|
+
message: string;
|
|
39
|
+
type: "success" | "error" | "info";
|
|
40
|
+
};
|
|
41
|
+
"notification:hide": {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
error: {
|
|
45
|
+
error: Error;
|
|
46
|
+
context?: string;
|
|
47
|
+
};
|
|
48
|
+
"loading:start": {
|
|
49
|
+
source: string;
|
|
50
|
+
};
|
|
51
|
+
"loading:end": {
|
|
52
|
+
source: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* EventBus class wrapper
|
|
57
|
+
* Provides debugging and convenience methods
|
|
58
|
+
*/
|
|
59
|
+
declare class EventBus {
|
|
60
|
+
private emitter;
|
|
61
|
+
private debugMode;
|
|
62
|
+
constructor();
|
|
63
|
+
/**
|
|
64
|
+
* Emit an event
|
|
65
|
+
*/
|
|
66
|
+
emit<K extends keyof AppEvents>(type: K, data: AppEvents[K]): void;
|
|
67
|
+
/**
|
|
68
|
+
* Subscribe to an event
|
|
69
|
+
*/
|
|
70
|
+
on<K extends keyof AppEvents>(type: K, handler: (data: AppEvents[K]) => void): void;
|
|
71
|
+
/**
|
|
72
|
+
* Unsubscribe from an event
|
|
73
|
+
*/
|
|
74
|
+
off<K extends keyof AppEvents>(type: K, handler: (data: AppEvents[K]) => void): void;
|
|
75
|
+
/**
|
|
76
|
+
* Subscribe to all events (use sparingly)
|
|
77
|
+
*/
|
|
78
|
+
onAll(handler: (type: keyof AppEvents, data: unknown) => void): void;
|
|
79
|
+
/**
|
|
80
|
+
* Clear all event handlers
|
|
81
|
+
*/
|
|
82
|
+
clear(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Enable debug logging
|
|
85
|
+
*/
|
|
86
|
+
enableDebug(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Disable debug logging
|
|
89
|
+
*/
|
|
90
|
+
disableDebug(): void;
|
|
91
|
+
}
|
|
92
|
+
export declare const eventBus: EventBus;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a date as relative time (e.g., "Just now", "5 mins ago", "2 hours ago")
|
|
3
|
+
*
|
|
4
|
+
* @param dateString - ISO date string or Date object
|
|
5
|
+
* @param currentTime - Current time for comparison (defaults to now)
|
|
6
|
+
* @returns Formatted relative time string
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* formatTimeAgo("2025-01-14T10:30:00Z") // "5 mins ago"
|
|
11
|
+
* formatTimeAgo(new Date()) // "Just now"
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatTimeAgo(dateString: string | Date, currentTime?: Date): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* Merge Tailwind CSS classes with conflict resolution
|
|
4
|
+
*/
|
|
5
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
6
|
+
/**
|
|
7
|
+
* Decode HTML entities in text
|
|
8
|
+
*/
|
|
9
|
+
export declare function decodeHtmlEntities(text: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format "Agent AI usage limit reached|<epoch>" into a local time string
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatUsageLimitText(text: string): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentxjs/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "AgentX UI Components - React component library for building AI agent interfaces",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/src/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./globals.css": "./dist/globals.css"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"*.css",
|
|
19
|
+
"*.scss"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"allotment": "^1.20.4",
|
|
27
|
+
"class-variance-authority": "^0.7.1",
|
|
28
|
+
"clsx": "^2.1.1",
|
|
29
|
+
"framer-motion": "^12.23.25",
|
|
30
|
+
"lucide-react": "^0.460.0",
|
|
31
|
+
"mitt": "^3.0.1",
|
|
32
|
+
"react": "^18.3.1",
|
|
33
|
+
"react-dom": "^18.3.1",
|
|
34
|
+
"react-markdown": "^10.1.0",
|
|
35
|
+
"remark-gfm": "^4.0.1",
|
|
36
|
+
"tailwind-merge": "^2.5.5",
|
|
37
|
+
"zustand": "^5.0.2",
|
|
38
|
+
"agentxjs": "0.0.1",
|
|
39
|
+
"@agentxjs/types": "0.0.1",
|
|
40
|
+
"@agentxjs/common": "0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@storybook/addon-a11y": "^8.4.7",
|
|
44
|
+
"@storybook/addon-essentials": "^8.4.7",
|
|
45
|
+
"@storybook/addon-interactions": "^8.4.7",
|
|
46
|
+
"@storybook/addon-links": "^8.4.7",
|
|
47
|
+
"@storybook/react": "^8.4.7",
|
|
48
|
+
"@storybook/react-vite": "^8.4.7",
|
|
49
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
50
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
51
|
+
"@types/node": "^24.9.2",
|
|
52
|
+
"@types/react": "^18.3.12",
|
|
53
|
+
"@types/react-dom": "^18.3.1",
|
|
54
|
+
"@types/ws": "^8.5.13",
|
|
55
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
56
|
+
"autoprefixer": "^10.4.20",
|
|
57
|
+
"concurrently": "^9.1.0",
|
|
58
|
+
"dotenv": "^16.6.1",
|
|
59
|
+
"postcss": "^8.4.49",
|
|
60
|
+
"storybook": "^8.4.7",
|
|
61
|
+
"tailwindcss": "^4.1.17",
|
|
62
|
+
"tsx": "^4.19.2",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"vite": "^6.0.5",
|
|
65
|
+
"vite-plugin-dts": "^4.3.0",
|
|
66
|
+
"ws": "^8.18.0",
|
|
67
|
+
"@agentxjs/node-runtime": "0.0.1"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"react": "^18.0.0",
|
|
71
|
+
"react-dom": "^18.0.0"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"dev": "vite",
|
|
78
|
+
"dev:server": "tsx --watch dev-tools/server/dev-server.ts",
|
|
79
|
+
"dev:full": "concurrently \"pnpm dev:server\" \"storybook dev -p 6007\"",
|
|
80
|
+
"build": "tsc && vite build",
|
|
81
|
+
"lint": "eslint .",
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
|
+
"preview": "vite preview",
|
|
84
|
+
"storybook": "storybook dev -p 6006",
|
|
85
|
+
"build-storybook": "storybook build"
|
|
86
|
+
}
|
|
87
|
+
}
|