@ash-cloud/ash-ai 0.1.12 → 0.1.15
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/index.cjs +415 -583
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -153
- package/dist/index.d.ts +115 -153
- package/dist/index.js +414 -581
- package/dist/index.js.map +1 -1
- package/dist/playground/components/ChatInput.d.ts.map +1 -1
- package/dist/playground/pages/ChatPage.d.ts.map +1 -1
- package/dist/playground.css +1 -1
- package/dist/playground.js +1354 -1125
- package/package.json +1 -1
package/dist/playground.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { lazy as
|
|
5
|
-
import { jsxs as
|
|
6
|
-
function
|
|
1
|
+
var ot = Object.defineProperty;
|
|
2
|
+
var ct = (e, n, r) => n in e ? ot(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
|
|
3
|
+
var se = (e, n, r) => ct(e, typeof n != "symbol" ? n + "" : n, r);
|
|
4
|
+
import { lazy as dt, createContext as Je, useState as N, useCallback as F, useRef as V, useEffect as P, useMemo as ae, useContext as Ue, Suspense as ut, Fragment as $e } from "react";
|
|
5
|
+
import { jsxs as a, jsx as t, Fragment as _ } from "react/jsx-runtime";
|
|
6
|
+
function ht(e) {
|
|
7
7
|
if (e.startsWith("mcp__")) {
|
|
8
8
|
const n = e.split("__");
|
|
9
9
|
if (n.length >= 3)
|
|
@@ -11,7 +11,7 @@ function ct(e) {
|
|
|
11
11
|
}
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function mt(e) {
|
|
15
15
|
if (e.startsWith("mcp__")) {
|
|
16
16
|
const n = e.split("__");
|
|
17
17
|
if (n.length >= 3 && n[1] !== void 0)
|
|
@@ -22,7 +22,7 @@ function dt(e) {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function pt(e, n) {
|
|
26
26
|
const r = n || {};
|
|
27
27
|
switch (e) {
|
|
28
28
|
case "Bash":
|
|
@@ -43,14 +43,14 @@ function ut(e, n) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
case "Edit": {
|
|
46
|
-
const s = r.old_string,
|
|
47
|
-
`).length : 0, c =
|
|
46
|
+
const s = r.old_string, i = r.new_string, l = s ? s.split(`
|
|
47
|
+
`).length : 0, c = i ? i.split(`
|
|
48
48
|
`).length : 0;
|
|
49
49
|
return {
|
|
50
50
|
action: "file_edit",
|
|
51
51
|
path: r.file_path || "",
|
|
52
52
|
oldString: s,
|
|
53
|
-
newString:
|
|
53
|
+
newString: i,
|
|
54
54
|
replaceAll: r.replace_all,
|
|
55
55
|
linesAdded: c,
|
|
56
56
|
linesRemoved: l
|
|
@@ -92,7 +92,7 @@ function ut(e, n) {
|
|
|
92
92
|
query: r.query || ""
|
|
93
93
|
};
|
|
94
94
|
case "TodoWrite": {
|
|
95
|
-
const s = r.todos || [],
|
|
95
|
+
const s = r.todos || [], i = {
|
|
96
96
|
total: s.length,
|
|
97
97
|
completed: s.filter((l) => l.status === "completed").length,
|
|
98
98
|
inProgress: s.filter((l) => l.status === "in_progress").length,
|
|
@@ -101,7 +101,7 @@ function ut(e, n) {
|
|
|
101
101
|
return {
|
|
102
102
|
action: "todo_write",
|
|
103
103
|
todos: s,
|
|
104
|
-
stats:
|
|
104
|
+
stats: i
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
case "Task":
|
|
@@ -114,7 +114,7 @@ function ut(e, n) {
|
|
|
114
114
|
toolCallCount: 0
|
|
115
115
|
};
|
|
116
116
|
default: {
|
|
117
|
-
const s =
|
|
117
|
+
const s = mt(e);
|
|
118
118
|
return s ? {
|
|
119
119
|
action: "mcp_tool",
|
|
120
120
|
serverName: s.serverName,
|
|
@@ -122,13 +122,13 @@ function ut(e, n) {
|
|
|
122
122
|
arguments: n
|
|
123
123
|
} : {
|
|
124
124
|
action: "generic_tool",
|
|
125
|
-
toolName:
|
|
125
|
+
toolName: ht(e),
|
|
126
126
|
arguments: n
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function ft(e, n, r) {
|
|
132
132
|
switch (r.action) {
|
|
133
133
|
case "command_run": {
|
|
134
134
|
const s = r.command;
|
|
@@ -162,11 +162,11 @@ function ht(e, n, r) {
|
|
|
162
162
|
return "Unknown tool";
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function xt(e) {
|
|
166
166
|
return typeof e == "string" ? e : Array.isArray(e) ? e.filter((n) => typeof (n == null ? void 0 : n.text) == "string").map((n) => n.text).join(`
|
|
167
167
|
`) : e && typeof e == "object" && "text" in e ? String(e.text) : JSON.stringify(e, null, 2);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function gt(e) {
|
|
170
170
|
if (typeof e == "string")
|
|
171
171
|
try {
|
|
172
172
|
return { type: "json", value: JSON.parse(e) };
|
|
@@ -190,8 +190,8 @@ function pt(e) {
|
|
|
190
190
|
}
|
|
191
191
|
return { type: "json", value: e };
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const n =
|
|
193
|
+
function wt(e) {
|
|
194
|
+
const n = xt(e);
|
|
195
195
|
if (typeof e == "string")
|
|
196
196
|
try {
|
|
197
197
|
const r = JSON.parse(e);
|
|
@@ -208,8 +208,8 @@ function ft(e) {
|
|
|
208
208
|
success: !0
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
const n =
|
|
211
|
+
function rr(e) {
|
|
212
|
+
const n = pt(e.name, e.input), r = ft(e.name, e.input, n);
|
|
213
213
|
return {
|
|
214
214
|
id: e.id,
|
|
215
215
|
toolName: e.name,
|
|
@@ -220,15 +220,15 @@ function nr(e) {
|
|
|
220
220
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const s = { ...e },
|
|
225
|
-
if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, s.output = n,
|
|
226
|
-
const l =
|
|
227
|
-
|
|
228
|
-
} else (
|
|
229
|
-
return s.actionType =
|
|
223
|
+
function sr(e, n, r) {
|
|
224
|
+
const s = { ...e }, i = { ...e.actionType };
|
|
225
|
+
if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, s.output = n, i.action === "command_run") {
|
|
226
|
+
const l = wt(n);
|
|
227
|
+
i.result = l, l.exitCode !== void 0 && l.exitCode !== 0 && (s.status = "failed", s.isError = !0);
|
|
228
|
+
} else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = gt(n));
|
|
229
|
+
return s.actionType = i, s;
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function ar(e) {
|
|
232
232
|
switch (e.action) {
|
|
233
233
|
case "command_run":
|
|
234
234
|
return "terminal";
|
|
@@ -258,7 +258,7 @@ function sr(e) {
|
|
|
258
258
|
return "tool";
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function Ke(e) {
|
|
262
262
|
switch (e.action) {
|
|
263
263
|
case "command_run":
|
|
264
264
|
return "Command";
|
|
@@ -291,7 +291,7 @@ function Ue(e) {
|
|
|
291
291
|
function ir(e) {
|
|
292
292
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function je(e) {
|
|
295
295
|
try {
|
|
296
296
|
return new Date(e).toLocaleTimeString("en-US", {
|
|
297
297
|
hour: "2-digit",
|
|
@@ -303,63 +303,63 @@ function De(e) {
|
|
|
303
303
|
return e;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const r = typeof e == "string" ? new Date(e) : e,
|
|
306
|
+
function Ve(e, n) {
|
|
307
|
+
const r = typeof e == "string" ? new Date(e) : e, i = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), l = Math.floor(i / 1e3);
|
|
308
308
|
if (l < 60)
|
|
309
309
|
return `${l}s`;
|
|
310
310
|
const c = Math.floor(l / 60), h = l % 60;
|
|
311
311
|
return h === 0 ? `${c}m` : `${c}m ${h}s`;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function lr(e, n) {
|
|
314
314
|
return e.length <= n ? e : e.substring(0, n - 3) + "...";
|
|
315
315
|
}
|
|
316
316
|
function p(...e) {
|
|
317
317
|
return e.filter(Boolean).join(" ");
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function vt(e, n) {
|
|
320
320
|
const r = [];
|
|
321
|
-
let s = [],
|
|
321
|
+
let s = [], i = 0;
|
|
322
322
|
const l = () => {
|
|
323
323
|
s.length > 0 && (r.push({
|
|
324
324
|
type: "tool_group",
|
|
325
325
|
entries: [...s],
|
|
326
|
-
id: `tool-group-${
|
|
326
|
+
id: `tool-group-${i++}`
|
|
327
327
|
}), s = []);
|
|
328
328
|
};
|
|
329
329
|
for (const c of e)
|
|
330
330
|
c.entryType.type === "tool_call" ? (s.push(c), n.breakEveryNToolCalls && n.breakEveryNToolCalls > 0 && s.length >= n.breakEveryNToolCalls && l()) : (l(), r.push({ type: "single", entry: c }));
|
|
331
331
|
return l(), r;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function yt(e) {
|
|
334
334
|
return e.filter(
|
|
335
335
|
(n) => n.entryType.type === "tool_call"
|
|
336
336
|
).map((n) => n.entryType.toolCall);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function bt(e) {
|
|
339
339
|
const n = /(?:\*\*)?Option\s+(\d+)(?:\*\*)?[:\-]\s*([^\n]+)(?:\n((?:(?!\n(?:\*\*)?Option\s+\d).)*?))?/gi, r = [];
|
|
340
|
-
let s = -1,
|
|
341
|
-
for (n.lastIndex = 0; (
|
|
342
|
-
s === -1 && (s =
|
|
343
|
-
const h =
|
|
344
|
-
let
|
|
340
|
+
let s = -1, i;
|
|
341
|
+
for (n.lastIndex = 0; (i = n.exec(e)) !== null; ) {
|
|
342
|
+
s === -1 && (s = i.index);
|
|
343
|
+
const h = i[1] ?? "", o = i[2], f = o ? o.trim() : "", d = i[3];
|
|
344
|
+
let x;
|
|
345
345
|
if (d) {
|
|
346
|
-
const
|
|
347
|
-
`).map((
|
|
348
|
-
|
|
346
|
+
const m = d.split(`
|
|
347
|
+
`).map((w) => w.trim()).filter((w) => w.length > 0).join(" ");
|
|
348
|
+
m && (x = m);
|
|
349
349
|
}
|
|
350
|
-
r.push({ id: h, label:
|
|
350
|
+
r.push({ id: h, label: f, description: x });
|
|
351
351
|
}
|
|
352
352
|
if (r.length >= 2)
|
|
353
353
|
return { preamble: s > 0 ? e.substring(0, s).trim() : "", options: r };
|
|
354
354
|
const l = /^(.*?(?:what would you like to do\??|choose an option|select.*?:|here are your options.*?:))\s*\n+((?:\d+\.\s+.+\n?)+)/ims, c = e.match(l);
|
|
355
355
|
if (c && c[1] && c[2]) {
|
|
356
|
-
const h = c[1].trim(), o = c[2],
|
|
356
|
+
const h = c[1].trim(), o = c[2], f = /(\d+)\.\s+([^\n]+)/g;
|
|
357
357
|
let d;
|
|
358
|
-
for (; (d =
|
|
359
|
-
const
|
|
358
|
+
for (; (d = f.exec(o)) !== null; ) {
|
|
359
|
+
const x = d[1] ?? "", m = d[2], w = m ? m.trim() : "";
|
|
360
360
|
r.push({
|
|
361
|
-
id:
|
|
362
|
-
label:
|
|
361
|
+
id: x,
|
|
362
|
+
label: w
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
if (r.length >= 2)
|
|
@@ -367,8 +367,8 @@ function wt(e) {
|
|
|
367
367
|
}
|
|
368
368
|
return null;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
return /* @__PURE__ */
|
|
370
|
+
function or({ className: e }) {
|
|
371
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
372
372
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "5" }),
|
|
373
373
|
/* @__PURE__ */ t("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
374
374
|
/* @__PURE__ */ t("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
@@ -380,29 +380,29 @@ function lr({ className: e }) {
|
|
|
380
380
|
/* @__PURE__ */ t("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
381
381
|
] });
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function cr({ className: e }) {
|
|
384
384
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function We({ className: e }) {
|
|
387
387
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "6 9 12 15 18 9" }) });
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function be({ className: e }) {
|
|
390
390
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "9 18 15 12 9 6" }) });
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function dr({ className: e }) {
|
|
393
393
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "15 18 9 12 15 6" }) });
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ur({ className: e }) {
|
|
396
396
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "18 15 12 9 6 15" }) });
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return /* @__PURE__ */
|
|
398
|
+
function Ie({ className: e }) {
|
|
399
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
400
400
|
/* @__PURE__ */ t("polyline", { points: "4 17 10 11 4 5" }),
|
|
401
401
|
/* @__PURE__ */ t("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
402
402
|
] });
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return /* @__PURE__ */
|
|
404
|
+
function Be({ className: e }) {
|
|
405
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
406
406
|
/* @__PURE__ */ t("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
407
407
|
/* @__PURE__ */ t("polyline", { points: "14 2 14 8 20 8" }),
|
|
408
408
|
/* @__PURE__ */ t("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
@@ -410,72 +410,72 @@ function We({ className: e }) {
|
|
|
410
410
|
] });
|
|
411
411
|
}
|
|
412
412
|
function Oe({ className: e }) {
|
|
413
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
414
414
|
/* @__PURE__ */ t("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
415
415
|
/* @__PURE__ */ t("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
416
416
|
] });
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
return /* @__PURE__ */
|
|
418
|
+
function Nt({ className: e }) {
|
|
419
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
420
420
|
/* @__PURE__ */ t("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
421
421
|
/* @__PURE__ */ t("polyline", { points: "14 2 14 8 20 8" }),
|
|
422
422
|
/* @__PURE__ */ t("line", { x1: "12", y1: "18", x2: "12", y2: "12" }),
|
|
423
423
|
/* @__PURE__ */ t("line", { x1: "9", y1: "15", x2: "15", y2: "15" })
|
|
424
424
|
] });
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
return /* @__PURE__ */
|
|
426
|
+
function Se({ className: e }) {
|
|
427
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
428
428
|
/* @__PURE__ */ t("circle", { cx: "11", cy: "11", r: "8" }),
|
|
429
429
|
/* @__PURE__ */ t("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
430
430
|
] });
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
return /* @__PURE__ */
|
|
432
|
+
function kt({ className: e }) {
|
|
433
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
434
434
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
435
435
|
/* @__PURE__ */ t("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
436
436
|
/* @__PURE__ */ t("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
437
437
|
] });
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return /* @__PURE__ */
|
|
439
|
+
function Ct({ className: e }) {
|
|
440
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
441
441
|
/* @__PURE__ */ t("path", { d: "M12 2v6" }),
|
|
442
442
|
/* @__PURE__ */ t("path", { d: "M6 6v4a6 6 0 0 0 12 0V6" }),
|
|
443
443
|
/* @__PURE__ */ t("path", { d: "M12 16v6" })
|
|
444
444
|
] });
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function _t({ className: e }) {
|
|
447
447
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" }) });
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return /* @__PURE__ */
|
|
449
|
+
function Tt({ className: e }) {
|
|
450
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
451
451
|
/* @__PURE__ */ t("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }),
|
|
452
452
|
/* @__PURE__ */ t("circle", { cx: "11", cy: "13", r: "3" }),
|
|
453
453
|
/* @__PURE__ */ t("line", { x1: "15", y1: "16", x2: "17", y2: "18" })
|
|
454
454
|
] });
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
return /* @__PURE__ */
|
|
456
|
+
function hr({ className: e }) {
|
|
457
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
458
458
|
/* @__PURE__ */ t("polyline", { points: "16 18 22 12 16 6" }),
|
|
459
459
|
/* @__PURE__ */ t("polyline", { points: "8 6 2 12 8 18" })
|
|
460
460
|
] });
|
|
461
461
|
}
|
|
462
|
-
function
|
|
463
|
-
return /* @__PURE__ */
|
|
462
|
+
function St({ className: e }) {
|
|
463
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
464
464
|
/* @__PURE__ */ t("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
465
465
|
/* @__PURE__ */ t("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
466
466
|
] });
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function Ye({ className: e }) {
|
|
469
469
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "20 6 9 17 4 12" }) });
|
|
470
470
|
}
|
|
471
471
|
function mr({ className: e }) {
|
|
472
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
473
473
|
/* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
474
474
|
/* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
475
475
|
] });
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return /* @__PURE__ */
|
|
477
|
+
function Mt({ className: e }) {
|
|
478
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
479
479
|
/* @__PURE__ */ t("line", { x1: "12", y1: "2", x2: "12", y2: "6" }),
|
|
480
480
|
/* @__PURE__ */ t("line", { x1: "12", y1: "18", x2: "12", y2: "22" }),
|
|
481
481
|
/* @__PURE__ */ t("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }),
|
|
@@ -486,29 +486,29 @@ function _t({ className: e }) {
|
|
|
486
486
|
/* @__PURE__ */ t("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })
|
|
487
487
|
] });
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
return /* @__PURE__ */
|
|
489
|
+
function Et({ className: e }) {
|
|
490
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
491
491
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
492
492
|
/* @__PURE__ */ t("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
493
493
|
/* @__PURE__ */ t("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
494
494
|
] });
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
return /* @__PURE__ */
|
|
496
|
+
function Ze({ className: e }) {
|
|
497
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
498
498
|
/* @__PURE__ */ t("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
499
499
|
/* @__PURE__ */ t("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
500
500
|
/* @__PURE__ */ t("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
501
501
|
] });
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
return /* @__PURE__ */
|
|
503
|
+
function It({ className: e }) {
|
|
504
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
505
505
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
506
506
|
/* @__PURE__ */ t("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
507
507
|
/* @__PURE__ */ t("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
508
508
|
] });
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
return /* @__PURE__ */
|
|
510
|
+
function Lt({ className: e }) {
|
|
511
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
512
512
|
/* @__PURE__ */ t("rect", { x: "8", y: "6", width: "8", height: "14", rx: "4" }),
|
|
513
513
|
/* @__PURE__ */ t("path", { d: "M3 10h2" }),
|
|
514
514
|
/* @__PURE__ */ t("path", { d: "M19 10h2" }),
|
|
@@ -518,30 +518,30 @@ function Mt({ className: e }) {
|
|
|
518
518
|
/* @__PURE__ */ t("path", { d: "M12 2v4" })
|
|
519
519
|
] });
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
return /* @__PURE__ */
|
|
521
|
+
function $t({ className: e }) {
|
|
522
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
523
523
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
524
524
|
/* @__PURE__ */ t("path", { d: "M9 12l2 2 4-4" })
|
|
525
525
|
] });
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
return /* @__PURE__ */
|
|
527
|
+
function Rt({ className: e }) {
|
|
528
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
529
529
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
530
530
|
/* @__PURE__ */ t("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
531
531
|
/* @__PURE__ */ t("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
532
532
|
] });
|
|
533
533
|
}
|
|
534
534
|
function pr({ className: e }) {
|
|
535
|
-
return /* @__PURE__ */
|
|
535
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
536
536
|
/* @__PURE__ */ t("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
537
537
|
/* @__PURE__ */ t("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
|
|
538
538
|
] });
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function At({ className: e }) {
|
|
541
541
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
|
|
542
542
|
}
|
|
543
543
|
function fr({ className: e }) {
|
|
544
|
-
return /* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
545
545
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
546
546
|
/* @__PURE__ */ t("rect", { x: "9", y: "9", width: "6", height: "6" })
|
|
547
547
|
] });
|
|
@@ -549,21 +549,21 @@ function fr({ className: e }) {
|
|
|
549
549
|
function xr({ className: e }) {
|
|
550
550
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
return /* @__PURE__ */
|
|
552
|
+
function Qe({ className: e }) {
|
|
553
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
554
554
|
/* @__PURE__ */ t("path", { d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z" }),
|
|
555
555
|
/* @__PURE__ */ t("path", { d: "M5 19l.5 1.5L7 21l-1.5.5L5 23l-.5-1.5L3 21l1.5-.5L5 19z" }),
|
|
556
556
|
/* @__PURE__ */ t("path", { d: "M19 11l.5 1.5L21 13l-1.5.5L19 15l-.5-1.5L17 13l1.5-.5L19 11z" })
|
|
557
557
|
] });
|
|
558
558
|
}
|
|
559
559
|
function gr({ className: e }) {
|
|
560
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
561
561
|
/* @__PURE__ */ t("path", { d: "M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 4.44-1.54" }),
|
|
562
562
|
/* @__PURE__ */ t("path", { d: "M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-4.44-1.54" })
|
|
563
563
|
] });
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
return /* @__PURE__ */
|
|
565
|
+
function xe({ className: e }) {
|
|
566
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
567
567
|
/* @__PURE__ */ t("path", { d: "M12 8V4H8" }),
|
|
568
568
|
/* @__PURE__ */ t("rect", { x: "5", y: "8", width: "14", height: "12", rx: "2" }),
|
|
569
569
|
/* @__PURE__ */ t("path", { d: "M2 14h2" }),
|
|
@@ -572,17 +572,17 @@ function de({ className: e }) {
|
|
|
572
572
|
/* @__PURE__ */ t("path", { d: "M15 13v2" })
|
|
573
573
|
] });
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return /* @__PURE__ */
|
|
575
|
+
function Dt({ className: e }) {
|
|
576
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
577
577
|
/* @__PURE__ */ t("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
578
578
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "7", r: "4" })
|
|
579
579
|
] });
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function jt({ className: e }) {
|
|
582
582
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }) });
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
return /* @__PURE__ */
|
|
584
|
+
function Wt({ className: e }) {
|
|
585
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
586
586
|
/* @__PURE__ */ t("path", { d: "M10 6h11" }),
|
|
587
587
|
/* @__PURE__ */ t("path", { d: "M10 12h11" }),
|
|
588
588
|
/* @__PURE__ */ t("path", { d: "M10 18h11" }),
|
|
@@ -591,21 +591,21 @@ function Dt({ className: e }) {
|
|
|
591
591
|
/* @__PURE__ */ t("path", { d: "M3 18l2 2 4-4" })
|
|
592
592
|
] });
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
return /* @__PURE__ */
|
|
594
|
+
function Bt({ className: e }) {
|
|
595
|
+
return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
596
596
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
|
|
597
597
|
/* @__PURE__ */ t("polyline", { points: "12 6 12 12 16 14" })
|
|
598
598
|
] });
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function He({ className: e }) {
|
|
601
601
|
return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Ot({ status: e, size: n = "sm", className: r }) {
|
|
604
604
|
const s = {
|
|
605
605
|
sm: "w-2 h-2",
|
|
606
606
|
md: "w-3 h-3",
|
|
607
607
|
lg: "w-4 h-4"
|
|
608
|
-
},
|
|
608
|
+
}, i = {
|
|
609
609
|
pending: "ash-status-pending",
|
|
610
610
|
success: "ash-status-success",
|
|
611
611
|
failed: "ash-status-failed"
|
|
@@ -616,67 +616,90 @@ function Wt({ status: e, size: n = "sm", className: r }) {
|
|
|
616
616
|
className: p(
|
|
617
617
|
"rounded-full flex-shrink-0",
|
|
618
618
|
s[n],
|
|
619
|
-
|
|
619
|
+
i[e],
|
|
620
620
|
r
|
|
621
621
|
)
|
|
622
622
|
}
|
|
623
623
|
);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Xe({ actionType: e, className: n = "w-4 h-4" }) {
|
|
626
626
|
switch (e.action) {
|
|
627
627
|
case "command_run":
|
|
628
|
-
return /* @__PURE__ */ t(
|
|
628
|
+
return /* @__PURE__ */ t(Ie, { className: n });
|
|
629
629
|
case "file_read":
|
|
630
|
-
return /* @__PURE__ */ t(
|
|
630
|
+
return /* @__PURE__ */ t(Be, { className: n });
|
|
631
631
|
case "file_edit":
|
|
632
632
|
return /* @__PURE__ */ t(Oe, { className: n });
|
|
633
633
|
case "file_write":
|
|
634
|
-
return /* @__PURE__ */ t(
|
|
634
|
+
return /* @__PURE__ */ t(Nt, { className: n });
|
|
635
635
|
case "search":
|
|
636
|
-
return /* @__PURE__ */ t(
|
|
636
|
+
return /* @__PURE__ */ t(Se, { className: n });
|
|
637
637
|
case "glob":
|
|
638
|
-
return /* @__PURE__ */ t(
|
|
638
|
+
return /* @__PURE__ */ t(Tt, { className: n });
|
|
639
639
|
case "web_fetch":
|
|
640
|
-
return /* @__PURE__ */ t(
|
|
640
|
+
return /* @__PURE__ */ t(kt, { className: n });
|
|
641
641
|
case "web_search":
|
|
642
|
-
return /* @__PURE__ */ t(
|
|
642
|
+
return /* @__PURE__ */ t(Se, { className: n });
|
|
643
643
|
case "mcp_tool":
|
|
644
|
-
return /* @__PURE__ */ t(
|
|
644
|
+
return /* @__PURE__ */ t(Ct, { className: n });
|
|
645
645
|
case "todo_write":
|
|
646
|
-
return /* @__PURE__ */ t(
|
|
646
|
+
return /* @__PURE__ */ t(Wt, { className: n });
|
|
647
647
|
case "agent_tool":
|
|
648
|
-
return /* @__PURE__ */ t(
|
|
648
|
+
return /* @__PURE__ */ t(xe, { className: n });
|
|
649
649
|
case "generic_tool":
|
|
650
650
|
default:
|
|
651
|
-
return /* @__PURE__ */ t(
|
|
651
|
+
return /* @__PURE__ */ t(_t, { className: n });
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function oe({
|
|
655
655
|
children: e,
|
|
656
656
|
maxHeight: n = 200,
|
|
657
657
|
language: r,
|
|
658
658
|
showLineNumbers: s = !1,
|
|
659
|
-
className:
|
|
659
|
+
className: i
|
|
660
660
|
}) {
|
|
661
|
-
const [l, c] = N(!1), h = e.split(`
|
|
662
|
-
`),
|
|
663
|
-
|
|
661
|
+
const [l, c] = N(!1), [h, o] = N(!1), f = e.split(`
|
|
662
|
+
`), d = f.length > 10 || e.length > 500, x = F(async () => {
|
|
663
|
+
try {
|
|
664
|
+
await navigator.clipboard.writeText(e), o(!0), setTimeout(() => o(!1), 2e3);
|
|
665
|
+
} catch (m) {
|
|
666
|
+
console.error("Failed to copy:", m);
|
|
667
|
+
}
|
|
668
|
+
}, [e]);
|
|
669
|
+
return /* @__PURE__ */ a("div", { className: p("relative rounded-lg overflow-hidden border border-white/10", i), children: [
|
|
670
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-2 bg-[var(--ash-code-header-bg)] border-b border-white/10", children: [
|
|
671
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-white/60 font-medium", children: r || "code" }),
|
|
672
|
+
/* @__PURE__ */ t(
|
|
673
|
+
"button",
|
|
674
|
+
{
|
|
675
|
+
onClick: x,
|
|
676
|
+
className: "flex items-center gap-1.5 text-xs text-white/60 hover:text-white transition-colors",
|
|
677
|
+
children: h ? /* @__PURE__ */ a(_, { children: [
|
|
678
|
+
/* @__PURE__ */ t(Ye, { className: "w-3.5 h-3.5" }),
|
|
679
|
+
/* @__PURE__ */ t("span", { children: "Copied!" })
|
|
680
|
+
] }) : /* @__PURE__ */ a(_, { children: [
|
|
681
|
+
/* @__PURE__ */ t(St, { className: "w-3.5 h-3.5" }),
|
|
682
|
+
/* @__PURE__ */ t("span", { children: "Copy" })
|
|
683
|
+
] })
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
] }),
|
|
664
687
|
/* @__PURE__ */ t(
|
|
665
688
|
"pre",
|
|
666
689
|
{
|
|
667
690
|
className: p(
|
|
668
|
-
"
|
|
669
|
-
!l &&
|
|
691
|
+
"text-xs font-mono text-white/90 p-4 bg-black/30 overflow-x-auto whitespace-pre-wrap break-words",
|
|
692
|
+
!l && d && "overflow-y-hidden"
|
|
670
693
|
),
|
|
671
|
-
style: !l &&
|
|
694
|
+
style: !l && d ? { maxHeight: n } : void 0,
|
|
672
695
|
"data-language": r,
|
|
673
|
-
children: s ? /* @__PURE__ */ t("code", { children:
|
|
674
|
-
/* @__PURE__ */ t("span", { className: "inline-block w-8 text-white/30 select-none text-right pr-2", children:
|
|
675
|
-
/* @__PURE__ */ t("span", { className: "text-white/80", children:
|
|
676
|
-
] },
|
|
696
|
+
children: s ? /* @__PURE__ */ t("code", { children: f.map((m, w) => /* @__PURE__ */ a("span", { className: "block", children: [
|
|
697
|
+
/* @__PURE__ */ t("span", { className: "inline-block w-8 text-white/30 select-none text-right pr-2", children: w + 1 }),
|
|
698
|
+
/* @__PURE__ */ t("span", { className: "text-white/80", children: m })
|
|
699
|
+
] }, w)) }) : /* @__PURE__ */ t("code", { className: "text-white/80", children: e })
|
|
677
700
|
}
|
|
678
701
|
),
|
|
679
|
-
|
|
702
|
+
d && !l && /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 h-12 ash-truncate-fade flex items-end justify-center pb-2", children: /* @__PURE__ */ t(
|
|
680
703
|
"button",
|
|
681
704
|
{
|
|
682
705
|
onClick: () => c(!0),
|
|
@@ -684,7 +707,7 @@ function se({
|
|
|
684
707
|
children: "Show more"
|
|
685
708
|
}
|
|
686
709
|
) }),
|
|
687
|
-
|
|
710
|
+
d && l && /* @__PURE__ */ t(
|
|
688
711
|
"button",
|
|
689
712
|
{
|
|
690
713
|
onClick: () => c(!1),
|
|
@@ -694,59 +717,59 @@ function se({
|
|
|
694
717
|
)
|
|
695
718
|
] });
|
|
696
719
|
}
|
|
697
|
-
function
|
|
720
|
+
function Me({ value: e, maxHeight: n, className: r }) {
|
|
698
721
|
const s = JSON.stringify(e, null, 2);
|
|
699
|
-
return /* @__PURE__ */ t(
|
|
722
|
+
return /* @__PURE__ */ t(oe, { maxHeight: n, className: r, children: s });
|
|
700
723
|
}
|
|
701
|
-
function
|
|
724
|
+
function et({
|
|
702
725
|
toolCall: e,
|
|
703
726
|
defaultExpanded: n = !1,
|
|
704
727
|
className: r,
|
|
705
728
|
depth: s = 0
|
|
706
729
|
}) {
|
|
707
|
-
const [
|
|
708
|
-
if (
|
|
730
|
+
const [i, l] = N(n), [c, h] = N(""), o = V(null), { actionType: f, status: d, summary: x, nestedToolCalls: m, nestedToolCallCount: w, startedAt: E } = e, D = ae(() => {
|
|
731
|
+
if (f.action !== "agent_tool")
|
|
709
732
|
return null;
|
|
710
|
-
const
|
|
733
|
+
const W = f;
|
|
711
734
|
return {
|
|
712
|
-
agentType:
|
|
713
|
-
description:
|
|
714
|
-
prompt:
|
|
735
|
+
agentType: W.agentType,
|
|
736
|
+
description: W.description,
|
|
737
|
+
prompt: W.prompt
|
|
715
738
|
};
|
|
716
|
-
}, [
|
|
717
|
-
if (
|
|
718
|
-
if (
|
|
719
|
-
return h(
|
|
720
|
-
h(
|
|
739
|
+
}, [f]), R = w ?? (m == null ? void 0 : m.length) ?? 0, T = d === "pending";
|
|
740
|
+
if (P(() => {
|
|
741
|
+
if (T && E)
|
|
742
|
+
return h(Ve(E)), o.current = setInterval(() => {
|
|
743
|
+
h(Ve(E));
|
|
721
744
|
}, 1e3), () => {
|
|
722
745
|
o.current && (clearInterval(o.current), o.current = null);
|
|
723
746
|
};
|
|
724
|
-
|
|
725
|
-
}, [
|
|
747
|
+
T || (o.current && (clearInterval(o.current), o.current = null), h(""));
|
|
748
|
+
}, [T, E]), !D)
|
|
726
749
|
return null;
|
|
727
|
-
const { agentType:
|
|
728
|
-
return /* @__PURE__ */
|
|
750
|
+
const { agentType: X, description: S, prompt: G } = D, A = s > 0 ? "ml-4" : "";
|
|
751
|
+
return /* @__PURE__ */ a(
|
|
729
752
|
"div",
|
|
730
753
|
{
|
|
731
754
|
className: p(
|
|
732
755
|
"rounded-xl border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
|
|
733
|
-
|
|
734
|
-
|
|
756
|
+
T ? "border-yellow-500/30" : d === "failed" ? "border-red-500/30" : "border-white/10",
|
|
757
|
+
A,
|
|
735
758
|
r
|
|
736
759
|
),
|
|
737
760
|
children: [
|
|
738
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ a(
|
|
739
762
|
"button",
|
|
740
763
|
{
|
|
741
|
-
onClick: () => l(!
|
|
764
|
+
onClick: () => l(!i),
|
|
742
765
|
className: "w-full px-4 py-3 flex items-center gap-3 hover:bg-white/5 cursor-pointer transition-colors",
|
|
743
766
|
children: [
|
|
744
767
|
/* @__PURE__ */ t(
|
|
745
|
-
|
|
768
|
+
be,
|
|
746
769
|
{
|
|
747
770
|
className: p(
|
|
748
771
|
"w-4 h-4 text-white/40 transition-transform duration-200 shrink-0",
|
|
749
|
-
|
|
772
|
+
i && "rotate-90"
|
|
750
773
|
)
|
|
751
774
|
}
|
|
752
775
|
),
|
|
@@ -755,15 +778,15 @@ function Ze({
|
|
|
755
778
|
{
|
|
756
779
|
className: p(
|
|
757
780
|
"w-6 h-6 rounded-lg flex items-center justify-center shrink-0",
|
|
758
|
-
|
|
781
|
+
T ? "bg-yellow-500/20" : d === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
|
|
759
782
|
),
|
|
760
|
-
children:
|
|
761
|
-
|
|
783
|
+
children: T ? /* @__PURE__ */ t(
|
|
784
|
+
He,
|
|
762
785
|
{
|
|
763
786
|
className: "w-3.5 h-3.5 text-yellow-400 animate-spin"
|
|
764
787
|
}
|
|
765
788
|
) : /* @__PURE__ */ t(
|
|
766
|
-
|
|
789
|
+
xe,
|
|
767
790
|
{
|
|
768
791
|
className: p(
|
|
769
792
|
"w-3.5 h-3.5",
|
|
@@ -778,46 +801,46 @@ function Ze({
|
|
|
778
801
|
{
|
|
779
802
|
className: p(
|
|
780
803
|
"px-2 py-0.5 rounded text-xs font-medium shrink-0",
|
|
781
|
-
|
|
804
|
+
T ? "bg-yellow-500/20 text-yellow-400" : d === "failed" ? "bg-red-500/20 text-red-400" : "bg-white/10 text-white/70"
|
|
782
805
|
),
|
|
783
|
-
children:
|
|
806
|
+
children: X
|
|
784
807
|
}
|
|
785
808
|
),
|
|
786
|
-
/* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children:
|
|
787
|
-
|
|
788
|
-
|
|
809
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children: S || x }),
|
|
810
|
+
R > 0 && /* @__PURE__ */ a("span", { className: "text-xs text-white/50 shrink-0", children: [
|
|
811
|
+
R,
|
|
789
812
|
" tool call",
|
|
790
|
-
|
|
813
|
+
R !== 1 ? "s" : ""
|
|
791
814
|
] }),
|
|
792
|
-
|
|
793
|
-
/* @__PURE__ */ t(
|
|
815
|
+
T && c && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-xs text-white/40 shrink-0", children: [
|
|
816
|
+
/* @__PURE__ */ t(Bt, { className: "w-3 h-3" }),
|
|
794
817
|
/* @__PURE__ */ t("span", { children: c })
|
|
795
818
|
] }),
|
|
796
819
|
/* @__PURE__ */ t("span", { className: "text-white/30 shrink-0", children: "..." })
|
|
797
820
|
]
|
|
798
821
|
}
|
|
799
822
|
),
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
823
|
+
i && /* @__PURE__ */ a("div", { className: "border-t border-white/5 bg-black/20", children: [
|
|
824
|
+
G && /* @__PURE__ */ t("div", { className: "px-4 py-3 border-b border-white/5", children: /* @__PURE__ */ t("p", { className: "text-sm text-white/70 whitespace-pre-wrap", children: G.length > 500 ? G.substring(0, 500) + "..." : G }) }),
|
|
825
|
+
m && m.length > 0 && /* @__PURE__ */ t("div", { className: "p-3 space-y-2", children: m.map((W) => /* @__PURE__ */ t("div", { children: W.actionType.action === "agent_tool" ? /* @__PURE__ */ t(
|
|
826
|
+
et,
|
|
804
827
|
{
|
|
805
|
-
toolCall:
|
|
828
|
+
toolCall: W,
|
|
806
829
|
defaultExpanded: !1,
|
|
807
830
|
depth: s + 1
|
|
808
831
|
}
|
|
809
832
|
) : /* @__PURE__ */ t(
|
|
810
|
-
|
|
833
|
+
ze,
|
|
811
834
|
{
|
|
812
|
-
toolCall:
|
|
835
|
+
toolCall: W,
|
|
813
836
|
defaultExpanded: !1
|
|
814
837
|
}
|
|
815
|
-
) },
|
|
816
|
-
(!
|
|
817
|
-
/* @__PURE__ */ t(
|
|
838
|
+
) }, W.id)) }),
|
|
839
|
+
(!m || m.length === 0) && T && /* @__PURE__ */ t("div", { className: "px-4 py-6 flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-white/40", children: [
|
|
840
|
+
/* @__PURE__ */ t(He, { className: "w-4 h-4 animate-spin" }),
|
|
818
841
|
/* @__PURE__ */ t("span", { children: "Agent is working..." })
|
|
819
842
|
] }) }),
|
|
820
|
-
(!
|
|
843
|
+
(!m || m.length === 0) && !T && /* @__PURE__ */ t("div", { className: "px-4 py-4 text-sm text-white/40 text-center", children: "No tool calls recorded" })
|
|
821
844
|
] })
|
|
822
845
|
]
|
|
823
846
|
}
|
|
@@ -827,20 +850,20 @@ function L({ children: e }) {
|
|
|
827
850
|
return /* @__PURE__ */ t("div", { className: "ash-tool-section-header", children: e });
|
|
828
851
|
}
|
|
829
852
|
function $({ children: e }) {
|
|
830
|
-
return /* @__PURE__ */ t("div", { className: "px-3 py-
|
|
853
|
+
return /* @__PURE__ */ t("div", { className: "px-3 py-1.5", children: e });
|
|
831
854
|
}
|
|
832
|
-
function
|
|
855
|
+
function zt({ action: e }) {
|
|
833
856
|
var n;
|
|
834
|
-
return /* @__PURE__ */
|
|
835
|
-
e.command && /* @__PURE__ */
|
|
857
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
858
|
+
e.command && /* @__PURE__ */ a(_, { children: [
|
|
836
859
|
/* @__PURE__ */ t(L, { children: "COMMAND" }),
|
|
837
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
860
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { children: e.command }) })
|
|
838
861
|
] }),
|
|
839
|
-
((n = e.result) == null ? void 0 : n.output) && /* @__PURE__ */
|
|
862
|
+
((n = e.result) == null ? void 0 : n.output) && /* @__PURE__ */ a(_, { children: [
|
|
840
863
|
/* @__PURE__ */ t(L, { children: "OUTPUT" }),
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */ t(
|
|
843
|
-
e.result.exitCode !== void 0 && e.result.exitCode !== 0 && /* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ a($, { children: [
|
|
865
|
+
/* @__PURE__ */ t(oe, { maxHeight: 300, children: e.result.output }),
|
|
866
|
+
e.result.exitCode !== void 0 && e.result.exitCode !== 0 && /* @__PURE__ */ a("div", { className: "mt-2 text-xs text-red-400", children: [
|
|
844
867
|
"Exit code: ",
|
|
845
868
|
e.result.exitCode
|
|
846
869
|
] })
|
|
@@ -848,18 +871,18 @@ function Ot({ action: e }) {
|
|
|
848
871
|
] })
|
|
849
872
|
] });
|
|
850
873
|
}
|
|
851
|
-
function
|
|
852
|
-
return /* @__PURE__ */
|
|
874
|
+
function Ft({ action: e }) {
|
|
875
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
853
876
|
/* @__PURE__ */ t(L, { children: "PATH" }),
|
|
854
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ a($, { children: [
|
|
855
878
|
/* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.path }),
|
|
856
|
-
(e.offset !== void 0 || e.limit !== void 0) && /* @__PURE__ */
|
|
857
|
-
e.offset !== void 0 && /* @__PURE__ */
|
|
879
|
+
(e.offset !== void 0 || e.limit !== void 0) && /* @__PURE__ */ a("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
880
|
+
e.offset !== void 0 && /* @__PURE__ */ a("span", { children: [
|
|
858
881
|
"Offset: ",
|
|
859
882
|
e.offset
|
|
860
883
|
] }),
|
|
861
884
|
e.offset !== void 0 && e.limit !== void 0 && /* @__PURE__ */ t("span", { children: " · " }),
|
|
862
|
-
e.limit !== void 0 && /* @__PURE__ */
|
|
885
|
+
e.limit !== void 0 && /* @__PURE__ */ a("span", { children: [
|
|
863
886
|
"Limit: ",
|
|
864
887
|
e.limit
|
|
865
888
|
] })
|
|
@@ -867,45 +890,45 @@ function Bt({ action: e }) {
|
|
|
867
890
|
] })
|
|
868
891
|
] });
|
|
869
892
|
}
|
|
870
|
-
function
|
|
871
|
-
return /* @__PURE__ */
|
|
893
|
+
function Pt({ action: e }) {
|
|
894
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
872
895
|
/* @__PURE__ */ t(L, { children: "PATH" }),
|
|
873
896
|
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.path }) }),
|
|
874
|
-
e.oldString && /* @__PURE__ */
|
|
897
|
+
e.oldString && /* @__PURE__ */ a(_, { children: [
|
|
875
898
|
/* @__PURE__ */ t(L, { children: "OLD" }),
|
|
876
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
899
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { children: e.oldString }) })
|
|
877
900
|
] }),
|
|
878
|
-
e.newString && /* @__PURE__ */
|
|
901
|
+
e.newString && /* @__PURE__ */ a(_, { children: [
|
|
879
902
|
/* @__PURE__ */ t(L, { children: "NEW" }),
|
|
880
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
903
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { children: e.newString }) })
|
|
881
904
|
] })
|
|
882
905
|
] });
|
|
883
906
|
}
|
|
884
|
-
function
|
|
885
|
-
return /* @__PURE__ */
|
|
907
|
+
function Gt({ action: e }) {
|
|
908
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
886
909
|
/* @__PURE__ */ t(L, { children: "PATH" }),
|
|
887
910
|
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.path }) }),
|
|
888
|
-
e.content && /* @__PURE__ */
|
|
911
|
+
e.content && /* @__PURE__ */ a(_, { children: [
|
|
889
912
|
/* @__PURE__ */ t(L, { children: "CONTENT" }),
|
|
890
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
913
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { maxHeight: 300, children: e.content }) })
|
|
891
914
|
] })
|
|
892
915
|
] });
|
|
893
916
|
}
|
|
894
|
-
function
|
|
895
|
-
return /* @__PURE__ */
|
|
917
|
+
function Vt({ action: e }) {
|
|
918
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
896
919
|
/* @__PURE__ */ t(L, { children: "PATTERN" }),
|
|
897
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ a($, { children: [
|
|
898
921
|
/* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.pattern }),
|
|
899
|
-
(e.path || e.glob || e.type) && /* @__PURE__ */
|
|
900
|
-
e.path && /* @__PURE__ */
|
|
922
|
+
(e.path || e.glob || e.type) && /* @__PURE__ */ a("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
923
|
+
e.path && /* @__PURE__ */ a("span", { children: [
|
|
901
924
|
"Path: ",
|
|
902
925
|
e.path
|
|
903
926
|
] }),
|
|
904
|
-
e.glob && /* @__PURE__ */
|
|
927
|
+
e.glob && /* @__PURE__ */ a("span", { children: [
|
|
905
928
|
"Glob: ",
|
|
906
929
|
e.glob
|
|
907
930
|
] }),
|
|
908
|
-
e.type && /* @__PURE__ */
|
|
931
|
+
e.type && /* @__PURE__ */ a("span", { children: [
|
|
909
932
|
"Type: ",
|
|
910
933
|
e.type
|
|
911
934
|
] })
|
|
@@ -914,11 +937,11 @@ function Pt({ action: e }) {
|
|
|
914
937
|
] });
|
|
915
938
|
}
|
|
916
939
|
function Ht({ action: e }) {
|
|
917
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
918
941
|
/* @__PURE__ */ t(L, { children: "PATTERN" }),
|
|
919
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ a($, { children: [
|
|
920
943
|
/* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.pattern }),
|
|
921
|
-
e.path && /* @__PURE__ */
|
|
944
|
+
e.path && /* @__PURE__ */ a("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
922
945
|
"Path: ",
|
|
923
946
|
e.path
|
|
924
947
|
] })
|
|
@@ -926,9 +949,9 @@ function Ht({ action: e }) {
|
|
|
926
949
|
] });
|
|
927
950
|
}
|
|
928
951
|
function qt({ action: e }) {
|
|
929
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
930
953
|
/* @__PURE__ */ t(L, { children: "URL" }),
|
|
931
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ a($, { children: [
|
|
932
955
|
/* @__PURE__ */ t(
|
|
933
956
|
"a",
|
|
934
957
|
{
|
|
@@ -943,49 +966,49 @@ function qt({ action: e }) {
|
|
|
943
966
|
] })
|
|
944
967
|
] });
|
|
945
968
|
}
|
|
946
|
-
function
|
|
947
|
-
return /* @__PURE__ */
|
|
969
|
+
function Jt({ action: e }) {
|
|
970
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
948
971
|
/* @__PURE__ */ t(L, { children: "QUERY" }),
|
|
949
972
|
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("span", { className: "text-sm text-white/90", children: e.query }) })
|
|
950
973
|
] });
|
|
951
974
|
}
|
|
952
|
-
function
|
|
953
|
-
return /* @__PURE__ */
|
|
975
|
+
function Ut({ action: e, isError: n }) {
|
|
976
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
954
977
|
/* @__PURE__ */ t(L, { children: "TOOL" }),
|
|
955
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ a("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: [
|
|
956
979
|
e.serverName,
|
|
957
980
|
":",
|
|
958
981
|
e.toolName
|
|
959
982
|
] }) }),
|
|
960
|
-
e.arguments && /* @__PURE__ */
|
|
983
|
+
e.arguments && /* @__PURE__ */ a(_, { children: [
|
|
961
984
|
/* @__PURE__ */ t(L, { children: "ARGS" }),
|
|
962
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
985
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Me, { value: e.arguments }) })
|
|
963
986
|
] }),
|
|
964
|
-
e.result && /* @__PURE__ */
|
|
987
|
+
e.result && /* @__PURE__ */ a(_, { children: [
|
|
965
988
|
/* @__PURE__ */ t(L, { children: n ? "ERROR" : "RESULT" }),
|
|
966
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(
|
|
989
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(oe, { children: String(e.result.value) }) : /* @__PURE__ */ t(Me, { value: e.result.value }) }) })
|
|
967
990
|
] })
|
|
968
991
|
] });
|
|
969
992
|
}
|
|
970
|
-
function
|
|
971
|
-
return /* @__PURE__ */
|
|
972
|
-
e.arguments && /* @__PURE__ */
|
|
993
|
+
function Kt({ action: e, isError: n }) {
|
|
994
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
995
|
+
e.arguments && /* @__PURE__ */ a(_, { children: [
|
|
973
996
|
/* @__PURE__ */ t(L, { children: "ARGS" }),
|
|
974
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
997
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Me, { value: e.arguments }) })
|
|
975
998
|
] }),
|
|
976
|
-
e.result && /* @__PURE__ */
|
|
999
|
+
e.result && /* @__PURE__ */ a(_, { children: [
|
|
977
1000
|
/* @__PURE__ */ t(L, { children: n ? "ERROR" : "RESULT" }),
|
|
978
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(
|
|
1001
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(oe, { children: String(e.result.value) }) : /* @__PURE__ */ t(Me, { value: e.result.value }) }) })
|
|
979
1002
|
] })
|
|
980
1003
|
] });
|
|
981
1004
|
}
|
|
982
|
-
function
|
|
1005
|
+
function Yt({ action: e }) {
|
|
983
1006
|
const { todos: n, stats: r } = e;
|
|
984
|
-
return /* @__PURE__ */
|
|
985
|
-
r && /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ a(_, { children: [
|
|
1008
|
+
r && /* @__PURE__ */ a(_, { children: [
|
|
986
1009
|
/* @__PURE__ */ t(L, { children: "PROGRESS" }),
|
|
987
|
-
/* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ a($, { children: [
|
|
1011
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
989
1012
|
/* @__PURE__ */ t("div", { className: "flex-1 h-2 bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ t(
|
|
990
1013
|
"div",
|
|
991
1014
|
{
|
|
@@ -993,18 +1016,18 @@ function Ut({ action: e }) {
|
|
|
993
1016
|
style: { width: `${r.total > 0 ? r.completed / r.total * 100 : 0}%` }
|
|
994
1017
|
}
|
|
995
1018
|
) }),
|
|
996
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ a("span", { className: "text-xs text-white/60 tabular-nums", children: [
|
|
997
1020
|
r.completed,
|
|
998
1021
|
"/",
|
|
999
1022
|
r.total
|
|
1000
1023
|
] })
|
|
1001
1024
|
] }),
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
r.inProgress > 0 && /* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ a("div", { className: "flex gap-3 mt-2 text-xs", children: [
|
|
1026
|
+
r.inProgress > 0 && /* @__PURE__ */ a("span", { className: "text-yellow-400", children: [
|
|
1004
1027
|
r.inProgress,
|
|
1005
1028
|
" in progress"
|
|
1006
1029
|
] }),
|
|
1007
|
-
r.pending > 0 && /* @__PURE__ */
|
|
1030
|
+
r.pending > 0 && /* @__PURE__ */ a("span", { className: "text-white/40", children: [
|
|
1008
1031
|
r.pending,
|
|
1009
1032
|
" pending"
|
|
1010
1033
|
] })
|
|
@@ -1012,9 +1035,9 @@ function Ut({ action: e }) {
|
|
|
1012
1035
|
] })
|
|
1013
1036
|
] }),
|
|
1014
1037
|
/* @__PURE__ */ t(L, { children: "TASKS" }),
|
|
1015
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: "space-y-1.5", children: n.map((s,
|
|
1038
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: "space-y-1.5", children: n.map((s, i) => {
|
|
1016
1039
|
const l = s.status === "in_progress" ? s.activeForm : s.content;
|
|
1017
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ a(
|
|
1018
1041
|
"div",
|
|
1019
1042
|
{
|
|
1020
1043
|
className: p(
|
|
@@ -1023,8 +1046,8 @@ function Ut({ action: e }) {
|
|
|
1023
1046
|
s.status === "in_progress" && "bg-yellow-500/10 -mx-2 px-2 rounded"
|
|
1024
1047
|
),
|
|
1025
1048
|
children: [
|
|
1026
|
-
s.status === "completed" ? /* @__PURE__ */ t(
|
|
1027
|
-
/* @__PURE__ */
|
|
1049
|
+
s.status === "completed" ? /* @__PURE__ */ t($t, { className: "w-4 h-4 text-emerald-400 shrink-0 mt-0.5" }) : s.status === "in_progress" ? /* @__PURE__ */ t(Mt, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ t(jt, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
|
|
1050
|
+
/* @__PURE__ */ a(
|
|
1028
1051
|
"span",
|
|
1029
1052
|
{
|
|
1030
1053
|
className: p(
|
|
@@ -1032,8 +1055,8 @@ function Ut({ action: e }) {
|
|
|
1032
1055
|
s.status === "completed" ? "text-white/50 line-through" : "text-white/80"
|
|
1033
1056
|
),
|
|
1034
1057
|
children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
|
|
1058
|
+
/* @__PURE__ */ a("span", { className: "text-white/40 mr-1.5", children: [
|
|
1059
|
+
i + 1,
|
|
1037
1060
|
"."
|
|
1038
1061
|
] }),
|
|
1039
1062
|
l
|
|
@@ -1042,40 +1065,40 @@ function Ut({ action: e }) {
|
|
|
1042
1065
|
)
|
|
1043
1066
|
]
|
|
1044
1067
|
},
|
|
1045
|
-
`${s.content}-${
|
|
1068
|
+
`${s.content}-${i}`
|
|
1046
1069
|
);
|
|
1047
1070
|
}) }) })
|
|
1048
1071
|
] });
|
|
1049
1072
|
}
|
|
1050
|
-
function
|
|
1073
|
+
function Zt({ actionType: e, isError: n }) {
|
|
1051
1074
|
switch (e.action) {
|
|
1052
1075
|
case "command_run":
|
|
1053
|
-
return /* @__PURE__ */ t(
|
|
1076
|
+
return /* @__PURE__ */ t(zt, { action: e });
|
|
1054
1077
|
case "file_read":
|
|
1055
|
-
return /* @__PURE__ */ t(
|
|
1078
|
+
return /* @__PURE__ */ t(Ft, { action: e });
|
|
1056
1079
|
case "file_edit":
|
|
1057
|
-
return /* @__PURE__ */ t(
|
|
1080
|
+
return /* @__PURE__ */ t(Pt, { action: e });
|
|
1058
1081
|
case "file_write":
|
|
1059
|
-
return /* @__PURE__ */ t(
|
|
1082
|
+
return /* @__PURE__ */ t(Gt, { action: e });
|
|
1060
1083
|
case "search":
|
|
1061
|
-
return /* @__PURE__ */ t(
|
|
1084
|
+
return /* @__PURE__ */ t(Vt, { action: e });
|
|
1062
1085
|
case "glob":
|
|
1063
1086
|
return /* @__PURE__ */ t(Ht, { action: e });
|
|
1064
1087
|
case "web_fetch":
|
|
1065
1088
|
return /* @__PURE__ */ t(qt, { action: e });
|
|
1066
1089
|
case "web_search":
|
|
1067
|
-
return /* @__PURE__ */ t(
|
|
1090
|
+
return /* @__PURE__ */ t(Jt, { action: e });
|
|
1068
1091
|
case "mcp_tool":
|
|
1069
|
-
return /* @__PURE__ */ t(
|
|
1092
|
+
return /* @__PURE__ */ t(Ut, { action: e, isError: n });
|
|
1070
1093
|
case "generic_tool":
|
|
1071
|
-
return /* @__PURE__ */ t(
|
|
1094
|
+
return /* @__PURE__ */ t(Kt, { action: e, isError: n });
|
|
1072
1095
|
case "todo_write":
|
|
1073
|
-
return /* @__PURE__ */ t(
|
|
1096
|
+
return /* @__PURE__ */ t(Yt, { action: e });
|
|
1074
1097
|
default:
|
|
1075
1098
|
return null;
|
|
1076
1099
|
}
|
|
1077
1100
|
}
|
|
1078
|
-
function
|
|
1101
|
+
function Qt(e) {
|
|
1079
1102
|
var n;
|
|
1080
1103
|
switch (e.action) {
|
|
1081
1104
|
case "command_run":
|
|
@@ -1107,23 +1130,23 @@ function Yt(e) {
|
|
|
1107
1130
|
return !1;
|
|
1108
1131
|
}
|
|
1109
1132
|
}
|
|
1110
|
-
function
|
|
1111
|
-
const [s,
|
|
1133
|
+
function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
|
|
1134
|
+
const [s, i] = N(n), { actionType: l, status: c, summary: h } = e;
|
|
1112
1135
|
if (l.action === "agent_tool")
|
|
1113
1136
|
return /* @__PURE__ */ t(
|
|
1114
|
-
|
|
1137
|
+
et,
|
|
1115
1138
|
{
|
|
1116
1139
|
toolCall: e,
|
|
1117
1140
|
defaultExpanded: n,
|
|
1118
1141
|
className: r
|
|
1119
1142
|
}
|
|
1120
1143
|
);
|
|
1121
|
-
const o =
|
|
1122
|
-
return /* @__PURE__ */
|
|
1144
|
+
const o = Qt(l);
|
|
1145
|
+
return /* @__PURE__ */ a(
|
|
1123
1146
|
"div",
|
|
1124
1147
|
{
|
|
1125
1148
|
className: p(
|
|
1126
|
-
"rounded-
|
|
1149
|
+
"rounded-lg border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
|
|
1127
1150
|
{
|
|
1128
1151
|
pending: "border-yellow-500/30 ash-tool-status-pending",
|
|
1129
1152
|
success: "border-white/10",
|
|
@@ -1132,40 +1155,40 @@ function Be({ toolCall: e, defaultExpanded: n = !1, className: r }) {
|
|
|
1132
1155
|
r
|
|
1133
1156
|
),
|
|
1134
1157
|
children: [
|
|
1135
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ a(
|
|
1136
1159
|
"button",
|
|
1137
1160
|
{
|
|
1138
|
-
onClick: () => o &&
|
|
1161
|
+
onClick: () => o && i(!s),
|
|
1139
1162
|
className: p(
|
|
1140
|
-
"w-full px-
|
|
1163
|
+
"w-full px-3 py-2 flex items-center justify-between transition-colors",
|
|
1141
1164
|
o ? "hover:bg-white/5 cursor-pointer" : "cursor-default"
|
|
1142
1165
|
),
|
|
1143
1166
|
disabled: !o,
|
|
1144
1167
|
children: [
|
|
1145
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
1146
1169
|
/* @__PURE__ */ t("div", { className: p(
|
|
1147
|
-
"w-
|
|
1170
|
+
"w-5 h-5 rounded flex items-center justify-center shrink-0",
|
|
1148
1171
|
c === "pending" ? "bg-yellow-500/20" : c === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
|
|
1149
1172
|
), children: /* @__PURE__ */ t(
|
|
1150
|
-
|
|
1173
|
+
Xe,
|
|
1151
1174
|
{
|
|
1152
1175
|
actionType: l,
|
|
1153
1176
|
className: p(
|
|
1154
|
-
"w-3
|
|
1177
|
+
"w-3 h-3",
|
|
1155
1178
|
c === "pending" ? "text-yellow-400" : c === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
|
|
1156
1179
|
)
|
|
1157
1180
|
}
|
|
1158
1181
|
) }),
|
|
1159
|
-
/* @__PURE__ */ t("span", { className: "text-
|
|
1160
|
-
/* @__PURE__ */ t("span", { className: "font-mono text-
|
|
1182
|
+
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-white shrink-0", children: Ke(l) }),
|
|
1183
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[12px] truncate text-white/50 min-w-0", children: h })
|
|
1161
1184
|
] }),
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */ t(
|
|
1185
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1186
|
+
/* @__PURE__ */ t(Ot, { status: c, size: "sm" }),
|
|
1164
1187
|
o && /* @__PURE__ */ t(
|
|
1165
|
-
|
|
1188
|
+
We,
|
|
1166
1189
|
{
|
|
1167
1190
|
className: p(
|
|
1168
|
-
"w-
|
|
1191
|
+
"w-3.5 h-3.5 text-white/30 transition-transform duration-200",
|
|
1169
1192
|
s && "rotate-180"
|
|
1170
1193
|
)
|
|
1171
1194
|
}
|
|
@@ -1174,31 +1197,36 @@ function Be({ toolCall: e, defaultExpanded: n = !1, className: r }) {
|
|
|
1174
1197
|
]
|
|
1175
1198
|
}
|
|
1176
1199
|
),
|
|
1177
|
-
s && o && /* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */ t(
|
|
1179
|
-
c === "success" && /* @__PURE__ */ t("div", { className: "px-
|
|
1180
|
-
/* @__PURE__ */ t(
|
|
1181
|
-
/* @__PURE__ */ t("span", { className: "text-
|
|
1200
|
+
s && o && /* @__PURE__ */ a("div", { className: "border-t border-white/5 max-h-[350px] overflow-y-auto ash-scrollbar bg-black/20", children: [
|
|
1201
|
+
/* @__PURE__ */ t(Zt, { actionType: l, isError: e.isError || c === "failed" }),
|
|
1202
|
+
c === "success" && /* @__PURE__ */ t("div", { className: "px-3 py-2 border-t border-white/5 bg-[var(--ash-accent)]/5", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
1203
|
+
/* @__PURE__ */ t(Ye, { className: "w-3.5 h-3.5 text-[var(--ash-accent)]" }),
|
|
1204
|
+
/* @__PURE__ */ t("span", { className: "text-[12px] text-[var(--ash-accent)] font-medium", children: "Completed" })
|
|
1182
1205
|
] }) }),
|
|
1183
|
-
c === "failed" && /* @__PURE__ */ t("div", { className: "px-
|
|
1184
|
-
/* @__PURE__ */ t(
|
|
1185
|
-
/* @__PURE__ */ t("span", { className: "text-
|
|
1206
|
+
c === "failed" && /* @__PURE__ */ t("div", { className: "px-3 py-2 border-t border-red-500/20 bg-red-500/10", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
|
|
1207
|
+
/* @__PURE__ */ t(Rt, { className: "w-3.5 h-3.5 text-red-400" }),
|
|
1208
|
+
/* @__PURE__ */ t("span", { className: "text-[12px] text-red-400 font-medium", children: "Failed" })
|
|
1186
1209
|
] }) })
|
|
1187
1210
|
] })
|
|
1188
1211
|
]
|
|
1189
1212
|
}
|
|
1190
1213
|
);
|
|
1191
1214
|
}
|
|
1192
|
-
var
|
|
1193
|
-
function
|
|
1194
|
-
const [
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}, [])
|
|
1215
|
+
var Xt = dt(() => import("./index-DJwpy-R5.js"));
|
|
1216
|
+
function Fe({ children: e, fallback: n, components: r, className: s }) {
|
|
1217
|
+
const [i, l] = N(!1);
|
|
1218
|
+
P(() => {
|
|
1219
|
+
l(!0);
|
|
1220
|
+
}, []);
|
|
1221
|
+
const c = ae(() => {
|
|
1222
|
+
if (r)
|
|
1223
|
+
return r;
|
|
1224
|
+
}, [r]);
|
|
1225
|
+
return i ? /* @__PURE__ */ t(ut, { fallback: /* @__PURE__ */ t("span", { className: s, children: n ?? e }), children: /* @__PURE__ */ t(Xt, { components: c, children: e }) }) : /* @__PURE__ */ t("span", { className: s, children: n ?? e });
|
|
1198
1226
|
}
|
|
1199
|
-
function
|
|
1227
|
+
function en({ segment: e }) {
|
|
1200
1228
|
const n = e.color ? `${e.color}20` : "rgba(34, 197, 94, 0.2)", r = e.color || "#22c55e", s = e.color ? `${e.color}40` : "rgba(34, 197, 94, 0.4)";
|
|
1201
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ a(
|
|
1202
1230
|
"span",
|
|
1203
1231
|
{
|
|
1204
1232
|
className: "inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium mx-0.5",
|
|
@@ -1215,20 +1243,20 @@ function Qt({ segment: e }) {
|
|
|
1215
1243
|
}
|
|
1216
1244
|
);
|
|
1217
1245
|
}
|
|
1218
|
-
function
|
|
1246
|
+
function tn({
|
|
1219
1247
|
content: e,
|
|
1220
1248
|
renderers: n,
|
|
1221
1249
|
className: r
|
|
1222
1250
|
}) {
|
|
1223
|
-
return /* @__PURE__ */ t("div", { className: p("rich-content", r), children: e.map((s,
|
|
1224
|
-
const l = `segment-${
|
|
1251
|
+
return /* @__PURE__ */ t("div", { className: p("rich-content", r), children: e.map((s, i) => {
|
|
1252
|
+
const l = `segment-${i}`;
|
|
1225
1253
|
switch (s.type) {
|
|
1226
1254
|
case "text":
|
|
1227
|
-
return /* @__PURE__ */ t(
|
|
1255
|
+
return /* @__PURE__ */ t($e, { children: /* @__PURE__ */ t(Fe, { children: s.content }) }, l);
|
|
1228
1256
|
case "mention":
|
|
1229
|
-
return n != null && n.renderMention ? /* @__PURE__ */ t(
|
|
1257
|
+
return n != null && n.renderMention ? /* @__PURE__ */ t($e, { children: n.renderMention({ segment: s }) }, l) : /* @__PURE__ */ t(en, { segment: s }, l);
|
|
1230
1258
|
case "component":
|
|
1231
|
-
return n != null && n.renderComponent ? /* @__PURE__ */ t(
|
|
1259
|
+
return n != null && n.renderComponent ? /* @__PURE__ */ t($e, { children: n.renderComponent({ segment: s }) }, l) : /* @__PURE__ */ a("code", { className: "text-xs text-orange-400", children: [
|
|
1232
1260
|
"[component: ",
|
|
1233
1261
|
s.componentType,
|
|
1234
1262
|
"]"
|
|
@@ -1238,10 +1266,10 @@ function Xt({
|
|
|
1238
1266
|
}
|
|
1239
1267
|
}) });
|
|
1240
1268
|
}
|
|
1241
|
-
function
|
|
1269
|
+
function nn({ options: e, onSelect: n, className: r }) {
|
|
1242
1270
|
return /* @__PURE__ */ t("div", { className: p("grid gap-2 mt-3", r), style: {
|
|
1243
1271
|
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))"
|
|
1244
|
-
}, children: e.map((s) => /* @__PURE__ */
|
|
1272
|
+
}, children: e.map((s) => /* @__PURE__ */ a(
|
|
1245
1273
|
"button",
|
|
1246
1274
|
{
|
|
1247
1275
|
onClick: () => n(s),
|
|
@@ -1262,7 +1290,7 @@ function en({ options: e, onSelect: n, className: r }) {
|
|
|
1262
1290
|
"group-hover:bg-[var(--ash-accent)]/30",
|
|
1263
1291
|
"transition-colors duration-200"
|
|
1264
1292
|
), children: s.id }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
1266
1294
|
/* @__PURE__ */ t("div", { className: "text-sm font-medium text-white/90 group-hover:text-white transition-colors", children: s.label }),
|
|
1267
1295
|
s.description && /* @__PURE__ */ t("div", { className: "text-xs text-white/50 mt-0.5 line-clamp-2 group-hover:text-white/60 transition-colors", children: s.description })
|
|
1268
1296
|
] }),
|
|
@@ -1286,7 +1314,37 @@ function en({ options: e, onSelect: n, className: r }) {
|
|
|
1286
1314
|
s.id
|
|
1287
1315
|
)) });
|
|
1288
1316
|
}
|
|
1289
|
-
|
|
1317
|
+
var Ne = {
|
|
1318
|
+
dense: {
|
|
1319
|
+
text: "text-xs",
|
|
1320
|
+
padding: "px-2 py-1",
|
|
1321
|
+
gap: "gap-1.5",
|
|
1322
|
+
avatar: "w-4 h-4",
|
|
1323
|
+
messageGap: "space-y-0.5"
|
|
1324
|
+
},
|
|
1325
|
+
compact: {
|
|
1326
|
+
text: "text-[13px]",
|
|
1327
|
+
padding: "px-3 py-2",
|
|
1328
|
+
gap: "gap-2",
|
|
1329
|
+
avatar: "w-5 h-5",
|
|
1330
|
+
messageGap: "space-y-1"
|
|
1331
|
+
},
|
|
1332
|
+
default: {
|
|
1333
|
+
text: "text-sm",
|
|
1334
|
+
padding: "px-4 py-3",
|
|
1335
|
+
gap: "gap-3",
|
|
1336
|
+
avatar: "w-6 h-6",
|
|
1337
|
+
messageGap: "space-y-2"
|
|
1338
|
+
},
|
|
1339
|
+
comfortable: {
|
|
1340
|
+
text: "text-[15px]",
|
|
1341
|
+
padding: "px-5 py-4",
|
|
1342
|
+
gap: "gap-4",
|
|
1343
|
+
avatar: "w-7 h-7",
|
|
1344
|
+
messageGap: "space-y-3"
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
function rn(e) {
|
|
1290
1348
|
const n = "[Uploaded files available at /uploads/]", r = e.indexOf(n);
|
|
1291
1349
|
if (r === -1)
|
|
1292
1350
|
return { text: e, files: [] };
|
|
@@ -1294,141 +1352,240 @@ function tn(e) {
|
|
|
1294
1352
|
`).filter((c) => c.startsWith("- ")).map((c) => c.substring(2).trim());
|
|
1295
1353
|
return { text: s, files: l };
|
|
1296
1354
|
}
|
|
1297
|
-
function
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1355
|
+
function sn({
|
|
1356
|
+
entry: e,
|
|
1357
|
+
variant: n = "bubble",
|
|
1358
|
+
scale: r = "compact",
|
|
1359
|
+
showAvatar: s = !1,
|
|
1360
|
+
// Hidden by default for ChatGPT style
|
|
1361
|
+
showTimestamp: i = !0,
|
|
1362
|
+
renderMetadata: l,
|
|
1363
|
+
metadata: c,
|
|
1364
|
+
className: h
|
|
1365
|
+
}) {
|
|
1366
|
+
const { text: o, files: f } = rn(e.content), d = Ne[r], x = {
|
|
1367
|
+
bubble: "rounded-[20px] bg-[var(--ash-user-bg)] text-[var(--ash-user-text)] border border-[var(--ash-user-border)]",
|
|
1368
|
+
plain: "bg-transparent text-[var(--ash-text-primary)]",
|
|
1369
|
+
minimal: "bg-transparent text-[var(--ash-text-secondary)]"
|
|
1370
|
+
};
|
|
1371
|
+
return /* @__PURE__ */ a(
|
|
1372
|
+
"div",
|
|
1373
|
+
{
|
|
1374
|
+
"data-message-role": "user",
|
|
1375
|
+
className: p("flex justify-end ash-animate-fade-in pr-1", d.gap, h),
|
|
1376
|
+
children: [
|
|
1377
|
+
/* @__PURE__ */ a("div", { className: "max-w-[85%] flex flex-col items-end", children: [
|
|
1378
|
+
/* @__PURE__ */ a("div", { className: p(x[n], n === "bubble" && "px-4 py-3"), children: [
|
|
1379
|
+
/* @__PURE__ */ t("p", { className: p(d.text, "leading-snug whitespace-pre-wrap"), children: o || "(files attached)" }),
|
|
1380
|
+
f.length > 0 && n === "bubble" && /* @__PURE__ */ t("div", { className: "mt-1.5 pt-1.5 border-t border-[var(--ash-user-text)]/15 flex flex-wrap gap-1", children: f.map((m, w) => /* @__PURE__ */ a(
|
|
1381
|
+
"span",
|
|
1382
|
+
{
|
|
1383
|
+
className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-[var(--ash-user-text)]/10 text-[11px]",
|
|
1384
|
+
title: m,
|
|
1385
|
+
children: [
|
|
1386
|
+
/* @__PURE__ */ t(At, { className: "w-2.5 h-2.5 opacity-60" }),
|
|
1387
|
+
m.split(" (")[0]
|
|
1388
|
+
]
|
|
1389
|
+
},
|
|
1390
|
+
w
|
|
1391
|
+
)) })
|
|
1392
|
+
] }),
|
|
1393
|
+
l ? l({ entry: e, metadata: c }) : i && e.timestamp && /* @__PURE__ */ a("div", { className: "text-[10px] text-[var(--ash-text-faint)] mt-0.5 mr-1 tabular-nums flex items-center gap-1.5", children: [
|
|
1394
|
+
(c == null ? void 0 : c.model) && /* @__PURE__ */ t("span", { children: c.model }),
|
|
1395
|
+
(c == null ? void 0 : c.model) && /* @__PURE__ */ t("span", { className: "opacity-50", children: "·" }),
|
|
1396
|
+
je(e.timestamp)
|
|
1397
|
+
] })
|
|
1306
1398
|
] }),
|
|
1307
|
-
/* @__PURE__ */ t("div", { className: "flex
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
title: a,
|
|
1312
|
-
children: a.split(" (")[0]
|
|
1313
|
-
},
|
|
1314
|
-
l
|
|
1315
|
-
)) })
|
|
1316
|
-
] }),
|
|
1317
|
-
e.timestamp && /* @__PURE__ */ t("div", { className: "text-xs text-white/40 mt-2", children: De(e.timestamp) })
|
|
1318
|
-
] }),
|
|
1319
|
-
/* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(At, { className: "w-4 h-4 text-white/50" }) })
|
|
1320
|
-
] });
|
|
1399
|
+
s && /* @__PURE__ */ t("div", { className: p(d.avatar, "rounded-full bg-[var(--ash-avatar-user-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Dt, { className: "w-3 h-3 text-[var(--ash-text-muted)]" }) })
|
|
1400
|
+
]
|
|
1401
|
+
}
|
|
1402
|
+
);
|
|
1321
1403
|
}
|
|
1322
|
-
function
|
|
1404
|
+
function an({
|
|
1323
1405
|
entry: e,
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1406
|
+
variant: n = "bubble",
|
|
1407
|
+
scale: r = "compact",
|
|
1408
|
+
showAvatar: s = !0,
|
|
1409
|
+
showTimestamp: i = !0,
|
|
1410
|
+
onOptionSelect: l,
|
|
1411
|
+
richContentRenderers: c,
|
|
1412
|
+
markdownComponents: h,
|
|
1413
|
+
renderMetadata: o,
|
|
1414
|
+
metadata: f,
|
|
1415
|
+
className: d
|
|
1327
1416
|
}) {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1330
|
-
},
|
|
1331
|
-
|
|
1417
|
+
const x = e.richContent ? null : bt(e.content), m = Ne[r], w = (R) => {
|
|
1418
|
+
l && l(`Option ${R.id}: ${R.label}`);
|
|
1419
|
+
}, E = {
|
|
1420
|
+
bubble: "rounded-[16px] bg-[var(--ash-assistant-bg)] border border-[var(--ash-assistant-border)]",
|
|
1421
|
+
plain: "bg-transparent",
|
|
1422
|
+
minimal: "bg-transparent"
|
|
1423
|
+
}, D = (R) => e.richContent && e.richContent.length > 0 ? /* @__PURE__ */ t(
|
|
1424
|
+
tn,
|
|
1332
1425
|
{
|
|
1333
1426
|
content: e.richContent,
|
|
1334
|
-
renderers:
|
|
1335
|
-
}
|
|
1336
|
-
) : /* @__PURE__ */ t(
|
|
1337
|
-
return /* @__PURE__ */
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1427
|
+
renderers: c
|
|
1428
|
+
}
|
|
1429
|
+
) : /* @__PURE__ */ t(Fe, { components: h, children: R || e.content });
|
|
1430
|
+
return /* @__PURE__ */ a(
|
|
1431
|
+
"div",
|
|
1432
|
+
{
|
|
1433
|
+
"data-message-role": "assistant",
|
|
1434
|
+
className: p("flex ash-animate-fade-in pl-1", m.gap, d),
|
|
1435
|
+
children: [
|
|
1436
|
+
s && /* @__PURE__ */ t("div", { className: p(m.avatar, "rounded-full bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Qe, { className: "w-3 h-3 text-white" }) }),
|
|
1437
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
1438
|
+
/* @__PURE__ */ t("div", { className: p(E[n], n === "bubble" && "px-4 py-3"), children: /* @__PURE__ */ t("div", { className: p("ash-message-content prose prose-sm prose-invert max-w-none leading-relaxed text-[var(--ash-assistant-text)]", m.text), children: x ? /* @__PURE__ */ a(_, { children: [
|
|
1439
|
+
x.preamble && D(x.preamble),
|
|
1440
|
+
/* @__PURE__ */ t(
|
|
1441
|
+
nn,
|
|
1442
|
+
{
|
|
1443
|
+
options: x.options,
|
|
1444
|
+
onSelect: w
|
|
1445
|
+
}
|
|
1446
|
+
)
|
|
1447
|
+
] }) : D() }) }),
|
|
1448
|
+
o ? o({ entry: e, metadata: f }) : i && e.timestamp && /* @__PURE__ */ a("div", { className: "text-[10px] text-[var(--ash-text-faint)] mt-0.5 ml-1 tabular-nums flex items-center gap-1.5", children: [
|
|
1449
|
+
(f == null ? void 0 : f.model) && /* @__PURE__ */ t("span", { children: f.model }),
|
|
1450
|
+
(f == null ? void 0 : f.model) && /* @__PURE__ */ t("span", { className: "opacity-50", children: "·" }),
|
|
1451
|
+
je(e.timestamp)
|
|
1452
|
+
] })
|
|
1453
|
+
] })
|
|
1454
|
+
]
|
|
1455
|
+
}
|
|
1456
|
+
);
|
|
1353
1457
|
}
|
|
1354
|
-
function
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1458
|
+
function ln({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
|
|
1459
|
+
const i = Ne[n];
|
|
1460
|
+
return /* @__PURE__ */ a(
|
|
1461
|
+
"div",
|
|
1462
|
+
{
|
|
1463
|
+
"data-message-role": "thinking",
|
|
1464
|
+
className: p("flex ash-animate-fade-in pl-1", i.gap, s),
|
|
1465
|
+
children: [
|
|
1466
|
+
r && /* @__PURE__ */ t("div", { className: p(i.avatar, "rounded-md bg-[var(--ash-avatar-thinking-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Qe, { className: "w-3 h-3 text-purple-400" }) }),
|
|
1467
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: p("rounded-lg bg-[var(--ash-thinking-bg)] border border-[var(--ash-thinking-border)]", i.padding), children: [
|
|
1468
|
+
/* @__PURE__ */ t("div", { className: "text-[10px] text-[var(--ash-thinking-text)] opacity-80 mb-1 font-medium uppercase tracking-wide", children: "Thinking" }),
|
|
1469
|
+
/* @__PURE__ */ t("div", { className: p(i.text, "text-[var(--ash-thinking-text)] opacity-70 italic whitespace-pre-wrap leading-relaxed"), children: e.content })
|
|
1470
|
+
] }) })
|
|
1471
|
+
]
|
|
1472
|
+
}
|
|
1473
|
+
);
|
|
1362
1474
|
}
|
|
1363
|
-
function
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1475
|
+
function on({ entry: e, scale: n = "compact", showAvatar: r = !0, defaultExpanded: s = !1, className: i }) {
|
|
1476
|
+
if (e.entryType.type !== "tool_call") return null;
|
|
1477
|
+
const l = Ne[n];
|
|
1478
|
+
return /* @__PURE__ */ a(
|
|
1479
|
+
"div",
|
|
1480
|
+
{
|
|
1481
|
+
"data-message-role": "tool",
|
|
1482
|
+
className: p("flex ash-animate-fade-in pl-1", l.gap, i),
|
|
1483
|
+
children: [
|
|
1484
|
+
r && /* @__PURE__ */ t("div", { className: p(l.avatar, "rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
1485
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t(ze, { toolCall: e.entryType.toolCall, defaultExpanded: s }) })
|
|
1486
|
+
]
|
|
1487
|
+
}
|
|
1488
|
+
);
|
|
1368
1489
|
}
|
|
1369
|
-
function
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1490
|
+
function cn({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
|
|
1491
|
+
if (e.entryType.type !== "error") return null;
|
|
1492
|
+
const i = Ne[n];
|
|
1493
|
+
return /* @__PURE__ */ a(
|
|
1494
|
+
"div",
|
|
1495
|
+
{
|
|
1496
|
+
"data-message-role": "error",
|
|
1497
|
+
className: p("flex ash-animate-fade-in pl-1", i.gap, s),
|
|
1498
|
+
children: [
|
|
1499
|
+
r && /* @__PURE__ */ t("div", { className: p(i.avatar, "rounded-md bg-[var(--ash-avatar-error-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Ze, { className: "w-3 h-3 text-red-400" }) }),
|
|
1500
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: p("rounded-lg bg-[var(--ash-error-bg)] border border-[var(--ash-error-border)]", i.padding), children: [
|
|
1501
|
+
/* @__PURE__ */ t("div", { className: "text-[10px] text-[var(--ash-error-text)] opacity-80 mb-1 font-medium uppercase tracking-wide", children: "Error" }),
|
|
1502
|
+
/* @__PURE__ */ t("p", { className: p(i.text, "text-[var(--ash-error-text)] opacity-90"), children: e.entryType.message }),
|
|
1503
|
+
e.entryType.code && /* @__PURE__ */ a("p", { className: "text-[11px] text-[var(--ash-error-text)] opacity-60 mt-1 font-mono", children: [
|
|
1504
|
+
"Code: ",
|
|
1505
|
+
e.entryType.code
|
|
1506
|
+
] })
|
|
1507
|
+
] }) })
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
);
|
|
1381
1511
|
}
|
|
1382
|
-
function
|
|
1512
|
+
function dn({
|
|
1383
1513
|
entry: e,
|
|
1384
1514
|
onOptionSelect: n,
|
|
1385
1515
|
defaultExpanded: r,
|
|
1386
1516
|
richContentRenderers: s,
|
|
1387
|
-
|
|
1517
|
+
markdownComponents: i,
|
|
1518
|
+
userVariant: l,
|
|
1519
|
+
assistantVariant: c,
|
|
1520
|
+
scale: h,
|
|
1521
|
+
showAvatars: o = !0,
|
|
1522
|
+
showTimestamp: f = !0,
|
|
1523
|
+
renderMetadata: d,
|
|
1524
|
+
metadata: x,
|
|
1525
|
+
className: m
|
|
1388
1526
|
}) {
|
|
1389
1527
|
switch (e.entryType.type) {
|
|
1390
1528
|
case "user_message":
|
|
1391
|
-
return /* @__PURE__ */ t(
|
|
1529
|
+
return /* @__PURE__ */ t(
|
|
1530
|
+
sn,
|
|
1531
|
+
{
|
|
1532
|
+
entry: e,
|
|
1533
|
+
variant: l,
|
|
1534
|
+
scale: h,
|
|
1535
|
+
showAvatar: o,
|
|
1536
|
+
showTimestamp: f,
|
|
1537
|
+
renderMetadata: d,
|
|
1538
|
+
metadata: x,
|
|
1539
|
+
className: m
|
|
1540
|
+
}
|
|
1541
|
+
);
|
|
1392
1542
|
case "assistant_message":
|
|
1393
1543
|
return /* @__PURE__ */ t(
|
|
1394
|
-
|
|
1544
|
+
an,
|
|
1395
1545
|
{
|
|
1396
1546
|
entry: e,
|
|
1547
|
+
variant: c,
|
|
1548
|
+
scale: h,
|
|
1549
|
+
showAvatar: o,
|
|
1550
|
+
showTimestamp: f,
|
|
1397
1551
|
onOptionSelect: n,
|
|
1398
1552
|
richContentRenderers: s,
|
|
1399
|
-
|
|
1553
|
+
markdownComponents: i,
|
|
1554
|
+
renderMetadata: d,
|
|
1555
|
+
metadata: x,
|
|
1556
|
+
className: m
|
|
1400
1557
|
}
|
|
1401
1558
|
);
|
|
1402
1559
|
case "thinking":
|
|
1403
|
-
return /* @__PURE__ */ t(
|
|
1560
|
+
return /* @__PURE__ */ t(ln, { entry: e, scale: h, showAvatar: o, className: m });
|
|
1404
1561
|
case "tool_call":
|
|
1405
|
-
return /* @__PURE__ */ t(
|
|
1562
|
+
return /* @__PURE__ */ t(on, { entry: e, scale: h, showAvatar: o, defaultExpanded: r, className: m });
|
|
1406
1563
|
case "error":
|
|
1407
|
-
return /* @__PURE__ */ t(
|
|
1564
|
+
return /* @__PURE__ */ t(cn, { entry: e, scale: h, showAvatar: o, className: m });
|
|
1408
1565
|
default:
|
|
1409
1566
|
return null;
|
|
1410
1567
|
}
|
|
1411
1568
|
}
|
|
1412
|
-
function
|
|
1569
|
+
function Re({ variant: e = "dots", size: n = "md", className: r }) {
|
|
1413
1570
|
if (e === "dots") {
|
|
1414
|
-
const
|
|
1571
|
+
const i = {
|
|
1415
1572
|
sm: "w-1 h-1",
|
|
1416
1573
|
md: "w-1.5 h-1.5",
|
|
1417
1574
|
lg: "w-2 h-2"
|
|
1418
1575
|
};
|
|
1419
|
-
return /* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse",
|
|
1421
|
-
/* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse",
|
|
1422
|
-
/* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse",
|
|
1576
|
+
return /* @__PURE__ */ a("div", { className: p("flex items-center gap-1", r), children: [
|
|
1577
|
+
/* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]) }),
|
|
1578
|
+
/* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "150ms" } }),
|
|
1579
|
+
/* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "300ms" } })
|
|
1423
1580
|
] });
|
|
1424
1581
|
}
|
|
1425
1582
|
if (e === "pulse") {
|
|
1426
|
-
const
|
|
1583
|
+
const i = {
|
|
1427
1584
|
sm: "w-1.5 h-1.5",
|
|
1428
1585
|
md: "w-2 h-2",
|
|
1429
1586
|
lg: "w-3 h-3"
|
|
1430
1587
|
};
|
|
1431
|
-
return /* @__PURE__ */ t("div", { className: p("flex items-center gap-1", r), children: /* @__PURE__ */ t("span", { className: p("bg-[var(--ash-accent)] rounded-full animate-pulse",
|
|
1588
|
+
return /* @__PURE__ */ t("div", { className: p("flex items-center gap-1", r), children: /* @__PURE__ */ t("span", { className: p("bg-[var(--ash-accent)] rounded-full animate-pulse", i[n]) }) });
|
|
1432
1589
|
}
|
|
1433
1590
|
return e === "cursor" ? /* @__PURE__ */ t(
|
|
1434
1591
|
"span",
|
|
@@ -1447,26 +1604,26 @@ function $e({ variant: e = "dots", size: n = "md", className: r }) {
|
|
|
1447
1604
|
sm: "w-4 h-4",
|
|
1448
1605
|
md: "w-6 h-6",
|
|
1449
1606
|
lg: "w-8 h-8"
|
|
1450
|
-
}[n], r), children: /* @__PURE__ */
|
|
1607
|
+
}[n], r), children: /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1451
1608
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", className: "opacity-25" }),
|
|
1452
1609
|
/* @__PURE__ */ t("path", { d: "M12 2a10 10 0 0 1 10 10", strokeLinecap: "round" })
|
|
1453
1610
|
] }) });
|
|
1454
1611
|
}
|
|
1455
|
-
function
|
|
1612
|
+
function un({
|
|
1456
1613
|
content: e,
|
|
1457
1614
|
isStreaming: n = !1,
|
|
1458
1615
|
renderMarkdown: r = !0,
|
|
1459
1616
|
className: s
|
|
1460
1617
|
}) {
|
|
1461
|
-
return /* @__PURE__ */ t("div", { className: p("relative", s), children: r ? /* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */ t(
|
|
1463
|
-
n && /* @__PURE__ */ t(
|
|
1464
|
-
] }) : /* @__PURE__ */
|
|
1618
|
+
return /* @__PURE__ */ t("div", { className: p("relative", s), children: r ? /* @__PURE__ */ a("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: [
|
|
1619
|
+
/* @__PURE__ */ t(Fe, { children: e }),
|
|
1620
|
+
n && /* @__PURE__ */ t(Re, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
|
|
1621
|
+
] }) : /* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-sm leading-relaxed", children: [
|
|
1465
1622
|
e,
|
|
1466
|
-
n && /* @__PURE__ */ t(
|
|
1623
|
+
n && /* @__PURE__ */ t(Re, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
|
|
1467
1624
|
] }) });
|
|
1468
1625
|
}
|
|
1469
|
-
function
|
|
1626
|
+
function hn(e) {
|
|
1470
1627
|
switch (e.action) {
|
|
1471
1628
|
case "file_read":
|
|
1472
1629
|
case "file_edit":
|
|
@@ -1476,15 +1633,15 @@ function dn(e) {
|
|
|
1476
1633
|
return null;
|
|
1477
1634
|
}
|
|
1478
1635
|
}
|
|
1479
|
-
function
|
|
1636
|
+
function tt(e) {
|
|
1480
1637
|
const n = e.split("/");
|
|
1481
1638
|
return n[n.length - 1] || e;
|
|
1482
1639
|
}
|
|
1483
|
-
function
|
|
1484
|
-
const n =
|
|
1640
|
+
function mn(e) {
|
|
1641
|
+
const n = tt(e), r = n.lastIndexOf(".");
|
|
1485
1642
|
return r === -1 ? null : n.slice(r + 1).toLowerCase();
|
|
1486
1643
|
}
|
|
1487
|
-
function
|
|
1644
|
+
function pn(e) {
|
|
1488
1645
|
switch (e.action) {
|
|
1489
1646
|
case "file_edit": {
|
|
1490
1647
|
const n = e;
|
|
@@ -1502,7 +1659,7 @@ function hn(e) {
|
|
|
1502
1659
|
return null;
|
|
1503
1660
|
}
|
|
1504
1661
|
}
|
|
1505
|
-
function
|
|
1662
|
+
function fn(e) {
|
|
1506
1663
|
switch (e) {
|
|
1507
1664
|
case "ts":
|
|
1508
1665
|
case "tsx":
|
|
@@ -1525,9 +1682,9 @@ function mn(e) {
|
|
|
1525
1682
|
return "text-white/70";
|
|
1526
1683
|
}
|
|
1527
1684
|
}
|
|
1528
|
-
function
|
|
1529
|
-
const { actionType: s, status:
|
|
1530
|
-
return /* @__PURE__ */
|
|
1685
|
+
function nt({ toolCall: e, showFullPath: n = !1, className: r }) {
|
|
1686
|
+
const { actionType: s, status: i, summary: l } = e, c = Ke(s), h = hn(s), o = pn(s), f = h ? n ? h : tt(h) : null, d = h ? mn(h) : null, x = fn(d), m = !h && l;
|
|
1687
|
+
return /* @__PURE__ */ a(
|
|
1531
1688
|
"div",
|
|
1532
1689
|
{
|
|
1533
1690
|
className: p(
|
|
@@ -1535,54 +1692,54 @@ function Xe({ toolCall: e, showFullPath: n = !1, className: r }) {
|
|
|
1535
1692
|
r
|
|
1536
1693
|
),
|
|
1537
1694
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
1695
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1539
1696
|
/* @__PURE__ */ t(
|
|
1540
|
-
|
|
1697
|
+
Xe,
|
|
1541
1698
|
{
|
|
1542
1699
|
actionType: s,
|
|
1543
1700
|
className: p(
|
|
1544
1701
|
"w-3.5 h-3.5",
|
|
1545
|
-
|
|
1702
|
+
i === "pending" ? "text-yellow-400" : i === "failed" ? "text-red-400" : "text-white/50"
|
|
1546
1703
|
)
|
|
1547
1704
|
}
|
|
1548
1705
|
),
|
|
1549
1706
|
/* @__PURE__ */ t("span", { className: p(
|
|
1550
1707
|
"font-medium",
|
|
1551
|
-
|
|
1708
|
+
i === "pending" ? "text-white/90" : i === "failed" ? "text-red-400" : "text-white/60"
|
|
1552
1709
|
), children: c })
|
|
1553
1710
|
] }),
|
|
1554
|
-
|
|
1711
|
+
f && /* @__PURE__ */ t("code", { className: p(
|
|
1555
1712
|
"px-1.5 py-0.5 rounded bg-white/5 font-mono text-xs truncate max-w-[200px]",
|
|
1556
|
-
|
|
1557
|
-
), children:
|
|
1558
|
-
o && /* @__PURE__ */
|
|
1559
|
-
o.added !== void 0 && o.added > 0 && /* @__PURE__ */
|
|
1713
|
+
x
|
|
1714
|
+
), children: f }),
|
|
1715
|
+
o && /* @__PURE__ */ a("span", { className: "flex items-center gap-1 text-xs shrink-0 font-mono", children: [
|
|
1716
|
+
o.added !== void 0 && o.added > 0 && /* @__PURE__ */ a("span", { className: "text-emerald-400", children: [
|
|
1560
1717
|
"+",
|
|
1561
1718
|
o.added
|
|
1562
1719
|
] }),
|
|
1563
|
-
o.removed !== void 0 && o.removed > 0 && /* @__PURE__ */
|
|
1720
|
+
o.removed !== void 0 && o.removed > 0 && /* @__PURE__ */ a("span", { className: "text-red-400", children: [
|
|
1564
1721
|
"-",
|
|
1565
1722
|
o.removed
|
|
1566
1723
|
] }),
|
|
1567
|
-
o.read !== void 0 && /* @__PURE__ */
|
|
1724
|
+
o.read !== void 0 && /* @__PURE__ */ a("span", { className: "text-white/40", children: [
|
|
1568
1725
|
o.read,
|
|
1569
1726
|
" lines"
|
|
1570
1727
|
] }),
|
|
1571
|
-
o.written !== void 0 && /* @__PURE__ */
|
|
1728
|
+
o.written !== void 0 && /* @__PURE__ */ a("span", { className: "text-emerald-400", children: [
|
|
1572
1729
|
"+",
|
|
1573
1730
|
o.written
|
|
1574
1731
|
] })
|
|
1575
1732
|
] }),
|
|
1576
|
-
|
|
1733
|
+
m && /* @__PURE__ */ t("span", { className: "text-white/40 truncate min-w-0 text-xs", children: l })
|
|
1577
1734
|
]
|
|
1578
1735
|
}
|
|
1579
1736
|
);
|
|
1580
1737
|
}
|
|
1581
|
-
function
|
|
1738
|
+
function xn(e) {
|
|
1582
1739
|
const n = e.split("/").pop() || e, r = n.lastIndexOf(".");
|
|
1583
1740
|
return r === -1 ? null : n.slice(r + 1).toLowerCase();
|
|
1584
1741
|
}
|
|
1585
|
-
function
|
|
1742
|
+
function gn(e) {
|
|
1586
1743
|
switch (e) {
|
|
1587
1744
|
case "ts":
|
|
1588
1745
|
case "tsx":
|
|
@@ -1605,7 +1762,7 @@ function fn(e) {
|
|
|
1605
1762
|
return "";
|
|
1606
1763
|
}
|
|
1607
1764
|
}
|
|
1608
|
-
function
|
|
1765
|
+
function wn(e) {
|
|
1609
1766
|
switch (e) {
|
|
1610
1767
|
case "ts":
|
|
1611
1768
|
case "tsx":
|
|
@@ -1628,31 +1785,31 @@ function xn(e) {
|
|
|
1628
1785
|
return "bg-white/10";
|
|
1629
1786
|
}
|
|
1630
1787
|
}
|
|
1631
|
-
function
|
|
1788
|
+
function rt({
|
|
1632
1789
|
path: e,
|
|
1633
1790
|
linesAdded: n,
|
|
1634
1791
|
linesRemoved: r,
|
|
1635
1792
|
showOnlyFilename: s = !0,
|
|
1636
|
-
className:
|
|
1793
|
+
className: i
|
|
1637
1794
|
}) {
|
|
1638
|
-
const l = s && e.split("/").pop() || e, c =
|
|
1639
|
-
return /* @__PURE__ */
|
|
1795
|
+
const l = s && e.split("/").pop() || e, c = xn(e), h = gn(c), o = wn(c), f = n !== void 0 && n > 0 || r !== void 0 && r > 0;
|
|
1796
|
+
return /* @__PURE__ */ a(
|
|
1640
1797
|
"span",
|
|
1641
1798
|
{
|
|
1642
1799
|
className: p(
|
|
1643
1800
|
"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-mono",
|
|
1644
1801
|
o,
|
|
1645
|
-
|
|
1802
|
+
i
|
|
1646
1803
|
),
|
|
1647
1804
|
children: [
|
|
1648
1805
|
h && /* @__PURE__ */ t("span", { className: "text-[10px] opacity-60 font-semibold", children: h }),
|
|
1649
1806
|
/* @__PURE__ */ t("span", { className: "text-white/80 truncate max-w-[120px]", children: l }),
|
|
1650
|
-
|
|
1651
|
-
n !== void 0 && n > 0 && /* @__PURE__ */
|
|
1807
|
+
f && /* @__PURE__ */ a("span", { className: "flex items-center gap-0.5", children: [
|
|
1808
|
+
n !== void 0 && n > 0 && /* @__PURE__ */ a("span", { className: "text-emerald-400", children: [
|
|
1652
1809
|
"+",
|
|
1653
1810
|
n
|
|
1654
1811
|
] }),
|
|
1655
|
-
r !== void 0 && r > 0 && /* @__PURE__ */
|
|
1812
|
+
r !== void 0 && r > 0 && /* @__PURE__ */ a("span", { className: "text-red-400", children: [
|
|
1656
1813
|
"-",
|
|
1657
1814
|
r
|
|
1658
1815
|
] })
|
|
@@ -1661,28 +1818,28 @@ function et({
|
|
|
1661
1818
|
}
|
|
1662
1819
|
);
|
|
1663
1820
|
}
|
|
1664
|
-
function
|
|
1821
|
+
function vn(e) {
|
|
1665
1822
|
const n = /* @__PURE__ */ new Map();
|
|
1666
1823
|
for (const r of e) {
|
|
1667
1824
|
const { actionType: s } = r;
|
|
1668
1825
|
if (s.action === "file_edit") {
|
|
1669
|
-
const
|
|
1670
|
-
l ? (l.linesAdded = (l.linesAdded || 0) + (
|
|
1671
|
-
path:
|
|
1672
|
-
linesAdded:
|
|
1673
|
-
linesRemoved:
|
|
1826
|
+
const i = s, l = n.get(i.path);
|
|
1827
|
+
l ? (l.linesAdded = (l.linesAdded || 0) + (i.linesAdded || 0), l.linesRemoved = (l.linesRemoved || 0) + (i.linesRemoved || 0)) : n.set(i.path, {
|
|
1828
|
+
path: i.path,
|
|
1829
|
+
linesAdded: i.linesAdded,
|
|
1830
|
+
linesRemoved: i.linesRemoved
|
|
1674
1831
|
});
|
|
1675
1832
|
} else if (s.action === "file_write") {
|
|
1676
|
-
const
|
|
1677
|
-
n.has(
|
|
1678
|
-
path:
|
|
1679
|
-
linesAdded:
|
|
1833
|
+
const i = s;
|
|
1834
|
+
n.has(i.path) || n.set(i.path, {
|
|
1835
|
+
path: i.path,
|
|
1836
|
+
linesAdded: i.linesWritten
|
|
1680
1837
|
});
|
|
1681
1838
|
}
|
|
1682
1839
|
}
|
|
1683
1840
|
return Array.from(n.values());
|
|
1684
1841
|
}
|
|
1685
|
-
function
|
|
1842
|
+
function yn(e) {
|
|
1686
1843
|
const n = {};
|
|
1687
1844
|
for (const r of e) {
|
|
1688
1845
|
const s = r.actionType.action;
|
|
@@ -1690,37 +1847,37 @@ function wn(e) {
|
|
|
1690
1847
|
}
|
|
1691
1848
|
return n;
|
|
1692
1849
|
}
|
|
1693
|
-
function
|
|
1850
|
+
function bn(e) {
|
|
1694
1851
|
switch (e) {
|
|
1695
1852
|
case "file_read":
|
|
1696
|
-
return
|
|
1853
|
+
return Be;
|
|
1697
1854
|
case "file_edit":
|
|
1698
1855
|
case "file_write":
|
|
1699
1856
|
return Oe;
|
|
1700
1857
|
case "command_run":
|
|
1701
|
-
return
|
|
1858
|
+
return Ie;
|
|
1702
1859
|
case "search":
|
|
1703
1860
|
case "glob":
|
|
1704
|
-
return
|
|
1861
|
+
return Se;
|
|
1705
1862
|
default:
|
|
1706
1863
|
return null;
|
|
1707
1864
|
}
|
|
1708
1865
|
}
|
|
1709
|
-
function
|
|
1866
|
+
function Nn({
|
|
1710
1867
|
toolCalls: e,
|
|
1711
1868
|
defaultExpanded: n = !1,
|
|
1712
1869
|
className: r
|
|
1713
1870
|
}) {
|
|
1714
|
-
const [s,
|
|
1715
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1871
|
+
const [s, i] = N(n), [l, c] = N(null), h = ae(() => vn(e), [e]), o = ae(() => yn(e), [e]), f = ae(() => Object.entries(o).sort((x, m) => m[1] - x[1]).slice(0, 3).map(([x]) => x), [o]), d = e.length;
|
|
1872
|
+
return e.length === 0 ? null : /* @__PURE__ */ a("div", { className: p("ash-animate-fade-in", r), children: [
|
|
1873
|
+
/* @__PURE__ */ a(
|
|
1717
1874
|
"button",
|
|
1718
1875
|
{
|
|
1719
|
-
onClick: () =>
|
|
1876
|
+
onClick: () => i(!s),
|
|
1720
1877
|
className: "w-full flex items-center gap-2 py-1 text-left group",
|
|
1721
1878
|
children: [
|
|
1722
1879
|
/* @__PURE__ */ t(
|
|
1723
|
-
|
|
1880
|
+
be,
|
|
1724
1881
|
{
|
|
1725
1882
|
className: p(
|
|
1726
1883
|
"w-3.5 h-3.5 text-white/40 transition-transform duration-200 shrink-0",
|
|
@@ -1728,33 +1885,33 @@ function yn({
|
|
|
1728
1885
|
)
|
|
1729
1886
|
}
|
|
1730
1887
|
),
|
|
1731
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-white/60", children: [
|
|
1732
1889
|
d,
|
|
1733
1890
|
" tool call",
|
|
1734
1891
|
d !== 1 ? "s" : ""
|
|
1735
1892
|
] }),
|
|
1736
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
1737
|
-
const
|
|
1738
|
-
return
|
|
1739
|
-
|
|
1893
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: f.map((x) => {
|
|
1894
|
+
const m = bn(x);
|
|
1895
|
+
return m ? /* @__PURE__ */ t(
|
|
1896
|
+
m,
|
|
1740
1897
|
{
|
|
1741
1898
|
className: "w-3.5 h-3.5 text-white/30"
|
|
1742
1899
|
},
|
|
1743
|
-
|
|
1900
|
+
x
|
|
1744
1901
|
) : null;
|
|
1745
1902
|
}) }),
|
|
1746
1903
|
/* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
1747
|
-
!s && h.length > 0 && /* @__PURE__ */
|
|
1748
|
-
h.slice(0, 4).map((
|
|
1749
|
-
|
|
1904
|
+
!s && h.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 flex-wrap justify-end", children: [
|
|
1905
|
+
h.slice(0, 4).map((x) => /* @__PURE__ */ t(
|
|
1906
|
+
rt,
|
|
1750
1907
|
{
|
|
1751
|
-
path:
|
|
1752
|
-
linesAdded:
|
|
1753
|
-
linesRemoved:
|
|
1908
|
+
path: x.path,
|
|
1909
|
+
linesAdded: x.linesAdded,
|
|
1910
|
+
linesRemoved: x.linesRemoved
|
|
1754
1911
|
},
|
|
1755
|
-
|
|
1912
|
+
x.path
|
|
1756
1913
|
)),
|
|
1757
|
-
h.length > 4 && /* @__PURE__ */
|
|
1914
|
+
h.length > 4 && /* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
|
|
1758
1915
|
"+",
|
|
1759
1916
|
h.length - 4,
|
|
1760
1917
|
" more"
|
|
@@ -1763,11 +1920,11 @@ function yn({
|
|
|
1763
1920
|
]
|
|
1764
1921
|
}
|
|
1765
1922
|
),
|
|
1766
|
-
s && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((
|
|
1923
|
+
s && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((x) => /* @__PURE__ */ t("div", { children: l === x.id ? /* @__PURE__ */ a("div", { className: "py-1", children: [
|
|
1767
1924
|
/* @__PURE__ */ t(
|
|
1768
|
-
|
|
1925
|
+
ze,
|
|
1769
1926
|
{
|
|
1770
|
-
toolCall:
|
|
1927
|
+
toolCall: x,
|
|
1771
1928
|
defaultExpanded: !0
|
|
1772
1929
|
}
|
|
1773
1930
|
),
|
|
@@ -1782,23 +1939,23 @@ function yn({
|
|
|
1782
1939
|
] }) : /* @__PURE__ */ t(
|
|
1783
1940
|
"button",
|
|
1784
1941
|
{
|
|
1785
|
-
onClick: () => c(
|
|
1942
|
+
onClick: () => c(x.id),
|
|
1786
1943
|
className: "w-full text-left hover:bg-white/5 rounded px-1 -mx-1 transition-colors",
|
|
1787
|
-
children: /* @__PURE__ */ t(
|
|
1944
|
+
children: /* @__PURE__ */ t(nt, { toolCall: x })
|
|
1788
1945
|
}
|
|
1789
|
-
) },
|
|
1946
|
+
) }, x.id)) })
|
|
1790
1947
|
] });
|
|
1791
1948
|
}
|
|
1792
|
-
function
|
|
1949
|
+
function kn(e) {
|
|
1793
1950
|
const n = /* @__PURE__ */ new Map();
|
|
1794
1951
|
for (const r of e) {
|
|
1795
1952
|
const { actionType: s } = r;
|
|
1796
1953
|
if (s.action === "file_edit") {
|
|
1797
|
-
const
|
|
1798
|
-
l ? (l.linesAdded = (l.linesAdded || 0) + (
|
|
1799
|
-
path:
|
|
1800
|
-
linesAdded:
|
|
1801
|
-
linesRemoved:
|
|
1954
|
+
const i = s, l = n.get(i.path);
|
|
1955
|
+
l ? (l.linesAdded = (l.linesAdded || 0) + (i.linesAdded || 0), l.linesRemoved = (l.linesRemoved || 0) + (i.linesRemoved || 0)) : n.set(i.path, {
|
|
1956
|
+
path: i.path,
|
|
1957
|
+
linesAdded: i.linesAdded,
|
|
1958
|
+
linesRemoved: i.linesRemoved
|
|
1802
1959
|
});
|
|
1803
1960
|
} else s.action === "file_write" && (n.has(s.path) || n.set(s.path, {
|
|
1804
1961
|
path: s.path,
|
|
@@ -1807,7 +1964,7 @@ function bn(e) {
|
|
|
1807
1964
|
}
|
|
1808
1965
|
return Array.from(n.values());
|
|
1809
1966
|
}
|
|
1810
|
-
function
|
|
1967
|
+
function Cn(e) {
|
|
1811
1968
|
const n = {};
|
|
1812
1969
|
for (const r of e) {
|
|
1813
1970
|
const s = r.actionType.action;
|
|
@@ -1815,37 +1972,37 @@ function Nn(e) {
|
|
|
1815
1972
|
}
|
|
1816
1973
|
return n;
|
|
1817
1974
|
}
|
|
1818
|
-
function
|
|
1975
|
+
function _n(e) {
|
|
1819
1976
|
switch (e) {
|
|
1820
1977
|
case "file_read":
|
|
1821
|
-
return
|
|
1978
|
+
return Be;
|
|
1822
1979
|
case "file_edit":
|
|
1823
1980
|
case "file_write":
|
|
1824
1981
|
return Oe;
|
|
1825
1982
|
case "command_run":
|
|
1826
|
-
return
|
|
1983
|
+
return Ie;
|
|
1827
1984
|
case "search":
|
|
1828
1985
|
case "glob":
|
|
1829
|
-
return
|
|
1986
|
+
return Se;
|
|
1830
1987
|
default:
|
|
1831
1988
|
return null;
|
|
1832
1989
|
}
|
|
1833
1990
|
}
|
|
1834
|
-
function
|
|
1991
|
+
function Tn({
|
|
1835
1992
|
toolCalls: e,
|
|
1836
1993
|
defaultExpanded: n = !1,
|
|
1837
1994
|
isExpanded: r,
|
|
1838
1995
|
onToggle: s,
|
|
1839
|
-
className:
|
|
1996
|
+
className: i
|
|
1840
1997
|
}) {
|
|
1841
|
-
const [l, c] = N(n), h = r !== void 0 ? r : l, o =
|
|
1842
|
-
s ? s() : c((
|
|
1843
|
-
}, [s]),
|
|
1998
|
+
const [l, c] = N(n), h = r !== void 0 ? r : l, o = F(() => {
|
|
1999
|
+
s ? s() : c((w) => !w);
|
|
2000
|
+
}, [s]), f = ae(() => kn(e), [e]), d = ae(() => Cn(e), [e]), x = ae(() => Object.entries(d).sort((w, E) => E[1] - w[1]).slice(0, 3).map(([w]) => w), [d]);
|
|
1844
2001
|
if (e.length === 0)
|
|
1845
2002
|
return null;
|
|
1846
|
-
const
|
|
1847
|
-
return /* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
2003
|
+
const m = e.length;
|
|
2004
|
+
return /* @__PURE__ */ a("div", { className: p("ash-animate-fade-in", i), children: [
|
|
2005
|
+
/* @__PURE__ */ a(
|
|
1849
2006
|
"button",
|
|
1850
2007
|
{
|
|
1851
2008
|
type: "button",
|
|
@@ -1853,7 +2010,7 @@ function Cn({
|
|
|
1853
2010
|
className: "w-full flex items-center gap-2 py-1 text-left group",
|
|
1854
2011
|
children: [
|
|
1855
2012
|
/* @__PURE__ */ t(
|
|
1856
|
-
|
|
2013
|
+
be,
|
|
1857
2014
|
{
|
|
1858
2015
|
className: p(
|
|
1859
2016
|
"w-3.5 h-3.5 text-white/40 transition-transform duration-200 shrink-0",
|
|
@@ -1861,42 +2018,42 @@ function Cn({
|
|
|
1861
2018
|
)
|
|
1862
2019
|
}
|
|
1863
2020
|
),
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
2021
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-white/60", children: [
|
|
2022
|
+
m,
|
|
1866
2023
|
" tool call",
|
|
1867
|
-
|
|
2024
|
+
m !== 1 ? "s" : ""
|
|
1868
2025
|
] }),
|
|
1869
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
1870
|
-
const
|
|
1871
|
-
return
|
|
1872
|
-
|
|
2026
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: x.map((w) => {
|
|
2027
|
+
const E = _n(w);
|
|
2028
|
+
return E ? /* @__PURE__ */ t(
|
|
2029
|
+
E,
|
|
1873
2030
|
{
|
|
1874
2031
|
className: "w-3.5 h-3.5 text-white/30"
|
|
1875
2032
|
},
|
|
1876
|
-
|
|
2033
|
+
w
|
|
1877
2034
|
) : null;
|
|
1878
2035
|
}) }),
|
|
1879
2036
|
/* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
1880
|
-
!h &&
|
|
1881
|
-
|
|
1882
|
-
|
|
2037
|
+
!h && f.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 flex-wrap justify-end", children: [
|
|
2038
|
+
f.slice(0, 4).map((w) => /* @__PURE__ */ t(
|
|
2039
|
+
rt,
|
|
1883
2040
|
{
|
|
1884
|
-
path:
|
|
1885
|
-
linesAdded:
|
|
1886
|
-
linesRemoved:
|
|
2041
|
+
path: w.path,
|
|
2042
|
+
linesAdded: w.linesAdded,
|
|
2043
|
+
linesRemoved: w.linesRemoved
|
|
1887
2044
|
},
|
|
1888
|
-
|
|
2045
|
+
w.path
|
|
1889
2046
|
)),
|
|
1890
|
-
|
|
2047
|
+
f.length > 4 && /* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
|
|
1891
2048
|
"+",
|
|
1892
|
-
|
|
2049
|
+
f.length - 4,
|
|
1893
2050
|
" more"
|
|
1894
2051
|
] })
|
|
1895
2052
|
] })
|
|
1896
2053
|
]
|
|
1897
2054
|
}
|
|
1898
2055
|
),
|
|
1899
|
-
h && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((
|
|
2056
|
+
h && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((w) => /* @__PURE__ */ t(nt, { toolCall: w }, w.id)) })
|
|
1900
2057
|
] });
|
|
1901
2058
|
}
|
|
1902
2059
|
function wr(e) {
|
|
@@ -1935,16 +2092,16 @@ function Mr(e) {
|
|
|
1935
2092
|
function Er(e) {
|
|
1936
2093
|
return e.type === "error";
|
|
1937
2094
|
}
|
|
1938
|
-
var
|
|
2095
|
+
var Sn = {
|
|
1939
2096
|
mode: "inline",
|
|
1940
2097
|
breakEveryNToolCalls: 0,
|
|
1941
2098
|
defaultExpanded: !1,
|
|
1942
2099
|
animationDuration: 300
|
|
1943
|
-
},
|
|
1944
|
-
function
|
|
1945
|
-
const e =
|
|
2100
|
+
}, Mn = Je(null);
|
|
2101
|
+
function En() {
|
|
2102
|
+
const e = Ue(Mn);
|
|
1946
2103
|
return e || {
|
|
1947
|
-
config:
|
|
2104
|
+
config: Sn,
|
|
1948
2105
|
setMode: () => {
|
|
1949
2106
|
},
|
|
1950
2107
|
setConfig: () => {
|
|
@@ -1953,111 +2110,127 @@ function Sn() {
|
|
|
1953
2110
|
}
|
|
1954
2111
|
};
|
|
1955
2112
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const { config: e } =
|
|
2113
|
+
function In() {
|
|
2114
|
+
const { config: e } = En();
|
|
1958
2115
|
return e;
|
|
1959
2116
|
}
|
|
1960
|
-
function
|
|
2117
|
+
function Ln({
|
|
1961
2118
|
entries: e,
|
|
1962
2119
|
loading: n,
|
|
1963
2120
|
streamingContent: r,
|
|
1964
2121
|
displayConfig: s,
|
|
1965
|
-
onOptionSelect:
|
|
2122
|
+
onOptionSelect: i,
|
|
1966
2123
|
renderWidget: l,
|
|
1967
2124
|
onWidgetAction: c,
|
|
1968
2125
|
autoScroll: h = !0,
|
|
1969
2126
|
richContentRenderers: o,
|
|
1970
|
-
|
|
2127
|
+
userVariant: f,
|
|
2128
|
+
assistantVariant: d,
|
|
2129
|
+
scale: x,
|
|
2130
|
+
showAvatars: m = !0,
|
|
2131
|
+
showTimestamp: w = !0,
|
|
2132
|
+
markdownComponents: E,
|
|
2133
|
+
renderMetadata: D,
|
|
2134
|
+
metadata: R,
|
|
2135
|
+
className: T
|
|
1971
2136
|
}) {
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1974
|
-
h &&
|
|
2137
|
+
const X = In(), S = s || X, G = V(null), A = V(null);
|
|
2138
|
+
P(() => {
|
|
2139
|
+
h && A.current && G.current && A.current.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
1975
2140
|
}, [e, r, n, h]);
|
|
1976
|
-
const
|
|
1977
|
-
(
|
|
2141
|
+
const W = F(
|
|
2142
|
+
(B, H) => {
|
|
1978
2143
|
if (c)
|
|
1979
|
-
return (
|
|
2144
|
+
return (C) => {
|
|
1980
2145
|
c({
|
|
1981
|
-
...
|
|
1982
|
-
entryId:
|
|
1983
|
-
widgetType:
|
|
2146
|
+
...C,
|
|
2147
|
+
entryId: B,
|
|
2148
|
+
widgetType: H
|
|
1984
2149
|
});
|
|
1985
2150
|
};
|
|
1986
2151
|
},
|
|
1987
2152
|
[c]
|
|
1988
|
-
),
|
|
2153
|
+
), ie = ae(() => S.mode === "inline" ? e.map((B) => ({
|
|
1989
2154
|
type: "single",
|
|
1990
|
-
entry:
|
|
1991
|
-
id:
|
|
1992
|
-
})) :
|
|
1993
|
-
return /* @__PURE__ */
|
|
1994
|
-
|
|
1995
|
-
if (
|
|
1996
|
-
const
|
|
1997
|
-
if (
|
|
1998
|
-
const
|
|
1999
|
-
entry:
|
|
2000
|
-
widgetType:
|
|
2001
|
-
widgetData:
|
|
2002
|
-
onAction:
|
|
2155
|
+
entry: B,
|
|
2156
|
+
id: B.id
|
|
2157
|
+
})) : vt(e, S), [e, S]), ee = x ? `ash-density-${x}` : void 0;
|
|
2158
|
+
return /* @__PURE__ */ a("div", { ref: G, className: p("flex-1 overflow-y-auto px-3 py-2 space-y-1 ash-scrollbar", ee, T), children: [
|
|
2159
|
+
ie.map((B) => {
|
|
2160
|
+
if (B.type === "single") {
|
|
2161
|
+
const C = B.entry;
|
|
2162
|
+
if (C.entryType.type === "widget" && l) {
|
|
2163
|
+
const O = C.entryType, te = l({
|
|
2164
|
+
entry: C,
|
|
2165
|
+
widgetType: O.widgetType,
|
|
2166
|
+
widgetData: O.widgetData,
|
|
2167
|
+
onAction: W(C.id, O.widgetType)
|
|
2003
2168
|
});
|
|
2004
|
-
if (
|
|
2005
|
-
return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children:
|
|
2169
|
+
if (te !== null)
|
|
2170
|
+
return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children: te }, C.id);
|
|
2006
2171
|
}
|
|
2007
2172
|
return /* @__PURE__ */ t(
|
|
2008
|
-
|
|
2173
|
+
dn,
|
|
2009
2174
|
{
|
|
2010
|
-
entry:
|
|
2011
|
-
onOptionSelect:
|
|
2012
|
-
defaultExpanded:
|
|
2013
|
-
richContentRenderers: o
|
|
2175
|
+
entry: C,
|
|
2176
|
+
onOptionSelect: i,
|
|
2177
|
+
defaultExpanded: S.defaultExpanded,
|
|
2178
|
+
richContentRenderers: o,
|
|
2179
|
+
markdownComponents: E,
|
|
2180
|
+
userVariant: f,
|
|
2181
|
+
assistantVariant: d,
|
|
2182
|
+
scale: x,
|
|
2183
|
+
showAvatars: m,
|
|
2184
|
+
showTimestamp: w,
|
|
2185
|
+
renderMetadata: D,
|
|
2186
|
+
metadata: R
|
|
2014
2187
|
},
|
|
2015
|
-
|
|
2188
|
+
C.id
|
|
2016
2189
|
);
|
|
2017
2190
|
}
|
|
2018
|
-
const
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2021
|
-
/* @__PURE__ */ t("div", { className: "flex-1", children:
|
|
2022
|
-
|
|
2191
|
+
const H = yt(B.entries);
|
|
2192
|
+
return /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
|
|
2193
|
+
m && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
2194
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: S.mode === "accordion" ? /* @__PURE__ */ t(
|
|
2195
|
+
Tn,
|
|
2023
2196
|
{
|
|
2024
|
-
toolCalls:
|
|
2025
|
-
defaultExpanded:
|
|
2197
|
+
toolCalls: H,
|
|
2198
|
+
defaultExpanded: S.defaultExpanded
|
|
2026
2199
|
}
|
|
2027
2200
|
) : /* @__PURE__ */ t(
|
|
2028
|
-
|
|
2201
|
+
Nn,
|
|
2029
2202
|
{
|
|
2030
|
-
toolCalls:
|
|
2031
|
-
defaultExpanded:
|
|
2032
|
-
animationDuration:
|
|
2203
|
+
toolCalls: H,
|
|
2204
|
+
defaultExpanded: S.defaultExpanded,
|
|
2205
|
+
animationDuration: S.animationDuration
|
|
2033
2206
|
}
|
|
2034
2207
|
) })
|
|
2035
|
-
] },
|
|
2208
|
+
] }, B.id);
|
|
2036
2209
|
}),
|
|
2037
|
-
r && /* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2039
|
-
/* @__PURE__ */ t("div", { className: "flex-1
|
|
2210
|
+
r && /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
|
|
2211
|
+
m && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
2212
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t("div", { className: "ash-message-bubble rounded-lg bg-white/[0.03] text-white/80 leading-relaxed", style: { padding: "var(--ash-message-padding, 0.5rem 0.75rem)", fontSize: "var(--ash-font-size-base, 13px)" }, children: /* @__PURE__ */ t(un, { content: r, isStreaming: !0 }) }) })
|
|
2040
2213
|
] }),
|
|
2041
|
-
n && !r && /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2043
|
-
/* @__PURE__ */ t("div", { className: "rounded-
|
|
2214
|
+
n && !r && /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
|
|
2215
|
+
m && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
2216
|
+
/* @__PURE__ */ t("div", { className: "rounded-lg px-3 py-1.5 bg-white/[0.03]", children: /* @__PURE__ */ t(Re, { variant: "dots" }) })
|
|
2044
2217
|
] }),
|
|
2045
|
-
/* @__PURE__ */ t("div", { ref:
|
|
2218
|
+
/* @__PURE__ */ t("div", { ref: A })
|
|
2046
2219
|
] });
|
|
2047
2220
|
}
|
|
2048
|
-
function
|
|
2221
|
+
function $n(e) {
|
|
2049
2222
|
switch (e) {
|
|
2050
2223
|
case "info":
|
|
2051
|
-
return /* @__PURE__ */ t(
|
|
2224
|
+
return /* @__PURE__ */ t(Et, { className: "w-3.5 h-3.5" });
|
|
2052
2225
|
case "warn":
|
|
2053
|
-
return /* @__PURE__ */ t(
|
|
2226
|
+
return /* @__PURE__ */ t(Ze, { className: "w-3.5 h-3.5" });
|
|
2054
2227
|
case "error":
|
|
2055
|
-
return /* @__PURE__ */ t(
|
|
2228
|
+
return /* @__PURE__ */ t(It, { className: "w-3.5 h-3.5" });
|
|
2056
2229
|
case "debug":
|
|
2057
|
-
return /* @__PURE__ */ t(
|
|
2230
|
+
return /* @__PURE__ */ t(Lt, { className: "w-3.5 h-3.5" });
|
|
2058
2231
|
}
|
|
2059
2232
|
}
|
|
2060
|
-
function
|
|
2233
|
+
function Rn(e) {
|
|
2061
2234
|
switch (e) {
|
|
2062
2235
|
case "info":
|
|
2063
2236
|
return "text-blue-400";
|
|
@@ -2069,7 +2242,7 @@ function Ln(e) {
|
|
|
2069
2242
|
return "text-white/50";
|
|
2070
2243
|
}
|
|
2071
2244
|
}
|
|
2072
|
-
function
|
|
2245
|
+
function An(e) {
|
|
2073
2246
|
switch (e) {
|
|
2074
2247
|
case "info":
|
|
2075
2248
|
return "bg-blue-900/20";
|
|
@@ -2081,7 +2254,7 @@ function $n(e) {
|
|
|
2081
2254
|
return "bg-white/5";
|
|
2082
2255
|
}
|
|
2083
2256
|
}
|
|
2084
|
-
function
|
|
2257
|
+
function Dn(e) {
|
|
2085
2258
|
switch (e) {
|
|
2086
2259
|
case "setup":
|
|
2087
2260
|
return "Setup";
|
|
@@ -2095,26 +2268,26 @@ function An(e) {
|
|
|
2095
2268
|
return "Startup";
|
|
2096
2269
|
}
|
|
2097
2270
|
}
|
|
2098
|
-
function
|
|
2271
|
+
function jn({ log: e }) {
|
|
2099
2272
|
const [n, r] = N(!1), s = e.data && Object.keys(e.data).length > 0;
|
|
2100
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ a(
|
|
2101
2274
|
"div",
|
|
2102
2275
|
{
|
|
2103
2276
|
className: p(
|
|
2104
2277
|
"px-3 py-2 border-b border-white/10 last:border-b-0",
|
|
2105
|
-
|
|
2278
|
+
An(e.level)
|
|
2106
2279
|
),
|
|
2107
2280
|
children: [
|
|
2108
|
-
/* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ a(
|
|
2109
2282
|
"div",
|
|
2110
2283
|
{
|
|
2111
2284
|
className: p("flex items-start gap-2", s && "cursor-pointer"),
|
|
2112
2285
|
onClick: () => s && r(!n),
|
|
2113
2286
|
children: [
|
|
2114
|
-
/* @__PURE__ */ t("div", { className: "w-4 flex-shrink-0 pt-0.5", children: s && (n ? /* @__PURE__ */ t(
|
|
2115
|
-
/* @__PURE__ */ t("div", { className: p("flex-shrink-0 pt-0.5",
|
|
2116
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children:
|
|
2117
|
-
/* @__PURE__ */ t("span", { className: "text-xs px-1.5 py-0.5 rounded bg-white/10 text-white/70 font-medium flex-shrink-0", children:
|
|
2287
|
+
/* @__PURE__ */ t("div", { className: "w-4 flex-shrink-0 pt-0.5", children: s && (n ? /* @__PURE__ */ t(We, { className: "w-3 h-3 text-white/40" }) : /* @__PURE__ */ t(be, { className: "w-3 h-3 text-white/40" })) }),
|
|
2288
|
+
/* @__PURE__ */ t("div", { className: p("flex-shrink-0 pt-0.5", Rn(e.level)), children: $n(e.level) }),
|
|
2289
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children: je(e.timestamp) }),
|
|
2290
|
+
/* @__PURE__ */ t("span", { className: "text-xs px-1.5 py-0.5 rounded bg-white/10 text-white/70 font-medium flex-shrink-0", children: Dn(e.category) }),
|
|
2118
2291
|
/* @__PURE__ */ t("span", { className: "text-sm text-white/80 flex-1 break-words", children: e.message })
|
|
2119
2292
|
]
|
|
2120
2293
|
}
|
|
@@ -2124,16 +2297,16 @@ function Rn({ log: e }) {
|
|
|
2124
2297
|
}
|
|
2125
2298
|
);
|
|
2126
2299
|
}
|
|
2127
|
-
function
|
|
2300
|
+
function Wn({
|
|
2128
2301
|
logs: e,
|
|
2129
2302
|
title: n = "Logs",
|
|
2130
2303
|
isLoading: r,
|
|
2131
2304
|
defaultCollapsed: s = !0,
|
|
2132
|
-
maxHeight:
|
|
2305
|
+
maxHeight: i = 256,
|
|
2133
2306
|
className: l
|
|
2134
2307
|
}) {
|
|
2135
|
-
const [c, h] = N(s), o = e.filter((d) => d.level === "error").length,
|
|
2136
|
-
return e.length === 0 && !r ? null : /* @__PURE__ */
|
|
2308
|
+
const [c, h] = N(s), o = e.filter((d) => d.level === "error").length, f = e.filter((d) => d.level === "warn").length;
|
|
2309
|
+
return e.length === 0 && !r ? null : /* @__PURE__ */ a(
|
|
2137
2310
|
"div",
|
|
2138
2311
|
{
|
|
2139
2312
|
className: p(
|
|
@@ -2141,33 +2314,33 @@ function Dn({
|
|
|
2141
2314
|
l
|
|
2142
2315
|
),
|
|
2143
2316
|
children: [
|
|
2144
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ a(
|
|
2145
2318
|
"button",
|
|
2146
2319
|
{
|
|
2147
2320
|
onClick: () => h(!c),
|
|
2148
2321
|
className: "w-full flex items-center justify-between px-4 py-2 hover:bg-white/5 transition-colors",
|
|
2149
2322
|
children: [
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
/* @__PURE__ */ t(
|
|
2323
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2324
|
+
/* @__PURE__ */ t(Ie, { className: "w-4 h-4 text-white/50" }),
|
|
2152
2325
|
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-white/80", children: n }),
|
|
2153
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
|
|
2154
2327
|
"(",
|
|
2155
2328
|
e.length,
|
|
2156
2329
|
")"
|
|
2157
2330
|
] }),
|
|
2158
|
-
o > 0 && /* @__PURE__ */
|
|
2331
|
+
o > 0 && /* @__PURE__ */ a("span", { className: "text-xs px-1.5 py-0.5 rounded bg-red-900/50 text-red-400 font-medium", children: [
|
|
2159
2332
|
o,
|
|
2160
2333
|
" error",
|
|
2161
2334
|
o > 1 ? "s" : ""
|
|
2162
2335
|
] }),
|
|
2163
|
-
|
|
2164
|
-
|
|
2336
|
+
f > 0 && /* @__PURE__ */ a("span", { className: "text-xs px-1.5 py-0.5 rounded bg-yellow-900/50 text-yellow-400 font-medium", children: [
|
|
2337
|
+
f,
|
|
2165
2338
|
" warning",
|
|
2166
|
-
|
|
2339
|
+
f > 1 ? "s" : ""
|
|
2167
2340
|
] }),
|
|
2168
2341
|
r && /* @__PURE__ */ t("span", { className: "text-xs text-white/40 animate-pulse", children: "Loading..." })
|
|
2169
2342
|
] }),
|
|
2170
|
-
c ? /* @__PURE__ */ t(
|
|
2343
|
+
c ? /* @__PURE__ */ t(be, { className: "w-4 h-4 text-white/40" }) : /* @__PURE__ */ t(We, { className: "w-4 h-4 text-white/40" })
|
|
2171
2344
|
]
|
|
2172
2345
|
}
|
|
2173
2346
|
),
|
|
@@ -2175,22 +2348,22 @@ function Dn({
|
|
|
2175
2348
|
"div",
|
|
2176
2349
|
{
|
|
2177
2350
|
className: "overflow-y-auto border-t border-white/10",
|
|
2178
|
-
style: { maxHeight:
|
|
2179
|
-
children: e.length === 0 ? /* @__PURE__ */ t("div", { className: "px-4 py-6 text-center text-sm text-white/50", children: "No logs yet" }) : e.map((d,
|
|
2351
|
+
style: { maxHeight: i },
|
|
2352
|
+
children: e.length === 0 ? /* @__PURE__ */ t("div", { className: "px-4 py-6 text-center text-sm text-white/50", children: "No logs yet" }) : e.map((d, x) => /* @__PURE__ */ t(jn, { log: d }, `${d.timestamp}-${x}`))
|
|
2180
2353
|
}
|
|
2181
2354
|
)
|
|
2182
2355
|
]
|
|
2183
2356
|
}
|
|
2184
2357
|
);
|
|
2185
2358
|
}
|
|
2186
|
-
var Ae =
|
|
2359
|
+
var Ae = Je(void 0), Bn = "ash-ui-theme";
|
|
2187
2360
|
function Ir({
|
|
2188
2361
|
children: e,
|
|
2189
2362
|
defaultTheme: n,
|
|
2190
|
-
storageKey: r =
|
|
2363
|
+
storageKey: r = Bn,
|
|
2191
2364
|
listenToSystemChanges: s = !0
|
|
2192
2365
|
}) {
|
|
2193
|
-
const [
|
|
2366
|
+
const [i, l] = N(() => {
|
|
2194
2367
|
if (typeof window < "u") {
|
|
2195
2368
|
const d = localStorage.getItem(r);
|
|
2196
2369
|
if (d === "dark" || d === "light")
|
|
@@ -2200,33 +2373,33 @@ function Ir({
|
|
|
2200
2373
|
}
|
|
2201
2374
|
return n ?? "light";
|
|
2202
2375
|
}), [c, h] = N(!1);
|
|
2203
|
-
|
|
2376
|
+
P(() => {
|
|
2204
2377
|
h(!0);
|
|
2205
|
-
}, []),
|
|
2378
|
+
}, []), P(() => {
|
|
2206
2379
|
if (!c) return;
|
|
2207
2380
|
const d = document.documentElement;
|
|
2208
|
-
|
|
2209
|
-
}, [
|
|
2381
|
+
i === "dark" ? d.classList.add("dark") : d.classList.remove("dark"), localStorage.setItem(r, i);
|
|
2382
|
+
}, [i, c, r]), P(() => {
|
|
2210
2383
|
if (!s || typeof window > "u") return;
|
|
2211
|
-
const d = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
2212
|
-
localStorage.getItem(r) || l(
|
|
2384
|
+
const d = window.matchMedia("(prefers-color-scheme: dark)"), x = (m) => {
|
|
2385
|
+
localStorage.getItem(r) || l(m.matches ? "dark" : "light");
|
|
2213
2386
|
};
|
|
2214
|
-
return d.addEventListener("change",
|
|
2387
|
+
return d.addEventListener("change", x), () => d.removeEventListener("change", x);
|
|
2215
2388
|
}, [r, s]);
|
|
2216
|
-
const o =
|
|
2389
|
+
const o = F(() => {
|
|
2217
2390
|
l((d) => d === "light" ? "dark" : "light");
|
|
2218
|
-
}, []),
|
|
2391
|
+
}, []), f = F((d) => {
|
|
2219
2392
|
l(d);
|
|
2220
2393
|
}, []);
|
|
2221
|
-
return c ? /* @__PURE__ */ t(Ae.Provider, { value: { theme:
|
|
2394
|
+
return c ? /* @__PURE__ */ t(Ae.Provider, { value: { theme: i, toggleTheme: o, setTheme: f }, children: e }) : /* @__PURE__ */ t(Ae.Provider, { value: { theme: n ?? "light", toggleTheme: o, setTheme: f }, children: e });
|
|
2222
2395
|
}
|
|
2223
2396
|
function Lr() {
|
|
2224
|
-
const e =
|
|
2397
|
+
const e = Ue(Ae);
|
|
2225
2398
|
if (e === void 0)
|
|
2226
2399
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
2227
2400
|
return e;
|
|
2228
2401
|
}
|
|
2229
|
-
var
|
|
2402
|
+
var On = {
|
|
2230
2403
|
slideUp: `
|
|
2231
2404
|
@keyframes ash-slide-up {
|
|
2232
2405
|
from { opacity: 0; transform: translateY(20px); }
|
|
@@ -2264,33 +2437,33 @@ var Wn = {
|
|
|
2264
2437
|
}
|
|
2265
2438
|
`
|
|
2266
2439
|
};
|
|
2267
|
-
Object.values(
|
|
2440
|
+
Object.values(On).join(`
|
|
2268
2441
|
`);
|
|
2269
|
-
function
|
|
2442
|
+
function zn({
|
|
2270
2443
|
messages: e,
|
|
2271
2444
|
loading: n,
|
|
2272
2445
|
streamingContent: r
|
|
2273
2446
|
}) {
|
|
2274
|
-
const s =
|
|
2275
|
-
return
|
|
2276
|
-
|
|
2277
|
-
}, [e, r, n]), /* @__PURE__ */
|
|
2278
|
-
e.map((l) => /* @__PURE__ */ t(
|
|
2279
|
-
r && /* @__PURE__ */ t("div", { className: "flex justify-start animate-fade-in", children: /* @__PURE__ */
|
|
2447
|
+
const s = V(null), i = V(null);
|
|
2448
|
+
return P(() => {
|
|
2449
|
+
i.current && i.current.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
2450
|
+
}, [e, r, n]), /* @__PURE__ */ a("div", { ref: s, className: "flex-1 overflow-y-auto p-4 space-y-4", children: [
|
|
2451
|
+
e.map((l) => /* @__PURE__ */ t(Fn, { message: l }, l.id)),
|
|
2452
|
+
r && /* @__PURE__ */ t("div", { className: "flex justify-start animate-fade-in", children: /* @__PURE__ */ a("div", { className: "max-w-[80%] card-glass rounded-2xl p-4", children: [
|
|
2280
2453
|
/* @__PURE__ */ t("div", { className: "text-xs text-[#ccff00] mb-2 font-medium", children: "Assistant" }),
|
|
2281
2454
|
/* @__PURE__ */ t("div", { className: "message-content prose prose-sm prose-invert max-w-none whitespace-pre-wrap", children: r })
|
|
2282
2455
|
] }) }),
|
|
2283
|
-
n && !r && /* @__PURE__ */ t("div", { className: "flex justify-start animate-fade-in", children: /* @__PURE__ */ t("div", { className: "card-glass rounded-2xl p-4", children: /* @__PURE__ */
|
|
2456
|
+
n && !r && /* @__PURE__ */ t("div", { className: "flex justify-start animate-fade-in", children: /* @__PURE__ */ t("div", { className: "card-glass rounded-2xl p-4", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-[#ccff00]", children: [
|
|
2284
2457
|
/* @__PURE__ */ t("span", { className: "w-2 h-2 rounded-full bg-[#ccff00] animate-pulse" }),
|
|
2285
2458
|
/* @__PURE__ */ t("span", { className: "w-2 h-2 rounded-full bg-[#ccff00] animate-pulse delay-100" }),
|
|
2286
2459
|
/* @__PURE__ */ t("span", { className: "w-2 h-2 rounded-full bg-[#ccff00] animate-pulse delay-200" })
|
|
2287
2460
|
] }) }) }),
|
|
2288
|
-
/* @__PURE__ */ t("div", { ref:
|
|
2461
|
+
/* @__PURE__ */ t("div", { ref: i })
|
|
2289
2462
|
] });
|
|
2290
2463
|
}
|
|
2291
|
-
function
|
|
2464
|
+
function Fn({ message: e }) {
|
|
2292
2465
|
const n = e.role === "user", r = e.role === "tool";
|
|
2293
|
-
return /* @__PURE__ */ t("div", { className: `flex ${n ? "justify-end" : "justify-start"} animate-fade-in`, children: /* @__PURE__ */
|
|
2466
|
+
return /* @__PURE__ */ t("div", { className: `flex ${n ? "justify-end" : "justify-start"} animate-fade-in`, children: /* @__PURE__ */ a(
|
|
2294
2467
|
"div",
|
|
2295
2468
|
{
|
|
2296
2469
|
className: `max-w-[80%] rounded-2xl p-4 ${n ? "bg-[#ccff00] text-black shadow-[0_0_20px_rgba(204,255,0,0.2)]" : r ? "bg-yellow-500/10 border border-yellow-500/20" : "card-glass"}`,
|
|
@@ -2302,173 +2475,175 @@ function Bn({ message: e }) {
|
|
|
2302
2475
|
children: e.role.charAt(0).toUpperCase() + e.role.slice(1)
|
|
2303
2476
|
}
|
|
2304
2477
|
),
|
|
2305
|
-
/* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((
|
|
2478
|
+
/* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((i, l) => /* @__PURE__ */ t(Pn, { block: i, isUser: n }, l)) }),
|
|
2306
2479
|
/* @__PURE__ */ t("div", { className: `text-xs mt-3 ${n ? "text-black/40" : "text-white/40"}`, children: new Date(e.createdAt).toLocaleTimeString() })
|
|
2307
2480
|
]
|
|
2308
2481
|
}
|
|
2309
2482
|
) });
|
|
2310
2483
|
}
|
|
2311
|
-
function
|
|
2484
|
+
function Pn({
|
|
2312
2485
|
block: e,
|
|
2313
2486
|
isUser: n
|
|
2314
2487
|
}) {
|
|
2315
|
-
return e.type === "text" && e.text ? /* @__PURE__ */ t("p", { className: "whitespace-pre-wrap", children: e.text }) : e.type === "tool_use" ? /* @__PURE__ */
|
|
2316
|
-
/* @__PURE__ */
|
|
2488
|
+
return e.type === "text" && e.text ? /* @__PURE__ */ t("p", { className: "whitespace-pre-wrap", children: e.text }) : e.type === "tool_use" ? /* @__PURE__ */ a("div", { className: "bg-black/40 border border-white/10 rounded-xl p-3 my-2", children: [
|
|
2489
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-[#ccff00] mb-2 font-medium flex items-center gap-2", children: [
|
|
2317
2490
|
/* @__PURE__ */ t("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z" }) }),
|
|
2318
2491
|
"Tool: ",
|
|
2319
2492
|
e.name
|
|
2320
2493
|
] }),
|
|
2321
2494
|
/* @__PURE__ */ t("pre", { className: "text-sm overflow-x-auto text-white/80 font-mono", children: JSON.stringify(e.input, null, 2) })
|
|
2322
|
-
] }) : e.type === "tool_result" ? /* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2495
|
+
] }) : e.type === "tool_result" ? /* @__PURE__ */ a("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-xl p-3 my-2", children: [
|
|
2496
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-emerald-400 mb-2 font-medium flex items-center gap-2", children: [
|
|
2324
2497
|
/* @__PURE__ */ t("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" }) }),
|
|
2325
2498
|
"Tool Result"
|
|
2326
2499
|
] }),
|
|
2327
2500
|
/* @__PURE__ */ t("pre", { className: "text-sm overflow-x-auto text-emerald-300/80 font-mono", children: typeof e.content == "string" ? e.content : JSON.stringify(e.content, null, 2) })
|
|
2328
2501
|
] }) : null;
|
|
2329
2502
|
}
|
|
2330
|
-
const
|
|
2331
|
-
function
|
|
2503
|
+
const Gn = 5e3;
|
|
2504
|
+
function qe(e) {
|
|
2332
2505
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
2333
2506
|
}
|
|
2334
|
-
function
|
|
2507
|
+
function Vn({
|
|
2335
2508
|
onSend: e,
|
|
2336
2509
|
disabled: n,
|
|
2337
2510
|
loading: r,
|
|
2338
2511
|
placeholder: s = "Type your message...",
|
|
2339
|
-
queue:
|
|
2512
|
+
queue: i = [],
|
|
2340
2513
|
onCancelQueued: l,
|
|
2341
2514
|
sessionContext: c = "",
|
|
2342
2515
|
onSessionContextChange: h,
|
|
2343
2516
|
envVars: o = {},
|
|
2344
|
-
onEnvVarsChange:
|
|
2517
|
+
onEnvVarsChange: f,
|
|
2345
2518
|
enableFileUpload: d = !0,
|
|
2346
|
-
maxFileSize:
|
|
2519
|
+
maxFileSize: x = 100 * 1024 * 1024,
|
|
2347
2520
|
// 100MB
|
|
2348
|
-
maxFiles:
|
|
2349
|
-
onStop:
|
|
2350
|
-
canStop:
|
|
2351
|
-
enableLongTextConversion:
|
|
2352
|
-
longTextThreshold:
|
|
2521
|
+
maxFiles: m = 10,
|
|
2522
|
+
onStop: w,
|
|
2523
|
+
canStop: E = !1,
|
|
2524
|
+
enableLongTextConversion: D = !0,
|
|
2525
|
+
longTextThreshold: R = Gn
|
|
2353
2526
|
}) {
|
|
2354
|
-
const [
|
|
2355
|
-
const
|
|
2356
|
-
let
|
|
2357
|
-
for (let
|
|
2358
|
-
|
|
2359
|
-
return btoa(
|
|
2360
|
-
}, []),
|
|
2361
|
-
if (!
|
|
2527
|
+
const [T, X] = N(""), [S, G] = N(!1), [A, W] = N(!1), [ie, ee] = N(""), [B, H] = N(""), [C, O] = N([]), [te, ce] = N(!1), [ne, Q] = N(null), [he, me] = N(/* @__PURE__ */ new Map()), ge = V(0), de = V(null), ke = V(null), pe = V(null), we = F((u) => {
|
|
2528
|
+
const I = new TextEncoder().encode(u);
|
|
2529
|
+
let k = "";
|
|
2530
|
+
for (let y = 0; y < I.length; y++)
|
|
2531
|
+
k += String.fromCharCode(I[y]);
|
|
2532
|
+
return btoa(k);
|
|
2533
|
+
}, []), K = F((u) => {
|
|
2534
|
+
if (!D || !d) return;
|
|
2362
2535
|
const b = u.clipboardData.getData("text/plain");
|
|
2363
|
-
if (b.length >
|
|
2364
|
-
if (u.preventDefault(),
|
|
2365
|
-
console.warn(`Cannot convert text to attachment: maximum ${
|
|
2536
|
+
if (b.length > R) {
|
|
2537
|
+
if (u.preventDefault(), C.length >= m) {
|
|
2538
|
+
console.warn(`Cannot convert text to attachment: maximum ${m} files reached`);
|
|
2366
2539
|
return;
|
|
2367
2540
|
}
|
|
2368
|
-
const
|
|
2541
|
+
const I = b.split(`
|
|
2369
2542
|
`).length;
|
|
2370
2543
|
ge.current += 1;
|
|
2371
|
-
const
|
|
2372
|
-
filename:
|
|
2373
|
-
content:
|
|
2544
|
+
const k = ge.current, y = `pasted-text-${k}-${Date.now()}.txt`, j = we(b), it = new TextEncoder().encode(b).length, lt = {
|
|
2545
|
+
filename: y,
|
|
2546
|
+
content: j,
|
|
2374
2547
|
mimeType: "text/plain",
|
|
2375
|
-
size:
|
|
2548
|
+
size: it
|
|
2376
2549
|
};
|
|
2377
|
-
|
|
2378
|
-
const
|
|
2379
|
-
return
|
|
2380
|
-
}),
|
|
2550
|
+
me((Le) => {
|
|
2551
|
+
const Ge = new Map(Le);
|
|
2552
|
+
return Ge.set(y, { number: k, lineCount: I }), Ge;
|
|
2553
|
+
}), O((Le) => [...Le, lt]), Q({
|
|
2381
2554
|
originalLength: b.length,
|
|
2382
|
-
filename:
|
|
2555
|
+
filename: y,
|
|
2383
2556
|
preview: b.slice(0, 100) + (b.length > 100 ? "..." : ""),
|
|
2384
|
-
lineCount:
|
|
2557
|
+
lineCount: I
|
|
2385
2558
|
}), setTimeout(() => {
|
|
2386
|
-
|
|
2559
|
+
Q(null);
|
|
2387
2560
|
}, 5e3);
|
|
2388
2561
|
}
|
|
2389
|
-
}, [
|
|
2390
|
-
const u =
|
|
2391
|
-
(u ||
|
|
2392
|
-
},
|
|
2393
|
-
u.key === "Enter" && !u.shiftKey && (u.preventDefault(),
|
|
2394
|
-
},
|
|
2395
|
-
const u =
|
|
2562
|
+
}, [D, d, R, C.length, m, we]), g = () => {
|
|
2563
|
+
const u = T.trim();
|
|
2564
|
+
(u || C.length > 0) && !n && (e(u || "(files attached)", C.length > 0 ? C : void 0), X(""), O([]), me(/* @__PURE__ */ new Map()), de.current && (de.current.style.height = "auto"));
|
|
2565
|
+
}, v = (u) => {
|
|
2566
|
+
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), g());
|
|
2567
|
+
}, M = () => {
|
|
2568
|
+
const u = de.current;
|
|
2396
2569
|
u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 200)}px`);
|
|
2397
|
-
},
|
|
2570
|
+
}, z = async (u) => {
|
|
2398
2571
|
if (!u) return;
|
|
2399
|
-
const b = [],
|
|
2400
|
-
for (let
|
|
2401
|
-
const
|
|
2402
|
-
if (
|
|
2403
|
-
console.warn(`File ${
|
|
2572
|
+
const b = [], I = C.length;
|
|
2573
|
+
for (let k = 0; k < u.length && I + b.length < m; k++) {
|
|
2574
|
+
const y = u[k];
|
|
2575
|
+
if (y.size > x) {
|
|
2576
|
+
console.warn(`File ${y.name} exceeds maximum size of ${qe(x)}`);
|
|
2404
2577
|
continue;
|
|
2405
2578
|
}
|
|
2406
2579
|
try {
|
|
2407
|
-
const
|
|
2580
|
+
const j = await re(y);
|
|
2408
2581
|
b.push({
|
|
2409
|
-
filename:
|
|
2410
|
-
content:
|
|
2411
|
-
mimeType:
|
|
2412
|
-
size:
|
|
2582
|
+
filename: y.name,
|
|
2583
|
+
content: j,
|
|
2584
|
+
mimeType: y.type || "application/octet-stream",
|
|
2585
|
+
size: y.size
|
|
2413
2586
|
});
|
|
2414
|
-
} catch (
|
|
2415
|
-
console.error(`Failed to read file ${
|
|
2587
|
+
} catch (j) {
|
|
2588
|
+
console.error(`Failed to read file ${y.name}:`, j);
|
|
2416
2589
|
}
|
|
2417
2590
|
}
|
|
2418
|
-
b.length > 0 &&
|
|
2419
|
-
},
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2422
|
-
const
|
|
2423
|
-
b(
|
|
2424
|
-
},
|
|
2425
|
-
}),
|
|
2426
|
-
|
|
2427
|
-
},
|
|
2428
|
-
u.preventDefault(), d && !n &&
|
|
2429
|
-
},
|
|
2430
|
-
u.preventDefault(),
|
|
2431
|
-
},
|
|
2432
|
-
u.preventDefault(),
|
|
2433
|
-
},
|
|
2434
|
-
const b =
|
|
2435
|
-
b &&
|
|
2436
|
-
const
|
|
2437
|
-
return
|
|
2438
|
-
}),
|
|
2439
|
-
}, J =
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2591
|
+
b.length > 0 && O((k) => [...k, ...b]);
|
|
2592
|
+
}, re = (u) => new Promise((b, I) => {
|
|
2593
|
+
const k = new FileReader();
|
|
2594
|
+
k.onload = () => {
|
|
2595
|
+
const j = k.result.split(",")[1];
|
|
2596
|
+
b(j || "");
|
|
2597
|
+
}, k.onerror = () => I(k.error), k.readAsDataURL(u);
|
|
2598
|
+
}), le = (u) => {
|
|
2599
|
+
z(u.target.files), pe.current && (pe.current.value = "");
|
|
2600
|
+
}, ue = (u) => {
|
|
2601
|
+
u.preventDefault(), d && !n && ce(!0);
|
|
2602
|
+
}, Y = (u) => {
|
|
2603
|
+
u.preventDefault(), ce(!1);
|
|
2604
|
+
}, q = (u) => {
|
|
2605
|
+
u.preventDefault(), ce(!1), d && !n && z(u.dataTransfer.files);
|
|
2606
|
+
}, Z = (u) => {
|
|
2607
|
+
const b = C[u];
|
|
2608
|
+
b && he.has(b.filename) && me((I) => {
|
|
2609
|
+
const k = new Map(I);
|
|
2610
|
+
return k.delete(b.filename), k;
|
|
2611
|
+
}), O((I) => I.filter((k, y) => y !== u));
|
|
2612
|
+
}, J = i.length > 0;
|
|
2613
|
+
r || J && `${i.length}`;
|
|
2614
|
+
const Ce = c.trim().length > 0, _e = Object.keys(o).length > 0, ve = !n && (T.trim() || C.length > 0), Te = () => {
|
|
2615
|
+
const u = ie.trim(), b = B.trim();
|
|
2616
|
+
u && f && (f({ ...o, [u]: b }), ee(""), H(""));
|
|
2617
|
+
}, ye = (u) => {
|
|
2618
|
+
if (f) {
|
|
2444
2619
|
const b = { ...o };
|
|
2445
|
-
delete b[u],
|
|
2620
|
+
delete b[u], f(b);
|
|
2446
2621
|
}
|
|
2447
|
-
},
|
|
2448
|
-
u.key === "Enter" && (u.preventDefault(),
|
|
2622
|
+
}, U = (u) => {
|
|
2623
|
+
u.key === "Enter" && (u.preventDefault(), Te());
|
|
2449
2624
|
};
|
|
2450
|
-
return /* @__PURE__ */
|
|
2625
|
+
return /* @__PURE__ */ a(
|
|
2451
2626
|
"div",
|
|
2452
2627
|
{
|
|
2453
|
-
className: `border-t border-white/10 p-3 sm:p-4 glass-panel relative ${
|
|
2454
|
-
onDragOver:
|
|
2455
|
-
onDragLeave:
|
|
2456
|
-
onDrop:
|
|
2628
|
+
className: `border-t border-white/10 p-3 sm:p-4 glass-panel relative ${te ? "bg-[#ccff00]/5" : ""}`,
|
|
2629
|
+
onDragOver: ue,
|
|
2630
|
+
onDragLeave: Y,
|
|
2631
|
+
onDrop: q,
|
|
2457
2632
|
children: [
|
|
2458
|
-
|
|
2459
|
-
h && /* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2633
|
+
te && d && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[#ccff00]/10 border-2 border-dashed border-[#ccff00]/50 rounded-xl flex items-center justify-center z-10 pointer-events-none", children: /* @__PURE__ */ t("div", { className: "text-[#ccff00] font-medium", children: "Drop files here" }) }),
|
|
2634
|
+
h && /* @__PURE__ */ a("div", { className: "mb-3", children: [
|
|
2635
|
+
/* @__PURE__ */ a(
|
|
2461
2636
|
"button",
|
|
2462
2637
|
{
|
|
2463
2638
|
type: "button",
|
|
2464
|
-
onClick: () =>
|
|
2639
|
+
onClick: () => G(!S),
|
|
2465
2640
|
className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
|
|
2466
2641
|
children: [
|
|
2467
2642
|
/* @__PURE__ */ t(
|
|
2468
2643
|
"svg",
|
|
2469
2644
|
{
|
|
2470
2645
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2471
|
-
className: `h-3 w-3 transition-transform ${
|
|
2646
|
+
className: `h-3 w-3 transition-transform ${S ? "rotate-90" : ""}`,
|
|
2472
2647
|
viewBox: "0 0 20 20",
|
|
2473
2648
|
fill: "currentColor",
|
|
2474
2649
|
children: /* @__PURE__ */ t(
|
|
@@ -2482,19 +2657,19 @@ function Pn({
|
|
|
2482
2657
|
}
|
|
2483
2658
|
),
|
|
2484
2659
|
/* @__PURE__ */ t("span", { className: "uppercase tracking-wide", children: "Session Context" }),
|
|
2485
|
-
|
|
2660
|
+
Ce && !S && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: "Active" })
|
|
2486
2661
|
]
|
|
2487
2662
|
}
|
|
2488
2663
|
),
|
|
2489
|
-
|
|
2664
|
+
S && /* @__PURE__ */ a("div", { className: "mt-2", children: [
|
|
2490
2665
|
/* @__PURE__ */ t(
|
|
2491
2666
|
"textarea",
|
|
2492
2667
|
{
|
|
2493
|
-
ref:
|
|
2668
|
+
ref: ke,
|
|
2494
2669
|
value: c,
|
|
2495
2670
|
onChange: (u) => h(u.target.value),
|
|
2496
2671
|
onInput: () => {
|
|
2497
|
-
const u =
|
|
2672
|
+
const u = ke.current;
|
|
2498
2673
|
u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 150)}px`);
|
|
2499
2674
|
},
|
|
2500
2675
|
placeholder: "Add context that will be injected into every request (e.g., current page, user selection, etc.)",
|
|
@@ -2505,19 +2680,19 @@ function Pn({
|
|
|
2505
2680
|
/* @__PURE__ */ t("p", { className: "text-xs text-white/40 mt-1", children: "This context is appended to the system prompt for each message sent." })
|
|
2506
2681
|
] })
|
|
2507
2682
|
] }),
|
|
2508
|
-
|
|
2509
|
-
/* @__PURE__ */
|
|
2683
|
+
f && /* @__PURE__ */ a("div", { className: "mb-3", children: [
|
|
2684
|
+
/* @__PURE__ */ a(
|
|
2510
2685
|
"button",
|
|
2511
2686
|
{
|
|
2512
2687
|
type: "button",
|
|
2513
|
-
onClick: () =>
|
|
2688
|
+
onClick: () => W(!A),
|
|
2514
2689
|
className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
|
|
2515
2690
|
children: [
|
|
2516
2691
|
/* @__PURE__ */ t(
|
|
2517
2692
|
"svg",
|
|
2518
2693
|
{
|
|
2519
2694
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2520
|
-
className: `h-3 w-3 transition-transform ${
|
|
2695
|
+
className: `h-3 w-3 transition-transform ${A ? "rotate-90" : ""}`,
|
|
2521
2696
|
viewBox: "0 0 20 20",
|
|
2522
2697
|
fill: "currentColor",
|
|
2523
2698
|
children: /* @__PURE__ */ t(
|
|
@@ -2531,12 +2706,12 @@ function Pn({
|
|
|
2531
2706
|
}
|
|
2532
2707
|
),
|
|
2533
2708
|
/* @__PURE__ */ t("span", { className: "uppercase tracking-wide", children: "Environment Variables" }),
|
|
2534
|
-
|
|
2709
|
+
_e && !A && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: Object.keys(o).length })
|
|
2535
2710
|
]
|
|
2536
2711
|
}
|
|
2537
2712
|
),
|
|
2538
|
-
|
|
2539
|
-
Object.entries(o).map(([u, b]) => /* @__PURE__ */
|
|
2713
|
+
A && /* @__PURE__ */ a("div", { className: "mt-2 space-y-2", children: [
|
|
2714
|
+
Object.entries(o).map(([u, b]) => /* @__PURE__ */ a(
|
|
2540
2715
|
"div",
|
|
2541
2716
|
{
|
|
2542
2717
|
className: "flex items-center gap-2 bg-white/5 border border-white/10 rounded-xl px-3 py-2 text-sm",
|
|
@@ -2547,7 +2722,7 @@ function Pn({
|
|
|
2547
2722
|
/* @__PURE__ */ t(
|
|
2548
2723
|
"button",
|
|
2549
2724
|
{
|
|
2550
|
-
onClick: () =>
|
|
2725
|
+
onClick: () => ye(u),
|
|
2551
2726
|
className: "text-white/40 hover:text-red-400 transition-colors",
|
|
2552
2727
|
title: "Remove variable",
|
|
2553
2728
|
children: /* @__PURE__ */ t(
|
|
@@ -2573,14 +2748,14 @@ function Pn({
|
|
|
2573
2748
|
},
|
|
2574
2749
|
u
|
|
2575
2750
|
)),
|
|
2576
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2577
2752
|
/* @__PURE__ */ t(
|
|
2578
2753
|
"input",
|
|
2579
2754
|
{
|
|
2580
2755
|
type: "text",
|
|
2581
|
-
value:
|
|
2582
|
-
onChange: (u) =>
|
|
2583
|
-
onKeyDown:
|
|
2756
|
+
value: ie,
|
|
2757
|
+
onChange: (u) => ee(u.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, "")),
|
|
2758
|
+
onKeyDown: U,
|
|
2584
2759
|
placeholder: "KEY",
|
|
2585
2760
|
className: "input-glass text-sm font-mono flex-1 min-w-0 py-2"
|
|
2586
2761
|
}
|
|
@@ -2590,9 +2765,9 @@ function Pn({
|
|
|
2590
2765
|
"input",
|
|
2591
2766
|
{
|
|
2592
2767
|
type: "text",
|
|
2593
|
-
value:
|
|
2594
|
-
onChange: (u) =>
|
|
2595
|
-
onKeyDown:
|
|
2768
|
+
value: B,
|
|
2769
|
+
onChange: (u) => H(u.target.value),
|
|
2770
|
+
onKeyDown: U,
|
|
2596
2771
|
placeholder: "value",
|
|
2597
2772
|
className: "input-glass text-sm font-mono flex-[2] min-w-0 py-2"
|
|
2598
2773
|
}
|
|
@@ -2600,8 +2775,8 @@ function Pn({
|
|
|
2600
2775
|
/* @__PURE__ */ t(
|
|
2601
2776
|
"button",
|
|
2602
2777
|
{
|
|
2603
|
-
onClick:
|
|
2604
|
-
disabled: !
|
|
2778
|
+
onClick: Te,
|
|
2779
|
+
disabled: !ie.trim(),
|
|
2605
2780
|
className: "px-3 py-2 text-sm bg-[#ccff00]/20 hover:bg-[#ccff00]/30 text-[#ccff00] rounded-xl transition-all duration-300 disabled:opacity-30 disabled:cursor-not-allowed",
|
|
2606
2781
|
children: "Add"
|
|
2607
2782
|
}
|
|
@@ -2610,8 +2785,8 @@ function Pn({
|
|
|
2610
2785
|
/* @__PURE__ */ t("p", { className: "text-xs text-white/40", children: "These environment variables will be available in the sandbox for new sessions." })
|
|
2611
2786
|
] })
|
|
2612
2787
|
] }),
|
|
2613
|
-
|
|
2614
|
-
/* @__PURE__ */
|
|
2788
|
+
ne && /* @__PURE__ */ t("div", { className: "mb-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-xl", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
|
|
2789
|
+
/* @__PURE__ */ a("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
2615
2790
|
/* @__PURE__ */ t(
|
|
2616
2791
|
"svg",
|
|
2617
2792
|
{
|
|
@@ -2631,21 +2806,21 @@ function Pn({
|
|
|
2631
2806
|
)
|
|
2632
2807
|
}
|
|
2633
2808
|
),
|
|
2634
|
-
/* @__PURE__ */
|
|
2809
|
+
/* @__PURE__ */ a("div", { className: "min-w-0", children: [
|
|
2635
2810
|
/* @__PURE__ */ t("p", { className: "text-sm text-blue-200 font-medium", children: "Long text converted to attachment" }),
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
|
|
2811
|
+
/* @__PURE__ */ a("p", { className: "text-xs text-blue-300/70 mt-1", children: [
|
|
2812
|
+
ne.originalLength.toLocaleString(),
|
|
2638
2813
|
" characters (",
|
|
2639
|
-
|
|
2814
|
+
ne.lineCount,
|
|
2640
2815
|
" lines) saved as text attachment"
|
|
2641
2816
|
] }),
|
|
2642
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-white/50 mt-1 truncate font-mono", children:
|
|
2817
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-white/50 mt-1 truncate font-mono", children: ne.preview })
|
|
2643
2818
|
] })
|
|
2644
2819
|
] }),
|
|
2645
2820
|
/* @__PURE__ */ t(
|
|
2646
2821
|
"button",
|
|
2647
2822
|
{
|
|
2648
|
-
onClick: () =>
|
|
2823
|
+
onClick: () => Q(null),
|
|
2649
2824
|
className: "text-blue-400/70 hover:text-blue-300 transition-colors shrink-0",
|
|
2650
2825
|
title: "Dismiss",
|
|
2651
2826
|
children: /* @__PURE__ */ t(
|
|
@@ -2668,20 +2843,20 @@ function Pn({
|
|
|
2668
2843
|
}
|
|
2669
2844
|
)
|
|
2670
2845
|
] }) }),
|
|
2671
|
-
|
|
2672
|
-
/* @__PURE__ */
|
|
2846
|
+
C.length > 0 && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
|
|
2847
|
+
/* @__PURE__ */ a("div", { className: "text-xs font-medium text-white/50 uppercase tracking-wide", children: [
|
|
2673
2848
|
"Attached Files (",
|
|
2674
|
-
|
|
2849
|
+
C.length,
|
|
2675
2850
|
")"
|
|
2676
2851
|
] }),
|
|
2677
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children:
|
|
2678
|
-
const
|
|
2679
|
-
return /* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: C.map((u, b) => {
|
|
2853
|
+
const I = he.get(u.filename), k = !!I;
|
|
2854
|
+
return /* @__PURE__ */ a(
|
|
2680
2855
|
"div",
|
|
2681
2856
|
{
|
|
2682
|
-
className: `flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm ${
|
|
2857
|
+
className: `flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm ${k ? "bg-purple-500/10 border border-purple-500/30" : "bg-white/5 border border-white/10"}`,
|
|
2683
2858
|
children: [
|
|
2684
|
-
|
|
2859
|
+
k ? (
|
|
2685
2860
|
// Pasted text icon (document with lines)
|
|
2686
2861
|
/* @__PURE__ */ t(
|
|
2687
2862
|
"svg",
|
|
@@ -2724,21 +2899,21 @@ function Pn({
|
|
|
2724
2899
|
}
|
|
2725
2900
|
)
|
|
2726
2901
|
),
|
|
2727
|
-
|
|
2902
|
+
k ? /* @__PURE__ */ a("span", { className: "text-purple-200 font-mono", title: u.filename, children: [
|
|
2728
2903
|
"[Pasted text #",
|
|
2729
|
-
|
|
2904
|
+
I.number,
|
|
2730
2905
|
" +",
|
|
2731
|
-
|
|
2906
|
+
I.lineCount,
|
|
2732
2907
|
" lines]"
|
|
2733
|
-
] }) : /* @__PURE__ */
|
|
2908
|
+
] }) : /* @__PURE__ */ a(_, { children: [
|
|
2734
2909
|
/* @__PURE__ */ t("span", { className: "text-white/80 truncate max-w-[150px]", title: u.filename, children: u.filename }),
|
|
2735
|
-
/* @__PURE__ */ t("span", { className: "text-white/40 text-xs", children:
|
|
2910
|
+
/* @__PURE__ */ t("span", { className: "text-white/40 text-xs", children: qe(u.size) })
|
|
2736
2911
|
] }),
|
|
2737
2912
|
/* @__PURE__ */ t(
|
|
2738
2913
|
"button",
|
|
2739
2914
|
{
|
|
2740
|
-
onClick: () =>
|
|
2741
|
-
className: `hover:text-red-400 transition-colors ${
|
|
2915
|
+
onClick: () => Z(b),
|
|
2916
|
+
className: `hover:text-red-400 transition-colors ${k ? "text-purple-400/70" : "text-white/40"}`,
|
|
2742
2917
|
title: "Remove file",
|
|
2743
2918
|
children: /* @__PURE__ */ t(
|
|
2744
2919
|
"svg",
|
|
@@ -2765,19 +2940,19 @@ function Pn({
|
|
|
2765
2940
|
);
|
|
2766
2941
|
}) })
|
|
2767
2942
|
] }),
|
|
2768
|
-
J && /* @__PURE__ */
|
|
2769
|
-
/* @__PURE__ */
|
|
2943
|
+
J && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
|
|
2944
|
+
/* @__PURE__ */ a("div", { className: "text-xs font-medium text-white/50 uppercase tracking-wide", children: [
|
|
2770
2945
|
"Queued Messages (",
|
|
2771
|
-
|
|
2946
|
+
i.length,
|
|
2772
2947
|
")"
|
|
2773
2948
|
] }),
|
|
2774
|
-
/* @__PURE__ */ t("div", { className: "max-h-32 overflow-y-auto space-y-1", children:
|
|
2949
|
+
/* @__PURE__ */ t("div", { className: "max-h-32 overflow-y-auto space-y-1", children: i.map((u, b) => /* @__PURE__ */ a(
|
|
2775
2950
|
"div",
|
|
2776
2951
|
{
|
|
2777
2952
|
className: "flex items-center justify-between bg-yellow-500/10 border border-yellow-500/20 rounded-xl px-3 py-2 text-sm",
|
|
2778
2953
|
children: [
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
2955
|
+
/* @__PURE__ */ a("span", { className: "text-yellow-400 font-medium shrink-0", children: [
|
|
2781
2956
|
"#",
|
|
2782
2957
|
b + 1
|
|
2783
2958
|
] }),
|
|
@@ -2813,30 +2988,75 @@ function Pn({
|
|
|
2813
2988
|
u.id
|
|
2814
2989
|
)) })
|
|
2815
2990
|
] }),
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
|
|
2991
|
+
/* @__PURE__ */ a("div", { className: "flex gap-3 items-end", children: [
|
|
2992
|
+
/* @__PURE__ */ a("div", { className: "flex-1 flex items-end bg-[#2f2f2f] rounded-2xl border border-white/10 overflow-hidden", children: [
|
|
2993
|
+
d && /* @__PURE__ */ a(_, { children: [
|
|
2994
|
+
/* @__PURE__ */ t(
|
|
2995
|
+
"input",
|
|
2996
|
+
{
|
|
2997
|
+
ref: pe,
|
|
2998
|
+
type: "file",
|
|
2999
|
+
multiple: !0,
|
|
3000
|
+
onChange: le,
|
|
3001
|
+
className: "hidden",
|
|
3002
|
+
disabled: n || C.length >= m
|
|
3003
|
+
}
|
|
3004
|
+
),
|
|
3005
|
+
/* @__PURE__ */ t(
|
|
3006
|
+
"button",
|
|
3007
|
+
{
|
|
3008
|
+
type: "button",
|
|
3009
|
+
onClick: () => {
|
|
3010
|
+
var u;
|
|
3011
|
+
return (u = pe.current) == null ? void 0 : u.click();
|
|
3012
|
+
},
|
|
3013
|
+
disabled: n || C.length >= m,
|
|
3014
|
+
className: "shrink-0 p-3 text-white/50 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3015
|
+
title: C.length >= m ? `Maximum ${m} files` : "Attach files",
|
|
3016
|
+
children: /* @__PURE__ */ t(
|
|
3017
|
+
"svg",
|
|
3018
|
+
{
|
|
3019
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3020
|
+
className: "h-5 w-5",
|
|
3021
|
+
fill: "none",
|
|
3022
|
+
viewBox: "0 0 24 24",
|
|
3023
|
+
stroke: "currentColor",
|
|
3024
|
+
children: /* @__PURE__ */ t(
|
|
3025
|
+
"path",
|
|
3026
|
+
{
|
|
3027
|
+
strokeLinecap: "round",
|
|
3028
|
+
strokeLinejoin: "round",
|
|
3029
|
+
strokeWidth: 2,
|
|
3030
|
+
d: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
|
|
3031
|
+
}
|
|
3032
|
+
)
|
|
3033
|
+
}
|
|
3034
|
+
)
|
|
3035
|
+
}
|
|
3036
|
+
)
|
|
3037
|
+
] }),
|
|
2818
3038
|
/* @__PURE__ */ t(
|
|
2819
|
-
"
|
|
3039
|
+
"textarea",
|
|
2820
3040
|
{
|
|
2821
|
-
ref:
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
3041
|
+
ref: de,
|
|
3042
|
+
value: T,
|
|
3043
|
+
onChange: (u) => X(u.target.value),
|
|
3044
|
+
onKeyDown: v,
|
|
3045
|
+
onInput: M,
|
|
3046
|
+
onPaste: K,
|
|
3047
|
+
placeholder: s,
|
|
3048
|
+
disabled: n,
|
|
3049
|
+
className: "flex-1 min-w-0 resize-none py-3 px-2 bg-transparent text-white placeholder-white/40 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3050
|
+
rows: 1
|
|
2827
3051
|
}
|
|
2828
3052
|
),
|
|
2829
3053
|
/* @__PURE__ */ t(
|
|
2830
3054
|
"button",
|
|
2831
3055
|
{
|
|
2832
3056
|
type: "button",
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
},
|
|
2837
|
-
disabled: n || R.length >= g,
|
|
2838
|
-
className: "shrink-0 p-2 sm:px-3 sm:py-2 text-white/50 hover:text-[#ccff00] hover:bg-white/5 rounded-xl transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2839
|
-
title: R.length >= g ? `Maximum ${g} files` : "Attach files",
|
|
3057
|
+
className: "shrink-0 p-3 text-white/50 hover:text-white transition-colors disabled:opacity-50",
|
|
3058
|
+
disabled: n,
|
|
3059
|
+
title: "Voice input (not available)",
|
|
2840
3060
|
children: /* @__PURE__ */ t(
|
|
2841
3061
|
"svg",
|
|
2842
3062
|
{
|
|
@@ -2851,59 +3071,68 @@ function Pn({
|
|
|
2851
3071
|
strokeLinecap: "round",
|
|
2852
3072
|
strokeLinejoin: "round",
|
|
2853
3073
|
strokeWidth: 2,
|
|
2854
|
-
d: "
|
|
3074
|
+
d: "M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8"
|
|
2855
3075
|
}
|
|
2856
3076
|
)
|
|
2857
3077
|
}
|
|
2858
3078
|
)
|
|
2859
3079
|
}
|
|
3080
|
+
),
|
|
3081
|
+
/* @__PURE__ */ t(
|
|
3082
|
+
"button",
|
|
3083
|
+
{
|
|
3084
|
+
type: "button",
|
|
3085
|
+
onClick: g,
|
|
3086
|
+
disabled: !ve,
|
|
3087
|
+
className: "shrink-0 p-3 text-white/50 hover:text-white transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
3088
|
+
title: "Send message",
|
|
3089
|
+
children: /* @__PURE__ */ a(
|
|
3090
|
+
"svg",
|
|
3091
|
+
{
|
|
3092
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3093
|
+
className: "h-5 w-5",
|
|
3094
|
+
fill: "none",
|
|
3095
|
+
viewBox: "0 0 24 24",
|
|
3096
|
+
stroke: "currentColor",
|
|
3097
|
+
children: [
|
|
3098
|
+
/* @__PURE__ */ t("line", { x1: "12", y1: "19", x2: "12", y2: "5", strokeWidth: 2, strokeLinecap: "round" }),
|
|
3099
|
+
/* @__PURE__ */ t("polyline", { points: "5 12 12 5 19 12", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3100
|
+
]
|
|
3101
|
+
}
|
|
3102
|
+
)
|
|
3103
|
+
}
|
|
2860
3104
|
)
|
|
2861
3105
|
] }),
|
|
2862
|
-
/* @__PURE__ */
|
|
2863
|
-
"textarea",
|
|
2864
|
-
{
|
|
2865
|
-
ref: oe,
|
|
2866
|
-
value: k,
|
|
2867
|
-
onChange: (u) => A(u.target.value),
|
|
2868
|
-
onKeyDown: y,
|
|
2869
|
-
onInput: T,
|
|
2870
|
-
onPaste: q,
|
|
2871
|
-
placeholder: s,
|
|
2872
|
-
disabled: n,
|
|
2873
|
-
className: "input-glass flex-1 min-w-0 resize-none py-2.5 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2874
|
-
rows: 1
|
|
2875
|
-
}
|
|
2876
|
-
),
|
|
2877
|
-
r && S && v ? /* @__PURE__ */ i(
|
|
3106
|
+
r && E && w ? /* @__PURE__ */ a(
|
|
2878
3107
|
"button",
|
|
2879
3108
|
{
|
|
2880
|
-
onClick:
|
|
2881
|
-
className: "shrink-0 px-
|
|
3109
|
+
onClick: w,
|
|
3110
|
+
className: "shrink-0 px-4 py-3 bg-red-500/80 hover:bg-red-500 text-white rounded-2xl transition-all duration-300 flex items-center gap-2 border border-red-400/30 font-medium",
|
|
2882
3111
|
title: "Stop generation",
|
|
2883
3112
|
children: [
|
|
2884
3113
|
/* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ t("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z", clipRule: "evenodd" }) }),
|
|
2885
3114
|
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: "Stop" })
|
|
2886
3115
|
]
|
|
2887
3116
|
}
|
|
2888
|
-
) : /* @__PURE__ */
|
|
3117
|
+
) : /* @__PURE__ */ a(
|
|
2889
3118
|
"button",
|
|
2890
3119
|
{
|
|
2891
|
-
onClick:
|
|
2892
|
-
disabled: !
|
|
2893
|
-
className: `shrink-0 px-
|
|
3120
|
+
onClick: g,
|
|
3121
|
+
disabled: !ve,
|
|
3122
|
+
className: `shrink-0 px-4 py-3 rounded-2xl font-medium transition-all duration-300 disabled:opacity-30 disabled:cursor-not-allowed ${J ? "bg-yellow-500/80 hover:bg-yellow-500 text-black border border-yellow-400/30" : "bg-[#10a37f] hover:bg-[#0d8c6d] text-white"}`,
|
|
2894
3123
|
children: [
|
|
2895
|
-
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children:
|
|
2896
|
-
/* @__PURE__ */ t("span", { className: "sm:hidden", children: r ? "..." : J ? `+${
|
|
3124
|
+
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: J ? `Queue (${i.length})` : "Execute" }),
|
|
3125
|
+
/* @__PURE__ */ t("span", { className: "sm:hidden", children: r ? "..." : J ? `+${i.length}` : "→" })
|
|
2897
3126
|
]
|
|
2898
3127
|
}
|
|
2899
3128
|
)
|
|
2900
3129
|
] }),
|
|
2901
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-white/40 mt-2 hidden sm:block", children: [
|
|
2902
3131
|
"Press Enter to ",
|
|
2903
3132
|
r || J ? "queue" : "send",
|
|
2904
3133
|
", Shift+Enter for new line",
|
|
2905
3134
|
d && " • Drag & drop files or click the attach button",
|
|
2906
|
-
|
|
3135
|
+
D && d && ` • Long text (>${R.toLocaleString()} chars) auto-converts to attachment`
|
|
2907
3136
|
] })
|
|
2908
3137
|
]
|
|
2909
3138
|
}
|
|
@@ -2914,230 +3143,230 @@ function $r({
|
|
|
2914
3143
|
initialAgent: n,
|
|
2915
3144
|
initialSessionId: r,
|
|
2916
3145
|
onSessionChange: s,
|
|
2917
|
-
className:
|
|
3146
|
+
className: i = "",
|
|
2918
3147
|
useBackendQueue: l = !1
|
|
2919
3148
|
}) {
|
|
2920
|
-
const [c, h] = N([]), [o,
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
}, [
|
|
2924
|
-
|
|
2925
|
-
}, [
|
|
2926
|
-
fetch(`${e}/agents`).then((
|
|
2927
|
-
const
|
|
2928
|
-
h(
|
|
2929
|
-
}).catch((
|
|
2930
|
-
console.error("Failed to fetch agents:",
|
|
3149
|
+
const [c, h] = N([]), [o, f] = N(n || null), [d, x] = N(r || null), [m, w] = N([]), [E, D] = N(!1), [R, T] = N(""), [X, S] = N(null), [G, A] = N([]), [W, ie] = N([]), [ee, B] = N(""), [H, C] = N({}), O = V(!1), te = V(ee), ce = V(H), ne = V(null);
|
|
3150
|
+
P(() => {
|
|
3151
|
+
te.current = ee;
|
|
3152
|
+
}, [ee]), P(() => {
|
|
3153
|
+
ce.current = H;
|
|
3154
|
+
}, [H]), P(() => {
|
|
3155
|
+
fetch(`${e}/agents`).then((g) => g.json()).then((g) => {
|
|
3156
|
+
const v = g.agents || [];
|
|
3157
|
+
h(v), !o && v.length > 0 && f(v[0].slug || v[0].name);
|
|
3158
|
+
}).catch((g) => {
|
|
3159
|
+
console.error("Failed to fetch agents:", g), S("Failed to load agents");
|
|
2931
3160
|
});
|
|
2932
|
-
}, [e]),
|
|
2933
|
-
d &&
|
|
3161
|
+
}, [e]), P(() => {
|
|
3162
|
+
d && he(d);
|
|
2934
3163
|
}, [d]);
|
|
2935
|
-
const
|
|
3164
|
+
const Q = F(async () => {
|
|
2936
3165
|
if (!(!l || !o))
|
|
2937
3166
|
try {
|
|
2938
|
-
const
|
|
3167
|
+
const g = await fetch(
|
|
2939
3168
|
`${e}/queue/status/${o}?sessionId=${d || ""}`
|
|
2940
3169
|
);
|
|
2941
|
-
if (!
|
|
2942
|
-
const
|
|
2943
|
-
|
|
2944
|
-
} catch (
|
|
2945
|
-
console.error("Failed to fetch queue status:",
|
|
3170
|
+
if (!g.ok) return;
|
|
3171
|
+
const v = await g.json();
|
|
3172
|
+
D(v.isProcessing), ie(v.nextItems || []), !v.isProcessing && E && (d && await he(d), T(""));
|
|
3173
|
+
} catch (g) {
|
|
3174
|
+
console.error("Failed to fetch queue status:", g);
|
|
2946
3175
|
}
|
|
2947
|
-
}, [l, o, d, e,
|
|
2948
|
-
|
|
3176
|
+
}, [l, o, d, e, E]);
|
|
3177
|
+
P(() => {
|
|
2949
3178
|
if (l)
|
|
2950
|
-
return
|
|
2951
|
-
|
|
3179
|
+
return ne.current = setInterval(Q, 1e3), () => {
|
|
3180
|
+
ne.current && (clearInterval(ne.current), ne.current = null);
|
|
2952
3181
|
};
|
|
2953
|
-
}, [l,
|
|
3182
|
+
}, [l, Q]), P(() => {
|
|
2954
3183
|
s == null || s(d);
|
|
2955
3184
|
}, [d, s]);
|
|
2956
|
-
const
|
|
3185
|
+
const he = async (g) => {
|
|
2957
3186
|
try {
|
|
2958
|
-
const
|
|
2959
|
-
if (!
|
|
2960
|
-
const
|
|
2961
|
-
|
|
2962
|
-
} catch (
|
|
2963
|
-
|
|
2964
|
-
}
|
|
2965
|
-
},
|
|
2966
|
-
var
|
|
2967
|
-
if (!o) return
|
|
2968
|
-
|
|
2969
|
-
const
|
|
3187
|
+
const v = await fetch(`${e}/sessions/${g}/messages`);
|
|
3188
|
+
if (!v.ok) throw new Error("Failed to fetch messages");
|
|
3189
|
+
const M = await v.json();
|
|
3190
|
+
w(M.items || M.messages || []);
|
|
3191
|
+
} catch (v) {
|
|
3192
|
+
S(v instanceof Error ? v.message : "Failed to fetch messages");
|
|
3193
|
+
}
|
|
3194
|
+
}, me = F(async (g, v, M) => {
|
|
3195
|
+
var le, ue;
|
|
3196
|
+
if (!o) return v;
|
|
3197
|
+
D(!0), S(null), T("");
|
|
3198
|
+
const z = {
|
|
2970
3199
|
id: `temp-${Date.now()}`,
|
|
2971
3200
|
role: "user",
|
|
2972
|
-
content: [{ type: "text", text:
|
|
3201
|
+
content: [{ type: "text", text: g }],
|
|
2973
3202
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2974
3203
|
};
|
|
2975
|
-
|
|
2976
|
-
let
|
|
3204
|
+
w((Y) => [...Y, z]);
|
|
3205
|
+
let re = v;
|
|
2977
3206
|
try {
|
|
2978
|
-
const
|
|
2979
|
-
filename:
|
|
2980
|
-
content:
|
|
2981
|
-
mimeType:
|
|
2982
|
-
})),
|
|
2983
|
-
J && (
|
|
2984
|
-
const
|
|
2985
|
-
!
|
|
2986
|
-
const
|
|
3207
|
+
const Y = v ? `${e}/sessions/${v}/send` : `${e}/agents/${o}/run`, q = M == null ? void 0 : M.map((fe) => ({
|
|
3208
|
+
filename: fe.filename,
|
|
3209
|
+
content: fe.content,
|
|
3210
|
+
mimeType: fe.mimeType
|
|
3211
|
+
})), Z = { prompt: g }, J = te.current.trim();
|
|
3212
|
+
J && (Z.sessionContext = J);
|
|
3213
|
+
const Ce = ce.current;
|
|
3214
|
+
!v && Object.keys(Ce).length > 0 && (Z.envVars = Ce), q && q.length > 0 && (Z.files = q);
|
|
3215
|
+
const _e = await fetch(Y, {
|
|
2987
3216
|
method: "POST",
|
|
2988
3217
|
headers: { "Content-Type": "application/json" },
|
|
2989
|
-
body: JSON.stringify(
|
|
3218
|
+
body: JSON.stringify(Z)
|
|
2990
3219
|
});
|
|
2991
|
-
if (!
|
|
2992
|
-
const
|
|
2993
|
-
let
|
|
2994
|
-
for (;
|
|
2995
|
-
const { done:
|
|
2996
|
-
if (
|
|
2997
|
-
|
|
2998
|
-
const
|
|
3220
|
+
if (!_e.ok) throw new Error("Failed to send message");
|
|
3221
|
+
const ve = (le = _e.body) == null ? void 0 : le.getReader(), Te = new TextDecoder();
|
|
3222
|
+
let ye = "", U = "";
|
|
3223
|
+
for (; ve; ) {
|
|
3224
|
+
const { done: fe, value: u } = await ve.read();
|
|
3225
|
+
if (fe) break;
|
|
3226
|
+
ye += Te.decode(u, { stream: !0 });
|
|
3227
|
+
const b = ye.split(`
|
|
2999
3228
|
`);
|
|
3000
|
-
|
|
3001
|
-
for (const
|
|
3002
|
-
if (
|
|
3003
|
-
const
|
|
3004
|
-
if (!
|
|
3229
|
+
ye = b.pop() || "";
|
|
3230
|
+
for (const I of b)
|
|
3231
|
+
if (I.startsWith("data:")) {
|
|
3232
|
+
const k = I.slice(5).trim();
|
|
3233
|
+
if (!k) continue;
|
|
3005
3234
|
try {
|
|
3006
|
-
const
|
|
3007
|
-
if (
|
|
3008
|
-
|
|
3009
|
-
else if (
|
|
3010
|
-
U +=
|
|
3011
|
-
else if (
|
|
3012
|
-
U +=
|
|
3013
|
-
else if (
|
|
3014
|
-
const
|
|
3015
|
-
(
|
|
3235
|
+
const y = JSON.parse(k);
|
|
3236
|
+
if (y.type === "session_start" && y.sessionId)
|
|
3237
|
+
re = y.sessionId, x(y.sessionId);
|
|
3238
|
+
else if (y.type === "text_delta" && y.delta)
|
|
3239
|
+
U += y.delta, T(U);
|
|
3240
|
+
else if (y.type === "thinking_delta" && y.delta)
|
|
3241
|
+
U += y.delta, T(U);
|
|
3242
|
+
else if (y.type === "message" && y.message) {
|
|
3243
|
+
const j = (ue = y.message.content) == null ? void 0 : ue.find(
|
|
3244
|
+
(Pe) => Pe.type === "text"
|
|
3016
3245
|
);
|
|
3017
|
-
|
|
3018
|
-
} else if (
|
|
3246
|
+
j != null && j.text && (U || (U = j.text, T(U)));
|
|
3247
|
+
} else if (y.type === "tool_use")
|
|
3019
3248
|
U += `
|
|
3020
3249
|
|
|
3021
|
-
🔧 Using tool: ${
|
|
3022
|
-
`,
|
|
3023
|
-
else if (
|
|
3024
|
-
const
|
|
3025
|
-
|
|
3026
|
-
} else
|
|
3250
|
+
🔧 Using tool: ${y.name}
|
|
3251
|
+
`, T(U);
|
|
3252
|
+
else if (y.type === "session_end") {
|
|
3253
|
+
const j = v || y.sessionId;
|
|
3254
|
+
j && await he(j), T("");
|
|
3255
|
+
} else y.type === "error" && S(y.error || "Unknown error");
|
|
3027
3256
|
} catch {
|
|
3028
3257
|
}
|
|
3029
3258
|
}
|
|
3030
3259
|
}
|
|
3031
|
-
} catch (
|
|
3032
|
-
|
|
3260
|
+
} catch (Y) {
|
|
3261
|
+
S(Y instanceof Error ? Y.message : "Unknown error"), w((q) => q.filter((Z) => Z.id !== z.id));
|
|
3033
3262
|
} finally {
|
|
3034
|
-
|
|
3263
|
+
D(!1);
|
|
3035
3264
|
}
|
|
3036
|
-
return
|
|
3037
|
-
}, [e, o]), ge =
|
|
3038
|
-
if (
|
|
3039
|
-
|
|
3040
|
-
let
|
|
3265
|
+
return re;
|
|
3266
|
+
}, [e, o]), ge = F(async () => {
|
|
3267
|
+
if (O.current) return;
|
|
3268
|
+
O.current = !0;
|
|
3269
|
+
let g = d;
|
|
3041
3270
|
for (; ; ) {
|
|
3042
|
-
let
|
|
3043
|
-
if (
|
|
3044
|
-
|
|
3045
|
-
}
|
|
3046
|
-
|
|
3047
|
-
}, [d,
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
}, [
|
|
3051
|
-
const
|
|
3271
|
+
let v;
|
|
3272
|
+
if (A((M) => M.length === 0 ? M : (v = M[0], M.slice(1))), await new Promise((M) => setTimeout(M, 0)), !v) break;
|
|
3273
|
+
g = await me(v.text, g, v.files);
|
|
3274
|
+
}
|
|
3275
|
+
O.current = !1;
|
|
3276
|
+
}, [d, me]);
|
|
3277
|
+
P(() => {
|
|
3278
|
+
G.length > 0 && !O.current && ge();
|
|
3279
|
+
}, [G, ge]);
|
|
3280
|
+
const de = F(async (g, v) => {
|
|
3052
3281
|
if (!o) return;
|
|
3053
|
-
const
|
|
3282
|
+
const M = {
|
|
3054
3283
|
id: `temp-${Date.now()}`,
|
|
3055
3284
|
role: "user",
|
|
3056
|
-
content: [{ type: "text", text:
|
|
3285
|
+
content: [{ type: "text", text: g }],
|
|
3057
3286
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3058
3287
|
};
|
|
3059
|
-
|
|
3288
|
+
w((z) => [...z, M]);
|
|
3060
3289
|
try {
|
|
3061
|
-
const
|
|
3062
|
-
filename:
|
|
3063
|
-
content:
|
|
3064
|
-
mimeType:
|
|
3065
|
-
})),
|
|
3290
|
+
const z = v == null ? void 0 : v.map((q) => ({
|
|
3291
|
+
filename: q.filename,
|
|
3292
|
+
content: q.content,
|
|
3293
|
+
mimeType: q.mimeType
|
|
3294
|
+
})), re = ce.current, le = !d && Object.keys(re).length > 0 ? re : void 0, ue = await fetch(`${e}/queue`, {
|
|
3066
3295
|
method: "POST",
|
|
3067
3296
|
headers: { "Content-Type": "application/json" },
|
|
3068
3297
|
body: JSON.stringify({
|
|
3069
3298
|
agentName: o,
|
|
3070
3299
|
sessionId: d,
|
|
3071
|
-
prompt:
|
|
3072
|
-
files:
|
|
3073
|
-
sessionContext:
|
|
3074
|
-
envVars:
|
|
3300
|
+
prompt: g,
|
|
3301
|
+
files: z,
|
|
3302
|
+
sessionContext: te.current.trim() || void 0,
|
|
3303
|
+
envVars: le
|
|
3075
3304
|
})
|
|
3076
3305
|
});
|
|
3077
|
-
if (!
|
|
3306
|
+
if (!ue.ok)
|
|
3078
3307
|
throw new Error("Failed to queue message");
|
|
3079
|
-
const
|
|
3080
|
-
!d &&
|
|
3081
|
-
const
|
|
3082
|
-
if (
|
|
3083
|
-
const J = await
|
|
3084
|
-
J.sessionId &&
|
|
3308
|
+
const Y = await ue.json();
|
|
3309
|
+
!d && Y.id && setTimeout(async () => {
|
|
3310
|
+
const Z = await fetch(`${e}/queue/${Y.id}`);
|
|
3311
|
+
if (Z.ok) {
|
|
3312
|
+
const J = await Z.json();
|
|
3313
|
+
J.sessionId && x(J.sessionId);
|
|
3085
3314
|
}
|
|
3086
|
-
}, 500), await
|
|
3087
|
-
} catch (
|
|
3088
|
-
|
|
3315
|
+
}, 500), await Q();
|
|
3316
|
+
} catch (z) {
|
|
3317
|
+
S(z instanceof Error ? z.message : "Failed to queue message"), w((re) => re.filter((le) => le.id !== M.id));
|
|
3089
3318
|
}
|
|
3090
|
-
}, [o, d, e,
|
|
3319
|
+
}, [o, d, e, Q]), ke = F((g, v) => {
|
|
3091
3320
|
if (!o) return;
|
|
3092
3321
|
if (l) {
|
|
3093
|
-
|
|
3322
|
+
de(g, v);
|
|
3094
3323
|
return;
|
|
3095
3324
|
}
|
|
3096
|
-
const
|
|
3325
|
+
const M = {
|
|
3097
3326
|
id: `queue-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
3098
|
-
text:
|
|
3099
|
-
files:
|
|
3327
|
+
text: g,
|
|
3328
|
+
files: v
|
|
3100
3329
|
};
|
|
3101
|
-
|
|
3102
|
-
}, [o,
|
|
3330
|
+
E || O.current ? A((z) => [...z, M]) : A([M]);
|
|
3331
|
+
}, [o, E, l, de]), pe = F(async (g) => {
|
|
3103
3332
|
if (l) {
|
|
3104
3333
|
try {
|
|
3105
|
-
await fetch(`${e}/queue/${
|
|
3334
|
+
await fetch(`${e}/queue/${g}/cancel`, {
|
|
3106
3335
|
method: "POST"
|
|
3107
|
-
}), await
|
|
3108
|
-
} catch (
|
|
3109
|
-
console.error("Failed to cancel queue item:",
|
|
3336
|
+
}), await Q();
|
|
3337
|
+
} catch (v) {
|
|
3338
|
+
console.error("Failed to cancel queue item:", v);
|
|
3110
3339
|
}
|
|
3111
3340
|
return;
|
|
3112
3341
|
}
|
|
3113
|
-
|
|
3114
|
-
}, [l, e,
|
|
3115
|
-
|
|
3116
|
-
}, []),
|
|
3117
|
-
(
|
|
3342
|
+
A((v) => v.filter((M) => M.id !== g));
|
|
3343
|
+
}, [l, e, Q]), we = F(() => {
|
|
3344
|
+
x(null), w([]), T(""), S(null), ie([]), A([]);
|
|
3345
|
+
}, []), K = c.find(
|
|
3346
|
+
(g) => g.slug === o || g.name === o
|
|
3118
3347
|
);
|
|
3119
|
-
return /* @__PURE__ */
|
|
3348
|
+
return /* @__PURE__ */ a("div", { className: `harness-playground flex flex-col h-full bg-[#0a0a0a] relative overflow-hidden ${i}`, children: [
|
|
3120
3349
|
/* @__PURE__ */ t("div", { className: "ambient-glow ambient-glow-accent w-[40vw] h-[40vw] -top-[20%] -right-[10%] animate-pulse-slow" }),
|
|
3121
3350
|
/* @__PURE__ */ t("div", { className: "ambient-glow ambient-glow-green w-[30vw] h-[30vw] bottom-[10%] -left-[10%] animate-pulse-slow" }),
|
|
3122
3351
|
/* @__PURE__ */ t("div", { className: "fixed inset-0 grid-pattern pointer-events-none z-0" }),
|
|
3123
3352
|
/* @__PURE__ */ t("div", { className: "fixed inset-0 noise-overlay pointer-events-none z-0" }),
|
|
3124
|
-
/* @__PURE__ */
|
|
3125
|
-
/* @__PURE__ */
|
|
3353
|
+
/* @__PURE__ */ a("div", { className: "sticky top-0 flex items-center justify-between p-4 border-b border-white/10 glass-panel relative z-10", children: [
|
|
3354
|
+
/* @__PURE__ */ a("div", { children: [
|
|
3126
3355
|
/* @__PURE__ */ t("h1", { className: "text-xl font-semibold text-white", children: "Playground" }),
|
|
3127
|
-
|
|
3356
|
+
K && /* @__PURE__ */ t("p", { className: "text-sm text-white/50 mt-0.5", children: K.description || `Chat with ${K.name}` })
|
|
3128
3357
|
] }),
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
3359
|
+
/* @__PURE__ */ a(
|
|
3131
3360
|
"select",
|
|
3132
3361
|
{
|
|
3133
3362
|
value: o || "",
|
|
3134
|
-
onChange: (
|
|
3135
|
-
|
|
3363
|
+
onChange: (g) => {
|
|
3364
|
+
f(g.target.value), we();
|
|
3136
3365
|
},
|
|
3137
3366
|
className: "px-4 py-2.5 rounded-xl text-sm bg-white/5 border border-white/10 text-white focus:outline-none focus:border-[#ccff00]/50 transition-all duration-300",
|
|
3138
3367
|
children: [
|
|
3139
3368
|
c.length === 0 && /* @__PURE__ */ t("option", { value: "", children: "No agents" }),
|
|
3140
|
-
c.map((
|
|
3369
|
+
c.map((g) => /* @__PURE__ */ t("option", { value: g.slug || g.name, className: "bg-[#0a0a0a]", children: g.name }, g.slug || g.name))
|
|
3141
3370
|
]
|
|
3142
3371
|
}
|
|
3143
3372
|
),
|
|
@@ -3151,47 +3380,47 @@ function $r({
|
|
|
3151
3380
|
)
|
|
3152
3381
|
] })
|
|
3153
3382
|
] }),
|
|
3154
|
-
|
|
3155
|
-
/* @__PURE__ */ t("span", { children:
|
|
3383
|
+
X && /* @__PURE__ */ a("div", { className: "bg-red-500/10 border-b border-red-500/20 px-4 py-3 text-red-400 text-sm flex items-center justify-between relative z-10", children: [
|
|
3384
|
+
/* @__PURE__ */ t("span", { children: X }),
|
|
3156
3385
|
/* @__PURE__ */ t(
|
|
3157
3386
|
"button",
|
|
3158
3387
|
{
|
|
3159
|
-
onClick: () =>
|
|
3388
|
+
onClick: () => S(null),
|
|
3160
3389
|
className: "text-red-400/70 hover:text-red-400 transition-colors",
|
|
3161
3390
|
children: /* @__PURE__ */ t("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
|
|
3162
3391
|
}
|
|
3163
3392
|
)
|
|
3164
3393
|
] }),
|
|
3165
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative z-10", children:
|
|
3394
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative z-10", children: m.length === 0 && !R ? /* @__PURE__ */ t("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center animate-fade-in", children: [
|
|
3166
3395
|
/* @__PURE__ */ t("div", { className: "w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#ccff00]/10 border border-[#ccff00]/20 flex items-center justify-center", children: /* @__PURE__ */ t("svg", { className: "w-8 h-8 text-[#ccff00]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z" }) }) }),
|
|
3167
3396
|
/* @__PURE__ */ t("p", { className: "text-lg text-white/80", children: "Start a conversation" }),
|
|
3168
|
-
/* @__PURE__ */ t("p", { className: "text-sm mt-1 text-white/40", children: o ? `Chat with ${(
|
|
3397
|
+
/* @__PURE__ */ t("p", { className: "text-sm mt-1 text-white/40", children: o ? `Chat with ${(K == null ? void 0 : K.name) || o}` : "Select an agent to begin" })
|
|
3169
3398
|
] }) }) : /* @__PURE__ */ t(
|
|
3170
|
-
|
|
3399
|
+
zn,
|
|
3171
3400
|
{
|
|
3172
|
-
messages:
|
|
3173
|
-
loading:
|
|
3174
|
-
streamingContent:
|
|
3401
|
+
messages: m,
|
|
3402
|
+
loading: E,
|
|
3403
|
+
streamingContent: R
|
|
3175
3404
|
}
|
|
3176
3405
|
) }),
|
|
3177
3406
|
/* @__PURE__ */ t("div", { className: "relative z-10", children: /* @__PURE__ */ t(
|
|
3178
|
-
|
|
3407
|
+
Vn,
|
|
3179
3408
|
{
|
|
3180
|
-
onSend:
|
|
3409
|
+
onSend: ke,
|
|
3181
3410
|
disabled: !o,
|
|
3182
|
-
loading:
|
|
3183
|
-
queue: l ?
|
|
3184
|
-
onCancelQueued:
|
|
3185
|
-
sessionContext:
|
|
3186
|
-
onSessionContextChange:
|
|
3187
|
-
envVars:
|
|
3188
|
-
onEnvVarsChange:
|
|
3189
|
-
placeholder: o ? `Message ${(
|
|
3411
|
+
loading: E,
|
|
3412
|
+
queue: l ? W.map((g) => ({ id: g.id, text: g.prompt })) : G,
|
|
3413
|
+
onCancelQueued: pe,
|
|
3414
|
+
sessionContext: ee,
|
|
3415
|
+
onSessionContextChange: B,
|
|
3416
|
+
envVars: H,
|
|
3417
|
+
onEnvVarsChange: C,
|
|
3418
|
+
placeholder: o ? `Message ${(K == null ? void 0 : K.name) || o}...` : "Select an agent to start chatting"
|
|
3190
3419
|
}
|
|
3191
3420
|
) }),
|
|
3192
|
-
d && /* @__PURE__ */
|
|
3421
|
+
d && /* @__PURE__ */ a("div", { className: "px-4 py-2 border-t border-white/10 text-xs text-white/40 glass-panel relative z-10 flex items-center gap-2", children: [
|
|
3193
3422
|
/* @__PURE__ */ t("span", { className: "w-1.5 h-1.5 rounded-full bg-[#ccff00]" }),
|
|
3194
|
-
/* @__PURE__ */
|
|
3423
|
+
/* @__PURE__ */ a("span", { className: "font-mono", children: [
|
|
3195
3424
|
"Session: ",
|
|
3196
3425
|
d.slice(0, 8),
|
|
3197
3426
|
"..."
|
|
@@ -3199,27 +3428,27 @@ function $r({
|
|
|
3199
3428
|
] })
|
|
3200
3429
|
] });
|
|
3201
3430
|
}
|
|
3202
|
-
function
|
|
3431
|
+
function Rr({
|
|
3203
3432
|
entries: e,
|
|
3204
3433
|
loading: n,
|
|
3205
3434
|
streamingContent: r,
|
|
3206
3435
|
displayConfig: s,
|
|
3207
|
-
onOptionSelect:
|
|
3436
|
+
onOptionSelect: i
|
|
3208
3437
|
}) {
|
|
3209
3438
|
return /* @__PURE__ */ t(
|
|
3210
|
-
|
|
3439
|
+
Ln,
|
|
3211
3440
|
{
|
|
3212
3441
|
entries: e,
|
|
3213
3442
|
loading: n,
|
|
3214
3443
|
streamingContent: r,
|
|
3215
3444
|
displayConfig: s,
|
|
3216
|
-
onOptionSelect:
|
|
3445
|
+
onOptionSelect: i
|
|
3217
3446
|
}
|
|
3218
3447
|
);
|
|
3219
3448
|
}
|
|
3220
|
-
function
|
|
3449
|
+
function Ar({ logs: e, isLoading: n, className: r }) {
|
|
3221
3450
|
return /* @__PURE__ */ t(
|
|
3222
|
-
|
|
3451
|
+
Wn,
|
|
3223
3452
|
{
|
|
3224
3453
|
logs: e,
|
|
3225
3454
|
title: "Sandbox Logs",
|
|
@@ -3247,7 +3476,7 @@ function qn(e) {
|
|
|
3247
3476
|
}
|
|
3248
3477
|
return null;
|
|
3249
3478
|
}
|
|
3250
|
-
function
|
|
3479
|
+
function Jn(e, n) {
|
|
3251
3480
|
const r = n || {};
|
|
3252
3481
|
switch (e) {
|
|
3253
3482
|
case "Bash":
|
|
@@ -3303,7 +3532,7 @@ function Vn(e, n) {
|
|
|
3303
3532
|
query: r.query || ""
|
|
3304
3533
|
};
|
|
3305
3534
|
case "TodoWrite": {
|
|
3306
|
-
const s = r.todos || [],
|
|
3535
|
+
const s = r.todos || [], i = {
|
|
3307
3536
|
total: s.length,
|
|
3308
3537
|
completed: s.filter((l) => l.status === "completed").length,
|
|
3309
3538
|
inProgress: s.filter((l) => l.status === "in_progress").length,
|
|
@@ -3312,7 +3541,7 @@ function Vn(e, n) {
|
|
|
3312
3541
|
return {
|
|
3313
3542
|
action: "todo_write",
|
|
3314
3543
|
todos: s,
|
|
3315
|
-
stats:
|
|
3544
|
+
stats: i
|
|
3316
3545
|
};
|
|
3317
3546
|
}
|
|
3318
3547
|
default: {
|
|
@@ -3330,7 +3559,7 @@ function Vn(e, n) {
|
|
|
3330
3559
|
}
|
|
3331
3560
|
}
|
|
3332
3561
|
}
|
|
3333
|
-
function
|
|
3562
|
+
function Un(e, n, r) {
|
|
3334
3563
|
switch (r.action) {
|
|
3335
3564
|
case "command_run":
|
|
3336
3565
|
const s = r.command;
|
|
@@ -3354,18 +3583,18 @@ function Gn(e, n, r) {
|
|
|
3354
3583
|
case "generic_tool":
|
|
3355
3584
|
return r.toolName;
|
|
3356
3585
|
case "todo_write": {
|
|
3357
|
-
const { stats:
|
|
3358
|
-
return
|
|
3586
|
+
const { stats: i } = r;
|
|
3587
|
+
return i ? `${i.completed}/${i.total} completed` : `${r.todos.length} tasks`;
|
|
3359
3588
|
}
|
|
3360
3589
|
default:
|
|
3361
3590
|
return "Unknown tool";
|
|
3362
3591
|
}
|
|
3363
3592
|
}
|
|
3364
|
-
function
|
|
3593
|
+
function Kn(e) {
|
|
3365
3594
|
return typeof e == "string" ? e : Array.isArray(e) ? e.filter((n) => typeof (n == null ? void 0 : n.text) == "string").map((n) => n.text).join(`
|
|
3366
3595
|
`) : e && typeof e == "object" && "text" in e ? String(e.text) : JSON.stringify(e, null, 2);
|
|
3367
3596
|
}
|
|
3368
|
-
function
|
|
3597
|
+
function Yn(e) {
|
|
3369
3598
|
if (typeof e == "string")
|
|
3370
3599
|
try {
|
|
3371
3600
|
return { type: "json", value: JSON.parse(e) };
|
|
@@ -3389,8 +3618,8 @@ function Un(e) {
|
|
|
3389
3618
|
}
|
|
3390
3619
|
return { type: "json", value: e };
|
|
3391
3620
|
}
|
|
3392
|
-
function
|
|
3393
|
-
const n =
|
|
3621
|
+
function Zn(e) {
|
|
3622
|
+
const n = Kn(e);
|
|
3394
3623
|
if (typeof e == "string")
|
|
3395
3624
|
try {
|
|
3396
3625
|
const r = JSON.parse(e);
|
|
@@ -3408,8 +3637,8 @@ function Kn(e) {
|
|
|
3408
3637
|
// Assume success if no exit code
|
|
3409
3638
|
};
|
|
3410
3639
|
}
|
|
3411
|
-
function
|
|
3412
|
-
const n =
|
|
3640
|
+
function st(e) {
|
|
3641
|
+
const n = Jn(e.name, e.input), r = Un(e.name, e.input, n);
|
|
3413
3642
|
return {
|
|
3414
3643
|
id: e.id,
|
|
3415
3644
|
toolName: e.name,
|
|
@@ -3419,36 +3648,36 @@ function tt(e) {
|
|
|
3419
3648
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3420
3649
|
};
|
|
3421
3650
|
}
|
|
3422
|
-
function
|
|
3423
|
-
const s = { ...e },
|
|
3424
|
-
if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r,
|
|
3425
|
-
const l =
|
|
3426
|
-
|
|
3427
|
-
} else (
|
|
3428
|
-
return s.actionType =
|
|
3651
|
+
function at(e, n, r) {
|
|
3652
|
+
const s = { ...e }, i = { ...e.actionType };
|
|
3653
|
+
if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, i.action === "command_run") {
|
|
3654
|
+
const l = Zn(n);
|
|
3655
|
+
i.result = l, l.exitCode !== void 0 && l.exitCode !== 0 && (s.status = "failed", s.isError = !0);
|
|
3656
|
+
} else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = Yn(n));
|
|
3657
|
+
return s.actionType = i, s;
|
|
3429
3658
|
}
|
|
3430
|
-
function
|
|
3659
|
+
function Qn(e) {
|
|
3431
3660
|
return e.type === "tool_use";
|
|
3432
3661
|
}
|
|
3433
|
-
function
|
|
3662
|
+
function Xn(e) {
|
|
3434
3663
|
return e.type === "tool_result";
|
|
3435
3664
|
}
|
|
3436
3665
|
function Dr(e) {
|
|
3437
3666
|
const n = [], r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
3438
|
-
for (const
|
|
3439
|
-
const l =
|
|
3440
|
-
for (const c of
|
|
3667
|
+
for (const i of e) {
|
|
3668
|
+
const l = i.createdAt instanceof Date ? i.createdAt.toISOString() : i.createdAt;
|
|
3669
|
+
for (const c of i.content)
|
|
3441
3670
|
if (c.type === "text" && "text" in c)
|
|
3442
3671
|
n.push({
|
|
3443
|
-
id: `${
|
|
3672
|
+
id: `${i.id}-text-${n.length}`,
|
|
3444
3673
|
timestamp: l,
|
|
3445
3674
|
entryType: {
|
|
3446
|
-
type:
|
|
3675
|
+
type: i.role === "user" ? "user_message" : "assistant_message"
|
|
3447
3676
|
},
|
|
3448
3677
|
content: c.text
|
|
3449
3678
|
});
|
|
3450
|
-
else if (
|
|
3451
|
-
const h =
|
|
3679
|
+
else if (Qn(c)) {
|
|
3680
|
+
const h = st(c);
|
|
3452
3681
|
r.set(c.id, h);
|
|
3453
3682
|
const o = {
|
|
3454
3683
|
id: c.id,
|
|
@@ -3460,30 +3689,30 @@ function Dr(e) {
|
|
|
3460
3689
|
content: h.summary
|
|
3461
3690
|
};
|
|
3462
3691
|
n.push(o), s.set(c.id, o);
|
|
3463
|
-
} else if (
|
|
3692
|
+
} else if (Xn(c)) {
|
|
3464
3693
|
const h = c.toolUseId, o = r.get(h);
|
|
3465
3694
|
if (o) {
|
|
3466
|
-
const
|
|
3695
|
+
const f = at(
|
|
3467
3696
|
o,
|
|
3468
3697
|
c.content,
|
|
3469
3698
|
c.isError
|
|
3470
3699
|
), d = s.get(h);
|
|
3471
|
-
d && d.entryType.type === "tool_call" && (d.entryType.toolCall =
|
|
3700
|
+
d && d.entryType.type === "tool_call" && (d.entryType.toolCall = f), r.delete(h);
|
|
3472
3701
|
}
|
|
3473
3702
|
}
|
|
3474
3703
|
}
|
|
3475
3704
|
return n;
|
|
3476
3705
|
}
|
|
3477
|
-
const
|
|
3706
|
+
const Ee = class Ee {
|
|
3478
3707
|
constructor() {
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3708
|
+
se(this, "entries", []);
|
|
3709
|
+
se(this, "pendingToolCalls", /* @__PURE__ */ new Map());
|
|
3710
|
+
se(this, "listeners", /* @__PURE__ */ new Set());
|
|
3711
|
+
se(this, "currentTextContent", "");
|
|
3712
|
+
se(this, "currentTextEntryId", null);
|
|
3713
|
+
se(this, "hadToolCallSinceText", !1);
|
|
3485
3714
|
/** Track the last few deltas to detect duplicates (prevents double-processing) */
|
|
3486
|
-
|
|
3715
|
+
se(this, "recentDeltas", []);
|
|
3487
3716
|
}
|
|
3488
3717
|
/**
|
|
3489
3718
|
* Subscribe to entry updates.
|
|
@@ -3570,7 +3799,7 @@ const Se = class Se {
|
|
|
3570
3799
|
console.warn("[ToolCallProcessor] Skipping potential duplicate delta");
|
|
3571
3800
|
return;
|
|
3572
3801
|
}
|
|
3573
|
-
this.recentDeltas.push(s), this.recentDeltas.length >
|
|
3802
|
+
this.recentDeltas.push(s), this.recentDeltas.length > Ee.MAX_RECENT_DELTAS && this.recentDeltas.shift();
|
|
3574
3803
|
}
|
|
3575
3804
|
if (this.hadToolCallSinceText && this.currentTextEntryId && (this.currentTextContent = "", this.currentTextEntryId = null, this.hadToolCallSinceText = !1), this.currentTextContent += n, !this.currentTextEntryId)
|
|
3576
3805
|
this.currentTextEntryId = `text-${Date.now()}-${Math.random().toString(36).slice(2)}`, this.entries.push({
|
|
@@ -3580,13 +3809,13 @@ const Se = class Se {
|
|
|
3580
3809
|
content: this.currentTextContent
|
|
3581
3810
|
});
|
|
3582
3811
|
else {
|
|
3583
|
-
const s = this.entries.findIndex((
|
|
3812
|
+
const s = this.entries.findIndex((i) => i.id === this.currentTextEntryId);
|
|
3584
3813
|
if (s !== -1) {
|
|
3585
|
-
const
|
|
3586
|
-
|
|
3587
|
-
id:
|
|
3588
|
-
timestamp:
|
|
3589
|
-
entryType:
|
|
3814
|
+
const i = this.entries[s];
|
|
3815
|
+
i && (this.entries[s] = {
|
|
3816
|
+
id: i.id,
|
|
3817
|
+
timestamp: i.timestamp,
|
|
3818
|
+
entryType: i.entryType,
|
|
3590
3819
|
content: this.currentTextContent
|
|
3591
3820
|
});
|
|
3592
3821
|
}
|
|
@@ -3604,7 +3833,7 @@ const Se = class Se {
|
|
|
3604
3833
|
*/
|
|
3605
3834
|
handleToolUse(n) {
|
|
3606
3835
|
this.finalizeCurrentText(), this.hadToolCallSinceText = !0;
|
|
3607
|
-
const r =
|
|
3836
|
+
const r = st({
|
|
3608
3837
|
id: n.id,
|
|
3609
3838
|
name: n.name,
|
|
3610
3839
|
input: n.input
|
|
@@ -3616,8 +3845,8 @@ const Se = class Se {
|
|
|
3616
3845
|
toolCall: r
|
|
3617
3846
|
},
|
|
3618
3847
|
content: r.summary
|
|
3619
|
-
},
|
|
3620
|
-
this.entries.push(s), this.pendingToolCalls.set(n.id, { entryIndex:
|
|
3848
|
+
}, i = this.entries.length;
|
|
3849
|
+
this.entries.push(s), this.pendingToolCalls.set(n.id, { entryIndex: i, toolCall: r }), this.emit();
|
|
3621
3850
|
}
|
|
3622
3851
|
/**
|
|
3623
3852
|
* Handle tool_result event - update pending tool call with result
|
|
@@ -3625,19 +3854,19 @@ const Se = class Se {
|
|
|
3625
3854
|
handleToolResult(n) {
|
|
3626
3855
|
const r = this.pendingToolCalls.get(n.toolUseId);
|
|
3627
3856
|
if (r) {
|
|
3628
|
-
const s =
|
|
3857
|
+
const s = at(
|
|
3629
3858
|
r.toolCall,
|
|
3630
3859
|
n.content,
|
|
3631
3860
|
n.isError
|
|
3632
|
-
),
|
|
3633
|
-
|
|
3634
|
-
id:
|
|
3635
|
-
timestamp:
|
|
3861
|
+
), i = this.entries[r.entryIndex];
|
|
3862
|
+
i && i.entryType.type === "tool_call" && (this.entries[r.entryIndex] = {
|
|
3863
|
+
id: i.id,
|
|
3864
|
+
timestamp: i.timestamp,
|
|
3636
3865
|
entryType: {
|
|
3637
3866
|
type: "tool_call",
|
|
3638
3867
|
toolCall: s
|
|
3639
3868
|
},
|
|
3640
|
-
content:
|
|
3869
|
+
content: i.content
|
|
3641
3870
|
}), this.pendingToolCalls.delete(n.toolUseId), this.emit();
|
|
3642
3871
|
}
|
|
3643
3872
|
}
|
|
@@ -3664,76 +3893,76 @@ const Se = class Se {
|
|
|
3664
3893
|
this.listeners.forEach((r) => r(n));
|
|
3665
3894
|
}
|
|
3666
3895
|
};
|
|
3667
|
-
|
|
3668
|
-
let
|
|
3896
|
+
se(Ee, "MAX_RECENT_DELTAS", 10);
|
|
3897
|
+
let De = Ee;
|
|
3669
3898
|
function jr() {
|
|
3670
|
-
return new
|
|
3899
|
+
return new De();
|
|
3671
3900
|
}
|
|
3672
3901
|
export {
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3902
|
+
Xe as ActionIcon,
|
|
3903
|
+
It as AlertCircleIcon,
|
|
3904
|
+
Ze as AlertTriangleIcon,
|
|
3905
|
+
an as AssistantMessage,
|
|
3677
3906
|
gr as BrainIcon,
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3907
|
+
Lt as BugIcon,
|
|
3908
|
+
Vn as ChatInput,
|
|
3909
|
+
$t as CheckCircleIcon,
|
|
3910
|
+
Ye as CheckIcon,
|
|
3911
|
+
We as ChevronDownIcon,
|
|
3912
|
+
dr as ChevronLeftIcon,
|
|
3913
|
+
be as ChevronRightIcon,
|
|
3914
|
+
ur as ChevronUpIcon,
|
|
3915
|
+
oe as CodeBlock,
|
|
3916
|
+
hr as CodeIcon,
|
|
3917
|
+
St as CopyIcon,
|
|
3689
3918
|
Oe as EditIcon,
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3919
|
+
cn as ErrorMessage,
|
|
3920
|
+
Be as FileIcon,
|
|
3921
|
+
Nt as FilePlusIcon,
|
|
3922
|
+
Tt as FolderSearchIcon,
|
|
3923
|
+
kt as GlobeIcon,
|
|
3924
|
+
Et as InfoIcon,
|
|
3925
|
+
Me as JsonDisplay,
|
|
3926
|
+
zn as LegacyMessageList,
|
|
3927
|
+
Mt as LoaderIcon,
|
|
3928
|
+
Re as LoadingIndicator,
|
|
3929
|
+
Wn as LogsPanel,
|
|
3930
|
+
dn as MessageEntry,
|
|
3931
|
+
Ln as MessageList,
|
|
3703
3932
|
xr as MessageSquareIcon,
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3933
|
+
cr as MoonIcon,
|
|
3934
|
+
Rr as NormalizedMessageList,
|
|
3935
|
+
At as PaperclipIcon,
|
|
3707
3936
|
$r as Playground,
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3937
|
+
Ct as PlugIcon,
|
|
3938
|
+
Ar as SandboxLogsPanel,
|
|
3939
|
+
Se as SearchIcon,
|
|
3711
3940
|
pr as SendIcon,
|
|
3712
|
-
|
|
3713
|
-
|
|
3941
|
+
Qe as SparklesIcon,
|
|
3942
|
+
Ot as StatusIndicator,
|
|
3714
3943
|
fr as StopCircleIcon,
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3944
|
+
un as StreamingText,
|
|
3945
|
+
or as SunIcon,
|
|
3946
|
+
Ie as TerminalIcon,
|
|
3718
3947
|
Ir as ThemeProvider,
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3948
|
+
ln as ThinkingMessage,
|
|
3949
|
+
ze as ToolCallCard,
|
|
3950
|
+
on as ToolCallMessage,
|
|
3951
|
+
De as ToolCallProcessor,
|
|
3952
|
+
_t as ToolIcon,
|
|
3953
|
+
sn as UserMessage,
|
|
3954
|
+
Rt as XCircleIcon,
|
|
3726
3955
|
mr as XIcon,
|
|
3727
3956
|
p as cn,
|
|
3728
|
-
|
|
3957
|
+
rr as createToolCall,
|
|
3729
3958
|
jr as createToolCallProcessor,
|
|
3730
|
-
|
|
3959
|
+
xt as extractTextContent,
|
|
3731
3960
|
ir as formatFileSize,
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3961
|
+
je as formatTimestamp,
|
|
3962
|
+
ht as formatToolName,
|
|
3963
|
+
ft as generateToolSummary,
|
|
3964
|
+
ar as getActionIcon,
|
|
3965
|
+
Ke as getActionLabel,
|
|
3737
3966
|
wr as isCommandRunAction,
|
|
3738
3967
|
Er as isErrorEntry,
|
|
3739
3968
|
yr as isFileEditAction,
|
|
@@ -3746,12 +3975,12 @@ export {
|
|
|
3746
3975
|
Mr as isToolCallEntry,
|
|
3747
3976
|
Cr as isWebFetchAction,
|
|
3748
3977
|
_r as isWebSearchAction,
|
|
3749
|
-
|
|
3978
|
+
pt as mapToolToActionType,
|
|
3750
3979
|
Dr as normalizeMessages,
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3980
|
+
gt as normalizeToolResult,
|
|
3981
|
+
wt as parseCommandResult,
|
|
3982
|
+
mt as parseMcpToolName,
|
|
3983
|
+
lr as truncate,
|
|
3984
|
+
sr as updateToolCallWithResult,
|
|
3756
3985
|
Lr as useTheme
|
|
3757
3986
|
};
|