@tangle-network/sandbox-ui 0.4.0 → 0.5.0
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/auth.js +3 -3
- package/dist/chat.d.ts +1 -1
- package/dist/chat.js +11 -9
- package/dist/{chunk-ZP6GSX4D.js → chunk-565V6JTN.js} +26 -50
- package/dist/chunk-5CEMHKBP.js +72 -0
- package/dist/{chunk-FOQTE67I.js → chunk-5F4NX5R2.js} +10 -5
- package/dist/{chunk-MUOL44AE.js → chunk-BRBTD7RH.js} +6 -6
- package/dist/{chunk-SSKVYXCR.js → chunk-DCPYTL4W.js} +62 -79
- package/dist/chunk-DLCFZDGX.js +182 -0
- package/dist/{chunk-HXEA7L2T.js → chunk-FFOXUHOF.js} +10 -10
- package/dist/chunk-H5XYSFYE.js +228 -0
- package/dist/{chunk-TQN3VR4F.js → chunk-JP725R4W.js} +2 -2
- package/dist/{chunk-CJ2RYVZH.js → chunk-NTSRY4GW.js} +68 -10
- package/dist/{chunk-DQYODCBN.js → chunk-P24K22CV.js} +57 -66
- package/dist/{chunk-GVUW4VDD.js → chunk-R3IU37AW.js} +161 -229
- package/dist/chunk-TDYQBLL5.js +127 -0
- package/dist/{chunk-HWLX5NME.js → chunk-TSE423UF.js} +12 -12
- package/dist/{chunk-YDBXQQLC.js → chunk-VBWY44UU.js} +30 -76
- package/dist/{chunk-IW2JZCOC.js → chunk-WBQ7VULC.js} +7 -7
- package/dist/{chunk-72UEKFZ2.js → chunk-WC7QTWPN.js} +65 -42
- package/dist/{chunk-HYLTXGOI.js → chunk-WQH233GF.js} +5 -5
- package/dist/{chunk-CCKNIAS7.js → chunk-XBR3IP7B.js} +2 -2
- package/dist/{chunk-OHMO7NUX.js → chunk-XTPAWK7L.js} +20 -31
- package/dist/{chunk-SULQQJPB.js → chunk-YS66Q3RC.js} +1 -1
- package/dist/{chunk-FRGMMANX.js → chunk-YYGECNZZ.js} +3 -3
- package/dist/{chunk-MVYFNPAH.js → chunk-ZOZX2U6I.js} +285 -271
- package/dist/dashboard.d.ts +2 -2
- package/dist/dashboard.js +6 -6
- package/dist/{document-editor-pane-5TN2VWGZ.js → document-editor-pane-JNXPANWM.js} +2 -2
- package/dist/editor.js +2 -2
- package/dist/files.js +2 -2
- package/dist/globals.css +129 -95
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +5 -5
- package/dist/{index-tTfThG0n.d.ts → index-CDt0GE4A.d.ts} +7 -8
- package/dist/index.d.ts +16 -23
- package/dist/index.js +27 -26
- package/dist/markdown.d.ts +14 -17
- package/dist/markdown.js +1 -1
- package/dist/openui.js +5 -5
- package/dist/pages.d.ts +10 -3
- package/dist/pages.js +147 -184
- package/dist/primitives.d.ts +8 -5
- package/dist/primitives.js +8 -8
- package/dist/run.d.ts +1 -1
- package/dist/run.js +4 -4
- package/dist/sdk-hooks.d.ts +1 -1
- package/dist/sdk-hooks.js +4 -4
- package/dist/styles.css +129 -95
- package/dist/terminal.d.ts +2 -2
- package/dist/terminal.js +13 -43
- package/dist/tokens.css +299 -179
- package/dist/{tool-call-feed-D5Ume-Pt.d.ts → tool-call-feed-Bs3MyQMT.d.ts} +3 -1
- package/dist/{usage-chart-CY9xo3KX.d.ts → usage-chart-XCoB_7Xu.d.ts} +1 -2
- package/dist/{use-pty-session-DeZSxOCN.d.ts → use-pty-session-COzVkhtc.d.ts} +1 -1
- package/dist/workspace.d.ts +3 -1
- package/dist/workspace.js +11 -11
- package/package.json +14 -2
- package/dist/chunk-GRYHFH5O.js +0 -110
- package/dist/chunk-LTFK464G.js +0 -103
- package/dist/chunk-MXCSSOGH.js +0 -105
|
@@ -6,20 +6,20 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
InlineThinkingItem,
|
|
8
8
|
RunGroup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WC7QTWPN.js";
|
|
10
10
|
import {
|
|
11
11
|
ToolCallGroup,
|
|
12
12
|
ToolCallStep
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NTSRY4GW.js";
|
|
14
14
|
import {
|
|
15
15
|
getToolDisplayMetadata
|
|
16
16
|
} from "./chunk-BX6AQMUS.js";
|
|
17
17
|
import {
|
|
18
18
|
OpenUIArtifactRenderer
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VBWY44UU.js";
|
|
20
20
|
import {
|
|
21
21
|
Markdown
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-H5XYSFYE.js";
|
|
23
23
|
import {
|
|
24
24
|
cn
|
|
25
25
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -31,7 +31,7 @@ var UserMessage = memo(({ message, parts, actions }) => {
|
|
|
31
31
|
const textContent = parts.filter((p) => p.type === "text").map((p) => p.text).join("\n");
|
|
32
32
|
if (!textContent.trim()) return null;
|
|
33
33
|
return /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs("div", { className: "flex max-w-[82%] flex-col items-end gap-2", children: [
|
|
34
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full rounded-[
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full rounded-[var(--radius-xl)] rounded-br-[var(--radius-sm)] border border-[var(--border-accent)] bg-[var(--depth-3)] px-4 py-3.5", children: [
|
|
35
35
|
/* @__PURE__ */ jsx("div", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-[0.14em] text-[var(--brand-cool)]", children: "You" }),
|
|
36
36
|
/* @__PURE__ */ jsx("div", { className: "text-[15px] leading-7 text-[var(--text-primary)]", children: /* @__PURE__ */ jsx(Markdown, { className: "tangle-prose", children: textContent }) })
|
|
37
37
|
] }),
|
|
@@ -87,77 +87,24 @@ var MessageList = memo2(
|
|
|
87
87
|
);
|
|
88
88
|
MessageList.displayName = "MessageList";
|
|
89
89
|
|
|
90
|
-
// src/chat/chat-message.tsx
|
|
91
|
-
import { User, Bot } from "lucide-react";
|
|
92
|
-
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
93
|
-
function ChatMessage({
|
|
94
|
-
role,
|
|
95
|
-
content,
|
|
96
|
-
toolCalls,
|
|
97
|
-
isStreaming,
|
|
98
|
-
timestamp,
|
|
99
|
-
className
|
|
100
|
-
}) {
|
|
101
|
-
const isUser = role === "user";
|
|
102
|
-
return /* @__PURE__ */ jsxs2(
|
|
103
|
-
"div",
|
|
104
|
-
{
|
|
105
|
-
className: cn(
|
|
106
|
-
"flex gap-4 rounded-[calc(var(--radius-xl)+2px)] border px-4 py-4 shadow-[var(--shadow-card)] backdrop-blur-sm",
|
|
107
|
-
isUser ? "border-[var(--border-accent)] bg-[radial-gradient(circle_at_top_right,rgba(96,165,250,0.18),transparent_42%),linear-gradient(135deg,rgba(98,114,243,0.18),rgba(98,114,243,0.06)_55%,rgba(255,255,255,0.02))]" : "border-[var(--border-subtle)] bg-[radial-gradient(circle_at_top_left,rgba(96,165,250,0.12),transparent_34%),linear-gradient(180deg,rgba(255,255,255,0.03),transparent_32%),var(--bg-card)]",
|
|
108
|
-
className
|
|
109
|
-
),
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsx3(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
className: cn(
|
|
115
|
-
"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-[calc(var(--radius-md)+2px)] border shadow-[var(--shadow-accent)]",
|
|
116
|
-
isUser ? "border-[var(--border-accent)] bg-[linear-gradient(135deg,rgba(82,164,255,0.24),rgba(82,164,255,0.08))] text-[var(--brand-cool)]" : "border-[var(--border-subtle)] bg-[linear-gradient(135deg,rgba(77,203,255,0.24),rgba(77,203,255,0.08))] text-[var(--brand-glow)]"
|
|
117
|
-
),
|
|
118
|
-
children: isUser ? /* @__PURE__ */ jsx3(User, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx3(Bot, { className: "h-4 w-4" })
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1 space-y-2", children: [
|
|
122
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
123
|
-
/* @__PURE__ */ jsx3("span", { className: "text-[11px] font-semibold uppercase tracking-[0.14em] text-[var(--text-secondary)]", children: isUser ? "You" : "Agent" }),
|
|
124
|
-
timestamp && /* @__PURE__ */ jsx3("span", { className: "text-[11px] text-[var(--text-muted)]", children: formatTime(timestamp) })
|
|
125
|
-
] }),
|
|
126
|
-
isUser ? /* @__PURE__ */ jsx3("div", { className: "whitespace-pre-wrap text-[15px] leading-7 text-[var(--text-primary)]", children: content }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
127
|
-
content && /* @__PURE__ */ jsx3(Markdown, { className: "tangle-prose text-[15px] leading-7", children: content }),
|
|
128
|
-
isStreaming && /* @__PURE__ */ jsx3("span", { className: "ml-0.5 inline-block h-4 w-2 animate-pulse rounded-sm bg-[var(--brand-cool)] align-text-bottom" })
|
|
129
|
-
] }),
|
|
130
|
-
toolCalls
|
|
131
|
-
] })
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
function formatTime(date) {
|
|
137
|
-
return date.toLocaleTimeString(void 0, {
|
|
138
|
-
hour: "numeric",
|
|
139
|
-
minute: "2-digit"
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
90
|
// src/chat/thinking-indicator.tsx
|
|
144
91
|
import { useEffect, useState } from "react";
|
|
145
|
-
import { jsx as
|
|
92
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
146
93
|
function ThinkingIndicator({ className }) {
|
|
147
94
|
const [elapsed, setElapsed] = useState(0);
|
|
148
95
|
useEffect(() => {
|
|
149
96
|
const interval = window.setInterval(() => setElapsed((current) => current + 1), 1e3);
|
|
150
97
|
return () => window.clearInterval(interval);
|
|
151
98
|
}, []);
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("flex gap-3 px-4 py-3", className), children: [
|
|
100
|
+
/* @__PURE__ */ jsx3("div", { className: "mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-[var(--brand-glow)]/15 text-[var(--brand-glow)]", children: /* @__PURE__ */ jsxs2("div", { className: "flex gap-0.5", children: [
|
|
101
|
+
/* @__PURE__ */ jsx3("span", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current", style: { animationDelay: "0ms" } }),
|
|
102
|
+
/* @__PURE__ */ jsx3("span", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current", style: { animationDelay: "150ms" } }),
|
|
103
|
+
/* @__PURE__ */ jsx3("span", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-current", style: { animationDelay: "300ms" } })
|
|
157
104
|
] }) }),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
elapsed > 5 && /* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
106
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm text-[var(--text-muted)]", children: elapsed < 10 ? "Thinking..." : elapsed < 60 ? "Thinking deeply..." : "Still working..." }),
|
|
107
|
+
elapsed > 5 && /* @__PURE__ */ jsxs2("span", { className: "text-xs tabular-nums text-[var(--text-muted)]", children: [
|
|
161
108
|
elapsed,
|
|
162
109
|
"s"
|
|
163
110
|
] })
|
|
@@ -173,7 +120,7 @@ import {
|
|
|
173
120
|
FileText,
|
|
174
121
|
Info
|
|
175
122
|
} from "lucide-react";
|
|
176
|
-
import { jsx as
|
|
123
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
177
124
|
var TONE_STYLES = {
|
|
178
125
|
default: {
|
|
179
126
|
dot: "bg-[var(--border-hover)]",
|
|
@@ -182,63 +129,81 @@ var TONE_STYLES = {
|
|
|
182
129
|
icon: CircleDot
|
|
183
130
|
},
|
|
184
131
|
info: {
|
|
185
|
-
dot: "bg-
|
|
186
|
-
card: "border-
|
|
187
|
-
text: "text-
|
|
132
|
+
dot: "bg-[var(--surface-info-text)]",
|
|
133
|
+
card: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)]",
|
|
134
|
+
text: "text-[var(--surface-info-text)]",
|
|
188
135
|
icon: Info
|
|
189
136
|
},
|
|
190
137
|
success: {
|
|
191
|
-
dot: "bg-[var(--
|
|
192
|
-
card: "border-
|
|
193
|
-
text: "text-
|
|
138
|
+
dot: "bg-[var(--surface-success-text)]",
|
|
139
|
+
card: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)]",
|
|
140
|
+
text: "text-[var(--surface-success-text)]",
|
|
194
141
|
icon: CheckCircle2
|
|
195
142
|
},
|
|
196
143
|
warning: {
|
|
197
|
-
dot: "bg-
|
|
198
|
-
card: "border-
|
|
199
|
-
text: "text-
|
|
144
|
+
dot: "bg-[var(--surface-warning-text)]",
|
|
145
|
+
card: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)]",
|
|
146
|
+
text: "text-[var(--surface-warning-text)]",
|
|
200
147
|
icon: AlertTriangle
|
|
201
148
|
},
|
|
202
149
|
error: {
|
|
203
|
-
dot: "bg-[var(--
|
|
204
|
-
card: "border-
|
|
205
|
-
text: "text-
|
|
150
|
+
dot: "bg-[var(--surface-danger-text)]",
|
|
151
|
+
card: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)]",
|
|
152
|
+
text: "text-[var(--surface-danger-text)]",
|
|
206
153
|
icon: AlertTriangle
|
|
207
154
|
}
|
|
208
155
|
};
|
|
156
|
+
function formatTime(date) {
|
|
157
|
+
return date.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
158
|
+
}
|
|
209
159
|
function AgentTimelineRow({ isLast, accentClassName, children }) {
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
!isLast && /* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-[1.25rem_minmax(0,1fr)] gap-x-4", children: [
|
|
161
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative flex justify-center", children: [
|
|
162
|
+
!isLast && /* @__PURE__ */ jsx4("span", { className: "absolute top-4 bottom-[-0.75rem] left-1/2 w-px -translate-x-1/2 bg-[var(--border-subtle)]" }),
|
|
163
|
+
/* @__PURE__ */ jsx4("span", { className: cn("relative mt-2 h-2.5 w-2.5 rounded-full ring-4 ring-[var(--bg-root)]", accentClassName) })
|
|
214
164
|
] }),
|
|
215
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ jsx4("div", { className: "min-w-0 pb-3", children })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
function UserMessage2({ item }) {
|
|
169
|
+
return /* @__PURE__ */ jsx4("div", { className: "mb-3 flex justify-end", children: /* @__PURE__ */ jsx4("div", { className: "max-w-[72%]", children: /* @__PURE__ */ jsxs3("div", { className: "rounded-2xl border border-[var(--border-accent)] bg-[var(--depth-3)] px-4 py-3", children: [
|
|
170
|
+
item.timestamp && /* @__PURE__ */ jsx4("div", { className: "mb-1.5 text-right text-[11px] text-[var(--text-muted)]", children: formatTime(item.timestamp) }),
|
|
171
|
+
/* @__PURE__ */ jsx4("div", { className: "whitespace-pre-wrap text-[15px] leading-7 text-[var(--text-primary)]", children: item.content })
|
|
172
|
+
] }) }) });
|
|
173
|
+
}
|
|
174
|
+
function AssistantMessage({ item }) {
|
|
175
|
+
return /* @__PURE__ */ jsxs3("div", { className: "-mt-0.5", children: [
|
|
176
|
+
item.timestamp && /* @__PURE__ */ jsx4("div", { className: "mb-2 text-[11px] text-[var(--text-muted)]", children: formatTime(item.timestamp) }),
|
|
177
|
+
item.content && /* @__PURE__ */ jsx4(Markdown, { className: "tangle-prose text-[15px] leading-7", children: item.content }),
|
|
178
|
+
item.isStreaming && /* @__PURE__ */ jsx4("span", { className: "ml-0.5 inline-block h-4 w-2 animate-pulse rounded-sm bg-[var(--brand-cool)] align-text-bottom" }),
|
|
179
|
+
item.toolCalls && /* @__PURE__ */ jsx4("div", { className: "mt-3", children: item.toolCalls }),
|
|
180
|
+
item.after && /* @__PURE__ */ jsx4("div", { className: "mt-3 border-t border-[var(--border-subtle)] pt-3", children: item.after })
|
|
216
181
|
] });
|
|
217
182
|
}
|
|
218
183
|
function StatusCard({ item }) {
|
|
219
184
|
const tone = TONE_STYLES[item.tone ?? "default"];
|
|
220
185
|
const Icon = tone.icon;
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
item.detail && /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ jsx4("div", { className: cn("rounded-[var(--radius-lg)] border px-4 py-3", tone.card), children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3", children: [
|
|
187
|
+
/* @__PURE__ */ jsx4(Icon, { className: cn("mt-0.5 h-4 w-4 shrink-0", tone.text) }),
|
|
188
|
+
/* @__PURE__ */ jsxs3("div", { className: "min-w-0", children: [
|
|
189
|
+
/* @__PURE__ */ jsx4("div", { className: cn("text-sm font-medium", tone.text), children: item.label }),
|
|
190
|
+
item.detail && /* @__PURE__ */ jsx4("div", { className: "mt-0.5 text-sm text-[var(--text-muted)]", children: item.detail })
|
|
226
191
|
] })
|
|
227
192
|
] }) });
|
|
228
193
|
}
|
|
229
194
|
function ArtifactCard({ item }) {
|
|
230
195
|
const tone = TONE_STYLES[item.tone ?? "default"];
|
|
231
|
-
const content = /* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
item.description && /* @__PURE__ */
|
|
236
|
-
item.meta && /* @__PURE__ */
|
|
196
|
+
const content = /* @__PURE__ */ jsx4("div", { className: cn("rounded-[var(--radius-lg)] border px-4 py-3", tone.card), children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3", children: [
|
|
197
|
+
/* @__PURE__ */ jsx4("div", { className: "mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-[var(--radius-md)] bg-[var(--bg-elevated)] text-[var(--text-secondary)]", children: item.icon ?? /* @__PURE__ */ jsx4(FileText, { className: "h-4 w-4" }) }),
|
|
198
|
+
/* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
|
|
199
|
+
/* @__PURE__ */ jsx4("div", { className: "text-sm font-medium text-[var(--text-primary)]", children: item.title }),
|
|
200
|
+
item.description && /* @__PURE__ */ jsx4("div", { className: "mt-1 text-sm text-[var(--text-muted)]", children: item.description }),
|
|
201
|
+
item.meta && /* @__PURE__ */ jsx4("div", { className: "mt-2 flex flex-wrap items-center gap-2 text-xs text-[var(--text-muted)]", children: item.meta })
|
|
237
202
|
] }),
|
|
238
|
-
item.action && /* @__PURE__ */
|
|
203
|
+
item.action && /* @__PURE__ */ jsx4("div", { className: "shrink-0", children: item.action })
|
|
239
204
|
] }) });
|
|
240
205
|
if (!item.onClick) return content;
|
|
241
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ jsx4(
|
|
242
207
|
"div",
|
|
243
208
|
{
|
|
244
209
|
role: "button",
|
|
@@ -262,108 +227,76 @@ function AgentTimeline({
|
|
|
262
227
|
className
|
|
263
228
|
}) {
|
|
264
229
|
if (items.length === 0 && !isThinking) {
|
|
265
|
-
return emptyState ? /* @__PURE__ */
|
|
230
|
+
return emptyState ? /* @__PURE__ */ jsx4("div", { className: cn("flex h-full items-center justify-center p-8", className), children: emptyState }) : null;
|
|
266
231
|
}
|
|
267
|
-
const renderedItems = isThinking ? [...items, { id: "__thinking__", kind: "custom", content: /* @__PURE__ */
|
|
268
|
-
|
|
269
|
-
|
|
232
|
+
const renderedItems = isThinking ? [...items, { id: "__thinking__", kind: "custom", content: /* @__PURE__ */ jsx4(ThinkingIndicator, {}) }] : items;
|
|
233
|
+
const timelineItems = renderedItems.filter((item) => !(item.kind === "message" && item.role === "user"));
|
|
234
|
+
return /* @__PURE__ */ jsx4("div", { className: cn("mx-auto w-full max-w-5xl px-4 py-4", className), children: renderedItems.map((item, index) => {
|
|
235
|
+
if (item.kind === "message" && item.role === "user") {
|
|
236
|
+
return /* @__PURE__ */ jsx4(UserMessage2, { item }, item.id);
|
|
237
|
+
}
|
|
238
|
+
const timelineIndex = timelineItems.indexOf(item);
|
|
239
|
+
const isLast = timelineIndex === timelineItems.length - 1;
|
|
270
240
|
if (item.kind === "message") {
|
|
271
|
-
|
|
272
|
-
return /* @__PURE__ */ jsx5(AgentTimelineRow, { isLast, accentClassName, children: /* @__PURE__ */ jsxs4("div", { className: "rounded-[var(--radius-xl)] border border-[var(--border-subtle)] bg-[var(--bg-card)] shadow-[var(--shadow-card)]", children: [
|
|
273
|
-
/* @__PURE__ */ jsx5(
|
|
274
|
-
ChatMessage,
|
|
275
|
-
{
|
|
276
|
-
role: item.role,
|
|
277
|
-
content: item.content,
|
|
278
|
-
toolCalls: item.toolCalls,
|
|
279
|
-
isStreaming: item.isStreaming,
|
|
280
|
-
timestamp: item.timestamp
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
item.after && /* @__PURE__ */ jsx5("div", { className: "border-t border-[var(--border-subtle)] px-4 py-3", children: item.after })
|
|
284
|
-
] }) }, item.id);
|
|
241
|
+
return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--brand-glow)]", children: /* @__PURE__ */ jsx4(AssistantMessage, { item }) }, item.id);
|
|
285
242
|
}
|
|
286
243
|
if (item.kind === "tool") {
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
-
|
|
244
|
+
return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", children: /* @__PURE__ */ jsx4(
|
|
245
|
+
ToolCallStep,
|
|
289
246
|
{
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
detail: item.call.detail,
|
|
299
|
-
output: item.call.output,
|
|
300
|
-
duration: item.call.duration
|
|
301
|
-
}
|
|
302
|
-
)
|
|
303
|
-
},
|
|
304
|
-
item.id
|
|
305
|
-
);
|
|
247
|
+
type: item.call.type,
|
|
248
|
+
label: item.call.label,
|
|
249
|
+
status: item.call.status,
|
|
250
|
+
detail: item.call.detail,
|
|
251
|
+
output: item.call.output,
|
|
252
|
+
duration: item.call.duration
|
|
253
|
+
}
|
|
254
|
+
) }, item.id);
|
|
306
255
|
}
|
|
307
256
|
if (item.kind === "tool_group") {
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
|
|
257
|
+
return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", children: /* @__PURE__ */ jsx4(ToolCallGroup, { title: item.title, children: item.calls.map((call) => /* @__PURE__ */ jsx4(
|
|
258
|
+
ToolCallStep,
|
|
310
259
|
{
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
label: call.label,
|
|
318
|
-
status: call.status,
|
|
319
|
-
detail: call.detail,
|
|
320
|
-
output: call.output,
|
|
321
|
-
duration: call.duration
|
|
322
|
-
},
|
|
323
|
-
call.id
|
|
324
|
-
)) })
|
|
260
|
+
type: call.type,
|
|
261
|
+
label: call.label,
|
|
262
|
+
status: call.status,
|
|
263
|
+
detail: call.detail,
|
|
264
|
+
output: call.output,
|
|
265
|
+
duration: call.duration
|
|
325
266
|
},
|
|
326
|
-
|
|
327
|
-
);
|
|
267
|
+
call.id
|
|
268
|
+
)) }) }, item.id);
|
|
328
269
|
}
|
|
329
270
|
if (item.kind === "status") {
|
|
330
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ jsx4(
|
|
331
272
|
AgentTimelineRow,
|
|
332
273
|
{
|
|
333
274
|
isLast,
|
|
334
275
|
accentClassName: TONE_STYLES[item.tone ?? "default"].dot,
|
|
335
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ jsx4(StatusCard, { item })
|
|
336
277
|
},
|
|
337
278
|
item.id
|
|
338
279
|
);
|
|
339
280
|
}
|
|
340
281
|
if (item.kind === "artifact") {
|
|
341
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ jsx4(
|
|
342
283
|
AgentTimelineRow,
|
|
343
284
|
{
|
|
344
285
|
isLast,
|
|
345
286
|
accentClassName: TONE_STYLES[item.tone ?? "default"].dot,
|
|
346
|
-
children: /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ jsx4(ArtifactCard, { item })
|
|
347
288
|
},
|
|
348
289
|
item.id
|
|
349
290
|
);
|
|
350
291
|
}
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
AgentTimelineRow,
|
|
353
|
-
{
|
|
354
|
-
isLast,
|
|
355
|
-
accentClassName: "bg-[var(--border-hover)]",
|
|
356
|
-
children: item.content
|
|
357
|
-
},
|
|
358
|
-
item.id
|
|
359
|
-
);
|
|
292
|
+
return /* @__PURE__ */ jsx4(AgentTimelineRow, { isLast, accentClassName: "bg-[var(--border-hover)]", children: item.content }, item.id);
|
|
360
293
|
}) });
|
|
361
294
|
}
|
|
362
295
|
|
|
363
296
|
// src/chat/chat-input.tsx
|
|
364
297
|
import { useState as useState2, useRef, useCallback } from "react";
|
|
365
298
|
import { Send, Square, Paperclip, FolderUp, X, Upload } from "lucide-react";
|
|
366
|
-
import { Fragment
|
|
299
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
367
300
|
function ChatInput({
|
|
368
301
|
onSend,
|
|
369
302
|
onCancel,
|
|
@@ -459,7 +392,7 @@ function ChatInput({
|
|
|
459
392
|
}, [onAttach]);
|
|
460
393
|
const fileChips = pendingFiles.filter((f) => f.type === "file" || !f.type);
|
|
461
394
|
const folderChips = pendingFiles.filter((f) => f.type === "folder");
|
|
462
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ jsxs4(
|
|
463
396
|
"div",
|
|
464
397
|
{
|
|
465
398
|
className: cn("px-4 py-3 relative", className),
|
|
@@ -468,65 +401,65 @@ function ChatInput({
|
|
|
468
401
|
onDragOver: onAttach ? handleDragOver : void 0,
|
|
469
402
|
onDrop: onAttach ? handleDrop : void 0,
|
|
470
403
|
children: [
|
|
471
|
-
dragOver && /* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
404
|
+
dragOver && /* @__PURE__ */ jsx5("div", { className: "absolute inset-0 z-10 flex items-center justify-center rounded-[var(--radius-xl)] border-2 border-dashed border-[var(--border-accent)] bg-[var(--depth-2)] pointer-events-none", children: /* @__PURE__ */ jsxs4("div", { className: "text-center", children: [
|
|
405
|
+
/* @__PURE__ */ jsx5("div", { className: "mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-[var(--accent-surface-soft)]", children: /* @__PURE__ */ jsx5(Upload, { className: "h-6 w-6 text-[var(--brand-cool)]" }) }),
|
|
406
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm font-semibold text-[var(--text-primary)]", children: dropTitle }),
|
|
407
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-1 text-xs text-[var(--text-muted)]", children: dropDescription })
|
|
475
408
|
] }) }),
|
|
476
|
-
pendingFiles.length > 0 && /* @__PURE__ */
|
|
477
|
-
folderChips.map((f) => /* @__PURE__ */
|
|
409
|
+
pendingFiles.length > 0 && /* @__PURE__ */ jsxs4("div", { className: "mb-3 flex flex-wrap gap-2", children: [
|
|
410
|
+
folderChips.map((f) => /* @__PURE__ */ jsxs4(
|
|
478
411
|
"span",
|
|
479
412
|
{
|
|
480
413
|
className: cn(
|
|
481
|
-
"inline-flex items-center gap-1.5 rounded-[var(--radius-full)] border px-3 py-1.5 text-xs
|
|
482
|
-
"border-[var(--border-subtle)] bg-[
|
|
414
|
+
"inline-flex items-center gap-1.5 rounded-[var(--radius-full)] border px-3 py-1.5 text-xs",
|
|
415
|
+
"border-[var(--border-subtle)] bg-[var(--depth-3)]",
|
|
483
416
|
f.status === "error" && "border-[var(--code-error)]/30 text-[var(--code-error)]",
|
|
484
417
|
f.status !== "error" && "text-[var(--text-secondary)]"
|
|
485
418
|
),
|
|
486
419
|
children: [
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
f.fileCount !== void 0 && /* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ jsx5(FolderUp, { className: "h-3 w-3 shrink-0" }),
|
|
421
|
+
/* @__PURE__ */ jsx5("span", { className: "truncate max-w-[150px]", children: f.name }),
|
|
422
|
+
f.fileCount !== void 0 && /* @__PURE__ */ jsxs4("span", { className: "text-[var(--text-muted)]", children: [
|
|
490
423
|
"(",
|
|
491
424
|
f.fileCount,
|
|
492
425
|
")"
|
|
493
426
|
] }),
|
|
494
|
-
f.status === "uploading" && /* @__PURE__ */
|
|
495
|
-
onRemoveFile && /* @__PURE__ */
|
|
427
|
+
f.status === "uploading" && /* @__PURE__ */ jsx5("span", { className: "w-3 h-3 border-2 border-[var(--brand-cool)] border-t-transparent rounded-full animate-spin" }),
|
|
428
|
+
onRemoveFile && /* @__PURE__ */ jsx5(
|
|
496
429
|
"button",
|
|
497
430
|
{
|
|
498
431
|
type: "button",
|
|
499
432
|
"aria-label": `Remove ${f.name}`,
|
|
500
433
|
onClick: () => onRemoveFile(f.id),
|
|
501
434
|
className: "rounded p-0.5 transition-colors hover:text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-cool)]/60",
|
|
502
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ jsx5(X, { className: "h-3 w-3" })
|
|
503
436
|
}
|
|
504
437
|
)
|
|
505
438
|
]
|
|
506
439
|
},
|
|
507
440
|
f.id
|
|
508
441
|
)),
|
|
509
|
-
fileChips.map((f) => /* @__PURE__ */
|
|
442
|
+
fileChips.map((f) => /* @__PURE__ */ jsxs4(
|
|
510
443
|
"span",
|
|
511
444
|
{
|
|
512
445
|
className: cn(
|
|
513
|
-
"inline-flex items-center gap-1.5 rounded-[var(--radius-full)] border px-3 py-1.5 text-xs
|
|
514
|
-
"border-[var(--border-subtle)] bg-[
|
|
446
|
+
"inline-flex items-center gap-1.5 rounded-[var(--radius-full)] border px-3 py-1.5 text-xs",
|
|
447
|
+
"border-[var(--border-subtle)] bg-[var(--depth-3)]",
|
|
515
448
|
f.status === "error" && "border-[var(--code-error)]/30 text-[var(--code-error)]",
|
|
516
449
|
f.status !== "error" && "text-[var(--text-secondary)]"
|
|
517
450
|
),
|
|
518
451
|
children: [
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
f.status === "uploading" && /* @__PURE__ */
|
|
522
|
-
onRemoveFile && /* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ jsx5(Paperclip, { className: "h-3 w-3 shrink-0" }),
|
|
453
|
+
/* @__PURE__ */ jsx5("span", { className: "truncate max-w-[150px]", children: f.name }),
|
|
454
|
+
f.status === "uploading" && /* @__PURE__ */ jsx5("span", { className: "w-3 h-3 border-2 border-[var(--brand-cool)] border-t-transparent rounded-full animate-spin" }),
|
|
455
|
+
onRemoveFile && /* @__PURE__ */ jsx5(
|
|
523
456
|
"button",
|
|
524
457
|
{
|
|
525
458
|
type: "button",
|
|
526
459
|
"aria-label": `Remove ${f.name}`,
|
|
527
460
|
onClick: () => onRemoveFile(f.id),
|
|
528
461
|
className: "rounded p-0.5 transition-colors hover:text-[var(--text-primary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-cool)]/60",
|
|
529
|
-
children: /* @__PURE__ */
|
|
462
|
+
children: /* @__PURE__ */ jsx5(X, { className: "h-3 w-3" })
|
|
530
463
|
}
|
|
531
464
|
)
|
|
532
465
|
]
|
|
@@ -534,14 +467,14 @@ function ChatInput({
|
|
|
534
467
|
f.id
|
|
535
468
|
))
|
|
536
469
|
] }),
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ jsx5("div", { className: "rounded-[var(--radius-xl)] border border-[var(--border-default)] bg-[var(--depth-2)] shadow-[var(--shadow-card)]", children: /* @__PURE__ */ jsxs4("div", { className: "rounded-[var(--radius-xl)] px-3 py-3.5 transition-colors focus-within:border-[var(--border-accent)]", children: [
|
|
471
|
+
/* @__PURE__ */ jsxs4("div", { className: "mb-2 flex items-center justify-between gap-3 px-1", children: [
|
|
472
|
+
/* @__PURE__ */ jsx5("div", { className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--text-muted)]", children: "Agent Command Deck" }),
|
|
473
|
+
/* @__PURE__ */ jsx5("div", { className: "text-[11px] text-[var(--text-muted)]", children: isStreaming ? "Streaming response" : "Ready for next instruction" })
|
|
541
474
|
] }),
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
onAttach && /* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-end gap-2", children: [
|
|
476
|
+
onAttach && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
477
|
+
/* @__PURE__ */ jsx5(
|
|
545
478
|
"button",
|
|
546
479
|
{
|
|
547
480
|
type: "button",
|
|
@@ -550,10 +483,10 @@ function ChatInput({
|
|
|
550
483
|
"aria-label": "Attach files",
|
|
551
484
|
title: "Attach files",
|
|
552
485
|
className: "mb-0.5 shrink-0 rounded-[var(--radius-md)] border border-transparent p-2 text-[var(--text-muted)] transition-colors hover:border-[var(--border-subtle)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-secondary)] disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-cool)]/60",
|
|
553
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ jsx5(Paperclip, { className: "h-4 w-4" })
|
|
554
487
|
}
|
|
555
488
|
),
|
|
556
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ jsx5(
|
|
557
490
|
"input",
|
|
558
491
|
{
|
|
559
492
|
ref: fileInputRef,
|
|
@@ -565,8 +498,8 @@ function ChatInput({
|
|
|
565
498
|
}
|
|
566
499
|
)
|
|
567
500
|
] }),
|
|
568
|
-
(onAttachFolder ?? onAttach) && /* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
501
|
+
(onAttachFolder ?? onAttach) && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
502
|
+
/* @__PURE__ */ jsx5(
|
|
570
503
|
"button",
|
|
571
504
|
{
|
|
572
505
|
type: "button",
|
|
@@ -575,10 +508,10 @@ function ChatInput({
|
|
|
575
508
|
"aria-label": "Attach folder",
|
|
576
509
|
title: "Attach folder",
|
|
577
510
|
className: "mb-0.5 shrink-0 rounded-[var(--radius-md)] border border-transparent p-2 text-[var(--text-muted)] transition-colors hover:border-[var(--border-subtle)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-secondary)] disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-cool)]/60",
|
|
578
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ jsx5(FolderUp, { className: "h-4 w-4" })
|
|
579
512
|
}
|
|
580
513
|
),
|
|
581
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ jsx5(
|
|
582
515
|
"input",
|
|
583
516
|
{
|
|
584
517
|
ref: folderInputRef,
|
|
@@ -590,7 +523,7 @@ function ChatInput({
|
|
|
590
523
|
}
|
|
591
524
|
)
|
|
592
525
|
] }),
|
|
593
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ jsx5(
|
|
594
527
|
"textarea",
|
|
595
528
|
{
|
|
596
529
|
ref: textareaRef,
|
|
@@ -604,30 +537,30 @@ function ChatInput({
|
|
|
604
537
|
className: "min-h-[36px] max-h-[160px] flex-1 resize-none bg-transparent text-[15px] leading-7 text-[var(--text-primary)] placeholder:text-[var(--text-muted)] disabled:opacity-50 focus-visible:outline-none"
|
|
605
538
|
}
|
|
606
539
|
),
|
|
607
|
-
isStreaming ? /* @__PURE__ */
|
|
540
|
+
isStreaming ? /* @__PURE__ */ jsx5(
|
|
608
541
|
"button",
|
|
609
542
|
{
|
|
610
543
|
type: "button",
|
|
611
544
|
onClick: onCancel,
|
|
612
545
|
"aria-label": "Stop response",
|
|
613
546
|
className: "mb-0.5 shrink-0 rounded-[var(--radius-lg)] border border-[var(--code-error)]/20 bg-[var(--code-error)]/14 p-2.5 text-[var(--code-error)] transition-colors hover:bg-[var(--code-error)]/24 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--code-error)]/50",
|
|
614
|
-
children: /* @__PURE__ */
|
|
547
|
+
children: /* @__PURE__ */ jsx5(Square, { className: "h-4 w-4" })
|
|
615
548
|
}
|
|
616
|
-
) : /* @__PURE__ */
|
|
549
|
+
) : /* @__PURE__ */ jsx5(
|
|
617
550
|
"button",
|
|
618
551
|
{
|
|
619
552
|
type: "button",
|
|
620
553
|
onClick: handleSend,
|
|
621
554
|
disabled: !value.trim() || disabled,
|
|
622
555
|
"aria-label": "Send message",
|
|
623
|
-
className: "mb-0.5 shrink-0 rounded-[var(--radius-lg)] border border-[var(--border-accent)] bg-[
|
|
624
|
-
children: /* @__PURE__ */
|
|
556
|
+
className: "mb-0.5 shrink-0 rounded-[var(--radius-lg)] border border-[var(--border-accent)] bg-[var(--accent-surface-soft)] p-2.5 text-[var(--accent-text)] transition-colors hover:translate-y-[-1px] hover:bg-[var(--accent-surface-strong)] disabled:opacity-30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--border-accent)]",
|
|
557
|
+
children: /* @__PURE__ */ jsx5(Send, { className: "h-4 w-4" })
|
|
625
558
|
}
|
|
626
559
|
)
|
|
627
560
|
] })
|
|
628
561
|
] }) }),
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ jsxs4("div", { className: "mt-2 flex items-center justify-between px-1", children: [
|
|
563
|
+
/* @__PURE__ */ jsx5("div", { className: "flex items-center gap-2", children: modelLabel && /* @__PURE__ */ jsxs4(
|
|
631
564
|
"button",
|
|
632
565
|
{
|
|
633
566
|
type: "button",
|
|
@@ -635,15 +568,15 @@ function ChatInput({
|
|
|
635
568
|
"aria-label": `Select model, current model ${modelLabel}`,
|
|
636
569
|
className: "inline-flex items-center gap-1.5 rounded-[var(--radius-full)] border border-[var(--border-subtle)] bg-[linear-gradient(180deg,rgba(255,255,255,0.04),transparent)] px-2.5 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--border-accent)] hover:text-[var(--text-secondary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-cool)]/60",
|
|
637
570
|
children: [
|
|
638
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsx5("span", { className: "w-1.5 h-1.5 rounded-full bg-[var(--code-success)]" }),
|
|
639
572
|
modelLabel
|
|
640
573
|
]
|
|
641
574
|
}
|
|
642
575
|
) }),
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-xs text-[var(--text-muted)]", children: [
|
|
577
|
+
/* @__PURE__ */ jsx5("kbd", { className: "px-1 py-0.5 bg-[var(--bg-input)] rounded border border-[var(--border-subtle)] text-[10px]", children: "Cmd" }),
|
|
578
|
+
/* @__PURE__ */ jsx5("kbd", { className: "px-1 py-0.5 bg-[var(--bg-input)] rounded border border-[var(--border-subtle)] text-[10px] ml-0.5", children: "L" }),
|
|
579
|
+
/* @__PURE__ */ jsx5("span", { className: "ml-1", children: "to focus" })
|
|
647
580
|
] })
|
|
648
581
|
] })
|
|
649
582
|
]
|
|
@@ -659,7 +592,7 @@ import {
|
|
|
659
592
|
useRef as useRef2
|
|
660
593
|
} from "react";
|
|
661
594
|
import { ArrowDown } from "lucide-react";
|
|
662
|
-
import { jsx as
|
|
595
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
663
596
|
var OPENUI_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
664
597
|
"heading",
|
|
665
598
|
"text",
|
|
@@ -809,7 +742,7 @@ function buildTimelineItems(messages, partMap, isStreaming, onOpenUIAction, enab
|
|
|
809
742
|
items.push({
|
|
810
743
|
id: `${message.id}-openui-${part.id}`,
|
|
811
744
|
kind: "custom",
|
|
812
|
-
content: /* @__PURE__ */
|
|
745
|
+
content: /* @__PURE__ */ jsx6("div", { className: "my-2 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)] p-4 shadow-[var(--shadow-card)]", children: /* @__PURE__ */ jsx6(OpenUIArtifactRenderer, { schema, onAction: onOpenUIAction }) })
|
|
813
746
|
});
|
|
814
747
|
}
|
|
815
748
|
}
|
|
@@ -841,7 +774,7 @@ function buildTimelineItems(messages, partMap, isStreaming, onOpenUIAction, enab
|
|
|
841
774
|
items.push({
|
|
842
775
|
id: `${itemId}-openui`,
|
|
843
776
|
kind: "custom",
|
|
844
|
-
content: /* @__PURE__ */
|
|
777
|
+
content: /* @__PURE__ */ jsx6("div", { className: "my-2 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)] p-4 shadow-[var(--shadow-card)]", children: /* @__PURE__ */ jsx6(OpenUIArtifactRenderer, { schema, onAction: onOpenUIAction }) })
|
|
845
778
|
});
|
|
846
779
|
const afterJson = part.text.slice(part.text.lastIndexOf("```") + 3).trim();
|
|
847
780
|
if (afterJson) {
|
|
@@ -871,7 +804,7 @@ function buildTimelineItems(messages, partMap, isStreaming, onOpenUIAction, enab
|
|
|
871
804
|
items.push({
|
|
872
805
|
id: itemId,
|
|
873
806
|
kind: "custom",
|
|
874
|
-
content: /* @__PURE__ */
|
|
807
|
+
content: /* @__PURE__ */ jsx6(InlineThinkingItem, { part, defaultOpen: isStreaming && lastAssistantMessage?.id === message.id })
|
|
875
808
|
});
|
|
876
809
|
return;
|
|
877
810
|
}
|
|
@@ -927,16 +860,16 @@ var ChatContainer = memo3(
|
|
|
927
860
|
},
|
|
928
861
|
[onSend]
|
|
929
862
|
);
|
|
930
|
-
return /* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ jsxs5("div", { className: cn("flex flex-col h-full", className), children: [
|
|
864
|
+
/* @__PURE__ */ jsx6(
|
|
932
865
|
"div",
|
|
933
866
|
{
|
|
934
867
|
ref: scrollRef,
|
|
935
868
|
className: "flex-1 overflow-y-auto px-4 py-4 [scrollbar-gutter:stable]",
|
|
936
|
-
children: messages.length === 0 ? /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
] }) }) : presentation === "timeline" ? /* @__PURE__ */
|
|
869
|
+
children: messages.length === 0 ? /* @__PURE__ */ jsx6("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxs5("div", { className: "max-w-md rounded-[var(--radius-xl)] border border-[var(--border-subtle)] bg-[linear-gradient(180deg,rgba(255,255,255,0.03),transparent)] px-6 py-8 text-center shadow-[var(--shadow-card)]", children: [
|
|
870
|
+
/* @__PURE__ */ jsx6("div", { className: "text-sm font-semibold text-[var(--text-primary)]", children: "Start the filing workflow" }),
|
|
871
|
+
/* @__PURE__ */ jsx6("div", { className: "mt-2 text-sm leading-relaxed text-[var(--text-muted)]", children: "Ask the agent to analyze documents, generate forms, explain a calculation, or review the current filing package." })
|
|
872
|
+
] }) }) : presentation === "timeline" ? /* @__PURE__ */ jsx6(AgentTimeline, { items: timeline.items, isThinking: timeline.showThinking }) : /* @__PURE__ */ jsx6("div", { className: "mx-auto flex w-full max-w-5xl flex-col gap-3", children: /* @__PURE__ */ jsx6(
|
|
940
873
|
MessageList,
|
|
941
874
|
{
|
|
942
875
|
groups,
|
|
@@ -952,7 +885,7 @@ var ChatContainer = memo3(
|
|
|
952
885
|
) })
|
|
953
886
|
}
|
|
954
887
|
),
|
|
955
|
-
!isAtBottom && /* @__PURE__ */
|
|
888
|
+
!isAtBottom && /* @__PURE__ */ jsx6("div", { className: "flex justify-center -mt-10 relative z-10", children: /* @__PURE__ */ jsxs5(
|
|
956
889
|
"button",
|
|
957
890
|
{
|
|
958
891
|
onClick: scrollToBottom,
|
|
@@ -963,12 +896,12 @@ var ChatContainer = memo3(
|
|
|
963
896
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-cool)]/60"
|
|
964
897
|
),
|
|
965
898
|
children: [
|
|
966
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ jsx6(ArrowDown, { className: "w-3 h-3" }),
|
|
967
900
|
"Scroll to bottom"
|
|
968
901
|
]
|
|
969
902
|
}
|
|
970
903
|
) }),
|
|
971
|
-
!hideInput && onSend && /* @__PURE__ */
|
|
904
|
+
!hideInput && onSend && /* @__PURE__ */ jsx6(
|
|
972
905
|
ChatInput,
|
|
973
906
|
{
|
|
974
907
|
onSend: handleSend,
|
|
@@ -992,7 +925,6 @@ ChatContainer.displayName = "ChatContainer";
|
|
|
992
925
|
export {
|
|
993
926
|
UserMessage,
|
|
994
927
|
MessageList,
|
|
995
|
-
ChatMessage,
|
|
996
928
|
ThinkingIndicator,
|
|
997
929
|
AgentTimeline,
|
|
998
930
|
ChatInput,
|