@adecore/agents-react 0.51.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/agents/AgentIcon.js +25 -17
  2. package/dist/agents/ProviderLogo.js +26 -16
  3. package/dist/agents/agent-marks.d.ts +1 -0
  4. package/dist/agents/provider-paths.d.ts +2 -1
  5. package/dist/agents/provider-paths.js +11 -2
  6. package/dist/chat/index.d.ts +2 -1
  7. package/dist/chat/index.js +2 -1
  8. package/dist/chat/logic/command-looks.d.ts +17 -5
  9. package/dist/chat/logic/command-looks.js +35 -7
  10. package/dist/chat/logic/timeline.d.ts +6 -4
  11. package/dist/chat/logic/timeline.js +32 -25
  12. package/dist/chat/logic/tool-looks.d.ts +16 -0
  13. package/dist/chat/logic/tool-looks.js +188 -0
  14. package/dist/chat/logic/tools.d.ts +5 -0
  15. package/dist/chat/logic/tools.js +17 -2
  16. package/dist/chat/ui/ShellCommand.d.ts +2 -1
  17. package/dist/chat/ui/ShellCommand.js +73 -22
  18. package/dist/chat/ui/SubagentTimeline.js +5 -2
  19. package/dist/chat/ui/Timeline.js +2 -1
  20. package/dist/chat/ui/diff/EditorEditDiff.d.ts +3 -2
  21. package/dist/chat/ui/diff/EditorEditDiff.js +93 -79
  22. package/dist/chat/ui/diff/LegacyEditDiff.d.ts +1 -1
  23. package/dist/chat/ui/diff/LegacyEditDiff.js +64 -48
  24. package/dist/chat/ui/rows/RowContainer.js +26 -23
  25. package/dist/chat/ui/rows/WorkRows.d.ts +3 -4
  26. package/dist/chat/ui/rows/WorkRows.js +592 -519
  27. package/dist/chat/ui/rows/row-rhythm.d.ts +2 -2
  28. package/dist/chat/ui/rows/row-rhythm.js +9 -6
  29. package/dist/chat/ui/thread-references.d.ts +1 -0
  30. package/dist/chat/ui/thread-references.js +4 -3
  31. package/dist/host.d.ts +28 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/locales/en/agent-chat.d.ts +4 -0
  34. package/dist/locales/en/agent-chat.js +4 -0
  35. package/dist/locales/nl/agent-chat.d.ts +4 -0
  36. package/dist/locales/nl/agent-chat.js +4 -0
  37. package/package.json +8 -8
  38. package/src/agents/AgentIcon.tsx +2 -1
  39. package/src/agents/ProviderLogo.tsx +2 -2
  40. package/src/agents/agent-marks.ts +2 -0
  41. package/src/agents/provider-paths.ts +15 -3
  42. package/src/chat/index.ts +2 -1
  43. package/src/chat/logic/command-looks.ts +51 -10
  44. package/src/chat/logic/timeline.ts +46 -27
  45. package/src/chat/logic/tool-looks.ts +228 -0
  46. package/src/chat/logic/tools.ts +13 -2
  47. package/src/chat/ui/ShellCommand.tsx +33 -6
  48. package/src/chat/ui/SubagentTimeline.tsx +3 -2
  49. package/src/chat/ui/Timeline.tsx +2 -1
  50. package/src/chat/ui/diff/EditorEditDiff.tsx +31 -5
  51. package/src/chat/ui/diff/LegacyEditDiff.tsx +5 -3
  52. package/src/chat/ui/rows/RowContainer.tsx +4 -2
  53. package/src/chat/ui/rows/WorkRows.tsx +46 -33
  54. package/src/chat/ui/rows/row-rhythm.ts +9 -6
  55. package/src/chat/ui/thread-references.ts +5 -1
  56. package/src/host.ts +51 -0
  57. package/src/index.ts +3 -0
  58. package/src/locales/en/agent-chat.ts +4 -0
  59. package/src/locales/nl/agent-chat.ts +4 -0
@@ -4,7 +4,7 @@ import clsx from 'clsx';
4
4
  import i18next from 'i18next';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { ChevronRight, FileDiff, X } from 'lucide-react';
7
- import { matchCommandLook } from '../../logic/command-looks.js';
7
+ import { lookKey, lookRunOf } from '../../logic/command-looks.js';
8
8
  import { exitCodeOf, fileChanges, hasOutput, hasToolBody, liveOutput, readImagePath, shellCommand, toolCallLines, toolStartedAt, toolSummary, toolSummaryIsPath, unifiedChanges } from '../../logic/tools.js';
9
9
  import { useOpenForFind } from '../find-reveal.js';
10
10
  import { useChatHost } from '../../../host.js';
@@ -19,8 +19,10 @@ import { formatClockDuration, formatElapsedShort } from '@adecore/ui/format';
19
19
  import { Button, Icon, LazyBoundary, MiddleTruncate, Spinner, useTickingText } from '@adecore/ui';
20
20
  import { ROW_GUTTER, toolIcon } from '../icons.js';
21
21
  import { AnsiOutput } from '../AnsiOutput.js';
22
+ import { ReferenceLookupContext } from '../reference-lookup.js';
22
23
  import { RowTime } from '../RowTime.js';
23
24
  import { ShellCommand } from '../ShellCommand.js';
25
+ import { useReferenceLookupIn } from '../thread-references.js';
24
26
  import { DiffStack, ReviewStackView } from '../diff/DiffStack.js';
25
27
  import { reviewEntries } from '../diff/review-plan.js';
26
28
  import { useReviewStack } from '../diff/use-review-stack.js';
@@ -58,7 +60,7 @@ function hasNames(look) {
58
60
  }
59
61
  /* The detail of a look's run, with the words its host names drawn as those names. */
