@ash-cloud/ash-ai 0.1.11 → 0.1.13
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 +204 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -20
- package/dist/index.d.ts +167 -20
- package/dist/index.js +204 -106
- package/dist/index.js.map +1 -1
- package/dist/playground.js +1275 -1126
- package/dist/{schema-B7RbjHWi.d.cts → schema-DSLyNeoS.d.cts} +3 -3
- package/dist/{schema-B7RbjHWi.d.ts → schema-DSLyNeoS.d.ts} +3 -3
- package/dist/schema.cjs +3 -1
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +3 -1
- package/dist/schema.js.map +1 -1
- package/package.json +1 -1
package/dist/playground.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var it = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { lazy as
|
|
5
|
-
import { jsxs as
|
|
6
|
-
function
|
|
2
|
+
var lt = (e, n, r) => n in e ? it(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
|
|
3
|
+
var se = (e, n, r) => lt(e, typeof n != "symbol" ? n + "" : n, r);
|
|
4
|
+
import { lazy as ot, createContext as Je, useState as N, useRef as G, useEffect as z, useCallback as P, useMemo as ae, useContext as Ue, Suspense as ct, Fragment as $e } from "react";
|
|
5
|
+
import { jsxs as a, jsx as t, Fragment as S } from "react/jsx-runtime";
|
|
6
|
+
function dt(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 ut(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 ht(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 = ut(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: dt(e),
|
|
126
126
|
arguments: n
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function mt(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 pt(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 ft(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 xt(e) {
|
|
194
|
+
const n = pt(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 = ht(e.name, e.input), r = mt(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 = xt(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 = ft(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",
|
|
@@ -304,61 +304,61 @@ function De(e) {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
function He(e, n) {
|
|
307
|
-
const r = typeof e == "string" ? new Date(e) : e,
|
|
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
|
-
function
|
|
316
|
+
function m(...e) {
|
|
317
317
|
return e.filter(Boolean).join(" ");
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function gt(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 wt(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 vt(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
|
|
346
|
+
const p = d.split(`
|
|
347
347
|
`).map((v) => v.trim()).filter((v) => v.length > 0).join(" ");
|
|
348
|
-
|
|
348
|
+
p && (x = p);
|
|
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] ?? "", p = d[2], v = p ? p.trim() : "";
|
|
360
360
|
r.push({
|
|
361
|
-
id:
|
|
361
|
+
id: x,
|
|
362
362
|
label: v
|
|
363
363
|
});
|
|
364
364
|
}
|
|
@@ -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 ye({ 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 Ee({ 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 yt({ 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 Te({ 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 bt({ 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 Nt({ 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 kt({ 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 Ct({ 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 mr({ 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 _t({ 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
|
-
function
|
|
472
|
-
return /* @__PURE__ */
|
|
471
|
+
function pr({ className: e }) {
|
|
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 Tt({ 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 St({ 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 Ye({ 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 Mt({ 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 Et({ 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,52 +518,52 @@ function Mt({ className: e }) {
|
|
|
518
518
|
/* @__PURE__ */ t("path", { d: "M12 2v4" })
|
|
519
519
|
] });
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
return /* @__PURE__ */
|
|
521
|
+
function It({ 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 Lt({ 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
|
-
function
|
|
535
|
-
return /* @__PURE__ */
|
|
534
|
+
function fr({ className: e }) {
|
|
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 $t({ 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
|
-
function
|
|
544
|
-
return /* @__PURE__ */
|
|
543
|
+
function xr({ className: e }) {
|
|
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
|
] });
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function gr({ 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 Rt({ 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
|
-
function
|
|
560
|
-
return /* @__PURE__ */
|
|
559
|
+
function wr({ className: e }) {
|
|
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 me({ 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" }),
|
|
@@ -573,16 +573,16 @@ function de({ className: e }) {
|
|
|
573
573
|
] });
|
|
574
574
|
}
|
|
575
575
|
function At({ className: e }) {
|
|
576
|
-
return /* @__PURE__ */
|
|
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 Dt({ 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 jt({ 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,8 +591,8 @@ 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 Wt({ 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
|
] });
|
|
@@ -600,12 +600,12 @@ function jt({ className: e }) {
|
|
|
600
600
|
function qe({ 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 Bt({ 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"
|
|
@@ -613,66 +613,66 @@ function Wt({ status: e, size: n = "sm", className: r }) {
|
|
|
613
613
|
return /* @__PURE__ */ t(
|
|
614
614
|
"div",
|
|
615
615
|
{
|
|
616
|
-
className:
|
|
616
|
+
className: m(
|
|
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 Ze({ 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(Ee, { 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(yt, { className: n });
|
|
635
635
|
case "search":
|
|
636
|
-
return /* @__PURE__ */ t(
|
|
636
|
+
return /* @__PURE__ */ t(Te, { className: n });
|
|
637
637
|
case "glob":
|
|
638
|
-
return /* @__PURE__ */ t(
|
|
638
|
+
return /* @__PURE__ */ t(Ct, { className: n });
|
|
639
639
|
case "web_fetch":
|
|
640
|
-
return /* @__PURE__ */ t(
|
|
640
|
+
return /* @__PURE__ */ t(bt, { className: n });
|
|
641
641
|
case "web_search":
|
|
642
|
-
return /* @__PURE__ */ t(
|
|
642
|
+
return /* @__PURE__ */ t(Te, { className: n });
|
|
643
643
|
case "mcp_tool":
|
|
644
|
-
return /* @__PURE__ */ t(
|
|
644
|
+
return /* @__PURE__ */ t(Nt, { className: n });
|
|
645
645
|
case "todo_write":
|
|
646
|
-
return /* @__PURE__ */ t(
|
|
646
|
+
return /* @__PURE__ */ t(jt, { className: n });
|
|
647
647
|
case "agent_tool":
|
|
648
|
-
return /* @__PURE__ */ t(
|
|
648
|
+
return /* @__PURE__ */ t(me, { className: n });
|
|
649
649
|
case "generic_tool":
|
|
650
650
|
default:
|
|
651
|
-
return /* @__PURE__ */ t(
|
|
651
|
+
return /* @__PURE__ */ t(kt, { className: n });
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function ce({
|
|
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
661
|
const [l, c] = N(!1), h = e.split(`
|
|
662
662
|
`), o = h.length > 10 || e.length > 500;
|
|
663
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ a("div", { className: m("relative", i), children: [
|
|
664
664
|
/* @__PURE__ */ t(
|
|
665
665
|
"pre",
|
|
666
666
|
{
|
|
667
|
-
className:
|
|
667
|
+
className: m(
|
|
668
668
|
"ash-tool-code-block text-xs font-mono text-white/90 p-3 rounded-xl overflow-x-auto whitespace-pre-wrap break-words",
|
|
669
669
|
!l && o && "overflow-y-hidden"
|
|
670
670
|
),
|
|
671
671
|
style: !l && o ? { maxHeight: n } : void 0,
|
|
672
672
|
"data-language": r,
|
|
673
|
-
children: s ? /* @__PURE__ */ t("code", { children: h.map((
|
|
673
|
+
children: s ? /* @__PURE__ */ t("code", { children: h.map((f, d) => /* @__PURE__ */ a("span", { className: "block", children: [
|
|
674
674
|
/* @__PURE__ */ t("span", { className: "inline-block w-8 text-white/30 select-none text-right pr-2", children: d + 1 }),
|
|
675
|
-
/* @__PURE__ */ t("span", { className: "text-white/80", children:
|
|
675
|
+
/* @__PURE__ */ t("span", { className: "text-white/80", children: f })
|
|
676
676
|
] }, d)) }) : /* @__PURE__ */ t("code", { className: "text-white/80", children: e })
|
|
677
677
|
}
|
|
678
678
|
),
|
|
@@ -694,78 +694,78 @@ function se({
|
|
|
694
694
|
)
|
|
695
695
|
] });
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Se({ value: e, maxHeight: n, className: r }) {
|
|
698
698
|
const s = JSON.stringify(e, null, 2);
|
|
699
|
-
return /* @__PURE__ */ t(
|
|
699
|
+
return /* @__PURE__ */ t(ce, { maxHeight: n, className: r, children: s });
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Qe({
|
|
702
702
|
toolCall: e,
|
|
703
703
|
defaultExpanded: n = !1,
|
|
704
704
|
className: r,
|
|
705
705
|
depth: s = 0
|
|
706
706
|
}) {
|
|
707
|
-
const [
|
|
708
|
-
if (
|
|
707
|
+
const [i, l] = N(n), [c, h] = N(""), o = G(null), { actionType: f, status: d, summary: x, nestedToolCalls: p, nestedToolCallCount: v, startedAt: E } = e, D = ae(() => {
|
|
708
|
+
if (f.action !== "agent_tool")
|
|
709
709
|
return null;
|
|
710
|
-
const
|
|
710
|
+
const j = f;
|
|
711
711
|
return {
|
|
712
|
-
agentType:
|
|
713
|
-
description:
|
|
714
|
-
prompt:
|
|
712
|
+
agentType: j.agentType,
|
|
713
|
+
description: j.description,
|
|
714
|
+
prompt: j.prompt
|
|
715
715
|
};
|
|
716
|
-
}, [
|
|
717
|
-
if (
|
|
718
|
-
if (
|
|
719
|
-
return h(He(
|
|
720
|
-
h(He(
|
|
716
|
+
}, [f]), R = v ?? (p == null ? void 0 : p.length) ?? 0, _ = d === "pending";
|
|
717
|
+
if (z(() => {
|
|
718
|
+
if (_ && E)
|
|
719
|
+
return h(He(E)), o.current = setInterval(() => {
|
|
720
|
+
h(He(E));
|
|
721
721
|
}, 1e3), () => {
|
|
722
722
|
o.current && (clearInterval(o.current), o.current = null);
|
|
723
723
|
};
|
|
724
|
-
|
|
725
|
-
}, [
|
|
724
|
+
_ || (o.current && (clearInterval(o.current), o.current = null), h(""));
|
|
725
|
+
}, [_, E]), !D)
|
|
726
726
|
return null;
|
|
727
|
-
const { agentType:
|
|
728
|
-
return /* @__PURE__ */
|
|
727
|
+
const { agentType: Q, description: T, prompt: F } = D, A = s > 0 ? "ml-4" : "";
|
|
728
|
+
return /* @__PURE__ */ a(
|
|
729
729
|
"div",
|
|
730
730
|
{
|
|
731
|
-
className:
|
|
731
|
+
className: m(
|
|
732
732
|
"rounded-xl border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
|
|
733
|
-
|
|
734
|
-
|
|
733
|
+
_ ? "border-yellow-500/30" : d === "failed" ? "border-red-500/30" : "border-white/10",
|
|
734
|
+
A,
|
|
735
735
|
r
|
|
736
736
|
),
|
|
737
737
|
children: [
|
|
738
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ a(
|
|
739
739
|
"button",
|
|
740
740
|
{
|
|
741
|
-
onClick: () => l(!
|
|
741
|
+
onClick: () => l(!i),
|
|
742
742
|
className: "w-full px-4 py-3 flex items-center gap-3 hover:bg-white/5 cursor-pointer transition-colors",
|
|
743
743
|
children: [
|
|
744
744
|
/* @__PURE__ */ t(
|
|
745
|
-
|
|
745
|
+
ye,
|
|
746
746
|
{
|
|
747
|
-
className:
|
|
747
|
+
className: m(
|
|
748
748
|
"w-4 h-4 text-white/40 transition-transform duration-200 shrink-0",
|
|
749
|
-
|
|
749
|
+
i && "rotate-90"
|
|
750
750
|
)
|
|
751
751
|
}
|
|
752
752
|
),
|
|
753
753
|
/* @__PURE__ */ t(
|
|
754
754
|
"div",
|
|
755
755
|
{
|
|
756
|
-
className:
|
|
756
|
+
className: m(
|
|
757
757
|
"w-6 h-6 rounded-lg flex items-center justify-center shrink-0",
|
|
758
|
-
|
|
758
|
+
_ ? "bg-yellow-500/20" : d === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
|
|
759
759
|
),
|
|
760
|
-
children:
|
|
760
|
+
children: _ ? /* @__PURE__ */ t(
|
|
761
761
|
qe,
|
|
762
762
|
{
|
|
763
763
|
className: "w-3.5 h-3.5 text-yellow-400 animate-spin"
|
|
764
764
|
}
|
|
765
765
|
) : /* @__PURE__ */ t(
|
|
766
|
-
|
|
766
|
+
me,
|
|
767
767
|
{
|
|
768
|
-
className:
|
|
768
|
+
className: m(
|
|
769
769
|
"w-3.5 h-3.5",
|
|
770
770
|
d === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
|
|
771
771
|
)
|
|
@@ -776,48 +776,48 @@ function Ze({
|
|
|
776
776
|
/* @__PURE__ */ t(
|
|
777
777
|
"span",
|
|
778
778
|
{
|
|
779
|
-
className:
|
|
779
|
+
className: m(
|
|
780
780
|
"px-2 py-0.5 rounded text-xs font-medium shrink-0",
|
|
781
|
-
|
|
781
|
+
_ ? "bg-yellow-500/20 text-yellow-400" : d === "failed" ? "bg-red-500/20 text-red-400" : "bg-white/10 text-white/70"
|
|
782
782
|
),
|
|
783
|
-
children:
|
|
783
|
+
children: Q
|
|
784
784
|
}
|
|
785
785
|
),
|
|
786
|
-
/* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children:
|
|
787
|
-
|
|
788
|
-
|
|
786
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children: T || x }),
|
|
787
|
+
R > 0 && /* @__PURE__ */ a("span", { className: "text-xs text-white/50 shrink-0", children: [
|
|
788
|
+
R,
|
|
789
789
|
" tool call",
|
|
790
|
-
|
|
790
|
+
R !== 1 ? "s" : ""
|
|
791
791
|
] }),
|
|
792
|
-
|
|
793
|
-
/* @__PURE__ */ t(
|
|
792
|
+
_ && c && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-xs text-white/40 shrink-0", children: [
|
|
793
|
+
/* @__PURE__ */ t(Wt, { className: "w-3 h-3" }),
|
|
794
794
|
/* @__PURE__ */ t("span", { children: c })
|
|
795
795
|
] }),
|
|
796
796
|
/* @__PURE__ */ t("span", { className: "text-white/30 shrink-0", children: "..." })
|
|
797
797
|
]
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
800
|
+
i && /* @__PURE__ */ a("div", { className: "border-t border-white/5 bg-black/20", children: [
|
|
801
|
+
F && /* @__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: F.length > 500 ? F.substring(0, 500) + "..." : F }) }),
|
|
802
|
+
p && p.length > 0 && /* @__PURE__ */ t("div", { className: "p-3 space-y-2", children: p.map((j) => /* @__PURE__ */ t("div", { children: j.actionType.action === "agent_tool" ? /* @__PURE__ */ t(
|
|
803
|
+
Qe,
|
|
804
804
|
{
|
|
805
|
-
toolCall:
|
|
805
|
+
toolCall: j,
|
|
806
806
|
defaultExpanded: !1,
|
|
807
807
|
depth: s + 1
|
|
808
808
|
}
|
|
809
809
|
) : /* @__PURE__ */ t(
|
|
810
|
-
|
|
810
|
+
ze,
|
|
811
811
|
{
|
|
812
|
-
toolCall:
|
|
812
|
+
toolCall: j,
|
|
813
813
|
defaultExpanded: !1
|
|
814
814
|
}
|
|
815
|
-
) },
|
|
816
|
-
(!
|
|
815
|
+
) }, j.id)) }),
|
|
816
|
+
(!p || p.length === 0) && _ && /* @__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: [
|
|
817
817
|
/* @__PURE__ */ t(qe, { className: "w-4 h-4 animate-spin" }),
|
|
818
818
|
/* @__PURE__ */ t("span", { children: "Agent is working..." })
|
|
819
819
|
] }) }),
|
|
820
|
-
(!
|
|
820
|
+
(!p || p.length === 0) && !_ && /* @__PURE__ */ t("div", { className: "px-4 py-4 text-sm text-white/40 text-center", children: "No tool calls recorded" })
|
|
821
821
|
] })
|
|
822
822
|
]
|
|
823
823
|
}
|
|
@@ -827,20 +827,20 @@ function L({ children: e }) {
|
|
|
827
827
|
return /* @__PURE__ */ t("div", { className: "ash-tool-section-header", children: e });
|
|
828
828
|
}
|
|
829
829
|
function $({ children: e }) {
|
|
830
|
-
return /* @__PURE__ */ t("div", { className: "px-3 py-
|
|
830
|
+
return /* @__PURE__ */ t("div", { className: "px-3 py-1.5", children: e });
|
|
831
831
|
}
|
|
832
832
|
function Ot({ action: e }) {
|
|
833
833
|
var n;
|
|
834
|
-
return /* @__PURE__ */
|
|
835
|
-
e.command && /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
835
|
+
e.command && /* @__PURE__ */ a(S, { children: [
|
|
836
836
|
/* @__PURE__ */ t(L, { children: "COMMAND" }),
|
|
837
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
837
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { children: e.command }) })
|
|
838
838
|
] }),
|
|
839
|
-
((n = e.result) == null ? void 0 : n.output) && /* @__PURE__ */
|
|
839
|
+
((n = e.result) == null ? void 0 : n.output) && /* @__PURE__ */ a(S, { children: [
|
|
840
840
|
/* @__PURE__ */ t(L, { children: "OUTPUT" }),
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */ t(
|
|
843
|
-
e.result.exitCode !== void 0 && e.result.exitCode !== 0 && /* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ a($, { children: [
|
|
842
|
+
/* @__PURE__ */ t(ce, { maxHeight: 300, children: e.result.output }),
|
|
843
|
+
e.result.exitCode !== void 0 && e.result.exitCode !== 0 && /* @__PURE__ */ a("div", { className: "mt-2 text-xs text-red-400", children: [
|
|
844
844
|
"Exit code: ",
|
|
845
845
|
e.result.exitCode
|
|
846
846
|
] })
|
|
@@ -848,18 +848,18 @@ function Ot({ action: e }) {
|
|
|
848
848
|
] })
|
|
849
849
|
] });
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
return /* @__PURE__ */
|
|
851
|
+
function zt({ action: e }) {
|
|
852
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
853
853
|
/* @__PURE__ */ t(L, { children: "PATH" }),
|
|
854
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ a($, { children: [
|
|
855
855
|
/* @__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__ */
|
|
856
|
+
(e.offset !== void 0 || e.limit !== void 0) && /* @__PURE__ */ a("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
857
|
+
e.offset !== void 0 && /* @__PURE__ */ a("span", { children: [
|
|
858
858
|
"Offset: ",
|
|
859
859
|
e.offset
|
|
860
860
|
] }),
|
|
861
861
|
e.offset !== void 0 && e.limit !== void 0 && /* @__PURE__ */ t("span", { children: " · " }),
|
|
862
|
-
e.limit !== void 0 && /* @__PURE__ */
|
|
862
|
+
e.limit !== void 0 && /* @__PURE__ */ a("span", { children: [
|
|
863
863
|
"Limit: ",
|
|
864
864
|
e.limit
|
|
865
865
|
] })
|
|
@@ -867,45 +867,45 @@ function Bt({ action: e }) {
|
|
|
867
867
|
] })
|
|
868
868
|
] });
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
return /* @__PURE__ */
|
|
870
|
+
function Ft({ action: e }) {
|
|
871
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
872
872
|
/* @__PURE__ */ t(L, { children: "PATH" }),
|
|
873
873
|
/* @__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__ */
|
|
874
|
+
e.oldString && /* @__PURE__ */ a(S, { children: [
|
|
875
875
|
/* @__PURE__ */ t(L, { children: "OLD" }),
|
|
876
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
876
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { children: e.oldString }) })
|
|
877
877
|
] }),
|
|
878
|
-
e.newString && /* @__PURE__ */
|
|
878
|
+
e.newString && /* @__PURE__ */ a(S, { children: [
|
|
879
879
|
/* @__PURE__ */ t(L, { children: "NEW" }),
|
|
880
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
880
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { children: e.newString }) })
|
|
881
881
|
] })
|
|
882
882
|
] });
|
|
883
883
|
}
|
|
884
|
-
function
|
|
885
|
-
return /* @__PURE__ */
|
|
884
|
+
function Pt({ action: e }) {
|
|
885
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
886
886
|
/* @__PURE__ */ t(L, { children: "PATH" }),
|
|
887
887
|
/* @__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__ */
|
|
888
|
+
e.content && /* @__PURE__ */ a(S, { children: [
|
|
889
889
|
/* @__PURE__ */ t(L, { children: "CONTENT" }),
|
|
890
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
890
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { maxHeight: 300, children: e.content }) })
|
|
891
891
|
] })
|
|
892
892
|
] });
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
return /* @__PURE__ */
|
|
894
|
+
function Gt({ action: e }) {
|
|
895
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
896
896
|
/* @__PURE__ */ t(L, { children: "PATTERN" }),
|
|
897
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ a($, { children: [
|
|
898
898
|
/* @__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__ */
|
|
899
|
+
(e.path || e.glob || e.type) && /* @__PURE__ */ a("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
900
|
+
e.path && /* @__PURE__ */ a("span", { children: [
|
|
901
901
|
"Path: ",
|
|
902
902
|
e.path
|
|
903
903
|
] }),
|
|
904
|
-
e.glob && /* @__PURE__ */
|
|
904
|
+
e.glob && /* @__PURE__ */ a("span", { children: [
|
|
905
905
|
"Glob: ",
|
|
906
906
|
e.glob
|
|
907
907
|
] }),
|
|
908
|
-
e.type && /* @__PURE__ */
|
|
908
|
+
e.type && /* @__PURE__ */ a("span", { children: [
|
|
909
909
|
"Type: ",
|
|
910
910
|
e.type
|
|
911
911
|
] })
|
|
@@ -914,11 +914,11 @@ function Pt({ action: e }) {
|
|
|
914
914
|
] });
|
|
915
915
|
}
|
|
916
916
|
function Ht({ action: e }) {
|
|
917
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
918
918
|
/* @__PURE__ */ t(L, { children: "PATTERN" }),
|
|
919
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ a($, { children: [
|
|
920
920
|
/* @__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__ */
|
|
921
|
+
e.path && /* @__PURE__ */ a("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
922
922
|
"Path: ",
|
|
923
923
|
e.path
|
|
924
924
|
] })
|
|
@@ -926,9 +926,9 @@ function Ht({ action: e }) {
|
|
|
926
926
|
] });
|
|
927
927
|
}
|
|
928
928
|
function qt({ action: e }) {
|
|
929
|
-
return /* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
930
930
|
/* @__PURE__ */ t(L, { children: "URL" }),
|
|
931
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ a($, { children: [
|
|
932
932
|
/* @__PURE__ */ t(
|
|
933
933
|
"a",
|
|
934
934
|
{
|
|
@@ -944,48 +944,48 @@ function qt({ action: e }) {
|
|
|
944
944
|
] });
|
|
945
945
|
}
|
|
946
946
|
function Vt({ action: e }) {
|
|
947
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
948
948
|
/* @__PURE__ */ t(L, { children: "QUERY" }),
|
|
949
949
|
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("span", { className: "text-sm text-white/90", children: e.query }) })
|
|
950
950
|
] });
|
|
951
951
|
}
|
|
952
|
-
function
|
|
953
|
-
return /* @__PURE__ */
|
|
952
|
+
function Jt({ action: e, isError: n }) {
|
|
953
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
954
954
|
/* @__PURE__ */ t(L, { children: "TOOL" }),
|
|
955
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */
|
|
955
|
+
/* @__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
956
|
e.serverName,
|
|
957
957
|
":",
|
|
958
958
|
e.toolName
|
|
959
959
|
] }) }),
|
|
960
|
-
e.arguments && /* @__PURE__ */
|
|
960
|
+
e.arguments && /* @__PURE__ */ a(S, { children: [
|
|
961
961
|
/* @__PURE__ */ t(L, { children: "ARGS" }),
|
|
962
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
962
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Se, { value: e.arguments }) })
|
|
963
963
|
] }),
|
|
964
|
-
e.result && /* @__PURE__ */
|
|
964
|
+
e.result && /* @__PURE__ */ a(S, { children: [
|
|
965
965
|
/* @__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(
|
|
966
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(ce, { children: String(e.result.value) }) : /* @__PURE__ */ t(Se, { value: e.result.value }) }) })
|
|
967
967
|
] })
|
|
968
968
|
] });
|
|
969
969
|
}
|
|
970
|
-
function
|
|
971
|
-
return /* @__PURE__ */
|
|
972
|
-
e.arguments && /* @__PURE__ */
|
|
970
|
+
function Ut({ action: e, isError: n }) {
|
|
971
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
972
|
+
e.arguments && /* @__PURE__ */ a(S, { children: [
|
|
973
973
|
/* @__PURE__ */ t(L, { children: "ARGS" }),
|
|
974
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(
|
|
974
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Se, { value: e.arguments }) })
|
|
975
975
|
] }),
|
|
976
|
-
e.result && /* @__PURE__ */
|
|
976
|
+
e.result && /* @__PURE__ */ a(S, { children: [
|
|
977
977
|
/* @__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(
|
|
978
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(ce, { children: String(e.result.value) }) : /* @__PURE__ */ t(Se, { value: e.result.value }) }) })
|
|
979
979
|
] })
|
|
980
980
|
] });
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function Kt({ action: e }) {
|
|
983
983
|
const { todos: n, stats: r } = e;
|
|
984
|
-
return /* @__PURE__ */
|
|
985
|
-
r && /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ a(S, { children: [
|
|
985
|
+
r && /* @__PURE__ */ a(S, { children: [
|
|
986
986
|
/* @__PURE__ */ t(L, { children: "PROGRESS" }),
|
|
987
|
-
/* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ a($, { children: [
|
|
988
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
989
989
|
/* @__PURE__ */ t("div", { className: "flex-1 h-2 bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ t(
|
|
990
990
|
"div",
|
|
991
991
|
{
|
|
@@ -993,18 +993,18 @@ function Ut({ action: e }) {
|
|
|
993
993
|
style: { width: `${r.total > 0 ? r.completed / r.total * 100 : 0}%` }
|
|
994
994
|
}
|
|
995
995
|
) }),
|
|
996
|
-
/* @__PURE__ */
|
|
996
|
+
/* @__PURE__ */ a("span", { className: "text-xs text-white/60 tabular-nums", children: [
|
|
997
997
|
r.completed,
|
|
998
998
|
"/",
|
|
999
999
|
r.total
|
|
1000
1000
|
] })
|
|
1001
1001
|
] }),
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
r.inProgress > 0 && /* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ a("div", { className: "flex gap-3 mt-2 text-xs", children: [
|
|
1003
|
+
r.inProgress > 0 && /* @__PURE__ */ a("span", { className: "text-yellow-400", children: [
|
|
1004
1004
|
r.inProgress,
|
|
1005
1005
|
" in progress"
|
|
1006
1006
|
] }),
|
|
1007
|
-
r.pending > 0 && /* @__PURE__ */
|
|
1007
|
+
r.pending > 0 && /* @__PURE__ */ a("span", { className: "text-white/40", children: [
|
|
1008
1008
|
r.pending,
|
|
1009
1009
|
" pending"
|
|
1010
1010
|
] })
|
|
@@ -1012,28 +1012,28 @@ function Ut({ action: e }) {
|
|
|
1012
1012
|
] })
|
|
1013
1013
|
] }),
|
|
1014
1014
|
/* @__PURE__ */ t(L, { children: "TASKS" }),
|
|
1015
|
-
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: "space-y-1.5", children: n.map((s,
|
|
1015
|
+
/* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: "space-y-1.5", children: n.map((s, i) => {
|
|
1016
1016
|
const l = s.status === "in_progress" ? s.activeForm : s.content;
|
|
1017
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ a(
|
|
1018
1018
|
"div",
|
|
1019
1019
|
{
|
|
1020
|
-
className:
|
|
1020
|
+
className: m(
|
|
1021
1021
|
"flex items-start gap-2 py-1 transition-all duration-200",
|
|
1022
1022
|
s.status === "completed" && "opacity-50",
|
|
1023
1023
|
s.status === "in_progress" && "bg-yellow-500/10 -mx-2 px-2 rounded"
|
|
1024
1024
|
),
|
|
1025
1025
|
children: [
|
|
1026
|
-
s.status === "completed" ? /* @__PURE__ */ t(
|
|
1027
|
-
/* @__PURE__ */
|
|
1026
|
+
s.status === "completed" ? /* @__PURE__ */ t(It, { className: "w-4 h-4 text-emerald-400 shrink-0 mt-0.5" }) : s.status === "in_progress" ? /* @__PURE__ */ t(Tt, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ t(Dt, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
|
|
1027
|
+
/* @__PURE__ */ a(
|
|
1028
1028
|
"span",
|
|
1029
1029
|
{
|
|
1030
|
-
className:
|
|
1030
|
+
className: m(
|
|
1031
1031
|
"text-sm leading-relaxed",
|
|
1032
1032
|
s.status === "completed" ? "text-white/50 line-through" : "text-white/80"
|
|
1033
1033
|
),
|
|
1034
1034
|
children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
|
|
1035
|
+
/* @__PURE__ */ a("span", { className: "text-white/40 mr-1.5", children: [
|
|
1036
|
+
i + 1,
|
|
1037
1037
|
"."
|
|
1038
1038
|
] }),
|
|
1039
1039
|
l
|
|
@@ -1042,23 +1042,23 @@ function Ut({ action: e }) {
|
|
|
1042
1042
|
)
|
|
1043
1043
|
]
|
|
1044
1044
|
},
|
|
1045
|
-
`${s.content}-${
|
|
1045
|
+
`${s.content}-${i}`
|
|
1046
1046
|
);
|
|
1047
1047
|
}) }) })
|
|
1048
1048
|
] });
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function Yt({ actionType: e, isError: n }) {
|
|
1051
1051
|
switch (e.action) {
|
|
1052
1052
|
case "command_run":
|
|
1053
1053
|
return /* @__PURE__ */ t(Ot, { action: e });
|
|
1054
1054
|
case "file_read":
|
|
1055
|
-
return /* @__PURE__ */ t(Bt, { action: e });
|
|
1056
|
-
case "file_edit":
|
|
1057
1055
|
return /* @__PURE__ */ t(zt, { action: e });
|
|
1058
|
-
case "
|
|
1056
|
+
case "file_edit":
|
|
1059
1057
|
return /* @__PURE__ */ t(Ft, { action: e });
|
|
1060
|
-
case "
|
|
1058
|
+
case "file_write":
|
|
1061
1059
|
return /* @__PURE__ */ t(Pt, { action: e });
|
|
1060
|
+
case "search":
|
|
1061
|
+
return /* @__PURE__ */ t(Gt, { action: e });
|
|
1062
1062
|
case "glob":
|
|
1063
1063
|
return /* @__PURE__ */ t(Ht, { action: e });
|
|
1064
1064
|
case "web_fetch":
|
|
@@ -1066,16 +1066,16 @@ function Kt({ actionType: e, isError: n }) {
|
|
|
1066
1066
|
case "web_search":
|
|
1067
1067
|
return /* @__PURE__ */ t(Vt, { action: e });
|
|
1068
1068
|
case "mcp_tool":
|
|
1069
|
-
return /* @__PURE__ */ t(Gt, { action: e, isError: n });
|
|
1070
|
-
case "generic_tool":
|
|
1071
1069
|
return /* @__PURE__ */ t(Jt, { action: e, isError: n });
|
|
1070
|
+
case "generic_tool":
|
|
1071
|
+
return /* @__PURE__ */ t(Ut, { action: e, isError: n });
|
|
1072
1072
|
case "todo_write":
|
|
1073
|
-
return /* @__PURE__ */ t(
|
|
1073
|
+
return /* @__PURE__ */ t(Kt, { action: e });
|
|
1074
1074
|
default:
|
|
1075
1075
|
return null;
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function Zt(e) {
|
|
1079
1079
|
var n;
|
|
1080
1080
|
switch (e.action) {
|
|
1081
1081
|
case "command_run":
|
|
@@ -1107,23 +1107,23 @@ function Yt(e) {
|
|
|
1107
1107
|
return !1;
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1111
|
-
const [s,
|
|
1110
|
+
function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
|
|
1111
|
+
const [s, i] = N(n), { actionType: l, status: c, summary: h } = e;
|
|
1112
1112
|
if (l.action === "agent_tool")
|
|
1113
1113
|
return /* @__PURE__ */ t(
|
|
1114
|
-
|
|
1114
|
+
Qe,
|
|
1115
1115
|
{
|
|
1116
1116
|
toolCall: e,
|
|
1117
1117
|
defaultExpanded: n,
|
|
1118
1118
|
className: r
|
|
1119
1119
|
}
|
|
1120
1120
|
);
|
|
1121
|
-
const o =
|
|
1122
|
-
return /* @__PURE__ */
|
|
1121
|
+
const o = Zt(l);
|
|
1122
|
+
return /* @__PURE__ */ a(
|
|
1123
1123
|
"div",
|
|
1124
1124
|
{
|
|
1125
|
-
className:
|
|
1126
|
-
"rounded-
|
|
1125
|
+
className: m(
|
|
1126
|
+
"rounded-lg border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
|
|
1127
1127
|
{
|
|
1128
1128
|
pending: "border-yellow-500/30 ash-tool-status-pending",
|
|
1129
1129
|
success: "border-white/10",
|
|
@@ -1132,40 +1132,40 @@ function Be({ toolCall: e, defaultExpanded: n = !1, className: r }) {
|
|
|
1132
1132
|
r
|
|
1133
1133
|
),
|
|
1134
1134
|
children: [
|
|
1135
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ a(
|
|
1136
1136
|
"button",
|
|
1137
1137
|
{
|
|
1138
|
-
onClick: () => o &&
|
|
1139
|
-
className:
|
|
1140
|
-
"w-full px-
|
|
1138
|
+
onClick: () => o && i(!s),
|
|
1139
|
+
className: m(
|
|
1140
|
+
"w-full px-3 py-2 flex items-center justify-between transition-colors",
|
|
1141
1141
|
o ? "hover:bg-white/5 cursor-pointer" : "cursor-default"
|
|
1142
1142
|
),
|
|
1143
1143
|
disabled: !o,
|
|
1144
1144
|
children: [
|
|
1145
|
-
/* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */ t("div", { className:
|
|
1147
|
-
"w-
|
|
1145
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
1146
|
+
/* @__PURE__ */ t("div", { className: m(
|
|
1147
|
+
"w-5 h-5 rounded flex items-center justify-center shrink-0",
|
|
1148
1148
|
c === "pending" ? "bg-yellow-500/20" : c === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
|
|
1149
1149
|
), children: /* @__PURE__ */ t(
|
|
1150
|
-
|
|
1150
|
+
Ze,
|
|
1151
1151
|
{
|
|
1152
1152
|
actionType: l,
|
|
1153
|
-
className:
|
|
1154
|
-
"w-3
|
|
1153
|
+
className: m(
|
|
1154
|
+
"w-3 h-3",
|
|
1155
1155
|
c === "pending" ? "text-yellow-400" : c === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
|
|
1156
1156
|
)
|
|
1157
1157
|
}
|
|
1158
1158
|
) }),
|
|
1159
|
-
/* @__PURE__ */ t("span", { className: "text-
|
|
1160
|
-
/* @__PURE__ */ t("span", { className: "font-mono text-
|
|
1159
|
+
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-white shrink-0", children: Ke(l) }),
|
|
1160
|
+
/* @__PURE__ */ t("span", { className: "font-mono text-[12px] truncate text-white/50 min-w-0", children: h })
|
|
1161
1161
|
] }),
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */ t(
|
|
1162
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1163
|
+
/* @__PURE__ */ t(Bt, { status: c, size: "sm" }),
|
|
1164
1164
|
o && /* @__PURE__ */ t(
|
|
1165
|
-
|
|
1165
|
+
We,
|
|
1166
1166
|
{
|
|
1167
|
-
className:
|
|
1168
|
-
"w-
|
|
1167
|
+
className: m(
|
|
1168
|
+
"w-3.5 h-3.5 text-white/30 transition-transform duration-200",
|
|
1169
1169
|
s && "rotate-180"
|
|
1170
1170
|
)
|
|
1171
1171
|
}
|
|
@@ -1174,31 +1174,36 @@ function Be({ toolCall: e, defaultExpanded: n = !1, className: r }) {
|
|
|
1174
1174
|
]
|
|
1175
1175
|
}
|
|
1176
1176
|
),
|
|
1177
|
-
s && o && /* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */ t(
|
|
1179
|
-
c === "success" && /* @__PURE__ */ t("div", { className: "px-
|
|
1180
|
-
/* @__PURE__ */ t(
|
|
1181
|
-
/* @__PURE__ */ t("span", { className: "text-
|
|
1177
|
+
s && o && /* @__PURE__ */ a("div", { className: "border-t border-white/5 max-h-[350px] overflow-y-auto ash-scrollbar bg-black/20", children: [
|
|
1178
|
+
/* @__PURE__ */ t(Yt, { actionType: l, isError: e.isError || c === "failed" }),
|
|
1179
|
+
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: [
|
|
1180
|
+
/* @__PURE__ */ t(_t, { className: "w-3.5 h-3.5 text-[var(--ash-accent)]" }),
|
|
1181
|
+
/* @__PURE__ */ t("span", { className: "text-[12px] text-[var(--ash-accent)] font-medium", children: "Completed" })
|
|
1182
1182
|
] }) }),
|
|
1183
|
-
c === "failed" && /* @__PURE__ */ t("div", { className: "px-
|
|
1184
|
-
/* @__PURE__ */ t(
|
|
1185
|
-
/* @__PURE__ */ t("span", { className: "text-
|
|
1183
|
+
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: [
|
|
1184
|
+
/* @__PURE__ */ t(Lt, { className: "w-3.5 h-3.5 text-red-400" }),
|
|
1185
|
+
/* @__PURE__ */ t("span", { className: "text-[12px] text-red-400 font-medium", children: "Failed" })
|
|
1186
1186
|
] }) })
|
|
1187
1187
|
] })
|
|
1188
1188
|
]
|
|
1189
1189
|
}
|
|
1190
1190
|
);
|
|
1191
1191
|
}
|
|
1192
|
-
var
|
|
1193
|
-
function
|
|
1194
|
-
const [
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}, [])
|
|
1192
|
+
var Qt = ot(() => import("./index-DJwpy-R5.js"));
|
|
1193
|
+
function Fe({ children: e, fallback: n, components: r, className: s }) {
|
|
1194
|
+
const [i, l] = N(!1);
|
|
1195
|
+
z(() => {
|
|
1196
|
+
l(!0);
|
|
1197
|
+
}, []);
|
|
1198
|
+
const c = ae(() => {
|
|
1199
|
+
if (r)
|
|
1200
|
+
return r;
|
|
1201
|
+
}, [r]);
|
|
1202
|
+
return i ? /* @__PURE__ */ t(ct, { fallback: /* @__PURE__ */ t("span", { className: s, children: n ?? e }), children: /* @__PURE__ */ t(Qt, { components: c, children: e }) }) : /* @__PURE__ */ t("span", { className: s, children: n ?? e });
|
|
1198
1203
|
}
|
|
1199
|
-
function
|
|
1204
|
+
function Xt({ segment: e }) {
|
|
1200
1205
|
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__ */
|
|
1206
|
+
return /* @__PURE__ */ a(
|
|
1202
1207
|
"span",
|
|
1203
1208
|
{
|
|
1204
1209
|
className: "inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium mx-0.5",
|
|
@@ -1215,20 +1220,20 @@ function Qt({ segment: e }) {
|
|
|
1215
1220
|
}
|
|
1216
1221
|
);
|
|
1217
1222
|
}
|
|
1218
|
-
function
|
|
1223
|
+
function en({
|
|
1219
1224
|
content: e,
|
|
1220
1225
|
renderers: n,
|
|
1221
1226
|
className: r
|
|
1222
1227
|
}) {
|
|
1223
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1224
|
-
const l = `segment-${
|
|
1228
|
+
return /* @__PURE__ */ t("div", { className: m("rich-content", r), children: e.map((s, i) => {
|
|
1229
|
+
const l = `segment-${i}`;
|
|
1225
1230
|
switch (s.type) {
|
|
1226
1231
|
case "text":
|
|
1227
|
-
return /* @__PURE__ */ t(
|
|
1232
|
+
return /* @__PURE__ */ t($e, { children: /* @__PURE__ */ t(Fe, { children: s.content }) }, l);
|
|
1228
1233
|
case "mention":
|
|
1229
|
-
return n != null && n.renderMention ? /* @__PURE__ */ t(
|
|
1234
|
+
return n != null && n.renderMention ? /* @__PURE__ */ t($e, { children: n.renderMention({ segment: s }) }, l) : /* @__PURE__ */ t(Xt, { segment: s }, l);
|
|
1230
1235
|
case "component":
|
|
1231
|
-
return n != null && n.renderComponent ? /* @__PURE__ */ t(
|
|
1236
|
+
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
1237
|
"[component: ",
|
|
1233
1238
|
s.componentType,
|
|
1234
1239
|
"]"
|
|
@@ -1238,14 +1243,14 @@ function Xt({
|
|
|
1238
1243
|
}
|
|
1239
1244
|
}) });
|
|
1240
1245
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1246
|
+
function tn({ options: e, onSelect: n, className: r }) {
|
|
1247
|
+
return /* @__PURE__ */ t("div", { className: m("grid gap-2 mt-3", r), style: {
|
|
1243
1248
|
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))"
|
|
1244
|
-
}, children: e.map((s) => /* @__PURE__ */
|
|
1249
|
+
}, children: e.map((s) => /* @__PURE__ */ a(
|
|
1245
1250
|
"button",
|
|
1246
1251
|
{
|
|
1247
1252
|
onClick: () => n(s),
|
|
1248
|
-
className:
|
|
1253
|
+
className: m(
|
|
1249
1254
|
"flex items-start gap-3 p-3 rounded-xl text-left",
|
|
1250
1255
|
"bg-white/5 border border-white/10",
|
|
1251
1256
|
"hover:bg-[var(--ash-accent)]/10 hover:border-[var(--ash-accent)]/30",
|
|
@@ -1254,7 +1259,7 @@ function en({ options: e, onSelect: n, className: r }) {
|
|
|
1254
1259
|
"group"
|
|
1255
1260
|
),
|
|
1256
1261
|
children: [
|
|
1257
|
-
/* @__PURE__ */ t("span", { className:
|
|
1262
|
+
/* @__PURE__ */ t("span", { className: m(
|
|
1258
1263
|
"flex-shrink-0 w-6 h-6 rounded-lg",
|
|
1259
1264
|
"bg-[var(--ash-accent)]/20 text-[var(--ash-accent)]",
|
|
1260
1265
|
"flex items-center justify-center",
|
|
@@ -1262,14 +1267,14 @@ function en({ options: e, onSelect: n, className: r }) {
|
|
|
1262
1267
|
"group-hover:bg-[var(--ash-accent)]/30",
|
|
1263
1268
|
"transition-colors duration-200"
|
|
1264
1269
|
), children: s.id }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
1266
1271
|
/* @__PURE__ */ t("div", { className: "text-sm font-medium text-white/90 group-hover:text-white transition-colors", children: s.label }),
|
|
1267
1272
|
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
1273
|
] }),
|
|
1269
1274
|
/* @__PURE__ */ t(
|
|
1270
1275
|
"svg",
|
|
1271
1276
|
{
|
|
1272
|
-
className:
|
|
1277
|
+
className: m(
|
|
1273
1278
|
"w-4 h-4 text-white/30 flex-shrink-0 mt-0.5",
|
|
1274
1279
|
"group-hover:text-[var(--ash-accent)] group-hover:translate-x-0.5",
|
|
1275
1280
|
"transition-all duration-200"
|
|
@@ -1286,7 +1291,37 @@ function en({ options: e, onSelect: n, className: r }) {
|
|
|
1286
1291
|
s.id
|
|
1287
1292
|
)) });
|
|
1288
1293
|
}
|
|
1289
|
-
|
|
1294
|
+
var be = {
|
|
1295
|
+
dense: {
|
|
1296
|
+
text: "text-xs",
|
|
1297
|
+
padding: "px-2 py-1",
|
|
1298
|
+
gap: "gap-1.5",
|
|
1299
|
+
avatar: "w-4 h-4",
|
|
1300
|
+
messageGap: "space-y-0.5"
|
|
1301
|
+
},
|
|
1302
|
+
compact: {
|
|
1303
|
+
text: "text-[13px]",
|
|
1304
|
+
padding: "px-3 py-2",
|
|
1305
|
+
gap: "gap-2",
|
|
1306
|
+
avatar: "w-5 h-5",
|
|
1307
|
+
messageGap: "space-y-1"
|
|
1308
|
+
},
|
|
1309
|
+
default: {
|
|
1310
|
+
text: "text-sm",
|
|
1311
|
+
padding: "px-4 py-3",
|
|
1312
|
+
gap: "gap-3",
|
|
1313
|
+
avatar: "w-6 h-6",
|
|
1314
|
+
messageGap: "space-y-2"
|
|
1315
|
+
},
|
|
1316
|
+
comfortable: {
|
|
1317
|
+
text: "text-[15px]",
|
|
1318
|
+
padding: "px-5 py-4",
|
|
1319
|
+
gap: "gap-4",
|
|
1320
|
+
avatar: "w-7 h-7",
|
|
1321
|
+
messageGap: "space-y-3"
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
function nn(e) {
|
|
1290
1325
|
const n = "[Uploaded files available at /uploads/]", r = e.indexOf(n);
|
|
1291
1326
|
if (r === -1)
|
|
1292
1327
|
return { text: e, files: [] };
|
|
@@ -1294,146 +1329,244 @@ function tn(e) {
|
|
|
1294
1329
|
`).filter((c) => c.startsWith("- ")).map((c) => c.substring(2).trim());
|
|
1295
1330
|
return { text: s, files: l };
|
|
1296
1331
|
}
|
|
1297
|
-
function
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1332
|
+
function rn({
|
|
1333
|
+
entry: e,
|
|
1334
|
+
variant: n = "bubble",
|
|
1335
|
+
scale: r = "compact",
|
|
1336
|
+
showAvatar: s = !0,
|
|
1337
|
+
showTimestamp: i = !0,
|
|
1338
|
+
renderMetadata: l,
|
|
1339
|
+
metadata: c,
|
|
1340
|
+
className: h
|
|
1341
|
+
}) {
|
|
1342
|
+
const { text: o, files: f } = nn(e.content), d = be[r], x = {
|
|
1343
|
+
bubble: "rounded-lg bg-[var(--ash-user-bg)] text-[var(--ash-user-text)] border border-[var(--ash-user-border)]",
|
|
1344
|
+
plain: "bg-transparent text-[var(--ash-text-primary)]",
|
|
1345
|
+
minimal: "bg-transparent text-[var(--ash-text-secondary)]"
|
|
1346
|
+
};
|
|
1347
|
+
return /* @__PURE__ */ a(
|
|
1348
|
+
"div",
|
|
1349
|
+
{
|
|
1350
|
+
"data-message-role": "user",
|
|
1351
|
+
className: m("flex justify-end ash-animate-fade-in pr-1", d.gap, h),
|
|
1352
|
+
children: [
|
|
1353
|
+
/* @__PURE__ */ a("div", { className: "max-w-[90%] flex flex-col items-end", children: [
|
|
1354
|
+
/* @__PURE__ */ a("div", { className: m(x[n], n === "bubble" && d.padding), children: [
|
|
1355
|
+
/* @__PURE__ */ t("p", { className: m(d.text, "leading-snug whitespace-pre-wrap"), children: o || "(files attached)" }),
|
|
1356
|
+
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((p, v) => /* @__PURE__ */ a(
|
|
1357
|
+
"span",
|
|
1358
|
+
{
|
|
1359
|
+
className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-[var(--ash-user-text)]/10 text-[11px]",
|
|
1360
|
+
title: p,
|
|
1361
|
+
children: [
|
|
1362
|
+
/* @__PURE__ */ t($t, { className: "w-2.5 h-2.5 opacity-60" }),
|
|
1363
|
+
p.split(" (")[0]
|
|
1364
|
+
]
|
|
1365
|
+
},
|
|
1366
|
+
v
|
|
1367
|
+
)) })
|
|
1368
|
+
] }),
|
|
1369
|
+
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: [
|
|
1370
|
+
(c == null ? void 0 : c.model) && /* @__PURE__ */ t("span", { children: c.model }),
|
|
1371
|
+
(c == null ? void 0 : c.model) && /* @__PURE__ */ t("span", { className: "opacity-50", children: "·" }),
|
|
1372
|
+
je(e.timestamp)
|
|
1373
|
+
] })
|
|
1306
1374
|
] }),
|
|
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
|
-
] });
|
|
1375
|
+
s && /* @__PURE__ */ t("div", { className: m(d.avatar, "rounded-md bg-[var(--ash-avatar-user-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(At, { className: "w-3 h-3 text-[var(--ash-text-muted)]" }) })
|
|
1376
|
+
]
|
|
1377
|
+
}
|
|
1378
|
+
);
|
|
1321
1379
|
}
|
|
1322
|
-
function
|
|
1380
|
+
function sn({
|
|
1323
1381
|
entry: e,
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1382
|
+
variant: n = "bubble",
|
|
1383
|
+
scale: r = "compact",
|
|
1384
|
+
showAvatar: s = !0,
|
|
1385
|
+
showTimestamp: i = !0,
|
|
1386
|
+
onOptionSelect: l,
|
|
1387
|
+
richContentRenderers: c,
|
|
1388
|
+
markdownComponents: h,
|
|
1389
|
+
renderMetadata: o,
|
|
1390
|
+
metadata: f,
|
|
1391
|
+
className: d
|
|
1327
1392
|
}) {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1330
|
-
},
|
|
1331
|
-
|
|
1393
|
+
const x = e.richContent ? null : vt(e.content), p = be[r], v = (R) => {
|
|
1394
|
+
l && l(`Option ${R.id}: ${R.label}`);
|
|
1395
|
+
}, E = {
|
|
1396
|
+
bubble: "rounded-lg bg-[var(--ash-assistant-bg)] border border-[var(--ash-assistant-border)]",
|
|
1397
|
+
plain: "bg-transparent",
|
|
1398
|
+
minimal: "bg-transparent"
|
|
1399
|
+
}, D = (R) => e.richContent && e.richContent.length > 0 ? /* @__PURE__ */ t(
|
|
1400
|
+
en,
|
|
1332
1401
|
{
|
|
1333
1402
|
content: e.richContent,
|
|
1334
|
-
renderers:
|
|
1403
|
+
renderers: c
|
|
1335
1404
|
}
|
|
1336
|
-
) : /* @__PURE__ */ t(
|
|
1337
|
-
return /* @__PURE__ */
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1405
|
+
) : /* @__PURE__ */ t(Fe, { components: h, children: R || e.content });
|
|
1406
|
+
return /* @__PURE__ */ a(
|
|
1407
|
+
"div",
|
|
1408
|
+
{
|
|
1409
|
+
"data-message-role": "assistant",
|
|
1410
|
+
className: m("flex ash-animate-fade-in pl-1", p.gap, d),
|
|
1411
|
+
children: [
|
|
1412
|
+
s && /* @__PURE__ */ t("div", { className: m(p.avatar, "rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
1413
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
1414
|
+
/* @__PURE__ */ t("div", { className: m(E[n], n === "bubble" && p.padding), children: /* @__PURE__ */ t("div", { className: m("ash-message-content prose prose-sm prose-invert max-w-none leading-relaxed text-[var(--ash-assistant-text)]", p.text), children: x ? /* @__PURE__ */ a(S, { children: [
|
|
1415
|
+
x.preamble && D(x.preamble),
|
|
1416
|
+
/* @__PURE__ */ t(
|
|
1417
|
+
tn,
|
|
1418
|
+
{
|
|
1419
|
+
options: x.options,
|
|
1420
|
+
onSelect: v
|
|
1421
|
+
}
|
|
1422
|
+
)
|
|
1423
|
+
] }) : D() }) }),
|
|
1424
|
+
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: [
|
|
1425
|
+
(f == null ? void 0 : f.model) && /* @__PURE__ */ t("span", { children: f.model }),
|
|
1426
|
+
(f == null ? void 0 : f.model) && /* @__PURE__ */ t("span", { className: "opacity-50", children: "·" }),
|
|
1427
|
+
je(e.timestamp)
|
|
1428
|
+
] })
|
|
1429
|
+
] })
|
|
1430
|
+
]
|
|
1431
|
+
}
|
|
1432
|
+
);
|
|
1353
1433
|
}
|
|
1354
|
-
function
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1434
|
+
function an({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
|
|
1435
|
+
const i = be[n];
|
|
1436
|
+
return /* @__PURE__ */ a(
|
|
1437
|
+
"div",
|
|
1438
|
+
{
|
|
1439
|
+
"data-message-role": "thinking",
|
|
1440
|
+
className: m("flex ash-animate-fade-in pl-1", i.gap, s),
|
|
1441
|
+
children: [
|
|
1442
|
+
r && /* @__PURE__ */ t("div", { className: m(i.avatar, "rounded-md bg-[var(--ash-avatar-thinking-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Rt, { className: "w-3 h-3 text-purple-400" }) }),
|
|
1443
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: m("rounded-lg bg-[var(--ash-thinking-bg)] border border-[var(--ash-thinking-border)]", i.padding), children: [
|
|
1444
|
+
/* @__PURE__ */ t("div", { className: "text-[10px] text-[var(--ash-thinking-text)] opacity-80 mb-1 font-medium uppercase tracking-wide", children: "Thinking" }),
|
|
1445
|
+
/* @__PURE__ */ t("div", { className: m(i.text, "text-[var(--ash-thinking-text)] opacity-70 italic whitespace-pre-wrap leading-relaxed"), children: e.content })
|
|
1446
|
+
] }) })
|
|
1447
|
+
]
|
|
1448
|
+
}
|
|
1449
|
+
);
|
|
1362
1450
|
}
|
|
1363
|
-
function
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1451
|
+
function ln({ entry: e, scale: n = "compact", showAvatar: r = !0, defaultExpanded: s = !1, className: i }) {
|
|
1452
|
+
if (e.entryType.type !== "tool_call") return null;
|
|
1453
|
+
const l = be[n];
|
|
1454
|
+
return /* @__PURE__ */ a(
|
|
1455
|
+
"div",
|
|
1456
|
+
{
|
|
1457
|
+
"data-message-role": "tool",
|
|
1458
|
+
className: m("flex ash-animate-fade-in pl-1", l.gap, i),
|
|
1459
|
+
children: [
|
|
1460
|
+
r && /* @__PURE__ */ t("div", { className: m(l.avatar, "rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
1461
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t(ze, { toolCall: e.entryType.toolCall, defaultExpanded: s }) })
|
|
1462
|
+
]
|
|
1463
|
+
}
|
|
1464
|
+
);
|
|
1368
1465
|
}
|
|
1369
|
-
function
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1466
|
+
function on({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
|
|
1467
|
+
if (e.entryType.type !== "error") return null;
|
|
1468
|
+
const i = be[n];
|
|
1469
|
+
return /* @__PURE__ */ a(
|
|
1470
|
+
"div",
|
|
1471
|
+
{
|
|
1472
|
+
"data-message-role": "error",
|
|
1473
|
+
className: m("flex ash-animate-fade-in pl-1", i.gap, s),
|
|
1474
|
+
children: [
|
|
1475
|
+
r && /* @__PURE__ */ t("div", { className: m(i.avatar, "rounded-md bg-[var(--ash-avatar-error-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Ye, { className: "w-3 h-3 text-red-400" }) }),
|
|
1476
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: m("rounded-lg bg-[var(--ash-error-bg)] border border-[var(--ash-error-border)]", i.padding), children: [
|
|
1477
|
+
/* @__PURE__ */ t("div", { className: "text-[10px] text-[var(--ash-error-text)] opacity-80 mb-1 font-medium uppercase tracking-wide", children: "Error" }),
|
|
1478
|
+
/* @__PURE__ */ t("p", { className: m(i.text, "text-[var(--ash-error-text)] opacity-90"), children: e.entryType.message }),
|
|
1479
|
+
e.entryType.code && /* @__PURE__ */ a("p", { className: "text-[11px] text-[var(--ash-error-text)] opacity-60 mt-1 font-mono", children: [
|
|
1480
|
+
"Code: ",
|
|
1481
|
+
e.entryType.code
|
|
1482
|
+
] })
|
|
1483
|
+
] }) })
|
|
1484
|
+
]
|
|
1485
|
+
}
|
|
1486
|
+
);
|
|
1381
1487
|
}
|
|
1382
|
-
function
|
|
1488
|
+
function cn({
|
|
1383
1489
|
entry: e,
|
|
1384
1490
|
onOptionSelect: n,
|
|
1385
1491
|
defaultExpanded: r,
|
|
1386
1492
|
richContentRenderers: s,
|
|
1387
|
-
|
|
1493
|
+
markdownComponents: i,
|
|
1494
|
+
userVariant: l,
|
|
1495
|
+
assistantVariant: c,
|
|
1496
|
+
scale: h,
|
|
1497
|
+
showAvatars: o = !0,
|
|
1498
|
+
showTimestamp: f = !0,
|
|
1499
|
+
renderMetadata: d,
|
|
1500
|
+
metadata: x,
|
|
1501
|
+
className: p
|
|
1388
1502
|
}) {
|
|
1389
1503
|
switch (e.entryType.type) {
|
|
1390
1504
|
case "user_message":
|
|
1391
|
-
return /* @__PURE__ */ t(nn, { entry: e, className: a });
|
|
1392
|
-
case "assistant_message":
|
|
1393
1505
|
return /* @__PURE__ */ t(
|
|
1394
1506
|
rn,
|
|
1395
1507
|
{
|
|
1396
1508
|
entry: e,
|
|
1509
|
+
variant: l,
|
|
1510
|
+
scale: h,
|
|
1511
|
+
showAvatar: o,
|
|
1512
|
+
showTimestamp: f,
|
|
1513
|
+
renderMetadata: d,
|
|
1514
|
+
metadata: x,
|
|
1515
|
+
className: p
|
|
1516
|
+
}
|
|
1517
|
+
);
|
|
1518
|
+
case "assistant_message":
|
|
1519
|
+
return /* @__PURE__ */ t(
|
|
1520
|
+
sn,
|
|
1521
|
+
{
|
|
1522
|
+
entry: e,
|
|
1523
|
+
variant: c,
|
|
1524
|
+
scale: h,
|
|
1525
|
+
showAvatar: o,
|
|
1526
|
+
showTimestamp: f,
|
|
1397
1527
|
onOptionSelect: n,
|
|
1398
1528
|
richContentRenderers: s,
|
|
1399
|
-
|
|
1529
|
+
markdownComponents: i,
|
|
1530
|
+
renderMetadata: d,
|
|
1531
|
+
metadata: x,
|
|
1532
|
+
className: p
|
|
1400
1533
|
}
|
|
1401
1534
|
);
|
|
1402
1535
|
case "thinking":
|
|
1403
|
-
return /* @__PURE__ */ t(
|
|
1536
|
+
return /* @__PURE__ */ t(an, { entry: e, scale: h, showAvatar: o, className: p });
|
|
1404
1537
|
case "tool_call":
|
|
1405
|
-
return /* @__PURE__ */ t(
|
|
1538
|
+
return /* @__PURE__ */ t(ln, { entry: e, scale: h, showAvatar: o, defaultExpanded: r, className: p });
|
|
1406
1539
|
case "error":
|
|
1407
|
-
return /* @__PURE__ */ t(
|
|
1540
|
+
return /* @__PURE__ */ t(on, { entry: e, scale: h, showAvatar: o, className: p });
|
|
1408
1541
|
default:
|
|
1409
1542
|
return null;
|
|
1410
1543
|
}
|
|
1411
1544
|
}
|
|
1412
|
-
function
|
|
1545
|
+
function Re({ variant: e = "dots", size: n = "md", className: r }) {
|
|
1413
1546
|
if (e === "dots") {
|
|
1414
|
-
const
|
|
1547
|
+
const i = {
|
|
1415
1548
|
sm: "w-1 h-1",
|
|
1416
1549
|
md: "w-1.5 h-1.5",
|
|
1417
1550
|
lg: "w-2 h-2"
|
|
1418
1551
|
};
|
|
1419
|
-
return /* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */ t("span", { className:
|
|
1421
|
-
/* @__PURE__ */ t("span", { className:
|
|
1422
|
-
/* @__PURE__ */ t("span", { className:
|
|
1552
|
+
return /* @__PURE__ */ a("div", { className: m("flex items-center gap-1", r), children: [
|
|
1553
|
+
/* @__PURE__ */ t("span", { className: m("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]) }),
|
|
1554
|
+
/* @__PURE__ */ t("span", { className: m("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "150ms" } }),
|
|
1555
|
+
/* @__PURE__ */ t("span", { className: m("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "300ms" } })
|
|
1423
1556
|
] });
|
|
1424
1557
|
}
|
|
1425
1558
|
if (e === "pulse") {
|
|
1426
|
-
const
|
|
1559
|
+
const i = {
|
|
1427
1560
|
sm: "w-1.5 h-1.5",
|
|
1428
1561
|
md: "w-2 h-2",
|
|
1429
1562
|
lg: "w-3 h-3"
|
|
1430
1563
|
};
|
|
1431
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1564
|
+
return /* @__PURE__ */ t("div", { className: m("flex items-center gap-1", r), children: /* @__PURE__ */ t("span", { className: m("bg-[var(--ash-accent)] rounded-full animate-pulse", i[n]) }) });
|
|
1432
1565
|
}
|
|
1433
1566
|
return e === "cursor" ? /* @__PURE__ */ t(
|
|
1434
1567
|
"span",
|
|
1435
1568
|
{
|
|
1436
|
-
className:
|
|
1569
|
+
className: m(
|
|
1437
1570
|
"inline-block bg-[var(--ash-accent)]/50 ash-tool-status-pending",
|
|
1438
1571
|
{
|
|
1439
1572
|
sm: "w-1 h-3",
|
|
@@ -1443,30 +1576,30 @@ function $e({ variant: e = "dots", size: n = "md", className: r }) {
|
|
|
1443
1576
|
r
|
|
1444
1577
|
)
|
|
1445
1578
|
}
|
|
1446
|
-
) : /* @__PURE__ */ t("div", { className:
|
|
1579
|
+
) : /* @__PURE__ */ t("div", { className: m("animate-spin text-[var(--ash-accent)]", {
|
|
1447
1580
|
sm: "w-4 h-4",
|
|
1448
1581
|
md: "w-6 h-6",
|
|
1449
1582
|
lg: "w-8 h-8"
|
|
1450
|
-
}[n], r), children: /* @__PURE__ */
|
|
1583
|
+
}[n], r), children: /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1451
1584
|
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", className: "opacity-25" }),
|
|
1452
1585
|
/* @__PURE__ */ t("path", { d: "M12 2a10 10 0 0 1 10 10", strokeLinecap: "round" })
|
|
1453
1586
|
] }) });
|
|
1454
1587
|
}
|
|
1455
|
-
function
|
|
1588
|
+
function dn({
|
|
1456
1589
|
content: e,
|
|
1457
1590
|
isStreaming: n = !1,
|
|
1458
1591
|
renderMarkdown: r = !0,
|
|
1459
1592
|
className: s
|
|
1460
1593
|
}) {
|
|
1461
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1462
|
-
/* @__PURE__ */ t(
|
|
1463
|
-
n && /* @__PURE__ */ t(
|
|
1464
|
-
] }) : /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ t("div", { className: m("relative", s), children: r ? /* @__PURE__ */ a("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: [
|
|
1595
|
+
/* @__PURE__ */ t(Fe, { children: e }),
|
|
1596
|
+
n && /* @__PURE__ */ t(Re, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
|
|
1597
|
+
] }) : /* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-sm leading-relaxed", children: [
|
|
1465
1598
|
e,
|
|
1466
|
-
n && /* @__PURE__ */ t(
|
|
1599
|
+
n && /* @__PURE__ */ t(Re, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
|
|
1467
1600
|
] }) });
|
|
1468
1601
|
}
|
|
1469
|
-
function
|
|
1602
|
+
function un(e) {
|
|
1470
1603
|
switch (e.action) {
|
|
1471
1604
|
case "file_read":
|
|
1472
1605
|
case "file_edit":
|
|
@@ -1476,15 +1609,15 @@ function dn(e) {
|
|
|
1476
1609
|
return null;
|
|
1477
1610
|
}
|
|
1478
1611
|
}
|
|
1479
|
-
function
|
|
1612
|
+
function Xe(e) {
|
|
1480
1613
|
const n = e.split("/");
|
|
1481
1614
|
return n[n.length - 1] || e;
|
|
1482
1615
|
}
|
|
1483
|
-
function
|
|
1484
|
-
const n =
|
|
1616
|
+
function hn(e) {
|
|
1617
|
+
const n = Xe(e), r = n.lastIndexOf(".");
|
|
1485
1618
|
return r === -1 ? null : n.slice(r + 1).toLowerCase();
|
|
1486
1619
|
}
|
|
1487
|
-
function
|
|
1620
|
+
function mn(e) {
|
|
1488
1621
|
switch (e.action) {
|
|
1489
1622
|
case "file_edit": {
|
|
1490
1623
|
const n = e;
|
|
@@ -1502,7 +1635,7 @@ function hn(e) {
|
|
|
1502
1635
|
return null;
|
|
1503
1636
|
}
|
|
1504
1637
|
}
|
|
1505
|
-
function
|
|
1638
|
+
function pn(e) {
|
|
1506
1639
|
switch (e) {
|
|
1507
1640
|
case "ts":
|
|
1508
1641
|
case "tsx":
|
|
@@ -1525,64 +1658,64 @@ function mn(e) {
|
|
|
1525
1658
|
return "text-white/70";
|
|
1526
1659
|
}
|
|
1527
1660
|
}
|
|
1528
|
-
function
|
|
1529
|
-
const { actionType: s, status:
|
|
1530
|
-
return /* @__PURE__ */
|
|
1661
|
+
function et({ toolCall: e, showFullPath: n = !1, className: r }) {
|
|
1662
|
+
const { actionType: s, status: i, summary: l } = e, c = Ke(s), h = un(s), o = mn(s), f = h ? n ? h : Xe(h) : null, d = h ? hn(h) : null, x = pn(d), p = !h && l;
|
|
1663
|
+
return /* @__PURE__ */ a(
|
|
1531
1664
|
"div",
|
|
1532
1665
|
{
|
|
1533
|
-
className:
|
|
1666
|
+
className: m(
|
|
1534
1667
|
"flex items-center gap-2 py-1.5 text-sm min-w-0",
|
|
1535
1668
|
r
|
|
1536
1669
|
),
|
|
1537
1670
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
1539
1672
|
/* @__PURE__ */ t(
|
|
1540
|
-
|
|
1673
|
+
Ze,
|
|
1541
1674
|
{
|
|
1542
1675
|
actionType: s,
|
|
1543
|
-
className:
|
|
1676
|
+
className: m(
|
|
1544
1677
|
"w-3.5 h-3.5",
|
|
1545
|
-
|
|
1678
|
+
i === "pending" ? "text-yellow-400" : i === "failed" ? "text-red-400" : "text-white/50"
|
|
1546
1679
|
)
|
|
1547
1680
|
}
|
|
1548
1681
|
),
|
|
1549
|
-
/* @__PURE__ */ t("span", { className:
|
|
1682
|
+
/* @__PURE__ */ t("span", { className: m(
|
|
1550
1683
|
"font-medium",
|
|
1551
|
-
|
|
1684
|
+
i === "pending" ? "text-white/90" : i === "failed" ? "text-red-400" : "text-white/60"
|
|
1552
1685
|
), children: c })
|
|
1553
1686
|
] }),
|
|
1554
|
-
|
|
1687
|
+
f && /* @__PURE__ */ t("code", { className: m(
|
|
1555
1688
|
"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__ */
|
|
1689
|
+
x
|
|
1690
|
+
), children: f }),
|
|
1691
|
+
o && /* @__PURE__ */ a("span", { className: "flex items-center gap-1 text-xs shrink-0 font-mono", children: [
|
|
1692
|
+
o.added !== void 0 && o.added > 0 && /* @__PURE__ */ a("span", { className: "text-emerald-400", children: [
|
|
1560
1693
|
"+",
|
|
1561
1694
|
o.added
|
|
1562
1695
|
] }),
|
|
1563
|
-
o.removed !== void 0 && o.removed > 0 && /* @__PURE__ */
|
|
1696
|
+
o.removed !== void 0 && o.removed > 0 && /* @__PURE__ */ a("span", { className: "text-red-400", children: [
|
|
1564
1697
|
"-",
|
|
1565
1698
|
o.removed
|
|
1566
1699
|
] }),
|
|
1567
|
-
o.read !== void 0 && /* @__PURE__ */
|
|
1700
|
+
o.read !== void 0 && /* @__PURE__ */ a("span", { className: "text-white/40", children: [
|
|
1568
1701
|
o.read,
|
|
1569
1702
|
" lines"
|
|
1570
1703
|
] }),
|
|
1571
|
-
o.written !== void 0 && /* @__PURE__ */
|
|
1704
|
+
o.written !== void 0 && /* @__PURE__ */ a("span", { className: "text-emerald-400", children: [
|
|
1572
1705
|
"+",
|
|
1573
1706
|
o.written
|
|
1574
1707
|
] })
|
|
1575
1708
|
] }),
|
|
1576
|
-
|
|
1709
|
+
p && /* @__PURE__ */ t("span", { className: "text-white/40 truncate min-w-0 text-xs", children: l })
|
|
1577
1710
|
]
|
|
1578
1711
|
}
|
|
1579
1712
|
);
|
|
1580
1713
|
}
|
|
1581
|
-
function
|
|
1714
|
+
function fn(e) {
|
|
1582
1715
|
const n = e.split("/").pop() || e, r = n.lastIndexOf(".");
|
|
1583
1716
|
return r === -1 ? null : n.slice(r + 1).toLowerCase();
|
|
1584
1717
|
}
|
|
1585
|
-
function
|
|
1718
|
+
function xn(e) {
|
|
1586
1719
|
switch (e) {
|
|
1587
1720
|
case "ts":
|
|
1588
1721
|
case "tsx":
|
|
@@ -1605,7 +1738,7 @@ function fn(e) {
|
|
|
1605
1738
|
return "";
|
|
1606
1739
|
}
|
|
1607
1740
|
}
|
|
1608
|
-
function
|
|
1741
|
+
function gn(e) {
|
|
1609
1742
|
switch (e) {
|
|
1610
1743
|
case "ts":
|
|
1611
1744
|
case "tsx":
|
|
@@ -1628,31 +1761,31 @@ function xn(e) {
|
|
|
1628
1761
|
return "bg-white/10";
|
|
1629
1762
|
}
|
|
1630
1763
|
}
|
|
1631
|
-
function
|
|
1764
|
+
function tt({
|
|
1632
1765
|
path: e,
|
|
1633
1766
|
linesAdded: n,
|
|
1634
1767
|
linesRemoved: r,
|
|
1635
1768
|
showOnlyFilename: s = !0,
|
|
1636
|
-
className:
|
|
1769
|
+
className: i
|
|
1637
1770
|
}) {
|
|
1638
|
-
const l = s && e.split("/").pop() || e, c =
|
|
1639
|
-
return /* @__PURE__ */
|
|
1771
|
+
const l = s && e.split("/").pop() || e, c = fn(e), h = xn(c), o = gn(c), f = n !== void 0 && n > 0 || r !== void 0 && r > 0;
|
|
1772
|
+
return /* @__PURE__ */ a(
|
|
1640
1773
|
"span",
|
|
1641
1774
|
{
|
|
1642
|
-
className:
|
|
1775
|
+
className: m(
|
|
1643
1776
|
"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-mono",
|
|
1644
1777
|
o,
|
|
1645
|
-
|
|
1778
|
+
i
|
|
1646
1779
|
),
|
|
1647
1780
|
children: [
|
|
1648
1781
|
h && /* @__PURE__ */ t("span", { className: "text-[10px] opacity-60 font-semibold", children: h }),
|
|
1649
1782
|
/* @__PURE__ */ t("span", { className: "text-white/80 truncate max-w-[120px]", children: l }),
|
|
1650
|
-
|
|
1651
|
-
n !== void 0 && n > 0 && /* @__PURE__ */
|
|
1783
|
+
f && /* @__PURE__ */ a("span", { className: "flex items-center gap-0.5", children: [
|
|
1784
|
+
n !== void 0 && n > 0 && /* @__PURE__ */ a("span", { className: "text-emerald-400", children: [
|
|
1652
1785
|
"+",
|
|
1653
1786
|
n
|
|
1654
1787
|
] }),
|
|
1655
|
-
r !== void 0 && r > 0 && /* @__PURE__ */
|
|
1788
|
+
r !== void 0 && r > 0 && /* @__PURE__ */ a("span", { className: "text-red-400", children: [
|
|
1656
1789
|
"-",
|
|
1657
1790
|
r
|
|
1658
1791
|
] })
|
|
@@ -1661,28 +1794,28 @@ function et({
|
|
|
1661
1794
|
}
|
|
1662
1795
|
);
|
|
1663
1796
|
}
|
|
1664
|
-
function
|
|
1797
|
+
function wn(e) {
|
|
1665
1798
|
const n = /* @__PURE__ */ new Map();
|
|
1666
1799
|
for (const r of e) {
|
|
1667
1800
|
const { actionType: s } = r;
|
|
1668
1801
|
if (s.action === "file_edit") {
|
|
1669
|
-
const
|
|
1670
|
-
l ? (l.linesAdded = (l.linesAdded || 0) + (
|
|
1671
|
-
path:
|
|
1672
|
-
linesAdded:
|
|
1673
|
-
linesRemoved:
|
|
1802
|
+
const i = s, l = n.get(i.path);
|
|
1803
|
+
l ? (l.linesAdded = (l.linesAdded || 0) + (i.linesAdded || 0), l.linesRemoved = (l.linesRemoved || 0) + (i.linesRemoved || 0)) : n.set(i.path, {
|
|
1804
|
+
path: i.path,
|
|
1805
|
+
linesAdded: i.linesAdded,
|
|
1806
|
+
linesRemoved: i.linesRemoved
|
|
1674
1807
|
});
|
|
1675
1808
|
} else if (s.action === "file_write") {
|
|
1676
|
-
const
|
|
1677
|
-
n.has(
|
|
1678
|
-
path:
|
|
1679
|
-
linesAdded:
|
|
1809
|
+
const i = s;
|
|
1810
|
+
n.has(i.path) || n.set(i.path, {
|
|
1811
|
+
path: i.path,
|
|
1812
|
+
linesAdded: i.linesWritten
|
|
1680
1813
|
});
|
|
1681
1814
|
}
|
|
1682
1815
|
}
|
|
1683
1816
|
return Array.from(n.values());
|
|
1684
1817
|
}
|
|
1685
|
-
function
|
|
1818
|
+
function vn(e) {
|
|
1686
1819
|
const n = {};
|
|
1687
1820
|
for (const r of e) {
|
|
1688
1821
|
const s = r.actionType.action;
|
|
@@ -1690,71 +1823,71 @@ function wn(e) {
|
|
|
1690
1823
|
}
|
|
1691
1824
|
return n;
|
|
1692
1825
|
}
|
|
1693
|
-
function
|
|
1826
|
+
function yn(e) {
|
|
1694
1827
|
switch (e) {
|
|
1695
1828
|
case "file_read":
|
|
1696
|
-
return
|
|
1829
|
+
return Be;
|
|
1697
1830
|
case "file_edit":
|
|
1698
1831
|
case "file_write":
|
|
1699
1832
|
return Oe;
|
|
1700
1833
|
case "command_run":
|
|
1701
|
-
return
|
|
1834
|
+
return Ee;
|
|
1702
1835
|
case "search":
|
|
1703
1836
|
case "glob":
|
|
1704
|
-
return
|
|
1837
|
+
return Te;
|
|
1705
1838
|
default:
|
|
1706
1839
|
return null;
|
|
1707
1840
|
}
|
|
1708
1841
|
}
|
|
1709
|
-
function
|
|
1842
|
+
function bn({
|
|
1710
1843
|
toolCalls: e,
|
|
1711
1844
|
defaultExpanded: n = !1,
|
|
1712
1845
|
className: r
|
|
1713
1846
|
}) {
|
|
1714
|
-
const [s,
|
|
1715
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1847
|
+
const [s, i] = N(n), [l, c] = N(null), h = ae(() => wn(e), [e]), o = ae(() => vn(e), [e]), f = ae(() => Object.entries(o).sort((x, p) => p[1] - x[1]).slice(0, 3).map(([x]) => x), [o]), d = e.length;
|
|
1848
|
+
return e.length === 0 ? null : /* @__PURE__ */ a("div", { className: m("ash-animate-fade-in", r), children: [
|
|
1849
|
+
/* @__PURE__ */ a(
|
|
1717
1850
|
"button",
|
|
1718
1851
|
{
|
|
1719
|
-
onClick: () =>
|
|
1852
|
+
onClick: () => i(!s),
|
|
1720
1853
|
className: "w-full flex items-center gap-2 py-1 text-left group",
|
|
1721
1854
|
children: [
|
|
1722
1855
|
/* @__PURE__ */ t(
|
|
1723
|
-
|
|
1856
|
+
ye,
|
|
1724
1857
|
{
|
|
1725
|
-
className:
|
|
1858
|
+
className: m(
|
|
1726
1859
|
"w-3.5 h-3.5 text-white/40 transition-transform duration-200 shrink-0",
|
|
1727
1860
|
s && "rotate-90"
|
|
1728
1861
|
)
|
|
1729
1862
|
}
|
|
1730
1863
|
),
|
|
1731
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-white/60", children: [
|
|
1732
1865
|
d,
|
|
1733
1866
|
" tool call",
|
|
1734
1867
|
d !== 1 ? "s" : ""
|
|
1735
1868
|
] }),
|
|
1736
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
1737
|
-
const
|
|
1738
|
-
return
|
|
1739
|
-
|
|
1869
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: f.map((x) => {
|
|
1870
|
+
const p = yn(x);
|
|
1871
|
+
return p ? /* @__PURE__ */ t(
|
|
1872
|
+
p,
|
|
1740
1873
|
{
|
|
1741
1874
|
className: "w-3.5 h-3.5 text-white/30"
|
|
1742
1875
|
},
|
|
1743
|
-
|
|
1876
|
+
x
|
|
1744
1877
|
) : null;
|
|
1745
1878
|
}) }),
|
|
1746
1879
|
/* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
1747
|
-
!s && h.length > 0 && /* @__PURE__ */
|
|
1748
|
-
h.slice(0, 4).map((
|
|
1749
|
-
|
|
1880
|
+
!s && h.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 flex-wrap justify-end", children: [
|
|
1881
|
+
h.slice(0, 4).map((x) => /* @__PURE__ */ t(
|
|
1882
|
+
tt,
|
|
1750
1883
|
{
|
|
1751
|
-
path:
|
|
1752
|
-
linesAdded:
|
|
1753
|
-
linesRemoved:
|
|
1884
|
+
path: x.path,
|
|
1885
|
+
linesAdded: x.linesAdded,
|
|
1886
|
+
linesRemoved: x.linesRemoved
|
|
1754
1887
|
},
|
|
1755
|
-
|
|
1888
|
+
x.path
|
|
1756
1889
|
)),
|
|
1757
|
-
h.length > 4 && /* @__PURE__ */
|
|
1890
|
+
h.length > 4 && /* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
|
|
1758
1891
|
"+",
|
|
1759
1892
|
h.length - 4,
|
|
1760
1893
|
" more"
|
|
@@ -1763,11 +1896,11 @@ function yn({
|
|
|
1763
1896
|
]
|
|
1764
1897
|
}
|
|
1765
1898
|
),
|
|
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((
|
|
1899
|
+
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
1900
|
/* @__PURE__ */ t(
|
|
1768
|
-
|
|
1901
|
+
ze,
|
|
1769
1902
|
{
|
|
1770
|
-
toolCall:
|
|
1903
|
+
toolCall: x,
|
|
1771
1904
|
defaultExpanded: !0
|
|
1772
1905
|
}
|
|
1773
1906
|
),
|
|
@@ -1782,23 +1915,23 @@ function yn({
|
|
|
1782
1915
|
] }) : /* @__PURE__ */ t(
|
|
1783
1916
|
"button",
|
|
1784
1917
|
{
|
|
1785
|
-
onClick: () => c(
|
|
1918
|
+
onClick: () => c(x.id),
|
|
1786
1919
|
className: "w-full text-left hover:bg-white/5 rounded px-1 -mx-1 transition-colors",
|
|
1787
|
-
children: /* @__PURE__ */ t(
|
|
1920
|
+
children: /* @__PURE__ */ t(et, { toolCall: x })
|
|
1788
1921
|
}
|
|
1789
|
-
) },
|
|
1922
|
+
) }, x.id)) })
|
|
1790
1923
|
] });
|
|
1791
1924
|
}
|
|
1792
|
-
function
|
|
1925
|
+
function Nn(e) {
|
|
1793
1926
|
const n = /* @__PURE__ */ new Map();
|
|
1794
1927
|
for (const r of e) {
|
|
1795
1928
|
const { actionType: s } = r;
|
|
1796
1929
|
if (s.action === "file_edit") {
|
|
1797
|
-
const
|
|
1798
|
-
l ? (l.linesAdded = (l.linesAdded || 0) + (
|
|
1799
|
-
path:
|
|
1800
|
-
linesAdded:
|
|
1801
|
-
linesRemoved:
|
|
1930
|
+
const i = s, l = n.get(i.path);
|
|
1931
|
+
l ? (l.linesAdded = (l.linesAdded || 0) + (i.linesAdded || 0), l.linesRemoved = (l.linesRemoved || 0) + (i.linesRemoved || 0)) : n.set(i.path, {
|
|
1932
|
+
path: i.path,
|
|
1933
|
+
linesAdded: i.linesAdded,
|
|
1934
|
+
linesRemoved: i.linesRemoved
|
|
1802
1935
|
});
|
|
1803
1936
|
} else s.action === "file_write" && (n.has(s.path) || n.set(s.path, {
|
|
1804
1937
|
path: s.path,
|
|
@@ -1807,7 +1940,7 @@ function bn(e) {
|
|
|
1807
1940
|
}
|
|
1808
1941
|
return Array.from(n.values());
|
|
1809
1942
|
}
|
|
1810
|
-
function
|
|
1943
|
+
function kn(e) {
|
|
1811
1944
|
const n = {};
|
|
1812
1945
|
for (const r of e) {
|
|
1813
1946
|
const s = r.actionType.action;
|
|
@@ -1815,37 +1948,37 @@ function Nn(e) {
|
|
|
1815
1948
|
}
|
|
1816
1949
|
return n;
|
|
1817
1950
|
}
|
|
1818
|
-
function
|
|
1951
|
+
function Cn(e) {
|
|
1819
1952
|
switch (e) {
|
|
1820
1953
|
case "file_read":
|
|
1821
|
-
return
|
|
1954
|
+
return Be;
|
|
1822
1955
|
case "file_edit":
|
|
1823
1956
|
case "file_write":
|
|
1824
1957
|
return Oe;
|
|
1825
1958
|
case "command_run":
|
|
1826
|
-
return
|
|
1959
|
+
return Ee;
|
|
1827
1960
|
case "search":
|
|
1828
1961
|
case "glob":
|
|
1829
|
-
return
|
|
1962
|
+
return Te;
|
|
1830
1963
|
default:
|
|
1831
1964
|
return null;
|
|
1832
1965
|
}
|
|
1833
1966
|
}
|
|
1834
|
-
function
|
|
1967
|
+
function _n({
|
|
1835
1968
|
toolCalls: e,
|
|
1836
1969
|
defaultExpanded: n = !1,
|
|
1837
1970
|
isExpanded: r,
|
|
1838
1971
|
onToggle: s,
|
|
1839
|
-
className:
|
|
1972
|
+
className: i
|
|
1840
1973
|
}) {
|
|
1841
|
-
const [l, c] = N(n), h = r !== void 0 ? r : l, o =
|
|
1974
|
+
const [l, c] = N(n), h = r !== void 0 ? r : l, o = P(() => {
|
|
1842
1975
|
s ? s() : c((v) => !v);
|
|
1843
|
-
}, [s]),
|
|
1976
|
+
}, [s]), f = ae(() => Nn(e), [e]), d = ae(() => kn(e), [e]), x = ae(() => Object.entries(d).sort((v, E) => E[1] - v[1]).slice(0, 3).map(([v]) => v), [d]);
|
|
1844
1977
|
if (e.length === 0)
|
|
1845
1978
|
return null;
|
|
1846
|
-
const
|
|
1847
|
-
return /* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
1979
|
+
const p = e.length;
|
|
1980
|
+
return /* @__PURE__ */ a("div", { className: m("ash-animate-fade-in", i), children: [
|
|
1981
|
+
/* @__PURE__ */ a(
|
|
1849
1982
|
"button",
|
|
1850
1983
|
{
|
|
1851
1984
|
type: "button",
|
|
@@ -1853,23 +1986,23 @@ function Cn({
|
|
|
1853
1986
|
className: "w-full flex items-center gap-2 py-1 text-left group",
|
|
1854
1987
|
children: [
|
|
1855
1988
|
/* @__PURE__ */ t(
|
|
1856
|
-
|
|
1989
|
+
ye,
|
|
1857
1990
|
{
|
|
1858
|
-
className:
|
|
1991
|
+
className: m(
|
|
1859
1992
|
"w-3.5 h-3.5 text-white/40 transition-transform duration-200 shrink-0",
|
|
1860
1993
|
h && "rotate-90"
|
|
1861
1994
|
)
|
|
1862
1995
|
}
|
|
1863
1996
|
),
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
1997
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-white/60", children: [
|
|
1998
|
+
p,
|
|
1866
1999
|
" tool call",
|
|
1867
|
-
|
|
2000
|
+
p !== 1 ? "s" : ""
|
|
1868
2001
|
] }),
|
|
1869
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
1870
|
-
const
|
|
1871
|
-
return
|
|
1872
|
-
|
|
2002
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: x.map((v) => {
|
|
2003
|
+
const E = Cn(v);
|
|
2004
|
+
return E ? /* @__PURE__ */ t(
|
|
2005
|
+
E,
|
|
1873
2006
|
{
|
|
1874
2007
|
className: "w-3.5 h-3.5 text-white/30"
|
|
1875
2008
|
},
|
|
@@ -1877,9 +2010,9 @@ function Cn({
|
|
|
1877
2010
|
) : null;
|
|
1878
2011
|
}) }),
|
|
1879
2012
|
/* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
1880
|
-
!h &&
|
|
1881
|
-
|
|
1882
|
-
|
|
2013
|
+
!h && f.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 flex-wrap justify-end", children: [
|
|
2014
|
+
f.slice(0, 4).map((v) => /* @__PURE__ */ t(
|
|
2015
|
+
tt,
|
|
1883
2016
|
{
|
|
1884
2017
|
path: v.path,
|
|
1885
2018
|
linesAdded: v.linesAdded,
|
|
@@ -1887,64 +2020,64 @@ function Cn({
|
|
|
1887
2020
|
},
|
|
1888
2021
|
v.path
|
|
1889
2022
|
)),
|
|
1890
|
-
|
|
2023
|
+
f.length > 4 && /* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
|
|
1891
2024
|
"+",
|
|
1892
|
-
|
|
2025
|
+
f.length - 4,
|
|
1893
2026
|
" more"
|
|
1894
2027
|
] })
|
|
1895
2028
|
] })
|
|
1896
2029
|
]
|
|
1897
2030
|
}
|
|
1898
2031
|
),
|
|
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((v) => /* @__PURE__ */ t(
|
|
2032
|
+
h && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((v) => /* @__PURE__ */ t(et, { toolCall: v }, v.id)) })
|
|
1900
2033
|
] });
|
|
1901
2034
|
}
|
|
1902
|
-
function
|
|
2035
|
+
function vr(e) {
|
|
1903
2036
|
return e.action === "command_run";
|
|
1904
2037
|
}
|
|
1905
|
-
function
|
|
2038
|
+
function yr(e) {
|
|
1906
2039
|
return e.action === "file_read";
|
|
1907
2040
|
}
|
|
1908
|
-
function
|
|
2041
|
+
function br(e) {
|
|
1909
2042
|
return e.action === "file_edit";
|
|
1910
2043
|
}
|
|
1911
|
-
function
|
|
2044
|
+
function Nr(e) {
|
|
1912
2045
|
return e.action === "file_write";
|
|
1913
2046
|
}
|
|
1914
|
-
function
|
|
2047
|
+
function kr(e) {
|
|
1915
2048
|
return e.action === "search";
|
|
1916
2049
|
}
|
|
1917
|
-
function
|
|
2050
|
+
function Cr(e) {
|
|
1918
2051
|
return e.action === "glob";
|
|
1919
2052
|
}
|
|
1920
|
-
function
|
|
2053
|
+
function _r(e) {
|
|
1921
2054
|
return e.action === "web_fetch";
|
|
1922
2055
|
}
|
|
1923
|
-
function
|
|
2056
|
+
function Tr(e) {
|
|
1924
2057
|
return e.action === "web_search";
|
|
1925
2058
|
}
|
|
1926
|
-
function
|
|
2059
|
+
function Sr(e) {
|
|
1927
2060
|
return e.action === "mcp_tool";
|
|
1928
2061
|
}
|
|
1929
|
-
function
|
|
2062
|
+
function Mr(e) {
|
|
1930
2063
|
return e.action === "generic_tool";
|
|
1931
2064
|
}
|
|
1932
|
-
function
|
|
2065
|
+
function Er(e) {
|
|
1933
2066
|
return e.type === "tool_call";
|
|
1934
2067
|
}
|
|
1935
|
-
function
|
|
2068
|
+
function Ir(e) {
|
|
1936
2069
|
return e.type === "error";
|
|
1937
2070
|
}
|
|
1938
|
-
var
|
|
2071
|
+
var Tn = {
|
|
1939
2072
|
mode: "inline",
|
|
1940
2073
|
breakEveryNToolCalls: 0,
|
|
1941
2074
|
defaultExpanded: !1,
|
|
1942
2075
|
animationDuration: 300
|
|
1943
|
-
},
|
|
1944
|
-
function
|
|
1945
|
-
const e =
|
|
2076
|
+
}, Sn = Je(null);
|
|
2077
|
+
function Mn() {
|
|
2078
|
+
const e = Ue(Sn);
|
|
1946
2079
|
return e || {
|
|
1947
|
-
config:
|
|
2080
|
+
config: Tn,
|
|
1948
2081
|
setMode: () => {
|
|
1949
2082
|
},
|
|
1950
2083
|
setConfig: () => {
|
|
@@ -1953,111 +2086,127 @@ function Sn() {
|
|
|
1953
2086
|
}
|
|
1954
2087
|
};
|
|
1955
2088
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const { config: e } =
|
|
2089
|
+
function En() {
|
|
2090
|
+
const { config: e } = Mn();
|
|
1958
2091
|
return e;
|
|
1959
2092
|
}
|
|
1960
|
-
function
|
|
2093
|
+
function In({
|
|
1961
2094
|
entries: e,
|
|
1962
2095
|
loading: n,
|
|
1963
2096
|
streamingContent: r,
|
|
1964
2097
|
displayConfig: s,
|
|
1965
|
-
onOptionSelect:
|
|
2098
|
+
onOptionSelect: i,
|
|
1966
2099
|
renderWidget: l,
|
|
1967
2100
|
onWidgetAction: c,
|
|
1968
2101
|
autoScroll: h = !0,
|
|
1969
2102
|
richContentRenderers: o,
|
|
1970
|
-
|
|
2103
|
+
userVariant: f,
|
|
2104
|
+
assistantVariant: d,
|
|
2105
|
+
scale: x,
|
|
2106
|
+
showAvatars: p = !0,
|
|
2107
|
+
showTimestamp: v = !0,
|
|
2108
|
+
markdownComponents: E,
|
|
2109
|
+
renderMetadata: D,
|
|
2110
|
+
metadata: R,
|
|
2111
|
+
className: _
|
|
1971
2112
|
}) {
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1974
|
-
h &&
|
|
2113
|
+
const Q = En(), T = s || Q, F = G(null), A = G(null);
|
|
2114
|
+
z(() => {
|
|
2115
|
+
h && A.current && F.current && A.current.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
1975
2116
|
}, [e, r, n, h]);
|
|
1976
|
-
const
|
|
1977
|
-
(
|
|
2117
|
+
const j = P(
|
|
2118
|
+
(W, H) => {
|
|
1978
2119
|
if (c)
|
|
1979
|
-
return (
|
|
2120
|
+
return (k) => {
|
|
1980
2121
|
c({
|
|
1981
|
-
...
|
|
1982
|
-
entryId:
|
|
1983
|
-
widgetType:
|
|
2122
|
+
...k,
|
|
2123
|
+
entryId: W,
|
|
2124
|
+
widgetType: H
|
|
1984
2125
|
});
|
|
1985
2126
|
};
|
|
1986
2127
|
},
|
|
1987
2128
|
[c]
|
|
1988
|
-
),
|
|
2129
|
+
), ie = ae(() => T.mode === "inline" ? e.map((W) => ({
|
|
1989
2130
|
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:
|
|
2131
|
+
entry: W,
|
|
2132
|
+
id: W.id
|
|
2133
|
+
})) : gt(e, T), [e, T]), X = x ? `ash-density-${x}` : void 0;
|
|
2134
|
+
return /* @__PURE__ */ a("div", { ref: F, className: m("flex-1 overflow-y-auto px-3 py-2 space-y-1 ash-scrollbar", X, _), children: [
|
|
2135
|
+
ie.map((W) => {
|
|
2136
|
+
if (W.type === "single") {
|
|
2137
|
+
const k = W.entry;
|
|
2138
|
+
if (k.entryType.type === "widget" && l) {
|
|
2139
|
+
const B = k.entryType, ee = l({
|
|
2140
|
+
entry: k,
|
|
2141
|
+
widgetType: B.widgetType,
|
|
2142
|
+
widgetData: B.widgetData,
|
|
2143
|
+
onAction: j(k.id, B.widgetType)
|
|
2003
2144
|
});
|
|
2004
|
-
if (
|
|
2005
|
-
return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children:
|
|
2145
|
+
if (ee !== null)
|
|
2146
|
+
return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children: ee }, k.id);
|
|
2006
2147
|
}
|
|
2007
2148
|
return /* @__PURE__ */ t(
|
|
2008
|
-
|
|
2149
|
+
cn,
|
|
2009
2150
|
{
|
|
2010
|
-
entry:
|
|
2011
|
-
onOptionSelect:
|
|
2012
|
-
defaultExpanded:
|
|
2013
|
-
richContentRenderers: o
|
|
2151
|
+
entry: k,
|
|
2152
|
+
onOptionSelect: i,
|
|
2153
|
+
defaultExpanded: T.defaultExpanded,
|
|
2154
|
+
richContentRenderers: o,
|
|
2155
|
+
markdownComponents: E,
|
|
2156
|
+
userVariant: f,
|
|
2157
|
+
assistantVariant: d,
|
|
2158
|
+
scale: x,
|
|
2159
|
+
showAvatars: p,
|
|
2160
|
+
showTimestamp: v,
|
|
2161
|
+
renderMetadata: D,
|
|
2162
|
+
metadata: R
|
|
2014
2163
|
},
|
|
2015
|
-
|
|
2164
|
+
k.id
|
|
2016
2165
|
);
|
|
2017
2166
|
}
|
|
2018
|
-
const
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2021
|
-
/* @__PURE__ */ t("div", { className: "flex-1", children:
|
|
2022
|
-
|
|
2167
|
+
const H = wt(W.entries);
|
|
2168
|
+
return /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
|
|
2169
|
+
p && /* @__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(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
2170
|
+
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: T.mode === "accordion" ? /* @__PURE__ */ t(
|
|
2171
|
+
_n,
|
|
2023
2172
|
{
|
|
2024
|
-
toolCalls:
|
|
2025
|
-
defaultExpanded:
|
|
2173
|
+
toolCalls: H,
|
|
2174
|
+
defaultExpanded: T.defaultExpanded
|
|
2026
2175
|
}
|
|
2027
2176
|
) : /* @__PURE__ */ t(
|
|
2028
|
-
|
|
2177
|
+
bn,
|
|
2029
2178
|
{
|
|
2030
|
-
toolCalls:
|
|
2031
|
-
defaultExpanded:
|
|
2032
|
-
animationDuration:
|
|
2179
|
+
toolCalls: H,
|
|
2180
|
+
defaultExpanded: T.defaultExpanded,
|
|
2181
|
+
animationDuration: T.animationDuration
|
|
2033
2182
|
}
|
|
2034
2183
|
) })
|
|
2035
|
-
] },
|
|
2184
|
+
] }, W.id);
|
|
2036
2185
|
}),
|
|
2037
|
-
r && /* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2039
|
-
/* @__PURE__ */ t("div", { className: "flex-1
|
|
2186
|
+
r && /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
|
|
2187
|
+
p && /* @__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(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
2188
|
+
/* @__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(dn, { content: r, isStreaming: !0 }) }) })
|
|
2040
2189
|
] }),
|
|
2041
|
-
n && !r && /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2043
|
-
/* @__PURE__ */ t("div", { className: "rounded-
|
|
2190
|
+
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: [
|
|
2191
|
+
p && /* @__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(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
|
|
2192
|
+
/* @__PURE__ */ t("div", { className: "rounded-lg px-3 py-1.5 bg-white/[0.03]", children: /* @__PURE__ */ t(Re, { variant: "dots" }) })
|
|
2044
2193
|
] }),
|
|
2045
|
-
/* @__PURE__ */ t("div", { ref:
|
|
2194
|
+
/* @__PURE__ */ t("div", { ref: A })
|
|
2046
2195
|
] });
|
|
2047
2196
|
}
|
|
2048
|
-
function
|
|
2197
|
+
function Ln(e) {
|
|
2049
2198
|
switch (e) {
|
|
2050
2199
|
case "info":
|
|
2051
|
-
return /* @__PURE__ */ t(
|
|
2200
|
+
return /* @__PURE__ */ t(St, { className: "w-3.5 h-3.5" });
|
|
2052
2201
|
case "warn":
|
|
2053
|
-
return /* @__PURE__ */ t(
|
|
2202
|
+
return /* @__PURE__ */ t(Ye, { className: "w-3.5 h-3.5" });
|
|
2054
2203
|
case "error":
|
|
2055
|
-
return /* @__PURE__ */ t(St, { className: "w-3.5 h-3.5" });
|
|
2056
|
-
case "debug":
|
|
2057
2204
|
return /* @__PURE__ */ t(Mt, { className: "w-3.5 h-3.5" });
|
|
2205
|
+
case "debug":
|
|
2206
|
+
return /* @__PURE__ */ t(Et, { className: "w-3.5 h-3.5" });
|
|
2058
2207
|
}
|
|
2059
2208
|
}
|
|
2060
|
-
function
|
|
2209
|
+
function $n(e) {
|
|
2061
2210
|
switch (e) {
|
|
2062
2211
|
case "info":
|
|
2063
2212
|
return "text-blue-400";
|
|
@@ -2069,7 +2218,7 @@ function Ln(e) {
|
|
|
2069
2218
|
return "text-white/50";
|
|
2070
2219
|
}
|
|
2071
2220
|
}
|
|
2072
|
-
function
|
|
2221
|
+
function Rn(e) {
|
|
2073
2222
|
switch (e) {
|
|
2074
2223
|
case "info":
|
|
2075
2224
|
return "bg-blue-900/20";
|
|
@@ -2095,25 +2244,25 @@ function An(e) {
|
|
|
2095
2244
|
return "Startup";
|
|
2096
2245
|
}
|
|
2097
2246
|
}
|
|
2098
|
-
function
|
|
2247
|
+
function Dn({ log: e }) {
|
|
2099
2248
|
const [n, r] = N(!1), s = e.data && Object.keys(e.data).length > 0;
|
|
2100
|
-
return /* @__PURE__ */
|
|
2249
|
+
return /* @__PURE__ */ a(
|
|
2101
2250
|
"div",
|
|
2102
2251
|
{
|
|
2103
|
-
className:
|
|
2252
|
+
className: m(
|
|
2104
2253
|
"px-3 py-2 border-b border-white/10 last:border-b-0",
|
|
2105
|
-
|
|
2254
|
+
Rn(e.level)
|
|
2106
2255
|
),
|
|
2107
2256
|
children: [
|
|
2108
|
-
/* @__PURE__ */
|
|
2257
|
+
/* @__PURE__ */ a(
|
|
2109
2258
|
"div",
|
|
2110
2259
|
{
|
|
2111
|
-
className:
|
|
2260
|
+
className: m("flex items-start gap-2", s && "cursor-pointer"),
|
|
2112
2261
|
onClick: () => s && r(!n),
|
|
2113
2262
|
children: [
|
|
2114
|
-
/* @__PURE__ */ t("div", { className: "w-4 flex-shrink-0 pt-0.5", children: s && (n ? /* @__PURE__ */ t(
|
|
2115
|
-
/* @__PURE__ */ t("div", { className:
|
|
2116
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children:
|
|
2263
|
+
/* @__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(ye, { className: "w-3 h-3 text-white/40" })) }),
|
|
2264
|
+
/* @__PURE__ */ t("div", { className: m("flex-shrink-0 pt-0.5", $n(e.level)), children: Ln(e.level) }),
|
|
2265
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children: je(e.timestamp) }),
|
|
2117
2266
|
/* @__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: An(e.category) }),
|
|
2118
2267
|
/* @__PURE__ */ t("span", { className: "text-sm text-white/80 flex-1 break-words", children: e.message })
|
|
2119
2268
|
]
|
|
@@ -2124,50 +2273,50 @@ function Rn({ log: e }) {
|
|
|
2124
2273
|
}
|
|
2125
2274
|
);
|
|
2126
2275
|
}
|
|
2127
|
-
function
|
|
2276
|
+
function jn({
|
|
2128
2277
|
logs: e,
|
|
2129
2278
|
title: n = "Logs",
|
|
2130
2279
|
isLoading: r,
|
|
2131
2280
|
defaultCollapsed: s = !0,
|
|
2132
|
-
maxHeight:
|
|
2281
|
+
maxHeight: i = 256,
|
|
2133
2282
|
className: l
|
|
2134
2283
|
}) {
|
|
2135
|
-
const [c, h] = N(s), o = e.filter((d) => d.level === "error").length,
|
|
2136
|
-
return e.length === 0 && !r ? null : /* @__PURE__ */
|
|
2284
|
+
const [c, h] = N(s), o = e.filter((d) => d.level === "error").length, f = e.filter((d) => d.level === "warn").length;
|
|
2285
|
+
return e.length === 0 && !r ? null : /* @__PURE__ */ a(
|
|
2137
2286
|
"div",
|
|
2138
2287
|
{
|
|
2139
|
-
className:
|
|
2288
|
+
className: m(
|
|
2140
2289
|
"border-t border-white/10 bg-[var(--ash-surface-dark,#0a0a0a)]",
|
|
2141
2290
|
l
|
|
2142
2291
|
),
|
|
2143
2292
|
children: [
|
|
2144
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ a(
|
|
2145
2294
|
"button",
|
|
2146
2295
|
{
|
|
2147
2296
|
onClick: () => h(!c),
|
|
2148
2297
|
className: "w-full flex items-center justify-between px-4 py-2 hover:bg-white/5 transition-colors",
|
|
2149
2298
|
children: [
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
/* @__PURE__ */ t(
|
|
2299
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2300
|
+
/* @__PURE__ */ t(Ee, { className: "w-4 h-4 text-white/50" }),
|
|
2152
2301
|
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-white/80", children: n }),
|
|
2153
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
|
|
2154
2303
|
"(",
|
|
2155
2304
|
e.length,
|
|
2156
2305
|
")"
|
|
2157
2306
|
] }),
|
|
2158
|
-
o > 0 && /* @__PURE__ */
|
|
2307
|
+
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
2308
|
o,
|
|
2160
2309
|
" error",
|
|
2161
2310
|
o > 1 ? "s" : ""
|
|
2162
2311
|
] }),
|
|
2163
|
-
|
|
2164
|
-
|
|
2312
|
+
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: [
|
|
2313
|
+
f,
|
|
2165
2314
|
" warning",
|
|
2166
|
-
|
|
2315
|
+
f > 1 ? "s" : ""
|
|
2167
2316
|
] }),
|
|
2168
2317
|
r && /* @__PURE__ */ t("span", { className: "text-xs text-white/40 animate-pulse", children: "Loading..." })
|
|
2169
2318
|
] }),
|
|
2170
|
-
c ? /* @__PURE__ */ t(
|
|
2319
|
+
c ? /* @__PURE__ */ t(ye, { className: "w-4 h-4 text-white/40" }) : /* @__PURE__ */ t(We, { className: "w-4 h-4 text-white/40" })
|
|
2171
2320
|
]
|
|
2172
2321
|
}
|
|
2173
2322
|
),
|
|
@@ -2175,22 +2324,22 @@ function Dn({
|
|
|
2175
2324
|
"div",
|
|
2176
2325
|
{
|
|
2177
2326
|
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,
|
|
2327
|
+
style: { maxHeight: i },
|
|
2328
|
+
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(Dn, { log: d }, `${d.timestamp}-${x}`))
|
|
2180
2329
|
}
|
|
2181
2330
|
)
|
|
2182
2331
|
]
|
|
2183
2332
|
}
|
|
2184
2333
|
);
|
|
2185
2334
|
}
|
|
2186
|
-
var Ae =
|
|
2187
|
-
function
|
|
2335
|
+
var Ae = Je(void 0), Wn = "ash-ui-theme";
|
|
2336
|
+
function Lr({
|
|
2188
2337
|
children: e,
|
|
2189
2338
|
defaultTheme: n,
|
|
2190
|
-
storageKey: r =
|
|
2339
|
+
storageKey: r = Wn,
|
|
2191
2340
|
listenToSystemChanges: s = !0
|
|
2192
2341
|
}) {
|
|
2193
|
-
const [
|
|
2342
|
+
const [i, l] = N(() => {
|
|
2194
2343
|
if (typeof window < "u") {
|
|
2195
2344
|
const d = localStorage.getItem(r);
|
|
2196
2345
|
if (d === "dark" || d === "light")
|
|
@@ -2200,33 +2349,33 @@ function Ir({
|
|
|
2200
2349
|
}
|
|
2201
2350
|
return n ?? "light";
|
|
2202
2351
|
}), [c, h] = N(!1);
|
|
2203
|
-
|
|
2352
|
+
z(() => {
|
|
2204
2353
|
h(!0);
|
|
2205
|
-
}, []),
|
|
2354
|
+
}, []), z(() => {
|
|
2206
2355
|
if (!c) return;
|
|
2207
2356
|
const d = document.documentElement;
|
|
2208
|
-
|
|
2209
|
-
}, [
|
|
2357
|
+
i === "dark" ? d.classList.add("dark") : d.classList.remove("dark"), localStorage.setItem(r, i);
|
|
2358
|
+
}, [i, c, r]), z(() => {
|
|
2210
2359
|
if (!s || typeof window > "u") return;
|
|
2211
|
-
const d = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
2212
|
-
localStorage.getItem(r) || l(
|
|
2360
|
+
const d = window.matchMedia("(prefers-color-scheme: dark)"), x = (p) => {
|
|
2361
|
+
localStorage.getItem(r) || l(p.matches ? "dark" : "light");
|
|
2213
2362
|
};
|
|
2214
|
-
return d.addEventListener("change",
|
|
2363
|
+
return d.addEventListener("change", x), () => d.removeEventListener("change", x);
|
|
2215
2364
|
}, [r, s]);
|
|
2216
|
-
const o =
|
|
2365
|
+
const o = P(() => {
|
|
2217
2366
|
l((d) => d === "light" ? "dark" : "light");
|
|
2218
|
-
}, []),
|
|
2367
|
+
}, []), f = P((d) => {
|
|
2219
2368
|
l(d);
|
|
2220
2369
|
}, []);
|
|
2221
|
-
return c ? /* @__PURE__ */ t(Ae.Provider, { value: { theme:
|
|
2370
|
+
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
2371
|
}
|
|
2223
|
-
function
|
|
2224
|
-
const e =
|
|
2372
|
+
function $r() {
|
|
2373
|
+
const e = Ue(Ae);
|
|
2225
2374
|
if (e === void 0)
|
|
2226
2375
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
2227
2376
|
return e;
|
|
2228
2377
|
}
|
|
2229
|
-
var
|
|
2378
|
+
var Bn = {
|
|
2230
2379
|
slideUp: `
|
|
2231
2380
|
@keyframes ash-slide-up {
|
|
2232
2381
|
from { opacity: 0; transform: translateY(20px); }
|
|
@@ -2264,33 +2413,33 @@ var Wn = {
|
|
|
2264
2413
|
}
|
|
2265
2414
|
`
|
|
2266
2415
|
};
|
|
2267
|
-
Object.values(
|
|
2416
|
+
Object.values(Bn).join(`
|
|
2268
2417
|
`);
|
|
2269
2418
|
function On({
|
|
2270
2419
|
messages: e,
|
|
2271
2420
|
loading: n,
|
|
2272
2421
|
streamingContent: r
|
|
2273
2422
|
}) {
|
|
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__ */
|
|
2423
|
+
const s = G(null), i = G(null);
|
|
2424
|
+
return z(() => {
|
|
2425
|
+
i.current && i.current.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
2426
|
+
}, [e, r, n]), /* @__PURE__ */ a("div", { ref: s, className: "flex-1 overflow-y-auto p-4 space-y-4", children: [
|
|
2427
|
+
e.map((l) => /* @__PURE__ */ t(zn, { message: l }, l.id)),
|
|
2428
|
+
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
2429
|
/* @__PURE__ */ t("div", { className: "text-xs text-[#ccff00] mb-2 font-medium", children: "Assistant" }),
|
|
2281
2430
|
/* @__PURE__ */ t("div", { className: "message-content prose prose-sm prose-invert max-w-none whitespace-pre-wrap", children: r })
|
|
2282
2431
|
] }) }),
|
|
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__ */
|
|
2432
|
+
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
2433
|
/* @__PURE__ */ t("span", { className: "w-2 h-2 rounded-full bg-[#ccff00] animate-pulse" }),
|
|
2285
2434
|
/* @__PURE__ */ t("span", { className: "w-2 h-2 rounded-full bg-[#ccff00] animate-pulse delay-100" }),
|
|
2286
2435
|
/* @__PURE__ */ t("span", { className: "w-2 h-2 rounded-full bg-[#ccff00] animate-pulse delay-200" })
|
|
2287
2436
|
] }) }) }),
|
|
2288
|
-
/* @__PURE__ */ t("div", { ref:
|
|
2437
|
+
/* @__PURE__ */ t("div", { ref: i })
|
|
2289
2438
|
] });
|
|
2290
2439
|
}
|
|
2291
|
-
function
|
|
2440
|
+
function zn({ message: e }) {
|
|
2292
2441
|
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__ */
|
|
2442
|
+
return /* @__PURE__ */ t("div", { className: `flex ${n ? "justify-end" : "justify-start"} animate-fade-in`, children: /* @__PURE__ */ a(
|
|
2294
2443
|
"div",
|
|
2295
2444
|
{
|
|
2296
2445
|
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 +2451,173 @@ function Bn({ message: e }) {
|
|
|
2302
2451
|
children: e.role.charAt(0).toUpperCase() + e.role.slice(1)
|
|
2303
2452
|
}
|
|
2304
2453
|
),
|
|
2305
|
-
/* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((
|
|
2454
|
+
/* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((i, l) => /* @__PURE__ */ t(Fn, { block: i, isUser: n }, l)) }),
|
|
2306
2455
|
/* @__PURE__ */ t("div", { className: `text-xs mt-3 ${n ? "text-black/40" : "text-white/40"}`, children: new Date(e.createdAt).toLocaleTimeString() })
|
|
2307
2456
|
]
|
|
2308
2457
|
}
|
|
2309
2458
|
) });
|
|
2310
2459
|
}
|
|
2311
|
-
function
|
|
2460
|
+
function Fn({
|
|
2312
2461
|
block: e,
|
|
2313
2462
|
isUser: n
|
|
2314
2463
|
}) {
|
|
2315
|
-
return e.type === "text" && e.text ? /* @__PURE__ */ t("p", { className: "whitespace-pre-wrap", children: e.text }) : e.type === "tool_use" ? /* @__PURE__ */
|
|
2316
|
-
/* @__PURE__ */
|
|
2464
|
+
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: [
|
|
2465
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-[#ccff00] mb-2 font-medium flex items-center gap-2", children: [
|
|
2317
2466
|
/* @__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
2467
|
"Tool: ",
|
|
2319
2468
|
e.name
|
|
2320
2469
|
] }),
|
|
2321
2470
|
/* @__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__ */
|
|
2471
|
+
] }) : e.type === "tool_result" ? /* @__PURE__ */ a("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-xl p-3 my-2", children: [
|
|
2472
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-emerald-400 mb-2 font-medium flex items-center gap-2", children: [
|
|
2324
2473
|
/* @__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
2474
|
"Tool Result"
|
|
2326
2475
|
] }),
|
|
2327
2476
|
/* @__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
2477
|
] }) : null;
|
|
2329
2478
|
}
|
|
2330
|
-
const
|
|
2479
|
+
const Pn = 5e3;
|
|
2331
2480
|
function Ve(e) {
|
|
2332
2481
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
2333
2482
|
}
|
|
2334
|
-
function
|
|
2483
|
+
function Gn({
|
|
2335
2484
|
onSend: e,
|
|
2336
2485
|
disabled: n,
|
|
2337
2486
|
loading: r,
|
|
2338
2487
|
placeholder: s = "Type your message...",
|
|
2339
|
-
queue:
|
|
2488
|
+
queue: i = [],
|
|
2340
2489
|
onCancelQueued: l,
|
|
2341
2490
|
sessionContext: c = "",
|
|
2342
2491
|
onSessionContextChange: h,
|
|
2343
2492
|
envVars: o = {},
|
|
2344
|
-
onEnvVarsChange:
|
|
2493
|
+
onEnvVarsChange: f,
|
|
2345
2494
|
enableFileUpload: d = !0,
|
|
2346
|
-
maxFileSize:
|
|
2495
|
+
maxFileSize: x = 100 * 1024 * 1024,
|
|
2347
2496
|
// 100MB
|
|
2348
|
-
maxFiles:
|
|
2497
|
+
maxFiles: p = 10,
|
|
2349
2498
|
onStop: v,
|
|
2350
|
-
canStop:
|
|
2351
|
-
enableLongTextConversion:
|
|
2352
|
-
longTextThreshold:
|
|
2499
|
+
canStop: E = !1,
|
|
2500
|
+
enableLongTextConversion: D = !0,
|
|
2501
|
+
longTextThreshold: R = Pn
|
|
2353
2502
|
}) {
|
|
2354
|
-
const [
|
|
2355
|
-
const
|
|
2356
|
-
let
|
|
2357
|
-
for (let C = 0; C <
|
|
2358
|
-
|
|
2359
|
-
return btoa(
|
|
2360
|
-
}, []),
|
|
2361
|
-
if (!
|
|
2503
|
+
const [_, Q] = N(""), [T, F] = N(!1), [A, j] = N(!1), [ie, X] = N(""), [W, H] = N(""), [k, B] = N([]), [ee, de] = N(!1), [te, Z] = N(null), [pe, fe] = N(/* @__PURE__ */ new Map()), we = G(0), ue = G(null), Ne = G(null), xe = G(null), ve = P((u) => {
|
|
2504
|
+
const I = new TextEncoder().encode(u);
|
|
2505
|
+
let g = "";
|
|
2506
|
+
for (let C = 0; C < I.length; C++)
|
|
2507
|
+
g += String.fromCharCode(I[C]);
|
|
2508
|
+
return btoa(g);
|
|
2509
|
+
}, []), V = P((u) => {
|
|
2510
|
+
if (!D || !d) return;
|
|
2362
2511
|
const b = u.clipboardData.getData("text/plain");
|
|
2363
|
-
if (b.length >
|
|
2364
|
-
if (u.preventDefault(),
|
|
2365
|
-
console.warn(`Cannot convert text to attachment: maximum ${
|
|
2512
|
+
if (b.length > R) {
|
|
2513
|
+
if (u.preventDefault(), k.length >= p) {
|
|
2514
|
+
console.warn(`Cannot convert text to attachment: maximum ${p} files reached`);
|
|
2366
2515
|
return;
|
|
2367
2516
|
}
|
|
2368
|
-
const
|
|
2517
|
+
const I = b.split(`
|
|
2369
2518
|
`).length;
|
|
2370
|
-
|
|
2371
|
-
const
|
|
2519
|
+
we.current += 1;
|
|
2520
|
+
const g = we.current, C = `pasted-text-${g}-${Date.now()}.txt`, re = ve(b), st = new TextEncoder().encode(b).length, at = {
|
|
2372
2521
|
filename: C,
|
|
2373
|
-
content:
|
|
2522
|
+
content: re,
|
|
2374
2523
|
mimeType: "text/plain",
|
|
2375
|
-
size:
|
|
2524
|
+
size: st
|
|
2376
2525
|
};
|
|
2377
|
-
|
|
2378
|
-
const
|
|
2379
|
-
return
|
|
2380
|
-
}),
|
|
2526
|
+
fe((Le) => {
|
|
2527
|
+
const Ge = new Map(Le);
|
|
2528
|
+
return Ge.set(C, { number: g, lineCount: I }), Ge;
|
|
2529
|
+
}), B((Le) => [...Le, at]), Z({
|
|
2381
2530
|
originalLength: b.length,
|
|
2382
2531
|
filename: C,
|
|
2383
2532
|
preview: b.slice(0, 100) + (b.length > 100 ? "..." : ""),
|
|
2384
|
-
lineCount:
|
|
2533
|
+
lineCount: I
|
|
2385
2534
|
}), setTimeout(() => {
|
|
2386
|
-
|
|
2535
|
+
Z(null);
|
|
2387
2536
|
}, 5e3);
|
|
2388
2537
|
}
|
|
2389
|
-
}, [
|
|
2390
|
-
const u =
|
|
2391
|
-
(u ||
|
|
2538
|
+
}, [D, d, R, k.length, p, ve]), w = () => {
|
|
2539
|
+
const u = _.trim();
|
|
2540
|
+
(u || k.length > 0) && !n && (e(u || "(files attached)", k.length > 0 ? k : void 0), Q(""), B([]), fe(/* @__PURE__ */ new Map()), ue.current && (ue.current.style.height = "auto"));
|
|
2392
2541
|
}, y = (u) => {
|
|
2393
|
-
u.key === "Enter" && !u.shiftKey && (u.preventDefault(),
|
|
2394
|
-
},
|
|
2395
|
-
const u =
|
|
2542
|
+
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), w());
|
|
2543
|
+
}, M = () => {
|
|
2544
|
+
const u = ue.current;
|
|
2396
2545
|
u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 200)}px`);
|
|
2397
|
-
},
|
|
2546
|
+
}, O = async (u) => {
|
|
2398
2547
|
if (!u) return;
|
|
2399
|
-
const b = [],
|
|
2400
|
-
for (let
|
|
2401
|
-
const C = u[
|
|
2402
|
-
if (C.size >
|
|
2403
|
-
console.warn(`File ${C.name} exceeds maximum size of ${Ve(
|
|
2548
|
+
const b = [], I = k.length;
|
|
2549
|
+
for (let g = 0; g < u.length && I + b.length < p; g++) {
|
|
2550
|
+
const C = u[g];
|
|
2551
|
+
if (C.size > x) {
|
|
2552
|
+
console.warn(`File ${C.name} exceeds maximum size of ${Ve(x)}`);
|
|
2404
2553
|
continue;
|
|
2405
2554
|
}
|
|
2406
2555
|
try {
|
|
2407
|
-
const
|
|
2556
|
+
const re = await ne(C);
|
|
2408
2557
|
b.push({
|
|
2409
2558
|
filename: C.name,
|
|
2410
|
-
content:
|
|
2559
|
+
content: re,
|
|
2411
2560
|
mimeType: C.type || "application/octet-stream",
|
|
2412
2561
|
size: C.size
|
|
2413
2562
|
});
|
|
2414
|
-
} catch (
|
|
2415
|
-
console.error(`Failed to read file ${C.name}:`,
|
|
2563
|
+
} catch (re) {
|
|
2564
|
+
console.error(`Failed to read file ${C.name}:`, re);
|
|
2416
2565
|
}
|
|
2417
2566
|
}
|
|
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
|
-
}, G = (u) => {
|
|
2434
|
-
const b = R[u];
|
|
2435
|
-
b && me.has(b.filename) && pe((E) => {
|
|
2436
|
-
const f = new Map(E);
|
|
2437
|
-
return f.delete(b.filename), f;
|
|
2438
|
-
}), K((E) => E.filter((f, C) => C !== u));
|
|
2439
|
-
}, J = a.length > 0, Ne = r ? "Sending..." : J ? `Queue (${a.length})` : "Send", ke = c.trim().length > 0, Ce = Object.keys(o).length > 0, Ee = !n && (k.trim() || R.length > 0), xe = () => {
|
|
2440
|
-
const u = ue.trim(), b = ye.trim();
|
|
2441
|
-
u && w && (w({ ...o, [u]: b }), ie(""), ae(""));
|
|
2567
|
+
b.length > 0 && B((g) => [...g, ...b]);
|
|
2568
|
+
}, ne = (u) => new Promise((b, I) => {
|
|
2569
|
+
const g = new FileReader();
|
|
2570
|
+
g.onload = () => {
|
|
2571
|
+
const re = g.result.split(",")[1];
|
|
2572
|
+
b(re || "");
|
|
2573
|
+
}, g.onerror = () => I(g.error), g.readAsDataURL(u);
|
|
2574
|
+
}), le = (u) => {
|
|
2575
|
+
O(u.target.files), xe.current && (xe.current.value = "");
|
|
2576
|
+
}, he = (u) => {
|
|
2577
|
+
u.preventDefault(), d && !n && de(!0);
|
|
2578
|
+
}, J = (u) => {
|
|
2579
|
+
u.preventDefault(), de(!1);
|
|
2580
|
+
}, q = (u) => {
|
|
2581
|
+
u.preventDefault(), de(!1), d && !n && O(u.dataTransfer.files);
|
|
2442
2582
|
}, U = (u) => {
|
|
2443
|
-
|
|
2583
|
+
const b = k[u];
|
|
2584
|
+
b && pe.has(b.filename) && fe((I) => {
|
|
2585
|
+
const g = new Map(I);
|
|
2586
|
+
return g.delete(b.filename), g;
|
|
2587
|
+
}), B((I) => I.filter((g, C) => C !== u));
|
|
2588
|
+
}, K = i.length > 0, ke = r ? "Sending..." : K ? `Queue (${i.length})` : "Send", Ce = c.trim().length > 0, _e = Object.keys(o).length > 0, Ie = !n && (_.trim() || k.length > 0), ge = () => {
|
|
2589
|
+
const u = ie.trim(), b = W.trim();
|
|
2590
|
+
u && f && (f({ ...o, [u]: b }), X(""), H(""));
|
|
2591
|
+
}, Y = (u) => {
|
|
2592
|
+
if (f) {
|
|
2444
2593
|
const b = { ...o };
|
|
2445
|
-
delete b[u],
|
|
2594
|
+
delete b[u], f(b);
|
|
2446
2595
|
}
|
|
2447
|
-
},
|
|
2448
|
-
u.key === "Enter" && (u.preventDefault(),
|
|
2596
|
+
}, oe = (u) => {
|
|
2597
|
+
u.key === "Enter" && (u.preventDefault(), ge());
|
|
2449
2598
|
};
|
|
2450
|
-
return /* @__PURE__ */
|
|
2599
|
+
return /* @__PURE__ */ a(
|
|
2451
2600
|
"div",
|
|
2452
2601
|
{
|
|
2453
|
-
className: `border-t border-white/10 p-3 sm:p-4 glass-panel relative ${
|
|
2454
|
-
onDragOver:
|
|
2455
|
-
onDragLeave:
|
|
2456
|
-
onDrop:
|
|
2602
|
+
className: `border-t border-white/10 p-3 sm:p-4 glass-panel relative ${ee ? "bg-[#ccff00]/5" : ""}`,
|
|
2603
|
+
onDragOver: he,
|
|
2604
|
+
onDragLeave: J,
|
|
2605
|
+
onDrop: q,
|
|
2457
2606
|
children: [
|
|
2458
|
-
|
|
2459
|
-
h && /* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2607
|
+
ee && 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" }) }),
|
|
2608
|
+
h && /* @__PURE__ */ a("div", { className: "mb-3", children: [
|
|
2609
|
+
/* @__PURE__ */ a(
|
|
2461
2610
|
"button",
|
|
2462
2611
|
{
|
|
2463
2612
|
type: "button",
|
|
2464
|
-
onClick: () =>
|
|
2613
|
+
onClick: () => F(!T),
|
|
2465
2614
|
className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
|
|
2466
2615
|
children: [
|
|
2467
2616
|
/* @__PURE__ */ t(
|
|
2468
2617
|
"svg",
|
|
2469
2618
|
{
|
|
2470
2619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2471
|
-
className: `h-3 w-3 transition-transform ${
|
|
2620
|
+
className: `h-3 w-3 transition-transform ${T ? "rotate-90" : ""}`,
|
|
2472
2621
|
viewBox: "0 0 20 20",
|
|
2473
2622
|
fill: "currentColor",
|
|
2474
2623
|
children: /* @__PURE__ */ t(
|
|
@@ -2482,19 +2631,19 @@ function Pn({
|
|
|
2482
2631
|
}
|
|
2483
2632
|
),
|
|
2484
2633
|
/* @__PURE__ */ t("span", { className: "uppercase tracking-wide", children: "Session Context" }),
|
|
2485
|
-
|
|
2634
|
+
Ce && !T && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: "Active" })
|
|
2486
2635
|
]
|
|
2487
2636
|
}
|
|
2488
2637
|
),
|
|
2489
|
-
|
|
2638
|
+
T && /* @__PURE__ */ a("div", { className: "mt-2", children: [
|
|
2490
2639
|
/* @__PURE__ */ t(
|
|
2491
2640
|
"textarea",
|
|
2492
2641
|
{
|
|
2493
|
-
ref:
|
|
2642
|
+
ref: Ne,
|
|
2494
2643
|
value: c,
|
|
2495
2644
|
onChange: (u) => h(u.target.value),
|
|
2496
2645
|
onInput: () => {
|
|
2497
|
-
const u =
|
|
2646
|
+
const u = Ne.current;
|
|
2498
2647
|
u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 150)}px`);
|
|
2499
2648
|
},
|
|
2500
2649
|
placeholder: "Add context that will be injected into every request (e.g., current page, user selection, etc.)",
|
|
@@ -2505,19 +2654,19 @@ function Pn({
|
|
|
2505
2654
|
/* @__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
2655
|
] })
|
|
2507
2656
|
] }),
|
|
2508
|
-
|
|
2509
|
-
/* @__PURE__ */
|
|
2657
|
+
f && /* @__PURE__ */ a("div", { className: "mb-3", children: [
|
|
2658
|
+
/* @__PURE__ */ a(
|
|
2510
2659
|
"button",
|
|
2511
2660
|
{
|
|
2512
2661
|
type: "button",
|
|
2513
|
-
onClick: () =>
|
|
2662
|
+
onClick: () => j(!A),
|
|
2514
2663
|
className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
|
|
2515
2664
|
children: [
|
|
2516
2665
|
/* @__PURE__ */ t(
|
|
2517
2666
|
"svg",
|
|
2518
2667
|
{
|
|
2519
2668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2520
|
-
className: `h-3 w-3 transition-transform ${
|
|
2669
|
+
className: `h-3 w-3 transition-transform ${A ? "rotate-90" : ""}`,
|
|
2521
2670
|
viewBox: "0 0 20 20",
|
|
2522
2671
|
fill: "currentColor",
|
|
2523
2672
|
children: /* @__PURE__ */ t(
|
|
@@ -2531,12 +2680,12 @@ function Pn({
|
|
|
2531
2680
|
}
|
|
2532
2681
|
),
|
|
2533
2682
|
/* @__PURE__ */ t("span", { className: "uppercase tracking-wide", children: "Environment Variables" }),
|
|
2534
|
-
|
|
2683
|
+
_e && !A && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: Object.keys(o).length })
|
|
2535
2684
|
]
|
|
2536
2685
|
}
|
|
2537
2686
|
),
|
|
2538
|
-
|
|
2539
|
-
Object.entries(o).map(([u, b]) => /* @__PURE__ */
|
|
2687
|
+
A && /* @__PURE__ */ a("div", { className: "mt-2 space-y-2", children: [
|
|
2688
|
+
Object.entries(o).map(([u, b]) => /* @__PURE__ */ a(
|
|
2540
2689
|
"div",
|
|
2541
2690
|
{
|
|
2542
2691
|
className: "flex items-center gap-2 bg-white/5 border border-white/10 rounded-xl px-3 py-2 text-sm",
|
|
@@ -2547,7 +2696,7 @@ function Pn({
|
|
|
2547
2696
|
/* @__PURE__ */ t(
|
|
2548
2697
|
"button",
|
|
2549
2698
|
{
|
|
2550
|
-
onClick: () =>
|
|
2699
|
+
onClick: () => Y(u),
|
|
2551
2700
|
className: "text-white/40 hover:text-red-400 transition-colors",
|
|
2552
2701
|
title: "Remove variable",
|
|
2553
2702
|
children: /* @__PURE__ */ t(
|
|
@@ -2573,14 +2722,14 @@ function Pn({
|
|
|
2573
2722
|
},
|
|
2574
2723
|
u
|
|
2575
2724
|
)),
|
|
2576
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2577
2726
|
/* @__PURE__ */ t(
|
|
2578
2727
|
"input",
|
|
2579
2728
|
{
|
|
2580
2729
|
type: "text",
|
|
2581
|
-
value:
|
|
2582
|
-
onChange: (u) =>
|
|
2583
|
-
onKeyDown:
|
|
2730
|
+
value: ie,
|
|
2731
|
+
onChange: (u) => X(u.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, "")),
|
|
2732
|
+
onKeyDown: oe,
|
|
2584
2733
|
placeholder: "KEY",
|
|
2585
2734
|
className: "input-glass text-sm font-mono flex-1 min-w-0 py-2"
|
|
2586
2735
|
}
|
|
@@ -2590,9 +2739,9 @@ function Pn({
|
|
|
2590
2739
|
"input",
|
|
2591
2740
|
{
|
|
2592
2741
|
type: "text",
|
|
2593
|
-
value:
|
|
2594
|
-
onChange: (u) =>
|
|
2595
|
-
onKeyDown:
|
|
2742
|
+
value: W,
|
|
2743
|
+
onChange: (u) => H(u.target.value),
|
|
2744
|
+
onKeyDown: oe,
|
|
2596
2745
|
placeholder: "value",
|
|
2597
2746
|
className: "input-glass text-sm font-mono flex-[2] min-w-0 py-2"
|
|
2598
2747
|
}
|
|
@@ -2600,8 +2749,8 @@ function Pn({
|
|
|
2600
2749
|
/* @__PURE__ */ t(
|
|
2601
2750
|
"button",
|
|
2602
2751
|
{
|
|
2603
|
-
onClick:
|
|
2604
|
-
disabled: !
|
|
2752
|
+
onClick: ge,
|
|
2753
|
+
disabled: !ie.trim(),
|
|
2605
2754
|
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
2755
|
children: "Add"
|
|
2607
2756
|
}
|
|
@@ -2610,8 +2759,8 @@ function Pn({
|
|
|
2610
2759
|
/* @__PURE__ */ t("p", { className: "text-xs text-white/40", children: "These environment variables will be available in the sandbox for new sessions." })
|
|
2611
2760
|
] })
|
|
2612
2761
|
] }),
|
|
2613
|
-
|
|
2614
|
-
/* @__PURE__ */
|
|
2762
|
+
te && /* @__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: [
|
|
2763
|
+
/* @__PURE__ */ a("div", { className: "flex items-start gap-2 min-w-0", children: [
|
|
2615
2764
|
/* @__PURE__ */ t(
|
|
2616
2765
|
"svg",
|
|
2617
2766
|
{
|
|
@@ -2631,21 +2780,21 @@ function Pn({
|
|
|
2631
2780
|
)
|
|
2632
2781
|
}
|
|
2633
2782
|
),
|
|
2634
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ a("div", { className: "min-w-0", children: [
|
|
2635
2784
|
/* @__PURE__ */ t("p", { className: "text-sm text-blue-200 font-medium", children: "Long text converted to attachment" }),
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
|
|
2785
|
+
/* @__PURE__ */ a("p", { className: "text-xs text-blue-300/70 mt-1", children: [
|
|
2786
|
+
te.originalLength.toLocaleString(),
|
|
2638
2787
|
" characters (",
|
|
2639
|
-
|
|
2788
|
+
te.lineCount,
|
|
2640
2789
|
" lines) saved as text attachment"
|
|
2641
2790
|
] }),
|
|
2642
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-white/50 mt-1 truncate font-mono", children:
|
|
2791
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-white/50 mt-1 truncate font-mono", children: te.preview })
|
|
2643
2792
|
] })
|
|
2644
2793
|
] }),
|
|
2645
2794
|
/* @__PURE__ */ t(
|
|
2646
2795
|
"button",
|
|
2647
2796
|
{
|
|
2648
|
-
onClick: () =>
|
|
2797
|
+
onClick: () => Z(null),
|
|
2649
2798
|
className: "text-blue-400/70 hover:text-blue-300 transition-colors shrink-0",
|
|
2650
2799
|
title: "Dismiss",
|
|
2651
2800
|
children: /* @__PURE__ */ t(
|
|
@@ -2668,20 +2817,20 @@ function Pn({
|
|
|
2668
2817
|
}
|
|
2669
2818
|
)
|
|
2670
2819
|
] }) }),
|
|
2671
|
-
|
|
2672
|
-
/* @__PURE__ */
|
|
2820
|
+
k.length > 0 && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
|
|
2821
|
+
/* @__PURE__ */ a("div", { className: "text-xs font-medium text-white/50 uppercase tracking-wide", children: [
|
|
2673
2822
|
"Attached Files (",
|
|
2674
|
-
|
|
2823
|
+
k.length,
|
|
2675
2824
|
")"
|
|
2676
2825
|
] }),
|
|
2677
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children:
|
|
2678
|
-
const
|
|
2679
|
-
return /* @__PURE__ */
|
|
2826
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: k.map((u, b) => {
|
|
2827
|
+
const I = pe.get(u.filename), g = !!I;
|
|
2828
|
+
return /* @__PURE__ */ a(
|
|
2680
2829
|
"div",
|
|
2681
2830
|
{
|
|
2682
|
-
className: `flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm ${
|
|
2831
|
+
className: `flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm ${g ? "bg-purple-500/10 border border-purple-500/30" : "bg-white/5 border border-white/10"}`,
|
|
2683
2832
|
children: [
|
|
2684
|
-
|
|
2833
|
+
g ? (
|
|
2685
2834
|
// Pasted text icon (document with lines)
|
|
2686
2835
|
/* @__PURE__ */ t(
|
|
2687
2836
|
"svg",
|
|
@@ -2724,21 +2873,21 @@ function Pn({
|
|
|
2724
2873
|
}
|
|
2725
2874
|
)
|
|
2726
2875
|
),
|
|
2727
|
-
|
|
2876
|
+
g ? /* @__PURE__ */ a("span", { className: "text-purple-200 font-mono", title: u.filename, children: [
|
|
2728
2877
|
"[Pasted text #",
|
|
2729
|
-
|
|
2878
|
+
I.number,
|
|
2730
2879
|
" +",
|
|
2731
|
-
|
|
2880
|
+
I.lineCount,
|
|
2732
2881
|
" lines]"
|
|
2733
|
-
] }) : /* @__PURE__ */
|
|
2882
|
+
] }) : /* @__PURE__ */ a(S, { children: [
|
|
2734
2883
|
/* @__PURE__ */ t("span", { className: "text-white/80 truncate max-w-[150px]", title: u.filename, children: u.filename }),
|
|
2735
2884
|
/* @__PURE__ */ t("span", { className: "text-white/40 text-xs", children: Ve(u.size) })
|
|
2736
2885
|
] }),
|
|
2737
2886
|
/* @__PURE__ */ t(
|
|
2738
2887
|
"button",
|
|
2739
2888
|
{
|
|
2740
|
-
onClick: () =>
|
|
2741
|
-
className: `hover:text-red-400 transition-colors ${
|
|
2889
|
+
onClick: () => U(b),
|
|
2890
|
+
className: `hover:text-red-400 transition-colors ${g ? "text-purple-400/70" : "text-white/40"}`,
|
|
2742
2891
|
title: "Remove file",
|
|
2743
2892
|
children: /* @__PURE__ */ t(
|
|
2744
2893
|
"svg",
|
|
@@ -2765,19 +2914,19 @@ function Pn({
|
|
|
2765
2914
|
);
|
|
2766
2915
|
}) })
|
|
2767
2916
|
] }),
|
|
2768
|
-
|
|
2769
|
-
/* @__PURE__ */
|
|
2917
|
+
K && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
|
|
2918
|
+
/* @__PURE__ */ a("div", { className: "text-xs font-medium text-white/50 uppercase tracking-wide", children: [
|
|
2770
2919
|
"Queued Messages (",
|
|
2771
|
-
|
|
2920
|
+
i.length,
|
|
2772
2921
|
")"
|
|
2773
2922
|
] }),
|
|
2774
|
-
/* @__PURE__ */ t("div", { className: "max-h-32 overflow-y-auto space-y-1", children:
|
|
2923
|
+
/* @__PURE__ */ t("div", { className: "max-h-32 overflow-y-auto space-y-1", children: i.map((u, b) => /* @__PURE__ */ a(
|
|
2775
2924
|
"div",
|
|
2776
2925
|
{
|
|
2777
2926
|
className: "flex items-center justify-between bg-yellow-500/10 border border-yellow-500/20 rounded-xl px-3 py-2 text-sm",
|
|
2778
2927
|
children: [
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
2929
|
+
/* @__PURE__ */ a("span", { className: "text-yellow-400 font-medium shrink-0", children: [
|
|
2781
2930
|
"#",
|
|
2782
2931
|
b + 1
|
|
2783
2932
|
] }),
|
|
@@ -2813,17 +2962,17 @@ function Pn({
|
|
|
2813
2962
|
u.id
|
|
2814
2963
|
)) })
|
|
2815
2964
|
] }),
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
d && /* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ a("div", { className: "flex gap-2 items-end", children: [
|
|
2966
|
+
d && /* @__PURE__ */ a(S, { children: [
|
|
2818
2967
|
/* @__PURE__ */ t(
|
|
2819
2968
|
"input",
|
|
2820
2969
|
{
|
|
2821
|
-
ref:
|
|
2970
|
+
ref: xe,
|
|
2822
2971
|
type: "file",
|
|
2823
2972
|
multiple: !0,
|
|
2824
|
-
onChange:
|
|
2973
|
+
onChange: le,
|
|
2825
2974
|
className: "hidden",
|
|
2826
|
-
disabled: n ||
|
|
2975
|
+
disabled: n || k.length >= p
|
|
2827
2976
|
}
|
|
2828
2977
|
),
|
|
2829
2978
|
/* @__PURE__ */ t(
|
|
@@ -2832,11 +2981,11 @@ function Pn({
|
|
|
2832
2981
|
type: "button",
|
|
2833
2982
|
onClick: () => {
|
|
2834
2983
|
var u;
|
|
2835
|
-
return (u =
|
|
2984
|
+
return (u = xe.current) == null ? void 0 : u.click();
|
|
2836
2985
|
},
|
|
2837
|
-
disabled: n ||
|
|
2986
|
+
disabled: n || k.length >= p,
|
|
2838
2987
|
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:
|
|
2988
|
+
title: k.length >= p ? `Maximum ${p} files` : "Attach files",
|
|
2840
2989
|
children: /* @__PURE__ */ t(
|
|
2841
2990
|
"svg",
|
|
2842
2991
|
{
|
|
@@ -2862,19 +3011,19 @@ function Pn({
|
|
|
2862
3011
|
/* @__PURE__ */ t(
|
|
2863
3012
|
"textarea",
|
|
2864
3013
|
{
|
|
2865
|
-
ref:
|
|
2866
|
-
value:
|
|
2867
|
-
onChange: (u) =>
|
|
3014
|
+
ref: ue,
|
|
3015
|
+
value: _,
|
|
3016
|
+
onChange: (u) => Q(u.target.value),
|
|
2868
3017
|
onKeyDown: y,
|
|
2869
|
-
onInput:
|
|
2870
|
-
onPaste:
|
|
3018
|
+
onInput: M,
|
|
3019
|
+
onPaste: V,
|
|
2871
3020
|
placeholder: s,
|
|
2872
3021
|
disabled: n,
|
|
2873
3022
|
className: "input-glass flex-1 min-w-0 resize-none py-2.5 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2874
3023
|
rows: 1
|
|
2875
3024
|
}
|
|
2876
3025
|
),
|
|
2877
|
-
r &&
|
|
3026
|
+
r && E && v ? /* @__PURE__ */ a(
|
|
2878
3027
|
"button",
|
|
2879
3028
|
{
|
|
2880
3029
|
onClick: v,
|
|
@@ -2885,313 +3034,313 @@ function Pn({
|
|
|
2885
3034
|
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: "Stop" })
|
|
2886
3035
|
]
|
|
2887
3036
|
}
|
|
2888
|
-
) : /* @__PURE__ */
|
|
3037
|
+
) : /* @__PURE__ */ a(
|
|
2889
3038
|
"button",
|
|
2890
3039
|
{
|
|
2891
|
-
onClick:
|
|
2892
|
-
disabled: !
|
|
2893
|
-
className: `shrink-0 px-3 sm:px-5 py-2.5 rounded-xl font-medium transition-all duration-300 disabled:opacity-30 disabled:cursor-not-allowed ${
|
|
3040
|
+
onClick: w,
|
|
3041
|
+
disabled: !Ie,
|
|
3042
|
+
className: `shrink-0 px-3 sm:px-5 py-2.5 rounded-xl font-medium transition-all duration-300 disabled:opacity-30 disabled:cursor-not-allowed ${K ? "bg-yellow-500/80 hover:bg-yellow-500 text-black border border-yellow-400/30" : "bg-[#ccff00] hover:bg-[#b8e600] text-black shadow-[0_0_20px_rgba(204,255,0,0.3)] hover:shadow-[0_0_30px_rgba(204,255,0,0.5)]"}`,
|
|
2894
3043
|
children: [
|
|
2895
|
-
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children:
|
|
2896
|
-
/* @__PURE__ */ t("span", { className: "sm:hidden", children: r ? "..." :
|
|
3044
|
+
/* @__PURE__ */ t("span", { className: "hidden sm:inline", children: ke }),
|
|
3045
|
+
/* @__PURE__ */ t("span", { className: "sm:hidden", children: r ? "..." : K ? `+${i.length}` : "→" })
|
|
2897
3046
|
]
|
|
2898
3047
|
}
|
|
2899
3048
|
)
|
|
2900
3049
|
] }),
|
|
2901
|
-
/* @__PURE__ */
|
|
3050
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-white/40 mt-2 hidden sm:block", children: [
|
|
2902
3051
|
"Press Enter to ",
|
|
2903
|
-
r ||
|
|
3052
|
+
r || K ? "queue" : "send",
|
|
2904
3053
|
", Shift+Enter for new line",
|
|
2905
3054
|
d && " • Drag & drop files or click the attach button",
|
|
2906
|
-
|
|
3055
|
+
D && d && ` • Long text (>${R.toLocaleString()} chars) auto-converts to attachment`
|
|
2907
3056
|
] })
|
|
2908
3057
|
]
|
|
2909
3058
|
}
|
|
2910
3059
|
);
|
|
2911
3060
|
}
|
|
2912
|
-
function
|
|
3061
|
+
function Rr({
|
|
2913
3062
|
apiBasePath: e,
|
|
2914
3063
|
initialAgent: n,
|
|
2915
3064
|
initialSessionId: r,
|
|
2916
3065
|
onSessionChange: s,
|
|
2917
|
-
className:
|
|
3066
|
+
className: i = "",
|
|
2918
3067
|
useBackendQueue: l = !1
|
|
2919
3068
|
}) {
|
|
2920
|
-
const [c, h] = N([]), [o,
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
}, [
|
|
2924
|
-
|
|
2925
|
-
}, [
|
|
2926
|
-
fetch(`${e}/agents`).then((
|
|
2927
|
-
const y =
|
|
2928
|
-
h(y), !o && y.length > 0 &&
|
|
2929
|
-
}).catch((
|
|
2930
|
-
console.error("Failed to fetch agents:",
|
|
3069
|
+
const [c, h] = N([]), [o, f] = N(n || null), [d, x] = N(r || null), [p, v] = N([]), [E, D] = N(!1), [R, _] = N(""), [Q, T] = N(null), [F, A] = N([]), [j, ie] = N([]), [X, W] = N(""), [H, k] = N({}), B = G(!1), ee = G(X), de = G(H), te = G(null);
|
|
3070
|
+
z(() => {
|
|
3071
|
+
ee.current = X;
|
|
3072
|
+
}, [X]), z(() => {
|
|
3073
|
+
de.current = H;
|
|
3074
|
+
}, [H]), z(() => {
|
|
3075
|
+
fetch(`${e}/agents`).then((w) => w.json()).then((w) => {
|
|
3076
|
+
const y = w.agents || [];
|
|
3077
|
+
h(y), !o && y.length > 0 && f(y[0].slug || y[0].name);
|
|
3078
|
+
}).catch((w) => {
|
|
3079
|
+
console.error("Failed to fetch agents:", w), T("Failed to load agents");
|
|
2931
3080
|
});
|
|
2932
|
-
}, [e]),
|
|
2933
|
-
d &&
|
|
3081
|
+
}, [e]), z(() => {
|
|
3082
|
+
d && pe(d);
|
|
2934
3083
|
}, [d]);
|
|
2935
|
-
const
|
|
3084
|
+
const Z = P(async () => {
|
|
2936
3085
|
if (!(!l || !o))
|
|
2937
3086
|
try {
|
|
2938
|
-
const
|
|
3087
|
+
const w = await fetch(
|
|
2939
3088
|
`${e}/queue/status/${o}?sessionId=${d || ""}`
|
|
2940
3089
|
);
|
|
2941
|
-
if (!
|
|
2942
|
-
const y = await
|
|
2943
|
-
|
|
2944
|
-
} catch (
|
|
2945
|
-
console.error("Failed to fetch queue status:",
|
|
3090
|
+
if (!w.ok) return;
|
|
3091
|
+
const y = await w.json();
|
|
3092
|
+
D(y.isProcessing), ie(y.nextItems || []), !y.isProcessing && E && (d && await pe(d), _(""));
|
|
3093
|
+
} catch (w) {
|
|
3094
|
+
console.error("Failed to fetch queue status:", w);
|
|
2946
3095
|
}
|
|
2947
|
-
}, [l, o, d, e,
|
|
2948
|
-
|
|
3096
|
+
}, [l, o, d, e, E]);
|
|
3097
|
+
z(() => {
|
|
2949
3098
|
if (l)
|
|
2950
|
-
return
|
|
2951
|
-
|
|
3099
|
+
return te.current = setInterval(Z, 1e3), () => {
|
|
3100
|
+
te.current && (clearInterval(te.current), te.current = null);
|
|
2952
3101
|
};
|
|
2953
|
-
}, [l,
|
|
3102
|
+
}, [l, Z]), z(() => {
|
|
2954
3103
|
s == null || s(d);
|
|
2955
3104
|
}, [d, s]);
|
|
2956
|
-
const
|
|
3105
|
+
const pe = async (w) => {
|
|
2957
3106
|
try {
|
|
2958
|
-
const y = await fetch(`${e}/sessions/${
|
|
3107
|
+
const y = await fetch(`${e}/sessions/${w}/messages`);
|
|
2959
3108
|
if (!y.ok) throw new Error("Failed to fetch messages");
|
|
2960
|
-
const
|
|
2961
|
-
v(
|
|
3109
|
+
const M = await y.json();
|
|
3110
|
+
v(M.items || M.messages || []);
|
|
2962
3111
|
} catch (y) {
|
|
2963
|
-
|
|
3112
|
+
T(y instanceof Error ? y.message : "Failed to fetch messages");
|
|
2964
3113
|
}
|
|
2965
|
-
},
|
|
2966
|
-
var
|
|
3114
|
+
}, fe = P(async (w, y, M) => {
|
|
3115
|
+
var le, he;
|
|
2967
3116
|
if (!o) return y;
|
|
2968
|
-
|
|
2969
|
-
const
|
|
3117
|
+
D(!0), T(null), _("");
|
|
3118
|
+
const O = {
|
|
2970
3119
|
id: `temp-${Date.now()}`,
|
|
2971
3120
|
role: "user",
|
|
2972
|
-
content: [{ type: "text", text:
|
|
3121
|
+
content: [{ type: "text", text: w }],
|
|
2973
3122
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2974
3123
|
};
|
|
2975
|
-
v((
|
|
2976
|
-
let
|
|
3124
|
+
v((J) => [...J, O]);
|
|
3125
|
+
let ne = y;
|
|
2977
3126
|
try {
|
|
2978
|
-
const
|
|
2979
|
-
filename:
|
|
2980
|
-
content:
|
|
2981
|
-
mimeType:
|
|
2982
|
-
})),
|
|
2983
|
-
|
|
2984
|
-
const
|
|
2985
|
-
!y && Object.keys(
|
|
2986
|
-
const
|
|
3127
|
+
const J = y ? `${e}/sessions/${y}/send` : `${e}/agents/${o}/run`, q = M == null ? void 0 : M.map((oe) => ({
|
|
3128
|
+
filename: oe.filename,
|
|
3129
|
+
content: oe.content,
|
|
3130
|
+
mimeType: oe.mimeType
|
|
3131
|
+
})), U = { prompt: w }, K = ee.current.trim();
|
|
3132
|
+
K && (U.sessionContext = K);
|
|
3133
|
+
const ke = de.current;
|
|
3134
|
+
!y && Object.keys(ke).length > 0 && (U.envVars = ke), q && q.length > 0 && (U.files = q);
|
|
3135
|
+
const Ce = await fetch(J, {
|
|
2987
3136
|
method: "POST",
|
|
2988
3137
|
headers: { "Content-Type": "application/json" },
|
|
2989
|
-
body: JSON.stringify(
|
|
3138
|
+
body: JSON.stringify(U)
|
|
2990
3139
|
});
|
|
2991
|
-
if (!
|
|
2992
|
-
const
|
|
2993
|
-
let
|
|
2994
|
-
for (;
|
|
2995
|
-
const { done:
|
|
2996
|
-
if (
|
|
2997
|
-
|
|
2998
|
-
const u =
|
|
3140
|
+
if (!Ce.ok) throw new Error("Failed to send message");
|
|
3141
|
+
const _e = (le = Ce.body) == null ? void 0 : le.getReader(), Ie = new TextDecoder();
|
|
3142
|
+
let ge = "", Y = "";
|
|
3143
|
+
for (; _e; ) {
|
|
3144
|
+
const { done: oe, value: Pe } = await _e.read();
|
|
3145
|
+
if (oe) break;
|
|
3146
|
+
ge += Ie.decode(Pe, { stream: !0 });
|
|
3147
|
+
const u = ge.split(`
|
|
2999
3148
|
`);
|
|
3000
|
-
|
|
3149
|
+
ge = u.pop() || "";
|
|
3001
3150
|
for (const b of u)
|
|
3002
3151
|
if (b.startsWith("data:")) {
|
|
3003
|
-
const
|
|
3004
|
-
if (!
|
|
3152
|
+
const I = b.slice(5).trim();
|
|
3153
|
+
if (!I) continue;
|
|
3005
3154
|
try {
|
|
3006
|
-
const
|
|
3007
|
-
if (
|
|
3008
|
-
|
|
3009
|
-
else if (
|
|
3010
|
-
|
|
3011
|
-
else if (
|
|
3012
|
-
|
|
3013
|
-
else if (
|
|
3014
|
-
const C = (
|
|
3015
|
-
(
|
|
3155
|
+
const g = JSON.parse(I);
|
|
3156
|
+
if (g.type === "session_start" && g.sessionId)
|
|
3157
|
+
ne = g.sessionId, x(g.sessionId);
|
|
3158
|
+
else if (g.type === "text_delta" && g.delta)
|
|
3159
|
+
Y += g.delta, _(Y);
|
|
3160
|
+
else if (g.type === "thinking_delta" && g.delta)
|
|
3161
|
+
Y += g.delta, _(Y);
|
|
3162
|
+
else if (g.type === "message" && g.message) {
|
|
3163
|
+
const C = (he = g.message.content) == null ? void 0 : he.find(
|
|
3164
|
+
(re) => re.type === "text"
|
|
3016
3165
|
);
|
|
3017
|
-
C != null && C.text && (
|
|
3018
|
-
} else if (
|
|
3019
|
-
|
|
3166
|
+
C != null && C.text && (Y || (Y = C.text, _(Y)));
|
|
3167
|
+
} else if (g.type === "tool_use")
|
|
3168
|
+
Y += `
|
|
3020
3169
|
|
|
3021
|
-
🔧 Using tool: ${
|
|
3022
|
-
`,
|
|
3023
|
-
else if (
|
|
3024
|
-
const C = y ||
|
|
3025
|
-
C && await
|
|
3026
|
-
} else
|
|
3170
|
+
🔧 Using tool: ${g.name}
|
|
3171
|
+
`, _(Y);
|
|
3172
|
+
else if (g.type === "session_end") {
|
|
3173
|
+
const C = y || g.sessionId;
|
|
3174
|
+
C && await pe(C), _("");
|
|
3175
|
+
} else g.type === "error" && T(g.error || "Unknown error");
|
|
3027
3176
|
} catch {
|
|
3028
3177
|
}
|
|
3029
3178
|
}
|
|
3030
3179
|
}
|
|
3031
|
-
} catch (
|
|
3032
|
-
|
|
3180
|
+
} catch (J) {
|
|
3181
|
+
T(J instanceof Error ? J.message : "Unknown error"), v((q) => q.filter((U) => U.id !== O.id));
|
|
3033
3182
|
} finally {
|
|
3034
|
-
|
|
3183
|
+
D(!1);
|
|
3035
3184
|
}
|
|
3036
|
-
return
|
|
3037
|
-
}, [e, o]),
|
|
3038
|
-
if (
|
|
3039
|
-
|
|
3040
|
-
let
|
|
3185
|
+
return ne;
|
|
3186
|
+
}, [e, o]), we = P(async () => {
|
|
3187
|
+
if (B.current) return;
|
|
3188
|
+
B.current = !0;
|
|
3189
|
+
let w = d;
|
|
3041
3190
|
for (; ; ) {
|
|
3042
3191
|
let y;
|
|
3043
|
-
if (
|
|
3044
|
-
|
|
3192
|
+
if (A((M) => M.length === 0 ? M : (y = M[0], M.slice(1))), await new Promise((M) => setTimeout(M, 0)), !y) break;
|
|
3193
|
+
w = await fe(y.text, w, y.files);
|
|
3045
3194
|
}
|
|
3046
|
-
|
|
3047
|
-
}, [d,
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
}, [
|
|
3051
|
-
const
|
|
3195
|
+
B.current = !1;
|
|
3196
|
+
}, [d, fe]);
|
|
3197
|
+
z(() => {
|
|
3198
|
+
F.length > 0 && !B.current && we();
|
|
3199
|
+
}, [F, we]);
|
|
3200
|
+
const ue = P(async (w, y) => {
|
|
3052
3201
|
if (!o) return;
|
|
3053
|
-
const
|
|
3202
|
+
const M = {
|
|
3054
3203
|
id: `temp-${Date.now()}`,
|
|
3055
3204
|
role: "user",
|
|
3056
|
-
content: [{ type: "text", text:
|
|
3205
|
+
content: [{ type: "text", text: w }],
|
|
3057
3206
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3058
3207
|
};
|
|
3059
|
-
v((
|
|
3208
|
+
v((O) => [...O, M]);
|
|
3060
3209
|
try {
|
|
3061
|
-
const
|
|
3062
|
-
filename:
|
|
3063
|
-
content:
|
|
3064
|
-
mimeType:
|
|
3065
|
-
})),
|
|
3210
|
+
const O = y == null ? void 0 : y.map((q) => ({
|
|
3211
|
+
filename: q.filename,
|
|
3212
|
+
content: q.content,
|
|
3213
|
+
mimeType: q.mimeType
|
|
3214
|
+
})), ne = de.current, le = !d && Object.keys(ne).length > 0 ? ne : void 0, he = await fetch(`${e}/queue`, {
|
|
3066
3215
|
method: "POST",
|
|
3067
3216
|
headers: { "Content-Type": "application/json" },
|
|
3068
3217
|
body: JSON.stringify({
|
|
3069
3218
|
agentName: o,
|
|
3070
3219
|
sessionId: d,
|
|
3071
|
-
prompt:
|
|
3072
|
-
files:
|
|
3073
|
-
sessionContext:
|
|
3074
|
-
envVars:
|
|
3220
|
+
prompt: w,
|
|
3221
|
+
files: O,
|
|
3222
|
+
sessionContext: ee.current.trim() || void 0,
|
|
3223
|
+
envVars: le
|
|
3075
3224
|
})
|
|
3076
3225
|
});
|
|
3077
|
-
if (!
|
|
3226
|
+
if (!he.ok)
|
|
3078
3227
|
throw new Error("Failed to queue message");
|
|
3079
|
-
const
|
|
3080
|
-
!d &&
|
|
3081
|
-
const
|
|
3082
|
-
if (
|
|
3083
|
-
const
|
|
3084
|
-
|
|
3228
|
+
const J = await he.json();
|
|
3229
|
+
!d && J.id && setTimeout(async () => {
|
|
3230
|
+
const U = await fetch(`${e}/queue/${J.id}`);
|
|
3231
|
+
if (U.ok) {
|
|
3232
|
+
const K = await U.json();
|
|
3233
|
+
K.sessionId && x(K.sessionId);
|
|
3085
3234
|
}
|
|
3086
|
-
}, 500), await
|
|
3087
|
-
} catch (
|
|
3088
|
-
|
|
3235
|
+
}, 500), await Z();
|
|
3236
|
+
} catch (O) {
|
|
3237
|
+
T(O instanceof Error ? O.message : "Failed to queue message"), v((ne) => ne.filter((le) => le.id !== M.id));
|
|
3089
3238
|
}
|
|
3090
|
-
}, [o, d, e,
|
|
3239
|
+
}, [o, d, e, Z]), Ne = P((w, y) => {
|
|
3091
3240
|
if (!o) return;
|
|
3092
3241
|
if (l) {
|
|
3093
|
-
|
|
3242
|
+
ue(w, y);
|
|
3094
3243
|
return;
|
|
3095
3244
|
}
|
|
3096
|
-
const
|
|
3245
|
+
const M = {
|
|
3097
3246
|
id: `queue-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
3098
|
-
text:
|
|
3247
|
+
text: w,
|
|
3099
3248
|
files: y
|
|
3100
3249
|
};
|
|
3101
|
-
|
|
3102
|
-
}, [o,
|
|
3250
|
+
E || B.current ? A((O) => [...O, M]) : A([M]);
|
|
3251
|
+
}, [o, E, l, ue]), xe = P(async (w) => {
|
|
3103
3252
|
if (l) {
|
|
3104
3253
|
try {
|
|
3105
|
-
await fetch(`${e}/queue/${
|
|
3254
|
+
await fetch(`${e}/queue/${w}/cancel`, {
|
|
3106
3255
|
method: "POST"
|
|
3107
|
-
}), await
|
|
3256
|
+
}), await Z();
|
|
3108
3257
|
} catch (y) {
|
|
3109
3258
|
console.error("Failed to cancel queue item:", y);
|
|
3110
3259
|
}
|
|
3111
3260
|
return;
|
|
3112
3261
|
}
|
|
3113
|
-
|
|
3114
|
-
}, [l, e,
|
|
3115
|
-
|
|
3116
|
-
}, []),
|
|
3117
|
-
(
|
|
3262
|
+
A((y) => y.filter((M) => M.id !== w));
|
|
3263
|
+
}, [l, e, Z]), ve = P(() => {
|
|
3264
|
+
x(null), v([]), _(""), T(null), ie([]), A([]);
|
|
3265
|
+
}, []), V = c.find(
|
|
3266
|
+
(w) => w.slug === o || w.name === o
|
|
3118
3267
|
);
|
|
3119
|
-
return /* @__PURE__ */
|
|
3268
|
+
return /* @__PURE__ */ a("div", { className: `harness-playground flex flex-col h-full bg-[#0a0a0a] relative overflow-hidden ${i}`, children: [
|
|
3120
3269
|
/* @__PURE__ */ t("div", { className: "ambient-glow ambient-glow-accent w-[40vw] h-[40vw] -top-[20%] -right-[10%] animate-pulse-slow" }),
|
|
3121
3270
|
/* @__PURE__ */ t("div", { className: "ambient-glow ambient-glow-green w-[30vw] h-[30vw] bottom-[10%] -left-[10%] animate-pulse-slow" }),
|
|
3122
3271
|
/* @__PURE__ */ t("div", { className: "fixed inset-0 grid-pattern pointer-events-none z-0" }),
|
|
3123
3272
|
/* @__PURE__ */ t("div", { className: "fixed inset-0 noise-overlay pointer-events-none z-0" }),
|
|
3124
|
-
/* @__PURE__ */
|
|
3125
|
-
/* @__PURE__ */
|
|
3273
|
+
/* @__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: [
|
|
3274
|
+
/* @__PURE__ */ a("div", { children: [
|
|
3126
3275
|
/* @__PURE__ */ t("h1", { className: "text-xl font-semibold text-white", children: "Playground" }),
|
|
3127
|
-
|
|
3276
|
+
V && /* @__PURE__ */ t("p", { className: "text-sm text-white/50 mt-0.5", children: V.description || `Chat with ${V.name}` })
|
|
3128
3277
|
] }),
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
3279
|
+
/* @__PURE__ */ a(
|
|
3131
3280
|
"select",
|
|
3132
3281
|
{
|
|
3133
3282
|
value: o || "",
|
|
3134
|
-
onChange: (
|
|
3135
|
-
w
|
|
3283
|
+
onChange: (w) => {
|
|
3284
|
+
f(w.target.value), ve();
|
|
3136
3285
|
},
|
|
3137
3286
|
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
3287
|
children: [
|
|
3139
3288
|
c.length === 0 && /* @__PURE__ */ t("option", { value: "", children: "No agents" }),
|
|
3140
|
-
c.map((
|
|
3289
|
+
c.map((w) => /* @__PURE__ */ t("option", { value: w.slug || w.name, className: "bg-[#0a0a0a]", children: w.name }, w.slug || w.name))
|
|
3141
3290
|
]
|
|
3142
3291
|
}
|
|
3143
3292
|
),
|
|
3144
3293
|
/* @__PURE__ */ t(
|
|
3145
3294
|
"button",
|
|
3146
3295
|
{
|
|
3147
|
-
onClick:
|
|
3296
|
+
onClick: ve,
|
|
3148
3297
|
className: "px-4 py-2.5 text-sm text-white/70 hover:text-white border border-white/10 rounded-xl hover:bg-white/10 hover:border-white/20 transition-all duration-300",
|
|
3149
3298
|
children: "New Chat"
|
|
3150
3299
|
}
|
|
3151
3300
|
)
|
|
3152
3301
|
] })
|
|
3153
3302
|
] }),
|
|
3154
|
-
|
|
3155
|
-
/* @__PURE__ */ t("span", { children:
|
|
3303
|
+
Q && /* @__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: [
|
|
3304
|
+
/* @__PURE__ */ t("span", { children: Q }),
|
|
3156
3305
|
/* @__PURE__ */ t(
|
|
3157
3306
|
"button",
|
|
3158
3307
|
{
|
|
3159
|
-
onClick: () =>
|
|
3308
|
+
onClick: () => T(null),
|
|
3160
3309
|
className: "text-red-400/70 hover:text-red-400 transition-colors",
|
|
3161
3310
|
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
3311
|
}
|
|
3163
3312
|
)
|
|
3164
3313
|
] }),
|
|
3165
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative z-10", children:
|
|
3314
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative z-10", children: p.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
3315
|
/* @__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
3316
|
/* @__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 ${(
|
|
3317
|
+
/* @__PURE__ */ t("p", { className: "text-sm mt-1 text-white/40", children: o ? `Chat with ${(V == null ? void 0 : V.name) || o}` : "Select an agent to begin" })
|
|
3169
3318
|
] }) }) : /* @__PURE__ */ t(
|
|
3170
3319
|
On,
|
|
3171
3320
|
{
|
|
3172
|
-
messages:
|
|
3173
|
-
loading:
|
|
3174
|
-
streamingContent:
|
|
3321
|
+
messages: p,
|
|
3322
|
+
loading: E,
|
|
3323
|
+
streamingContent: R
|
|
3175
3324
|
}
|
|
3176
3325
|
) }),
|
|
3177
3326
|
/* @__PURE__ */ t("div", { className: "relative z-10", children: /* @__PURE__ */ t(
|
|
3178
|
-
|
|
3327
|
+
Gn,
|
|
3179
3328
|
{
|
|
3180
|
-
onSend:
|
|
3329
|
+
onSend: Ne,
|
|
3181
3330
|
disabled: !o,
|
|
3182
|
-
loading:
|
|
3183
|
-
queue: l ?
|
|
3184
|
-
onCancelQueued:
|
|
3185
|
-
sessionContext:
|
|
3186
|
-
onSessionContextChange:
|
|
3187
|
-
envVars:
|
|
3188
|
-
onEnvVarsChange:
|
|
3189
|
-
placeholder: o ? `Message ${(
|
|
3331
|
+
loading: E,
|
|
3332
|
+
queue: l ? j.map((w) => ({ id: w.id, text: w.prompt })) : F,
|
|
3333
|
+
onCancelQueued: xe,
|
|
3334
|
+
sessionContext: X,
|
|
3335
|
+
onSessionContextChange: W,
|
|
3336
|
+
envVars: H,
|
|
3337
|
+
onEnvVarsChange: k,
|
|
3338
|
+
placeholder: o ? `Message ${(V == null ? void 0 : V.name) || o}...` : "Select an agent to start chatting"
|
|
3190
3339
|
}
|
|
3191
3340
|
) }),
|
|
3192
|
-
d && /* @__PURE__ */
|
|
3341
|
+
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
3342
|
/* @__PURE__ */ t("span", { className: "w-1.5 h-1.5 rounded-full bg-[#ccff00]" }),
|
|
3194
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ a("span", { className: "font-mono", children: [
|
|
3195
3344
|
"Session: ",
|
|
3196
3345
|
d.slice(0, 8),
|
|
3197
3346
|
"..."
|
|
@@ -3204,22 +3353,22 @@ function Ar({
|
|
|
3204
3353
|
loading: n,
|
|
3205
3354
|
streamingContent: r,
|
|
3206
3355
|
displayConfig: s,
|
|
3207
|
-
onOptionSelect:
|
|
3356
|
+
onOptionSelect: i
|
|
3208
3357
|
}) {
|
|
3209
3358
|
return /* @__PURE__ */ t(
|
|
3210
|
-
|
|
3359
|
+
In,
|
|
3211
3360
|
{
|
|
3212
3361
|
entries: e,
|
|
3213
3362
|
loading: n,
|
|
3214
3363
|
streamingContent: r,
|
|
3215
3364
|
displayConfig: s,
|
|
3216
|
-
onOptionSelect:
|
|
3365
|
+
onOptionSelect: i
|
|
3217
3366
|
}
|
|
3218
3367
|
);
|
|
3219
3368
|
}
|
|
3220
|
-
function
|
|
3369
|
+
function Dr({ logs: e, isLoading: n, className: r }) {
|
|
3221
3370
|
return /* @__PURE__ */ t(
|
|
3222
|
-
|
|
3371
|
+
jn,
|
|
3223
3372
|
{
|
|
3224
3373
|
logs: e,
|
|
3225
3374
|
title: "Sandbox Logs",
|
|
@@ -3303,7 +3452,7 @@ function Vn(e, n) {
|
|
|
3303
3452
|
query: r.query || ""
|
|
3304
3453
|
};
|
|
3305
3454
|
case "TodoWrite": {
|
|
3306
|
-
const s = r.todos || [],
|
|
3455
|
+
const s = r.todos || [], i = {
|
|
3307
3456
|
total: s.length,
|
|
3308
3457
|
completed: s.filter((l) => l.status === "completed").length,
|
|
3309
3458
|
inProgress: s.filter((l) => l.status === "in_progress").length,
|
|
@@ -3312,7 +3461,7 @@ function Vn(e, n) {
|
|
|
3312
3461
|
return {
|
|
3313
3462
|
action: "todo_write",
|
|
3314
3463
|
todos: s,
|
|
3315
|
-
stats:
|
|
3464
|
+
stats: i
|
|
3316
3465
|
};
|
|
3317
3466
|
}
|
|
3318
3467
|
default: {
|
|
@@ -3330,7 +3479,7 @@ function Vn(e, n) {
|
|
|
3330
3479
|
}
|
|
3331
3480
|
}
|
|
3332
3481
|
}
|
|
3333
|
-
function
|
|
3482
|
+
function Jn(e, n, r) {
|
|
3334
3483
|
switch (r.action) {
|
|
3335
3484
|
case "command_run":
|
|
3336
3485
|
const s = r.command;
|
|
@@ -3354,18 +3503,18 @@ function Gn(e, n, r) {
|
|
|
3354
3503
|
case "generic_tool":
|
|
3355
3504
|
return r.toolName;
|
|
3356
3505
|
case "todo_write": {
|
|
3357
|
-
const { stats:
|
|
3358
|
-
return
|
|
3506
|
+
const { stats: i } = r;
|
|
3507
|
+
return i ? `${i.completed}/${i.total} completed` : `${r.todos.length} tasks`;
|
|
3359
3508
|
}
|
|
3360
3509
|
default:
|
|
3361
3510
|
return "Unknown tool";
|
|
3362
3511
|
}
|
|
3363
3512
|
}
|
|
3364
|
-
function
|
|
3513
|
+
function Un(e) {
|
|
3365
3514
|
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
3515
|
`) : e && typeof e == "object" && "text" in e ? String(e.text) : JSON.stringify(e, null, 2);
|
|
3367
3516
|
}
|
|
3368
|
-
function
|
|
3517
|
+
function Kn(e) {
|
|
3369
3518
|
if (typeof e == "string")
|
|
3370
3519
|
try {
|
|
3371
3520
|
return { type: "json", value: JSON.parse(e) };
|
|
@@ -3389,8 +3538,8 @@ function Un(e) {
|
|
|
3389
3538
|
}
|
|
3390
3539
|
return { type: "json", value: e };
|
|
3391
3540
|
}
|
|
3392
|
-
function
|
|
3393
|
-
const n =
|
|
3541
|
+
function Yn(e) {
|
|
3542
|
+
const n = Un(e);
|
|
3394
3543
|
if (typeof e == "string")
|
|
3395
3544
|
try {
|
|
3396
3545
|
const r = JSON.parse(e);
|
|
@@ -3408,8 +3557,8 @@ function Kn(e) {
|
|
|
3408
3557
|
// Assume success if no exit code
|
|
3409
3558
|
};
|
|
3410
3559
|
}
|
|
3411
|
-
function
|
|
3412
|
-
const n = Vn(e.name, e.input), r =
|
|
3560
|
+
function nt(e) {
|
|
3561
|
+
const n = Vn(e.name, e.input), r = Jn(e.name, e.input, n);
|
|
3413
3562
|
return {
|
|
3414
3563
|
id: e.id,
|
|
3415
3564
|
toolName: e.name,
|
|
@@ -3419,36 +3568,36 @@ function tt(e) {
|
|
|
3419
3568
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3420
3569
|
};
|
|
3421
3570
|
}
|
|
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 =
|
|
3571
|
+
function rt(e, n, r) {
|
|
3572
|
+
const s = { ...e }, i = { ...e.actionType };
|
|
3573
|
+
if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, i.action === "command_run") {
|
|
3574
|
+
const l = Yn(n);
|
|
3575
|
+
i.result = l, l.exitCode !== void 0 && l.exitCode !== 0 && (s.status = "failed", s.isError = !0);
|
|
3576
|
+
} else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = Kn(n));
|
|
3577
|
+
return s.actionType = i, s;
|
|
3429
3578
|
}
|
|
3430
|
-
function
|
|
3579
|
+
function Zn(e) {
|
|
3431
3580
|
return e.type === "tool_use";
|
|
3432
3581
|
}
|
|
3433
|
-
function
|
|
3582
|
+
function Qn(e) {
|
|
3434
3583
|
return e.type === "tool_result";
|
|
3435
3584
|
}
|
|
3436
|
-
function
|
|
3585
|
+
function jr(e) {
|
|
3437
3586
|
const n = [], r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
3438
|
-
for (const
|
|
3439
|
-
const l =
|
|
3440
|
-
for (const c of
|
|
3587
|
+
for (const i of e) {
|
|
3588
|
+
const l = i.createdAt instanceof Date ? i.createdAt.toISOString() : i.createdAt;
|
|
3589
|
+
for (const c of i.content)
|
|
3441
3590
|
if (c.type === "text" && "text" in c)
|
|
3442
3591
|
n.push({
|
|
3443
|
-
id: `${
|
|
3592
|
+
id: `${i.id}-text-${n.length}`,
|
|
3444
3593
|
timestamp: l,
|
|
3445
3594
|
entryType: {
|
|
3446
|
-
type:
|
|
3595
|
+
type: i.role === "user" ? "user_message" : "assistant_message"
|
|
3447
3596
|
},
|
|
3448
3597
|
content: c.text
|
|
3449
3598
|
});
|
|
3450
|
-
else if (
|
|
3451
|
-
const h =
|
|
3599
|
+
else if (Zn(c)) {
|
|
3600
|
+
const h = nt(c);
|
|
3452
3601
|
r.set(c.id, h);
|
|
3453
3602
|
const o = {
|
|
3454
3603
|
id: c.id,
|
|
@@ -3460,30 +3609,30 @@ function Dr(e) {
|
|
|
3460
3609
|
content: h.summary
|
|
3461
3610
|
};
|
|
3462
3611
|
n.push(o), s.set(c.id, o);
|
|
3463
|
-
} else if (
|
|
3612
|
+
} else if (Qn(c)) {
|
|
3464
3613
|
const h = c.toolUseId, o = r.get(h);
|
|
3465
3614
|
if (o) {
|
|
3466
|
-
const
|
|
3615
|
+
const f = rt(
|
|
3467
3616
|
o,
|
|
3468
3617
|
c.content,
|
|
3469
3618
|
c.isError
|
|
3470
3619
|
), d = s.get(h);
|
|
3471
|
-
d && d.entryType.type === "tool_call" && (d.entryType.toolCall =
|
|
3620
|
+
d && d.entryType.type === "tool_call" && (d.entryType.toolCall = f), r.delete(h);
|
|
3472
3621
|
}
|
|
3473
3622
|
}
|
|
3474
3623
|
}
|
|
3475
3624
|
return n;
|
|
3476
3625
|
}
|
|
3477
|
-
const
|
|
3626
|
+
const Me = class Me {
|
|
3478
3627
|
constructor() {
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3628
|
+
se(this, "entries", []);
|
|
3629
|
+
se(this, "pendingToolCalls", /* @__PURE__ */ new Map());
|
|
3630
|
+
se(this, "listeners", /* @__PURE__ */ new Set());
|
|
3631
|
+
se(this, "currentTextContent", "");
|
|
3632
|
+
se(this, "currentTextEntryId", null);
|
|
3633
|
+
se(this, "hadToolCallSinceText", !1);
|
|
3485
3634
|
/** Track the last few deltas to detect duplicates (prevents double-processing) */
|
|
3486
|
-
|
|
3635
|
+
se(this, "recentDeltas", []);
|
|
3487
3636
|
}
|
|
3488
3637
|
/**
|
|
3489
3638
|
* Subscribe to entry updates.
|
|
@@ -3570,7 +3719,7 @@ const Se = class Se {
|
|
|
3570
3719
|
console.warn("[ToolCallProcessor] Skipping potential duplicate delta");
|
|
3571
3720
|
return;
|
|
3572
3721
|
}
|
|
3573
|
-
this.recentDeltas.push(s), this.recentDeltas.length >
|
|
3722
|
+
this.recentDeltas.push(s), this.recentDeltas.length > Me.MAX_RECENT_DELTAS && this.recentDeltas.shift();
|
|
3574
3723
|
}
|
|
3575
3724
|
if (this.hadToolCallSinceText && this.currentTextEntryId && (this.currentTextContent = "", this.currentTextEntryId = null, this.hadToolCallSinceText = !1), this.currentTextContent += n, !this.currentTextEntryId)
|
|
3576
3725
|
this.currentTextEntryId = `text-${Date.now()}-${Math.random().toString(36).slice(2)}`, this.entries.push({
|
|
@@ -3580,13 +3729,13 @@ const Se = class Se {
|
|
|
3580
3729
|
content: this.currentTextContent
|
|
3581
3730
|
});
|
|
3582
3731
|
else {
|
|
3583
|
-
const s = this.entries.findIndex((
|
|
3732
|
+
const s = this.entries.findIndex((i) => i.id === this.currentTextEntryId);
|
|
3584
3733
|
if (s !== -1) {
|
|
3585
|
-
const
|
|
3586
|
-
|
|
3587
|
-
id:
|
|
3588
|
-
timestamp:
|
|
3589
|
-
entryType:
|
|
3734
|
+
const i = this.entries[s];
|
|
3735
|
+
i && (this.entries[s] = {
|
|
3736
|
+
id: i.id,
|
|
3737
|
+
timestamp: i.timestamp,
|
|
3738
|
+
entryType: i.entryType,
|
|
3590
3739
|
content: this.currentTextContent
|
|
3591
3740
|
});
|
|
3592
3741
|
}
|
|
@@ -3604,7 +3753,7 @@ const Se = class Se {
|
|
|
3604
3753
|
*/
|
|
3605
3754
|
handleToolUse(n) {
|
|
3606
3755
|
this.finalizeCurrentText(), this.hadToolCallSinceText = !0;
|
|
3607
|
-
const r =
|
|
3756
|
+
const r = nt({
|
|
3608
3757
|
id: n.id,
|
|
3609
3758
|
name: n.name,
|
|
3610
3759
|
input: n.input
|
|
@@ -3616,8 +3765,8 @@ const Se = class Se {
|
|
|
3616
3765
|
toolCall: r
|
|
3617
3766
|
},
|
|
3618
3767
|
content: r.summary
|
|
3619
|
-
},
|
|
3620
|
-
this.entries.push(s), this.pendingToolCalls.set(n.id, { entryIndex:
|
|
3768
|
+
}, i = this.entries.length;
|
|
3769
|
+
this.entries.push(s), this.pendingToolCalls.set(n.id, { entryIndex: i, toolCall: r }), this.emit();
|
|
3621
3770
|
}
|
|
3622
3771
|
/**
|
|
3623
3772
|
* Handle tool_result event - update pending tool call with result
|
|
@@ -3625,19 +3774,19 @@ const Se = class Se {
|
|
|
3625
3774
|
handleToolResult(n) {
|
|
3626
3775
|
const r = this.pendingToolCalls.get(n.toolUseId);
|
|
3627
3776
|
if (r) {
|
|
3628
|
-
const s =
|
|
3777
|
+
const s = rt(
|
|
3629
3778
|
r.toolCall,
|
|
3630
3779
|
n.content,
|
|
3631
3780
|
n.isError
|
|
3632
|
-
),
|
|
3633
|
-
|
|
3634
|
-
id:
|
|
3635
|
-
timestamp:
|
|
3781
|
+
), i = this.entries[r.entryIndex];
|
|
3782
|
+
i && i.entryType.type === "tool_call" && (this.entries[r.entryIndex] = {
|
|
3783
|
+
id: i.id,
|
|
3784
|
+
timestamp: i.timestamp,
|
|
3636
3785
|
entryType: {
|
|
3637
3786
|
type: "tool_call",
|
|
3638
3787
|
toolCall: s
|
|
3639
3788
|
},
|
|
3640
|
-
content:
|
|
3789
|
+
content: i.content
|
|
3641
3790
|
}), this.pendingToolCalls.delete(n.toolUseId), this.emit();
|
|
3642
3791
|
}
|
|
3643
3792
|
}
|
|
@@ -3664,94 +3813,94 @@ const Se = class Se {
|
|
|
3664
3813
|
this.listeners.forEach((r) => r(n));
|
|
3665
3814
|
}
|
|
3666
3815
|
};
|
|
3667
|
-
|
|
3668
|
-
let
|
|
3669
|
-
function
|
|
3670
|
-
return new
|
|
3816
|
+
se(Me, "MAX_RECENT_DELTAS", 10);
|
|
3817
|
+
let De = Me;
|
|
3818
|
+
function Wr() {
|
|
3819
|
+
return new De();
|
|
3671
3820
|
}
|
|
3672
3821
|
export {
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3822
|
+
Ze as ActionIcon,
|
|
3823
|
+
Mt as AlertCircleIcon,
|
|
3824
|
+
Ye as AlertTriangleIcon,
|
|
3825
|
+
sn as AssistantMessage,
|
|
3826
|
+
wr as BrainIcon,
|
|
3827
|
+
Et as BugIcon,
|
|
3828
|
+
Gn as ChatInput,
|
|
3829
|
+
It as CheckCircleIcon,
|
|
3830
|
+
_t as CheckIcon,
|
|
3831
|
+
We as ChevronDownIcon,
|
|
3832
|
+
dr as ChevronLeftIcon,
|
|
3833
|
+
ye as ChevronRightIcon,
|
|
3834
|
+
ur as ChevronUpIcon,
|
|
3835
|
+
ce as CodeBlock,
|
|
3836
|
+
hr as CodeIcon,
|
|
3837
|
+
mr as CopyIcon,
|
|
3689
3838
|
Oe as EditIcon,
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3839
|
+
on as ErrorMessage,
|
|
3840
|
+
Be as FileIcon,
|
|
3841
|
+
yt as FilePlusIcon,
|
|
3842
|
+
Ct as FolderSearchIcon,
|
|
3843
|
+
bt as GlobeIcon,
|
|
3844
|
+
St as InfoIcon,
|
|
3845
|
+
Se as JsonDisplay,
|
|
3697
3846
|
On as LegacyMessageList,
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3847
|
+
Tt as LoaderIcon,
|
|
3848
|
+
Re as LoadingIndicator,
|
|
3849
|
+
jn as LogsPanel,
|
|
3850
|
+
cn as MessageEntry,
|
|
3851
|
+
In as MessageList,
|
|
3852
|
+
gr as MessageSquareIcon,
|
|
3853
|
+
cr as MoonIcon,
|
|
3705
3854
|
Ar as NormalizedMessageList,
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3855
|
+
$t as PaperclipIcon,
|
|
3856
|
+
Rr as Playground,
|
|
3857
|
+
Nt as PlugIcon,
|
|
3858
|
+
Dr as SandboxLogsPanel,
|
|
3859
|
+
Te as SearchIcon,
|
|
3860
|
+
fr as SendIcon,
|
|
3861
|
+
Rt as SparklesIcon,
|
|
3862
|
+
Bt as StatusIndicator,
|
|
3863
|
+
xr as StopCircleIcon,
|
|
3864
|
+
dn as StreamingText,
|
|
3865
|
+
or as SunIcon,
|
|
3866
|
+
Ee as TerminalIcon,
|
|
3867
|
+
Lr as ThemeProvider,
|
|
3868
|
+
an as ThinkingMessage,
|
|
3869
|
+
ze as ToolCallCard,
|
|
3870
|
+
ln as ToolCallMessage,
|
|
3871
|
+
De as ToolCallProcessor,
|
|
3872
|
+
kt as ToolIcon,
|
|
3873
|
+
rn as UserMessage,
|
|
3874
|
+
Lt as XCircleIcon,
|
|
3875
|
+
pr as XIcon,
|
|
3876
|
+
m as cn,
|
|
3877
|
+
rr as createToolCall,
|
|
3878
|
+
Wr as createToolCallProcessor,
|
|
3879
|
+
pt as extractTextContent,
|
|
3731
3880
|
ir as formatFileSize,
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3881
|
+
je as formatTimestamp,
|
|
3882
|
+
dt as formatToolName,
|
|
3883
|
+
mt as generateToolSummary,
|
|
3884
|
+
ar as getActionIcon,
|
|
3885
|
+
Ke as getActionLabel,
|
|
3886
|
+
vr as isCommandRunAction,
|
|
3887
|
+
Ir as isErrorEntry,
|
|
3888
|
+
br as isFileEditAction,
|
|
3889
|
+
yr as isFileReadAction,
|
|
3890
|
+
Nr as isFileWriteAction,
|
|
3891
|
+
Mr as isGenericToolAction,
|
|
3892
|
+
Cr as isGlobAction,
|
|
3893
|
+
Sr as isMcpToolAction,
|
|
3894
|
+
kr as isSearchAction,
|
|
3895
|
+
Er as isToolCallEntry,
|
|
3896
|
+
_r as isWebFetchAction,
|
|
3897
|
+
Tr as isWebSearchAction,
|
|
3898
|
+
ht as mapToolToActionType,
|
|
3899
|
+
jr as normalizeMessages,
|
|
3900
|
+
ft as normalizeToolResult,
|
|
3901
|
+
xt as parseCommandResult,
|
|
3902
|
+
ut as parseMcpToolName,
|
|
3903
|
+
lr as truncate,
|
|
3904
|
+
sr as updateToolCallWithResult,
|
|
3905
|
+
$r as useTheme
|
|
3757
3906
|
};
|