@adecore/agents-react 0.46.3 → 0.47.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 (56) hide show
  1. package/dist/chat/index.d.ts +1 -0
  2. package/dist/chat/index.js +1 -0
  3. package/dist/chat/logic/scrubber.js +12 -0
  4. package/dist/chat/logic/timeline-copy.js +2 -0
  5. package/dist/chat/logic/timeline.d.ts +6 -1
  6. package/dist/chat/logic/timeline.js +36 -10
  7. package/dist/chat/ui/ChatActivity.d.ts +2 -1
  8. package/dist/chat/ui/ChatActivity.js +295 -61
  9. package/dist/chat/ui/Composer.d.ts +2 -1
  10. package/dist/chat/ui/Composer.js +492 -486
  11. package/dist/chat/ui/PromptEditor.js +4 -1
  12. package/dist/chat/ui/ReferenceChip.d.ts +2 -1
  13. package/dist/chat/ui/ReferenceChip.js +135 -100
  14. package/dist/chat/ui/composer/ComposerMenu.js +17 -11
  15. package/dist/chat/ui/composer/chips.d.ts +3 -0
  16. package/dist/chat/ui/composer/chips.js +14 -10
  17. package/dist/chat/ui/reference-icons.d.ts +3 -0
  18. package/dist/chat/ui/reference-icons.js +15 -2
  19. package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
  20. package/dist/chat/ui/rows/MessageRows.js +166 -10
  21. package/dist/chat/ui/rows/RowContainer.js +21 -22
  22. package/dist/chat/ui/rows/Rows.js +37 -19
  23. package/dist/chat/ui/rows/WorkflowRow.d.ts +2 -1
  24. package/dist/chat/ui/rows/WorkflowRow.js +197 -191
  25. package/dist/chat/ui/rows/row-rhythm.d.ts +1 -0
  26. package/dist/chat/ui/rows/row-rhythm.js +12 -3
  27. package/dist/chat/workflow-list.d.ts +12 -0
  28. package/dist/chat/workflow-list.js +54 -0
  29. package/dist/host.d.ts +8 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/locales/en/agent-chat.d.ts +9 -0
  32. package/dist/locales/en/agent-chat.js +9 -0
  33. package/dist/locales/nl/agent-chat.d.ts +9 -0
  34. package/dist/locales/nl/agent-chat.js +9 -0
  35. package/package.json +8 -8
  36. package/src/chat/index.ts +1 -0
  37. package/src/chat/logic/scrubber.ts +5 -0
  38. package/src/chat/logic/timeline-copy.ts +2 -0
  39. package/src/chat/logic/timeline.ts +33 -2
  40. package/src/chat/ui/ChatActivity.tsx +52 -6
  41. package/src/chat/ui/Composer.tsx +19 -3
  42. package/src/chat/ui/PromptEditor.tsx +3 -1
  43. package/src/chat/ui/ReferenceChip.tsx +15 -5
  44. package/src/chat/ui/composer/ComposerMenu.tsx +4 -2
  45. package/src/chat/ui/composer/chips.ts +15 -9
  46. package/src/chat/ui/reference-icons.ts +13 -1
  47. package/src/chat/ui/rows/MessageRows.tsx +35 -0
  48. package/src/chat/ui/rows/RowContainer.tsx +2 -2
  49. package/src/chat/ui/rows/Rows.tsx +3 -0
  50. package/src/chat/ui/rows/WorkflowRow.tsx +9 -4
  51. package/src/chat/ui/rows/row-rhythm.ts +12 -3
  52. package/src/chat/workflow-list.ts +65 -0
  53. package/src/host.ts +15 -1
  54. package/src/index.ts +1 -0
  55. package/src/locales/en/agent-chat.ts +9 -0
  56. package/src/locales/nl/agent-chat.ts +9 -0
