@townco/ui 0.1.17 → 0.1.18
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/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.js +55 -64
- package/dist/core/hooks/use-chat-messages.js +114 -121
- package/dist/core/hooks/use-chat-session.d.ts +1 -1
- package/dist/core/hooks/use-chat-session.js +80 -78
- package/dist/gui/components/Button.d.ts +7 -23
- package/dist/gui/components/Button.js +27 -40
- package/dist/gui/components/Card.d.ts +7 -26
- package/dist/gui/components/Card.js +8 -54
- package/dist/gui/components/ChatSecondaryPanel.d.ts +25 -14
- package/dist/gui/components/ChatSecondaryPanel.js +60 -115
- package/dist/gui/components/ChatStatus.d.ts +2 -4
- package/dist/gui/components/ChatStatus.js +34 -45
- package/dist/gui/components/Conversation.d.ts +14 -17
- package/dist/gui/components/Conversation.js +83 -143
- package/dist/gui/components/Dialog.d.ts +11 -57
- package/dist/gui/components/HeightTransition.d.ts +7 -12
- package/dist/gui/components/HeightTransition.js +77 -88
- package/dist/gui/components/Input.d.ts +6 -13
- package/dist/gui/components/Input.js +16 -27
- package/dist/gui/components/Label.d.ts +1 -7
- package/dist/gui/components/MarkdownRenderer.d.ts +4 -6
- package/dist/gui/components/MarkdownRenderer.js +81 -178
- package/dist/gui/components/MessageContent.d.ts +22 -29
- package/dist/gui/components/PanelTabsHeader.d.ts +17 -0
- package/dist/gui/components/PanelTabsHeader.js +31 -0
- package/dist/gui/components/Reasoning.d.ts +24 -30
- package/dist/gui/components/Reasoning.js +60 -187
- package/dist/gui/components/Response.d.ts +9 -11
- package/dist/gui/components/Response.js +90 -229
- package/dist/gui/components/Select.d.ts +10 -69
- package/dist/gui/components/Tabs.d.ts +4 -24
- package/dist/gui/components/Task.d.ts +24 -28
- package/dist/gui/components/Task.js +31 -164
- package/dist/gui/components/Textarea.d.ts +7 -15
- package/dist/gui/components/Textarea.js +46 -63
- package/dist/gui/components/ThinkingBlock.d.ts +10 -20
- package/dist/gui/components/ThinkingBlock.js +35 -134
- package/dist/gui/components/TodoList.d.ts +10 -12
- package/dist/gui/components/TodoList.js +7 -22
- package/dist/gui/components/TodoListItem.d.ts +6 -9
- package/dist/gui/components/TodoListItem.js +4 -18
- package/dist/gui/components/index.d.ts +1 -0
- package/dist/gui/components/index.js +1 -0
- package/dist/gui/lib/utils.js +1 -1
- package/dist/index.test.js +1 -0
- package/dist/sdk/client/acp-client.d.ts +76 -88
- package/dist/sdk/client/acp-client.js +217 -215
- package/dist/sdk/schemas/agent.d.ts +64 -111
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/message.d.ts +147 -245
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/session.d.ts +6 -6
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.js +46 -52
- package/dist/tui/components/ChatView.d.ts +2 -4
- package/dist/tui/components/GameOfLife.js +35 -64
- package/dist/tui/components/InputBox.d.ts +11 -18
- package/dist/tui/components/InputBox.js +10 -70
- package/dist/tui/components/ReadlineInput.d.ts +6 -12
- package/dist/tui/components/ReadlineInput.js +237 -252
- package/dist/tui/components/SingleSelect.d.ts +9 -15
- package/dist/tui/components/SingleSelect.js +43 -84
- package/dist/tui/components/StatusBar.d.ts +6 -11
- package/dist/tui/components/StatusBar.js +67 -102
- package/package.json +2 -2
- package/dist/core/hooks/index.d.ts.map +0 -1
- package/dist/core/hooks/index.js.map +0 -1
- package/dist/core/hooks/use-chat-input.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-input.js.map +0 -1
- package/dist/core/hooks/use-chat-messages.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-messages.js.map +0 -1
- package/dist/core/hooks/use-chat-session.d.ts.map +0 -1
- package/dist/core/hooks/use-chat-session.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/schemas/chat.d.ts.map +0 -1
- package/dist/core/schemas/chat.js.map +0 -1
- package/dist/core/schemas/index.d.ts.map +0 -1
- package/dist/core/schemas/index.js.map +0 -1
- package/dist/core/store/chat-store.d.ts.map +0 -1
- package/dist/core/store/chat-store.js.map +0 -1
- package/dist/gui/components/Button.d.ts.map +0 -1
- package/dist/gui/components/Button.js.map +0 -1
- package/dist/gui/components/Card.d.ts.map +0 -1
- package/dist/gui/components/Card.js.map +0 -1
- package/dist/gui/components/ChatInput.d.ts.map +0 -1
- package/dist/gui/components/ChatInput.js.map +0 -1
- package/dist/gui/components/ChatInterface.d.ts +0 -12
- package/dist/gui/components/ChatInterface.d.ts.map +0 -1
- package/dist/gui/components/ChatInterface.js +0 -204
- package/dist/gui/components/ChatInterface.js.map +0 -1
- package/dist/gui/components/ChatPreview.d.ts +0 -12
- package/dist/gui/components/ChatPreview.d.ts.map +0 -1
- package/dist/gui/components/ChatPreview.js +0 -214
- package/dist/gui/components/ChatPreview.js.map +0 -1
- package/dist/gui/components/ChatSecondaryPanel.d.ts.map +0 -1
- package/dist/gui/components/ChatSecondaryPanel.js.map +0 -1
- package/dist/gui/components/ChatStatus.d.ts.map +0 -1
- package/dist/gui/components/ChatStatus.js.map +0 -1
- package/dist/gui/components/ChatView.d.ts +0 -8
- package/dist/gui/components/ChatView.d.ts.map +0 -1
- package/dist/gui/components/ChatView.js +0 -42
- package/dist/gui/components/ChatView.js.map +0 -1
- package/dist/gui/components/ConfigPanel.d.ts +0 -20
- package/dist/gui/components/ConfigPanel.d.ts.map +0 -1
- package/dist/gui/components/ConfigPanel.js +0 -225
- package/dist/gui/components/ConfigPanel.js.map +0 -1
- package/dist/gui/components/Conversation.d.ts.map +0 -1
- package/dist/gui/components/Conversation.js.map +0 -1
- package/dist/gui/components/Dialog.d.ts.map +0 -1
- package/dist/gui/components/Dialog.js.map +0 -1
- package/dist/gui/components/HeightTransition.d.ts.map +0 -1
- package/dist/gui/components/HeightTransition.js.map +0 -1
- package/dist/gui/components/Input.d.ts.map +0 -1
- package/dist/gui/components/Input.js.map +0 -1
- package/dist/gui/components/InputBox.d.ts +0 -21
- package/dist/gui/components/InputBox.d.ts.map +0 -1
- package/dist/gui/components/InputBox.js +0 -90
- package/dist/gui/components/InputBox.js.map +0 -1
- package/dist/gui/components/Label.d.ts.map +0 -1
- package/dist/gui/components/Label.js.map +0 -1
- package/dist/gui/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/gui/components/MarkdownRenderer.js.map +0 -1
- package/dist/gui/components/Message.d.ts.map +0 -1
- package/dist/gui/components/Message.js.map +0 -1
- package/dist/gui/components/MessageContent.d.ts.map +0 -1
- package/dist/gui/components/MessageContent.js.map +0 -1
- package/dist/gui/components/MessageList.d.ts.map +0 -1
- package/dist/gui/components/MessageList.js.map +0 -1
- package/dist/gui/components/PlaygroundLayout.d.ts +0 -14
- package/dist/gui/components/PlaygroundLayout.d.ts.map +0 -1
- package/dist/gui/components/PlaygroundLayout.js +0 -49
- package/dist/gui/components/PlaygroundLayout.js.map +0 -1
- package/dist/gui/components/Reasoning.d.ts.map +0 -1
- package/dist/gui/components/Reasoning.js.map +0 -1
- package/dist/gui/components/Response.d.ts.map +0 -1
- package/dist/gui/components/Response.js.map +0 -1
- package/dist/gui/components/Select.d.ts.map +0 -1
- package/dist/gui/components/Select.js.map +0 -1
- package/dist/gui/components/StatusBar.d.ts +0 -12
- package/dist/gui/components/StatusBar.d.ts.map +0 -1
- package/dist/gui/components/StatusBar.js +0 -58
- package/dist/gui/components/StatusBar.js.map +0 -1
- package/dist/gui/components/Tabs.d.ts.map +0 -1
- package/dist/gui/components/Tabs.js.map +0 -1
- package/dist/gui/components/Task.d.ts.map +0 -1
- package/dist/gui/components/Task.js.map +0 -1
- package/dist/gui/components/Textarea.d.ts.map +0 -1
- package/dist/gui/components/Textarea.js.map +0 -1
- package/dist/gui/components/ThinkingBlock.d.ts.map +0 -1
- package/dist/gui/components/ThinkingBlock.js.map +0 -1
- package/dist/gui/components/TodoList.d.ts.map +0 -1
- package/dist/gui/components/TodoList.js.map +0 -1
- package/dist/gui/components/TodoListItem.d.ts.map +0 -1
- package/dist/gui/components/TodoListItem.js.map +0 -1
- package/dist/gui/components/index.d.ts.map +0 -1
- package/dist/gui/components/index.js.map +0 -1
- package/dist/gui/index.d.ts.map +0 -1
- package/dist/gui/index.js.map +0 -1
- package/dist/gui/lib/utils.d.ts.map +0 -1
- package/dist/gui/lib/utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/sdk/client/acp-client.d.ts.map +0 -1
- package/dist/sdk/client/acp-client.js.map +0 -1
- package/dist/sdk/client/index.d.ts.map +0 -1
- package/dist/sdk/client/index.js.map +0 -1
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/schemas/agent.d.ts.map +0 -1
- package/dist/sdk/schemas/agent.js.map +0 -1
- package/dist/sdk/schemas/index.d.ts.map +0 -1
- package/dist/sdk/schemas/index.js.map +0 -1
- package/dist/sdk/schemas/message.d.ts.map +0 -1
- package/dist/sdk/schemas/message.js.map +0 -1
- package/dist/sdk/schemas/session.d.ts.map +0 -1
- package/dist/sdk/schemas/session.js.map +0 -1
- package/dist/sdk/transports/http.d.ts.map +0 -1
- package/dist/sdk/transports/http.js.map +0 -1
- package/dist/sdk/transports/index.d.ts.map +0 -1
- package/dist/sdk/transports/index.js.map +0 -1
- package/dist/sdk/transports/stdio.d.ts.map +0 -1
- package/dist/sdk/transports/stdio.js.map +0 -1
- package/dist/sdk/transports/types.d.ts.map +0 -1
- package/dist/sdk/transports/types.js.map +0 -1
- package/dist/sdk/transports/websocket.d.ts.map +0 -1
- package/dist/sdk/transports/websocket.js.map +0 -1
- package/dist/tui/components/ChatView.d.ts.map +0 -1
- package/dist/tui/components/ChatView.js.map +0 -1
- package/dist/tui/components/GameOfLife.d.ts.map +0 -1
- package/dist/tui/components/GameOfLife.js.map +0 -1
- package/dist/tui/components/InputBox.d.ts.map +0 -1
- package/dist/tui/components/InputBox.js.map +0 -1
- package/dist/tui/components/MessageList.d.ts.map +0 -1
- package/dist/tui/components/MessageList.js.map +0 -1
- package/dist/tui/components/ReadlineInput.d.ts.map +0 -1
- package/dist/tui/components/ReadlineInput.js.map +0 -1
- package/dist/tui/components/StatusBar.d.ts.map +0 -1
- package/dist/tui/components/StatusBar.js.map +0 -1
- package/dist/tui/components/index.d.ts.map +0 -1
- package/dist/tui/components/index.js.map +0 -1
- package/dist/tui/index.d.ts.map +0 -1
- package/dist/tui/index.js.map +0 -1
|
@@ -2,182 +2,85 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import ReactMarkdown from "react-markdown";
|
|
3
3
|
import remarkGfm from "remark-gfm";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
export function MarkdownRenderer({ content, className }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}),
|
|
87
|
-
// List styling
|
|
88
|
-
ul: ({ node, ...props }) => {
|
|
89
|
-
// Check if this is a task list by looking for checkbox inputs in children
|
|
90
|
-
const isTaskList = node?.children?.some(
|
|
91
|
-
(child) =>
|
|
92
|
-
typeof child === "object" &&
|
|
93
|
-
child !== null &&
|
|
94
|
-
"type" in child &&
|
|
95
|
-
child.type === "element" &&
|
|
96
|
-
"tagName" in child &&
|
|
97
|
-
child.tagName === "li" &&
|
|
98
|
-
"children" in child &&
|
|
99
|
-
Array.isArray(child.children) &&
|
|
100
|
-
child.children.some(
|
|
101
|
-
(grandChild) =>
|
|
102
|
-
typeof grandChild === "object" &&
|
|
103
|
-
grandChild !== null &&
|
|
104
|
-
"type" in grandChild &&
|
|
105
|
-
grandChild.type === "element" &&
|
|
106
|
-
"tagName" in grandChild &&
|
|
107
|
-
grandChild.tagName === "input" &&
|
|
108
|
-
"properties" in grandChild &&
|
|
109
|
-
typeof grandChild.properties === "object" &&
|
|
110
|
-
grandChild.properties !== null &&
|
|
111
|
-
"type" in grandChild.properties &&
|
|
112
|
-
grandChild.properties.type === "checkbox",
|
|
113
|
-
),
|
|
114
|
-
);
|
|
115
|
-
return _jsx("ul", {
|
|
116
|
-
className: cn(
|
|
117
|
-
"my-2 space-y-1 text-foreground",
|
|
118
|
-
isTaskList ? "list-none space-y-2" : "list-disc list-inside",
|
|
119
|
-
),
|
|
120
|
-
...props,
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
ol: ({ node, ...props }) =>
|
|
124
|
-
_jsx("ol", {
|
|
125
|
-
className: "list-decimal list-inside my-2 space-y-1 text-foreground",
|
|
126
|
-
...props,
|
|
127
|
-
}),
|
|
128
|
-
// List item styling
|
|
129
|
-
li: ({ node, ...props }) => {
|
|
130
|
-
// Check if this li contains a checkbox (task list item)
|
|
131
|
-
const isTaskListItem = node?.children?.some(
|
|
132
|
-
(child) =>
|
|
133
|
-
typeof child === "object" &&
|
|
134
|
-
child !== null &&
|
|
135
|
-
"type" in child &&
|
|
136
|
-
child.type === "element" &&
|
|
137
|
-
"tagName" in child &&
|
|
138
|
-
child.tagName === "input" &&
|
|
139
|
-
"properties" in child &&
|
|
140
|
-
typeof child.properties === "object" &&
|
|
141
|
-
child.properties !== null &&
|
|
142
|
-
"type" in child.properties &&
|
|
143
|
-
child.properties.type === "checkbox",
|
|
144
|
-
);
|
|
145
|
-
return _jsx("li", {
|
|
146
|
-
className: cn("flex items-start", isTaskListItem ? "gap-2" : "ml-2"),
|
|
147
|
-
...props,
|
|
148
|
-
});
|
|
149
|
-
},
|
|
150
|
-
// Link styling
|
|
151
|
-
a: ({ node, ...props }) =>
|
|
152
|
-
_jsx("a", {
|
|
153
|
-
className: "text-primary hover:underline",
|
|
154
|
-
target: "_blank",
|
|
155
|
-
rel: "noopener noreferrer",
|
|
156
|
-
...props,
|
|
157
|
-
}),
|
|
158
|
-
// Paragraph styling
|
|
159
|
-
p: ({ node, ...props }) =>
|
|
160
|
-
_jsx("p", {
|
|
161
|
-
className: "my-2 text-foreground leading-relaxed",
|
|
162
|
-
...props,
|
|
163
|
-
}),
|
|
164
|
-
// Blockquote styling
|
|
165
|
-
blockquote: ({ node, ...props }) =>
|
|
166
|
-
_jsx("blockquote", {
|
|
167
|
-
className:
|
|
168
|
-
"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2",
|
|
169
|
-
...props,
|
|
170
|
-
}),
|
|
171
|
-
};
|
|
172
|
-
return _jsx("div", {
|
|
173
|
-
className: cn(
|
|
174
|
-
"markdown-content prose prose-sm max-w-none dark:prose-invert",
|
|
175
|
-
className,
|
|
176
|
-
),
|
|
177
|
-
children: _jsx(ReactMarkdown, {
|
|
178
|
-
remarkPlugins: [remarkGfm],
|
|
179
|
-
components: components,
|
|
180
|
-
children: content,
|
|
181
|
-
}),
|
|
182
|
-
});
|
|
5
|
+
export function MarkdownRenderer({ content, className, }) {
|
|
6
|
+
if (!content) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const components = {
|
|
10
|
+
// Table styling
|
|
11
|
+
table: ({ node, ...props }) => (_jsx("div", { className: "overflow-x-auto my-4", children: _jsx("table", { className: "min-w-full border-collapse border border-border rounded-md", ...props }) })),
|
|
12
|
+
thead: ({ node, ...props }) => (_jsx("thead", { className: "bg-card border-b border-border", ...props })),
|
|
13
|
+
tbody: ({ node, ...props }) => _jsx("tbody", { ...props }),
|
|
14
|
+
tr: ({ node, ...props }) => (_jsx("tr", { className: "border-b border-border hover:bg-card transition-colors", ...props })),
|
|
15
|
+
th: ({ node, ...props }) => (_jsx("th", { className: "px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0", ...props })),
|
|
16
|
+
td: ({ node, ...props }) => (_jsx("td", { className: "px-4 py-2 text-foreground border-r border-border last:border-r-0", ...props })),
|
|
17
|
+
// Task list styling
|
|
18
|
+
input: ({ node, checked, ...props }) => {
|
|
19
|
+
if (props.type === "checkbox") {
|
|
20
|
+
return (_jsx("input", { type: "checkbox", checked: checked || false, disabled: true, readOnly: true, className: "mr-2 w-4 h-4 accent-[primary] cursor-not-allowed", ...props }));
|
|
21
|
+
}
|
|
22
|
+
return _jsx("input", { ...props });
|
|
23
|
+
},
|
|
24
|
+
// Code block styling
|
|
25
|
+
code: ({ node, ...props }) => {
|
|
26
|
+
const inline = !props.className?.includes("language-");
|
|
27
|
+
if (inline) {
|
|
28
|
+
return (_jsx("code", { className: "px-1.5 py-0.5 bg-card border border-border rounded text-sm font-mono text-foreground", ...props }));
|
|
29
|
+
}
|
|
30
|
+
return (_jsx("code", { className: "block p-4 bg-card border border-border rounded-md overflow-x-auto text-sm font-mono text-foreground", ...props }));
|
|
31
|
+
},
|
|
32
|
+
pre: ({ node, ...props }) => _jsx("pre", { className: "my-4", ...props }),
|
|
33
|
+
// Heading styling
|
|
34
|
+
h1: ({ node, ...props }) => (_jsx("h1", { className: "text-2xl font-bold mt-6 mb-4 text-foreground", ...props })),
|
|
35
|
+
h2: ({ node, ...props }) => (_jsx("h2", { className: "text-xl font-semibold mt-5 mb-3 text-foreground", ...props })),
|
|
36
|
+
h3: ({ node, ...props }) => (_jsx("h3", { className: "text-lg font-semibold mt-4 mb-2 text-foreground", ...props })),
|
|
37
|
+
// List styling
|
|
38
|
+
ul: ({ node, ...props }) => {
|
|
39
|
+
// Check if this is a task list by looking for checkbox inputs in children
|
|
40
|
+
const isTaskList = node?.children?.some((child) => typeof child === "object" &&
|
|
41
|
+
child !== null &&
|
|
42
|
+
"type" in child &&
|
|
43
|
+
child.type === "element" &&
|
|
44
|
+
"tagName" in child &&
|
|
45
|
+
child.tagName === "li" &&
|
|
46
|
+
"children" in child &&
|
|
47
|
+
Array.isArray(child.children) &&
|
|
48
|
+
child.children.some((grandChild) => typeof grandChild === "object" &&
|
|
49
|
+
grandChild !== null &&
|
|
50
|
+
"type" in grandChild &&
|
|
51
|
+
grandChild.type === "element" &&
|
|
52
|
+
"tagName" in grandChild &&
|
|
53
|
+
grandChild.tagName === "input" &&
|
|
54
|
+
"properties" in grandChild &&
|
|
55
|
+
typeof grandChild.properties === "object" &&
|
|
56
|
+
grandChild.properties !== null &&
|
|
57
|
+
"type" in grandChild.properties &&
|
|
58
|
+
grandChild.properties.type === "checkbox"));
|
|
59
|
+
return (_jsx("ul", { className: cn("my-2 space-y-1 text-foreground", isTaskList ? "list-none space-y-2" : "list-disc list-inside"), ...props }));
|
|
60
|
+
},
|
|
61
|
+
ol: ({ node, ...props }) => (_jsx("ol", { className: "list-decimal list-inside my-2 space-y-1 text-foreground", ...props })),
|
|
62
|
+
// List item styling
|
|
63
|
+
li: ({ node, ...props }) => {
|
|
64
|
+
// Check if this li contains a checkbox (task list item)
|
|
65
|
+
const isTaskListItem = node?.children?.some((child) => typeof child === "object" &&
|
|
66
|
+
child !== null &&
|
|
67
|
+
"type" in child &&
|
|
68
|
+
child.type === "element" &&
|
|
69
|
+
"tagName" in child &&
|
|
70
|
+
child.tagName === "input" &&
|
|
71
|
+
"properties" in child &&
|
|
72
|
+
typeof child.properties === "object" &&
|
|
73
|
+
child.properties !== null &&
|
|
74
|
+
"type" in child.properties &&
|
|
75
|
+
child.properties.type === "checkbox");
|
|
76
|
+
return (_jsx("li", { className: cn("flex items-start", isTaskListItem ? "gap-2" : "ml-2"), ...props }));
|
|
77
|
+
},
|
|
78
|
+
// Link styling
|
|
79
|
+
a: ({ node, ...props }) => (_jsx("a", { className: "text-primary hover:underline", target: "_blank", rel: "noopener noreferrer", ...props })),
|
|
80
|
+
// Paragraph styling
|
|
81
|
+
p: ({ node, ...props }) => (_jsx("p", { className: "my-2 text-foreground leading-relaxed", ...props })),
|
|
82
|
+
// Blockquote styling
|
|
83
|
+
blockquote: ({ node, ...props }) => (_jsx("blockquote", { className: "border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2", ...props })),
|
|
84
|
+
};
|
|
85
|
+
return (_jsx("div", { className: cn("markdown-content prose prose-sm max-w-none dark:prose-invert", className), children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], components: components, children: content }) }));
|
|
183
86
|
}
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { DisplayMessage } from "./MessageList.js";
|
|
4
|
-
declare const messageContentVariants: (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
message?: DisplayMessage;
|
|
26
|
-
/** Display style for thinking/reasoning blocks (when using smart rendering) */
|
|
27
|
-
thinkingDisplayStyle?: "collapsible" | "inline";
|
|
28
|
-
/** Custom content (overrides smart rendering) */
|
|
29
|
-
children?: React.ReactNode;
|
|
4
|
+
declare const messageContentVariants: (props?: ({
|
|
5
|
+
role?: "user" | "assistant" | "system" | null | undefined;
|
|
6
|
+
variant?: "default" | "outline" | "ghost" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface MessageContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof messageContentVariants> {
|
|
9
|
+
/** Message role - determines styling */
|
|
10
|
+
role?: "user" | "assistant" | "system";
|
|
11
|
+
/** Visual variant */
|
|
12
|
+
variant?: "default" | "outline" | "ghost";
|
|
13
|
+
/** Whether the message is currently streaming */
|
|
14
|
+
isStreaming?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Message object for smart rendering (optional)
|
|
17
|
+
* When provided, automatically renders thinking, waiting, and content
|
|
18
|
+
*/
|
|
19
|
+
message?: DisplayMessage;
|
|
20
|
+
/** Display style for thinking/reasoning blocks (when using smart rendering) */
|
|
21
|
+
thinkingDisplayStyle?: "collapsible" | "inline";
|
|
22
|
+
/** Custom content (overrides smart rendering) */
|
|
23
|
+
children?: React.ReactNode;
|
|
30
24
|
}
|
|
31
|
-
export declare const MessageContent: React.ForwardRefExoticComponent<
|
|
32
|
-
|
|
33
|
-
>;
|
|
25
|
+
export declare const MessageContent: React.ForwardRefExoticComponent<MessageContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TabsList } from "./Tabs.js";
|
|
3
|
+
export interface PanelTabsHeaderProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsList>, "children"> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to show icons
|
|
6
|
+
*/
|
|
7
|
+
showIcons?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Which tabs to show
|
|
10
|
+
*/
|
|
11
|
+
visibleTabs?: ("todo" | "files" | "database")[];
|
|
12
|
+
/**
|
|
13
|
+
* Styling variant
|
|
14
|
+
*/
|
|
15
|
+
variant?: "default" | "compact";
|
|
16
|
+
}
|
|
17
|
+
export declare const PanelTabsHeader: React.ForwardRefExoticComponent<PanelTabsHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckSquare, Database, FileText } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { TabsList, TabsTrigger } from "./Tabs.js";
|
|
6
|
+
export const PanelTabsHeader = React.forwardRef(({ showIcons = true, visibleTabs = ["todo", "files"], variant = "default", className, ...props }, ref) => {
|
|
7
|
+
const allTabs = [
|
|
8
|
+
{
|
|
9
|
+
id: "todo",
|
|
10
|
+
label: "To-do",
|
|
11
|
+
icon: CheckSquare,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "files",
|
|
15
|
+
label: "Files",
|
|
16
|
+
icon: FileText,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "database",
|
|
20
|
+
label: "Database",
|
|
21
|
+
icon: Database,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
const tabs = allTabs.filter((tab) => visibleTabs.includes(tab.id));
|
|
25
|
+
const gap = variant === "compact" ? "gap-[4px]" : "gap-3";
|
|
26
|
+
return (_jsx(TabsList, { ref: ref, className: cn("w-full justify-start bg-transparent p-0 h-auto", gap, className), ...props, children: tabs.map((tab) => {
|
|
27
|
+
const Icon = tab.icon;
|
|
28
|
+
return (_jsxs(TabsTrigger, { value: tab.id, className: cn("gap-2 px-3 py-1.5 rounded-lg text-sm font-medium", "data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground", "data-[state=inactive]:text-muted-foreground"), children: [showIcons && Icon && _jsx(Icon, { className: "size-4" }), tab.label] }, tab.id));
|
|
29
|
+
}) }));
|
|
30
|
+
});
|
|
31
|
+
PanelTabsHeader.displayName = "PanelTabsHeader";
|
|
@@ -4,34 +4,28 @@ import * as React from "react";
|
|
|
4
4
|
* Reasoning component inspired by shadcn.io/ai
|
|
5
5
|
* Displays AI thinking/reasoning process with auto-collapse support
|
|
6
6
|
*/
|
|
7
|
-
declare const reasoningContainerVariants: (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
autoCollapseDelay?: number;
|
|
30
|
-
/** Custom label */
|
|
31
|
-
label?: string;
|
|
32
|
-
/** Additional CSS class */
|
|
33
|
-
className?: string;
|
|
7
|
+
declare const reasoningContainerVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "subtle" | "prominent" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface ReasoningProps extends VariantProps<typeof reasoningContainerVariants> {
|
|
11
|
+
/** The reasoning/thinking content */
|
|
12
|
+
content?: string;
|
|
13
|
+
/** Whether the content is currently streaming */
|
|
14
|
+
isStreaming?: boolean;
|
|
15
|
+
/** Display mode - collapsible or always visible */
|
|
16
|
+
mode?: "collapsible" | "inline";
|
|
17
|
+
/** Default expanded state (default: false - collapsed by default) */
|
|
18
|
+
defaultExpanded?: boolean;
|
|
19
|
+
/** Auto-expand when streaming starts (default: false) */
|
|
20
|
+
autoExpand?: boolean;
|
|
21
|
+
/** Auto-collapse after streaming completes */
|
|
22
|
+
autoCollapse?: boolean;
|
|
23
|
+
/** Delay before auto-collapsing (ms) */
|
|
24
|
+
autoCollapseDelay?: number;
|
|
25
|
+
/** Custom label */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Additional CSS class */
|
|
28
|
+
className?: string;
|
|
34
29
|
}
|
|
35
|
-
export declare const Reasoning: React.ForwardRefExoticComponent<
|
|
36
|
-
|
|
37
|
-
>;
|
|
30
|
+
export declare const Reasoning: React.ForwardRefExoticComponent<ReasoningProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export {};
|