@wayofmono/wo-web-ui 1.0.0 → 1.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/dist/components/chat-container.d.ts +14 -0
- package/dist/components/chat-container.d.ts.map +1 -0
- package/dist/components/chat-container.js +71 -0
- package/dist/components/chat-container.js.map +1 -0
- package/dist/components/chat-input.d.ts +14 -0
- package/dist/components/chat-input.d.ts.map +1 -0
- package/dist/components/chat-input.js +52 -0
- package/dist/components/chat-input.js.map +1 -0
- package/dist/components/message-bubble.d.ts +12 -0
- package/dist/components/message-bubble.d.ts.map +1 -0
- package/dist/components/message-bubble.js +27 -0
- package/dist/components/message-bubble.js.map +1 -0
- package/dist/components/session-list.d.ts +17 -0
- package/dist/components/session-list.d.ts.map +1 -0
- package/dist/components/session-list.js +69 -0
- package/dist/components/session-list.js.map +1 -0
- package/dist/components/tool-call-card.d.ts +15 -0
- package/dist/components/tool-call-card.d.ts.map +1 -0
- package/dist/components/tool-call-card.js +49 -0
- package/dist/components/tool-call-card.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/theme.d.ts +6 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +30 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChatMessage, SessionInfo } from "../types.js";
|
|
2
|
+
export interface ChatContainerProps {
|
|
3
|
+
messages: ChatMessage[];
|
|
4
|
+
sessions?: SessionInfo[];
|
|
5
|
+
activeSessionId?: string;
|
|
6
|
+
onSend: (text: string) => void;
|
|
7
|
+
onSelectSession?: (id: string) => void;
|
|
8
|
+
onCreateSession?: () => void;
|
|
9
|
+
themeMode?: "dark" | "light";
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function ChatContainer({ messages, sessions, activeSessionId, onSend, onSelectSession, onCreateSession, themeMode, disabled, }: ChatContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default ChatContainer;
|
|
14
|
+
//# sourceMappingURL=chat-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-container.d.ts","sourceRoot":"","sources":["../../src/components/chat-container.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO5D,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAoCD,wBAAgB,aAAa,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,MAAM,EACN,eAAe,EACf,eAAe,EACf,SAAkB,EAClB,QAAQ,GACR,EAAE,kBAAkB,2CAwEpB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { getTheme } from "../theme.js";
|
|
4
|
+
import { MessageBubble } from "./message-bubble.js";
|
|
5
|
+
import { ChatInput } from "./chat-input.js";
|
|
6
|
+
import { SessionList } from "./session-list.js";
|
|
7
|
+
import { ToolCallCard } from "./tool-call-card.js";
|
|
8
|
+
const containerStyle = (theme) => ({
|
|
9
|
+
display: "flex",
|
|
10
|
+
height: "100%",
|
|
11
|
+
backgroundColor: theme.background,
|
|
12
|
+
color: theme.text,
|
|
13
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
14
|
+
});
|
|
15
|
+
const mainStyle = {
|
|
16
|
+
flex: 1,
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
};
|
|
21
|
+
const messagesStyle = {
|
|
22
|
+
flex: 1,
|
|
23
|
+
overflowY: "auto",
|
|
24
|
+
padding: "16px",
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: "12px",
|
|
28
|
+
};
|
|
29
|
+
const emptyStyle = {
|
|
30
|
+
flex: 1,
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
color: "var(--text-secondary, #94a3b8)",
|
|
35
|
+
fontSize: "14px",
|
|
36
|
+
};
|
|
37
|
+
export function ChatContainer({ messages, sessions, activeSessionId, onSend, onSelectSession, onCreateSession, themeMode = "dark", disabled, }) {
|
|
38
|
+
const bottomRef = useRef(null);
|
|
39
|
+
const theme = getTheme(themeMode);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
bottomRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
42
|
+
}, [messages]);
|
|
43
|
+
const bubbleTheme = {
|
|
44
|
+
userBubble: theme.userBubble,
|
|
45
|
+
assistantBubble: theme.assistantBubble,
|
|
46
|
+
text: theme.text,
|
|
47
|
+
};
|
|
48
|
+
const inputTheme = {
|
|
49
|
+
surface: theme.surface,
|
|
50
|
+
text: theme.text,
|
|
51
|
+
border: theme.border,
|
|
52
|
+
primary: theme.primary,
|
|
53
|
+
};
|
|
54
|
+
const toolCardTheme = {
|
|
55
|
+
surface: theme.surface,
|
|
56
|
+
text: theme.text,
|
|
57
|
+
textSecondary: theme.textSecondary,
|
|
58
|
+
border: theme.border,
|
|
59
|
+
success: theme.success,
|
|
60
|
+
error: theme.error,
|
|
61
|
+
};
|
|
62
|
+
return (_jsxs("div", { style: containerStyle(theme), children: [sessions && onSelectSession && onCreateSession && (_jsx(SessionList, { sessions: sessions, activeId: activeSessionId, onSelect: onSelectSession, onCreate: onCreateSession, theme: {
|
|
63
|
+
surface: theme.surface,
|
|
64
|
+
text: theme.text,
|
|
65
|
+
textSecondary: theme.textSecondary,
|
|
66
|
+
border: theme.border,
|
|
67
|
+
primary: theme.primary,
|
|
68
|
+
} })), _jsxs("div", { style: mainStyle, children: [_jsxs("div", { style: messagesStyle, children: [messages.length === 0 && (_jsx("div", { style: emptyStyle, children: "Start a conversation" })), messages.map((msg) => (_jsxs("div", { children: [_jsx(MessageBubble, { message: msg, theme: bubbleTheme }), msg.toolCalls?.map((tc) => (_jsx("div", { style: { marginTop: "8px" }, children: _jsx(ToolCallCard, { toolCall: tc, theme: toolCardTheme }) }, tc.id)))] }, msg.id))), _jsx("div", { ref: bottomRef })] }), _jsx(ChatInput, { onSend: onSend, disabled: disabled, theme: inputTheme })] })] }));
|
|
69
|
+
}
|
|
70
|
+
export default ChatContainer;
|
|
71
|
+
//# sourceMappingURL=chat-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-container.js","sourceRoot":"","sources":["../../src/components/chat-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAoB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE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EAAE,WAAW,GAAI,EAClD,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAC3B,cAAiB,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,YAC3C,KAAC,YAAY,IAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,GAAI,IAD3C,EAAE,CAAC,EAAE,CAET,CACN,CAAC,KANO,GAAG,CAAC,EAAE,CAOV,CACN,CAAC,EACF,cAAK,GAAG,EAAE,SAAS,GAAI,IAClB,EACN,KAAC,SAAS,IACT,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,UAAU,GAChB,IACG,IACD,CACN,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ChatInputProps {
|
|
2
|
+
onSend: (text: string) => void;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
theme: {
|
|
6
|
+
surface: string;
|
|
7
|
+
text: string;
|
|
8
|
+
border: string;
|
|
9
|
+
primary: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function ChatInput({ onSend, disabled, placeholder, theme }: ChatInputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default ChatInput;
|
|
14
|
+
//# sourceMappingURL=chat-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../src/components/chat-input.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF;AAsCD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,cAAc,2CAsCjF;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
const containerStyle = {
|
|
4
|
+
display: "flex",
|
|
5
|
+
gap: "8px",
|
|
6
|
+
padding: "12px",
|
|
7
|
+
borderTop: "1px solid var(--border, #e2e8f0)",
|
|
8
|
+
};
|
|
9
|
+
const textareaStyle = (theme) => ({
|
|
10
|
+
flex: 1,
|
|
11
|
+
backgroundColor: theme.surface,
|
|
12
|
+
color: theme.text,
|
|
13
|
+
border: `1px solid ${theme.border}`,
|
|
14
|
+
borderRadius: "8px",
|
|
15
|
+
padding: "10px 14px",
|
|
16
|
+
fontSize: "14px",
|
|
17
|
+
fontFamily: "inherit",
|
|
18
|
+
resize: "none",
|
|
19
|
+
outline: "none",
|
|
20
|
+
minHeight: "42px",
|
|
21
|
+
maxHeight: "200px",
|
|
22
|
+
lineHeight: "1.4",
|
|
23
|
+
});
|
|
24
|
+
const buttonStyle = (theme) => ({
|
|
25
|
+
backgroundColor: theme.primary,
|
|
26
|
+
color: "#fff",
|
|
27
|
+
border: "none",
|
|
28
|
+
borderRadius: "8px",
|
|
29
|
+
padding: "8px 16px",
|
|
30
|
+
fontSize: "14px",
|
|
31
|
+
cursor: "pointer",
|
|
32
|
+
alignSelf: "flex-end",
|
|
33
|
+
});
|
|
34
|
+
export function ChatInput({ onSend, disabled, placeholder, theme }) {
|
|
35
|
+
const [text, setText] = useState("");
|
|
36
|
+
const handleSend = () => {
|
|
37
|
+
const trimmed = text.trim();
|
|
38
|
+
if (!trimmed || disabled)
|
|
39
|
+
return;
|
|
40
|
+
onSend(trimmed);
|
|
41
|
+
setText("");
|
|
42
|
+
};
|
|
43
|
+
const handleKeyDown = (e) => {
|
|
44
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
handleSend();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return (_jsxs("div", { style: containerStyle, children: [_jsx("textarea", { value: text, onChange: (e) => setText(e.target.value), onKeyDown: handleKeyDown, style: textareaStyle(theme), placeholder: placeholder ?? "Type a message...", disabled: disabled, rows: 1 }), _jsx("button", { type: "button", onClick: handleSend, disabled: disabled || !text.trim(), style: buttonStyle(theme), children: "Send" })] }));
|
|
50
|
+
}
|
|
51
|
+
export default ChatInput;
|
|
52
|
+
//# sourceMappingURL=chat-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-input.js","sourceRoot":"","sources":["../../src/components/chat-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAcrD,MAAM,cAAc,GAAwB;IAC3C,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,MAAM;IACf,SAAS,EAAE,kCAAkC;CAC7C,CAAC;AAEF,MAAM,aAAa,GAAG,CACrB,KAA8B,EACR,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC;IACP,eAAe,EAAE,KAAK,CAAC,OAAO;IAC9B,KAAK,EAAE,KAAK,CAAC,IAAI;IACjB,MAAM,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;IACnC,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,KAAK;CACjB,CAAC,CAAC;AAEH,MAAM,W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,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAClC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,qBAGjB,IACJ,CACN,CAAC;AACH,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChatMessage } from "../types.js";
|
|
2
|
+
export interface MessageBubbleProps {
|
|
3
|
+
message: ChatMessage;
|
|
4
|
+
theme: {
|
|
5
|
+
userBubble: string;
|
|
6
|
+
assistantBubble: string;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function MessageBubble({ message, theme }: MessageBubbleProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default MessageBubble;
|
|
12
|
+
//# sourceMappingURL=message-bubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-bubble.d.ts","sourceRoot":"","sources":["../../src/components/message-bubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAyBD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,kBAAkB,2CAOnE;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const bubbleStyle = (role, theme) => ({
|
|
3
|
+
alignSelf: role === "user" ? "flex-end" : "flex-start",
|
|
4
|
+
backgroundColor: role === "user" ? theme.userBubble : theme.assistantBubble,
|
|
5
|
+
color: theme.text,
|
|
6
|
+
borderRadius: "12px",
|
|
7
|
+
padding: "8px 14px",
|
|
8
|
+
maxWidth: "80%",
|
|
9
|
+
wordBreak: "break-word",
|
|
10
|
+
whiteSpace: "pre-wrap",
|
|
11
|
+
fontSize: "14px",
|
|
12
|
+
lineHeight: "1.5",
|
|
13
|
+
});
|
|
14
|
+
const streamingStyle = {
|
|
15
|
+
display: "inline-block",
|
|
16
|
+
width: "8px",
|
|
17
|
+
height: "16px",
|
|
18
|
+
backgroundColor: "currentColor",
|
|
19
|
+
animation: "wo-blink 1s step-end infinite",
|
|
20
|
+
marginLeft: "2px",
|
|
21
|
+
opacity: 0.7,
|
|
22
|
+
};
|
|
23
|
+
export function MessageBubble({ message, theme }) {
|
|
24
|
+
return (_jsxs("div", { style: bubbleStyle(message.role, theme), children: [message.content, message.streaming && _jsx("span", { style: streamingStyle })] }, message.id));
|
|
25
|
+
}
|
|
26
|
+
export default MessageBubble;
|
|
27
|
+
//# sourceMappingURL=message-bubble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-bubble.js","sourceRoot":"","sources":["../../src/components/message-bubble.tsx"],"names":[],"mappings":";AAWA,MAAM,WAAW,GAAG,CAAC,IAAyB,EAAE,KAAkC,EAAuB,EAAE,CAAC,CAAC;IAC5G,SAAS,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;IACtD,eAAe,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe;IAC3E,KAAK,EAAE,KAAK,CAAC,IAAI;IACjB,YAAY,EAAE,MAAM;IACpB,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,KAAK;CACjB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAwB;IAC3C,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM;IACd,eAAe,EAAE,cAAc;IAC/B,SAAS,EAAE,+BAA+B;IAC1C,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,GAAG;CACZ,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAsB;IACnE,OAAO,CACN,eAAsB,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,aAC3D,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,SAAS,IAAI,eAAM,KAAK,EAAE,cAAc,GAAI,KAF5C,OAAO,CAAC,EAAE,CAGd,CACN,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SessionInfo } from "../types.js";
|
|
2
|
+
export interface SessionListProps {
|
|
3
|
+
sessions: SessionInfo[];
|
|
4
|
+
activeId?: string;
|
|
5
|
+
onSelect: (id: string) => void;
|
|
6
|
+
onCreate: () => void;
|
|
7
|
+
theme: {
|
|
8
|
+
surface: string;
|
|
9
|
+
text: string;
|
|
10
|
+
textSecondary: string;
|
|
11
|
+
border: string;
|
|
12
|
+
primary: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function SessionList({ sessions, activeId, onSelect, onCreate, theme }: SessionListProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default SessionList;
|
|
17
|
+
//# sourceMappingURL=session-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-list.d.ts","sourceRoot":"","sources":["../../src/components/session-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF;AAsED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,gBAAgB,2CAyB9F;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const sidebarStyle = (theme) => ({
|
|
3
|
+
width: "260px",
|
|
4
|
+
backgroundColor: theme.surface,
|
|
5
|
+
borderRight: `1px solid ${theme.border}`,
|
|
6
|
+
display: "flex",
|
|
7
|
+
flexDirection: "column",
|
|
8
|
+
height: "100%",
|
|
9
|
+
});
|
|
10
|
+
const headerStyle = {
|
|
11
|
+
padding: "16px",
|
|
12
|
+
fontSize: "16px",
|
|
13
|
+
fontWeight: 600,
|
|
14
|
+
display: "flex",
|
|
15
|
+
justifyContent: "space-between",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
};
|
|
18
|
+
const createButtonStyle = (theme) => ({
|
|
19
|
+
backgroundColor: theme.primary,
|
|
20
|
+
color: "#fff",
|
|
21
|
+
border: "none",
|
|
22
|
+
borderRadius: "6px",
|
|
23
|
+
padding: "4px 10px",
|
|
24
|
+
fontSize: "12px",
|
|
25
|
+
cursor: "pointer",
|
|
26
|
+
});
|
|
27
|
+
const listStyle = {
|
|
28
|
+
flex: 1,
|
|
29
|
+
overflowY: "auto",
|
|
30
|
+
padding: "4px 8px",
|
|
31
|
+
};
|
|
32
|
+
function itemStyle(isActive, theme) {
|
|
33
|
+
return {
|
|
34
|
+
padding: "10px 12px",
|
|
35
|
+
borderRadius: "6px",
|
|
36
|
+
cursor: "pointer",
|
|
37
|
+
backgroundColor: isActive ? theme.primary + "20" : "transparent",
|
|
38
|
+
marginBottom: "2px",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const labelStyle = {
|
|
42
|
+
fontSize: "14px",
|
|
43
|
+
fontWeight: 500,
|
|
44
|
+
overflow: "hidden",
|
|
45
|
+
textOverflow: "ellipsis",
|
|
46
|
+
whiteSpace: "nowrap",
|
|
47
|
+
};
|
|
48
|
+
const metaStyle = (theme) => ({
|
|
49
|
+
fontSize: "11px",
|
|
50
|
+
color: theme.textSecondary,
|
|
51
|
+
marginTop: "2px",
|
|
52
|
+
});
|
|
53
|
+
function formatTime(ts) {
|
|
54
|
+
const d = new Date(ts);
|
|
55
|
+
const now = new Date();
|
|
56
|
+
const diff = now.getTime() - d.getTime();
|
|
57
|
+
if (diff < 60000)
|
|
58
|
+
return "just now";
|
|
59
|
+
if (diff < 3600000)
|
|
60
|
+
return `${Math.floor(diff / 60000)}m ago`;
|
|
61
|
+
if (diff < 86400000)
|
|
62
|
+
return `${Math.floor(diff / 3600000)}h ago`;
|
|
63
|
+
return d.toLocaleDateString();
|
|
64
|
+
}
|
|
65
|
+
export function SessionList({ sessions, activeId, onSelect, onCreate, theme }) {
|
|
66
|
+
return (_jsxs("div", { style: sidebarStyle(theme), children: [_jsxs("div", { style: headerStyle, children: [_jsx("span", { children: "Sessions" }), _jsx("button", { type: "button", style: createButtonStyle(theme), onClick: onCreate, children: "+ New" })] }), _jsx("div", { style: listStyle, children: sessions.map((s) => (_jsxs("div", { style: itemStyle(s.id === activeId, theme), onClick: () => onSelect(s.id), children: [_jsx("div", { style: labelStyle, children: s.label }), _jsxs("div", { style: metaStyle(theme), children: [formatTime(s.updatedAt), " \u00B7 ", s.messageCount, " msgs"] })] }, s.id))) })] }));
|
|
67
|
+
}
|
|
68
|
+
export default SessionList;
|
|
69
|
+
//# sourceMappingURL=session-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-list.js","sourceRoot":"","sources":["../../src/components/session-list.tsx"],"names":[],"mappings":";AAgBA,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAuB,EAAE,CAAC,CAAC;IAChF,KAAK,EAAE,OAAO;IACd,eAAe,EAAE,KAAK,CAAC,OAAO;IAC9B,WAAW,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;IACxC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,MAAM,EAAE,MAAM;CACd,CAAC,CAAC;AAEH,MAAM,WAAW,GAAwB;IACxC,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,GAAG;IACf,OAAO,EAAE,MAAM;IACf,cAAc,EAAE,eAAe;IAC/B,UAAU,EAAE,QAAQ;CACpB,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAgC,EAAuB,EAAE,CAAC,CAAC;IACrF,eAAe,EAAE,KAAK,CAAC,OAAO;IAC9B,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,SAAS;CACjB,CAAC,CAAC;AAEH,MAAM,SAAS,GAAwB;IACtC,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,MAAM;IACjB,OAAO,EAAE,SAAS;CAClB,CAAC;AAEF,SAAS,SAAS,CAAC,QAAiB,EAAE,KAAgC;IACrE,OAAO;QACN,OAAO,EAAE,WAAW;QACpB,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,SAAS;QACjB,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,aAAa;QAChE,YAAY,EAAE,KA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,EACN,cAAK,KAAK,EAAE,SAAS,YACnB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACpB,eAEC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,EAAE,KAAK,CAAC,EAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,aAE7B,cAAK,KAAK,EAAE,UAAU,YAAG,CAAC,CAAC,KAAK,GAAO,EACvC,eAAK,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,aAC1B,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,cAAK,CAAC,CAAC,YAAY,aACtC,KAPD,CAAC,CAAC,EAAE,CAQJ,CACN,CAAC,GACG,IACD,CACN,CAAC;AACH,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolCall } from "../types.js";
|
|
2
|
+
export interface ToolCallCardProps {
|
|
3
|
+
toolCall: ToolCall;
|
|
4
|
+
theme: {
|
|
5
|
+
surface: string;
|
|
6
|
+
text: string;
|
|
7
|
+
textSecondary: string;
|
|
8
|
+
border: string;
|
|
9
|
+
success: string;
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function ToolCallCard({ toolCall, theme }: ToolCallCardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default ToolCallCard;
|
|
15
|
+
//# sourceMappingURL=tool-call-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-card.d.ts","sourceRoot":"","sources":["../../src/components/tool-call-card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;CACF;AA2CD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,2CAmClE;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
const cardStyle = (theme) => ({
|
|
4
|
+
backgroundColor: theme.surface,
|
|
5
|
+
border: `1px solid ${theme.border}`,
|
|
6
|
+
borderRadius: "8px",
|
|
7
|
+
overflow: "hidden",
|
|
8
|
+
fontSize: "13px",
|
|
9
|
+
});
|
|
10
|
+
const headerStyle = {
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
gap: "8px",
|
|
14
|
+
padding: "8px 12px",
|
|
15
|
+
cursor: "pointer",
|
|
16
|
+
userSelect: "none",
|
|
17
|
+
};
|
|
18
|
+
const dotStyle = (color) => ({
|
|
19
|
+
width: "8px",
|
|
20
|
+
height: "8px",
|
|
21
|
+
borderRadius: "50%",
|
|
22
|
+
backgroundColor: color,
|
|
23
|
+
flexShrink: 0,
|
|
24
|
+
});
|
|
25
|
+
const nameStyle = {
|
|
26
|
+
fontWeight: 600,
|
|
27
|
+
flex: 1,
|
|
28
|
+
};
|
|
29
|
+
const contentStyle = (theme) => ({
|
|
30
|
+
padding: "8px 12px",
|
|
31
|
+
borderTop: `1px solid ${theme.border}`,
|
|
32
|
+
fontFamily: "monospace",
|
|
33
|
+
fontSize: "12px",
|
|
34
|
+
whiteSpace: "pre-wrap",
|
|
35
|
+
wordBreak: "break-word",
|
|
36
|
+
maxHeight: "200px",
|
|
37
|
+
overflowY: "auto",
|
|
38
|
+
});
|
|
39
|
+
export function ToolCallCard({ toolCall, theme }) {
|
|
40
|
+
const [expanded, setExpanded] = useState(false);
|
|
41
|
+
const statusColor = toolCall.result?.isError ? theme.error : theme.success;
|
|
42
|
+
return (_jsxs("div", { style: cardStyle(theme), children: [_jsxs("div", { style: headerStyle, onClick: () => setExpanded(!expanded), children: [_jsx("span", { style: dotStyle(statusColor) }), _jsx("span", { style: nameStyle, children: toolCall.name }), _jsx("span", { style: { color: theme.textSecondary, fontSize: "11px" }, children: expanded ? "▲" : "▼" })] }), expanded && (_jsxs("div", { style: contentStyle(theme), children: [_jsx("div", { style: { color: theme.textSecondary, marginBottom: "4px" }, children: "Arguments:" }), toolCall.args, toolCall.result && (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
43
|
+
color: theme.textSecondary,
|
|
44
|
+
marginTop: "8px",
|
|
45
|
+
marginBottom: "4px",
|
|
46
|
+
}, children: "Result:" }), toolCall.result.content] }))] }))] }));
|
|
47
|
+
}
|
|
48
|
+
export default ToolCallCard;
|
|
49
|
+
//# sourceMappingURL=tool-call-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-card.js","sourceRoot":"","sources":["../../src/components/tool-call-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAejC,MAAM,SAAS,GAAG,CAAC,KAAiC,EAAuB,EAAE,CAAC,CAAC;IAC9E,eAAe,EAAE,KAAK,CAAC,OAAO;IAC9B,MAAM,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;IACnC,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,MAAM;CAChB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAwB;IACxC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,SAAS;IACjB,UA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AQ,EAAE,MAAM,EAAE,YAC3D,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GACf,IACF,EACL,QAAQ,IAAI,CACZ,eAAK,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,aAC9B,cAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,2BAAkB,EAChF,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,MAAM,IAAI,CACnB,8BACC,cACC,KAAK,EAAE;oCACN,KAAK,EAAE,KAAK,CAAC,aAAa;oCAC1B,SAAS,EAAE,KAAK;oCAChB,YAAY,EAAE,KAAK;iCACnB,wBAGI,EACL,QAAQ,CAAC,MAAM,CAAC,OAAO,IACtB,CACH,IACI,CACN,IACI,CACN,CAAC;AACH,CAAC;AAED,eAAe,YAAY,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ChatContainer } from "./components/chat-container.js";
|
|
2
|
+
export { MessageBubble } from "./components/message-bubble.js";
|
|
3
|
+
export { ChatInput } from "./components/chat-input.js";
|
|
4
|
+
export { SessionList } from "./components/session-list.js";
|
|
5
|
+
export { ToolCallCard } from "./components/tool-call-card.js";
|
|
6
|
+
export type { ChatMessage, ToolCall, ToolResult } from "./types.js";
|
|
7
|
+
export type { SessionInfo, DiagnosticInfo } from "./types.js";
|
|
8
|
+
export type { ThemeConfig, WebSocketMessage } from "./types.js";
|
|
9
|
+
export { darkTheme, lightTheme, getTheme } from "./theme.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC9D,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ChatContainer } from "./components/chat-container.js";
|
|
2
|
+
export { MessageBubble } from "./components/message-bubble.js";
|
|
3
|
+
export { ChatInput } from "./components/chat-input.js";
|
|
4
|
+
export { SessionList } from "./components/session-list.js";
|
|
5
|
+
export { ToolCallCard } from "./components/tool-call-card.js";
|
|
6
|
+
export { darkTheme, lightTheme, getTheme } from "./theme.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAK9D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ThemeConfig } from "./types.js";
|
|
2
|
+
export declare const darkTheme: ThemeConfig;
|
|
3
|
+
export declare const lightTheme: ThemeConfig;
|
|
4
|
+
export declare function getTheme(mode: "dark" | "light"): ThemeConfig;
|
|
5
|
+
export type { ThemeConfig };
|
|
6
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,SAAS,EAAE,WAYvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAYxB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAE5D;AAED,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const darkTheme = {
|
|
2
|
+
mode: "dark",
|
|
3
|
+
primary: "#6366f1",
|
|
4
|
+
background: "#0f172a",
|
|
5
|
+
surface: "#1e293b",
|
|
6
|
+
text: "#f1f5f9",
|
|
7
|
+
textSecondary: "#94a3b8",
|
|
8
|
+
border: "#334155",
|
|
9
|
+
userBubble: "#6366f1",
|
|
10
|
+
assistantBubble: "#334155",
|
|
11
|
+
error: "#ef4444",
|
|
12
|
+
success: "#22c55e",
|
|
13
|
+
};
|
|
14
|
+
export const lightTheme = {
|
|
15
|
+
mode: "light",
|
|
16
|
+
primary: "#6366f1",
|
|
17
|
+
background: "#ffffff",
|
|
18
|
+
surface: "#f8fafc",
|
|
19
|
+
text: "#0f172a",
|
|
20
|
+
textSecondary: "#64748b",
|
|
21
|
+
border: "#e2e8f0",
|
|
22
|
+
userBubble: "#6366f1",
|
|
23
|
+
assistantBubble: "#f1f5f9",
|
|
24
|
+
error: "#ef4444",
|
|
25
|
+
success: "#22c55e",
|
|
26
|
+
};
|
|
27
|
+
export function getTheme(mode) {
|
|
28
|
+
return mode === "dark" ? darkTheme : lightTheme;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAgB;IACrC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,SAAS;IACrB,eAAe,EAAE,SAAS;IAC1B,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAgB;IACtC,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,SAAS;IACrB,eAAe,EAAE,SAAS;IAC1B,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CAClB,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,IAAsB;IAC9C,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;AACjD,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface ChatMessage {
|
|
2
|
+
id: string;
|
|
3
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
4
|
+
content: string;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
toolCalls?: ToolCall[];
|
|
7
|
+
toolResult?: ToolResult;
|
|
8
|
+
streaming?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ToolCall {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
args: string;
|
|
14
|
+
result?: ToolResult;
|
|
15
|
+
}
|
|
16
|
+
export interface ToolResult {
|
|
17
|
+
content: string;
|
|
18
|
+
isError?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface SessionInfo {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
messageCount: number;
|
|
26
|
+
}
|
|
27
|
+
export interface DiagnosticInfo {
|
|
28
|
+
message: string;
|
|
29
|
+
severity: "error" | "warning" | "info" | "hint";
|
|
30
|
+
line?: number;
|
|
31
|
+
column?: number;
|
|
32
|
+
tool?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ThemeConfig {
|
|
35
|
+
mode: "dark" | "light";
|
|
36
|
+
primary: string;
|
|
37
|
+
background: string;
|
|
38
|
+
surface: string;
|
|
39
|
+
text: string;
|
|
40
|
+
textSecondary: string;
|
|
41
|
+
border: string;
|
|
42
|
+
userBubble: string;
|
|
43
|
+
assistantBubble: string;
|
|
44
|
+
error: string;
|
|
45
|
+
success: string;
|
|
46
|
+
}
|
|
47
|
+
export interface WebSocketMessage {
|
|
48
|
+
type: "message" | "tool_call" | "tool_result" | "error" | "status" | "diagnostic";
|
|
49
|
+
payload: unknown;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC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OAAO,EAAE,OAAO,CAAC;CACjB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wayofmono/wo-web-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Web UI components for WayOfMono — chat interface, session management, and tool call visualization",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "
|
|
7
|
-
"types": "
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./
|
|
11
|
-
"import": "./
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
+
"dist",
|
|
15
16
|
"src",
|
|
16
17
|
"README.md"
|
|
17
18
|
],
|