@@ -2,6 +2,7 @@ export { type AccountChoice, useAccountChoice, type NewAccountChoice, useNewAcco
2
2
  export { transportActions, actionsOf, useChatActions } from './actions.js';
3
3
  export { type ChatSendExtras, ChatClient } from './chat-client.js';
4
4
  export type { ProjectChat, Referable, ReferableKind, Referables } from './chat-references.js';
5
+ export { REFERENCE_ICONS } from './ui/reference-icons.js';
5
6
  export { sendFromComposer, type ComposerSend } from './composer-send.js';
6
7
  export { stepEffortFromComposer } from './composer-effort.js';
7
8
  export type { EffortStep } from './logic/effort.js';
@@ -2,6 +2,7 @@
2
2
  export { useAccountChoice, useNewAccountChoice } from './account-choice.js';
3
3
  export { transportActions, actionsOf, useChatActions } from './actions.js';
4
4
  export { ChatClient } from './chat-client.js';
5
+ export { REFERENCE_ICONS } from './ui/reference-icons.js';
5
6
  export { sendFromComposer } from './composer-send.js';
6
7
  export { stepEffortFromComposer } from './composer-effort.js';
7
8
  export { EMPTY_DRAFT, useDrafts, readDraft, writeDraft, offerDraft } from './drafts.js';
@@ -80,6 +80,18 @@ export function ticksOf(rows, marks = new Map(), earlier = [], bookmarks = []) {
80
80
  bookmark
81
81
  }];
82
82
  }
83
+ // A message another node sent stands in for the turn it opened, whose own line it hides.
84
+ if (row.kind === 'message') {
85
+ return [{
86
+ id: row.id,
87
+ rowIndex,
88
+ kind: 'wake',
89
+ text: row.message.text,
90
+ createdAt: row.createdAt,
91
+ turnId: null,
92
+ bookmark
93
+ }];
94
+ }
83
95
  // The other turns nobody asked for (a sub-agent that finished, the CLI going on) are no place to return to.
