@ash-cloud/ash-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-tokens.cjs +275 -0
- package/dist/design-tokens.cjs.map +1 -0
- package/dist/design-tokens.d.cts +258 -0
- package/dist/design-tokens.d.ts +258 -0
- package/dist/design-tokens.js +261 -0
- package/dist/design-tokens.js.map +1 -0
- package/dist/icons.cjs +279 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.cts +53 -0
- package/dist/icons.d.ts +53 -0
- package/dist/icons.js +241 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +2430 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +535 -0
- package/dist/index.d.ts +535 -0
- package/dist/index.js +2318 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types.cjs +65 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +303 -0
- package/dist/types.d.ts +303 -0
- package/dist/types.js +50 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.cjs +415 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +135 -0
- package/dist/utils.d.ts +135 -0
- package/dist/utils.js +396 -0
- package/dist/utils.js.map +1 -0
- package/package.json +89 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2318 @@
|
|
|
1
|
+
import { createContext, useState, useRef, useEffect, useMemo, useCallback, useContext } from 'react';
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import ReactMarkdown from 'react-markdown';
|
|
4
|
+
|
|
5
|
+
// src/components/ToolCallCard.tsx
|
|
6
|
+
|
|
7
|
+
// src/utils.ts
|
|
8
|
+
function formatToolName(name) {
|
|
9
|
+
if (name.startsWith("mcp__")) {
|
|
10
|
+
const parts = name.split("__");
|
|
11
|
+
if (parts.length >= 3) {
|
|
12
|
+
return `mcp:${parts[1]}:${parts.slice(2).join(":")}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return name;
|
|
16
|
+
}
|
|
17
|
+
function parseMcpToolName(name) {
|
|
18
|
+
if (name.startsWith("mcp__")) {
|
|
19
|
+
const parts = name.split("__");
|
|
20
|
+
if (parts.length >= 3 && parts[1] !== void 0) {
|
|
21
|
+
return {
|
|
22
|
+
serverName: parts[1],
|
|
23
|
+
toolName: parts.slice(2).join("__")
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function mapToolToActionType(toolName, input) {
|
|
30
|
+
const inputObj = input || {};
|
|
31
|
+
switch (toolName) {
|
|
32
|
+
case "Bash":
|
|
33
|
+
return {
|
|
34
|
+
action: "command_run",
|
|
35
|
+
command: inputObj.command || "",
|
|
36
|
+
description: inputObj.description
|
|
37
|
+
};
|
|
38
|
+
case "Read":
|
|
39
|
+
return {
|
|
40
|
+
action: "file_read",
|
|
41
|
+
path: inputObj.file_path || "",
|
|
42
|
+
offset: inputObj.offset,
|
|
43
|
+
limit: inputObj.limit
|
|
44
|
+
};
|
|
45
|
+
case "Edit":
|
|
46
|
+
return {
|
|
47
|
+
action: "file_edit",
|
|
48
|
+
path: inputObj.file_path || "",
|
|
49
|
+
oldString: inputObj.old_string,
|
|
50
|
+
newString: inputObj.new_string,
|
|
51
|
+
replaceAll: inputObj.replace_all
|
|
52
|
+
};
|
|
53
|
+
case "Write":
|
|
54
|
+
return {
|
|
55
|
+
action: "file_write",
|
|
56
|
+
path: inputObj.file_path || "",
|
|
57
|
+
content: inputObj.content
|
|
58
|
+
};
|
|
59
|
+
case "Grep":
|
|
60
|
+
return {
|
|
61
|
+
action: "search",
|
|
62
|
+
pattern: inputObj.pattern || "",
|
|
63
|
+
path: inputObj.path,
|
|
64
|
+
glob: inputObj.glob,
|
|
65
|
+
type: inputObj.type
|
|
66
|
+
};
|
|
67
|
+
case "Glob":
|
|
68
|
+
return {
|
|
69
|
+
action: "glob",
|
|
70
|
+
pattern: inputObj.pattern || "",
|
|
71
|
+
path: inputObj.path
|
|
72
|
+
};
|
|
73
|
+
case "WebFetch":
|
|
74
|
+
return {
|
|
75
|
+
action: "web_fetch",
|
|
76
|
+
url: inputObj.url || "",
|
|
77
|
+
prompt: inputObj.prompt
|
|
78
|
+
};
|
|
79
|
+
case "WebSearch":
|
|
80
|
+
return {
|
|
81
|
+
action: "web_search",
|
|
82
|
+
query: inputObj.query || ""
|
|
83
|
+
};
|
|
84
|
+
case "TodoWrite": {
|
|
85
|
+
const todos = inputObj.todos || [];
|
|
86
|
+
const stats = {
|
|
87
|
+
total: todos.length,
|
|
88
|
+
completed: todos.filter((t) => t.status === "completed").length,
|
|
89
|
+
inProgress: todos.filter((t) => t.status === "in_progress").length,
|
|
90
|
+
pending: todos.filter((t) => t.status === "pending").length
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
action: "todo_write",
|
|
94
|
+
todos,
|
|
95
|
+
stats
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
default: {
|
|
99
|
+
const mcpParts = parseMcpToolName(toolName);
|
|
100
|
+
if (mcpParts) {
|
|
101
|
+
return {
|
|
102
|
+
action: "mcp_tool",
|
|
103
|
+
serverName: mcpParts.serverName,
|
|
104
|
+
toolName: mcpParts.toolName,
|
|
105
|
+
arguments: input
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
action: "generic_tool",
|
|
110
|
+
toolName: formatToolName(toolName),
|
|
111
|
+
arguments: input
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function generateToolSummary(_toolName, _input, actionType) {
|
|
117
|
+
switch (actionType.action) {
|
|
118
|
+
case "command_run": {
|
|
119
|
+
const cmd = actionType.command;
|
|
120
|
+
return cmd.length > 60 ? cmd.substring(0, 57) + "..." : cmd;
|
|
121
|
+
}
|
|
122
|
+
case "file_read":
|
|
123
|
+
return actionType.path;
|
|
124
|
+
case "file_edit":
|
|
125
|
+
return actionType.path;
|
|
126
|
+
case "file_write":
|
|
127
|
+
return actionType.path;
|
|
128
|
+
case "search":
|
|
129
|
+
return `${actionType.pattern}${actionType.path ? ` in ${actionType.path}` : ""}`;
|
|
130
|
+
case "glob":
|
|
131
|
+
return actionType.pattern;
|
|
132
|
+
case "web_fetch":
|
|
133
|
+
return actionType.url;
|
|
134
|
+
case "web_search":
|
|
135
|
+
return actionType.query;
|
|
136
|
+
case "mcp_tool":
|
|
137
|
+
return `${actionType.serverName}:${actionType.toolName}`;
|
|
138
|
+
case "generic_tool":
|
|
139
|
+
return actionType.toolName;
|
|
140
|
+
case "todo_write": {
|
|
141
|
+
const { stats } = actionType;
|
|
142
|
+
if (stats) {
|
|
143
|
+
return `${stats.completed}/${stats.total} completed`;
|
|
144
|
+
}
|
|
145
|
+
return `${actionType.todos.length} tasks`;
|
|
146
|
+
}
|
|
147
|
+
default:
|
|
148
|
+
return "Unknown tool";
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function extractTextContent(content) {
|
|
152
|
+
if (typeof content === "string") return content;
|
|
153
|
+
if (Array.isArray(content)) {
|
|
154
|
+
return content.filter((item) => typeof item?.text === "string").map((item) => item.text).join("\n");
|
|
155
|
+
}
|
|
156
|
+
if (content && typeof content === "object" && "text" in content) {
|
|
157
|
+
return String(content.text);
|
|
158
|
+
}
|
|
159
|
+
return JSON.stringify(content, null, 2);
|
|
160
|
+
}
|
|
161
|
+
function normalizeToolResult(content) {
|
|
162
|
+
if (typeof content === "string") {
|
|
163
|
+
try {
|
|
164
|
+
const parsed = JSON.parse(content);
|
|
165
|
+
return { type: "json", value: parsed };
|
|
166
|
+
} catch {
|
|
167
|
+
return { type: "markdown", value: content };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (Array.isArray(content)) {
|
|
171
|
+
const texts = content.filter(
|
|
172
|
+
(item) => item?.type === "text" && typeof item.text === "string"
|
|
173
|
+
).map((item) => item.text);
|
|
174
|
+
if (texts.length > 0) {
|
|
175
|
+
const joined = texts.join("\n\n");
|
|
176
|
+
try {
|
|
177
|
+
return { type: "json", value: JSON.parse(joined) };
|
|
178
|
+
} catch {
|
|
179
|
+
return { type: "markdown", value: joined };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { type: "json", value: content };
|
|
184
|
+
}
|
|
185
|
+
function parseCommandResult(content) {
|
|
186
|
+
const output = extractTextContent(content);
|
|
187
|
+
if (typeof content === "string") {
|
|
188
|
+
try {
|
|
189
|
+
const parsed = JSON.parse(content);
|
|
190
|
+
if (typeof parsed.exitCode === "number") {
|
|
191
|
+
return {
|
|
192
|
+
exitCode: parsed.exitCode,
|
|
193
|
+
output: parsed.output || output,
|
|
194
|
+
success: parsed.exitCode === 0
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
} catch {
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
output,
|
|
202
|
+
success: true
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function createToolCall(toolUse) {
|
|
206
|
+
const actionType = mapToolToActionType(toolUse.name, toolUse.input);
|
|
207
|
+
const summary = generateToolSummary(toolUse.name, toolUse.input, actionType);
|
|
208
|
+
return {
|
|
209
|
+
id: toolUse.id,
|
|
210
|
+
toolName: toolUse.name,
|
|
211
|
+
actionType,
|
|
212
|
+
status: "pending",
|
|
213
|
+
summary,
|
|
214
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function updateToolCallWithResult(toolCall, content, isError) {
|
|
218
|
+
const updatedToolCall = { ...toolCall };
|
|
219
|
+
const actionType = { ...toolCall.actionType };
|
|
220
|
+
updatedToolCall.status = isError ? "failed" : "success";
|
|
221
|
+
updatedToolCall.completedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
222
|
+
updatedToolCall.isError = isError;
|
|
223
|
+
if (actionType.action === "command_run") {
|
|
224
|
+
const result = parseCommandResult(content);
|
|
225
|
+
actionType.result = result;
|
|
226
|
+
if (result.exitCode !== void 0 && result.exitCode !== 0) {
|
|
227
|
+
updatedToolCall.status = "failed";
|
|
228
|
+
updatedToolCall.isError = true;
|
|
229
|
+
}
|
|
230
|
+
} else if (actionType.action === "mcp_tool" || actionType.action === "generic_tool") {
|
|
231
|
+
actionType.result = normalizeToolResult(content);
|
|
232
|
+
}
|
|
233
|
+
updatedToolCall.actionType = actionType;
|
|
234
|
+
return updatedToolCall;
|
|
235
|
+
}
|
|
236
|
+
function getActionIcon(actionType) {
|
|
237
|
+
switch (actionType.action) {
|
|
238
|
+
case "command_run":
|
|
239
|
+
return "terminal";
|
|
240
|
+
case "file_read":
|
|
241
|
+
return "file-text";
|
|
242
|
+
case "file_edit":
|
|
243
|
+
return "edit";
|
|
244
|
+
case "file_write":
|
|
245
|
+
return "file-plus";
|
|
246
|
+
case "search":
|
|
247
|
+
return "search";
|
|
248
|
+
case "glob":
|
|
249
|
+
return "folder-search";
|
|
250
|
+
case "web_fetch":
|
|
251
|
+
return "globe";
|
|
252
|
+
case "web_search":
|
|
253
|
+
return "search";
|
|
254
|
+
case "mcp_tool":
|
|
255
|
+
return "plug";
|
|
256
|
+
case "generic_tool":
|
|
257
|
+
return "tool";
|
|
258
|
+
case "todo_write":
|
|
259
|
+
return "list-checks";
|
|
260
|
+
default:
|
|
261
|
+
return "tool";
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function getActionLabel(actionType) {
|
|
265
|
+
switch (actionType.action) {
|
|
266
|
+
case "command_run":
|
|
267
|
+
return "Command";
|
|
268
|
+
case "file_read":
|
|
269
|
+
return "Read";
|
|
270
|
+
case "file_edit":
|
|
271
|
+
return "Edit";
|
|
272
|
+
case "file_write":
|
|
273
|
+
return "Write";
|
|
274
|
+
case "search":
|
|
275
|
+
return "Search";
|
|
276
|
+
case "glob":
|
|
277
|
+
return "Glob";
|
|
278
|
+
case "web_fetch":
|
|
279
|
+
return "Fetch";
|
|
280
|
+
case "web_search":
|
|
281
|
+
return "Search";
|
|
282
|
+
case "mcp_tool":
|
|
283
|
+
return "MCP";
|
|
284
|
+
case "generic_tool":
|
|
285
|
+
return "Tool";
|
|
286
|
+
case "todo_write":
|
|
287
|
+
return "Tasks";
|
|
288
|
+
default:
|
|
289
|
+
return "Tool";
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function formatFileSize(bytes) {
|
|
293
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
294
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
295
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
296
|
+
}
|
|
297
|
+
function formatTimestamp(timestamp) {
|
|
298
|
+
try {
|
|
299
|
+
const date = new Date(timestamp);
|
|
300
|
+
return date.toLocaleTimeString("en-US", {
|
|
301
|
+
hour: "2-digit",
|
|
302
|
+
minute: "2-digit",
|
|
303
|
+
second: "2-digit",
|
|
304
|
+
hour12: false
|
|
305
|
+
});
|
|
306
|
+
} catch {
|
|
307
|
+
return timestamp;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function truncate(str, maxLength) {
|
|
311
|
+
if (str.length <= maxLength) return str;
|
|
312
|
+
return str.substring(0, maxLength - 3) + "...";
|
|
313
|
+
}
|
|
314
|
+
function cn(...classes) {
|
|
315
|
+
return classes.filter(Boolean).join(" ");
|
|
316
|
+
}
|
|
317
|
+
function groupEntriesForCompactMode(entries, config) {
|
|
318
|
+
const result = [];
|
|
319
|
+
let currentToolGroup = [];
|
|
320
|
+
let toolGroupCounter = 0;
|
|
321
|
+
const flushToolGroup = () => {
|
|
322
|
+
if (currentToolGroup.length > 0) {
|
|
323
|
+
result.push({
|
|
324
|
+
type: "tool_group",
|
|
325
|
+
entries: [...currentToolGroup],
|
|
326
|
+
id: `tool-group-${toolGroupCounter++}`
|
|
327
|
+
});
|
|
328
|
+
currentToolGroup = [];
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
for (const entry of entries) {
|
|
332
|
+
if (entry.entryType.type === "tool_call") {
|
|
333
|
+
currentToolGroup.push(entry);
|
|
334
|
+
if (config.breakEveryNToolCalls && config.breakEveryNToolCalls > 0 && currentToolGroup.length >= config.breakEveryNToolCalls) {
|
|
335
|
+
flushToolGroup();
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
flushToolGroup();
|
|
339
|
+
result.push({ type: "single", entry });
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
flushToolGroup();
|
|
343
|
+
return result;
|
|
344
|
+
}
|
|
345
|
+
function extractToolCallsFromGroup(entries) {
|
|
346
|
+
return entries.filter(
|
|
347
|
+
(e) => e.entryType.type === "tool_call"
|
|
348
|
+
).map((e) => e.entryType.toolCall);
|
|
349
|
+
}
|
|
350
|
+
function parseOptionsFromContent(content) {
|
|
351
|
+
const optionPattern = /(?:\*\*)?Option\s+(\d+)(?:\*\*)?[:\-]\s*([^\n]+)(?:\n((?:(?!\n(?:\*\*)?Option\s+\d).)*?))?/gi;
|
|
352
|
+
const options = [];
|
|
353
|
+
let firstMatchStart = -1;
|
|
354
|
+
let match;
|
|
355
|
+
optionPattern.lastIndex = 0;
|
|
356
|
+
while ((match = optionPattern.exec(content)) !== null) {
|
|
357
|
+
if (firstMatchStart === -1) {
|
|
358
|
+
firstMatchStart = match.index;
|
|
359
|
+
}
|
|
360
|
+
const id = match[1] ?? "";
|
|
361
|
+
const labelRaw = match[2];
|
|
362
|
+
const label = labelRaw ? labelRaw.trim() : "";
|
|
363
|
+
const descriptionRaw = match[3];
|
|
364
|
+
let description;
|
|
365
|
+
if (descriptionRaw) {
|
|
366
|
+
const cleaned = descriptionRaw.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).join(" ");
|
|
367
|
+
if (cleaned) {
|
|
368
|
+
description = cleaned;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
options.push({ id, label, description });
|
|
372
|
+
}
|
|
373
|
+
if (options.length >= 2) {
|
|
374
|
+
const preamble = firstMatchStart > 0 ? content.substring(0, firstMatchStart).trim() : "";
|
|
375
|
+
return { preamble, options };
|
|
376
|
+
}
|
|
377
|
+
const questionPattern = /^(.*?(?:what would you like to do\??|choose an option|select.*?:|here are your options.*?:))\s*\n+((?:\d+\.\s+.+\n?)+)/ims;
|
|
378
|
+
const questionMatch = content.match(questionPattern);
|
|
379
|
+
if (questionMatch && questionMatch[1] && questionMatch[2]) {
|
|
380
|
+
const preamble = questionMatch[1].trim();
|
|
381
|
+
const listSection = questionMatch[2];
|
|
382
|
+
const listPattern = /(\d+)\.\s+([^\n]+)/g;
|
|
383
|
+
let listMatch;
|
|
384
|
+
while ((listMatch = listPattern.exec(listSection)) !== null) {
|
|
385
|
+
const listId = listMatch[1] ?? "";
|
|
386
|
+
const listLabelRaw = listMatch[2];
|
|
387
|
+
const listLabel = listLabelRaw ? listLabelRaw.trim() : "";
|
|
388
|
+
options.push({
|
|
389
|
+
id: listId,
|
|
390
|
+
label: listLabel
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
if (options.length >= 2) {
|
|
394
|
+
return { preamble, options };
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
function SunIcon({ className }) {
|
|
400
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
401
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "5" }),
|
|
402
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
403
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
404
|
+
/* @__PURE__ */ jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
405
|
+
/* @__PURE__ */ jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
406
|
+
/* @__PURE__ */ jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
407
|
+
/* @__PURE__ */ jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
408
|
+
/* @__PURE__ */ jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
409
|
+
/* @__PURE__ */ jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
410
|
+
] });
|
|
411
|
+
}
|
|
412
|
+
function MoonIcon({ className }) {
|
|
413
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
414
|
+
}
|
|
415
|
+
function ChevronDownIcon({ className }) {
|
|
416
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) });
|
|
417
|
+
}
|
|
418
|
+
function ChevronRightIcon({ className }) {
|
|
419
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) });
|
|
420
|
+
}
|
|
421
|
+
function ChevronLeftIcon({ className }) {
|
|
422
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" }) });
|
|
423
|
+
}
|
|
424
|
+
function ChevronUpIcon({ className }) {
|
|
425
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "18 15 12 9 6 15" }) });
|
|
426
|
+
}
|
|
427
|
+
function TerminalIcon({ className }) {
|
|
428
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
429
|
+
/* @__PURE__ */ jsx("polyline", { points: "4 17 10 11 4 5" }),
|
|
430
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
431
|
+
] });
|
|
432
|
+
}
|
|
433
|
+
function FileIcon({ className }) {
|
|
434
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
435
|
+
/* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
436
|
+
/* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" }),
|
|
437
|
+
/* @__PURE__ */ jsx("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
438
|
+
/* @__PURE__ */ jsx("line", { x1: "16", y1: "17", x2: "8", y2: "17" })
|
|
439
|
+
] });
|
|
440
|
+
}
|
|
441
|
+
function EditIcon({ className }) {
|
|
442
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
443
|
+
/* @__PURE__ */ jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
444
|
+
/* @__PURE__ */ jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
445
|
+
] });
|
|
446
|
+
}
|
|
447
|
+
function FilePlusIcon({ className }) {
|
|
448
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
449
|
+
/* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
450
|
+
/* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" }),
|
|
451
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "18", x2: "12", y2: "12" }),
|
|
452
|
+
/* @__PURE__ */ jsx("line", { x1: "9", y1: "15", x2: "15", y2: "15" })
|
|
453
|
+
] });
|
|
454
|
+
}
|
|
455
|
+
function SearchIcon({ className }) {
|
|
456
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
457
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
458
|
+
/* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
459
|
+
] });
|
|
460
|
+
}
|
|
461
|
+
function GlobeIcon({ className }) {
|
|
462
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
463
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
464
|
+
/* @__PURE__ */ jsx("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
465
|
+
/* @__PURE__ */ jsx("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" })
|
|
466
|
+
] });
|
|
467
|
+
}
|
|
468
|
+
function PlugIcon({ className }) {
|
|
469
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
470
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2v6" }),
|
|
471
|
+
/* @__PURE__ */ jsx("path", { d: "M6 6v4a6 6 0 0 0 12 0V6" }),
|
|
472
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16v6" })
|
|
473
|
+
] });
|
|
474
|
+
}
|
|
475
|
+
function ToolIcon({ className }) {
|
|
476
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("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" }) });
|
|
477
|
+
}
|
|
478
|
+
function FolderSearchIcon({ className }) {
|
|
479
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
480
|
+
/* @__PURE__ */ jsx("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" }),
|
|
481
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "13", r: "3" }),
|
|
482
|
+
/* @__PURE__ */ jsx("line", { x1: "15", y1: "16", x2: "17", y2: "18" })
|
|
483
|
+
] });
|
|
484
|
+
}
|
|
485
|
+
function CodeIcon({ className }) {
|
|
486
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
487
|
+
/* @__PURE__ */ jsx("polyline", { points: "16 18 22 12 16 6" }),
|
|
488
|
+
/* @__PURE__ */ jsx("polyline", { points: "8 6 2 12 8 18" })
|
|
489
|
+
] });
|
|
490
|
+
}
|
|
491
|
+
function CopyIcon({ className }) {
|
|
492
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
493
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
494
|
+
/* @__PURE__ */ jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
495
|
+
] });
|
|
496
|
+
}
|
|
497
|
+
function CheckIcon({ className }) {
|
|
498
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" }) });
|
|
499
|
+
}
|
|
500
|
+
function XIcon({ className }) {
|
|
501
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
502
|
+
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
503
|
+
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
function LoaderIcon({ className }) {
|
|
507
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
508
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "2", x2: "12", y2: "6" }),
|
|
509
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "18", x2: "12", y2: "22" }),
|
|
510
|
+
/* @__PURE__ */ jsx("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }),
|
|
511
|
+
/* @__PURE__ */ jsx("line", { x1: "16.24", y1: "16.24", x2: "19.07", y2: "19.07" }),
|
|
512
|
+
/* @__PURE__ */ jsx("line", { x1: "2", y1: "12", x2: "6", y2: "12" }),
|
|
513
|
+
/* @__PURE__ */ jsx("line", { x1: "18", y1: "12", x2: "22", y2: "12" }),
|
|
514
|
+
/* @__PURE__ */ jsx("line", { x1: "4.93", y1: "19.07", x2: "7.76", y2: "16.24" }),
|
|
515
|
+
/* @__PURE__ */ jsx("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })
|
|
516
|
+
] });
|
|
517
|
+
}
|
|
518
|
+
function InfoIcon({ className }) {
|
|
519
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
520
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
521
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
522
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
523
|
+
] });
|
|
524
|
+
}
|
|
525
|
+
function AlertTriangleIcon({ className }) {
|
|
526
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
527
|
+
/* @__PURE__ */ jsx("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" }),
|
|
528
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
529
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
530
|
+
] });
|
|
531
|
+
}
|
|
532
|
+
function AlertCircleIcon({ className }) {
|
|
533
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
534
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
535
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
536
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
537
|
+
] });
|
|
538
|
+
}
|
|
539
|
+
function BugIcon({ className }) {
|
|
540
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
541
|
+
/* @__PURE__ */ jsx("rect", { x: "8", y: "6", width: "8", height: "14", rx: "4" }),
|
|
542
|
+
/* @__PURE__ */ jsx("path", { d: "M3 10h2" }),
|
|
543
|
+
/* @__PURE__ */ jsx("path", { d: "M19 10h2" }),
|
|
544
|
+
/* @__PURE__ */ jsx("path", { d: "M3 14h2" }),
|
|
545
|
+
/* @__PURE__ */ jsx("path", { d: "M19 14h2" }),
|
|
546
|
+
/* @__PURE__ */ jsx("path", { d: "M9 2h6" }),
|
|
547
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2v4" })
|
|
548
|
+
] });
|
|
549
|
+
}
|
|
550
|
+
function CheckCircleIcon({ className }) {
|
|
551
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
552
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
553
|
+
/* @__PURE__ */ jsx("path", { d: "M9 12l2 2 4-4" })
|
|
554
|
+
] });
|
|
555
|
+
}
|
|
556
|
+
function XCircleIcon({ className }) {
|
|
557
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
558
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
559
|
+
/* @__PURE__ */ jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
560
|
+
/* @__PURE__ */ jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
561
|
+
] });
|
|
562
|
+
}
|
|
563
|
+
function SendIcon({ className }) {
|
|
564
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
565
|
+
/* @__PURE__ */ jsx("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
566
|
+
/* @__PURE__ */ jsx("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
|
|
567
|
+
] });
|
|
568
|
+
}
|
|
569
|
+
function PaperclipIcon({ className }) {
|
|
570
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("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" }) });
|
|
571
|
+
}
|
|
572
|
+
function StopCircleIcon({ className }) {
|
|
573
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
574
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
575
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "6", height: "6" })
|
|
576
|
+
] });
|
|
577
|
+
}
|
|
578
|
+
function MessageSquareIcon({ className }) {
|
|
579
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
580
|
+
}
|
|
581
|
+
function SparklesIcon({ className }) {
|
|
582
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
583
|
+
/* @__PURE__ */ jsx("path", { d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z" }),
|
|
584
|
+
/* @__PURE__ */ jsx("path", { d: "M5 19l.5 1.5L7 21l-1.5.5L5 23l-.5-1.5L3 21l1.5-.5L5 19z" }),
|
|
585
|
+
/* @__PURE__ */ jsx("path", { d: "M19 11l.5 1.5L21 13l-1.5.5L19 15l-.5-1.5L17 13l1.5-.5L19 11z" })
|
|
586
|
+
] });
|
|
587
|
+
}
|
|
588
|
+
function BrainIcon({ className }) {
|
|
589
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
590
|
+
/* @__PURE__ */ jsx("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" }),
|
|
591
|
+
/* @__PURE__ */ jsx("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" })
|
|
592
|
+
] });
|
|
593
|
+
}
|
|
594
|
+
function BotIcon({ className }) {
|
|
595
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
596
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8V4H8" }),
|
|
597
|
+
/* @__PURE__ */ jsx("rect", { x: "5", y: "8", width: "14", height: "12", rx: "2" }),
|
|
598
|
+
/* @__PURE__ */ jsx("path", { d: "M2 14h2" }),
|
|
599
|
+
/* @__PURE__ */ jsx("path", { d: "M20 14h2" }),
|
|
600
|
+
/* @__PURE__ */ jsx("path", { d: "M9 13v2" }),
|
|
601
|
+
/* @__PURE__ */ jsx("path", { d: "M15 13v2" })
|
|
602
|
+
] });
|
|
603
|
+
}
|
|
604
|
+
function UserIcon({ className }) {
|
|
605
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
606
|
+
/* @__PURE__ */ jsx("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
607
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
608
|
+
] });
|
|
609
|
+
}
|
|
610
|
+
function CircleIcon({ className }) {
|
|
611
|
+
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }) });
|
|
612
|
+
}
|
|
613
|
+
function ListChecksIcon({ className }) {
|
|
614
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
615
|
+
/* @__PURE__ */ jsx("path", { d: "M10 6h11" }),
|
|
616
|
+
/* @__PURE__ */ jsx("path", { d: "M10 12h11" }),
|
|
617
|
+
/* @__PURE__ */ jsx("path", { d: "M10 18h11" }),
|
|
618
|
+
/* @__PURE__ */ jsx("path", { d: "M3 6l2 2 4-4" }),
|
|
619
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12l2 2 4-4" }),
|
|
620
|
+
/* @__PURE__ */ jsx("path", { d: "M3 18l2 2 4-4" })
|
|
621
|
+
] });
|
|
622
|
+
}
|
|
623
|
+
function ClipboardListIcon({ className }) {
|
|
624
|
+
return /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
625
|
+
/* @__PURE__ */ jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }),
|
|
626
|
+
/* @__PURE__ */ jsx("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }),
|
|
627
|
+
/* @__PURE__ */ jsx("path", { d: "M12 11h4" }),
|
|
628
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16h4" }),
|
|
629
|
+
/* @__PURE__ */ jsx("path", { d: "M8 11h.01" }),
|
|
630
|
+
/* @__PURE__ */ jsx("path", { d: "M8 16h.01" })
|
|
631
|
+
] });
|
|
632
|
+
}
|
|
633
|
+
function StatusIndicator({ status, size = "sm", className }) {
|
|
634
|
+
const sizeClasses = {
|
|
635
|
+
sm: "w-2 h-2",
|
|
636
|
+
md: "w-3 h-3",
|
|
637
|
+
lg: "w-4 h-4"
|
|
638
|
+
};
|
|
639
|
+
const statusClasses = {
|
|
640
|
+
pending: "ash-status-pending",
|
|
641
|
+
success: "ash-status-success",
|
|
642
|
+
failed: "ash-status-failed"
|
|
643
|
+
};
|
|
644
|
+
return /* @__PURE__ */ jsx(
|
|
645
|
+
"div",
|
|
646
|
+
{
|
|
647
|
+
className: cn(
|
|
648
|
+
"rounded-full flex-shrink-0",
|
|
649
|
+
sizeClasses[size],
|
|
650
|
+
statusClasses[status],
|
|
651
|
+
className
|
|
652
|
+
)
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
function ActionIcon({ actionType, className = "w-4 h-4" }) {
|
|
657
|
+
switch (actionType.action) {
|
|
658
|
+
case "command_run":
|
|
659
|
+
return /* @__PURE__ */ jsx(TerminalIcon, { className });
|
|
660
|
+
case "file_read":
|
|
661
|
+
return /* @__PURE__ */ jsx(FileIcon, { className });
|
|
662
|
+
case "file_edit":
|
|
663
|
+
return /* @__PURE__ */ jsx(EditIcon, { className });
|
|
664
|
+
case "file_write":
|
|
665
|
+
return /* @__PURE__ */ jsx(FilePlusIcon, { className });
|
|
666
|
+
case "search":
|
|
667
|
+
return /* @__PURE__ */ jsx(SearchIcon, { className });
|
|
668
|
+
case "glob":
|
|
669
|
+
return /* @__PURE__ */ jsx(FolderSearchIcon, { className });
|
|
670
|
+
case "web_fetch":
|
|
671
|
+
return /* @__PURE__ */ jsx(GlobeIcon, { className });
|
|
672
|
+
case "web_search":
|
|
673
|
+
return /* @__PURE__ */ jsx(SearchIcon, { className });
|
|
674
|
+
case "mcp_tool":
|
|
675
|
+
return /* @__PURE__ */ jsx(PlugIcon, { className });
|
|
676
|
+
case "todo_write":
|
|
677
|
+
return /* @__PURE__ */ jsx(ListChecksIcon, { className });
|
|
678
|
+
case "generic_tool":
|
|
679
|
+
default:
|
|
680
|
+
return /* @__PURE__ */ jsx(ToolIcon, { className });
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function CodeBlock({
|
|
684
|
+
children,
|
|
685
|
+
maxHeight = 200,
|
|
686
|
+
language,
|
|
687
|
+
showLineNumbers = false,
|
|
688
|
+
className
|
|
689
|
+
}) {
|
|
690
|
+
const [expanded, setExpanded] = useState(false);
|
|
691
|
+
const lines = children.split("\n");
|
|
692
|
+
const isLong = lines.length > 10 || children.length > 500;
|
|
693
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
694
|
+
/* @__PURE__ */ jsx(
|
|
695
|
+
"pre",
|
|
696
|
+
{
|
|
697
|
+
className: cn(
|
|
698
|
+
"ash-tool-code-block text-xs font-mono text-white/90 p-3 rounded-xl overflow-x-auto whitespace-pre-wrap break-words",
|
|
699
|
+
!expanded && isLong && "overflow-y-hidden"
|
|
700
|
+
),
|
|
701
|
+
style: !expanded && isLong ? { maxHeight } : void 0,
|
|
702
|
+
"data-language": language,
|
|
703
|
+
children: showLineNumbers ? /* @__PURE__ */ jsx("code", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("span", { className: "block", children: [
|
|
704
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block w-8 text-white/30 select-none text-right pr-2", children: i + 1 }),
|
|
705
|
+
/* @__PURE__ */ jsx("span", { className: "text-white/80", children: line })
|
|
706
|
+
] }, i)) }) : /* @__PURE__ */ jsx("code", { className: "text-white/80", children })
|
|
707
|
+
}
|
|
708
|
+
),
|
|
709
|
+
isLong && !expanded && /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-12 ash-truncate-fade flex items-end justify-center pb-2", children: /* @__PURE__ */ jsx(
|
|
710
|
+
"button",
|
|
711
|
+
{
|
|
712
|
+
onClick: () => setExpanded(true),
|
|
713
|
+
className: "text-xs text-[var(--ash-accent)] hover:text-[var(--ash-accent-300)] font-medium transition-colors",
|
|
714
|
+
children: "Show more"
|
|
715
|
+
}
|
|
716
|
+
) }),
|
|
717
|
+
isLong && expanded && /* @__PURE__ */ jsx(
|
|
718
|
+
"button",
|
|
719
|
+
{
|
|
720
|
+
onClick: () => setExpanded(false),
|
|
721
|
+
className: "text-xs text-[var(--ash-accent)] hover:text-[var(--ash-accent-300)] font-medium mt-2 transition-colors",
|
|
722
|
+
children: "Show less"
|
|
723
|
+
}
|
|
724
|
+
)
|
|
725
|
+
] });
|
|
726
|
+
}
|
|
727
|
+
function JsonDisplay({ value, maxHeight, className }) {
|
|
728
|
+
const formatted = JSON.stringify(value, null, 2);
|
|
729
|
+
return /* @__PURE__ */ jsx(CodeBlock, { maxHeight, className, children: formatted });
|
|
730
|
+
}
|
|
731
|
+
function SectionHeader({ children }) {
|
|
732
|
+
return /* @__PURE__ */ jsx("div", { className: "ash-tool-section-header", children });
|
|
733
|
+
}
|
|
734
|
+
function SectionContent({ children }) {
|
|
735
|
+
return /* @__PURE__ */ jsx("div", { className: "px-3 py-2", children });
|
|
736
|
+
}
|
|
737
|
+
function CommandRunDetails({ action }) {
|
|
738
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
739
|
+
action.command && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
740
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "COMMAND" }),
|
|
741
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx(CodeBlock, { children: action.command }) })
|
|
742
|
+
] }),
|
|
743
|
+
action.result?.output && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
744
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "OUTPUT" }),
|
|
745
|
+
/* @__PURE__ */ jsxs(SectionContent, { children: [
|
|
746
|
+
/* @__PURE__ */ jsx(CodeBlock, { maxHeight: 300, children: action.result.output }),
|
|
747
|
+
action.result.exitCode !== void 0 && action.result.exitCode !== 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-red-400", children: [
|
|
748
|
+
"Exit code: ",
|
|
749
|
+
action.result.exitCode
|
|
750
|
+
] })
|
|
751
|
+
] })
|
|
752
|
+
] })
|
|
753
|
+
] });
|
|
754
|
+
}
|
|
755
|
+
function FileReadDetails({ action }) {
|
|
756
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
757
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "PATH" }),
|
|
758
|
+
/* @__PURE__ */ jsxs(SectionContent, { children: [
|
|
759
|
+
/* @__PURE__ */ jsx("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: action.path }),
|
|
760
|
+
(action.offset !== void 0 || action.limit !== void 0) && /* @__PURE__ */ jsxs("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
761
|
+
action.offset !== void 0 && /* @__PURE__ */ jsxs("span", { children: [
|
|
762
|
+
"Offset: ",
|
|
763
|
+
action.offset
|
|
764
|
+
] }),
|
|
765
|
+
action.offset !== void 0 && action.limit !== void 0 && /* @__PURE__ */ jsx("span", { children: " \xB7 " }),
|
|
766
|
+
action.limit !== void 0 && /* @__PURE__ */ jsxs("span", { children: [
|
|
767
|
+
"Limit: ",
|
|
768
|
+
action.limit
|
|
769
|
+
] })
|
|
770
|
+
] })
|
|
771
|
+
] })
|
|
772
|
+
] });
|
|
773
|
+
}
|
|
774
|
+
function FileEditDetails({ action }) {
|
|
775
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
776
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "PATH" }),
|
|
777
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: action.path }) }),
|
|
778
|
+
action.oldString && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
779
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "OLD" }),
|
|
780
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx(CodeBlock, { children: action.oldString }) })
|
|
781
|
+
] }),
|
|
782
|
+
action.newString && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
783
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "NEW" }),
|
|
784
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx(CodeBlock, { children: action.newString }) })
|
|
785
|
+
] })
|
|
786
|
+
] });
|
|
787
|
+
}
|
|
788
|
+
function FileWriteDetails({ action }) {
|
|
789
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
790
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "PATH" }),
|
|
791
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: action.path }) }),
|
|
792
|
+
action.content && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
793
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "CONTENT" }),
|
|
794
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx(CodeBlock, { maxHeight: 300, children: action.content }) })
|
|
795
|
+
] })
|
|
796
|
+
] });
|
|
797
|
+
}
|
|
798
|
+
function SearchDetails({ action }) {
|
|
799
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
800
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "PATTERN" }),
|
|
801
|
+
/* @__PURE__ */ jsxs(SectionContent, { children: [
|
|
802
|
+
/* @__PURE__ */ jsx("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: action.pattern }),
|
|
803
|
+
(action.path || action.glob || action.type) && /* @__PURE__ */ jsxs("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
804
|
+
action.path && /* @__PURE__ */ jsxs("span", { children: [
|
|
805
|
+
"Path: ",
|
|
806
|
+
action.path
|
|
807
|
+
] }),
|
|
808
|
+
action.glob && /* @__PURE__ */ jsxs("span", { children: [
|
|
809
|
+
"Glob: ",
|
|
810
|
+
action.glob
|
|
811
|
+
] }),
|
|
812
|
+
action.type && /* @__PURE__ */ jsxs("span", { children: [
|
|
813
|
+
"Type: ",
|
|
814
|
+
action.type
|
|
815
|
+
] })
|
|
816
|
+
] })
|
|
817
|
+
] })
|
|
818
|
+
] });
|
|
819
|
+
}
|
|
820
|
+
function GlobDetails({ action }) {
|
|
821
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
822
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "PATTERN" }),
|
|
823
|
+
/* @__PURE__ */ jsxs(SectionContent, { children: [
|
|
824
|
+
/* @__PURE__ */ jsx("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: action.pattern }),
|
|
825
|
+
action.path && /* @__PURE__ */ jsxs("div", { className: "mt-1 text-xs text-white/50", children: [
|
|
826
|
+
"Path: ",
|
|
827
|
+
action.path
|
|
828
|
+
] })
|
|
829
|
+
] })
|
|
830
|
+
] });
|
|
831
|
+
}
|
|
832
|
+
function WebFetchDetails({ action }) {
|
|
833
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
834
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "URL" }),
|
|
835
|
+
/* @__PURE__ */ jsxs(SectionContent, { children: [
|
|
836
|
+
/* @__PURE__ */ jsx(
|
|
837
|
+
"a",
|
|
838
|
+
{
|
|
839
|
+
href: action.url,
|
|
840
|
+
target: "_blank",
|
|
841
|
+
rel: "noopener noreferrer",
|
|
842
|
+
className: "text-xs text-blue-400 hover:text-blue-300 underline break-all",
|
|
843
|
+
children: action.url
|
|
844
|
+
}
|
|
845
|
+
),
|
|
846
|
+
action.prompt && /* @__PURE__ */ jsx("div", { className: "mt-2 text-xs text-white/50", children: action.prompt })
|
|
847
|
+
] })
|
|
848
|
+
] });
|
|
849
|
+
}
|
|
850
|
+
function WebSearchDetails({ action }) {
|
|
851
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
852
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "QUERY" }),
|
|
853
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx("span", { className: "text-sm text-white/90", children: action.query }) })
|
|
854
|
+
] });
|
|
855
|
+
}
|
|
856
|
+
function McpToolDetails({ action }) {
|
|
857
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
858
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "TOOL" }),
|
|
859
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsxs("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: [
|
|
860
|
+
action.serverName,
|
|
861
|
+
":",
|
|
862
|
+
action.toolName
|
|
863
|
+
] }) }),
|
|
864
|
+
action.arguments && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
865
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "ARGS" }),
|
|
866
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx(JsonDisplay, { value: action.arguments }) })
|
|
867
|
+
] }),
|
|
868
|
+
action.result && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
869
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "RESULT" }),
|
|
870
|
+
/* @__PURE__ */ jsx(SectionContent, { children: action.result.type === "markdown" ? /* @__PURE__ */ jsx(CodeBlock, { children: String(action.result.value) }) : /* @__PURE__ */ jsx(JsonDisplay, { value: action.result.value }) })
|
|
871
|
+
] })
|
|
872
|
+
] });
|
|
873
|
+
}
|
|
874
|
+
function GenericToolDetails({ action }) {
|
|
875
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
876
|
+
action.arguments && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
877
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "ARGS" }),
|
|
878
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx(JsonDisplay, { value: action.arguments }) })
|
|
879
|
+
] }),
|
|
880
|
+
action.result && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
881
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "RESULT" }),
|
|
882
|
+
/* @__PURE__ */ jsx(SectionContent, { children: action.result.type === "markdown" ? /* @__PURE__ */ jsx(CodeBlock, { children: String(action.result.value) }) : /* @__PURE__ */ jsx(JsonDisplay, { value: action.result.value }) })
|
|
883
|
+
] })
|
|
884
|
+
] });
|
|
885
|
+
}
|
|
886
|
+
function TodoWriteDetails({ action }) {
|
|
887
|
+
const { todos, stats } = action;
|
|
888
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
889
|
+
stats && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
890
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "PROGRESS" }),
|
|
891
|
+
/* @__PURE__ */ jsxs(SectionContent, { children: [
|
|
892
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
893
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 h-2 bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
894
|
+
"div",
|
|
895
|
+
{
|
|
896
|
+
className: "h-full bg-emerald-400 rounded-full transition-all duration-500 ease-out",
|
|
897
|
+
style: { width: `${stats.total > 0 ? stats.completed / stats.total * 100 : 0}%` }
|
|
898
|
+
}
|
|
899
|
+
) }),
|
|
900
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-white/60 tabular-nums", children: [
|
|
901
|
+
stats.completed,
|
|
902
|
+
"/",
|
|
903
|
+
stats.total
|
|
904
|
+
] })
|
|
905
|
+
] }),
|
|
906
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 mt-2 text-xs", children: [
|
|
907
|
+
stats.inProgress > 0 && /* @__PURE__ */ jsxs("span", { className: "text-yellow-400", children: [
|
|
908
|
+
stats.inProgress,
|
|
909
|
+
" in progress"
|
|
910
|
+
] }),
|
|
911
|
+
stats.pending > 0 && /* @__PURE__ */ jsxs("span", { className: "text-white/40", children: [
|
|
912
|
+
stats.pending,
|
|
913
|
+
" pending"
|
|
914
|
+
] })
|
|
915
|
+
] })
|
|
916
|
+
] })
|
|
917
|
+
] }),
|
|
918
|
+
/* @__PURE__ */ jsx(SectionHeader, { children: "TASKS" }),
|
|
919
|
+
/* @__PURE__ */ jsx(SectionContent, { children: /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: todos.map((todo, index) => {
|
|
920
|
+
const displayText = todo.status === "in_progress" ? todo.activeForm : todo.content;
|
|
921
|
+
return /* @__PURE__ */ jsxs(
|
|
922
|
+
"div",
|
|
923
|
+
{
|
|
924
|
+
className: cn(
|
|
925
|
+
"flex items-start gap-2 py-1 transition-all duration-200",
|
|
926
|
+
todo.status === "completed" && "opacity-50",
|
|
927
|
+
todo.status === "in_progress" && "bg-yellow-500/10 -mx-2 px-2 rounded"
|
|
928
|
+
),
|
|
929
|
+
children: [
|
|
930
|
+
todo.status === "completed" ? /* @__PURE__ */ jsx(CheckCircleIcon, { className: "w-4 h-4 text-emerald-400 shrink-0 mt-0.5" }) : todo.status === "in_progress" ? /* @__PURE__ */ jsx(LoaderIcon, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ jsx(CircleIcon, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
|
|
931
|
+
/* @__PURE__ */ jsxs(
|
|
932
|
+
"span",
|
|
933
|
+
{
|
|
934
|
+
className: cn(
|
|
935
|
+
"text-sm leading-relaxed",
|
|
936
|
+
todo.status === "completed" ? "text-white/50 line-through" : "text-white/80"
|
|
937
|
+
),
|
|
938
|
+
children: [
|
|
939
|
+
/* @__PURE__ */ jsxs("span", { className: "text-white/40 mr-1.5", children: [
|
|
940
|
+
index + 1,
|
|
941
|
+
"."
|
|
942
|
+
] }),
|
|
943
|
+
displayText
|
|
944
|
+
]
|
|
945
|
+
}
|
|
946
|
+
)
|
|
947
|
+
]
|
|
948
|
+
},
|
|
949
|
+
`${todo.content}-${index}`
|
|
950
|
+
);
|
|
951
|
+
}) }) })
|
|
952
|
+
] });
|
|
953
|
+
}
|
|
954
|
+
function ToolDetails({ actionType }) {
|
|
955
|
+
switch (actionType.action) {
|
|
956
|
+
case "command_run":
|
|
957
|
+
return /* @__PURE__ */ jsx(CommandRunDetails, { action: actionType });
|
|
958
|
+
case "file_read":
|
|
959
|
+
return /* @__PURE__ */ jsx(FileReadDetails, { action: actionType });
|
|
960
|
+
case "file_edit":
|
|
961
|
+
return /* @__PURE__ */ jsx(FileEditDetails, { action: actionType });
|
|
962
|
+
case "file_write":
|
|
963
|
+
return /* @__PURE__ */ jsx(FileWriteDetails, { action: actionType });
|
|
964
|
+
case "search":
|
|
965
|
+
return /* @__PURE__ */ jsx(SearchDetails, { action: actionType });
|
|
966
|
+
case "glob":
|
|
967
|
+
return /* @__PURE__ */ jsx(GlobDetails, { action: actionType });
|
|
968
|
+
case "web_fetch":
|
|
969
|
+
return /* @__PURE__ */ jsx(WebFetchDetails, { action: actionType });
|
|
970
|
+
case "web_search":
|
|
971
|
+
return /* @__PURE__ */ jsx(WebSearchDetails, { action: actionType });
|
|
972
|
+
case "mcp_tool":
|
|
973
|
+
return /* @__PURE__ */ jsx(McpToolDetails, { action: actionType });
|
|
974
|
+
case "generic_tool":
|
|
975
|
+
return /* @__PURE__ */ jsx(GenericToolDetails, { action: actionType });
|
|
976
|
+
case "todo_write":
|
|
977
|
+
return /* @__PURE__ */ jsx(TodoWriteDetails, { action: actionType });
|
|
978
|
+
default:
|
|
979
|
+
return null;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
function hasDetails(actionType) {
|
|
983
|
+
switch (actionType.action) {
|
|
984
|
+
case "command_run":
|
|
985
|
+
return Boolean(actionType.command || actionType.result?.output);
|
|
986
|
+
case "file_read":
|
|
987
|
+
return true;
|
|
988
|
+
case "file_edit":
|
|
989
|
+
return Boolean(actionType.oldString || actionType.newString);
|
|
990
|
+
case "file_write":
|
|
991
|
+
return Boolean(actionType.content);
|
|
992
|
+
case "search":
|
|
993
|
+
return true;
|
|
994
|
+
case "glob":
|
|
995
|
+
return true;
|
|
996
|
+
case "web_fetch":
|
|
997
|
+
return true;
|
|
998
|
+
case "web_search":
|
|
999
|
+
return true;
|
|
1000
|
+
case "mcp_tool":
|
|
1001
|
+
return Boolean(actionType.arguments || actionType.result);
|
|
1002
|
+
case "generic_tool":
|
|
1003
|
+
return Boolean(actionType.arguments || actionType.result);
|
|
1004
|
+
case "todo_write":
|
|
1005
|
+
return actionType.todos.length > 0;
|
|
1006
|
+
default:
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
function ToolCallCard({ toolCall, defaultExpanded = false, className }) {
|
|
1011
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
1012
|
+
const { actionType, status, summary } = toolCall;
|
|
1013
|
+
const canExpand = hasDetails(actionType);
|
|
1014
|
+
const statusClasses = {
|
|
1015
|
+
pending: "border-yellow-500/30 ash-tool-status-pending",
|
|
1016
|
+
success: "border-white/10",
|
|
1017
|
+
failed: "border-red-500/30"
|
|
1018
|
+
};
|
|
1019
|
+
return /* @__PURE__ */ jsxs(
|
|
1020
|
+
"div",
|
|
1021
|
+
{
|
|
1022
|
+
className: cn(
|
|
1023
|
+
"rounded-xl border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
|
|
1024
|
+
statusClasses[status],
|
|
1025
|
+
className
|
|
1026
|
+
),
|
|
1027
|
+
children: [
|
|
1028
|
+
/* @__PURE__ */ jsxs(
|
|
1029
|
+
"button",
|
|
1030
|
+
{
|
|
1031
|
+
onClick: () => canExpand && setExpanded(!expanded),
|
|
1032
|
+
className: cn(
|
|
1033
|
+
"w-full px-4 py-3 flex items-center justify-between transition-colors",
|
|
1034
|
+
canExpand ? "hover:bg-white/5 cursor-pointer" : "cursor-default"
|
|
1035
|
+
),
|
|
1036
|
+
disabled: !canExpand,
|
|
1037
|
+
children: [
|
|
1038
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0 flex-1", children: [
|
|
1039
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
1040
|
+
"w-6 h-6 rounded-lg flex items-center justify-center shrink-0",
|
|
1041
|
+
status === "pending" ? "bg-yellow-500/20" : status === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
|
|
1042
|
+
), children: /* @__PURE__ */ jsx(
|
|
1043
|
+
ActionIcon,
|
|
1044
|
+
{
|
|
1045
|
+
actionType,
|
|
1046
|
+
className: cn(
|
|
1047
|
+
"w-3.5 h-3.5",
|
|
1048
|
+
status === "pending" ? "text-yellow-400" : status === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
|
|
1049
|
+
)
|
|
1050
|
+
}
|
|
1051
|
+
) }),
|
|
1052
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-white shrink-0", children: getActionLabel(actionType) }),
|
|
1053
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm truncate text-white/60 min-w-0", children: summary })
|
|
1054
|
+
] }),
|
|
1055
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
1056
|
+
/* @__PURE__ */ jsx(StatusIndicator, { status, size: "sm" }),
|
|
1057
|
+
canExpand && /* @__PURE__ */ jsx(
|
|
1058
|
+
ChevronDownIcon,
|
|
1059
|
+
{
|
|
1060
|
+
className: cn(
|
|
1061
|
+
"w-4 h-4 text-white/40 transition-transform duration-200",
|
|
1062
|
+
expanded && "rotate-180"
|
|
1063
|
+
)
|
|
1064
|
+
}
|
|
1065
|
+
)
|
|
1066
|
+
] })
|
|
1067
|
+
]
|
|
1068
|
+
}
|
|
1069
|
+
),
|
|
1070
|
+
expanded && canExpand && /* @__PURE__ */ jsxs("div", { className: "border-t border-white/5 max-h-[400px] overflow-y-auto ash-scrollbar bg-black/20", children: [
|
|
1071
|
+
/* @__PURE__ */ jsx(ToolDetails, { actionType }),
|
|
1072
|
+
status === "success" && /* @__PURE__ */ jsx("div", { className: "px-4 py-3 border-t border-white/5 bg-[var(--ash-accent)]/5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1073
|
+
/* @__PURE__ */ jsx(CheckIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }),
|
|
1074
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-[var(--ash-accent)] font-medium", children: "Completed successfully" })
|
|
1075
|
+
] }) })
|
|
1076
|
+
] })
|
|
1077
|
+
]
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
function OptionCards({ options, onSelect, className }) {
|
|
1082
|
+
return /* @__PURE__ */ jsx("div", { className: cn("grid gap-2 mt-3", className), style: {
|
|
1083
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))"
|
|
1084
|
+
}, children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
1085
|
+
"button",
|
|
1086
|
+
{
|
|
1087
|
+
onClick: () => onSelect(option),
|
|
1088
|
+
className: cn(
|
|
1089
|
+
"flex items-start gap-3 p-3 rounded-xl text-left",
|
|
1090
|
+
"bg-white/5 border border-white/10",
|
|
1091
|
+
"hover:bg-[var(--ash-accent)]/10 hover:border-[var(--ash-accent)]/30",
|
|
1092
|
+
"focus:outline-none focus:ring-2 focus:ring-[var(--ash-accent)]/50",
|
|
1093
|
+
"transition-all duration-200 cursor-pointer",
|
|
1094
|
+
"group"
|
|
1095
|
+
),
|
|
1096
|
+
children: [
|
|
1097
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
1098
|
+
"flex-shrink-0 w-6 h-6 rounded-lg",
|
|
1099
|
+
"bg-[var(--ash-accent)]/20 text-[var(--ash-accent)]",
|
|
1100
|
+
"flex items-center justify-center",
|
|
1101
|
+
"text-xs font-semibold",
|
|
1102
|
+
"group-hover:bg-[var(--ash-accent)]/30",
|
|
1103
|
+
"transition-colors duration-200"
|
|
1104
|
+
), children: option.id }),
|
|
1105
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1106
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-white/90 group-hover:text-white transition-colors", children: option.label }),
|
|
1107
|
+
option.description && /* @__PURE__ */ jsx("div", { className: "text-xs text-white/50 mt-0.5 line-clamp-2 group-hover:text-white/60 transition-colors", children: option.description })
|
|
1108
|
+
] }),
|
|
1109
|
+
/* @__PURE__ */ jsx(
|
|
1110
|
+
"svg",
|
|
1111
|
+
{
|
|
1112
|
+
className: cn(
|
|
1113
|
+
"w-4 h-4 text-white/30 flex-shrink-0 mt-0.5",
|
|
1114
|
+
"group-hover:text-[var(--ash-accent)] group-hover:translate-x-0.5",
|
|
1115
|
+
"transition-all duration-200"
|
|
1116
|
+
),
|
|
1117
|
+
fill: "none",
|
|
1118
|
+
viewBox: "0 0 24 24",
|
|
1119
|
+
stroke: "currentColor",
|
|
1120
|
+
strokeWidth: 2,
|
|
1121
|
+
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1124
|
+
]
|
|
1125
|
+
},
|
|
1126
|
+
option.id
|
|
1127
|
+
)) });
|
|
1128
|
+
}
|
|
1129
|
+
function parseFilesFromContent(content) {
|
|
1130
|
+
const fileMarker = "[Uploaded files available at /uploads/]";
|
|
1131
|
+
const markerIndex = content.indexOf(fileMarker);
|
|
1132
|
+
if (markerIndex === -1) {
|
|
1133
|
+
return { text: content, files: [] };
|
|
1134
|
+
}
|
|
1135
|
+
const text = content.substring(0, markerIndex).trim();
|
|
1136
|
+
const fileSection = content.substring(markerIndex + fileMarker.length).trim();
|
|
1137
|
+
const files = fileSection.split("\n").filter((line) => line.startsWith("- ")).map((line) => line.substring(2).trim());
|
|
1138
|
+
return { text, files };
|
|
1139
|
+
}
|
|
1140
|
+
function UserMessage({ entry, className }) {
|
|
1141
|
+
const { text, files } = parseFilesFromContent(entry.content);
|
|
1142
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 justify-end ash-animate-fade-in", className), children: [
|
|
1143
|
+
/* @__PURE__ */ jsxs("div", { className: "max-w-[85%]", children: [
|
|
1144
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-2xl p-4 bg-[var(--ash-accent)] text-[var(--ash-accent-foreground)]", children: /* @__PURE__ */ jsx("p", { className: "text-sm leading-relaxed whitespace-pre-wrap", children: text || "(files attached)" }) }),
|
|
1145
|
+
files.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 pt-2 border-t border-[var(--ash-accent-foreground)]/20", children: [
|
|
1146
|
+
/* @__PURE__ */ jsxs("div", { className: "text-xs text-[var(--ash-accent-foreground)]/60 mb-1 flex items-center gap-1", children: [
|
|
1147
|
+
/* @__PURE__ */ jsx(PaperclipIcon, { className: "w-3 h-3" }),
|
|
1148
|
+
"Attached Files"
|
|
1149
|
+
] }),
|
|
1150
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: files.map((file, index) => /* @__PURE__ */ jsx(
|
|
1151
|
+
"span",
|
|
1152
|
+
{
|
|
1153
|
+
className: "inline-flex items-center px-2 py-0.5 rounded-lg bg-[var(--ash-accent-foreground)]/10 text-xs",
|
|
1154
|
+
title: file,
|
|
1155
|
+
children: file.split(" (")[0]
|
|
1156
|
+
},
|
|
1157
|
+
index
|
|
1158
|
+
)) })
|
|
1159
|
+
] }),
|
|
1160
|
+
entry.timestamp && /* @__PURE__ */ jsx("div", { className: "text-xs text-white/40 mt-2", children: formatTimestamp(entry.timestamp) })
|
|
1161
|
+
] }),
|
|
1162
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(UserIcon, { className: "w-4 h-4 text-white/50" }) })
|
|
1163
|
+
] });
|
|
1164
|
+
}
|
|
1165
|
+
function AssistantMessage({ entry, onOptionSelect, className }) {
|
|
1166
|
+
const parsedOptions = parseOptionsFromContent(entry.content);
|
|
1167
|
+
const handleOptionSelect = (option) => {
|
|
1168
|
+
if (onOptionSelect) {
|
|
1169
|
+
onOptionSelect(`Option ${option.id}: ${option.label}`);
|
|
1170
|
+
}
|
|
1171
|
+
};
|
|
1172
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 ash-animate-fade-in", className), children: [
|
|
1173
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(BotIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
|
|
1174
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 max-w-[85%]", children: [
|
|
1175
|
+
/* @__PURE__ */ jsx("div", { className: "ash-card-glass rounded-2xl p-4", children: /* @__PURE__ */ jsx("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: parsedOptions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1176
|
+
parsedOptions.preamble && /* @__PURE__ */ jsx(ReactMarkdown, { children: parsedOptions.preamble }),
|
|
1177
|
+
/* @__PURE__ */ jsx(
|
|
1178
|
+
OptionCards,
|
|
1179
|
+
{
|
|
1180
|
+
options: parsedOptions.options,
|
|
1181
|
+
onSelect: handleOptionSelect
|
|
1182
|
+
}
|
|
1183
|
+
)
|
|
1184
|
+
] }) : /* @__PURE__ */ jsx(ReactMarkdown, { children: entry.content }) }) }),
|
|
1185
|
+
entry.timestamp && /* @__PURE__ */ jsx("div", { className: "text-xs text-white/40 mt-2", children: formatTimestamp(entry.timestamp) })
|
|
1186
|
+
] })
|
|
1187
|
+
] });
|
|
1188
|
+
}
|
|
1189
|
+
function ThinkingMessage({ entry, className }) {
|
|
1190
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 ash-animate-fade-in", className), children: [
|
|
1191
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-purple-500/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(SparklesIcon, { className: "w-4 h-4 text-purple-400" }) }),
|
|
1192
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ jsxs("div", { className: "rounded-2xl p-4 bg-purple-500/10 border border-purple-500/30", children: [
|
|
1193
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-purple-400 mb-2 font-medium", children: "Thinking" }),
|
|
1194
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-purple-300 italic opacity-80 whitespace-pre-wrap leading-relaxed", children: entry.content })
|
|
1195
|
+
] }) })
|
|
1196
|
+
] });
|
|
1197
|
+
}
|
|
1198
|
+
function ToolCallMessage({ entry, defaultExpanded = false, className }) {
|
|
1199
|
+
if (entry.entryType.type !== "tool_call") return null;
|
|
1200
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 ash-animate-fade-in", className), children: [
|
|
1201
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(BotIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
|
|
1202
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(ToolCallCard, { toolCall: entry.entryType.toolCall, defaultExpanded }) })
|
|
1203
|
+
] });
|
|
1204
|
+
}
|
|
1205
|
+
function ErrorMessage({ entry, className }) {
|
|
1206
|
+
if (entry.entryType.type !== "error") return null;
|
|
1207
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 ash-animate-fade-in", className), children: [
|
|
1208
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-red-500/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(AlertTriangleIcon, { className: "w-4 h-4 text-red-400" }) }),
|
|
1209
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ jsxs("div", { className: "rounded-2xl p-4 bg-red-500/10 border border-red-500/30", children: [
|
|
1210
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-red-400 mb-2 font-medium", children: "Error" }),
|
|
1211
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-red-300", children: entry.entryType.message }),
|
|
1212
|
+
entry.entryType.code && /* @__PURE__ */ jsxs("p", { className: "text-xs text-red-400/70 mt-2 font-mono", children: [
|
|
1213
|
+
"Code: ",
|
|
1214
|
+
entry.entryType.code
|
|
1215
|
+
] })
|
|
1216
|
+
] }) })
|
|
1217
|
+
] });
|
|
1218
|
+
}
|
|
1219
|
+
function MessageEntry({ entry, onOptionSelect, className }) {
|
|
1220
|
+
switch (entry.entryType.type) {
|
|
1221
|
+
case "user_message":
|
|
1222
|
+
return /* @__PURE__ */ jsx(UserMessage, { entry, className });
|
|
1223
|
+
case "assistant_message":
|
|
1224
|
+
return /* @__PURE__ */ jsx(AssistantMessage, { entry, onOptionSelect, className });
|
|
1225
|
+
case "thinking":
|
|
1226
|
+
return /* @__PURE__ */ jsx(ThinkingMessage, { entry, className });
|
|
1227
|
+
case "tool_call":
|
|
1228
|
+
return /* @__PURE__ */ jsx(ToolCallMessage, { entry, className });
|
|
1229
|
+
case "error":
|
|
1230
|
+
return /* @__PURE__ */ jsx(ErrorMessage, { entry, className });
|
|
1231
|
+
default:
|
|
1232
|
+
return null;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
function LoadingIndicator({ variant = "dots", size = "md", className }) {
|
|
1236
|
+
if (variant === "dots") {
|
|
1237
|
+
const dotSizes = {
|
|
1238
|
+
sm: "w-1 h-1",
|
|
1239
|
+
md: "w-1.5 h-1.5",
|
|
1240
|
+
lg: "w-2 h-2"
|
|
1241
|
+
};
|
|
1242
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1", className), children: [
|
|
1243
|
+
/* @__PURE__ */ jsx("span", { className: cn("rounded-full bg-[var(--ash-accent)] animate-pulse", dotSizes[size]) }),
|
|
1244
|
+
/* @__PURE__ */ jsx("span", { className: cn("rounded-full bg-[var(--ash-accent)] animate-pulse", dotSizes[size]), style: { animationDelay: "150ms" } }),
|
|
1245
|
+
/* @__PURE__ */ jsx("span", { className: cn("rounded-full bg-[var(--ash-accent)] animate-pulse", dotSizes[size]), style: { animationDelay: "300ms" } })
|
|
1246
|
+
] });
|
|
1247
|
+
}
|
|
1248
|
+
if (variant === "pulse") {
|
|
1249
|
+
const dotSizes = {
|
|
1250
|
+
sm: "w-1.5 h-1.5",
|
|
1251
|
+
md: "w-2 h-2",
|
|
1252
|
+
lg: "w-3 h-3"
|
|
1253
|
+
};
|
|
1254
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1", className), children: /* @__PURE__ */ jsx("span", { className: cn("bg-[var(--ash-accent)] rounded-full animate-pulse", dotSizes[size]) }) });
|
|
1255
|
+
}
|
|
1256
|
+
if (variant === "cursor") {
|
|
1257
|
+
const cursorSizes = {
|
|
1258
|
+
sm: "w-1 h-3",
|
|
1259
|
+
md: "w-1.5 h-4",
|
|
1260
|
+
lg: "w-2 h-5"
|
|
1261
|
+
};
|
|
1262
|
+
return /* @__PURE__ */ jsx(
|
|
1263
|
+
"span",
|
|
1264
|
+
{
|
|
1265
|
+
className: cn(
|
|
1266
|
+
"inline-block bg-[var(--ash-accent)]/50 ash-tool-status-pending",
|
|
1267
|
+
cursorSizes[size],
|
|
1268
|
+
className
|
|
1269
|
+
)
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
const spinnerSizes = {
|
|
1274
|
+
sm: "w-4 h-4",
|
|
1275
|
+
md: "w-6 h-6",
|
|
1276
|
+
lg: "w-8 h-8"
|
|
1277
|
+
};
|
|
1278
|
+
return /* @__PURE__ */ jsx("div", { className: cn("animate-spin text-[var(--ash-accent)]", spinnerSizes[size], className), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1279
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", className: "opacity-25" }),
|
|
1280
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2a10 10 0 0 1 10 10", strokeLinecap: "round" })
|
|
1281
|
+
] }) });
|
|
1282
|
+
}
|
|
1283
|
+
function StreamingText({
|
|
1284
|
+
content,
|
|
1285
|
+
isStreaming = false,
|
|
1286
|
+
renderMarkdown = true,
|
|
1287
|
+
className
|
|
1288
|
+
}) {
|
|
1289
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative", className), children: renderMarkdown ? /* @__PURE__ */ jsxs("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: [
|
|
1290
|
+
/* @__PURE__ */ jsx(ReactMarkdown, { children: content }),
|
|
1291
|
+
isStreaming && /* @__PURE__ */ jsx(LoadingIndicator, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
|
|
1292
|
+
] }) : /* @__PURE__ */ jsxs("p", { className: "whitespace-pre-wrap text-sm leading-relaxed", children: [
|
|
1293
|
+
content,
|
|
1294
|
+
isStreaming && /* @__PURE__ */ jsx(LoadingIndicator, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
|
|
1295
|
+
] }) });
|
|
1296
|
+
}
|
|
1297
|
+
function CompactToolStatusLine({
|
|
1298
|
+
toolCall,
|
|
1299
|
+
previousToolCall,
|
|
1300
|
+
animationDuration = 300,
|
|
1301
|
+
className
|
|
1302
|
+
}) {
|
|
1303
|
+
const [isAnimating, setIsAnimating] = useState(false);
|
|
1304
|
+
const [displayedToolCall, setDisplayedToolCall] = useState(toolCall);
|
|
1305
|
+
const [exitingToolCall, setExitingToolCall] = useState(null);
|
|
1306
|
+
const prevToolCallRef = useRef(null);
|
|
1307
|
+
useEffect(() => {
|
|
1308
|
+
if (toolCall.id !== prevToolCallRef.current) {
|
|
1309
|
+
if (prevToolCallRef.current !== null && previousToolCall) {
|
|
1310
|
+
setExitingToolCall(previousToolCall);
|
|
1311
|
+
setIsAnimating(true);
|
|
1312
|
+
const timer = setTimeout(() => {
|
|
1313
|
+
setDisplayedToolCall(toolCall);
|
|
1314
|
+
setExitingToolCall(null);
|
|
1315
|
+
setIsAnimating(false);
|
|
1316
|
+
}, animationDuration);
|
|
1317
|
+
prevToolCallRef.current = toolCall.id;
|
|
1318
|
+
return () => clearTimeout(timer);
|
|
1319
|
+
} else {
|
|
1320
|
+
setDisplayedToolCall(toolCall);
|
|
1321
|
+
prevToolCallRef.current = toolCall.id;
|
|
1322
|
+
}
|
|
1323
|
+
} else {
|
|
1324
|
+
setDisplayedToolCall(toolCall);
|
|
1325
|
+
}
|
|
1326
|
+
return void 0;
|
|
1327
|
+
}, [toolCall, previousToolCall, animationDuration]);
|
|
1328
|
+
const statusClasses = {
|
|
1329
|
+
pending: "border-yellow-500/30",
|
|
1330
|
+
success: "border-[var(--ash-accent)]/30",
|
|
1331
|
+
failed: "border-red-500/30"
|
|
1332
|
+
};
|
|
1333
|
+
const renderToolCallContent = (tc, isExiting) => /* @__PURE__ */ jsxs(
|
|
1334
|
+
"div",
|
|
1335
|
+
{
|
|
1336
|
+
className: cn(
|
|
1337
|
+
"flex items-center gap-3 px-4 py-2.5",
|
|
1338
|
+
isExiting ? "ash-status-line-exit" : isAnimating ? "ash-status-line-enter" : ""
|
|
1339
|
+
),
|
|
1340
|
+
style: {
|
|
1341
|
+
animationDuration: `${animationDuration}ms`
|
|
1342
|
+
},
|
|
1343
|
+
children: [
|
|
1344
|
+
/* @__PURE__ */ jsx(
|
|
1345
|
+
"div",
|
|
1346
|
+
{
|
|
1347
|
+
className: cn(
|
|
1348
|
+
"w-6 h-6 rounded-lg flex items-center justify-center shrink-0",
|
|
1349
|
+
tc.status === "pending" ? "bg-yellow-500/20" : tc.status === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
|
|
1350
|
+
),
|
|
1351
|
+
children: /* @__PURE__ */ jsx(
|
|
1352
|
+
ActionIcon,
|
|
1353
|
+
{
|
|
1354
|
+
actionType: tc.actionType,
|
|
1355
|
+
className: cn(
|
|
1356
|
+
"w-3.5 h-3.5",
|
|
1357
|
+
tc.status === "pending" ? "text-yellow-400" : tc.status === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
|
|
1358
|
+
)
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
}
|
|
1362
|
+
),
|
|
1363
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-white shrink-0", children: getActionLabel(tc.actionType) }),
|
|
1364
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm truncate text-white/60 flex-1 min-w-0", children: tc.summary }),
|
|
1365
|
+
/* @__PURE__ */ jsx(StatusIndicator, { status: tc.status, size: "sm" })
|
|
1366
|
+
]
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1369
|
+
return /* @__PURE__ */ jsxs(
|
|
1370
|
+
"div",
|
|
1371
|
+
{
|
|
1372
|
+
className: cn(
|
|
1373
|
+
"relative rounded-xl border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
|
|
1374
|
+
statusClasses[displayedToolCall.status],
|
|
1375
|
+
displayedToolCall.status === "pending" && "ash-tool-status-pending",
|
|
1376
|
+
className
|
|
1377
|
+
),
|
|
1378
|
+
children: [
|
|
1379
|
+
exitingToolCall && /* @__PURE__ */ jsx("div", { className: "absolute inset-0", children: renderToolCallContent(exitingToolCall, true) }),
|
|
1380
|
+
renderToolCallContent(displayedToolCall, false)
|
|
1381
|
+
]
|
|
1382
|
+
}
|
|
1383
|
+
);
|
|
1384
|
+
}
|
|
1385
|
+
function calculateGroupStatus(toolCalls) {
|
|
1386
|
+
const hasPending = toolCalls.some((tc) => tc.status === "pending");
|
|
1387
|
+
const hasFailed = toolCalls.some((tc) => tc.status === "failed");
|
|
1388
|
+
const allSuccess = toolCalls.every((tc) => tc.status === "success");
|
|
1389
|
+
if (hasPending) return "pending";
|
|
1390
|
+
if (allSuccess) return "success";
|
|
1391
|
+
if (hasFailed && !hasPending) return toolCalls.some((tc) => tc.status === "success") ? "partial_failure" : "failed";
|
|
1392
|
+
return "pending";
|
|
1393
|
+
}
|
|
1394
|
+
function ToolExecutionGroup({
|
|
1395
|
+
toolCalls,
|
|
1396
|
+
defaultExpanded = false,
|
|
1397
|
+
animationDuration = 300,
|
|
1398
|
+
className
|
|
1399
|
+
}) {
|
|
1400
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
1401
|
+
const activeToolCall = toolCalls[toolCalls.length - 1];
|
|
1402
|
+
const previousToolCall = toolCalls.length > 1 ? toolCalls[toolCalls.length - 2] : null;
|
|
1403
|
+
const groupStatus = useMemo(() => calculateGroupStatus(toolCalls), [toolCalls]);
|
|
1404
|
+
const completedCount = toolCalls.filter((tc) => tc.status === "success").length;
|
|
1405
|
+
const failedCount = toolCalls.filter((tc) => tc.status === "failed").length;
|
|
1406
|
+
const totalCount = toolCalls.length;
|
|
1407
|
+
if (!activeToolCall) {
|
|
1408
|
+
return null;
|
|
1409
|
+
}
|
|
1410
|
+
const borderClasses = {
|
|
1411
|
+
pending: "border-yellow-500/30",
|
|
1412
|
+
success: "border-[var(--ash-accent)]/30",
|
|
1413
|
+
partial_failure: "border-orange-500/30",
|
|
1414
|
+
failed: "border-red-500/30"
|
|
1415
|
+
};
|
|
1416
|
+
return /* @__PURE__ */ jsxs(
|
|
1417
|
+
"div",
|
|
1418
|
+
{
|
|
1419
|
+
className: cn(
|
|
1420
|
+
"rounded-xl border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden ash-animate-fade-in",
|
|
1421
|
+
borderClasses[groupStatus],
|
|
1422
|
+
groupStatus === "pending" && "ash-tool-status-pending",
|
|
1423
|
+
className
|
|
1424
|
+
),
|
|
1425
|
+
children: [
|
|
1426
|
+
/* @__PURE__ */ jsx(
|
|
1427
|
+
"button",
|
|
1428
|
+
{
|
|
1429
|
+
onClick: () => setExpanded(!expanded),
|
|
1430
|
+
className: cn(
|
|
1431
|
+
"w-full transition-colors hover:bg-white/5 cursor-pointer"
|
|
1432
|
+
),
|
|
1433
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1434
|
+
/* @__PURE__ */ jsx(
|
|
1435
|
+
CompactToolStatusLine,
|
|
1436
|
+
{
|
|
1437
|
+
toolCall: activeToolCall,
|
|
1438
|
+
previousToolCall,
|
|
1439
|
+
animationDuration,
|
|
1440
|
+
className: "border-0 rounded-none"
|
|
1441
|
+
}
|
|
1442
|
+
),
|
|
1443
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2", children: [
|
|
1444
|
+
totalCount > 1 && /* @__PURE__ */ jsx(
|
|
1445
|
+
"div",
|
|
1446
|
+
{
|
|
1447
|
+
className: cn(
|
|
1448
|
+
"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium",
|
|
1449
|
+
groupStatus === "pending" ? "bg-yellow-500/20 text-yellow-400" : groupStatus === "success" ? "bg-[var(--ash-accent)]/20 text-[var(--ash-accent)]" : groupStatus === "failed" ? "bg-red-500/20 text-red-400" : "bg-orange-500/20 text-orange-400"
|
|
1450
|
+
),
|
|
1451
|
+
children: groupStatus === "pending" ? /* @__PURE__ */ jsxs("span", { children: [
|
|
1452
|
+
completedCount,
|
|
1453
|
+
"/",
|
|
1454
|
+
totalCount
|
|
1455
|
+
] }) : failedCount > 0 ? /* @__PURE__ */ jsxs("span", { children: [
|
|
1456
|
+
completedCount,
|
|
1457
|
+
" ok, ",
|
|
1458
|
+
failedCount,
|
|
1459
|
+
" failed"
|
|
1460
|
+
] }) : /* @__PURE__ */ jsxs("span", { children: [
|
|
1461
|
+
totalCount,
|
|
1462
|
+
" tools"
|
|
1463
|
+
] })
|
|
1464
|
+
}
|
|
1465
|
+
),
|
|
1466
|
+
/* @__PURE__ */ jsx(
|
|
1467
|
+
ChevronDownIcon,
|
|
1468
|
+
{
|
|
1469
|
+
className: cn(
|
|
1470
|
+
"w-4 h-4 text-white/40 transition-transform duration-200",
|
|
1471
|
+
expanded && "rotate-180"
|
|
1472
|
+
)
|
|
1473
|
+
}
|
|
1474
|
+
)
|
|
1475
|
+
] })
|
|
1476
|
+
] })
|
|
1477
|
+
}
|
|
1478
|
+
),
|
|
1479
|
+
expanded && /* @__PURE__ */ jsxs("div", { className: "border-t border-white/5 bg-black/20", children: [
|
|
1480
|
+
/* @__PURE__ */ jsx("div", { className: "p-3 space-y-2", children: toolCalls.map((toolCall, index) => /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1481
|
+
index < toolCalls.length - 1 && /* @__PURE__ */ jsx("div", { className: "absolute left-[19px] top-10 bottom-0 w-px bg-white/10" }),
|
|
1482
|
+
/* @__PURE__ */ jsx(
|
|
1483
|
+
ToolCallCard,
|
|
1484
|
+
{
|
|
1485
|
+
toolCall,
|
|
1486
|
+
defaultExpanded: false,
|
|
1487
|
+
className: "relative z-10"
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
] }, toolCall.id)) }),
|
|
1491
|
+
groupStatus !== "pending" && /* @__PURE__ */ jsx(
|
|
1492
|
+
"div",
|
|
1493
|
+
{
|
|
1494
|
+
className: cn(
|
|
1495
|
+
"px-4 py-3 border-t border-white/5 flex items-center gap-2",
|
|
1496
|
+
groupStatus === "success" ? "bg-[var(--ash-accent)]/5" : groupStatus === "failed" ? "bg-red-500/5" : "bg-orange-500/5"
|
|
1497
|
+
),
|
|
1498
|
+
children: groupStatus === "success" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1499
|
+
/* @__PURE__ */ jsx(CheckIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }),
|
|
1500
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-[var(--ash-accent)] font-medium", children: [
|
|
1501
|
+
"All ",
|
|
1502
|
+
totalCount,
|
|
1503
|
+
" tool",
|
|
1504
|
+
totalCount !== 1 ? "s" : "",
|
|
1505
|
+
" completed successfully"
|
|
1506
|
+
] })
|
|
1507
|
+
] }) : groupStatus === "failed" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1508
|
+
/* @__PURE__ */ jsx(StatusIndicator, { status: "failed", size: "sm" }),
|
|
1509
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-red-400 font-medium", children: [
|
|
1510
|
+
failedCount,
|
|
1511
|
+
" tool",
|
|
1512
|
+
failedCount !== 1 ? "s" : "",
|
|
1513
|
+
" failed"
|
|
1514
|
+
] })
|
|
1515
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1516
|
+
/* @__PURE__ */ jsx(StatusIndicator, { status: "failed", size: "sm" }),
|
|
1517
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-orange-400 font-medium", children: [
|
|
1518
|
+
completedCount,
|
|
1519
|
+
" succeeded, ",
|
|
1520
|
+
failedCount,
|
|
1521
|
+
" failed"
|
|
1522
|
+
] })
|
|
1523
|
+
] })
|
|
1524
|
+
}
|
|
1525
|
+
)
|
|
1526
|
+
] })
|
|
1527
|
+
]
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
// src/types.ts
|
|
1533
|
+
function isCommandRunAction(action) {
|
|
1534
|
+
return action.action === "command_run";
|
|
1535
|
+
}
|
|
1536
|
+
function isFileReadAction(action) {
|
|
1537
|
+
return action.action === "file_read";
|
|
1538
|
+
}
|
|
1539
|
+
function isFileEditAction(action) {
|
|
1540
|
+
return action.action === "file_edit";
|
|
1541
|
+
}
|
|
1542
|
+
function isFileWriteAction(action) {
|
|
1543
|
+
return action.action === "file_write";
|
|
1544
|
+
}
|
|
1545
|
+
function isSearchAction(action) {
|
|
1546
|
+
return action.action === "search";
|
|
1547
|
+
}
|
|
1548
|
+
function isGlobAction(action) {
|
|
1549
|
+
return action.action === "glob";
|
|
1550
|
+
}
|
|
1551
|
+
function isWebFetchAction(action) {
|
|
1552
|
+
return action.action === "web_fetch";
|
|
1553
|
+
}
|
|
1554
|
+
function isWebSearchAction(action) {
|
|
1555
|
+
return action.action === "web_search";
|
|
1556
|
+
}
|
|
1557
|
+
function isMcpToolAction(action) {
|
|
1558
|
+
return action.action === "mcp_tool";
|
|
1559
|
+
}
|
|
1560
|
+
function isGenericToolAction(action) {
|
|
1561
|
+
return action.action === "generic_tool";
|
|
1562
|
+
}
|
|
1563
|
+
function isTodoWriteAction(action) {
|
|
1564
|
+
return action.action === "todo_write";
|
|
1565
|
+
}
|
|
1566
|
+
function isToolCallEntry(entry) {
|
|
1567
|
+
return entry.type === "tool_call";
|
|
1568
|
+
}
|
|
1569
|
+
function isErrorEntry(entry) {
|
|
1570
|
+
return entry.type === "error";
|
|
1571
|
+
}
|
|
1572
|
+
var DEFAULT_DISPLAY_CONFIG = {
|
|
1573
|
+
mode: "inline",
|
|
1574
|
+
breakEveryNToolCalls: 0,
|
|
1575
|
+
defaultExpanded: false,
|
|
1576
|
+
animationDuration: 300
|
|
1577
|
+
};
|
|
1578
|
+
var DisplayModeContext = createContext(null);
|
|
1579
|
+
function DisplayModeProvider({ children, initialConfig }) {
|
|
1580
|
+
const [config, setConfigState] = useState({
|
|
1581
|
+
...DEFAULT_DISPLAY_CONFIG,
|
|
1582
|
+
...initialConfig
|
|
1583
|
+
});
|
|
1584
|
+
const setMode = useCallback((mode) => {
|
|
1585
|
+
setConfigState((prev) => ({ ...prev, mode }));
|
|
1586
|
+
}, []);
|
|
1587
|
+
const setConfig = useCallback((updates) => {
|
|
1588
|
+
setConfigState((prev) => ({ ...prev, ...updates }));
|
|
1589
|
+
}, []);
|
|
1590
|
+
const toggleMode = useCallback(() => {
|
|
1591
|
+
setConfigState((prev) => ({
|
|
1592
|
+
...prev,
|
|
1593
|
+
mode: prev.mode === "inline" ? "compact" : "inline"
|
|
1594
|
+
}));
|
|
1595
|
+
}, []);
|
|
1596
|
+
const value = useMemo(
|
|
1597
|
+
() => ({ config, setMode, setConfig, toggleMode }),
|
|
1598
|
+
[config, setMode, setConfig, toggleMode]
|
|
1599
|
+
);
|
|
1600
|
+
return /* @__PURE__ */ jsx(DisplayModeContext.Provider, { value, children });
|
|
1601
|
+
}
|
|
1602
|
+
function useDisplayMode() {
|
|
1603
|
+
const context = useContext(DisplayModeContext);
|
|
1604
|
+
if (!context) {
|
|
1605
|
+
return {
|
|
1606
|
+
config: DEFAULT_DISPLAY_CONFIG,
|
|
1607
|
+
setMode: () => {
|
|
1608
|
+
},
|
|
1609
|
+
setConfig: () => {
|
|
1610
|
+
},
|
|
1611
|
+
toggleMode: () => {
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
return context;
|
|
1616
|
+
}
|
|
1617
|
+
function useDisplayConfig() {
|
|
1618
|
+
const { config } = useDisplayMode();
|
|
1619
|
+
return config;
|
|
1620
|
+
}
|
|
1621
|
+
function MessageList({
|
|
1622
|
+
entries,
|
|
1623
|
+
loading,
|
|
1624
|
+
streamingContent,
|
|
1625
|
+
displayConfig: displayConfigProp,
|
|
1626
|
+
onOptionSelect,
|
|
1627
|
+
className
|
|
1628
|
+
}) {
|
|
1629
|
+
const contextConfig = useDisplayConfig();
|
|
1630
|
+
const config = displayConfigProp || contextConfig;
|
|
1631
|
+
const groupedEntries = useMemo(() => {
|
|
1632
|
+
if (config.mode === "inline") {
|
|
1633
|
+
return entries.map((entry) => ({
|
|
1634
|
+
type: "single",
|
|
1635
|
+
entry,
|
|
1636
|
+
id: entry.id
|
|
1637
|
+
}));
|
|
1638
|
+
}
|
|
1639
|
+
return groupEntriesForCompactMode(entries, config);
|
|
1640
|
+
}, [entries, config]);
|
|
1641
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex-1 overflow-y-auto p-4 space-y-4 ash-scrollbar", className), children: [
|
|
1642
|
+
groupedEntries.map((groupedEntry) => {
|
|
1643
|
+
if (groupedEntry.type === "single") {
|
|
1644
|
+
return /* @__PURE__ */ jsx(MessageEntry, { entry: groupedEntry.entry, onOptionSelect }, groupedEntry.entry.id);
|
|
1645
|
+
}
|
|
1646
|
+
const toolCalls = extractToolCallsFromGroup(groupedEntry.entries);
|
|
1647
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex gap-3 ash-animate-fade-in", children: [
|
|
1648
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(BotIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
|
|
1649
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
1650
|
+
ToolExecutionGroup,
|
|
1651
|
+
{
|
|
1652
|
+
toolCalls,
|
|
1653
|
+
defaultExpanded: config.defaultExpanded,
|
|
1654
|
+
animationDuration: config.animationDuration
|
|
1655
|
+
}
|
|
1656
|
+
) })
|
|
1657
|
+
] }, groupedEntry.id);
|
|
1658
|
+
}),
|
|
1659
|
+
streamingContent && /* @__PURE__ */ jsxs("div", { className: "flex gap-3 ash-animate-fade-in", children: [
|
|
1660
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(BotIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
|
|
1661
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ jsx("div", { className: "rounded-xl p-3 bg-white/5 text-white/80", children: /* @__PURE__ */ jsx(StreamingText, { content: streamingContent, isStreaming: true }) }) })
|
|
1662
|
+
] }),
|
|
1663
|
+
loading && !streamingContent && /* @__PURE__ */ jsxs("div", { className: "flex gap-3 ash-animate-fade-in", children: [
|
|
1664
|
+
/* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx(BotIcon, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
|
|
1665
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-xl p-3 bg-white/5", children: /* @__PURE__ */ jsx(LoadingIndicator, { variant: "dots" }) })
|
|
1666
|
+
] })
|
|
1667
|
+
] });
|
|
1668
|
+
}
|
|
1669
|
+
function getLevelIcon(level) {
|
|
1670
|
+
switch (level) {
|
|
1671
|
+
case "info":
|
|
1672
|
+
return /* @__PURE__ */ jsx(InfoIcon, { className: "w-3.5 h-3.5" });
|
|
1673
|
+
case "warn":
|
|
1674
|
+
return /* @__PURE__ */ jsx(AlertTriangleIcon, { className: "w-3.5 h-3.5" });
|
|
1675
|
+
case "error":
|
|
1676
|
+
return /* @__PURE__ */ jsx(AlertCircleIcon, { className: "w-3.5 h-3.5" });
|
|
1677
|
+
case "debug":
|
|
1678
|
+
return /* @__PURE__ */ jsx(BugIcon, { className: "w-3.5 h-3.5" });
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
function getLevelColor(level) {
|
|
1682
|
+
switch (level) {
|
|
1683
|
+
case "info":
|
|
1684
|
+
return "text-blue-400";
|
|
1685
|
+
case "warn":
|
|
1686
|
+
return "text-yellow-500";
|
|
1687
|
+
case "error":
|
|
1688
|
+
return "text-red-400";
|
|
1689
|
+
case "debug":
|
|
1690
|
+
return "text-white/50";
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
function getLevelBgColor(level) {
|
|
1694
|
+
switch (level) {
|
|
1695
|
+
case "info":
|
|
1696
|
+
return "bg-blue-900/20";
|
|
1697
|
+
case "warn":
|
|
1698
|
+
return "bg-yellow-900/20";
|
|
1699
|
+
case "error":
|
|
1700
|
+
return "bg-red-900/20";
|
|
1701
|
+
case "debug":
|
|
1702
|
+
return "bg-white/5";
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
function getCategoryLabel(category) {
|
|
1706
|
+
switch (category) {
|
|
1707
|
+
case "setup":
|
|
1708
|
+
return "Setup";
|
|
1709
|
+
case "skills":
|
|
1710
|
+
return "Skills";
|
|
1711
|
+
case "execution":
|
|
1712
|
+
return "Execution";
|
|
1713
|
+
case "process":
|
|
1714
|
+
return "Process";
|
|
1715
|
+
case "startup":
|
|
1716
|
+
return "Startup";
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
function LogEntryRow({ log }) {
|
|
1720
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
1721
|
+
const hasData = log.data && Object.keys(log.data).length > 0;
|
|
1722
|
+
return /* @__PURE__ */ jsxs(
|
|
1723
|
+
"div",
|
|
1724
|
+
{
|
|
1725
|
+
className: cn(
|
|
1726
|
+
"px-3 py-2 border-b border-white/10 last:border-b-0",
|
|
1727
|
+
getLevelBgColor(log.level)
|
|
1728
|
+
),
|
|
1729
|
+
children: [
|
|
1730
|
+
/* @__PURE__ */ jsxs(
|
|
1731
|
+
"div",
|
|
1732
|
+
{
|
|
1733
|
+
className: cn("flex items-start gap-2", hasData && "cursor-pointer"),
|
|
1734
|
+
onClick: () => hasData && setIsExpanded(!isExpanded),
|
|
1735
|
+
children: [
|
|
1736
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 flex-shrink-0 pt-0.5", children: hasData && (isExpanded ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "w-3 h-3 text-white/40" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { className: "w-3 h-3 text-white/40" })) }),
|
|
1737
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0 pt-0.5", getLevelColor(log.level)), children: getLevelIcon(log.level) }),
|
|
1738
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children: formatTimestamp(log.timestamp) }),
|
|
1739
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs px-1.5 py-0.5 rounded bg-white/10 text-white/70 font-medium flex-shrink-0", children: getCategoryLabel(log.category) }),
|
|
1740
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-white/80 flex-1 break-words", children: log.message })
|
|
1741
|
+
]
|
|
1742
|
+
}
|
|
1743
|
+
),
|
|
1744
|
+
isExpanded && hasData && /* @__PURE__ */ jsx("div", { className: "mt-2 ml-6 pl-4 border-l-2 border-white/20", children: /* @__PURE__ */ jsx("pre", { className: "text-xs text-white/50 font-mono whitespace-pre-wrap overflow-x-auto", children: JSON.stringify(log.data, null, 2) }) })
|
|
1745
|
+
]
|
|
1746
|
+
}
|
|
1747
|
+
);
|
|
1748
|
+
}
|
|
1749
|
+
function LogsPanel({
|
|
1750
|
+
logs,
|
|
1751
|
+
title = "Logs",
|
|
1752
|
+
isLoading,
|
|
1753
|
+
defaultCollapsed = true,
|
|
1754
|
+
maxHeight = 256,
|
|
1755
|
+
className
|
|
1756
|
+
}) {
|
|
1757
|
+
const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
|
|
1758
|
+
const errorCount = logs.filter((l) => l.level === "error").length;
|
|
1759
|
+
const warnCount = logs.filter((l) => l.level === "warn").length;
|
|
1760
|
+
if (logs.length === 0 && !isLoading) {
|
|
1761
|
+
return null;
|
|
1762
|
+
}
|
|
1763
|
+
return /* @__PURE__ */ jsxs(
|
|
1764
|
+
"div",
|
|
1765
|
+
{
|
|
1766
|
+
className: cn(
|
|
1767
|
+
"border-t border-white/10 bg-[var(--ash-surface-dark,#0a0a0a)]",
|
|
1768
|
+
className
|
|
1769
|
+
),
|
|
1770
|
+
children: [
|
|
1771
|
+
/* @__PURE__ */ jsxs(
|
|
1772
|
+
"button",
|
|
1773
|
+
{
|
|
1774
|
+
onClick: () => setIsCollapsed(!isCollapsed),
|
|
1775
|
+
className: "w-full flex items-center justify-between px-4 py-2 hover:bg-white/5 transition-colors",
|
|
1776
|
+
children: [
|
|
1777
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1778
|
+
/* @__PURE__ */ jsx(TerminalIcon, { className: "w-4 h-4 text-white/50" }),
|
|
1779
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-white/80", children: title }),
|
|
1780
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-white/40", children: [
|
|
1781
|
+
"(",
|
|
1782
|
+
logs.length,
|
|
1783
|
+
")"
|
|
1784
|
+
] }),
|
|
1785
|
+
errorCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs px-1.5 py-0.5 rounded bg-red-900/50 text-red-400 font-medium", children: [
|
|
1786
|
+
errorCount,
|
|
1787
|
+
" error",
|
|
1788
|
+
errorCount > 1 ? "s" : ""
|
|
1789
|
+
] }),
|
|
1790
|
+
warnCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs px-1.5 py-0.5 rounded bg-yellow-900/50 text-yellow-400 font-medium", children: [
|
|
1791
|
+
warnCount,
|
|
1792
|
+
" warning",
|
|
1793
|
+
warnCount > 1 ? "s" : ""
|
|
1794
|
+
] }),
|
|
1795
|
+
isLoading && /* @__PURE__ */ jsx("span", { className: "text-xs text-white/40 animate-pulse", children: "Loading..." })
|
|
1796
|
+
] }),
|
|
1797
|
+
isCollapsed ? /* @__PURE__ */ jsx(ChevronRightIcon, { className: "w-4 h-4 text-white/40" }) : /* @__PURE__ */ jsx(ChevronDownIcon, { className: "w-4 h-4 text-white/40" })
|
|
1798
|
+
]
|
|
1799
|
+
}
|
|
1800
|
+
),
|
|
1801
|
+
!isCollapsed && /* @__PURE__ */ jsx(
|
|
1802
|
+
"div",
|
|
1803
|
+
{
|
|
1804
|
+
className: "overflow-y-auto border-t border-white/10",
|
|
1805
|
+
style: { maxHeight },
|
|
1806
|
+
children: logs.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-6 text-center text-sm text-white/50", children: "No logs yet" }) : logs.map((log, index) => /* @__PURE__ */ jsx(LogEntryRow, { log }, `${log.timestamp}-${index}`))
|
|
1807
|
+
}
|
|
1808
|
+
)
|
|
1809
|
+
]
|
|
1810
|
+
}
|
|
1811
|
+
);
|
|
1812
|
+
}
|
|
1813
|
+
function TodoStatusIcon({ status, className = "w-4 h-4" }) {
|
|
1814
|
+
switch (status) {
|
|
1815
|
+
case "completed":
|
|
1816
|
+
return /* @__PURE__ */ jsx(CheckCircleIcon, { className: cn(className, "text-emerald-400") });
|
|
1817
|
+
case "in_progress":
|
|
1818
|
+
return /* @__PURE__ */ jsx(LoaderIcon, { className: cn(className, "text-yellow-400 animate-spin") });
|
|
1819
|
+
case "pending":
|
|
1820
|
+
default:
|
|
1821
|
+
return /* @__PURE__ */ jsx(CircleIcon, { className: cn(className, "text-white/30") });
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
function TodoListItem({ todo, index, compact = false }) {
|
|
1825
|
+
const displayText = todo.status === "in_progress" ? todo.activeForm : todo.content;
|
|
1826
|
+
return /* @__PURE__ */ jsxs(
|
|
1827
|
+
"div",
|
|
1828
|
+
{
|
|
1829
|
+
className: cn(
|
|
1830
|
+
"flex items-start gap-2 transition-all duration-200",
|
|
1831
|
+
compact ? "py-1" : "py-1.5",
|
|
1832
|
+
todo.status === "completed" && "opacity-60",
|
|
1833
|
+
todo.status === "in_progress" && "bg-yellow-500/5 -mx-2 px-2 rounded-md"
|
|
1834
|
+
),
|
|
1835
|
+
children: [
|
|
1836
|
+
/* @__PURE__ */ jsx(TodoStatusIcon, { status: todo.status, className: compact ? "w-3.5 h-3.5 mt-0.5" : "w-4 h-4 mt-0.5" }),
|
|
1837
|
+
/* @__PURE__ */ jsxs(
|
|
1838
|
+
"span",
|
|
1839
|
+
{
|
|
1840
|
+
className: cn(
|
|
1841
|
+
"flex-1 text-white/80",
|
|
1842
|
+
compact ? "text-xs" : "text-sm",
|
|
1843
|
+
todo.status === "completed" && "line-through text-white/50"
|
|
1844
|
+
),
|
|
1845
|
+
children: [
|
|
1846
|
+
!compact && /* @__PURE__ */ jsxs("span", { className: "text-white/40 mr-1.5", children: [
|
|
1847
|
+
index + 1,
|
|
1848
|
+
"."
|
|
1849
|
+
] }),
|
|
1850
|
+
displayText
|
|
1851
|
+
]
|
|
1852
|
+
}
|
|
1853
|
+
)
|
|
1854
|
+
]
|
|
1855
|
+
}
|
|
1856
|
+
);
|
|
1857
|
+
}
|
|
1858
|
+
function TodoProgress({ completed, total, className }) {
|
|
1859
|
+
const percentage = total > 0 ? Math.round(completed / total * 100) : 0;
|
|
1860
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
1861
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 h-1.5 bg-white/10 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
1862
|
+
"div",
|
|
1863
|
+
{
|
|
1864
|
+
className: "h-full bg-emerald-400 rounded-full transition-all duration-500 ease-out",
|
|
1865
|
+
style: { width: `${percentage}%` }
|
|
1866
|
+
}
|
|
1867
|
+
) }),
|
|
1868
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-white/50 tabular-nums min-w-[3rem] text-right", children: [
|
|
1869
|
+
completed,
|
|
1870
|
+
"/",
|
|
1871
|
+
total
|
|
1872
|
+
] })
|
|
1873
|
+
] });
|
|
1874
|
+
}
|
|
1875
|
+
function TodoPanel({
|
|
1876
|
+
todos,
|
|
1877
|
+
title,
|
|
1878
|
+
compact = false,
|
|
1879
|
+
showProgress = true,
|
|
1880
|
+
className
|
|
1881
|
+
}) {
|
|
1882
|
+
const stats = useMemo(() => {
|
|
1883
|
+
return {
|
|
1884
|
+
total: todos.length,
|
|
1885
|
+
completed: todos.filter((t) => t.status === "completed").length,
|
|
1886
|
+
inProgress: todos.filter((t) => t.status === "in_progress").length,
|
|
1887
|
+
pending: todos.filter((t) => t.status === "pending").length
|
|
1888
|
+
};
|
|
1889
|
+
}, [todos]);
|
|
1890
|
+
if (todos.length === 0) {
|
|
1891
|
+
return null;
|
|
1892
|
+
}
|
|
1893
|
+
return /* @__PURE__ */ jsxs(
|
|
1894
|
+
"div",
|
|
1895
|
+
{
|
|
1896
|
+
className: cn(
|
|
1897
|
+
"rounded-lg border border-white/10 bg-white/5 overflow-hidden",
|
|
1898
|
+
className
|
|
1899
|
+
),
|
|
1900
|
+
children: [
|
|
1901
|
+
(title || showProgress) && /* @__PURE__ */ jsxs("div", { className: cn("border-b border-white/5", compact ? "px-2 py-1.5" : "px-3 py-2"), children: [
|
|
1902
|
+
title && /* @__PURE__ */ jsx("div", { className: cn("font-medium text-white/90 mb-1.5", compact ? "text-xs" : "text-sm"), children: title }),
|
|
1903
|
+
showProgress && /* @__PURE__ */ jsx(TodoProgress, { completed: stats.completed, total: stats.total })
|
|
1904
|
+
] }),
|
|
1905
|
+
/* @__PURE__ */ jsx("div", { className: cn(compact ? "px-2 py-1.5" : "px-3 py-2"), children: todos.map((todo, index) => /* @__PURE__ */ jsx(
|
|
1906
|
+
TodoListItem,
|
|
1907
|
+
{
|
|
1908
|
+
todo,
|
|
1909
|
+
index,
|
|
1910
|
+
compact
|
|
1911
|
+
},
|
|
1912
|
+
`${todo.content}-${index}`
|
|
1913
|
+
)) }),
|
|
1914
|
+
!compact && stats.inProgress > 0 && /* @__PURE__ */ jsx("div", { className: "px-3 py-2 border-t border-white/5 bg-yellow-500/5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-yellow-400", children: [
|
|
1915
|
+
/* @__PURE__ */ jsx(LoaderIcon, { className: "w-3 h-3 animate-spin" }),
|
|
1916
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
1917
|
+
stats.inProgress,
|
|
1918
|
+
" task",
|
|
1919
|
+
stats.inProgress !== 1 ? "s" : "",
|
|
1920
|
+
" in progress"
|
|
1921
|
+
] })
|
|
1922
|
+
] }) })
|
|
1923
|
+
]
|
|
1924
|
+
}
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
var DEFAULT_WORDS = [
|
|
1928
|
+
"Thinking",
|
|
1929
|
+
"Reasoning",
|
|
1930
|
+
"Pondering",
|
|
1931
|
+
"Analyzing",
|
|
1932
|
+
"Considering",
|
|
1933
|
+
"Processing",
|
|
1934
|
+
"Evaluating"
|
|
1935
|
+
];
|
|
1936
|
+
function TypewriterText({
|
|
1937
|
+
words = DEFAULT_WORDS,
|
|
1938
|
+
typeSpeed = 50,
|
|
1939
|
+
pauseBeforeErase = 800,
|
|
1940
|
+
eraseSpeed = 30,
|
|
1941
|
+
pauseBeforeType = 200,
|
|
1942
|
+
showCursor = true,
|
|
1943
|
+
className,
|
|
1944
|
+
cursorClassName
|
|
1945
|
+
}) {
|
|
1946
|
+
const [displayText, setDisplayText] = useState("");
|
|
1947
|
+
const [wordIndex, setWordIndex] = useState(0);
|
|
1948
|
+
const [isTyping, setIsTyping] = useState(true);
|
|
1949
|
+
const timeoutRef = useRef(null);
|
|
1950
|
+
useEffect(() => {
|
|
1951
|
+
const currentWord = words[wordIndex] ?? "";
|
|
1952
|
+
if (isTyping) {
|
|
1953
|
+
if (displayText.length < currentWord.length) {
|
|
1954
|
+
timeoutRef.current = setTimeout(() => {
|
|
1955
|
+
setDisplayText(currentWord.slice(0, displayText.length + 1));
|
|
1956
|
+
}, typeSpeed);
|
|
1957
|
+
} else {
|
|
1958
|
+
timeoutRef.current = setTimeout(() => {
|
|
1959
|
+
setIsTyping(false);
|
|
1960
|
+
}, pauseBeforeErase);
|
|
1961
|
+
}
|
|
1962
|
+
} else {
|
|
1963
|
+
if (displayText.length > 0) {
|
|
1964
|
+
timeoutRef.current = setTimeout(() => {
|
|
1965
|
+
setDisplayText(displayText.slice(0, -1));
|
|
1966
|
+
}, eraseSpeed);
|
|
1967
|
+
} else {
|
|
1968
|
+
timeoutRef.current = setTimeout(() => {
|
|
1969
|
+
setWordIndex((prev) => (prev + 1) % words.length);
|
|
1970
|
+
setIsTyping(true);
|
|
1971
|
+
}, pauseBeforeType);
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
return () => {
|
|
1975
|
+
if (timeoutRef.current) {
|
|
1976
|
+
clearTimeout(timeoutRef.current);
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
}, [displayText, wordIndex, isTyping, words, typeSpeed, pauseBeforeErase, eraseSpeed, pauseBeforeType]);
|
|
1980
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center", className), children: [
|
|
1981
|
+
/* @__PURE__ */ jsx("span", { children: displayText }),
|
|
1982
|
+
showCursor && /* @__PURE__ */ jsx(
|
|
1983
|
+
"span",
|
|
1984
|
+
{
|
|
1985
|
+
className: cn(
|
|
1986
|
+
"w-0.5 h-4 bg-current ml-0.5 animate-pulse",
|
|
1987
|
+
cursorClassName
|
|
1988
|
+
)
|
|
1989
|
+
}
|
|
1990
|
+
)
|
|
1991
|
+
] });
|
|
1992
|
+
}
|
|
1993
|
+
var ThemeContext = createContext(void 0);
|
|
1994
|
+
var DEFAULT_STORAGE_KEY = "ash-ui-theme";
|
|
1995
|
+
function ThemeProvider({
|
|
1996
|
+
children,
|
|
1997
|
+
defaultTheme,
|
|
1998
|
+
storageKey = DEFAULT_STORAGE_KEY,
|
|
1999
|
+
listenToSystemChanges = true
|
|
2000
|
+
}) {
|
|
2001
|
+
const [theme, setThemeState] = useState(() => {
|
|
2002
|
+
if (typeof window !== "undefined") {
|
|
2003
|
+
const stored = localStorage.getItem(storageKey);
|
|
2004
|
+
if (stored === "dark" || stored === "light") {
|
|
2005
|
+
return stored;
|
|
2006
|
+
}
|
|
2007
|
+
if (!defaultTheme && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
2008
|
+
return "dark";
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
return defaultTheme ?? "light";
|
|
2012
|
+
});
|
|
2013
|
+
const [mounted, setMounted] = useState(false);
|
|
2014
|
+
useEffect(() => {
|
|
2015
|
+
setMounted(true);
|
|
2016
|
+
}, []);
|
|
2017
|
+
useEffect(() => {
|
|
2018
|
+
if (!mounted) return;
|
|
2019
|
+
const root = document.documentElement;
|
|
2020
|
+
if (theme === "dark") {
|
|
2021
|
+
root.classList.add("dark");
|
|
2022
|
+
} else {
|
|
2023
|
+
root.classList.remove("dark");
|
|
2024
|
+
}
|
|
2025
|
+
localStorage.setItem(storageKey, theme);
|
|
2026
|
+
}, [theme, mounted, storageKey]);
|
|
2027
|
+
useEffect(() => {
|
|
2028
|
+
if (!listenToSystemChanges || typeof window === "undefined") return;
|
|
2029
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2030
|
+
const handleChange = (e) => {
|
|
2031
|
+
const stored = localStorage.getItem(storageKey);
|
|
2032
|
+
if (!stored) {
|
|
2033
|
+
setThemeState(e.matches ? "dark" : "light");
|
|
2034
|
+
}
|
|
2035
|
+
};
|
|
2036
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
2037
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
2038
|
+
}, [storageKey, listenToSystemChanges]);
|
|
2039
|
+
const toggleTheme = useCallback(() => {
|
|
2040
|
+
setThemeState((prev) => prev === "light" ? "dark" : "light");
|
|
2041
|
+
}, []);
|
|
2042
|
+
const setTheme = useCallback((newTheme) => {
|
|
2043
|
+
setThemeState(newTheme);
|
|
2044
|
+
}, []);
|
|
2045
|
+
if (!mounted) {
|
|
2046
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme: defaultTheme ?? "light", toggleTheme, setTheme }, children });
|
|
2047
|
+
}
|
|
2048
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme, toggleTheme, setTheme }, children });
|
|
2049
|
+
}
|
|
2050
|
+
function useTheme() {
|
|
2051
|
+
const context = useContext(ThemeContext);
|
|
2052
|
+
if (context === void 0) {
|
|
2053
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
2054
|
+
}
|
|
2055
|
+
return context;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
// src/design-tokens.ts
|
|
2059
|
+
var colors = {
|
|
2060
|
+
// Primary accent color (lime green)
|
|
2061
|
+
accent: {
|
|
2062
|
+
DEFAULT: "#ccff00",
|
|
2063
|
+
50: "#f8ffe5",
|
|
2064
|
+
100: "#eeffb8",
|
|
2065
|
+
200: "#e0ff85",
|
|
2066
|
+
300: "#d4ff52",
|
|
2067
|
+
400: "#ccff00",
|
|
2068
|
+
500: "#b8e600",
|
|
2069
|
+
600: "#99cc00",
|
|
2070
|
+
700: "#739900",
|
|
2071
|
+
800: "#4d6600",
|
|
2072
|
+
900: "#263300"
|
|
2073
|
+
},
|
|
2074
|
+
// Surface colors (dark theme)
|
|
2075
|
+
surface: {
|
|
2076
|
+
dark: "#0a0a0a",
|
|
2077
|
+
darker: "#050505",
|
|
2078
|
+
card: "#0c0c0c",
|
|
2079
|
+
elevated: "#111111"
|
|
2080
|
+
},
|
|
2081
|
+
// Text colors
|
|
2082
|
+
text: {
|
|
2083
|
+
primary: "#ffffff",
|
|
2084
|
+
secondary: "rgba(255, 255, 255, 0.7)",
|
|
2085
|
+
muted: "rgba(255, 255, 255, 0.5)",
|
|
2086
|
+
disabled: "rgba(255, 255, 255, 0.3)"
|
|
2087
|
+
},
|
|
2088
|
+
// Border colors
|
|
2089
|
+
border: {
|
|
2090
|
+
DEFAULT: "rgba(255, 255, 255, 0.1)",
|
|
2091
|
+
hover: "rgba(255, 255, 255, 0.2)",
|
|
2092
|
+
accent: "rgba(204, 255, 0, 0.3)",
|
|
2093
|
+
accentHover: "rgba(204, 255, 0, 0.5)"
|
|
2094
|
+
},
|
|
2095
|
+
// Status colors
|
|
2096
|
+
status: {
|
|
2097
|
+
success: "#10b981",
|
|
2098
|
+
warning: "#eab308",
|
|
2099
|
+
error: "#ef4444",
|
|
2100
|
+
info: "#3b82f6"
|
|
2101
|
+
},
|
|
2102
|
+
// User message background
|
|
2103
|
+
user: {
|
|
2104
|
+
bg: "rgba(204, 255, 0, 0.1)",
|
|
2105
|
+
border: "rgba(204, 255, 0, 0.2)"
|
|
2106
|
+
},
|
|
2107
|
+
// Assistant message background
|
|
2108
|
+
assistant: {
|
|
2109
|
+
bg: "rgba(255, 255, 255, 0.05)",
|
|
2110
|
+
border: "rgba(255, 255, 255, 0.1)"
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
var spacing = {
|
|
2114
|
+
xs: "4px",
|
|
2115
|
+
sm: "8px",
|
|
2116
|
+
md: "12px",
|
|
2117
|
+
lg: "16px",
|
|
2118
|
+
xl: "24px",
|
|
2119
|
+
"2xl": "32px",
|
|
2120
|
+
"3xl": "48px"
|
|
2121
|
+
};
|
|
2122
|
+
var borderRadius = {
|
|
2123
|
+
sm: "8px",
|
|
2124
|
+
md: "12px",
|
|
2125
|
+
lg: "16px",
|
|
2126
|
+
xl: "20px",
|
|
2127
|
+
"2xl": "24px",
|
|
2128
|
+
full: "9999px"
|
|
2129
|
+
};
|
|
2130
|
+
var shadows = {
|
|
2131
|
+
sm: "0 1px 2px rgba(0, 0, 0, 0.3)",
|
|
2132
|
+
md: "0 4px 6px rgba(0, 0, 0, 0.4)",
|
|
2133
|
+
lg: "0 10px 15px rgba(0, 0, 0, 0.5)",
|
|
2134
|
+
xl: "0 20px 25px rgba(0, 0, 0, 0.6)",
|
|
2135
|
+
glow: {
|
|
2136
|
+
sm: "0 0 10px rgba(204, 255, 0, 0.2)",
|
|
2137
|
+
md: "0 0 20px rgba(204, 255, 0, 0.3)",
|
|
2138
|
+
lg: "0 0 30px rgba(204, 255, 0, 0.5)"
|
|
2139
|
+
},
|
|
2140
|
+
panel: "0 25px 50px rgba(0, 0, 0, 0.5)"
|
|
2141
|
+
};
|
|
2142
|
+
var typography = {
|
|
2143
|
+
fontFamily: {
|
|
2144
|
+
sans: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2145
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'
|
|
2146
|
+
},
|
|
2147
|
+
fontSize: {
|
|
2148
|
+
xs: "12px",
|
|
2149
|
+
sm: "14px",
|
|
2150
|
+
base: "16px",
|
|
2151
|
+
lg: "18px",
|
|
2152
|
+
xl: "20px",
|
|
2153
|
+
"2xl": "24px"
|
|
2154
|
+
},
|
|
2155
|
+
lineHeight: {
|
|
2156
|
+
tight: "1.25",
|
|
2157
|
+
normal: "1.5",
|
|
2158
|
+
relaxed: "1.75"
|
|
2159
|
+
}
|
|
2160
|
+
};
|
|
2161
|
+
var keyframes = {
|
|
2162
|
+
slideUp: {
|
|
2163
|
+
from: { opacity: "0", transform: "translateY(20px)" },
|
|
2164
|
+
to: { opacity: "1", transform: "translateY(0)" }
|
|
2165
|
+
},
|
|
2166
|
+
fadeIn: {
|
|
2167
|
+
from: { opacity: "0", transform: "translateY(10px)" },
|
|
2168
|
+
to: { opacity: "1", transform: "translateY(0)" }
|
|
2169
|
+
},
|
|
2170
|
+
blink: {
|
|
2171
|
+
"0%, 50%": { opacity: "1" },
|
|
2172
|
+
"51%, 100%": { opacity: "0" }
|
|
2173
|
+
},
|
|
2174
|
+
bounce: {
|
|
2175
|
+
"0%, 80%, 100%": { transform: "scale(0)" },
|
|
2176
|
+
"40%": { transform: "scale(1)" }
|
|
2177
|
+
},
|
|
2178
|
+
pulse: {
|
|
2179
|
+
"0%, 100%": { opacity: "1" },
|
|
2180
|
+
"50%": { opacity: "0.5" }
|
|
2181
|
+
},
|
|
2182
|
+
glowPulse: {
|
|
2183
|
+
"0%, 100%": { boxShadow: "0 0 20px rgba(204, 255, 0, 0.3)" },
|
|
2184
|
+
"50%": { boxShadow: "0 0 40px rgba(204, 255, 0, 0.5)" }
|
|
2185
|
+
}
|
|
2186
|
+
};
|
|
2187
|
+
var keyframesCss = {
|
|
2188
|
+
slideUp: `
|
|
2189
|
+
@keyframes ash-slide-up {
|
|
2190
|
+
from { opacity: 0; transform: translateY(20px); }
|
|
2191
|
+
to { opacity: 1; transform: translateY(0); }
|
|
2192
|
+
}
|
|
2193
|
+
`,
|
|
2194
|
+
fadeIn: `
|
|
2195
|
+
@keyframes ash-fade-in {
|
|
2196
|
+
from { opacity: 0; transform: translateY(10px); }
|
|
2197
|
+
to { opacity: 1; transform: translateY(0); }
|
|
2198
|
+
}
|
|
2199
|
+
`,
|
|
2200
|
+
blink: `
|
|
2201
|
+
@keyframes ash-blink {
|
|
2202
|
+
0%, 50% { opacity: 1; }
|
|
2203
|
+
51%, 100% { opacity: 0; }
|
|
2204
|
+
}
|
|
2205
|
+
`,
|
|
2206
|
+
bounce: `
|
|
2207
|
+
@keyframes ash-bounce {
|
|
2208
|
+
0%, 80%, 100% { transform: scale(0); }
|
|
2209
|
+
40% { transform: scale(1); }
|
|
2210
|
+
}
|
|
2211
|
+
`,
|
|
2212
|
+
pulse: `
|
|
2213
|
+
@keyframes ash-pulse {
|
|
2214
|
+
0%, 100% { opacity: 1; }
|
|
2215
|
+
50% { opacity: 0.5; }
|
|
2216
|
+
}
|
|
2217
|
+
`,
|
|
2218
|
+
glowPulse: `
|
|
2219
|
+
@keyframes ash-glow-pulse {
|
|
2220
|
+
0%, 100% { box-shadow: 0 0 20px rgba(204, 255, 0, 0.3); }
|
|
2221
|
+
50% { box-shadow: 0 0 40px rgba(204, 255, 0, 0.5); }
|
|
2222
|
+
}
|
|
2223
|
+
`
|
|
2224
|
+
};
|
|
2225
|
+
var allKeyframesCss = Object.values(keyframesCss).join("\n");
|
|
2226
|
+
var transitions = {
|
|
2227
|
+
fast: "150ms ease-out",
|
|
2228
|
+
normal: "300ms ease-out",
|
|
2229
|
+
slow: "500ms ease-out",
|
|
2230
|
+
spring: "400ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
2231
|
+
};
|
|
2232
|
+
var zIndex = {
|
|
2233
|
+
base: 0,
|
|
2234
|
+
dropdown: 100,
|
|
2235
|
+
modal: 200,
|
|
2236
|
+
tooltip: 300,
|
|
2237
|
+
widget: 999999
|
|
2238
|
+
};
|
|
2239
|
+
var widget = {
|
|
2240
|
+
launcher: {
|
|
2241
|
+
size: "60px",
|
|
2242
|
+
iconSize: "28px"
|
|
2243
|
+
},
|
|
2244
|
+
panel: {
|
|
2245
|
+
width: "400px",
|
|
2246
|
+
height: "600px",
|
|
2247
|
+
maxHeight: "80vh"
|
|
2248
|
+
},
|
|
2249
|
+
header: {
|
|
2250
|
+
height: "60px"
|
|
2251
|
+
},
|
|
2252
|
+
input: {
|
|
2253
|
+
minHeight: "60px",
|
|
2254
|
+
maxHeight: "150px"
|
|
2255
|
+
},
|
|
2256
|
+
message: {
|
|
2257
|
+
maxWidth: "85%",
|
|
2258
|
+
avatarSize: "32px"
|
|
2259
|
+
},
|
|
2260
|
+
gap: "20px"
|
|
2261
|
+
// Gap from edge of screen
|
|
2262
|
+
};
|
|
2263
|
+
function tokensToCssVariables(prefix = "ash") {
|
|
2264
|
+
const vars = {};
|
|
2265
|
+
vars[`--${prefix}-accent`] = colors.accent.DEFAULT;
|
|
2266
|
+
Object.entries(colors.accent).forEach(([key, value]) => {
|
|
2267
|
+
if (key !== "DEFAULT") vars[`--${prefix}-accent-${key}`] = value;
|
|
2268
|
+
});
|
|
2269
|
+
Object.entries(colors.surface).forEach(([key, value]) => {
|
|
2270
|
+
vars[`--${prefix}-surface-${key}`] = value;
|
|
2271
|
+
});
|
|
2272
|
+
Object.entries(colors.text).forEach(([key, value]) => {
|
|
2273
|
+
vars[`--${prefix}-text-${key}`] = value;
|
|
2274
|
+
});
|
|
2275
|
+
Object.entries(colors.border).forEach(([key, value]) => {
|
|
2276
|
+
if (key !== "DEFAULT") vars[`--${prefix}-border-${key}`] = value;
|
|
2277
|
+
else vars[`--${prefix}-border`] = value;
|
|
2278
|
+
});
|
|
2279
|
+
return vars;
|
|
2280
|
+
}
|
|
2281
|
+
var inlineStyles = {
|
|
2282
|
+
// Glass panel effect
|
|
2283
|
+
glassPanel: {
|
|
2284
|
+
backgroundColor: "rgba(255, 255, 255, 0.05)",
|
|
2285
|
+
backdropFilter: "blur(24px)",
|
|
2286
|
+
WebkitBackdropFilter: "blur(24px)",
|
|
2287
|
+
border: `1px solid ${colors.border.DEFAULT}`
|
|
2288
|
+
},
|
|
2289
|
+
// Accent button
|
|
2290
|
+
accentButton: {
|
|
2291
|
+
backgroundColor: colors.accent.DEFAULT,
|
|
2292
|
+
color: "#000000",
|
|
2293
|
+
border: `1px solid ${colors.accent.DEFAULT}`,
|
|
2294
|
+
boxShadow: shadows.glow.md
|
|
2295
|
+
},
|
|
2296
|
+
// Ghost button
|
|
2297
|
+
ghostButton: {
|
|
2298
|
+
backgroundColor: "transparent",
|
|
2299
|
+
color: colors.text.secondary,
|
|
2300
|
+
border: "1px solid transparent"
|
|
2301
|
+
},
|
|
2302
|
+
// User message bubble
|
|
2303
|
+
userMessage: {
|
|
2304
|
+
backgroundColor: colors.user.bg,
|
|
2305
|
+
border: `1px solid ${colors.user.border}`,
|
|
2306
|
+
borderRadius: borderRadius.lg
|
|
2307
|
+
},
|
|
2308
|
+
// Assistant message bubble
|
|
2309
|
+
assistantMessage: {
|
|
2310
|
+
backgroundColor: colors.assistant.bg,
|
|
2311
|
+
border: `1px solid ${colors.assistant.border}`,
|
|
2312
|
+
borderRadius: borderRadius.lg
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
export { ActionIcon, AlertCircleIcon, AlertTriangleIcon, AssistantMessage, BotIcon, BrainIcon, BugIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardListIcon, CodeBlock, CodeIcon, CompactToolStatusLine, CopyIcon, DEFAULT_DISPLAY_CONFIG, DisplayModeProvider, EditIcon, ErrorMessage, FileIcon, FilePlusIcon, FolderSearchIcon, GlobeIcon, InfoIcon, JsonDisplay, ListChecksIcon, LoaderIcon, LoadingIndicator, LogsPanel, MessageEntry, MessageList, MessageSquareIcon, MoonIcon, OptionCards, PaperclipIcon, PlugIcon, SearchIcon, SendIcon, SparklesIcon, StatusIndicator, StopCircleIcon, StreamingText, SunIcon, TerminalIcon, ThemeProvider, ThinkingMessage, TodoPanel, ToolCallCard, ToolCallMessage, ToolExecutionGroup, ToolIcon, TypewriterText, UserIcon, UserMessage, XCircleIcon, XIcon, allKeyframesCss, borderRadius, cn, colors, createToolCall, extractTextContent, extractToolCallsFromGroup, formatFileSize, formatTimestamp, formatToolName, generateToolSummary, getActionIcon, getActionLabel, groupEntriesForCompactMode, inlineStyles, isCommandRunAction, isErrorEntry, isFileEditAction, isFileReadAction, isFileWriteAction, isGenericToolAction, isGlobAction, isMcpToolAction, isSearchAction, isTodoWriteAction, isToolCallEntry, isWebFetchAction, isWebSearchAction, keyframes, keyframesCss, mapToolToActionType, normalizeToolResult, parseCommandResult, parseMcpToolName, parseOptionsFromContent, shadows, spacing, tokensToCssVariables, transitions, truncate, typography, updateToolCallWithResult, useDisplayConfig, useDisplayMode, useTheme, widget, zIndex };
|
|
2317
|
+
//# sourceMappingURL=index.js.map
|
|
2318
|
+
//# sourceMappingURL=index.js.map
|