@adecore/agents-react 0.74.1 → 0.75.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.
Files changed (53) hide show
  1. package/dist/chat/logic/timeline.js +3 -0
  2. package/dist/chat/mentions.d.ts +11 -2
  3. package/dist/chat/mentions.js +57 -18
  4. package/dist/chat/stop-task.d.ts +1 -0
  5. package/dist/chat/stop-task.js +34 -0
  6. package/dist/chat/tag-suggestions.d.ts +3 -1
  7. package/dist/chat/tag-suggestions.js +54 -10
  8. package/dist/chat/ui/ChatActivity.js +20 -42
  9. package/dist/chat/ui/Composer.js +397 -381
  10. package/dist/chat/ui/NamedChip.js +49 -44
  11. package/dist/chat/ui/ReferenceChip.d.ts +2 -1
  12. package/dist/chat/ui/ReferenceChip.js +64 -48
  13. package/dist/chat/ui/chip-clipboard.js +17 -6
  14. package/dist/chat/ui/composer/ComposerMenu.js +28 -24
  15. package/dist/chat/ui/composer/QueuedMessages.d.ts +5 -1
  16. package/dist/chat/ui/composer/QueuedMessages.js +60 -30
  17. package/dist/chat/ui/composer/chips.js +19 -8
  18. package/dist/chat/ui/composer/use-prompt-menus.js +138 -137
  19. package/dist/chat/ui/named-chip-look.d.ts +2 -1
  20. package/dist/chat/ui/named-chip-look.js +18 -8
  21. package/dist/chat/ui/rehype-chips.js +6 -3
  22. package/dist/chat/ui/rows/MessageRows.d.ts +6 -2
  23. package/dist/chat/ui/rows/MessageRows.js +122 -45
  24. package/dist/chat/ui/rows/Rows.js +65 -61
  25. package/dist/chat/waiting-on.d.ts +6 -0
  26. package/dist/chat/waiting-on.js +13 -2
  27. package/dist/host/timeline-row.d.ts +1 -0
  28. package/dist/locales/en/agent-chat.d.ts +4 -0
  29. package/dist/locales/en/agent-chat.js +5 -1
  30. package/dist/locales/nl/agent-chat.d.ts +4 -0
  31. package/dist/locales/nl/agent-chat.js +5 -1
  32. package/package.json +9 -9
  33. package/src/chat/logic/timeline.ts +2 -1
  34. package/src/chat/mentions.ts +69 -18
  35. package/src/chat/stop-task.ts +17 -0
  36. package/src/chat/tag-suggestions.ts +73 -11
  37. package/src/chat/ui/ChatActivity.tsx +2 -10
  38. package/src/chat/ui/Composer.tsx +3 -0
  39. package/src/chat/ui/NamedChip.tsx +10 -10
  40. package/src/chat/ui/ReferenceChip.tsx +4 -1
  41. package/src/chat/ui/chip-clipboard.ts +9 -5
  42. package/src/chat/ui/composer/ComposerMenu.tsx +6 -3
  43. package/src/chat/ui/composer/QueuedMessages.tsx +21 -1
  44. package/src/chat/ui/composer/chips.ts +18 -7
  45. package/src/chat/ui/composer/use-prompt-menus.ts +2 -2
  46. package/src/chat/ui/named-chip-look.ts +19 -8
  47. package/src/chat/ui/rehype-chips.ts +7 -3
  48. package/src/chat/ui/rows/MessageRows.tsx +34 -3
  49. package/src/chat/ui/rows/Rows.tsx +1 -1
  50. package/src/chat/waiting-on.ts +13 -2
  51. package/src/host/timeline-row.ts +1 -1
  52. package/src/locales/en/agent-chat.ts +5 -1
  53. package/src/locales/nl/agent-chat.ts +5 -1
@@ -1,12 +1,13 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { CliMark } from '../../agents/AgentModelLabel.js';
3
- import { namedChipPrefix } from '../mentions.js';
3
+ import { namedChipParts, namedChipPrefix } from '../mentions.js';
4
4
  import { REFERENCE_TONE, TOKEN_ICON_BOX } from './chips.js';
5
5
  import { useNamedChipLookup } from './named-chip-look.js';
6
6
  import { TokenChip } from './ReferenceChip.js';