60
62
  function NamedLookDetail(t0) {
61
- const $ = _c(9);
63
+ const $ = _c(13);
62
64
  const {
63
65
  run,
64
66
  chatId,
@@ -66,6 +68,7 @@ function NamedLookDetail(t0) {
66
68
  } = t0;
67
69
  const scope = useContext(ChatScopeContext);
68
70
  const nameOf = useCommandNames(look, scope?.id ?? "", chatId);
71
+ const lookup = useReferenceLookupIn(scope?.id ?? "", chatId);
69
72
  let t1;
70
73
  if ($[0] !== nameOf || $[1] !== run.words) {
71
74
  let t2;
@@ -92,24 +95,39 @@ function NamedLookDetail(t0) {
92
95
  t1 = $[2];
93
96
  }
94
97
  const names = t1;
95
- let t2;
96
- if ($[5] !== names || $[6] !== run.code || $[7] !== run.detail) {
97
- t2 = /*#__PURE__*/_jsx(ShellCommand, {
98
+ const t2 = !run.shell;
99
+ let t3;
100
+ if ($[5] !== names || $[6] !== run.code || $[7] !== run.detail || $[8] !== t2) {
101
+ t3 = /*#__PURE__*/_jsx(ShellCommand, {
98
102
  command: run.detail,
99
103
  code: run.code,
100
- names: names
104
+ names: names,
105
+ plain: t2
101
106
  });
102
107
  $[5] = names;
103
108
  $[6] = run.code;
104
109
  $[7] = run.detail;
105
110
  $[8] = t2;
111
+ $[9] = t3;
106
112
  } else {
107
- t2 = $[8];
113
+ t3 = $[9];
108
114
  }
109
- return t2;
115
+ let t4;
116
+ if ($[10] !== lookup || $[11] !== t3) {
117
+ t4 = /*#__PURE__*/_jsx(ReferenceLookupContext, {
118
+ value: lookup,
119
+ children: t3
120
+ });
121
+ $[10] = lookup;
122
+ $[11] = t3;
123
+ $[12] = t4;
124
+ } else {
125
+ t4 = $[12];
126
+ }
127
+ return t4;
110
128
  }
111
129
  function LookDetail(t0) {
112
- const $ = _c(7);
130
+ const $ = _c(11);
113
131
  const {
114
132
  run,
115
133
  chatId
@@ -118,35 +136,47 @@ function LookDetail(t0) {
118
136
  look
119
137
  } = run;
120
138
  if (!hasNames(look)) {
121
- let t1;
122
- if ($[0] !== run.code || $[1] !== run.detail) {
123
- t1 = /*#__PURE__*/_jsx(ShellCommand, {
139
+ const t1 = !run.shell;
140
+ let t2;
141
+ if ($[0] !== run.code || $[1] !== run.detail || $[2] !== t1) {
142
+ t2 = /*#__PURE__*/_jsx(ShellCommand, {
124
143
  command: run.detail,
125
- code: run.code
144
+ code: run.code,
145
+ plain: t1
126
146
  });
127
147
  $[0] = run.code;
128
148
  $[1] = run.detail;
129
149
  $[2] = t1;
150
+ $[3] = t2;
130
151
  } else {
131
- t1 = $[2];
152
+ t2 = $[3];
132
153
  }
133
- return t1;
154
+ return t2;
134
155
  }
135
156
  let t1;
136
- if ($[3] !== chatId || $[4] !== look || $[5] !== run) {
137
- t1 = /*#__PURE__*/_jsx(NamedLookDetail, {
157
+ if ($[4] !== look) {
158
+ t1 = lookKey(look);
159
+ $[4] = look;
160
+ $[5] = t1;
161
+ } else {
162
+ t1 = $[5];
163
+ }
164
+ let t2;
165
+ if ($[6] !== chatId || $[7] !== look || $[8] !== run || $[9] !== t1) {
166
+ t2 = /*#__PURE__*/_jsx(NamedLookDetail, {
138
167
  run: run,
139
168
  chatId: chatId,
140
169
  look: look
141
- }, look.program);
142
- $[3] = chatId;
143
- $[4] = look;
144
- $[5] = run;
145
- $[6] = t1;
170
+ }, t1);
171
+ $[6] = chatId;
172
+ $[7] = look;
173
+ $[8] = run;
174
+ $[9] = t1;
175
+ $[10] = t2;
146
176
  } else {
147
- t1 = $[6];
177
+ t2 = $[10];
148
178
  }
149
- return t1;
179
+ return t2;
150
180
  }
151
181
  const TAG = 'shrink-0 rounded bg-surface-hover px-1.5 text-text-faint';
152
182
  /* What else the line ran, in quiet tags: the other programs and a heredoc, and how many more runs of a look. */
@@ -224,78 +254,79 @@ export function ToggleLine(t0) {
224
254
  className
225
255
  } = t0;
226
256
  const open = t1 === undefined ? false : t1;
257
+ const {
258
+ t
259
+ } = useTranslation("agent-chat");
227
260
  const t2 = onToggle !== undefined && "hover:bg-surface-hover";
228
- const t3 = failed ? "text-status-error" : "text-text-muted";
229
- let t4;
230
- if ($[0] !== className || $[1] !== t2 || $[2] !== t3) {
231
- t4 = clsx("group/line -mx-1 mb-0.5 flex h-7 w-[calc(100%+8px)] items-center gap-2 rounded-md px-1 text-left text-xs", t2, t3, className);
261
+ let t3;
262
+ if ($[0] !== className || $[1] !== t2) {
263
+ t3 = clsx("group/line -mx-1 mb-0.5 flex h-7 w-[calc(100%+8px)] items-center gap-2 rounded-md px-1 text-left text-xs text-text-muted", t2, className);
232
264
  $[0] = className;
233
265
  $[1] = t2;
234
266
  $[2] = t3;
235
- $[3] = t4;
236
267
  } else {
237
- t4 = $[3];
268
+ t3 = $[2];
238
269
  }
239
- const classes = t4;
240
- const t5 = live && "text-accent";
241
- let t6;
242
- if ($[4] !== t5) {
243
- t6 = clsx(ROW_GUTTER, t5);
270
+ const classes = t3;
271
+ const t4 = live && "text-accent";
272
+ let t5;
273
+ if ($[3] !== t4) {
274
+ t5 = clsx(ROW_GUTTER, t4);
275
+ $[3] = t4;
244
276
  $[4] = t5;
245
- $[5] = t6;
246
277
  } else {
247
- t6 = $[5];
278
+ t5 = $[4];
248
279
  }
249
- let t7;
250
- if ($[6] !== icon || $[7] !== t6) {
251
- t7 = /*#__PURE__*/_jsx("span", {
252
- className: t6,
280
+ let t6;
281
+ if ($[5] !== icon || $[6] !== t5) {
282
+ t6 = /*#__PURE__*/_jsx("span", {
283
+ className: t5,
253
284
  children: icon
254
285
  });
255
- $[6] = icon;
286
+ $[5] = icon;
287
+ $[6] = t5;
256
288
  $[7] = t6;
257
- $[8] = t7;
258
289
  } else {
259
- t7 = $[8];
290
+ t6 = $[7];
260
291
  }
261
- const t8 = live && "chat-live-text";
262
- let t9;
263
- if ($[9] !== t8) {
264
- t9 = clsx("shrink-0", t8);
292
+ const t7 = live && "chat-live-text";
293
+ let t8;
294
+ if ($[8] !== t7) {
295
+ t8 = clsx("shrink-0", t7);
296
+ $[8] = t7;
265
297
  $[9] = t8;
266
- $[10] = t9;
267
298
  } else {
268
- t9 = $[10];
299
+ t8 = $[9];
269
300
  }
270
- let t10;
271
- if ($[11] !== brand) {
272
- t10 = brand !== undefined && /*#__PURE__*/_jsx("span", {
301
+ let t9;
302
+ if ($[10] !== brand) {
303
+ t9 = brand !== undefined && /*#__PURE__*/_jsx("span", {
273
304
  className: BRAND,
274
305
  children: brand
275
306
  });
276
- $[11] = brand;
277
- $[12] = t10;
307
+ $[10] = brand;
308
+ $[11] = t9;
278
309
  } else {
279
- t10 = $[12];
310
+ t9 = $[11];
280
311
  }
281
- const t11 = brand !== undefined && label !== "" && " ";
282
- let t12;
283
- if ($[13] !== label || $[14] !== t10 || $[15] !== t11 || $[16] !== t9) {
284
- t12 = /*#__PURE__*/_jsxs("span", {
285
- className: t9,
286
- children: [t10, t11, label]
287
- });
288
- $[13] = label;
289
- $[14] = t10;
290
- $[15] = t11;
291
- $[16] = t9;
292
- $[17] = t12;
312
+ const t10 = brand !== undefined && label !== "" && " ";
313
+ let t11;
314
+ if ($[12] !== label || $[13] !== t10 || $[14] !== t8 || $[15] !== t9) {
315
+ t11 = /*#__PURE__*/_jsxs("span", {
316
+ className: t8,
317
+ children: [t9, t10, label]
318
+ });
319
+ $[12] = label;
320
+ $[13] = t10;
321
+ $[14] = t8;
322
+ $[15] = t9;
323
+ $[16] = t11;
293
324
  } else {
294
- t12 = $[17];
325
+ t11 = $[16];
295
326
  }
296
- let t13;
297
- if ($[18] !== command || $[19] !== detail || $[20] !== look || $[21] !== path) {
298
- t13 = look !== undefined ? /*#__PURE__*/_jsxs(_Fragment, {
327
+ let t12;
328
+ if ($[17] !== command || $[18] !== detail || $[19] !== look || $[20] !== path) {
329
+ t12 = look !== undefined ? /*#__PURE__*/_jsxs(_Fragment, {
299
330
  children: [look.run.detail !== "" && /*#__PURE__*/_jsx("span", {
300
331
  "data-find-field": "summary",
301
332
  className: "min-w-0 truncate font-mono text-code text-text-faint",
@@ -315,104 +346,110 @@ export function ToggleLine(t0) {
315
346
  text: detail
316
347
  }) : detail
317
348
  });
318
- $[18] = command;
319
- $[19] = detail;
320
- $[20] = look;
321
- $[21] = path;
322
- $[22] = t13;
349
+ $[17] = command;
350
+ $[18] = detail;
351
+ $[19] = look;
352
+ $[20] = path;
353
+ $[21] = t12;
323
354
  } else {
324
- t13 = $[22];
355
+ t12 = $[21];
325
356
  }
326
- let t14;
327
- if ($[23] !== t12 || $[24] !== t13) {
328
- t14 = /*#__PURE__*/_jsxs("span", {
357
+ let t13;
358
+ if ($[22] !== t11 || $[23] !== t12) {
359
+ t13 = /*#__PURE__*/_jsxs("span", {
329
360
  className: "flex min-w-0 items-baseline gap-2",
330
- children: [t12, t13]
361
+ children: [t11, t12]
331
362
  });
363
+ $[22] = t11;
332
364
  $[23] = t12;
333
365
  $[24] = t13;
334
- $[25] = t14;
335
366
  } else {
336
- t14 = $[25];
367
+ t13 = $[24];
337
368
  }
338
- let t15;
339
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
340
- t15 = /*#__PURE__*/_jsx("span", {
369
+ let t14;
370
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
371
+ t14 = /*#__PURE__*/_jsx("span", {
341
372
  className: "grow"
342
373
  });
343
- $[26] = t15;
374
+ $[25] = t14;
344
375
  } else {
345
- t15 = $[26];
376
+ t14 = $[25];
346
377
  }
347
- let t16;
348
- if ($[27] !== time) {
349
- t16 = time !== undefined && /*#__PURE__*/_jsx(RowTime, {
378
+ let t15;
379
+ if ($[26] !== time) {
380
+ t15 = time !== undefined && /*#__PURE__*/_jsx(RowTime, {
350
381
  at: time
351
382
  });
352
- $[27] = time;
353
- $[28] = t16;
383
+ $[26] = time;
384
+ $[27] = t15;
354
385
  } else {
355
- t16 = $[28];
386
+ t15 = $[27];
356
387
  }
357
- let t17;
358
- if ($[29] !== failed) {
359
- t17 = failed && /*#__PURE__*/_jsx(Icon, {
360
- icon: X,
361
- size: 12,
362
- className: "shrink-0"
388
+ let t16;
389
+ if ($[28] !== failed || $[29] !== t) {
390
+ t16 = failed && /*#__PURE__*/_jsxs("span", {
391
+ className: "shrink-0 text-status-error",
392
+ children: [/*#__PURE__*/_jsx(Icon, {
393
+ icon: X,
394
+ size: 12
395
+ }), /*#__PURE__*/_jsx("span", {
396
+ className: "sr-only",
397
+ children: t("work.failed")
398
+ })]
363
399
  });
364
- $[29] = failed;
365
- $[30] = t17;
400
+ $[28] = failed;
401
+ $[29] = t;
402
+ $[30] = t16;
366
403
  } else {
367
- t17 = $[30];
404
+ t16 = $[30];
368
405
  }
369
- let t18;
406
+ let t17;
370
407
  if ($[31] !== onToggle || $[32] !== open) {
371
- t18 = onToggle !== undefined && /*#__PURE__*/_jsx(Icon, {
408
+ t17 = onToggle !== undefined && /*#__PURE__*/_jsx(Icon, {
372
409
  icon: ChevronRight,
373
410
  size: 12,
374
411
  className: clsx("shrink-0 text-text-faint transition-transform", open && "rotate-90")
375
412
  });
376
413
  $[31] = onToggle;
377
414
  $[32] = open;
378
- $[33] = t18;
415
+ $[33] = t17;
379
416
  } else {
380
- t18 = $[33];
417
+ t17 = $[33];
381
418
  }
382
- let t19;
383
- if ($[34] !== t14 || $[35] !== t16 || $[36] !== t17 || $[37] !== t18 || $[38] !== t7 || $[39] !== trailing) {
384
- t19 = /*#__PURE__*/_jsxs(_Fragment, {
385
- children: [t7, t14, t15, trailing, t16, t17, t18]
386
- });
387
- $[34] = t14;
388
- $[35] = t16;
389
- $[36] = t17;
390
- $[37] = t18;
391
- $[38] = t7;
419
+ let t18;
420
+ if ($[34] !== t13 || $[35] !== t15 || $[36] !== t16 || $[37] !== t17 || $[38] !== t6 || $[39] !== trailing) {
421
+ t18 = /*#__PURE__*/_jsxs(_Fragment, {
422
+ children: [t6, t13, t14, trailing, t15, t16, t17]
423
+ });
424
+ $[34] = t13;
425
+ $[35] = t15;
426
+ $[36] = t16;
427
+ $[37] = t17;
428
+ $[38] = t6;
392
429
  $[39] = trailing;
393
- $[40] = t19;
430
+ $[40] = t18;
394
431
  } else {
395
- t19 = $[40];
432
+ t18 = $[40];
396
433
  }
397
- const content = t19;
434
+ const content = t18;
398
435
  if (onToggle === undefined) {
399
- let t20;
436
+ let t19;
400
437
  if ($[41] !== classes || $[42] !== content) {
401
- t20 = /*#__PURE__*/_jsx("div", {
438
+ t19 = /*#__PURE__*/_jsx("div", {
402
439
  className: classes,
403
440
  children: content
404
441
  });
405
442
  $[41] = classes;
406
443
  $[42] = content;
407
- $[43] = t20;
444
+ $[43] = t19;
408
445
  } else {
409
- t20 = $[43];
446
+ t19 = $[43];
410
447
  }
411
- return t20;
448
+ return t19;
412
449
  }
413
- let t20;
450
+ let t19;
414
451
  if ($[44] !== classes || $[45] !== content || $[46] !== onToggle || $[47] !== open) {
415
- t20 = /*#__PURE__*/_jsx("button", {
452
+ t19 = /*#__PURE__*/_jsx("button", {
416
453
  className: classes,
417
454
  onClick: onToggle,
418
455
  "aria-expanded": open,
@@ -422,11 +459,11 @@ export function ToggleLine(t0) {
422
459
  $[45] = content;
423
460
  $[46] = onToggle;
424
461
  $[47] = open;
425
- $[48] = t20;
462
+ $[48] = t19;
426
463
  } else {
427
- t20 = $[48];
464
+ t19 = $[48];
428
465
  }
429
- return t20;
466
+ return t19;
430
467
  }
431
468
  /* The diff renderers load lazily, so a diff waits on them under a line that says so. */
432
469
  function DiffSuspense(t0) {
@@ -1133,7 +1170,7 @@ function _temp(t0) {
1133
1170
  }, key);
1134
1171
  }
1135
1172
  export function WorkRow(t0) {
1136
- const $ = _c(57);
1173
+ const $ = _c(59);
1137
1174
  const {
1138
1175
  tool,
1139
1176
  chatId,
@@ -1180,144 +1217,150 @@ export function WorkRow(t0) {
1180
1217
  t3 = $[9];
1181
1218
  }
1182
1219
  const opens = t3;
1183
- let shell;
1184
1220
  let t4;
1185
- if ($[10] !== detail || $[11] !== host.commandLooks || $[12] !== icon || $[13] !== label || $[14] !== tool.input || $[15] !== tool.name) {
1186
- shell = shellCommand(tool.name, tool.input);
1187
- t4 = detail === undefined && icon === undefined && label === undefined && shell !== null ? matchCommandLook(shell, host.commandLooks) : null;
1188
- $[10] = detail;
1189
- $[11] = host.commandLooks;
1190
- $[12] = icon;
1191
- $[13] = label;
1192
- $[14] = tool.input;
1193
- $[15] = tool.name;
1194
- $[16] = shell;
1195
- $[17] = t4;
1196
- } else {
1197
- shell = $[16];
1198
- t4 = $[17];
1221
+ if ($[10] !== tool.input || $[11] !== tool.name) {
1222
+ t4 = shellCommand(tool.name, tool.input);
1223
+ $[10] = tool.input;
1224
+ $[11] = tool.name;
1225
+ $[12] = t4;
1226
+ } else {
1227
+ t4 = $[12];
1199
1228
  }
1200
- const run = t4;
1201
- const t5 = nested ? "ml-6" : undefined;
1202
- let t6;
1203
- if ($[18] !== icon || $[19] !== run || $[20] !== tool.name) {
1204
- t6 = run === null ? icon ?? toolIcon(tool.name) : /*#__PURE__*/_jsx(run.look.Mark, {
1229
+ const shell = t4;
1230
+ let t5;
1231
+ if ($[13] !== detail || $[14] !== host.commandLooks || $[15] !== host.toolLooks || $[16] !== icon || $[17] !== label || $[18] !== tool) {
1232
+ t5 = detail === undefined && icon === undefined && label === undefined ? lookRunOf(tool, host.commandLooks, host.toolLooks) : null;
1233
+ $[13] = detail;
1234
+ $[14] = host.commandLooks;
1235
+ $[15] = host.toolLooks;
1236
+ $[16] = icon;
1237
+ $[17] = label;
1238
+ $[18] = tool;
1239
+ $[19] = t5;
1240
+ } else {
1241
+ t5 = $[19];
1242
+ }
1243
+ const run = t5;
1244
+ const t6 = nested ? "ml-6" : undefined;
1245
+ let t7;
1246
+ if ($[20] !== icon || $[21] !== run || $[22] !== tool.name) {
1247
+ t7 = run === null ? icon ?? toolIcon(tool.name) : /*#__PURE__*/_jsx(run.look.Mark, {
1205
1248
  size: 12
1206
1249
  });
1207
- $[18] = icon;
1208
- $[19] = run;
1209
- $[20] = tool.name;
1210
- $[21] = t6;
1250
+ $[20] = icon;
1251
+ $[21] = run;
1252
+ $[22] = tool.name;
1253
+ $[23] = t7;
1211
1254
  } else {
1212
- t6 = $[21];
1255
+ t7 = $[23];
1213
1256
  }
1214
- const t7 = run === null ? label ?? tool.name : run.match.label;
1215
- const t8 = run?.look.brand;
1216
- let t9;
1217
- if ($[22] !== chatId || $[23] !== run) {
1218
- t9 = run === null ? undefined : {
1257
+ const t8 = run === null ? label ?? tool.name : run.label;
1258
+ const t9 = run?.look.brand;
1259
+ let t10;
1260
+ if ($[24] !== chatId || $[25] !== run) {
1261
+ t10 = run === null ? undefined : {
1219
1262
  run,
1220
1263
  chatId: chatId ?? ""
1221
1264
  };
1222
- $[22] = chatId;
1223
- $[23] = run;
1224
- $[24] = t9;
1265
+ $[24] = chatId;
1266
+ $[25] = run;
1267
+ $[26] = t10;
1225
1268
  } else {
1226
- t9 = $[24];
1269
+ t10 = $[26];
1227
1270
  }
1228
- const t10 = detail === undefined && summary === shell;
1229
- let t11;
1230
- if ($[25] !== detail || $[26] !== tool.input || $[27] !== tool.name) {
1231
- t11 = detail === undefined && toolSummaryIsPath(tool.name, tool.input);
1232
- $[25] = detail;
1233
- $[26] = tool.input;
1234
- $[27] = tool.name;
1235
- $[28] = t11;
1271
+ const t11 = detail === undefined && summary === shell;
1272
+ let t12;
1273
+ if ($[27] !== detail || $[28] !== tool.input || $[29] !== tool.name) {
1274
+ t12 = detail === undefined && toolSummaryIsPath(tool.name, tool.input);
1275
+ $[27] = detail;
1276
+ $[28] = tool.input;
1277
+ $[29] = tool.name;
1278
+ $[30] = t12;
1236
1279
  } else {
1237
- t11 = $[28];
1280
+ t12 = $[30];
1238
1281
  }
1239
- const t12 = open && opens;
1240
- let t13;
1241
- if ($[29] !== opens) {
1242
- t13 = opens ? () => setOpen(_temp2) : undefined;
1243
- $[29] = opens;
1244
- $[30] = t13;
1282
+ const t13 = open && opens;
1283
+ let t14;
1284
+ if ($[31] !== opens) {
1285
+ t14 = opens ? () => setOpen(_temp2) : undefined;
1286
+ $[31] = opens;
1287
+ $[32] = t14;
1245
1288
  } else {
1246
- t13 = $[30];
1289
+ t14 = $[32];
1247
1290
  }
1248
- const t14 = failed ?? tool.state === "error";
1249
- let t15;
1250
- if ($[31] !== summary || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t6 || $[38] !== t7 || $[39] !== t8 || $[40] !== t9 || $[41] !== tool.createdAt) {
1251
- t15 = /*#__PURE__*/_jsx(ToggleLine, {
1252
- icon: t6,
1253
- label: t7,
1254
- brand: t8,
1291
+ const t15 = failed ?? tool.state === "error";
1292
+ let t16;
1293
+ if ($[33] !== summary || $[34] !== t10 || $[35] !== t11 || $[36] !== t12 || $[37] !== t13 || $[38] !== t14 || $[39] !== t15 || $[40] !== t7 || $[41] !== t8 || $[42] !== t9 || $[43] !== tool.createdAt) {
1294
+ t16 = /*#__PURE__*/_jsx(ToggleLine, {
1295
+ icon: t7,
1296
+ label: t8,
1297
+ brand: t9,
1255
1298
  detail: summary,
1256
- look: t9,
1257
- command: t10,
1258
- path: t11,
1259
- open: t12,
1260
- onToggle: t13,
1261
- failed: t14,
1299
+ look: t10,
1300
+ command: t11,
1301
+ path: t12,
1302
+ open: t13,
1303
+ onToggle: t14,
1304
+ failed: t15,
1262
1305
  time: tool.createdAt
1263
1306
  });
1264
- $[31] = summary;
1265
- $[32] = t10;
1266
- $[33] = t11;
1267
- $[34] = t12;
1268
- $[35] = t13;
1269
- $[36] = t14;
1270
- $[37] = t6;
1271
- $[38] = t7;
1272
- $[39] = t8;
1273
- $[40] = t9;
1274
- $[41] = tool.createdAt;
1275
- $[42] = t15;
1276
- } else {
1277
- t15 = $[42];
1307
+ $[33] = summary;
1308
+ $[34] = t10;
1309
+ $[35] = t11;
1310
+ $[36] = t12;
1311
+ $[37] = t13;
1312
+ $[38] = t14;
1313
+ $[39] = t15;
1314
+ $[40] = t7;
1315
+ $[41] = t8;
1316
+ $[42] = t9;
1317
+ $[43] = tool.createdAt;
1318
+ $[44] = t16;
1319
+ } else {
1320
+ t16 = $[44];
1278
1321
  }
1279
- let t16;
1280
- if ($[43] !== ReadImage || $[44] !== image) {
1281
- t16 = image !== null && ReadImage !== null && /*#__PURE__*/_jsx(ReadImage, {
1322
+ let t17;
1323
+ if ($[45] !== ReadImage || $[46] !== image) {
1324
+ t17 = image !== null && ReadImage !== null && /*#__PURE__*/_jsx(ReadImage, {
1282
1325
  path: image
1283
1326
  });
1284
- $[43] = ReadImage;
1285
- $[44] = image;
1286
- $[45] = t16;
1327
+ $[45] = ReadImage;
1328
+ $[46] = image;
1329
+ $[47] = t17;
1287
1330
  } else {
1288
- t16 = $[45];
1331
+ t17 = $[47];
1289
1332
  }
1290
- let t17;
1291
- if ($[46] !== chatId || $[47] !== open || $[48] !== opens || $[49] !== tool) {
1292
- t17 = open && opens && /*#__PURE__*/_jsx(ToolBody, {
1333
+ let t18;
1334
+ if ($[48] !== chatId || $[49] !== open || $[50] !== opens || $[51] !== tool) {
1335
+ t18 = open && opens && /*#__PURE__*/_jsx(ToolBody, {
1293
1336
  tool: tool,
1294
1337
  chatId: chatId
1295
1338
  });
1296
- $[46] = chatId;
1297
- $[47] = open;
1298
- $[48] = opens;
1299
- $[49] = tool;
1300
- $[50] = t17;
1339
+ $[48] = chatId;
1340
+ $[49] = open;
1341
+ $[50] = opens;
1342
+ $[51] = tool;
1343
+ $[52] = t18;
1301
1344
  } else {
1302
- t17 = $[50];
1345
+ t18 = $[52];
1303
1346
  }
1304
- let t18;
1305
- if ($[51] !== t15 || $[52] !== t16 || $[53] !== t17 || $[54] !== t5 || $[55] !== tool.id) {
1306
- t18 = /*#__PURE__*/_jsxs("div", {
1347
+ let t19;
1348
+ if ($[53] !== t16 || $[54] !== t17 || $[55] !== t18 || $[56] !== t6 || $[57] !== tool.id) {
1349
+ t19 = /*#__PURE__*/_jsxs("div", {
1307
1350
  "data-find-item": tool.id,
1308
- className: t5,
1309
- children: [t15, t16, t17]
1351
+ className: t6,
1352
+ children: [t16, t17, t18]
1310
1353
  });
1311
- $[51] = t15;
1312
- $[52] = t16;
1313
- $[53] = t17;
1314
- $[54] = t5;
1315
- $[55] = tool.id;
1316
- $[56] = t18;
1354
+ $[53] = t16;
1355
+ $[54] = t17;
1356
+ $[55] = t18;
1357
+ $[56] = t6;
1358
+ $[57] = tool.id;
1359
+ $[58] = t19;
1317
1360
  } else {
1318
- t18 = $[56];
1361
+ t19 = $[58];
1319
1362
  }
1320
- return t18;
1363
+ return t19;
1321
1364
  }
1322
1365
  /* "running for 12s" next to a live call. */
1323
1366
  function _temp2(o) {
@@ -1356,17 +1399,16 @@ export function RunningFor(t0) {
1356
1399
  }
1357
1400
  return t2;
1358
1401
  }
1359
- /* The mark of one call: the look its shell command runs under, else what the tool is about. */
1360
- function callIcon(tool, commandLooks) {
1361
- const shell = shellCommand(tool.name, tool.input);
1362
- const run = shell === null ? null : matchCommandLook(shell, commandLooks);
1402
+ /* The mark of one call: the look it runs under, else what the tool is about. */
1403
+ function callIcon(tool, commandLooks, toolLooks) {
1404
+ const run = lookRunOf(tool, commandLooks, toolLooks);
1363
1405
  return run === null ? toolIcon(tool.name) : /*#__PURE__*/_jsx(run.look.Mark, {
1364
1406
  size: 12
1365
1407
  });
1366
1408
  }
1367
1409
  /* A call still running: its timer on the line, and for a provider that streams output, the last lines under it. */
1368
1410
  export function WorkLiveRow(t0) {
1369
- const $ = _c(50);
1411
+ const $ = _c(54);
1370
1412
  const {
1371
1413
  chatId,
1372
1414
  tool: derived
@@ -1401,54 +1443,54 @@ export function WorkLiveRow(t0) {
1401
1443
  t3 = $[6];
1402
1444
  }
1403
1445
  const opens = t3;
1404
- const shell = shellCommand(tool.name, tool.input);
1405
1446
  const {
1406
- commandLooks
1447
+ commandLooks,
1448
+ toolLooks
1407
1449
  } = useChatHost();
1408
- const run = shell === null ? null : matchCommandLook(shell, commandLooks);
1450
+ let t4;
1451
+ if ($[7] !== commandLooks || $[8] !== tool || $[9] !== toolLooks) {
1452
+ t4 = lookRunOf(tool, commandLooks, toolLooks);
1453
+ $[7] = commandLooks;
1454
+ $[8] = tool;
1455
+ $[9] = toolLooks;
1456
+ $[10] = t4;
1457
+ } else {
1458
+ t4 = $[10];
1459
+ }
1460
+ const run = t4;
1409
1461
  const awaiting = useAwaitsApproval(chatId, tool.toolUseId);
1410
1462
  const {
1411
1463
  t
1412
1464
  } = useTranslation("agent-chat");
1413
- let t4;
1414
- if ($[7] !== run || $[8] !== tool.name) {
1415
- t4 = run === null ? toolIcon(tool.name) : /*#__PURE__*/_jsx(run.look.Mark, {
1465
+ let t5;
1466
+ if ($[11] !== run || $[12] !== tool.name) {
1467
+ t5 = run === null ? toolIcon(tool.name) : /*#__PURE__*/_jsx(run.look.Mark, {
1416
1468
  size: 12
1417
1469
  });
1418
- $[7] = run;
1419
- $[8] = tool.name;
1420
- $[9] = t4;
1470
+ $[11] = run;
1471
+ $[12] = tool.name;
1472
+ $[13] = t5;
1421
1473
  } else {
1422
- t4 = $[9];
1474
+ t5 = $[13];
1423
1475
  }
1424
- const t5 = run === null ? tool.name : run.match.label;
1425
- const t6 = run?.look.brand;
1426
- let t7;
1427
- if ($[10] !== chatId || $[11] !== run) {
1428
- t7 = run === null ? undefined : {
1476
+ const t6 = run === null ? tool.name : run.label;
1477
+ const t7 = run?.look.brand;
1478
+ let t8;
1479
+ if ($[14] !== chatId || $[15] !== run) {
1480
+ t8 = run === null ? undefined : {
1429
1481
  run,
1430
1482
  chatId
1431
1483
  };
1432
- $[10] = chatId;
1433
- $[11] = run;
1434
- $[12] = t7;
1435
- } else {
1436
- t7 = $[12];
1437
- }
1438
- const t8 = summary || tool.progress?.description || "";
1439
- let t9;
1440
- if ($[13] !== summary || $[14] !== tool.input || $[15] !== tool.name) {
1441
- t9 = summary !== "" && summary === shellCommand(tool.name, tool.input);
1442
- $[13] = summary;
1443
- $[14] = tool.input;
1444
- $[15] = tool.name;
1445
- $[16] = t9;
1484
+ $[14] = chatId;
1485
+ $[15] = run;
1486
+ $[16] = t8;
1446
1487
  } else {
1447
- t9 = $[16];
1488
+ t8 = $[16];
1448
1489
  }
1490
+ const t9 = summary || tool.progress?.description || "";
1449
1491
  let t10;
1450
1492
  if ($[17] !== summary || $[18] !== tool.input || $[19] !== tool.name) {
1451
- t10 = summary !== "" && toolSummaryIsPath(tool.name, tool.input);
1493
+ t10 = summary !== "" && summary === shellCommand(tool.name, tool.input);
1452
1494
  $[17] = summary;
1453
1495
  $[18] = tool.input;
1454
1496
  $[19] = tool.name;
@@ -1456,108 +1498,118 @@ export function WorkLiveRow(t0) {
1456
1498
  } else {
1457
1499
  t10 = $[20];
1458
1500
  }
1459
- const t11 = open && opens;
1460
- let t12;
1461
- if ($[21] !== opens) {
1462
- t12 = opens ? () => setOpen(_temp3) : undefined;
1463
- $[21] = opens;
1464
- $[22] = t12;
1501
+ let t11;
1502
+ if ($[21] !== summary || $[22] !== tool.input || $[23] !== tool.name) {
1503
+ t11 = summary !== "" && toolSummaryIsPath(tool.name, tool.input);
1504
+ $[21] = summary;
1505
+ $[22] = tool.input;
1506
+ $[23] = tool.name;
1507
+ $[24] = t11;
1465
1508
  } else {
1466
- t12 = $[22];
1509
+ t11 = $[24];
1467
1510
  }
1511
+ const t12 = open && opens;
1468
1512
  let t13;
1469
- if ($[23] !== awaiting || $[24] !== t || $[25] !== tool) {
1470
- t13 = awaiting ? /*#__PURE__*/_jsx("span", {
1513
+ if ($[25] !== opens) {
1514
+ t13 = opens ? () => setOpen(_temp3) : undefined;
1515
+ $[25] = opens;
1516
+ $[26] = t13;
1517
+ } else {
1518
+ t13 = $[26];
1519
+ }
1520
+ let t14;
1521
+ if ($[27] !== awaiting || $[28] !== t || $[29] !== tool) {
1522
+ t14 = awaiting ? /*#__PURE__*/_jsx("span", {
1471
1523
  className: "shrink-0 text-xs text-text-faint",
1472
1524
  children: t("work.awaitingApproval")
1473
1525
  }) : /*#__PURE__*/_jsx(RunningFor, {
1474
1526
  startedAt: toolStartedAt(tool)
1475
1527
  });
1476
- $[23] = awaiting;
1477
- $[24] = t;
1478
- $[25] = tool;
1479
- $[26] = t13;
1528
+ $[27] = awaiting;
1529
+ $[28] = t;
1530
+ $[29] = tool;
1531
+ $[30] = t14;
1480
1532
  } else {
1481
- t13 = $[26];
1533
+ t14 = $[30];
1482
1534
  }
1483
- let t14;
1484
- if ($[27] !== t10 || $[28] !== t11 || $[29] !== t12 || $[30] !== t13 || $[31] !== t4 || $[32] !== t5 || $[33] !== t6 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9) {
1485
- t14 = /*#__PURE__*/_jsx(ToggleLine, {
1486
- icon: t4,
1487
- label: t5,
1488
- brand: t6,
1489
- look: t7,
1490
- detail: t8,
1491
- command: t9,
1492
- path: t10,
1493
- open: t11,
1494
- onToggle: t12,
1495
- trailing: t13,
1535
+ let t15;
1536
+ if ($[31] !== t10 || $[32] !== t11 || $[33] !== t12 || $[34] !== t13 || $[35] !== t14 || $[36] !== t5 || $[37] !== t6 || $[38] !== t7 || $[39] !== t8 || $[40] !== t9) {
1537
+ t15 = /*#__PURE__*/_jsx(ToggleLine, {
1538
+ icon: t5,
1539
+ label: t6,
1540
+ brand: t7,
1541
+ look: t8,
1542
+ detail: t9,
1543
+ command: t10,
1544
+ path: t11,
1545
+ open: t12,
1546
+ onToggle: t13,
1547
+ trailing: t14,
1496
1548
  live: true
1497
1549
  });
1498
- $[27] = t10;
1499
- $[28] = t11;
1500
- $[29] = t12;
1501
- $[30] = t13;
1502
- $[31] = t4;
1503
- $[32] = t5;
1504
- $[33] = t6;
1505
- $[34] = t7;
1506
- $[35] = t8;
1507
- $[36] = t9;
1508
- $[37] = t14;
1550
+ $[31] = t10;
1551
+ $[32] = t11;
1552
+ $[33] = t12;
1553
+ $[34] = t13;
1554
+ $[35] = t14;
1555
+ $[36] = t5;
1556
+ $[37] = t6;
1557
+ $[38] = t7;
1558
+ $[39] = t8;
1559
+ $[40] = t9;
1560
+ $[41] = t15;
1509
1561
  } else {
1510
- t14 = $[37];
1562
+ t15 = $[41];
1511
1563
  }
1512
- let t15;
1513
- if ($[38] !== chatId || $[39] !== open || $[40] !== opens || $[41] !== tool) {
1514
- t15 = open && opens && /*#__PURE__*/_jsx(ToolBody, {
1564
+ let t16;
1565
+ if ($[42] !== chatId || $[43] !== open || $[44] !== opens || $[45] !== tool) {
1566
+ t16 = open && opens && /*#__PURE__*/_jsx(ToolBody, {
1515
1567
  tool: tool,
1516
1568
  chatId: chatId
1517
1569
  });
1518
- $[38] = chatId;
1519
- $[39] = open;
1520
- $[40] = opens;
1521
- $[41] = tool;
1522
- $[42] = t15;
1570
+ $[42] = chatId;
1571
+ $[43] = open;
1572
+ $[44] = opens;
1573
+ $[45] = tool;
1574
+ $[46] = t16;
1523
1575
  } else {
1524
- t15 = $[42];
1576
+ t16 = $[46];
1525
1577
  }
1526
- let t16;
1527
- if ($[43] !== open || $[44] !== tail) {
1528
- t16 = tail !== null && !open && /*#__PURE__*/_jsx("pre", {
1578
+ let t17;
1579
+ if ($[47] !== open || $[48] !== tail) {
1580
+ t17 = tail !== null && !open && /*#__PURE__*/_jsx("pre", {
1529
1581
  className: "mt-1.5 mb-2 ml-6 max-h-48 overflow-auto rounded-md border border-border bg-surface-raised px-3 py-2 font-mono text-code whitespace-pre-wrap text-chat-output select-text",
1530
1582
  children: /*#__PURE__*/_jsx(AnsiOutput, {
1531
1583
  text: tail,
1532
1584
  tailLines: 12
1533
1585
  })
1534
1586
  });
1535
- $[43] = open;
1536
- $[44] = tail;
1537
- $[45] = t16;
1587
+ $[47] = open;
1588
+ $[48] = tail;
1589
+ $[49] = t17;
1538
1590
  } else {
1539
- t16 = $[45];
1591
+ t17 = $[49];
1540
1592
  }
1541
- let t17;
1542
- if ($[46] !== t14 || $[47] !== t15 || $[48] !== t16) {
1543
- t17 = /*#__PURE__*/_jsxs("div", {
1544
- children: [t14, t15, t16]
1593
+ let t18;
1594
+ if ($[50] !== t15 || $[51] !== t16 || $[52] !== t17) {
1595
+ t18 = /*#__PURE__*/_jsxs("div", {
1596
+ children: [t15, t16, t17]
1545
1597
  });
1546
- $[46] = t14;
1547
- $[47] = t15;
1548
- $[48] = t16;
1549
- $[49] = t17;
1598
+ $[50] = t15;
1599
+ $[51] = t16;
1600
+ $[52] = t17;
1601
+ $[53] = t18;
1550
1602
  } else {
1551
- t17 = $[49];
1603
+ t18 = $[53];
1552
1604
  }
1553
- return t17;
1605
+ return t18;
1554
1606
  }
1555
1607
  /* A run of tool calls as one line ("Read 4 files"); opening it lists every call. A run of one look wears its mark and its brand. */
1556
1608
  function _temp3(o) {
1557
1609
  return !o;
1558
1610
  }
1559
1611
  export function WorkGroupRow(t0) {
1560
- const $ = _c(31);
1612
+ const $ = _c(35);
1561
1613
  const {
1562
1614
  tools,
1563
1615
  summary,
@@ -1569,7 +1621,8 @@ export function WorkGroupRow(t0) {
1569
1621
  t
1570
1622
  } = useTranslation("agent-chat");
1571
1623
  const {
1572
- commandLooks
1624
+ commandLooks,
1625
+ toolLooks
1573
1626
  } = useChatHost();
1574
1627
  let t1;
1575
1628
  if ($[0] !== tools) {
@@ -1582,101 +1635,115 @@ export function WorkGroupRow(t0) {
1582
1635
  const running = t1.length;
1583
1636
  let t2;
1584
1637
  if ($[2] !== tools) {
1585
- t2 = tools.some(_temp5);
1638
+ t2 = tools.filter(_temp5);
1586
1639
  $[2] = tools;
1587
1640
  $[3] = t2;
1588
1641
  } else {
1589
1642
  t2 = $[3];
1590
1643
  }
1591
- const failed = t2;
1644
+ const failed = t2.length;
1592
1645
  let T0;
1593
1646
  let latest;
1594
1647
  let t3;
1595
- if ($[4] !== commandLooks || $[5] !== look || $[6] !== tools) {
1648
+ if ($[4] !== commandLooks || $[5] !== look || $[6] !== toolLooks || $[7] !== tools) {
1596
1649
  latest = tools.findLast(_temp6);
1597
1650
  T0 = ToggleLine;
1598
- t3 = latest !== undefined ? callIcon(latest, commandLooks) : look === undefined ? toolIcon(tools[0].name) : /*#__PURE__*/_jsx(look.Mark, {
1651
+ t3 = latest !== undefined ? callIcon(latest, commandLooks, toolLooks) : look === undefined ? toolIcon(tools[0].name) : /*#__PURE__*/_jsx(look.Mark, {
1599
1652
  size: 12
1600
1653
  });
1601
1654
  $[4] = commandLooks;
1602
1655
  $[5] = look;
1603
- $[6] = tools;
1604
- $[7] = T0;
1605
- $[8] = latest;
1606
- $[9] = t3;
1656
+ $[6] = toolLooks;
1657
+ $[7] = tools;
1658
+ $[8] = T0;
1659
+ $[9] = latest;
1660
+ $[10] = t3;
1607
1661
  } else {
1608
- T0 = $[7];
1609
- latest = $[8];
1610
- t3 = $[9];
1662
+ T0 = $[8];
1663
+ latest = $[9];
1664
+ t3 = $[10];
1611
1665
  }
1612
1666
  let t4;
1613
- if ($[10] !== look || $[11] !== running || $[12] !== summary || $[13] !== t || $[14] !== tools.length) {
1667
+ if ($[11] !== look || $[12] !== running || $[13] !== summary || $[14] !== t || $[15] !== tools.length) {
1614
1668
  t4 = running > 0 ? t("group.toolCalls", {
1615
1669
  count: tools.length
1616
1670
  }) : look?.brand === undefined ? summary : withBrand(summary, [look.brand]);
1617
- $[10] = look;
1618
- $[11] = running;
1619
- $[12] = summary;
1620
- $[13] = t;
1621
- $[14] = tools.length;
1622
- $[15] = t4;
1671
+ $[11] = look;
1672
+ $[12] = running;
1673
+ $[13] = summary;
1674
+ $[14] = t;
1675
+ $[15] = tools.length;
1676
+ $[16] = t4;
1623
1677
  } else {
1624
- t4 = $[15];
1678
+ t4 = $[16];
1625
1679
  }
1626
1680
  let t5;
1627
- if ($[16] !== t4) {
1628
- t5 = /*#__PURE__*/_jsx("span", {
1681
+ if ($[17] !== failed || $[18] !== t) {
1682
+ t5 = failed > 0 && /*#__PURE__*/_jsx("span", {
1683
+ className: "text-status-error",
1684
+ children: ` · ${t("group.failed", {
1685
+ count: failed
1686
+ })}`
1687
+ });
1688
+ $[17] = failed;
1689
+ $[18] = t;
1690
+ $[19] = t5;
1691
+ } else {
1692
+ t5 = $[19];
1693
+ }
1694
+ let t6;
1695
+ if ($[20] !== t4 || $[21] !== t5) {
1696
+ t6 = /*#__PURE__*/_jsxs("span", {
1629
1697
  className: "tabular-nums",
1630
- children: t4
1698
+ children: [t4, t5]
1631
1699
  });
1632
- $[16] = t4;
1633
- $[17] = t5;
1700
+ $[20] = t4;
1701
+ $[21] = t5;
1702
+ $[22] = t6;
1634
1703
  } else {
1635
- t5 = $[17];
1704
+ t6 = $[22];
1636
1705
  }
1637
- const t6 = latest !== undefined;
1638
- let t7;
1639
- if ($[18] !== running || $[19] !== t) {
1640
- t7 = running > 0 && /*#__PURE__*/_jsx("span", {
1706
+ const t7 = latest !== undefined;
1707
+ let t8;
1708
+ if ($[23] !== running || $[24] !== t) {
1709
+ t8 = running > 0 && /*#__PURE__*/_jsx("span", {
1641
1710
  className: "shrink-0 text-text-faint tabular-nums",
1642
1711
  children: t("group.running", {
1643
1712
  count: running
1644
1713
  })
1645
1714
  });
1646
- $[18] = running;
1647
- $[19] = t;
1648
- $[20] = t7;
1715
+ $[23] = running;
1716
+ $[24] = t;
1717
+ $[25] = t8;
1649
1718
  } else {
1650
- t7 = $[20];
1719
+ t8 = $[25];
1651
1720
  }
1652
- let t8;
1653
- if ($[21] !== T0 || $[22] !== expanded || $[23] !== failed || $[24] !== onToggle || $[25] !== t3 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7 || $[29] !== tools[0].createdAt) {
1654
- t8 = /*#__PURE__*/_jsx("div", {
1721
+ let t9;
1722
+ if ($[26] !== T0 || $[27] !== expanded || $[28] !== onToggle || $[29] !== t3 || $[30] !== t6 || $[31] !== t7 || $[32] !== t8 || $[33] !== tools[0].createdAt) {
1723
+ t9 = /*#__PURE__*/_jsx("div", {
1655
1724
  children: /*#__PURE__*/_jsx(T0, {
1656
1725
  icon: t3,
1657
- label: t5,
1726
+ label: t6,
1658
1727
  open: expanded,
1659
1728
  onToggle: onToggle,
1660
- failed: failed,
1661
- live: t6,
1662
- trailing: t7,
1729
+ live: t7,
1730
+ trailing: t8,
1663
1731
  time: tools[0].createdAt
1664
1732
  })
1665
1733
  });
1666
- $[21] = T0;
1667
- $[22] = expanded;
1668
- $[23] = failed;
1669
- $[24] = onToggle;
1670
- $[25] = t3;
1671
- $[26] = t5;
1672
- $[27] = t6;
1673
- $[28] = t7;
1674
- $[29] = tools[0].createdAt;
1675
- $[30] = t8;
1734
+ $[26] = T0;
1735
+ $[27] = expanded;
1736
+ $[28] = onToggle;
1737
+ $[29] = t3;
1738
+ $[30] = t6;
1739
+ $[31] = t7;
1740
+ $[32] = t8;
1741
+ $[33] = tools[0].createdAt;
1742
+ $[34] = t9;
1676
1743
  } else {
1677
- t8 = $[30];
1744
+ t9 = $[34];
1678
1745
  }
1679
- return t8;
1746
+ return t9;
1680
1747
  }
1681
1748
  /*
1682
1749
  * A settled turn folded behind how long it took and what it did. A line and not a button, like the
@@ -1692,7 +1759,7 @@ function _temp4(tool) {
1692
1759
  return tool.state === "running";
1693
1760
  }
1694
1761
  export function TurnFoldRow(t0) {
1695
- const $ = _c(39);
1762
+ const $ = _c(40);
1696
1763
  const {
1697
1764
  turn,
1698
1765
  label,
@@ -1702,156 +1769,160 @@ export function TurnFoldRow(t0) {
1702
1769
  onToggle
1703
1770
  } = t0;
1704
1771
  const {
1705
- commandLooks
1772
+ commandLooks: t1,
1773
+ toolLooks: t2
1706
1774
  } = useChatHost();
1707
1775
  let className;
1708
- let t1;
1709
- let t2;
1710
1776
  let t3;
1711
- if ($[0] !== commandLooks || $[1] !== expandable || $[2] !== expanded || $[3] !== label || $[4] !== turn.state || $[5] !== work) {
1712
- const brands = commandLooks?.flatMap(_temp7) ?? [];
1713
- const t4 = expandable && "hover:bg-surface-hover";
1714
- const t5 = turn.state === "error" && "text-status-error";
1715
- let t6;
1716
- if ($[10] !== t4 || $[11] !== t5) {
1717
- t6 = clsx("group group/line -mx-1 mb-2 flex h-7 w-[calc(100%+8px)] min-w-0 items-center gap-2 rounded-md px-1 text-left text-xs text-text-muted", t4, t5);
1718
- $[10] = t4;
1719
- $[11] = t5;
1720
- $[12] = t6;
1777
+ let t4;
1778
+ let t5;
1779
+ if ($[0] !== expandable || $[1] !== expanded || $[2] !== label || $[3] !== t1 || $[4] !== t2 || $[5] !== turn.state || $[6] !== work) {
1780
+ const commandLooks = t1 === undefined ? [] : t1;
1781
+ const toolLooks = t2 === undefined ? [] : t2;
1782
+ const brands = [...commandLooks, ...toolLooks].flatMap(_temp7);
1783
+ const t6 = expandable && "hover:bg-surface-hover";
1784
+ const t7 = turn.state === "error" && "text-status-error";
1785
+ let t8;
1786
+ if ($[11] !== t6 || $[12] !== t7) {
1787
+ t8 = clsx("group group/line -mx-1 mb-2 flex h-7 w-[calc(100%+8px)] min-w-0 items-center gap-2 rounded-md px-1 text-left text-xs text-text-muted", t6, t7);
1788
+ $[11] = t6;
1789
+ $[12] = t7;
1790
+ $[13] = t8;
1721
1791
  } else {
1722
- t6 = $[12];
1792
+ t8 = $[13];
1723
1793
  }
1724
- className = t6;
1725
- let t7;
1726
- if ($[13] !== expandable || $[14] !== expanded) {
1727
- t7 = expandable && /*#__PURE__*/_jsx(Icon, {
1794
+ className = t8;
1795
+ let t9;
1796
+ if ($[14] !== expandable || $[15] !== expanded) {
1797
+ t9 = expandable && /*#__PURE__*/_jsx(Icon, {
1728
1798
  icon: ChevronRight,
1729
1799
  size: 12,
1730
1800
  className: clsx("transition-transform", expanded && "rotate-90")
1731
1801
  });
1732
- $[13] = expandable;
1733
- $[14] = expanded;
1734
- $[15] = t7;
1802
+ $[14] = expandable;
1803
+ $[15] = expanded;
1804
+ $[16] = t9;
1735
1805
  } else {
1736
- t7 = $[15];
1806
+ t9 = $[16];
1737
1807
  }
1738
- if ($[16] !== t7) {
1739
- t1 = /*#__PURE__*/_jsx("span", {
1808
+ if ($[17] !== t9) {
1809
+ t3 = /*#__PURE__*/_jsx("span", {
1740
1810
  className: ROW_GUTTER,
1741
- children: t7
1811
+ children: t9
1742
1812
  });
1743
- $[16] = t7;
1744
- $[17] = t1;
1813
+ $[17] = t9;
1814
+ $[18] = t3;
1745
1815
  } else {
1746
- t1 = $[17];
1816
+ t3 = $[18];
1747
1817
  }
1748
- const t8 = expandable && "group-hover:text-text";
1749
- let t9;
1750
- if ($[18] !== t8) {
1751
- t9 = clsx("shrink-0", t8);
1752
- $[18] = t8;
1753
- $[19] = t9;
1818
+ const t10 = expandable && "group-hover:text-text";
1819
+ let t11;
1820
+ if ($[19] !== t10) {
1821
+ t11 = clsx("shrink-0", t10);
1822
+ $[19] = t10;
1823
+ $[20] = t11;
1754
1824
  } else {
1755
- t9 = $[19];
1825
+ t11 = $[20];
1756
1826
  }
1757
- if ($[20] !== label || $[21] !== t9) {
1758
- t2 = /*#__PURE__*/_jsx("span", {
1759
- className: t9,
1827
+ if ($[21] !== label || $[22] !== t11) {
1828
+ t4 = /*#__PURE__*/_jsx("span", {
1829
+ className: t11,
1760
1830
  children: label
1761
1831
  });
1762
- $[20] = label;
1763
- $[21] = t9;
1764
- $[22] = t2;
1832
+ $[21] = label;
1833
+ $[22] = t11;
1834
+ $[23] = t4;
1765
1835
  } else {
1766
- t2 = $[22];
1836
+ t4 = $[23];
1767
1837
  }
1768
- t3 = work.length > 0 && /*#__PURE__*/_jsx("span", {
1838
+ t5 = work.length > 0 && /*#__PURE__*/_jsx("span", {
1769
1839
  className: "min-w-0 truncate text-text-faint",
1770
1840
  children: work.map((part, index) => /*#__PURE__*/_jsxs(Fragment, {
1771
1841
  children: [" \xB7 ", withBrand(part, brands)]
1772
1842
  }, index))
1773
1843
  });
1774
- $[0] = commandLooks;
1775
- $[1] = expandable;
1776
- $[2] = expanded;
1777
- $[3] = label;
1778
- $[4] = turn.state;
1779
- $[5] = work;
1780
- $[6] = className;
1781
- $[7] = t1;
1782
- $[8] = t2;
1783
- $[9] = t3;
1844
+ $[0] = expandable;
1845
+ $[1] = expanded;
1846
+ $[2] = label;
1847
+ $[3] = t1;
1848
+ $[4] = t2;
1849
+ $[5] = turn.state;
1850
+ $[6] = work;
1851
+ $[7] = className;
1852
+ $[8] = t3;
1853
+ $[9] = t4;
1854
+ $[10] = t5;
1784
1855
  } else {
1785
- className = $[6];
1786
- t1 = $[7];
1787
- t2 = $[8];
1788
- t3 = $[9];
1856
+ className = $[7];
1857
+ t3 = $[8];
1858
+ t4 = $[9];
1859
+ t5 = $[10];
1789
1860
  }
1790
- let t4;
1791
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
1792
- t4 = /*#__PURE__*/_jsx("span", {
1861
+ let t6;
1862
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
1863
+ t6 = /*#__PURE__*/_jsx("span", {
1793
1864
  className: "grow"
1794
1865
  });
1795
- $[23] = t4;
1866
+ $[24] = t6;
1796
1867
  } else {
1797
- t4 = $[23];
1868
+ t6 = $[24];
1798
1869
  }
1799
- let t5;
1800
- if ($[24] !== turn.createdAt) {
1801
- t5 = /*#__PURE__*/_jsx(RowTime, {
1870
+ let t7;
1871
+ if ($[25] !== turn.createdAt) {
1872
+ t7 = /*#__PURE__*/_jsx(RowTime, {
1802
1873
  at: turn.createdAt
1803
1874
  });
1804
- $[24] = turn.createdAt;
1805
- $[25] = t5;
1875
+ $[25] = turn.createdAt;
1876
+ $[26] = t7;
1806
1877
  } else {
1807
- t5 = $[25];
1878
+ t7 = $[26];
1808
1879
  }
1809
- let t6;
1810
- if ($[26] !== t1 || $[27] !== t2 || $[28] !== t3 || $[29] !== t5) {
1811
- t6 = /*#__PURE__*/_jsxs(_Fragment, {
1812
- children: [t1, t2, t3, t4, t5]
1880
+ let t8;
1881
+ if ($[27] !== t3 || $[28] !== t4 || $[29] !== t5 || $[30] !== t7) {
1882
+ t8 = /*#__PURE__*/_jsxs(_Fragment, {
1883
+ children: [t3, t4, t5, t6, t7]
1813
1884
  });
1814
- $[26] = t1;
1815
- $[27] = t2;
1816
- $[28] = t3;
1885
+ $[27] = t3;
1886
+ $[28] = t4;
1817
1887
  $[29] = t5;
1818
- $[30] = t6;
1888
+ $[30] = t7;
1889
+ $[31] = t8;
1819
1890
  } else {
1820
- t6 = $[30];
1891
+ t8 = $[31];
1821
1892
  }
1822
- const content = t6;
1893
+ const content = t8;
1823
1894
  if (!expandable) {
1824
- let t7;
1825
- if ($[31] !== className || $[32] !== content) {
1826
- t7 = /*#__PURE__*/_jsx("div", {
1895
+ let t9;
1896
+ if ($[32] !== className || $[33] !== content) {
1897
+ t9 = /*#__PURE__*/_jsx("div", {
1827
1898
  className: className,
1828
1899
  children: content
1829
1900
  });
1830
- $[31] = className;
1831
- $[32] = content;
1832
- $[33] = t7;
1901
+ $[32] = className;
1902
+ $[33] = content;
1903
+ $[34] = t9;
1833
1904
  } else {
1834
- t7 = $[33];
1905
+ t9 = $[34];
1835
1906
  }
1836
- return t7;
1907
+ return t9;
1837
1908
  }
1838
- let t7;
1839
- if ($[34] !== className || $[35] !== content || $[36] !== expanded || $[37] !== onToggle) {
1840
- t7 = /*#__PURE__*/_jsx("button", {
1909
+ let t9;
1910
+ if ($[35] !== className || $[36] !== content || $[37] !== expanded || $[38] !== onToggle) {
1911
+ t9 = /*#__PURE__*/_jsx("button", {
1841
1912
  className: className,
1842
1913
  "aria-expanded": expanded,
1843
1914
  onClick: onToggle,
1844
1915
  children: content
1845
1916
  });
1846
- $[34] = className;
1847
- $[35] = content;
1848
- $[36] = expanded;
1849
- $[37] = onToggle;
1850
- $[38] = t7;
1917
+ $[35] = className;
1918
+ $[36] = content;
1919
+ $[37] = expanded;
1920
+ $[38] = onToggle;
1921
+ $[39] = t9;
1851
1922
  } else {
1852
- t7 = $[38];
1923
+ t9 = $[39];
1853
1924
  }
1854
- return t7;
1925
+ return t9;
1855
1926
  }
1856
1927
  function _temp7(t0) {
1857
1928
  const {
@@ -2499,7 +2570,7 @@ function _temp12(t0) {
2499
2570
  };
2500
2571
  }
2501
2572
  export function WorkingRow(t0) {
2502
- const $ = _c(20);
2573
+ const $ = _c(21);
2503
2574
  const {
2504
2575
  startedAt,
2505
2576
  tool
@@ -2508,7 +2579,8 @@ export function WorkingRow(t0) {
2508
2579
  t
2509
2580
  } = useTranslation("agent-chat");
2510
2581
  const {
2511
- commandLooks
2582
+ commandLooks,
2583
+ toolLooks
2512
2584
  } = useChatHost();
2513
2585
  let t1;
2514
2586
  if ($[0] !== startedAt) {
@@ -2529,70 +2601,71 @@ export function WorkingRow(t0) {
2529
2601
  t3 = $[3];
2530
2602
  }
2531
2603
  let t4;
2532
- if ($[4] !== commandLooks || $[5] !== tool) {
2604
+ if ($[4] !== commandLooks || $[5] !== tool || $[6] !== toolLooks) {
2533
2605
  t4 = tool === undefined ? /*#__PURE__*/_jsx(Spinner, {
2534
2606
  size: 12
2535
- }) : callIcon(tool, commandLooks);
2607
+ }) : callIcon(tool, commandLooks, toolLooks);
2536
2608
  $[4] = commandLooks;
2537
2609
  $[5] = tool;
2538
- $[6] = t4;
2610
+ $[6] = toolLooks;
2611
+ $[7] = t4;
2539
2612
  } else {
2540
- t4 = $[6];
2613
+ t4 = $[7];
2541
2614
  }
2542
2615
  let t5;
2543
- if ($[7] !== t3 || $[8] !== t4) {
2616
+ if ($[8] !== t3 || $[9] !== t4) {
2544
2617
  t5 = /*#__PURE__*/_jsx("span", {
2545
2618
  className: t3,
2546
2619
  children: t4
2547
2620
  });
2548
- $[7] = t3;
2549
- $[8] = t4;
2550
- $[9] = t5;
2621
+ $[8] = t3;
2622
+ $[9] = t4;
2623
+ $[10] = t5;
2551
2624
  } else {
2552
- t5 = $[9];
2625
+ t5 = $[10];
2553
2626
  }
2554
2627
  let t6;
2555
- if ($[10] !== t) {
2628
+ if ($[11] !== t) {
2556
2629
  t6 = t("work.workingFor");
2557
- $[10] = t;
2558
- $[11] = t6;
2630
+ $[11] = t;
2631
+ $[12] = t6;
2559
2632
  } else {
2560
- t6 = $[11];
2633
+ t6 = $[12];
2561
2634
  }
2562
2635
  let t7;
2563
- if ($[12] !== t6) {
2636
+ if ($[13] !== t6) {
2564
2637
  t7 = /*#__PURE__*/_jsx("span", {
2565
2638
  className: "chat-live-text",
2566
2639
  children: t6
2567
2640
  });
2568
- $[12] = t6;
2569
- $[13] = t7;
2641
+ $[13] = t6;
2642
+ $[14] = t7;
2570
2643
  } else {
2571
- t7 = $[13];
2644
+ t7 = $[14];
2572
2645
  }
2573
2646
  let t8;
2574
- if ($[14] !== ref) {
2647
+ if ($[15] !== ref) {
2575
2648
  t8 = /*#__PURE__*/_jsx("span", {
2576
2649
  ref: ref,
2577
2650
  className: "tabular-nums"
2578
2651
  });
2579
- $[14] = ref;
2580
- $[15] = t8;
2652
+ $[15] = ref;
2653
+ $[16] = t8;
2581
2654
  } else {
2582
- t8 = $[15];
2655
+ t8 = $[16];
2583
2656
  }
2584
2657
  let t9;
2585
- if ($[16] !== t5 || $[17] !== t7 || $[18] !== t8) {
2658
+ if ($[17] !== t5 || $[18] !== t7 || $[19] !== t8) {
2586
2659
  t9 = /*#__PURE__*/_jsxs("div", {
2587
2660
  className: "-mx-1 mb-0.5 flex h-7 items-center gap-2 px-1 text-xs text-text-muted",
2588
2661
  children: [t5, t7, t8]
2589
2662
  });
2590
- $[16] = t5;
2591
- $[17] = t7;
2592
- $[18] = t8;
2593
- $[19] = t9;
2663
+ $[17] = t5;
2664
+ $[18] = t7;
2665
+ $[19] = t8;
2666
+ $[20] = t9;
2594
2667
  } else {
2595
- t9 = $[19];
2668
+ t9 = $[20];
2596
2669
  }
2597
2670
  return t9;
2598
2671
  }