84
96
  if (row.kind === 'turn-start' && ((row.turn.taskIds?.length ?? 0) > 0 || (row.turn.messageFrom?.length ?? 0) > 0)) {
85
97
  return [{
@@ -35,6 +35,8 @@ export function messageTextOf(row) {
35
35
  return row.item.result ?? row.item.summary ?? null;
36
36
  case 'note':
37
37
  return row.text;
38
+ case 'message':
39
+ return row.message.text || null;
38
40
  default:
39
41
  return null;
40
42
  }
@@ -1,4 +1,4 @@
1
- import type { ChatApprovalItem, ChatAssistantItem, ChatCheckpointDiff, ChatItem, ChatQuestionItem, ChatSubagentItem, ChatThinkingItem, ChatToolItem, ChatTurnItem, ChatUserItem, ChatVisual, ChatWorkflow } from '@adecore/agent-contracts';
1
+ import type { ChatApprovalItem, ChatAssistantItem, ChatCheckpointDiff, ChatItem, ChatNoteMessage, ChatQuestionItem, ChatSubagentItem, ChatThinkingItem, ChatToolItem, ChatTurnItem, ChatUserItem, ChatVisual, ChatWorkflow } from '@adecore/agent-contracts';
2
2
  import type { CommandLook, ThreadCard } from '../../host.js';
3
3
  export interface SubagentBranch {
4
4
  id: string;
@@ -69,6 +69,11 @@ export type TimelineRow = {
69
69
  level: 'info' | 'warning' | 'error';
70
70
  text: string;
71
71
  from?: string;
72
+ } | {
73
+ kind: 'message';
74
+ id: string;
75
+ message: ChatNoteMessage;
76
+ createdAt: number;
72
77
  } | {
73
78
  kind: 'compaction';
74
79
  id: string;
@@ -396,15 +396,24 @@ function rowsForItems(items, options, children) {
396
396
  }
397
397
  break;
398
398
  case 'note':
399
- rows.push({
400
- kind: 'note',
401
- id: item.id,
402
- level: item.level,
403
- text: item.text,
404
- ...(item.from === undefined ? {} : {
405
- from: item.from
406
- })
407
- });
399
+ if (item.message !== undefined) {
400
+ rows.push({
401
+ kind: 'message',
402
+ id: item.id,
403
+ message: item.message,
404
+ createdAt: item.createdAt
405
+ });
406
+ } else {
407
+ rows.push({
408
+ kind: 'note',
409
+ id: item.id,
410
+ level: item.level,
411
+ text: item.text,
412
+ ...(item.from === undefined ? {} : {
413
+ from: item.from
414
+ })
415
+ });
416
+ }
408
417
  break;
409
418
  case 'compaction':
410
419
  rows.push({
@@ -528,6 +537,22 @@ function chunksByTurn(items) {
528
537
  }
529
538
  return chunks;
530
539
  }
540
+ /* Whether every node whose message opened the turn has that message among the rows right above it. */
541
+ function opensUnderItsMessages(turn, rows) {
542
+ const from = turn.messageFrom ?? [];
543
+ if (from.length === 0) {
544
+ return false;
545
+ }
546
+ const senders = new Set();
547
+ for (let i = rows.length - 1; i >= 0; i--) {
548
+ const row = rows[i];
549
+ if (row.kind !== 'message') {
550
+ break;
551
+ }
552
+ senders.add(row.message.from);
553
+ }
554
+ return from.every(id => senders.has(id));
555
+ }
531
556
  /* The whole thread as rows; items without a turn (older records) are shown as they are. */
532
557
  export function deriveTimelineRows(items, options) {
533
558
  const rows = [];
@@ -540,7 +565,8 @@ export function deriveTimelineRows(items, options) {
540
565
  const turnId = chunk.turnId;
541
566
  const turn = chunk.items.find(item => item.kind === 'turn');
542
567
  const conversation = chunk.items.filter(item => item.kind !== 'turn');
543
- if (turn?.origin === 'agent') {
568
+ // A turn a message opened needs no line of its own when that message stands right above it.
569
+ if (turn?.origin === 'agent' && !opensUnderItsMessages(turn, rows)) {
544
570
  // The agent started this one itself, so there is no message of the person to show above it.
545
571
  rows.push({
546
572
  kind: 'turn-start',
@@ -1,6 +1,7 @@
1
1
  import { type StatusWord } from '../../agents/status-look.js';
2
- export declare function ChatActivity({ chatId }: {
2
+ export declare function ChatActivity({ chatId, workflows: showsWorkflows }: {
3
3
  chatId: string;
4
+ workflows?: boolean;
4
5
  }): import("react").JSX.Element | null;
5
6
  export declare function StatusIcon({ word }: {
6
7
  word: StatusWord;
@@ -1,14 +1,16 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import 'react';
2
+ import { useState } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { useShallow } from 'zustand/shallow';
5
5
  import { useTranslation } from 'react-i18next';
6
- import { Activity, MessageCircleQuestionMark, Square, SquareTerminal } from 'lucide-react';
6
+ import { Activity, MessageCircleQuestionMark, Square, SquareTerminal, TriangleAlert } from 'lucide-react';
7
7
  import { backgroundCounts } from '../activity.js';
8
8
  import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf, taskIdOf, taskRowStateOf } from '../subagent-list.js';
9
9
  import { useSubagentSupport } from '../subagent-support.js';
10
10
  import { canOpenSubagent, crumbOf, openFromMain, useSubagentTrail } from '../subagent-view.js';
11
+ import { flyoutWorkflows, workflowPillOf } from '../workflow-list.js';
11
12
  import { SubagentStopButton } from './SubagentStopButton.js';
13
+ import { WorkflowRow } from './rows/WorkflowRow.js';
12
14
  import { formatElapsedShort } from '@adecore/ui/format';
13
15
  import { Icon, IconButton, Popover, Surface, useNow } from '@adecore/ui';
14
16
  import { useChatRow, useChats } from '../../state/chats.js';
@@ -21,77 +23,95 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
21
23
  const NO_TASKS = [];
22
24
  const NO_ITEMS = [];
23
25
  const ROW_BODY = 'flex min-h-9 min-w-0 grow items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left';
24
- /* What the chat keeps working on beside the thread, in one small line over the composer: its sub-agents and what runs in the background. */
26
+ /*
27
+ * What the chat keeps working on beside the thread, in one small line over the composer: its sub-agents,
28
+ * its workflows and what runs in the background. Without `workflows` an app shows them somewhere else.
29
+ */
25
30
  export function ChatActivity(t0) {
26
- const $ = _c(20);
31
+ const $ = _c(29);
27
32
  const {
28
- chatId
33
+ chatId,
34
+ workflows: t1
29
35
  } = t0;
36
+ const showsWorkflows = t1 === undefined ? true : t1;
30
37
  const host = useChatHost();
31
38
  const {
32
39
  t
33
40
  } = useTranslation("agent-chat");
34
41
  const order = useChatRow(chatId, _temp) ?? NO_ITEMS;
35
42
  const before = useChatRow(chatId, _temp2) ?? NO_ITEMS;
36
- const structure = useChatRow(chatId, _temp3);
37
- let t1;
43
+ const workflowsBefore = useChatRow(chatId, _temp3) ?? NO_ITEMS;
44
+ const structure = useChatRow(chatId, _temp4);
45
+ let t2;
38
46
  if ($[0] !== before || $[1] !== order || $[2] !== structure) {
39
- t1 = structure === undefined ? [] : flyoutSubagents([...before, ...order], structure);
47
+ t2 = structure === undefined ? [] : flyoutSubagents([...before, ...order], structure);
40
48
  $[0] = before;
41
49
  $[1] = order;
42
50
  $[2] = structure;
43
- $[3] = t1;
51
+ $[3] = t2;
52
+ } else {
53
+ t2 = $[3];
54
+ }
55
+ const subagents = t2;
56
+ let t3;
57
+ if ($[4] !== order || $[5] !== showsWorkflows || $[6] !== structure || $[7] !== workflowsBefore) {
58
+ t3 = structure === undefined || !showsWorkflows ? [] : flyoutWorkflows([...workflowsBefore, ...order], structure);
59
+ $[4] = order;
60
+ $[5] = showsWorkflows;
61
+ $[6] = structure;
62
+ $[7] = workflowsBefore;
63
+ $[8] = t3;
44
64
  } else {
45
- t1 = $[3];
65
+ t3 = $[8];
46
66
  }
47
- const subagents = t1;
67
+ const workflows = t3;
48
68
  const {
49
69
  id,
50
70
  keyOf
51
71
  } = useChatScope();
52
72
  const tasks = useHostTasks(id);
53
- let t2;
54
- if ($[4] !== keyOf || $[5] !== subagents) {
55
- t2 = s => subagents.map(item => item.childId === undefined ? undefined : s.statusByKey[keyOf(item.childId)]?.info);
56
- $[4] = keyOf;
57
- $[5] = subagents;
58
- $[6] = t2;
73
+ let t4;
74
+ if ($[9] !== keyOf || $[10] !== subagents) {
75
+ t4 = s => subagents.map(item => item.childId === undefined ? undefined : s.statusByKey[keyOf(item.childId)]?.info);
76
+ $[9] = keyOf;
77
+ $[10] = subagents;
78
+ $[11] = t4;
59
79
  } else {
60
- t2 = $[6];
80
+ t4 = $[11];
61
81
  }
62
- const children = useChats(useShallow(t2));
82
+ const children = useChats(useShallow(t4));
63
83
  const progress = progressOf(subagents.map((item_0, index) => {
64
84
  const taskId = taskIdOf(item_0);
65
85
  return taskRowStateOf(item_0, taskId === null ? null : tasks?.[taskId] ?? null, children[index]);
66
86
  }));
67
- let t3;
68
- if ($[7] !== tasks) {
69
- t3 = item_1 => {
87
+ let t5;
88
+ if ($[12] !== tasks) {
89
+ t5 = item_1 => {
70
90
  const taskId_0 = taskIdOf(item_1);
71
91
  return statusWordOf(item_1, taskId_0 === null ? null : tasks?.[taskId_0] ?? null);
72
92
  };
73
- $[7] = tasks;
74
- $[8] = t3;
93
+ $[12] = tasks;
94
+ $[13] = t5;
75
95
  } else {
76
- t3 = $[8];
96
+ t5 = $[13];
77
97
  }
78
- const words = subagents.map(t3);
79
- const background = useChatRow(chatId, _temp4) ?? NO_TASKS;
80
- if (subagents.length === 0 && background.length === 0) {
98
+ const words = subagents.map(t5);
99
+ const background = useChatRow(chatId, _temp5) ?? NO_TASKS;
100
+ if (subagents.length === 0 && workflows.length === 0 && background.length === 0) {
81
101
  return null;
82
102
  }
83
- let t4;
84
- if ($[9] !== background) {
85
- t4 = backgroundCounts(background);
86
- $[9] = background;
87
- $[10] = t4;
103
+ let t6;
104
+ if ($[14] !== background) {
105
+ t6 = backgroundCounts(background);
106
+ $[14] = background;
107
+ $[15] = t6;
88
108
  } else {
89
- t4 = $[10];
109
+ t6 = $[15];
90
110
  }
91
111
  const {
92
112
  shells,
93
113
  monitors
94
- } = t4;
114
+ } = t6;
95
115
  const Slot = host.SubagentSlot;
96
116
  const counting = progress.active > 0 && progress.total > 1;
97
117
  const label = counting ? [t("activity.progress", {
@@ -102,8 +122,8 @@ export function ChatActivity(t0) {
102
122
  })].filter(Boolean).join(", ") : t("activity.subagents", {
103
123
  count: badgeCountOf(words)
104
124
  });
105
- const t5 = "mb-3 flex flex-wrap items-center gap-2";
106
- const t6 = subagents.length > 0 && (Slot === null ? /*#__PURE__*/_jsx(Flyout, {
125
+ const t7 = "mb-3 flex flex-wrap items-center gap-2";
126
+ const t8 = subagents.length > 0 && (Slot === null ? /*#__PURE__*/_jsx(Flyout, {
107
127
  icon: progress.waiting > 0 ? /*#__PURE__*/_jsx(Icon, {
108
128
  icon: MessageCircleQuestionMark,
109
129
  size: 14,
@@ -123,9 +143,21 @@ export function ChatActivity(t0) {
123
143
  chatId: chatId,
124
144
  items: subagents
125
145
  }));
126
- let t7;
127
- if ($[11] !== background || $[12] !== chatId || $[13] !== monitors || $[14] !== shells || $[15] !== t) {
128
- t7 = background.length > 0 && /*#__PURE__*/_jsx(Flyout, {
146
+ let t9;
147
+ if ($[16] !== chatId || $[17] !== workflows) {
148
+ t9 = workflows.length > 0 && /*#__PURE__*/_jsx(WorkflowFlyout, {
149
+ chatId: chatId,
150
+ calls: workflows
151
+ });
152
+ $[16] = chatId;
153
+ $[17] = workflows;
154
+ $[18] = t9;
155
+ } else {
156
+ t9 = $[18];
157
+ }
158
+ let t10;
159
+ if ($[19] !== background || $[20] !== chatId || $[21] !== monitors || $[22] !== shells || $[23] !== t) {
160
+ t10 = background.length > 0 && /*#__PURE__*/_jsx(Flyout, {
129
161
  icon: /*#__PURE__*/_jsx(Icon, {
130
162
  icon: shells > 0 ? SquareTerminal : Activity,
131
163
  size: 14
@@ -140,34 +172,38 @@ export function ChatActivity(t0) {
140
172
  tasks: background
141
173
  })
142
174
  });
143
- $[11] = background;
144
- $[12] = chatId;
145
- $[13] = monitors;
146
- $[14] = shells;
147
- $[15] = t;
148
- $[16] = t7;
175
+ $[19] = background;
176
+ $[20] = chatId;
177
+ $[21] = monitors;
178
+ $[22] = shells;
179
+ $[23] = t;
180
+ $[24] = t10;
149
181
  } else {
150
- t7 = $[16];
182
+ t10 = $[24];
151
183
  }
152
- let t8;
153
- if ($[17] !== t6 || $[18] !== t7) {
154
- t8 = /*#__PURE__*/_jsxs("div", {
155
- className: t5,
156
- children: [t6, t7]
184
+ let t11;
185
+ if ($[25] !== t10 || $[26] !== t8 || $[27] !== t9) {
186
+ t11 = /*#__PURE__*/_jsxs("div", {
187
+ className: t7,
188
+ children: [t8, t9, t10]
157
189
  });
158
- $[17] = t6;
159
- $[18] = t7;
160
- $[19] = t8;
190
+ $[25] = t10;
191
+ $[26] = t8;
192
+ $[27] = t9;
193
+ $[28] = t11;
161
194
  } else {
162
- t8 = $[19];
195
+ t11 = $[28];
163
196
  }
164
- return t8;
197
+ return t11;
198
+ }
199
+ function _temp5(row_3) {
200
+ return row_3?.info.background;
165
201
  }
166
202
  function _temp4(row_2) {
167
- return row_2?.info.background;
203
+ return row_2?.structure;
168
204
  }
169
205
  function _temp3(row_1) {
170
- return row_1?.structure;
206
+ return row_1?.workflowsBefore;
171
207
  }
172
208
  function _temp2(row_0) {
173
209
  return row_0?.subagentsBefore;
@@ -285,6 +321,204 @@ function Flyout(t0) {
285
321
  }
286
322
  return t6;
287
323
  }
324
+ function WorkflowIcon(t0) {
325
+ const $ = _c(2);
326
+ const {
327
+ word
328
+ } = t0;
329
+ let t1;
330
+ if ($[0] !== word) {
331
+ t1 = word === "stalled" ? /*#__PURE__*/_jsx(Icon, {
332
+ icon: TriangleAlert,
333
+ size: 14,
334
+ className: "shrink-0 text-status-needs-you"
335
+ }) : /*#__PURE__*/_jsx(StatusIcon, {
336
+ word: word
337
+ });
338
+ $[0] = word;
339
+ $[1] = t1;
340
+ } else {
341
+ t1 = $[1];
342
+ }
343
+ return t1;
344
+ }
345
+ /* The workflows as the thread draws them, each with its phases; opening an agent shows its conversation in the thread's place. */
346
+ function WorkflowFlyout(t0) {
347
+ const $ = _c(38);
348
+ const {
349
+ chatId,
350
+ calls
351
+ } = t0;
352
+ const {
353
+ t
354
+ } = useTranslation("agent-chat");
355
+ const {
356
+ show
357
+ } = useSubagentTrail(chatId);
358
+ const [open, setOpen] = useState(false);
359
+ let t1;
360
+ if ($[0] !== calls) {
361
+ t1 = workflowPillOf(calls);
362
+ $[0] = calls;
363
+ $[1] = t1;
364
+ } else {
365
+ t1 = $[1];
366
+ }
367
+ const pill = t1;
368
+ let t2;
369
+ if ($[2] !== show) {
370
+ t2 = step => {
371
+ setOpen(false);
372
+ show(openFromMain(step));
373
+ };
374
+ $[2] = show;
375
+ $[3] = t2;
376
+ } else {
377
+ t2 = $[3];
378
+ }
379
+ const openAgent = t2;
380
+ let t3;
381
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
382
+ t3 = /*#__PURE__*/_jsx(Popover.Trigger, {});
383
+ $[4] = t3;
384
+ } else {
385
+ t3 = $[4];
386
+ }
387
+ let t4;
388
+ if ($[5] !== pill.word) {
389
+ t4 = /*#__PURE__*/_jsx(WorkflowIcon, {
390
+ word: pill.word
391
+ });
392
+ $[5] = pill.word;
393
+ $[6] = t4;
394
+ } else {
395
+ t4 = $[6];
396
+ }
397
+ let t5;
398
+ if ($[7] !== pill.label) {
399
+ t5 = /*#__PURE__*/_jsx("span", {
400
+ className: "truncate",
401
+ children: pill.label
402
+ });
403
+ $[7] = pill.label;
404
+ $[8] = t5;
405
+ } else {
406
+ t5 = $[8];
407
+ }
408
+ let t6;
409
+ if ($[9] !== calls.length || $[10] !== pill.word || $[11] !== t) {
410
+ t6 = calls.length === 1 && /*#__PURE__*/_jsxs("span", {
411
+ className: "sr-only",
412
+ children: [", ", t(`rows.workflow.${pill.word}`)]
413
+ });
414
+ $[9] = calls.length;
415
+ $[10] = pill.word;
416
+ $[11] = t;
417
+ $[12] = t6;
418
+ } else {
419
+ t6 = $[12];
420
+ }
421
+ let t7;
422
+ if ($[13] !== t4 || $[14] !== t5 || $[15] !== t6) {
423
+ t7 = /*#__PURE__*/_jsxs(Surface, {
424
+ render: t3,
425
+ className: "pointer-events-auto inline-flex h-7.5 max-w-full min-w-0 items-center gap-1.5 rounded-full px-3 text-xs text-text-muted tabular-nums hover:text-text",
426
+ children: [t4, t5, t6]
427
+ });
428
+ $[13] = t4;
429
+ $[14] = t5;
430
+ $[15] = t6;
431
+ $[16] = t7;
432
+ } else {
433
+ t7 = $[16];
434
+ }
435
+ let t8;
436
+ if ($[17] !== calls.length || $[18] !== t) {
437
+ t8 = t("activity.workflows", {
438
+ count: calls.length
439
+ });
440
+ $[17] = calls.length;
441
+ $[18] = t;
442
+ $[19] = t8;
443
+ } else {
444
+ t8 = $[19];
445
+ }
446
+ let t9;
447
+ if ($[20] !== t8) {
448
+ t9 = /*#__PURE__*/_jsx("div", {
449
+ className: "px-2.5 pt-1.5 pb-1 text-xs text-text-faint",
450
+ children: t8
451
+ });
452
+ $[20] = t8;
453
+ $[21] = t9;
454
+ } else {
455
+ t9 = $[21];
456
+ }
457
+ let t10;
458
+ if ($[22] !== calls || $[23] !== chatId || $[24] !== openAgent) {
459
+ let t11;
460
+ if ($[26] !== chatId || $[27] !== openAgent) {
461
+ t11 = call => /*#__PURE__*/_jsx(WorkflowRow, {
462
+ chatId: chatId,
463
+ tool: call,
464
+ workflow: call.workflow,
465
+ onOpenAgent: openAgent,
466
+ place: "flyout"
467
+ }, call.id);
468
+ $[26] = chatId;
469
+ $[27] = openAgent;
470
+ $[28] = t11;
471
+ } else {
472
+ t11 = $[28];
473
+ }
474
+ t10 = calls.map(t11);
475
+ $[22] = calls;
476
+ $[23] = chatId;
477
+ $[24] = openAgent;
478
+ $[25] = t10;
479
+ } else {
480
+ t10 = $[25];
481
+ }
482
+ let t11;
483
+ if ($[29] !== t10) {
484
+ t11 = /*#__PURE__*/_jsx("div", {
485
+ className: "max-h-96 overflow-auto px-2.5 pb-1.5",
486
+ children: t10
487
+ });
488
+ $[29] = t10;
489
+ $[30] = t11;
490
+ } else {
491
+ t11 = $[30];
492
+ }
493
+ let t12;
494
+ if ($[31] !== t11 || $[32] !== t9) {
495
+ t12 = /*#__PURE__*/_jsxs(Popover.Popup, {
496
+ side: "top",
497
+ className: "w-96",
498
+ children: [t9, t11]
499
+ });
500
+ $[31] = t11;
501
+ $[32] = t9;
502
+ $[33] = t12;
503
+ } else {
504
+ t12 = $[33];
505
+ }
506
+ let t13;
507
+ if ($[34] !== open || $[35] !== t12 || $[36] !== t7) {
508
+ t13 = /*#__PURE__*/_jsxs(Popover.Root, {
509
+ open: open,
510
+ onOpenChange: setOpen,
511
+ children: [t7, t12]
512
+ });
513
+ $[34] = open;
514
+ $[35] = t12;
515
+ $[36] = t7;
516
+ $[37] = t13;
517
+ } else {
518
+ t13 = $[37];
519
+ }
520
+ return t13;
521
+ }
288
522
  /* One line of a flyout; with `onOpen` the line leads somewhere and closes the flyout on the way. */
289
523
  function ActivityRow(t0) {
290
524
  const $ = _c(22);
@@ -403,7 +637,7 @@ function SubagentRows(t0) {
403
637
  } = t0;
404
638
  let t1;
405
639
  if ($[0] !== items) {
406
- t1 = items.some(_temp5);
640
+ t1 = items.some(_temp6);
407
641
  $[0] = items;
408
642
  $[1] = t1;
409
643
  } else {
@@ -435,7 +669,7 @@ function SubagentRows(t0) {
435
669
  }
436
670
  return t2;
437
671
  }
438
- function _temp5(item) {
672
+ function _temp6(item) {
439
673
  return item.status === "running";
440
674
  }
441
675
  function SubagentEntry(t0) {
@@ -7,9 +7,10 @@ interface ComposerProps {
7
7
  answerPromptsElsewhere?: () => void;
8
8
  disabled: boolean;
9
9
  readOnly?: boolean;
10
+ workflowPill?: boolean;
10
11
  providerFixed: boolean;
11
12
  onSend(text: string, extras: ChatSendExtras): void | Promise<boolean>;
12
13
  onRetarget(provider: AgentKind, selection: ModelSelection): Promise<void>;
13
14
  }
14
- export declare function Composer({ chatId, info, focused, answerPromptsElsewhere, disabled, readOnly, providerFixed, onSend, onRetarget }: ComposerProps): import("react").JSX.Element;
15
+ export declare function Composer({ chatId, info, focused, answerPromptsElsewhere, disabled, readOnly, workflowPill, providerFixed, onSend, onRetarget }: ComposerProps): import("react").JSX.Element;
15
16
  export {};