7
7
  /*
8
8
  * A model or an account a message names, under its CLI's mark in the color of the account it runs on, and
9
- * the name the machine knows it by. An id the machine does not know keeps the id. A copy reads the token.
9
+ * the name the machine knows it by, after its account's when it names one. An id the machine does not know
10
+ * keeps the id. A copy reads the token.
10
11
  */
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  export function NamedChip(t0) {
@@ -18,93 +19,97 @@ export function NamedChip(t0) {
18
19
  const lookup = useNamedChipLookup();
19
20
  let T0;
20
21
  let cli;
21
- let color;
22
22
  let id;
23
- let label;
23
+ let look;
24
24
  let t1;
25
25
  let t2;
26
26
  let t3;
27
27
  if ($[0] !== kind || $[1] !== lookup || $[2] !== value) {
28
- const slash = value.indexOf("/");
29
- cli = value.slice(0, slash);
30
- id = value.slice(slash + 1);
31
- ({
32
- label,
33
- color
34
- } = lookup(kind, cli, id));
28
+ const {
29
+ cli: t4,
30
+ id: t5,
31
+ account
32
+ } = namedChipParts(value) ?? {
33
+ cli: "",
34
+ id: value,
35
+ account: undefined
36
+ };
37
+ cli = t4;
38
+ id = t5;
39
+ look = lookup(kind, cli, id, account);
35
40
  T0 = TokenChip;
36
41
  t1 = kind;
37
42
  t2 = value;
38
- t3 = namedChipPrefix(kind, cli);
43
+ t3 = namedChipPrefix(kind, cli, account);
39
44
  $[0] = kind;
40
45
  $[1] = lookup;
41
46
  $[2] = value;
42
47
  $[3] = T0;
43
48
  $[4] = cli;
44
- $[5] = color;
45
- $[6] = id;
46
- $[7] = label;
47
- $[8] = t1;
48
- $[9] = t2;
49
- $[10] = t3;
49
+ $[5] = id;
50
+ $[6] = look;
51
+ $[7] = t1;
52
+ $[8] = t2;
53
+ $[9] = t3;
50
54
  } else {
51
55
  T0 = $[3];
52
56
  cli = $[4];
53
- color = $[5];
54
- id = $[6];
55
- label = $[7];
56
- t1 = $[8];
57
- t2 = $[9];
58
- t3 = $[10];
57
+ id = $[5];
58
+ look = $[6];
59
+ t1 = $[7];
60
+ t2 = $[8];
61
+ t3 = $[9];
59
62
  }
60
63
  let t4;
61
- if ($[11] !== color) {
62
- t4 = color === undefined ? undefined : {
63
- color
64
+ if ($[10] !== look.color) {
65
+ t4 = look.color === undefined ? undefined : {
66
+ color: look.color
64
67
  };
65
- $[11] = color;
66
- $[12] = t4;
68
+ $[10] = look.color;
69
+ $[11] = t4;
67
70
  } else {
68
- t4 = $[12];
71
+ t4 = $[11];
69
72
  }
70
73
  let t5;
71
- if ($[13] !== cli) {
74
+ if ($[12] !== cli) {
72
75
  t5 = /*#__PURE__*/_jsx(CliMark, {
73
76
  kind: cli,
74
77
  size: 14
75
78
  });
76
- $[13] = cli;
77
- $[14] = t5;
79
+ $[12] = cli;
80
+ $[13] = t5;
78
81
  } else {
79
- t5 = $[14];
82
+ t5 = $[13];
80
83
  }
81
84
  let t6;
82
- if ($[15] !== t4 || $[16] !== t5) {
85
+ if ($[14] !== t4 || $[15] !== t5) {
83
86
  t6 = /*#__PURE__*/_jsx("span", {
84
87
  className: TOKEN_ICON_BOX,
85
88
  style: t4,
86
89
  children: t5
87
90
  });
88
- $[15] = t4;
89
- $[16] = t5;
90
- $[17] = t6;
91
+ $[14] = t4;
92
+ $[15] = t5;
93
+ $[16] = t6;
91
94
  } else {
92
- t6 = $[17];
95
+ t6 = $[16];
93
96
  }
94
- const t7 = label === id ? undefined : id;
97
+ const t7 = look.label === id ? undefined : id;
95
98
  let t8;
96
- if ($[18] !== T0 || $[19] !== label || $[20] !== t1 || $[21] !== t2 || $[22] !== t3 || $[23] !== t6 || $[24] !== t7) {
99
+ if ($[17] !== T0 || $[18] !== look.account || $[19] !== look.label || $[20] !== t1 || $[21] !== t2 || $[22] !== t3 || $[23] !== t6 || $[24] !== t7) {
97
100
  t8 = /*#__PURE__*/_jsx(T0, {
98
101
  kind: t1,
99
102
  value: t2,
100
103
  sigil: t3,
101
104
  icon: t6,
102
- label: label,
105
+ label: look.label,
106
+ prefix: look.account,
103
107
  spelled: t7,
104
108
  tone: REFERENCE_TONE
105
109
  });
106
- $[18] = T0;
107
- $[19] = label;
110
+ $[17] = T0;
111
+ $[18] = look.account;
112
+ $[19] = look.label;
108
113
  $[20] = t1;
109
114
  $[21] = t2;
110
115
  $[22] = t3;
@@ -5,11 +5,12 @@ interface TokenChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children
5
5
  sigil?: string;
6
6
  icon: ReactNode;
7
7
  label: string;
8
+ prefix?: string;
8
9
  spelled?: string;
9
10
  tone: string;
10
11
  onOpen?: () => void;
11
12
  }
12
- export declare function TokenChip({ kind, value, sigil, icon, label, spelled, tone, onOpen, className, ...rest }: TokenChipProps): import("react").JSX.Element;
13
+ export declare function TokenChip({ kind, value, sigil, icon, label, prefix, spelled, tone, onOpen, className, ...rest }: TokenChipProps): import("react").JSX.Element;
13
14
  export declare function ReferenceChip({ id, lastName, goneHint }: {
14
15
  id: string;
15
16
  lastName?: string;
@@ -16,12 +16,13 @@ import { ReferenceTrail } from './ReferenceTrail.js';
16
16
  */
17
17
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
18
18
  export function TokenChip(t0) {
19
- const $ = _c(34);
19
+ const $ = _c(38);
20
20
  let className;
21
21
  let icon;
22
22
  let kind;
23
23
  let label;
24
24
  let onOpen;
25
+ let prefix;
25
26
  let rest;
26
27
  let sigil;
27
28
  let spelled;
@@ -35,6 +36,7 @@ export function TokenChip(t0) {
35
36
  sigil,
36
37
  icon,
37
38
  label,
39
+ prefix,
38
40
  spelled,
39
41
  tone,
40
42
  onOpen,
@@ -53,55 +55,68 @@ export function TokenChip(t0) {
53
55
  $[3] = kind;
54
56
  $[4] = label;
55
57
  $[5] = onOpen;
56
- $[6] = rest;
57
- $[7] = sigil;
58
- $[8] = spelled;
59
- $[9] = t1;
60
- $[10] = tone;
61
- $[11] = value;
58
+ $[6] = prefix;
59
+ $[7] = rest;
60
+ $[8] = sigil;
61
+ $[9] = spelled;
62
+ $[10] = t1;
63
+ $[11] = tone;
64
+ $[12] = value;
62
65
  } else {
63
66
  className = $[1];
64
67
  icon = $[2];
65
68
  kind = $[3];
66
69
  label = $[4];
67
70
  onOpen = $[5];
68
- rest = $[6];
69
- sigil = $[7];
70
- spelled = $[8];
71
- t1 = $[9];
72
- tone = $[10];
73
- value = $[11];
71
+ prefix = $[6];
72
+ rest = $[7];
73
+ sigil = $[8];
74
+ spelled = $[9];
75
+ t1 = $[10];
76
+ tone = $[11];
77
+ value = $[12];
74
78
  }
75
79
  const onKeyDown = t1;
76
80
  const t2 = onOpen !== undefined && "cursor-pointer focus-visible:outline-2 focus-visible:outline-accent-on-surface";
77
81
  let t3;
78
- if ($[12] !== className || $[13] !== t2 || $[14] !== tone) {
82
+ if ($[13] !== className || $[14] !== t2 || $[15] !== tone) {
79
83
  t3 = clsx("not-prose", TOKEN_IN_MESSAGE, tone, t2, className);
80
- $[12] = className;
81
- $[13] = t2;
82
- $[14] = tone;
83
- $[15] = t3;
84
+ $[13] = className;
85
+ $[14] = t2;
86
+ $[15] = tone;
87
+ $[16] = t3;
84
88
  } else {
85
- t3 = $[15];
89
+ t3 = $[16];
86
90
  }
87
91
  const t4 = kind === "reference" ? label : undefined;
88
92
  const t5 = onOpen === undefined ? undefined : "button";
89
93
  const t6 = onOpen === undefined ? undefined : 0;
90
94
  const t7 = onOpen === undefined ? undefined : onKeyDown;
91
95
  let t8;
92
- if ($[16] !== sigil) {
96
+ if ($[17] !== sigil) {
93
97
  t8 = sigil !== undefined && /*#__PURE__*/_jsx("span", {
94
98
  className: "sr-only",
95
99
  children: sigil
96
100
  });
97
- $[16] = sigil;
98
- $[17] = t8;
101
+ $[17] = sigil;
102
+ $[18] = t8;
99
103
  } else {
100
- t8 = $[17];
104
+ t8 = $[18];
101
105
  }
102
106
  let t9;
103
- if ($[18] !== label || $[19] !== spelled) {
104
- t9 = spelled === undefined ? label : /*#__PURE__*/_jsxs(_Fragment, {
107
+ if ($[19] !== prefix) {
108
+ t9 = prefix !== undefined && /*#__PURE__*/_jsx("span", {
109
+ className: "text-text-muted select-none",
110
+ children: `${prefix} / `
111
+ });
112
+ $[19] = prefix;
113
+ $[20] = t9;
114
+ } else {
115
+ t9 = $[20];
116
+ }
117
+ let t10;
118
+ if ($[21] !== label || $[22] !== spelled) {
119
+ t10 = spelled === undefined ? label : /*#__PURE__*/_jsxs(_Fragment, {
105
120
  children: [/*#__PURE__*/_jsx("span", {
106
121
  "aria-hidden": true,
107
122
  className: "sr-only",
@@ -111,15 +126,15 @@ export function TokenChip(t0) {
111
126
  children: label
112
127
  })]
113
128
  });
114
- $[18] = label;
115
- $[19] = spelled;
116
- $[20] = t9;
129
+ $[21] = label;
130
+ $[22] = spelled;
131
+ $[23] = t10;
117
132
  } else {
118
- t9 = $[20];
133
+ t10 = $[23];
119
134
  }
120
- let t10;
121
- if ($[21] !== icon || $[22] !== kind || $[23] !== onOpen || $[24] !== rest || $[25] !== t3 || $[26] !== t4 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9 || $[32] !== value) {
122
- t10 = /*#__PURE__*/_jsxs("span", {
135
+ let t11;
136
+ if ($[24] !== icon || $[25] !== kind || $[26] !== onOpen || $[27] !== rest || $[28] !== t10 || $[29] !== t3 || $[30] !== t4 || $[31] !== t5 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9 || $[36] !== value) {
137
+ t11 = /*#__PURE__*/_jsxs("span", {
123
138
  ...rest,
124
139
  className: t3,
125
140
  "data-chip": kind,
@@ -129,25 +144,26 @@ export function TokenChip(t0) {
129
144
  tabIndex: t6,
130
145
  onClick: onOpen,
131
146
  onKeyDown: t7,
132
- children: [icon, t8, t9]
147
+ children: [icon, t8, t9, t10]
133
148
  });
134
- $[21] = icon;
135
- $[22] = kind;
136
- $[23] = onOpen;
137
- $[24] = rest;
138
- $[25] = t3;
139
- $[26] = t4;
140
- $[27] = t5;
141
- $[28] = t6;
142
- $[29] = t7;
143
- $[30] = t8;
144
- $[31] = t9;
145
- $[32] = value;
146
- $[33] = t10;
149
+ $[24] = icon;
150
+ $[25] = kind;
151
+ $[26] = onOpen;
152
+ $[27] = rest;
153
+ $[28] = t10;
154
+ $[29] = t3;
155
+ $[30] = t4;
156
+ $[31] = t5;
157
+ $[32] = t6;
158
+ $[33] = t7;
159
+ $[34] = t8;
160
+ $[35] = t9;
161
+ $[36] = value;
162
+ $[37] = t11;
147
163
  } else {
148
- t10 = $[33];
164
+ t11 = $[37];
149
165
  }
150
- return t10;
166
+ return t11;
151
167
  }
152
168
  /*
153
169
  * A view, node or chat a message points at, under the name it has now. One that went says so, under
@@ -1,6 +1,6 @@
1
1
  import { copyText } from '@adecore/ui';
2
2
  import { referenceTokens } from '../chat-references.js';
3
- import { clipboardChipsOf, hasClipboardChips, tokenizeChips, tokenizeNamedReferences, writeClipboardChips } from '../mentions.js';
3
+ import { clipboardChipsOf, hasClipboardChips, namedChipParts, tokenizeChips, tokenizeNamedReferences, writeClipboardChips } from '../mentions.js';
4
4
  /* The chips a copy of a whole message carries: what the person picked, or what a reply names. */
5
5
  export function messageClipboardChips(item, text, lookup) {
6
6
  if (item.kind === 'assistant') {
@@ -43,13 +43,24 @@ function segmentOf(chip) {
43
43
  };
44
44
  }
45
45
  case 'model':
46
+ {
47
+ const parts = namedChipParts(value);
48
+ return parts === null ? null : {
49
+ kind: 'model',
50
+ cli: parts.cli,
51
+ id: parts.id,
52
+ ...(parts.account === undefined ? {} : {
53
+ account: parts.account
54
+ })
55
+ };
56
+ }
46
57
  case 'account':
47
58
  {
48
- const slash = value.indexOf('/');
49
- return slash < 1 ? null : {
50
- kind: chip.getAttribute('data-chip'),
51
- cli: value.slice(0, slash),
52
- id: value.slice(slash + 1)
59
+ const parts = namedChipParts(value);
60
+ return parts === null ? null : {
61
+ kind: 'account',
62
+ cli: parts.cli,
63
+ id: parts.id
53
64
  };
54
65
  }
55
66
  default:
@@ -220,58 +220,59 @@ function SkillMenu(t0) {
220
220
  }
221
221
  /* The CLI's mark of a model or account row, in the color of the account it runs on, as its chip wears it. */
222
222
  function NamedMark(t0) {
223
- const $ = _c(12);
223
+ const $ = _c(13);
224
224
  const {
225
225
  menus,
226
226
  pick
227
227
  } = t0;
228
228
  let t1;
229
- if ($[0] !== menus || $[1] !== pick.cli || $[2] !== pick.id || $[3] !== pick.kind) {
230
- t1 = menus.namedLook(pick.kind, pick.cli, pick.id);
229
+ if ($[0] !== menus || $[1] !== pick.account || $[2] !== pick.cli || $[3] !== pick.id || $[4] !== pick.kind) {
230
+ t1 = menus.namedLook(pick.kind, pick.cli, pick.id, pick.account);
231
231
  $[0] = menus;
232
- $[1] = pick.cli;
233
- $[2] = pick.id;
234
- $[3] = pick.kind;
235
- $[4] = t1;
232
+ $[1] = pick.account;
233
+ $[2] = pick.cli;
234
+ $[3] = pick.id;
235
+ $[4] = pick.kind;
236
+ $[5] = t1;
236
237
  } else {
237
- t1 = $[4];
238
+ t1 = $[5];
238
239
  }
239
240
  const {
240
241
  color
241
242
  } = t1;
242
243
  let t2;
243
- if ($[5] !== color) {
244
+ if ($[6] !== color) {
244
245
  t2 = color === undefined ? undefined : {
245
246
  color
246
247
  };
247
- $[5] = color;
248
- $[6] = t2;
248
+ $[6] = color;
249
+ $[7] = t2;
249
250
  } else {
250
- t2 = $[6];
251
+ t2 = $[7];
251
252
  }
252
253
  let t3;
253
- if ($[7] !== pick.cli) {
254
+ if ($[8] !== pick.cli) {
254
255
  t3 = /*#__PURE__*/_jsx(CliMark, {
255
256
  kind: pick.cli,
256
257
  size: 14
257
258
  });
258
- $[7] = pick.cli;
259
- $[8] = t3;
259
+ $[8] = pick.cli;
260
+ $[9] = t3;
260
261
  } else {
261
- t3 = $[8];
262
+ t3 = $[9];
262
263
  }
263
264
  let t4;
264
- if ($[9] !== t2 || $[10] !== t3) {
265
+ if ($[10] !== t2 || $[11] !== t3) {
265
266
  t4 = /*#__PURE__*/_jsx("span", {
266
267
  className: "flex shrink-0",
267
268
  style: t2,
268
269
  children: t3
269
270
  });
270
- $[9] = t2;
271
- $[10] = t3;
272
- $[11] = t4;
271
+ $[10] = t2;
272
+ $[11] = t3;
273
+ $[12] = t4;
273
274
  } else {
274
- t4 = $[11];
275
+ t4 = $[12];
275
276
  }
276
277
  return t4;
277
278
  }
@@ -328,13 +329,16 @@ function MentionMenu(t0) {
328
329
  children: [/*#__PURE__*/_jsx(NamedMark, {
329
330
  menus: menus,
330
331
  pick: match
331
- }), /*#__PURE__*/_jsx("span", {
332
+ }), /*#__PURE__*/_jsxs("span", {
332
333
  className: "truncate text-text",
333
- children: match.model.name
334
+ children: [match.accountName !== undefined && /*#__PURE__*/_jsx("span", {
335
+ className: "text-text-muted",
336
+ children: `${match.accountName} / `
337
+ }), match.model.name]
334
338
  }), /*#__PURE__*/_jsx(ModelMarks, {
335
339
  model: match.model
336
340
  })]
337
- }, `${match.cli}/${match.id}`))]
341
+ }, `${match.cli}:${match.account ?? ""}/${match.id}`))]
338
342
  }), accountMatches.length > 0 && /*#__PURE__*/_jsxs("div", {
339
343
  role: "group",
340
344
  "aria-labelledby": accountsLabelId,
@@ -1,10 +1,14 @@
1
1
  import type { ChatQueuedMessage } from '@adecore/agent-contracts';
2
+ import { type ChatThreadBackgroundTask } from '../../activity.js';
2
3
  interface QueuedMessagesProps {
3
4
  chatId: string;
4
5
  queue: readonly ChatQueuedMessage[];
5
6
  paused: boolean;
7
+ held?: {
8
+ task: ChatThreadBackgroundTask | null;
9
+ };
6
10
  takingBack: boolean;
7
11
  onEdit(message: ChatQueuedMessage): void;
8
12
  }
9
- export declare function QueuedMessages({ chatId, queue, paused, takingBack, onEdit }: QueuedMessagesProps): import("react").JSX.Element;
13
+ export declare function QueuedMessages({ chatId, queue, paused, held, takingBack, onEdit }: QueuedMessagesProps): import("react").JSX.Element;
10
14
  export {};
@@ -3,15 +3,18 @@ import { ButtonGroup, ContextMenu, copyText, Icon, IconButton } from '@adecore/u
3
3
  import { Clock, Copy, FastForward, Pencil, X } from 'lucide-react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useChatActions } from '../../actions.js';
6
+ import { backgroundTaskName } from '../../activity.js';
7
+ import { useStopTask } from '../../stop-task.js';
6
8
  import { scrollTimelineToEnd } from '../../timeline-scroll.js';
7
9
  /* The messages waiting for the running turn to end, each with a way to send it now, edit it or drop it. */
8
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
11
  export function QueuedMessages(t0) {
10
- const $ = _c(19);
12
+ const $ = _c(26);
11
13
  const {
12
14
  chatId,
13
15
  queue,
14
16
  paused,
17
+ held,
15
18
  takingBack,
16
19
  onEdit
17
20
  } = t0;
@@ -19,6 +22,8 @@ export function QueuedMessages(t0) {
19
22
  t
20
23
  } = useTranslation("agent-chat");
21
24
  const actions = useChatActions();
25
+ const stop = useStopTask(chatId);
26
+ const task = held?.task ?? null;
22
27
  let t1;
23
28
  if ($[0] !== paused || $[1] !== t) {
24
29
  t1 = paused && /*#__PURE__*/_jsx("p", {
@@ -32,10 +37,34 @@ export function QueuedMessages(t0) {
32
37
  t1 = $[2];
33
38
  }
34
39
  let t2;
35
- if ($[3] !== actions || $[4] !== chatId || $[5] !== onEdit || $[6] !== queue || $[7] !== t || $[8] !== takingBack) {
36
- let t3;
37
- if ($[10] !== actions || $[11] !== chatId || $[12] !== onEdit || $[13] !== t || $[14] !== takingBack) {
38
- t3 = message => {
40
+ if ($[3] !== held || $[4] !== paused || $[5] !== stop || $[6] !== t || $[7] !== task) {
41
+ t2 = held !== undefined && !paused && /*#__PURE__*/_jsxs("p", {
42
+ className: "flex items-center gap-2 px-1.5 text-xs text-text-muted",
43
+ children: [/*#__PURE__*/_jsx("span", {
44
+ className: "min-w-0 truncate",
45
+ children: task === null ? t("composer.queue.heldByWork") : t("composer.queue.heldBy", {
46
+ command: backgroundTaskName(task)
47
+ })
48
+ }), task !== null && /*#__PURE__*/_jsx("button", {
49
+ className: "shrink-0 text-text-muted hover:text-text",
50
+ onClick: () => stop(task.id),
51
+ children: t("activity.stop")
52
+ })]
53
+ });
54
+ $[3] = held;
55
+ $[4] = paused;
56
+ $[5] = stop;
57
+ $[6] = t;
58
+ $[7] = task;
59
+ $[8] = t2;
60
+ } else {
61
+ t2 = $[8];
62
+ }
63
+ let t3;
64
+ if ($[9] !== actions || $[10] !== chatId || $[11] !== onEdit || $[12] !== queue || $[13] !== t || $[14] !== takingBack) {
65
+ let t4;
66
+ if ($[16] !== actions || $[17] !== chatId || $[18] !== onEdit || $[19] !== t || $[20] !== takingBack) {
67
+ t4 = message => {
39
68
  const sendNow = () => {
40
69
  scrollTimelineToEnd(chatId, "instant");
41
70
  actions.sendNow(chatId, message.id).catch(_temp);
@@ -107,39 +136,40 @@ export function QueuedMessages(t0) {
107
136
  })]
108
137
  }, message.id);
109
138
  };
110
- $[10] = actions;
111
- $[11] = chatId;
112
- $[12] = onEdit;
113
- $[13] = t;
114
- $[14] = takingBack;
115
- $[15] = t3;
139
+ $[16] = actions;
140
+ $[17] = chatId;
141
+ $[18] = onEdit;
142
+ $[19] = t;
143
+ $[20] = takingBack;
144
+ $[21] = t4;
116
145
  } else {
117
- t3 = $[15];
146
+ t4 = $[21];
118
147
  }
119
- t2 = queue.map(t3);
120
- $[3] = actions;
121
- $[4] = chatId;
122
- $[5] = onEdit;
123
- $[6] = queue;
124
- $[7] = t;
125
- $[8] = takingBack;
126
- $[9] = t2;
148
+ t3 = queue.map(t4);
149
+ $[9] = actions;
150
+ $[10] = chatId;
151
+ $[11] = onEdit;
152
+ $[12] = queue;
153
+ $[13] = t;
154
+ $[14] = takingBack;
155
+ $[15] = t3;
127
156
  } else {
128
- t2 = $[9];
157
+ t3 = $[15];
129
158
  }
130
- let t3;
131
- if ($[16] !== t1 || $[17] !== t2) {
132
- t3 = /*#__PURE__*/_jsxs("div", {
159
+ let t4;
160
+ if ($[22] !== t1 || $[23] !== t2 || $[24] !== t3) {
161
+ t4 = /*#__PURE__*/_jsxs("div", {
133
162
  className: "flex flex-col gap-1 border-b border-border px-2 py-1.5",
134
- children: [t1, t2]
163
+ children: [t1, t2, t3]
135
164
  });
136
- $[16] = t1;
137
- $[17] = t2;
138
- $[18] = t3;
165
+ $[22] = t1;
166
+ $[23] = t2;
167
+ $[24] = t3;
168
+ $[25] = t4;
139
169
  } else {
140
- t3 = $[18];
170
+ t4 = $[25];
141
171
  }
142
- return t3;
172
+ return t4;
143
173
  }
144
174
  function _temp2() {}
145
175
  function _temp() {}