@lumerahq/ui 0.19.6 → 0.20.0-dev.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 (60) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +31 -16
  3. package/dist/{RecordSheet-YYdAQo89.js → RecordSheet-Cq027sFr.js} +1358 -750
  4. package/dist/components/agent-chat/ActivityStrip.d.ts +6 -1
  5. package/dist/components/agent-chat/ActivityStrip.d.ts.map +1 -1
  6. package/dist/components/agent-chat/AgentChat.d.ts +1 -1
  7. package/dist/components/agent-chat/AgentChat.d.ts.map +1 -1
  8. package/dist/components/agent-chat/AgentChatComposer.d.ts +8 -0
  9. package/dist/components/agent-chat/AgentChatComposer.d.ts.map +1 -0
  10. package/dist/components/agent-chat/AgentChatEmptyState.d.ts +9 -0
  11. package/dist/components/agent-chat/AgentChatEmptyState.d.ts.map +1 -0
  12. package/dist/components/agent-chat/AgentChatHeader.d.ts +4 -0
  13. package/dist/components/agent-chat/AgentChatHeader.d.ts.map +1 -0
  14. package/dist/components/agent-chat/AgentChatToast.d.ts +5 -0
  15. package/dist/components/agent-chat/AgentChatToast.d.ts.map +1 -0
  16. package/dist/components/agent-chat/AgentChatTranscript.d.ts +24 -0
  17. package/dist/components/agent-chat/AgentChatTranscript.d.ts.map +1 -0
  18. package/dist/components/agent-chat/AssistantTurn.d.ts +40 -0
  19. package/dist/components/agent-chat/AssistantTurn.d.ts.map +1 -0
  20. package/dist/components/agent-chat/DefaultContentBlock.d.ts +4 -0
  21. package/dist/components/agent-chat/DefaultContentBlock.d.ts.map +1 -0
  22. package/dist/components/agent-chat/Markdown.d.ts +2 -2
  23. package/dist/components/agent-chat/ReasoningLine.d.ts +10 -0
  24. package/dist/components/agent-chat/ReasoningLine.d.ts.map +1 -0
  25. package/dist/components/agent-chat/SystemMarker.d.ts +7 -0
  26. package/dist/components/agent-chat/SystemMarker.d.ts.map +1 -0
  27. package/dist/components/agent-chat/ToolStepsCard.d.ts +17 -0
  28. package/dist/components/agent-chat/ToolStepsCard.d.ts.map +1 -0
  29. package/dist/components/agent-chat/TurnStatus.d.ts +11 -0
  30. package/dist/components/agent-chat/TurnStatus.d.ts.map +1 -0
  31. package/dist/components/agent-chat/UserMessage.d.ts +4 -0
  32. package/dist/components/agent-chat/UserMessage.d.ts.map +1 -0
  33. package/dist/components/agent-chat/activity-utils.d.ts +35 -8
  34. package/dist/components/agent-chat/activity-utils.d.ts.map +1 -1
  35. package/dist/components/agent-chat/hooks/use-autosize-textarea.d.ts +4 -0
  36. package/dist/components/agent-chat/hooks/use-autosize-textarea.d.ts.map +1 -0
  37. package/dist/components/agent-chat/hooks/use-stick-to-bottom.d.ts +7 -0
  38. package/dist/components/agent-chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
  39. package/dist/components/agent-chat/hooks/use-transient-toast.d.ts +7 -0
  40. package/dist/components/agent-chat/hooks/use-transient-toast.d.ts.map +1 -0
  41. package/dist/components/agent-chat/index.d.ts +2 -1
  42. package/dist/components/agent-chat/index.d.ts.map +1 -1
  43. package/dist/components/agent-chat/lumera-agent-transport.d.ts.map +1 -1
  44. package/dist/components/agent-chat/tool-renderers/ToolCallCard.d.ts +4 -1
  45. package/dist/components/agent-chat/tool-renderers/ToolCallCard.d.ts.map +1 -1
  46. package/dist/components/agent-chat/types.d.ts +98 -19
  47. package/dist/components/agent-chat/types.d.ts.map +1 -1
  48. package/dist/components/index.d.ts +2 -2
  49. package/dist/components/index.d.ts.map +1 -1
  50. package/dist/components/index.js +22 -21
  51. package/dist/{highlighted-body-OFNGDK62-CC4-u9BC.js → highlighted-body-OFNGDK62-ByL2oaVl.js} +1 -1
  52. package/dist/hooks/index.js +1 -1
  53. package/dist/hooks/use-agent-chat.d.ts +6 -3
  54. package/dist/hooks/use-agent-chat.d.ts.map +1 -1
  55. package/dist/index.js +25 -24
  56. package/dist/mermaid-GHXKKRXX-BkfFnaMM.js +4 -0
  57. package/dist/ui.css +517 -59
  58. package/dist/{use-automation-run-BcXShLYo.js → use-automation-run-BaW82zqJ.js} +9 -4
  59. package/package.json +3 -2
  60. package/dist/mermaid-GHXKKRXX-BYF0ZrAE.js +0 -4
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, isValidElement, cloneElement, useCallback, Suspense, lazy, Fragment as Fragment$1, useLayoutEffect } from "react";
4
- import { u as useAgentChat, b as useAgentChatSessions, a as areAgentChatMutationsBlocked, c as useAutomationRun } from "./use-automation-run-BcXShLYo.js";
3
+ import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, isValidElement, cloneElement, useCallback, Suspense, lazy, useLayoutEffect, Fragment as Fragment$1 } from "react";
5
4
  import { t as twMerge, p as clsx, c as cn$2, a as formatCellValue$2 } from "./formatters-BuHr2I8Z.js";
5
+ import { u as useAgentChat, b as useAgentChatSessions, a as areAgentChatMutationsBlocked, c as useAutomationRun } from "./use-automation-run-BaW82zqJ.js";
6
6
  import { T as pbSql, o as getDownloadUrl, K as parentApiRequest, L as parentApiStream, B as BridgeError, k as getAppProjectExternalId, a3 as resolveProjectResourceId, a as automationStatuses, n as getAutomationRunFileDownloadUrl, D as listAutomationRunFiles } from "./automations-DD15itWa.js";
7
7
  import * as ReactDOM from "react-dom";
8
8
  import { createPortal } from "react-dom";
@@ -85,24 +85,24 @@ const createLucideIcon = (iconName, iconNode) => {
85
85
  Component.displayName = toPascalCase(iconName);
86
86
  return Component;
87
87
  };
88
- const __iconNode$G = [
88
+ const __iconNode$J = [
89
89
  ["path", { d: "M12 5v14", key: "s699le" }],
90
90
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
91
91
  ];
92
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$G);
93
- const __iconNode$F = [
92
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$J);
93
+ const __iconNode$I = [
94
94
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
95
95
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
96
96
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
97
97
  ["path", { d: "M7 4v16", key: "1glfcx" }]
98
98
  ];
99
- const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$F);
100
- const __iconNode$E = [
99
+ const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$I);
100
+ const __iconNode$H = [
101
101
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
102
102
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
103
103
  ];
104
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$E);
105
- const __iconNode$D = [
104
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$H);
105
+ const __iconNode$G = [
106
106
  ["path", { d: "M12 8V4H8", key: "hb8ula" }],
107
107
  ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
108
108
  ["path", { d: "M2 14h2", key: "vft8re" }],
@@ -110,8 +110,8 @@ const __iconNode$D = [
110
110
  ["path", { d: "M15 13v2", key: "1xurst" }],
111
111
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
112
112
  ];
113
- const Bot = createLucideIcon("bot", __iconNode$D);
114
- const __iconNode$C = [
113
+ const Bot = createLucideIcon("bot", __iconNode$G);
114
+ const __iconNode$F = [
115
115
  ["path", { d: "M12 18V5", key: "adv99a" }],
116
116
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
117
117
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -121,61 +121,72 @@ const __iconNode$C = [
121
121
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
122
122
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
123
123
  ];
124
- const Brain = createLucideIcon("brain", __iconNode$C);
125
- const __iconNode$B = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
126
- const Check = createLucideIcon("check", __iconNode$B);
127
- const __iconNode$A = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
128
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$A);
129
- const __iconNode$z = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
130
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$z);
131
- const __iconNode$y = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
132
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$y);
133
- const __iconNode$x = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
134
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$x);
135
- const __iconNode$w = [
124
+ const Brain = createLucideIcon("brain", __iconNode$F);
125
+ const __iconNode$E = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
126
+ const Check = createLucideIcon("check", __iconNode$E);
127
+ const __iconNode$D = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
128
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$D);
129
+ const __iconNode$C = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
130
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$C);
131
+ const __iconNode$B = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
132
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$B);
133
+ const __iconNode$A = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
134
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$A);
135
+ const __iconNode$z = [
136
136
  ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
137
137
  ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
138
138
  ];
139
- const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$w);
140
- const __iconNode$v = [
139
+ const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$z);
140
+ const __iconNode$y = [
141
141
  ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
142
142
  ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
143
143
  ];
144
- const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$v);
145
- const __iconNode$u = [
144
+ const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$y);
145
+ const __iconNode$x = [
146
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
147
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
148
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
149
+ ];
150
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$x);
151
+ const __iconNode$w = [
146
152
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
147
153
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
148
154
  ];
149
- const CircleCheck = createLucideIcon("circle-check", __iconNode$u);
150
- const __iconNode$t = [
155
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$w);
156
+ const __iconNode$v = [
157
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
158
+ ["rect", { x: "9", y: "9", width: "6", height: "6", rx: "1", key: "1ssd4o" }]
159
+ ];
160
+ const CircleStop = createLucideIcon("circle-stop", __iconNode$v);
161
+ const __iconNode$u = [
151
162
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
152
163
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
153
164
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
154
165
  ];
155
- const CircleX = createLucideIcon("circle-x", __iconNode$t);
156
- const __iconNode$s = [
166
+ const CircleX = createLucideIcon("circle-x", __iconNode$u);
167
+ const __iconNode$t = [
157
168
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
158
169
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
159
170
  ];
160
- const Code = createLucideIcon("code", __iconNode$s);
161
- const __iconNode$r = [
171
+ const Code = createLucideIcon("code", __iconNode$t);
172
+ const __iconNode$s = [
162
173
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
163
174
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
164
175
  ];
165
- const Copy = createLucideIcon("copy", __iconNode$r);
166
- const __iconNode$q = [
176
+ const Copy = createLucideIcon("copy", __iconNode$s);
177
+ const __iconNode$r = [
167
178
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
168
179
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
169
180
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
170
181
  ];
171
- const Download = createLucideIcon("download", __iconNode$q);
172
- const __iconNode$p = [
182
+ const Download = createLucideIcon("download", __iconNode$r);
183
+ const __iconNode$q = [
173
184
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
174
185
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
175
186
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
176
187
  ];
177
- const ExternalLink = createLucideIcon("external-link", __iconNode$p);
178
- const __iconNode$o = [
188
+ const ExternalLink = createLucideIcon("external-link", __iconNode$q);
189
+ const __iconNode$p = [
179
190
  [
180
191
  "path",
181
192
  {
@@ -189,8 +200,8 @@ const __iconNode$o = [
189
200
  ["path", { d: "M8 17h2", key: "2yhykz" }],
190
201
  ["path", { d: "M14 17h2", key: "10kma7" }]
191
202
  ];
192
- const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$o);
193
- const __iconNode$n = [
203
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$p);
204
+ const __iconNode$o = [
194
205
  [
195
206
  "path",
196
207
  {
@@ -203,8 +214,8 @@ const __iconNode$n = [
203
214
  ["path", { d: "M16 13H8", key: "t4e002" }],
204
215
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
205
216
  ];
206
- const FileText = createLucideIcon("file-text", __iconNode$n);
207
- const __iconNode$m = [
217
+ const FileText = createLucideIcon("file-text", __iconNode$o);
218
+ const __iconNode$n = [
208
219
  [
209
220
  "path",
210
221
  {
@@ -214,8 +225,8 @@ const __iconNode$m = [
214
225
  ],
215
226
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
216
227
  ];
217
- const File = createLucideIcon("file", __iconNode$m);
218
- const __iconNode$l = [
228
+ const File = createLucideIcon("file", __iconNode$n);
229
+ const __iconNode$m = [
219
230
  [
220
231
  "path",
221
232
  {
@@ -224,7 +235,13 @@ const __iconNode$l = [
224
235
  }
225
236
  ]
226
237
  ];
227
- const Funnel = createLucideIcon("funnel", __iconNode$l);
238
+ const Funnel = createLucideIcon("funnel", __iconNode$m);
239
+ const __iconNode$l = [
240
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
241
+ ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
242
+ ["path", { d: "M2 12h20", key: "9i4pu4" }]
243
+ ];
244
+ const Globe = createLucideIcon("globe", __iconNode$l);
228
245
  const __iconNode$k = [
229
246
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
230
247
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
@@ -237,16 +254,24 @@ const __iconNode$j = [
237
254
  ["path", { d: "M12 8h.01", key: "e9boi3" }]
238
255
  ];
239
256
  const Info$1 = createLucideIcon("info", __iconNode$j);
240
- const __iconNode$i = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
241
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$i);
242
- const __iconNode$h = [
257
+ const __iconNode$i = [
258
+ ["path", { d: "M10 5h11", key: "1hkqpe" }],
259
+ ["path", { d: "M10 12h11", key: "6m4ad9" }],
260
+ ["path", { d: "M10 19h11", key: "14g2nv" }],
261
+ ["path", { d: "m3 10 3-3-3-3", key: "i7pm08" }],
262
+ ["path", { d: "m3 20 3-3-3-3", key: "20gx1n" }]
263
+ ];
264
+ const ListCollapse = createLucideIcon("list-collapse", __iconNode$i);
265
+ const __iconNode$h = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
266
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$h);
267
+ const __iconNode$g = [
243
268
  ["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
244
269
  ["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
245
270
  ["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
246
271
  ["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
247
272
  ];
248
- const Maximize = createLucideIcon("maximize", __iconNode$h);
249
- const __iconNode$g = [
273
+ const Maximize = createLucideIcon("maximize", __iconNode$g);
274
+ const __iconNode$f = [
250
275
  [
251
276
  "path",
252
277
  {
@@ -262,27 +287,27 @@ const __iconNode$g = [
262
287
  }
263
288
  ]
264
289
  ];
265
- const MessagesSquare = createLucideIcon("messages-square", __iconNode$g);
266
- const __iconNode$f = [
290
+ const MessagesSquare = createLucideIcon("messages-square", __iconNode$f);
291
+ const __iconNode$e = [
267
292
  ["path", { d: "M8 3v3a2 2 0 0 1-2 2H3", key: "hohbtr" }],
268
293
  ["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3", key: "5jw1f3" }],
269
294
  ["path", { d: "M3 16h3a2 2 0 0 1 2 2v3", key: "198tvr" }],
270
295
  ["path", { d: "M16 21v-3a2 2 0 0 1 2-2h3", key: "ph8mxp" }]
271
296
  ];
272
- const Minimize = createLucideIcon("minimize", __iconNode$f);
273
- const __iconNode$e = [
297
+ const Minimize = createLucideIcon("minimize", __iconNode$e);
298
+ const __iconNode$d = [
274
299
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
275
300
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
276
301
  ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
277
302
  ];
278
- const PanelLeftClose = createLucideIcon("panel-left-close", __iconNode$e);
279
- const __iconNode$d = [
303
+ const PanelLeftClose = createLucideIcon("panel-left-close", __iconNode$d);
304
+ const __iconNode$c = [
280
305
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
281
306
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
282
307
  ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
283
308
  ];
284
- const PanelLeftOpen = createLucideIcon("panel-left-open", __iconNode$d);
285
- const __iconNode$c = [
309
+ const PanelLeftOpen = createLucideIcon("panel-left-open", __iconNode$c);
310
+ const __iconNode$b = [
286
311
  [
287
312
  "path",
288
313
  {
@@ -291,8 +316,8 @@ const __iconNode$c = [
291
316
  }
292
317
  ]
293
318
  ];
294
- const Paperclip = createLucideIcon("paperclip", __iconNode$c);
295
- const __iconNode$b = [
319
+ const Paperclip = createLucideIcon("paperclip", __iconNode$b);
320
+ const __iconNode$a = [
296
321
  [
297
322
  "path",
298
323
  {
@@ -302,20 +327,20 @@ const __iconNode$b = [
302
327
  ],
303
328
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
304
329
  ];
305
- const Pencil = createLucideIcon("pencil", __iconNode$b);
306
- const __iconNode$a = [
330
+ const Pencil = createLucideIcon("pencil", __iconNode$a);
331
+ const __iconNode$9 = [
307
332
  ["path", { d: "M5 12h14", key: "1ays0h" }],
308
333
  ["path", { d: "M12 5v14", key: "s699le" }]
309
334
  ];
310
- const Plus = createLucideIcon("plus", __iconNode$a);
311
- const __iconNode$9 = [
335
+ const Plus = createLucideIcon("plus", __iconNode$9);
336
+ const __iconNode$8 = [
312
337
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
313
338
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
314
339
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
315
340
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
316
341
  ];
317
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$9);
318
- const __iconNode$8 = [
342
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$8);
343
+ const __iconNode$7 = [
319
344
  [
320
345
  "path",
321
346
  {
@@ -325,8 +350,8 @@ const __iconNode$8 = [
325
350
  ],
326
351
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
327
352
  ];
328
- const Send = createLucideIcon("send", __iconNode$8);
329
- const __iconNode$7 = [
353
+ const Send = createLucideIcon("send", __iconNode$7);
354
+ const __iconNode$6 = [
330
355
  [
331
356
  "path",
332
357
  {
@@ -338,12 +363,12 @@ const __iconNode$7 = [
338
363
  ["path", { d: "M22 4h-4", key: "gwowj6" }],
339
364
  ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
340
365
  ];
341
- const Sparkles = createLucideIcon("sparkles", __iconNode$7);
342
- const __iconNode$6 = [
366
+ const Sparkles = createLucideIcon("sparkles", __iconNode$6);
367
+ const __iconNode$5 = [
343
368
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
344
369
  ];
345
- const Square = createLucideIcon("square", __iconNode$6);
346
- const __iconNode$5 = [
370
+ const Square = createLucideIcon("square", __iconNode$5);
371
+ const __iconNode$4 = [
347
372
  [
348
373
  "path",
349
374
  {
@@ -353,8 +378,8 @@ const __iconNode$5 = [
353
378
  ],
354
379
  ["path", { d: "M17 14V2", key: "8ymqnk" }]
355
380
  ];
356
- const ThumbsDown = createLucideIcon("thumbs-down", __iconNode$5);
357
- const __iconNode$4 = [
381
+ const ThumbsDown = createLucideIcon("thumbs-down", __iconNode$4);
382
+ const __iconNode$3 = [
358
383
  [
359
384
  "path",
360
385
  {
@@ -364,16 +389,16 @@ const __iconNode$4 = [
364
389
  ],
365
390
  ["path", { d: "M7 10v12", key: "1qc93n" }]
366
391
  ];
367
- const ThumbsUp = createLucideIcon("thumbs-up", __iconNode$4);
368
- const __iconNode$3 = [
392
+ const ThumbsUp = createLucideIcon("thumbs-up", __iconNode$3);
393
+ const __iconNode$2 = [
369
394
  ["path", { d: "M10 11v6", key: "nco0om" }],
370
395
  ["path", { d: "M14 11v6", key: "outv1u" }],
371
396
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
372
397
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
373
398
  ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
374
399
  ];
375
- const Trash2 = createLucideIcon("trash-2", __iconNode$3);
376
- const __iconNode$2 = [
400
+ const Trash2 = createLucideIcon("trash-2", __iconNode$2);
401
+ const __iconNode$1 = [
377
402
  [
378
403
  "path",
379
404
  {
@@ -384,12 +409,7 @@ const __iconNode$2 = [
384
409
  ["path", { d: "M12 9v4", key: "juzpu7" }],
385
410
  ["path", { d: "M12 17h.01", key: "p32p05" }]
386
411
  ];
387
- const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$2);
388
- const __iconNode$1 = [
389
- ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
390
- ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
391
- ];
392
- const User = createLucideIcon("user", __iconNode$1);
412
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$1);
393
413
  const __iconNode = [
394
414
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
395
415
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
@@ -24010,7 +24030,7 @@ var lr = (e) => {
24010
24030
  for (; t > 0 && e[t - 1] === `
24011
24031
  `; ) t--;
24012
24032
  return e.slice(0, t);
24013
- }, cr = lazy(() => import("./highlighted-body-OFNGDK62-CC4-u9BC.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24033
+ }, cr = lazy(() => import("./highlighted-body-OFNGDK62-ByL2oaVl.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24014
24034
  let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
24015
24035
  `).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
24016
24036
  return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
@@ -24372,7 +24392,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
24372
24392
  let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
24373
24393
  return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
24374
24394
  };
24375
- var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-BYF0ZrAE.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24395
+ var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-BkfFnaMM.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24376
24396
  function qe(e, t) {
24377
24397
  if (!(e != null && e.position || t != null && t.position)) return true;
24378
24398
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -24955,25 +24975,25 @@ var po = ({ chart: e, className: t, config: o, fullscreen: n = false, showContro
24955
24975
  function isActivityBlock(block) {
24956
24976
  return block.type === "thinking" || block.type === "tool_call" || block.type === "custom" && block.kind === "tool_call_args_progress";
24957
24977
  }
24958
- function encodeActivityLabels(labels) {
24959
- const encoded = [];
24960
- for (const label of labels) {
24961
- const last = encoded[encoded.length - 1];
24962
- if (last && last.label === label) last.count += 1;
24963
- else encoded.push({ label, count: 1 });
24964
- }
24965
- return encoded.map(({ label, count }) => count > 1 ? `${label} ×${count}` : label);
24978
+ const LEADING_GLYPH_RE = new RegExp("^(?:\\p{Extended_Pictographic}|\\p{Emoji_Presentation}|\\u{FE0F}|\\u{200D}|[$▸])+\\s*", "u");
24979
+ function splitStepLabel(summary) {
24980
+ const clean = summary.replace(LEADING_GLYPH_RE, "").replace(/\s+/g, " ").trim();
24981
+ const at2 = clean.lastIndexOf(" · ");
24982
+ if (at2 < 0) return { label: clean };
24983
+ const label = clean.slice(0, at2).trim();
24984
+ const detail = clean.slice(at2 + 3).trim();
24985
+ return detail ? { label, detail } : { label: clean };
24966
24986
  }
24967
- function clipLabel(label, max2 = 44) {
24987
+ function clipLabel(label, max2 = 60) {
24968
24988
  const oneLine = label.replace(/\s+/g, " ").trim();
24969
24989
  return oneLine.length > max2 ? `${oneLine.slice(0, max2 - 1)}…` : oneLine;
24970
24990
  }
24971
- function summarizeActivityLabels(labels, shown = 3) {
24972
- const encoded = encodeActivityLabels(labels.map((label) => clipLabel(label)));
24973
- if (encoded.length === 0) return "Thought it through";
24974
- const head = encoded.slice(0, shown);
24975
- const extra = encoded.length - head.length;
24976
- return head.join(" · ") + (extra > 0 ? ` · +${extra} more` : "");
24991
+ function toolCardTitle(labels) {
24992
+ const last = labels[labels.length - 1];
24993
+ return last ? clipLabel(last.label) : "Done";
24994
+ }
24995
+ function stepCountLabel(count) {
24996
+ return `${count} step${count === 1 ? "" : "s"}`;
24977
24997
  }
24978
24998
  function activityDurationSeconds(toolCalls) {
24979
24999
  if (toolCalls.length === 0) return null;
@@ -24991,6 +25011,40 @@ function activityDurationSeconds(toolCalls) {
24991
25011
  const seconds = Math.round((end - start) / 1e3);
24992
25012
  return seconds >= 0 ? seconds : null;
24993
25013
  }
25014
+ function thinkingDurationSeconds(blocks) {
25015
+ let total = 0;
25016
+ let stamped = false;
25017
+ for (const block of blocks) {
25018
+ if (!block.startedAt || !block.completedAt) continue;
25019
+ const started = Date.parse(block.startedAt);
25020
+ const completed = Date.parse(block.completedAt);
25021
+ if (Number.isNaN(started) || Number.isNaN(completed)) continue;
25022
+ total += Math.max(0, completed - started);
25023
+ stamped = true;
25024
+ }
25025
+ return stamped ? Math.max(1, Math.round(total / 1e3)) : null;
25026
+ }
25027
+ function reasoningLabel(seconds, isStreaming) {
25028
+ if (isStreaming) return "Thinking…";
25029
+ if (seconds !== null) return `Thought for ${seconds}s`;
25030
+ return "Reasoning";
25031
+ }
25032
+ function encodeActivityLabels(labels) {
25033
+ const encoded = [];
25034
+ for (const label of labels) {
25035
+ const last = encoded[encoded.length - 1];
25036
+ if (last && last.label === label) last.count += 1;
25037
+ else encoded.push({ label, count: 1 });
25038
+ }
25039
+ return encoded.map(({ label, count }) => count > 1 ? `${label} ×${count}` : label);
25040
+ }
25041
+ function summarizeActivityLabels(labels, shown = 3) {
25042
+ const encoded = encodeActivityLabels(labels.map((label) => clipLabel(label, 44)));
25043
+ if (encoded.length === 0) return "Thought it through";
25044
+ const head = encoded.slice(0, shown);
25045
+ const extra = encoded.length - head.length;
25046
+ return head.join(" · ") + (extra > 0 ? ` · +${extra} more` : "");
25047
+ }
24994
25048
  const artifactRenderer = {
24995
25049
  match(tc) {
24996
25050
  return tc.name === "create_artifact";
@@ -26135,7 +26189,7 @@ function ToolRenderersProvider({ renderers, children: children2 }) {
26135
26189
  function useToolRenderers() {
26136
26190
  return useContext(ToolRenderersContext);
26137
26191
  }
26138
- function ToolCallCard({ toolCall, renderers, className, ...props }) {
26192
+ function ToolCallCard({ toolCall, renderers, label, className, ...props }) {
26139
26193
  const [expanded, setExpanded] = useState(false);
26140
26194
  const [collections, setCollections] = useState(() => getCollectionMap());
26141
26195
  const contextRenderers = useContext(ToolRenderersContext);
@@ -26146,13 +26200,14 @@ function ToolCallCard({ toolCall, renderers, className, ...props }) {
26146
26200
  () => toolCall.input == null ? { ...toolCall, input: {} } : toolCall,
26147
26201
  [toolCall]
26148
26202
  );
26149
- const summary = useMemo(() => {
26203
+ const step = useMemo(() => {
26204
+ if (label) return label;
26150
26205
  try {
26151
- return renderer.summary(safeToolCall, collections);
26206
+ return splitStepLabel(renderer.summary(safeToolCall, collections));
26152
26207
  } catch {
26153
- return safeToolCall.name;
26208
+ return { label: safeToolCall.name };
26154
26209
  }
26155
- }, [renderer, safeToolCall, collections]);
26210
+ }, [collections, label, renderer, safeToolCall]);
26156
26211
  const inlinePreview = useMemo(() => {
26157
26212
  try {
26158
26213
  return renderer.inlinePreview?.(safeToolCall, collections) ?? null;
@@ -26168,41 +26223,53 @@ function ToolCallCard({ toolCall, renderers, className, ...props }) {
26168
26223
  }
26169
26224
  }, [renderer, safeToolCall, collections]);
26170
26225
  const rawOutput = useMemo(() => extractOutputText(toolCall.output), [toolCall.output]);
26171
- const hasExpandable = !!expandedView || !!rawOutput;
26226
+ const hasDetail = Boolean(inlinePreview || expandedView || rawOutput);
26172
26227
  const isRunning = toolCall.status === "running";
26173
- const isExploratoryError = isExploratoryToolCallError(toolCall);
26174
- const isError = toolCall.status === "error" && !isExploratoryError;
26175
- return /* @__PURE__ */ jsxs(
26176
- "div",
26228
+ const isError = toolCall.status === "error" && !isExploratoryToolCallError(toolCall);
26229
+ return /* @__PURE__ */ jsxs("div", { className: cn$2("group/step min-w-0", className), ...props, children: [
26230
+ /* @__PURE__ */ jsxs(
26231
+ "button",
26232
+ {
26233
+ type: "button",
26234
+ onClick: () => hasDetail && setExpanded((value) => !value),
26235
+ disabled: !hasDetail,
26236
+ "aria-expanded": hasDetail ? expanded : void 0,
26237
+ className: cn$2(
26238
+ "flex w-full min-w-0 items-baseline gap-2 text-left text-[12.5px] text-muted-foreground",
26239
+ hasDetail ? "cursor-pointer hover:text-foreground" : "cursor-default"
26240
+ ),
26241
+ children: [
26242
+ /* @__PURE__ */ jsx(StepDot, { running: isRunning, error: isError }),
26243
+ /* @__PURE__ */ jsx("span", { className: cn$2("min-w-0 flex-1 truncate", isError && "text-(--agent-chat-accent-ink)"), children: step.label }),
26244
+ step.detail && /* @__PURE__ */ jsx("span", { className: "shrink-0 font-mono text-[11.5px] tabular-nums text-foreground", children: step.detail }),
26245
+ hasDetail && /* @__PURE__ */ jsx(
26246
+ ChevronDown,
26247
+ {
26248
+ className: cn$2(
26249
+ "relative top-0.5 size-2.5 shrink-0 text-muted-foreground/60 transition-transform",
26250
+ expanded && "rotate-180"
26251
+ ),
26252
+ "aria-hidden": "true"
26253
+ }
26254
+ )
26255
+ ]
26256
+ }
26257
+ ),
26258
+ expanded && hasDetail && /* @__PURE__ */ jsxs("div", { className: "mt-1.5 ml-[13px] space-y-1.5", children: [
26259
+ inlinePreview,
26260
+ expandedView ?? /* @__PURE__ */ jsx("div", { className: "max-h-[200px] overflow-auto rounded-md bg-muted/60 p-2.5", children: /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap break-words font-mono text-[10.5px] text-muted-foreground", children: rawOutput }) })
26261
+ ] })
26262
+ ] });
26263
+ }
26264
+ function StepDot({ running, error: error2 }) {
26265
+ return /* @__PURE__ */ jsx(
26266
+ "span",
26177
26267
  {
26268
+ "aria-hidden": "true",
26178
26269
  className: cn$2(
26179
- "group flex min-w-0 flex-col rounded-lg transition-colors",
26180
- isError && "bg-destructive/10",
26181
- className
26182
- ),
26183
- ...props,
26184
- children: [
26185
- /* @__PURE__ */ jsxs(
26186
- "button",
26187
- {
26188
- type: "button",
26189
- onClick: () => hasExpandable && setExpanded(!expanded),
26190
- disabled: !hasExpandable,
26191
- className: cn$2(
26192
- "flex min-w-0 items-center gap-2 px-2 py-1.5 text-left text-[12px]",
26193
- hasExpandable && "cursor-pointer rounded-lg hover:bg-muted/50",
26194
- !hasExpandable && "cursor-default"
26195
- ),
26196
- children: [
26197
- hasExpandable ? expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 shrink-0 text-muted-foreground/50" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-3 shrink-0 text-muted-foreground/50" }) : /* @__PURE__ */ jsx("span", { className: "size-3 shrink-0" }),
26198
- /* @__PURE__ */ jsx("span", { className: cn$2("min-w-0 flex-1 truncate", isError ? "text-destructive" : "text-muted-foreground"), children: summary }),
26199
- isRunning && /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 shrink-0 animate-spin text-muted-foreground/50" })
26200
- ]
26201
- }
26202
- ),
26203
- inlinePreview,
26204
- expanded && hasExpandable && (expandedView ?? /* @__PURE__ */ jsx("div", { className: "mx-2 mb-2 max-h-[200px] overflow-auto rounded-md bg-muted/40 p-2.5", children: /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap break-words font-mono text-[10px] text-muted-foreground", children: rawOutput }) }))
26205
- ]
26270
+ "relative -top-px size-[5px] shrink-0 rounded-full",
26271
+ running ? "bg-primary animate-[agent-chat-pulse_1s_ease-in-out_infinite]" : error2 ? "bg-primary" : "bg-muted-foreground"
26272
+ )
26206
26273
  }
26207
26274
  );
26208
26275
  }
@@ -26313,6 +26380,320 @@ function ToolArgsProgress({ payload }) {
26313
26380
  ] })
26314
26381
  ] });
26315
26382
  }
26383
+ function useAutosizeTextarea(ref, value, maxHeight) {
26384
+ useLayoutEffect(() => {
26385
+ const el = ref.current;
26386
+ if (!el) return;
26387
+ el.style.height = "auto";
26388
+ el.style.height = `${Math.min(el.scrollHeight, maxHeight)}px`;
26389
+ el.style.overflowY = el.scrollHeight > maxHeight ? "auto" : "hidden";
26390
+ }, [maxHeight, ref, value]);
26391
+ }
26392
+ const TEXTAREA_MAX_HEIGHT = 120;
26393
+ function AgentChatComposer({ state, actions }) {
26394
+ const textareaRef = useRef(null);
26395
+ useAutosizeTextarea(textareaRef, state.value, TEXTAREA_MAX_HEIGHT);
26396
+ const submit = () => {
26397
+ if (state.canSubmit) void actions.submit();
26398
+ };
26399
+ return /* @__PURE__ */ jsxs(
26400
+ "form",
26401
+ {
26402
+ className: "px-3 pt-2.5 pb-3",
26403
+ onSubmit: (event) => {
26404
+ event.preventDefault();
26405
+ submit();
26406
+ },
26407
+ children: [
26408
+ !state.inFlight && state.chips && state.chips.length > 0 && actions.pickChip && /* @__PURE__ */ jsx("div", { className: "mb-2 flex flex-wrap gap-1.5 px-0.5", children: state.chips.map((chip) => /* @__PURE__ */ jsx(
26409
+ "button",
26410
+ {
26411
+ type: "button",
26412
+ disabled: state.disabled,
26413
+ onClick: () => actions.pickChip?.(chip.value),
26414
+ className: "rounded-full border border-border bg-background px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",
26415
+ children: chip.label
26416
+ },
26417
+ chip.label
26418
+ )) }),
26419
+ /* @__PURE__ */ jsxs("div", { className: "relative rounded-xl border border-border bg-background shadow-[0_1px_2px_rgba(0,0,0,.03)]", children: [
26420
+ state.inFlight && /* @__PURE__ */ jsx(StreamingTrace, {}),
26421
+ state.pendingFiles.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 px-2 pt-2", children: state.pendingFiles.map((file) => /* @__PURE__ */ jsx(PendingFileChip, { file, onRemove: actions.removePendingFile }, file.id)) }),
26422
+ /* @__PURE__ */ jsx(
26423
+ "textarea",
26424
+ {
26425
+ ref: textareaRef,
26426
+ value: state.value,
26427
+ placeholder: state.placeholder,
26428
+ disabled: state.disabled,
26429
+ rows: 1,
26430
+ className: "block min-h-[38px] w-full resize-none bg-transparent px-3 pt-2.5 pb-1 text-sm leading-[1.4] text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-60",
26431
+ onChange: (event) => actions.setValue(event.target.value),
26432
+ onKeyDown: (event) => {
26433
+ if (event.key === "Enter" && !event.shiftKey) {
26434
+ event.preventDefault();
26435
+ submit();
26436
+ }
26437
+ }
26438
+ }
26439
+ ),
26440
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 px-1.5 pt-1 pb-1.5", children: [
26441
+ actions.attachFiles && /* @__PURE__ */ jsx(AttachButton, { disabled: state.disabled, onFiles: actions.attachFiles }),
26442
+ state.webSearchEnabled !== void 0 && actions.setWebSearchEnabled && /* @__PURE__ */ jsx(
26443
+ WebSearchChip,
26444
+ {
26445
+ enabled: state.webSearchEnabled,
26446
+ disabled: state.disabled,
26447
+ onToggle: actions.setWebSearchEnabled
26448
+ }
26449
+ ),
26450
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
26451
+ state.queueLength > 0 ? /* @__PURE__ */ jsxs("span", { className: "mr-1.5 text-[11px] text-muted-foreground", children: [
26452
+ state.queueLength,
26453
+ " queued"
26454
+ ] }) : /* @__PURE__ */ jsx("span", { className: "mr-1.5 text-[11px] text-muted-foreground", children: state.hint }),
26455
+ state.canAbort ? /* @__PURE__ */ jsx(
26456
+ "button",
26457
+ {
26458
+ type: "button",
26459
+ onClick: () => void actions.abort(),
26460
+ disabled: state.phase === "aborting",
26461
+ "aria-label": state.stopLabel,
26462
+ title: state.stopLabel,
26463
+ className: "flex size-[30px] shrink-0 items-center justify-center rounded-md bg-foreground text-background transition-opacity hover:opacity-90 disabled:opacity-60",
26464
+ children: state.phase === "aborting" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-2.5 rounded-[2px] bg-current" })
26465
+ }
26466
+ ) : /* @__PURE__ */ jsx(
26467
+ "button",
26468
+ {
26469
+ type: "submit",
26470
+ disabled: !state.canSubmit,
26471
+ "aria-label": state.sendLabel,
26472
+ title: state.sendLabel,
26473
+ className: "flex size-[30px] shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground transition-colors hover:opacity-90 disabled:cursor-default disabled:bg-border disabled:text-muted-foreground disabled:hover:opacity-100",
26474
+ children: state.phase === "submitting" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ArrowUp, { className: "size-3.5", strokeWidth: 2.2, "aria-hidden": "true" })
26475
+ }
26476
+ )
26477
+ ] })
26478
+ ] })
26479
+ ]
26480
+ }
26481
+ );
26482
+ }
26483
+ function StreamingTrace() {
26484
+ return /* @__PURE__ */ jsx(
26485
+ "svg",
26486
+ {
26487
+ className: "pointer-events-none absolute -inset-px z-10 h-[calc(100%+2px)] w-[calc(100%+2px)]",
26488
+ fill: "none",
26489
+ role: "presentation",
26490
+ children: /* @__PURE__ */ jsx(
26491
+ "rect",
26492
+ {
26493
+ x: "0.75",
26494
+ y: "0.75",
26495
+ width: "calc(100% - 1.5px)",
26496
+ height: "calc(100% - 1.5px)",
26497
+ stroke: "var(--primary)",
26498
+ strokeOpacity: "0.6",
26499
+ strokeWidth: "1.5",
26500
+ strokeLinecap: "round",
26501
+ pathLength: "100",
26502
+ strokeDasharray: "15 85",
26503
+ className: "animate-[border-trace_2s_linear_infinite] [rx:calc(var(--radius-xl)-0.75px)]"
26504
+ }
26505
+ )
26506
+ }
26507
+ );
26508
+ }
26509
+ function AttachButton({ disabled, onFiles }) {
26510
+ const inputRef = useRef(null);
26511
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26512
+ /* @__PURE__ */ jsx(
26513
+ "input",
26514
+ {
26515
+ ref: inputRef,
26516
+ type: "file",
26517
+ multiple: true,
26518
+ className: "hidden",
26519
+ onChange: (event) => {
26520
+ const files = Array.from(event.currentTarget.files ?? []);
26521
+ if (files.length > 0) void onFiles(files);
26522
+ event.currentTarget.value = "";
26523
+ }
26524
+ }
26525
+ ),
26526
+ /* @__PURE__ */ jsx(
26527
+ "button",
26528
+ {
26529
+ type: "button",
26530
+ onClick: () => inputRef.current?.click(),
26531
+ disabled,
26532
+ "aria-label": "Attach files",
26533
+ title: "Attach files",
26534
+ className: "flex size-[30px] shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",
26535
+ children: /* @__PURE__ */ jsx(Paperclip, { className: "size-[15px]", "aria-hidden": "true" })
26536
+ }
26537
+ )
26538
+ ] });
26539
+ }
26540
+ function WebSearchChip({
26541
+ enabled,
26542
+ disabled,
26543
+ onToggle
26544
+ }) {
26545
+ return /* @__PURE__ */ jsxs(
26546
+ "button",
26547
+ {
26548
+ type: "button",
26549
+ role: "switch",
26550
+ "aria-checked": enabled,
26551
+ disabled,
26552
+ onClick: () => onToggle(!enabled),
26553
+ title: enabled ? "Web search on" : "Web search off",
26554
+ className: cn$2(
26555
+ "flex h-[30px] shrink-0 items-center gap-1.5 rounded-full border pr-2.5 pl-2 text-xs font-medium transition-colors disabled:opacity-50",
26556
+ enabled ? "border-primary bg-(--agent-chat-accent-soft) text-(--agent-chat-accent-ink)" : "border-border text-muted-foreground hover:bg-muted"
26557
+ ),
26558
+ children: [
26559
+ /* @__PURE__ */ jsx(Globe, { className: "size-[13px]", "aria-hidden": "true" }),
26560
+ "Web"
26561
+ ]
26562
+ }
26563
+ );
26564
+ }
26565
+ function PendingFileChip({ file, onRemove }) {
26566
+ return /* @__PURE__ */ jsxs(
26567
+ "span",
26568
+ {
26569
+ className: cn$2(
26570
+ "inline-flex items-center gap-1.5 rounded-md border py-1 pr-1 pl-1 text-[11.5px] animate-[agent-chat-in_.15s]",
26571
+ file.status === "failed" ? "border-destructive/40 bg-destructive/10 text-destructive" : "border-border"
26572
+ ),
26573
+ children: [
26574
+ /* @__PURE__ */ jsx("span", { className: "flex size-[18px] items-center justify-center rounded bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx(File, { className: "size-3", "aria-hidden": "true" }) }),
26575
+ /* @__PURE__ */ jsx("span", { className: "max-w-40 truncate", children: file.name }),
26576
+ file.status === "uploading" && /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 animate-spin", "aria-hidden": "true" }),
26577
+ onRemove && /* @__PURE__ */ jsx(
26578
+ "button",
26579
+ {
26580
+ type: "button",
26581
+ onClick: () => onRemove(file.id),
26582
+ "aria-label": `Remove ${file.name}`,
26583
+ className: "flex size-4 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground",
26584
+ children: /* @__PURE__ */ jsx(X$2, { className: "size-2.5", "aria-hidden": "true" })
26585
+ }
26586
+ )
26587
+ ]
26588
+ }
26589
+ );
26590
+ }
26591
+ function AgentChatEmptyState({ name: name2, description, suggestions, onPick }) {
26592
+ const prompts = onPick ? suggestions ?? [] : [];
26593
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-64 flex-1 flex-col items-center justify-center gap-3 overflow-hidden px-5 py-6 text-center", children: [
26594
+ /* @__PURE__ */ jsx(
26595
+ "div",
26596
+ {
26597
+ "aria-hidden": "true",
26598
+ className: "pointer-events-none absolute inset-x-0 top-0 h-[260px] bg-[radial-gradient(120%_90%_at_50%_0%,var(--agent-chat-accent-soft)_0%,transparent_70%)]"
26599
+ }
26600
+ ),
26601
+ /* @__PURE__ */ jsx("div", { className: "relative flex size-[52px] items-center justify-center rounded-full bg-primary text-primary-foreground shadow-[0_8px_20px_color-mix(in_oklab,var(--primary)_35%,transparent)]", children: /* @__PURE__ */ jsx(Bot, { className: "size-6", "aria-hidden": "true" }) }),
26602
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
26603
+ /* @__PURE__ */ jsx("p", { title: name2, className: "line-clamp-2 max-w-full break-words text-[17px] font-semibold", children: name2 }),
26604
+ description && /* @__PURE__ */ jsx(
26605
+ "p",
26606
+ {
26607
+ title: description,
26608
+ className: "mx-auto mt-1 line-clamp-3 max-w-[280px] text-pretty text-[12.5px] leading-normal text-muted-foreground",
26609
+ children: description
26610
+ }
26611
+ )
26612
+ ] }),
26613
+ prompts.length > 0 && /* @__PURE__ */ jsx("div", { className: "relative mt-1.5 flex w-full max-w-[300px] flex-col gap-1.5", children: prompts.map((prompt) => /* @__PURE__ */ jsxs(
26614
+ "button",
26615
+ {
26616
+ type: "button",
26617
+ onClick: () => onPick?.(prompt),
26618
+ className: "flex items-center gap-2.5 rounded-lg border border-border bg-background px-3 py-[9px] text-left text-[12.5px] text-foreground transition-colors hover:bg-muted",
26619
+ children: [
26620
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-primary" }),
26621
+ prompt
26622
+ ]
26623
+ },
26624
+ prompt
26625
+ )) })
26626
+ ] });
26627
+ }
26628
+ function AgentChatHeader({
26629
+ name: name2,
26630
+ description,
26631
+ avatarUrl,
26632
+ isWorking,
26633
+ onNewChat,
26634
+ isCompacting,
26635
+ labels,
26636
+ headerLeft,
26637
+ headerRight
26638
+ }) {
26639
+ const activityLabel = isCompacting ? labels.compacting : isWorking ? labels.active : labels.idle;
26640
+ const subtitle = description ? `${description} · ${activityLabel}` : activityLabel;
26641
+ return /* @__PURE__ */ jsxs("header", { className: "relative z-10 flex shrink-0 items-center gap-2.5 border-b border-border bg-background px-3.5 py-3", children: [
26642
+ headerLeft,
26643
+ /* @__PURE__ */ jsxs("div", { className: "relative flex size-8 shrink-0 items-center justify-center rounded-lg bg-(--agent-chat-accent-soft) text-primary", children: [
26644
+ avatarUrl ? /* @__PURE__ */ jsx("img", { src: avatarUrl, alt: "", className: "size-8 rounded-lg object-cover" }) : /* @__PURE__ */ jsx(Bot, { className: "size-4", "aria-hidden": "true" }),
26645
+ /* @__PURE__ */ jsx(
26646
+ "span",
26647
+ {
26648
+ "aria-hidden": "true",
26649
+ className: cn$2(
26650
+ // 7px dot with a 2px ring outside it, 11px overall (the design's 13px read too big).
26651
+ "absolute -right-0.5 -bottom-0.5 box-content size-[7px] rounded-full border-2 border-background transition-colors duration-300",
26652
+ isWorking ? "bg-(--status-success-foreground)" : "bg-muted-foreground",
26653
+ isWorking && "animate-[agent-chat-pulse_1s_ease-in-out_infinite]"
26654
+ )
26655
+ }
26656
+ )
26657
+ ] }),
26658
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
26659
+ /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-semibold leading-tight", children: name2 }),
26660
+ /* @__PURE__ */ jsxs("div", { className: "mt-0.5 truncate text-[11.5px] text-muted-foreground", children: [
26661
+ subtitle,
26662
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: isWorking ? " Working" : "" })
26663
+ ] })
26664
+ ] }),
26665
+ onNewChat && /* @__PURE__ */ jsxs(HeaderButton, { onClick: onNewChat, title: "Start a new chat", children: [
26666
+ /* @__PURE__ */ jsx(Plus, { className: "size-[13px]", "aria-hidden": "true" }),
26667
+ labels.newChat
26668
+ ] }),
26669
+ headerRight
26670
+ ] });
26671
+ }
26672
+ function HeaderButton({
26673
+ children: children2,
26674
+ ...props
26675
+ }) {
26676
+ return /* @__PURE__ */ jsx(
26677
+ "button",
26678
+ {
26679
+ type: "button",
26680
+ ...props,
26681
+ className: "flex h-7 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-border px-2.5 text-xs text-foreground transition-colors hover:bg-muted disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent",
26682
+ children: children2
26683
+ }
26684
+ );
26685
+ }
26686
+ function AgentChatToast({ text: text2 }) {
26687
+ if (!text2) return null;
26688
+ return /* @__PURE__ */ jsx(
26689
+ "div",
26690
+ {
26691
+ role: "status",
26692
+ className: "absolute top-[68px] left-1/2 z-30 -translate-x-1/2 whitespace-nowrap rounded-full bg-foreground px-3 py-[7px] text-xs text-background shadow-[0_6px_20px_rgba(0,0,0,.18)] animate-[agent-chat-in_.18s_ease-out]",
26693
+ children: text2
26694
+ }
26695
+ );
26696
+ }
26316
26697
  function hasWindow() {
26317
26698
  return typeof window !== "undefined";
26318
26699
  }
@@ -27461,7 +27842,7 @@ function heading(Tag) {
27461
27842
  Component,
27462
27843
  {
27463
27844
  ...props,
27464
- className: cn$2("mb-1 mt-3 text-[13px] font-semibold text-foreground first:mt-0", className)
27845
+ className: cn$2("mb-1 mt-3 text-sm font-semibold text-foreground first:mt-0", className)
27465
27846
  }
27466
27847
  );
27467
27848
  };
@@ -27496,7 +27877,7 @@ function AgentChatMarkdown({ children: children2, isStreaming, variant = "prose"
27496
27877
  Qs,
27497
27878
  {
27498
27879
  animated: isStreaming,
27499
- className: cn$2("max-w-none text-[13px] leading-relaxed text-foreground", className),
27880
+ className: cn$2("max-w-none text-sm leading-[1.55] text-foreground", className),
27500
27881
  components: chatMarkdownComponents,
27501
27882
  isAnimating: isStreaming,
27502
27883
  mode: isStreaming ? "streaming" : "static",
@@ -27518,6 +27899,620 @@ function AgentChatMarkdown({ children: children2, isStreaming, variant = "prose"
27518
27899
  }
27519
27900
  );
27520
27901
  }
27902
+ function ReasoningLine({ blocks, isStreaming = false, label }) {
27903
+ const [open2, setOpen] = useState(false);
27904
+ const content2 = blocks.map((block) => block.content).join("\n\n");
27905
+ const text2 = label ?? reasoningLabel(thinkingDurationSeconds(blocks), isStreaming);
27906
+ const expandable = content2.trim().length > 0;
27907
+ return /* @__PURE__ */ jsxs("div", { children: [
27908
+ /* @__PURE__ */ jsxs(
27909
+ "button",
27910
+ {
27911
+ type: "button",
27912
+ onClick: () => expandable && setOpen((value) => !value),
27913
+ disabled: !expandable,
27914
+ "aria-expanded": expandable ? open2 : void 0,
27915
+ className: cn$2(
27916
+ "flex items-center gap-1.5 text-xs text-muted-foreground transition-colors",
27917
+ expandable ? "hover:text-foreground" : "cursor-default"
27918
+ ),
27919
+ children: [
27920
+ /* @__PURE__ */ jsx(Brain, { className: cn$2("size-3 shrink-0", isStreaming && "animate-pulse"), "aria-hidden": "true" }),
27921
+ /* @__PURE__ */ jsx("span", { children: text2 }),
27922
+ expandable && /* @__PURE__ */ jsx(
27923
+ ChevronDown,
27924
+ {
27925
+ className: cn$2("size-3 shrink-0 opacity-60 transition-transform", open2 && "rotate-180"),
27926
+ "aria-hidden": "true"
27927
+ }
27928
+ )
27929
+ ]
27930
+ }
27931
+ ),
27932
+ open2 && expandable && /* @__PURE__ */ jsx("div", { className: "mt-1.5 border-l-2 border-primary/20 pl-3", children: /* @__PURE__ */ jsx(AgentChatMarkdown, { variant: "chat", isStreaming, className: "text-xs text-muted-foreground", children: content2 }) })
27933
+ ] });
27934
+ }
27935
+ function DefaultContentBlock({ block, isStreaming }) {
27936
+ switch (block.type) {
27937
+ case "text":
27938
+ return /* @__PURE__ */ jsx(
27939
+ AgentChatMarkdown,
27940
+ {
27941
+ variant: "chat",
27942
+ isStreaming,
27943
+ className: cn$2(isStreaming && "agent-chat-streaming"),
27944
+ children: block.content
27945
+ }
27946
+ );
27947
+ case "thinking":
27948
+ return /* @__PURE__ */ jsx(ReasoningLine, { blocks: [block], isStreaming });
27949
+ case "tool_call":
27950
+ return /* @__PURE__ */ jsx(ToolCallCard, { toolCall: block.toolCall });
27951
+ case "action":
27952
+ return /* @__PURE__ */ jsx(ActionChip, { action: block.action });
27953
+ case "file":
27954
+ return /* @__PURE__ */ jsx(ArtifactCard, { file: block.file });
27955
+ case "info":
27956
+ return /* @__PURE__ */ jsx(InfoLine, { content: block.content, tone: block.tone });
27957
+ case "compaction_summary":
27958
+ return /* @__PURE__ */ jsx(InfoLine, { content: "Earlier context was summarized." });
27959
+ case "custom":
27960
+ return null;
27961
+ }
27962
+ }
27963
+ function ActionChip({ action }) {
27964
+ const className = cn$2(
27965
+ "inline-flex items-center gap-1.5 rounded-full border border-border px-2.5 py-[5px] text-xs text-foreground transition-colors hover:bg-muted",
27966
+ action.status === "error" && "text-(--agent-chat-accent-ink)"
27967
+ );
27968
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [
27969
+ /* @__PURE__ */ jsx(OperationIcon, { status: action.status }),
27970
+ /* @__PURE__ */ jsx("span", { children: action.label }),
27971
+ action.error && /* @__PURE__ */ jsx("span", { className: "text-(--agent-chat-accent-ink)", children: action.error }),
27972
+ action.href && /* @__PURE__ */ jsx(ExternalLink, { className: "size-2.5", "aria-hidden": "true" })
27973
+ ] });
27974
+ return /* @__PURE__ */ jsx("div", { className: "flex gap-1.5", children: action.href ? /* @__PURE__ */ jsx("a", { href: action.href, target: "_blank", rel: "noopener noreferrer", className, children: body }) : /* @__PURE__ */ jsx("span", { className, children: body }) });
27975
+ }
27976
+ function OperationIcon({ status }) {
27977
+ if (status === "running") return /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 animate-spin text-primary", "aria-hidden": "true" });
27978
+ if (status === "error") return /* @__PURE__ */ jsx(CircleX, { className: "size-3", "aria-hidden": "true" });
27979
+ return /* @__PURE__ */ jsx(CircleCheck, { className: "size-3 text-primary", "aria-hidden": "true" });
27980
+ }
27981
+ function InfoLine({ content: content2, tone }) {
27982
+ return /* @__PURE__ */ jsxs(
27983
+ "div",
27984
+ {
27985
+ className: cn$2(
27986
+ "flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-xs",
27987
+ tone === "error" ? "bg-(--agent-chat-accent-soft) text-(--agent-chat-accent-ink)" : tone === "success" ? "bg-(--status-success-bg) text-(--status-success-foreground)" : tone === "warning" ? "bg-(--status-warning-bg) text-(--status-warning-foreground)" : "bg-muted text-muted-foreground"
27988
+ ),
27989
+ children: [
27990
+ /* @__PURE__ */ jsx(Info$1, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
27991
+ /* @__PURE__ */ jsx("span", { children: content2 })
27992
+ ]
27993
+ }
27994
+ );
27995
+ }
27996
+ function ToolStepsCard({ toolCalls, preparingTool, isStreaming = false, settled = false }) {
27997
+ const [userOpen, setUserOpen] = useState(null);
27998
+ const [collections, setCollections] = useState(() => getCollectionMap());
27999
+ const overrides = useToolRenderers();
28000
+ useEffect(() => subscribeCollectionMap(setCollections), []);
28001
+ const labels = useMemo(
28002
+ () => toolCalls.map((toolCall) => {
28003
+ const safe = toolCall.input == null ? { ...toolCall, input: {} } : toolCall;
28004
+ try {
28005
+ return splitStepLabel(findRenderer(safe, overrides).summary(safe, collections));
28006
+ } catch {
28007
+ return { label: safe.name };
28008
+ }
28009
+ }),
28010
+ [collections, overrides, toolCalls]
28011
+ );
28012
+ const running = !settled && (Boolean(preparingTool) || toolCalls.some((tc) => tc.status === "running") || isStreaming);
28013
+ const failed = toolCalls.some((tc) => tc.status === "error" && !isExploratoryToolCallError(tc));
28014
+ const stepCount = toolCalls.length + (preparingTool ? 1 : 0);
28015
+ const expanded = userOpen ?? running;
28016
+ const title = running ? "Working…" : toolCardTitle(labels);
28017
+ return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-lg border border-border text-[12.5px]", children: [
28018
+ /* @__PURE__ */ jsxs(
28019
+ "button",
28020
+ {
28021
+ type: "button",
28022
+ onClick: () => setUserOpen(!expanded),
28023
+ "aria-expanded": expanded,
28024
+ className: "flex w-full items-center gap-2 bg-muted px-2.5 py-2 text-left text-foreground",
28025
+ children: [
28026
+ /* @__PURE__ */ jsx(StatusIcon, { running, failed }),
28027
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: title }),
28028
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: stepCountLabel(stepCount) }),
28029
+ /* @__PURE__ */ jsx(
28030
+ ChevronDown,
28031
+ {
28032
+ className: cn$2("size-2.5 shrink-0 text-muted-foreground transition-transform", expanded && "rotate-180"),
28033
+ "aria-hidden": "true"
28034
+ }
28035
+ )
28036
+ ]
28037
+ }
28038
+ ),
28039
+ expanded && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5 border-t border-border py-2 pr-2.5 pl-3.5 text-muted-foreground", children: [
28040
+ toolCalls.map((toolCall, index2) => /* @__PURE__ */ jsx(
28041
+ ToolCallCard,
28042
+ {
28043
+ toolCall: settled && toolCall.status === "running" ? { ...toolCall, status: "completed" } : toolCall,
28044
+ label: labels[index2]
28045
+ },
28046
+ toolCall.id
28047
+ )),
28048
+ preparingTool && /* @__PURE__ */ jsx(PreparingStep, { tool: preparingTool })
28049
+ ] })
28050
+ ] });
28051
+ }
28052
+ function StatusIcon({ running, failed }) {
28053
+ if (running) {
28054
+ return /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 shrink-0 animate-spin text-muted-foreground", "aria-hidden": "true" });
28055
+ }
28056
+ return /* @__PURE__ */ jsx(
28057
+ "span",
28058
+ {
28059
+ "aria-hidden": "true",
28060
+ className: cn$2(
28061
+ "flex size-4 shrink-0 items-center justify-center rounded-full text-primary-foreground",
28062
+ failed ? "bg-(--agent-chat-accent-ink)" : "bg-primary"
28063
+ ),
28064
+ children: failed ? /* @__PURE__ */ jsx(X$2, { className: "size-2.5", strokeWidth: 3 }) : /* @__PURE__ */ jsx(Check, { className: "size-2.5", strokeWidth: 3 })
28065
+ }
28066
+ );
28067
+ }
28068
+ function PreparingStep({ tool }) {
28069
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
28070
+ /* @__PURE__ */ jsx(
28071
+ "span",
28072
+ {
28073
+ "aria-hidden": "true",
28074
+ className: "relative -top-px size-[5px] shrink-0 rounded-full bg-primary animate-[agent-chat-pulse_1s_ease-in-out_infinite]"
28075
+ }
28076
+ ),
28077
+ /* @__PURE__ */ jsxs("span", { className: "flex-1", children: [
28078
+ "Preparing ",
28079
+ tool,
28080
+ "…"
28081
+ ] })
28082
+ ] });
28083
+ }
28084
+ function ErrorBlock({
28085
+ message,
28086
+ retryLabel,
28087
+ onRetry
28088
+ }) {
28089
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5 rounded-lg border border-[color-mix(in_oklab,var(--primary)_40%,transparent)] bg-(--agent-chat-accent-soft) px-[11px] py-[9px] text-[12.5px] text-(--agent-chat-accent-ink)", children: [
28090
+ /* @__PURE__ */ jsx(CircleAlert, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
28091
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 [overflow-wrap:anywhere]", children: message }),
28092
+ onRetry && /* @__PURE__ */ jsx(RetryLink, { label: retryLabel, onClick: onRetry })
28093
+ ] });
28094
+ }
28095
+ function WorkingLine({ label }) {
28096
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-[12.5px] text-muted-foreground", children: [
28097
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin", "aria-hidden": "true" }),
28098
+ /* @__PURE__ */ jsx("span", { children: label })
28099
+ ] });
28100
+ }
28101
+ function RetryLink({ label, onClick }) {
28102
+ return /* @__PURE__ */ jsx(
28103
+ "button",
28104
+ {
28105
+ type: "button",
28106
+ onClick,
28107
+ className: "shrink-0 font-semibold underline underline-offset-2 transition-opacity hover:opacity-80",
28108
+ children: label
28109
+ }
28110
+ );
28111
+ }
28112
+ function AssistantTurn({ turn, isStreaming, toolDetails, ContentBlock: ContentBlock2 }) {
28113
+ const segments = useMemo(() => segmentTurn(turn.assistants, toolDetails !== false), [turn.assistants, toolDetails]);
28114
+ const settled = !isActive(turn.user?.status);
28115
+ const Block = ContentBlock2 ?? DefaultContentBlock;
28116
+ if (segments.length === 0) return null;
28117
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 animate-[agent-chat-in_.18s_ease-out]", children: segments.map((segment, index2) => {
28118
+ const isTail = index2 === segments.length - 1;
28119
+ if (segment.kind === "activity") {
28120
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
28121
+ segment.thinking.length > 0 && /* @__PURE__ */ jsx(
28122
+ ReasoningLine,
28123
+ {
28124
+ blocks: segment.thinking,
28125
+ isStreaming: isStreaming && isTail && segment.toolCalls.length === 0 && !segment.preparingTool
28126
+ }
28127
+ ),
28128
+ (segment.toolCalls.length > 0 || segment.preparingTool) && /* @__PURE__ */ jsx(
28129
+ ToolStepsCard,
28130
+ {
28131
+ toolCalls: segment.toolCalls,
28132
+ preparingTool: segment.preparingTool,
28133
+ isStreaming: isStreaming && isTail,
28134
+ settled
28135
+ }
28136
+ )
28137
+ ] }, segment.key);
28138
+ }
28139
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 text-sm leading-[1.55]", children: segment.entries.map((entry, entryIndex) => /* @__PURE__ */ jsx(
28140
+ Block,
28141
+ {
28142
+ block: entry.block,
28143
+ message: entry.message,
28144
+ isStreaming: isStreaming && isTail && entryIndex === segment.entries.length - 1
28145
+ },
28146
+ entry.key
28147
+ )) }, segment.key);
28148
+ }) });
28149
+ }
28150
+ function turnOutcome(status, hasOutput, isCompacting) {
28151
+ if (isActive(status)) return isCompacting ? "compacting" : hasOutput ? null : "working";
28152
+ return status === "failed" || status === "interrupted" ? "failed" : null;
28153
+ }
28154
+ function turnHasOutput(turn, toolDetails, perMessage = false) {
28155
+ if (perMessage)
28156
+ return turn.assistants.some((message) => Boolean(message.content) || (message.blocks?.length ?? 0) > 0);
28157
+ return segmentTurn(turn.assistants, toolDetails !== false).length > 0;
28158
+ }
28159
+ function TurnOutcome({
28160
+ kind,
28161
+ turn,
28162
+ labels,
28163
+ onRetry
28164
+ }) {
28165
+ if (kind === "compacting") return /* @__PURE__ */ jsx(WorkingLine, { label: labels.compacting });
28166
+ if (kind === "working") return /* @__PURE__ */ jsx(WorkingLine, { label: labels.working });
28167
+ const status = turn.user?.status;
28168
+ const retry = onRetry && turn.requestId ? () => onRetry(turn.requestId) : void 0;
28169
+ return /* @__PURE__ */ jsx(
28170
+ ErrorBlock,
28171
+ {
28172
+ message: turn.user?.error || (status === "interrupted" ? labels.interrupted : labels.error),
28173
+ retryLabel: labels.retry,
28174
+ onRetry: retry
28175
+ }
28176
+ );
28177
+ }
28178
+ function isActive(status) {
28179
+ return status === "queued" || status === "claimed" || status === "preparing" || status === "submitting" || status === "running";
28180
+ }
28181
+ function segmentTurn(messages, includeActivity) {
28182
+ const segments = [];
28183
+ for (const message of messages) {
28184
+ normalizedBlocks$1(message).forEach((block, index2) => {
28185
+ const last = segments[segments.length - 1];
28186
+ if (isActivityBlock(block)) {
28187
+ if (!includeActivity) return;
28188
+ const segment2 = last?.kind === "activity" ? last : pushSegment(segments, {
28189
+ kind: "activity",
28190
+ key: `activity:${message.id}:${segments.length}`,
28191
+ thinking: [],
28192
+ toolCalls: [],
28193
+ preparingTool: null
28194
+ });
28195
+ if (block.type === "thinking") segment2.thinking.push(block);
28196
+ else if (block.type === "tool_call") segment2.toolCalls.push(block.toolCall);
28197
+ else if (block.type === "custom") segment2.preparingTool = preparingToolName(block.payload);
28198
+ return;
28199
+ }
28200
+ const segment = last?.kind === "content" ? last : pushSegment(segments, {
28201
+ kind: "content",
28202
+ key: `content:${message.id}:${segments.length}`,
28203
+ entries: []
28204
+ });
28205
+ segment.entries.push({ message, block, key: `${message.id}:${blockKey$1(block, index2)}` });
28206
+ });
28207
+ }
28208
+ return segments;
28209
+ }
28210
+ function pushSegment(segments, segment) {
28211
+ segments.push(segment);
28212
+ return segment;
28213
+ }
28214
+ function preparingToolName(payload) {
28215
+ const tool = payload?.tool;
28216
+ return typeof tool === "string" && tool ? tool : "tool";
28217
+ }
28218
+ function normalizedBlocks$1(message) {
28219
+ if (message.blocks && message.blocks.length > 0) return message.blocks;
28220
+ return message.content ? [{ type: "text", content: message.content }] : [];
28221
+ }
28222
+ function blockKey$1(block, index2) {
28223
+ if (block.type === "tool_call") return `tool:${block.toolCall.id}`;
28224
+ if (block.type === "action") return `action:${block.action.id}`;
28225
+ if (block.type === "file") return `file:${block.file.id ?? block.file.url ?? block.file.name}:${index2}`;
28226
+ if (block.type === "custom") return `custom:${block.kind}:${index2}`;
28227
+ return `${block.type}:${index2}`;
28228
+ }
28229
+ function AssistantMessage({
28230
+ message,
28231
+ isStreaming,
28232
+ ContentBlock: ContentBlock2
28233
+ }) {
28234
+ const blocks = normalizedBlocks$1(message);
28235
+ const Block = ContentBlock2 ?? DefaultContentBlock;
28236
+ return /* @__PURE__ */ jsx("div", { className: cn$2("flex flex-col gap-2 text-sm leading-[1.55]"), children: blocks.map((block, index2) => /* @__PURE__ */ jsx(
28237
+ Block,
28238
+ {
28239
+ block,
28240
+ message,
28241
+ isStreaming: isStreaming && index2 === blocks.length - 1
28242
+ },
28243
+ blockKey$1(block, index2)
28244
+ )) });
28245
+ }
28246
+ const NEAR_BOTTOM_PX = 80;
28247
+ function useStickToBottom(ref, signal) {
28248
+ const stuckRef = useRef(true);
28249
+ const onScroll = useCallback(() => {
28250
+ const el = ref.current;
28251
+ if (!el) return;
28252
+ stuckRef.current = el.scrollHeight - el.scrollTop - el.clientHeight < NEAR_BOTTOM_PX;
28253
+ }, [ref]);
28254
+ useEffect(() => {
28255
+ if (!stuckRef.current) return;
28256
+ const el = ref.current;
28257
+ if (!el) return;
28258
+ const frame = window.requestAnimationFrame(() => {
28259
+ el.scrollTop = el.scrollHeight;
28260
+ });
28261
+ return () => window.cancelAnimationFrame(frame);
28262
+ }, [ref, signal]);
28263
+ return onScroll;
28264
+ }
28265
+ const ACTIVE = /* @__PURE__ */ new Set(["queued", "claimed", "preparing", "submitting", "running"]);
28266
+ function SystemMarker({ message }) {
28267
+ const summary = message.blocks?.find((block) => block.type === "compaction_summary");
28268
+ const active = message.status ? ACTIVE.has(message.status) : false;
28269
+ const failed = message.status === "failed" || message.status === "interrupted" || message.status === "aborted";
28270
+ const label = summary ? "Compacted · earlier messages summarized" : message.content;
28271
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 animate-[agent-chat-fade_.3s]", children: [
28272
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2.5 text-[11px] text-muted-foreground", children: [
28273
+ /* @__PURE__ */ jsx(Hairline, {}),
28274
+ /* @__PURE__ */ jsxs("span", { className: cn$2("flex min-w-0 items-center gap-1.5", failed && "text-(--agent-chat-accent-ink)"), children: [
28275
+ active ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-[11px] shrink-0 animate-spin", "aria-hidden": "true" }) : failed ? /* @__PURE__ */ jsx(CircleAlert, { className: "size-[11px] shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ListCollapse, { className: "size-[11px] shrink-0", "aria-hidden": "true" }),
28276
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: label })
28277
+ ] }),
28278
+ /* @__PURE__ */ jsx(Hairline, {})
28279
+ ] }),
28280
+ summary?.type === "compaction_summary" && /* @__PURE__ */ jsx(CompactionRecap, { content: summary.content })
28281
+ ] });
28282
+ }
28283
+ function Hairline() {
28284
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "h-px flex-1 bg-border" });
28285
+ }
28286
+ function CompactionRecap({ content: content2 }) {
28287
+ const [open2, setOpen] = useState(false);
28288
+ return /* @__PURE__ */ jsxs("div", { className: "w-full max-w-[560px]", children: [
28289
+ /* @__PURE__ */ jsxs(
28290
+ "button",
28291
+ {
28292
+ type: "button",
28293
+ onClick: () => setOpen((value) => !value),
28294
+ "aria-expanded": open2,
28295
+ className: "mx-auto flex items-center gap-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground",
28296
+ children: [
28297
+ "View summary",
28298
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn$2("size-3 transition-transform", open2 && "rotate-180"), "aria-hidden": "true" })
28299
+ ]
28300
+ }
28301
+ ),
28302
+ open2 && /* @__PURE__ */ jsx("div", { className: "mt-2 max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/40 px-3.5 py-2.5 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx(AgentChatMarkdown, { variant: "chat", className: "text-xs text-muted-foreground", children: content2 }) })
28303
+ ] });
28304
+ }
28305
+ function UserMessage({ message, labels }) {
28306
+ return /* @__PURE__ */ jsxs("div", { className: "flex max-w-[80%] animate-[agent-chat-in_.18s_ease-out] flex-col items-end gap-1.5 self-end", children: [
28307
+ message.files?.map((file) => /* @__PURE__ */ jsx(AttachmentChip, { file }, file.id ?? file.name)),
28308
+ /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap rounded-xl rounded-br-[4px] bg-(--agent-chat-accent-soft) px-[13px] py-[9px] text-sm leading-[1.45] text-foreground [overflow-wrap:anywhere]", children: message.content }),
28309
+ message.status === "queued" && /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: labels.queue }),
28310
+ message.status === "aborted" && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-[11px] text-muted-foreground", children: [
28311
+ /* @__PURE__ */ jsx(CircleStop, { className: "size-3", "aria-hidden": "true" }),
28312
+ labels.stopped
28313
+ ] })
28314
+ ] });
28315
+ }
28316
+ function AttachmentChip({ file }) {
28317
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-border py-1.5 pr-2 pl-1.5 text-xs", children: [
28318
+ /* @__PURE__ */ jsx("span", { className: "flex size-[26px] items-center justify-center rounded-md bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx(File, { className: "size-3.5", "aria-hidden": "true" }) }),
28319
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
28320
+ /* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: file.name }),
28321
+ file.size ? /* @__PURE__ */ jsx("span", { className: "block text-[11px] text-muted-foreground", children: formatSize(file.size) }) : null
28322
+ ] })
28323
+ ] });
28324
+ }
28325
+ function formatSize(bytes) {
28326
+ if (bytes < 1024) return `${bytes} B`;
28327
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;
28328
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
28329
+ }
28330
+ function AgentChatTranscript({
28331
+ turns,
28332
+ isStreaming,
28333
+ isCompacting,
28334
+ isLoadingHistory,
28335
+ canLoadEarlier,
28336
+ isLoadingEarlier,
28337
+ onLoadEarlier,
28338
+ error: error2,
28339
+ onRetryHistory,
28340
+ onRetryTurn,
28341
+ toolDetails,
28342
+ labels,
28343
+ renderers,
28344
+ emptyState,
28345
+ children: children2
28346
+ }) {
28347
+ const viewportRef = useRef(null);
28348
+ const onScroll = useStickToBottom(viewportRef, turns);
28349
+ const hasTurns = turns.length > 0;
28350
+ const lastTurnId = turns[turns.length - 1]?.id;
28351
+ const LoadingState = renderers?.LoadingState ?? DefaultLoadingState;
28352
+ const ErrorState = renderers?.ErrorState ?? DefaultErrorState;
28353
+ const LoadEarlierButton = renderers?.LoadEarlierButton ?? DefaultLoadEarlierButton;
28354
+ const User = renderers?.UserMessage ?? UserMessage;
28355
+ const System = renderers?.SystemMessage ?? SystemMarker;
28356
+ const perMessageAssistant = Boolean(renderers?.AssistantMessage || renderers?.ContentBlock);
28357
+ return /* @__PURE__ */ jsxs(
28358
+ "div",
28359
+ {
28360
+ ref: viewportRef,
28361
+ onScroll,
28362
+ className: "flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain",
28363
+ children: [
28364
+ isLoadingHistory && !hasTurns ? /* @__PURE__ */ jsx(LoadingState, {}) : !hasTurns ? emptyState : /* @__PURE__ */ jsxs("div", { role: "log", "aria-live": "polite", className: "flex flex-col gap-[18px] px-4 py-[18px]", children: [
28365
+ canLoadEarlier && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(LoadEarlierButton, { loading: isLoadingEarlier, label: labels.loadEarlier, onClick: onLoadEarlier }) }),
28366
+ turns.map((turn) => /* @__PURE__ */ jsx(
28367
+ TurnView,
28368
+ {
28369
+ turn,
28370
+ isLast: turn.id === lastTurnId,
28371
+ isStreaming: isStreaming && turn.id === lastTurnId,
28372
+ isCompacting: Boolean(isCompacting) && turn.id === lastTurnId,
28373
+ perMessageAssistant,
28374
+ User,
28375
+ System,
28376
+ Assistant: renderers?.AssistantMessage,
28377
+ ContentBlock: renderers?.ContentBlock,
28378
+ toolDetails,
28379
+ labels,
28380
+ onRetryTurn
28381
+ },
28382
+ turn.id
28383
+ ))
28384
+ ] }),
28385
+ error2 ? /* @__PURE__ */ jsx("div", { className: "px-4 pb-4", children: /* @__PURE__ */ jsx(ErrorState, { error: error2, retry: onRetryHistory }) }) : null,
28386
+ children2
28387
+ ]
28388
+ }
28389
+ );
28390
+ }
28391
+ function TurnView({
28392
+ turn,
28393
+ isLast,
28394
+ isStreaming,
28395
+ isCompacting,
28396
+ perMessageAssistant,
28397
+ User,
28398
+ System,
28399
+ Assistant,
28400
+ ContentBlock: ContentBlock2,
28401
+ toolDetails,
28402
+ labels,
28403
+ onRetryTurn
28404
+ }) {
28405
+ const hasOutput = turnHasOutput(turn, toolDetails, perMessageAssistant);
28406
+ const outcome = turnOutcome(turn.user?.status, hasOutput, isCompacting);
28407
+ const outcomeNode = outcome && /* @__PURE__ */ jsx(TurnOutcome, { kind: outcome, turn, labels, onRetry: onRetryTurn });
28408
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[18px]", children: [
28409
+ turn.systems?.map((message, index2) => /* @__PURE__ */ jsx(
28410
+ System,
28411
+ {
28412
+ message,
28413
+ turn,
28414
+ isLast,
28415
+ isFirstInTurn: index2 === 0,
28416
+ isLastInTurn: index2 === (turn.systems?.length ?? 0) - 1,
28417
+ labels
28418
+ },
28419
+ message.id
28420
+ )),
28421
+ turn.user && /* @__PURE__ */ jsx(User, { message: turn.user, turn, isLast, isFirstInTurn: true, isLastInTurn: true, labels }),
28422
+ perMessageAssistant ? /* @__PURE__ */ jsxs(Fragment, { children: [
28423
+ turn.assistants.map((message, index2) => {
28424
+ const last = index2 === turn.assistants.length - 1;
28425
+ const props = {
28426
+ message,
28427
+ turn,
28428
+ isStreaming: isStreaming && last,
28429
+ isLast: isLast && last,
28430
+ isFirstInTurn: index2 === 0,
28431
+ isLastInTurn: last,
28432
+ labels
28433
+ };
28434
+ return Assistant ? /* @__PURE__ */ jsx(Assistant, { ...props }, message.id) : /* @__PURE__ */ jsx(
28435
+ AssistantMessage,
28436
+ {
28437
+ message,
28438
+ isStreaming: props.isStreaming,
28439
+ ContentBlock: ContentBlock2
28440
+ },
28441
+ message.id
28442
+ );
28443
+ }),
28444
+ outcomeNode
28445
+ ] }) : (hasOutput || outcome) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
28446
+ /* @__PURE__ */ jsx(
28447
+ AssistantTurn,
28448
+ {
28449
+ turn,
28450
+ isStreaming,
28451
+ toolDetails,
28452
+ ContentBlock: ContentBlock2
28453
+ }
28454
+ ),
28455
+ outcomeNode
28456
+ ] })
28457
+ ] });
28458
+ }
28459
+ function DefaultLoadingState() {
28460
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-h-64 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground", children: [
28461
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin", "aria-hidden": "true" }),
28462
+ "Loading conversation…"
28463
+ ] });
28464
+ }
28465
+ function DefaultErrorState({ error: error2, retry }) {
28466
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg border border-[color-mix(in_oklab,var(--primary)_40%,transparent)] bg-(--agent-chat-accent-soft) px-3 py-2 text-[12.5px] text-(--agent-chat-accent-ink)", children: [
28467
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
28468
+ /* @__PURE__ */ jsx(TriangleAlert, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
28469
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: error2 instanceof Error ? error2.message : String(error2) })
28470
+ ] }),
28471
+ retry && /* @__PURE__ */ jsx("button", { type: "button", className: "shrink-0 font-semibold underline underline-offset-2", onClick: retry, children: "Retry" })
28472
+ ] });
28473
+ }
28474
+ function DefaultLoadEarlierButton({
28475
+ loading,
28476
+ label,
28477
+ onClick
28478
+ }) {
28479
+ return /* @__PURE__ */ jsxs(
28480
+ "button",
28481
+ {
28482
+ type: "button",
28483
+ onClick,
28484
+ disabled: loading,
28485
+ className: "inline-flex items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted disabled:opacity-50",
28486
+ children: [
28487
+ loading && /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 animate-spin", "aria-hidden": "true" }),
28488
+ label
28489
+ ]
28490
+ }
28491
+ );
28492
+ }
28493
+ const TOAST_MS = 1800;
28494
+ function useTransientToast(durationMs = TOAST_MS) {
28495
+ const [toast, setToast] = useState(null);
28496
+ const timerRef = useRef(null);
28497
+ const show = useCallback(
28498
+ (text2) => {
28499
+ if (timerRef.current != null) window.clearTimeout(timerRef.current);
28500
+ setToast(text2);
28501
+ timerRef.current = window.setTimeout(() => {
28502
+ timerRef.current = null;
28503
+ setToast(null);
28504
+ }, durationMs);
28505
+ },
28506
+ [durationMs]
28507
+ );
28508
+ useEffect(
28509
+ () => () => {
28510
+ if (timerRef.current != null) window.clearTimeout(timerRef.current);
28511
+ },
28512
+ []
28513
+ );
28514
+ return { toast, show };
28515
+ }
27521
28516
  const DEFAULT_LABELS = {
27522
28517
  placeholder: "Ask the agent…",
27523
28518
  send: "Send",
@@ -27526,7 +28521,16 @@ const DEFAULT_LABELS = {
27526
28521
  retry: "Retry",
27527
28522
  loadEarlier: "Load earlier",
27528
28523
  emptyTitle: "Start a conversation",
27529
- emptyDescription: "Ask the agent to help with this workflow."
28524
+ emptyDescription: "Ask the agent to help with this workflow.",
28525
+ newChat: "New",
28526
+ active: "Active",
28527
+ idle: "Idle",
28528
+ compacting: "Compacting context…",
28529
+ hint: "⏎ to send",
28530
+ working: "Working…",
28531
+ stopped: "Stopped",
28532
+ interrupted: "The response was interrupted.",
28533
+ error: "Something went wrong."
27530
28534
  };
27531
28535
  function AgentChat({
27532
28536
  agentId,
@@ -27546,6 +28550,14 @@ function AgentChat({
27546
28550
  watchdogTimeoutMs,
27547
28551
  watchdogPollMs,
27548
28552
  discoveryPoll,
28553
+ suggestions,
28554
+ composerChips,
28555
+ onNewChat,
28556
+ headerLeft,
28557
+ headerRight,
28558
+ webSearchDefault,
28559
+ accent,
28560
+ accentForeground,
27549
28561
  className,
27550
28562
  labels: labelOverrides,
27551
28563
  features,
@@ -27555,6 +28567,15 @@ function AgentChat({
27555
28567
  onError,
27556
28568
  children: children2
27557
28569
  }) {
28570
+ const profile = useAgentProfile({
28571
+ agentId,
28572
+ agent,
28573
+ name: name2,
28574
+ description,
28575
+ loadAgent: transport.loadAgent,
28576
+ // The Web chip seeds from the agent's setting, so fetch the profile even when the host names the agent.
28577
+ needsWebSearchDefault: features?.webSearch === true && webSearchDefault === void 0
28578
+ });
27558
28579
  const chat = useAgentChat({
27559
28580
  agentId,
27560
28581
  sessionId,
@@ -27570,179 +28591,113 @@ function AgentChat({
27570
28591
  watchdogTimeoutMs,
27571
28592
  watchdogPollMs,
27572
28593
  discoveryPoll,
28594
+ webSearch: features?.webSearch,
28595
+ webSearchDefault: webSearchDefault ?? profile.webSearchEnabled,
27573
28596
  onMessagesChange,
27574
28597
  onTurnComplete,
27575
28598
  onError
27576
28599
  });
27577
- const labels = { ...DEFAULT_LABELS, ...labelOverrides };
27578
- const [loadedAgent, setLoadedAgent] = useState(agent);
27579
- const hasMessages = chat.messages.length > 0;
27580
- const lastTurnId = chat.turns[chat.turns.length - 1]?.id;
27581
- const scrollViewportRef = useRef(null);
27582
- const stickToBottomRef = useRef(true);
27583
- useEffect(() => {
27584
- setLoadedAgent(agent);
27585
- }, [agent]);
28600
+ const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides]);
28601
+ const { toast, show: showToast } = useTransientToast();
28602
+ const resize = useResizableWidth(features?.resizableWidth);
27586
28603
  useEffect(() => {
27587
28604
  warmCollectionCache();
27588
28605
  }, []);
27589
- useEffect(() => {
27590
- if (name2 && description || agent?.name && agent?.description || !transport.loadAgent) return;
27591
- let cancelled = false;
27592
- transport.loadAgent({ agentId }).then((profile) => {
27593
- if (!cancelled) setLoadedAgent((current) => ({ ...profile, ...current ?? {} }));
27594
- }).catch(() => {
27595
- });
27596
- return () => {
27597
- cancelled = true;
27598
- };
27599
- }, [agent?.description, agent?.name, agentId, description, name2, transport]);
27600
- useEffect(() => {
27601
- if (!stickToBottomRef.current) return;
27602
- const viewport = scrollViewportRef.current;
27603
- if (!viewport) return;
27604
- const frame = window.requestAnimationFrame(() => {
27605
- viewport.scrollTop = viewport.scrollHeight;
27606
- });
27607
- return () => window.cancelAnimationFrame(frame);
27608
- });
27609
- const displayName = name2 ?? agent?.name ?? loadedAgent?.name ?? "Agent chat";
27610
- const displayDescription = description ?? agent?.description ?? loadedAgent?.description;
27611
- const statusText = chat.phase === "streaming" ? "Streaming response…" : chat.phase === "submitting" ? "Submitting…" : chat.isWorking ? "Working…" : "Ready";
27612
- const appearance = features?.appearance ?? "card";
27613
- const resizeOptions = useMemo(() => normalizeResizableWidth(features?.resizableWidth), [features?.resizableWidth]);
28606
+ const hasMessages = chat.messages.length > 0;
27614
28607
  const attachmentsEnabled = Boolean(features?.attachments && transport.uploadFile);
27615
- const [width, setWidth] = useState(() => initialResizableWidth(resizeOptions));
27616
- useEffect(() => {
27617
- if (!resizeOptions.enabled || !resizeOptions.storageKey || typeof window === "undefined") return;
27618
- const stored = Number(window.localStorage.getItem(resizeOptions.storageKey));
27619
- if (Number.isFinite(stored) && stored > 0) setWidth(clampWidth(stored, resizeOptions));
27620
- }, [resizeOptions]);
27621
- const rootStyle = useMemo(() => {
27622
- if (!resizeOptions.enabled || !width) return void 0;
27623
- return { width, maxWidth: resizeOptions.maxWidth };
27624
- }, [resizeOptions.enabled, resizeOptions.maxWidth, width]);
27625
- const beginResize = (event) => {
27626
- if (!resizeOptions.enabled || !width) return;
27627
- event.preventDefault();
27628
- const startX = event.clientX;
27629
- const startWidth = width;
27630
- const direction = resizeOptions.edge === "left" ? -1 : 1;
27631
- const onMove = (moveEvent) => {
27632
- const delta = (moveEvent.clientX - startX) * direction;
27633
- const nextWidth = clampWidth(startWidth + delta, resizeOptions);
27634
- setWidth(nextWidth);
27635
- if (resizeOptions.storageKey && typeof window !== "undefined") {
27636
- window.localStorage.setItem(resizeOptions.storageKey, String(nextWidth));
27637
- }
27638
- };
27639
- const onUp = () => {
27640
- window.removeEventListener("pointermove", onMove);
27641
- window.removeEventListener("pointerup", onUp);
27642
- };
27643
- window.addEventListener("pointermove", onMove);
27644
- window.addEventListener("pointerup", onUp);
27645
- };
27646
- const EmptyState2 = renderers?.EmptyState ?? DefaultEmptyState;
27647
- const LoadingState = renderers?.LoadingState ?? DefaultLoadingState;
27648
- const ErrorState = renderers?.ErrorState ?? DefaultErrorState;
27649
- const LoadEarlierButton = renderers?.LoadEarlierButton ?? DefaultLoadEarlierButton;
27650
- const Composer2 = renderers?.Composer ?? DefaultComposer;
27651
- const Header = renderers?.Header ?? DefaultHeader;
28608
+ const queueWhileStreaming = features?.queueWhileStreaming !== false;
28609
+ const canSubmit = chat.canSubmit && (queueWhileStreaming || !chat.hasActive);
28610
+ const statusText = chat.isCompacting ? labels.compacting : chat.phase === "streaming" ? "Streaming response…" : chat.phase === "submitting" ? "Submitting…" : chat.isWorking ? "Working…" : "Ready";
28611
+ const send = useCallback(
28612
+ async (message) => {
28613
+ await chat.sendMessage(message);
28614
+ },
28615
+ [chat.sendMessage]
28616
+ );
28617
+ const stop = useCallback(async () => {
28618
+ await chat.abort();
28619
+ showToast(labels.stopped);
28620
+ }, [chat.abort, labels.stopped, showToast]);
28621
+ const retryTurn = useCallback(
28622
+ (requestId) => {
28623
+ void chat.retry(requestId);
28624
+ },
28625
+ [chat.retry]
28626
+ );
28627
+ const newChat = useCallback(() => {
28628
+ if (!onNewChat || !hasMessages) return;
28629
+ onNewChat();
28630
+ showToast("New chat started");
28631
+ }, [hasMessages, onNewChat, showToast]);
28632
+ const rootStyle = useMemo(
28633
+ () => ({
28634
+ ...resize.style,
28635
+ ...accent ? { "--primary": accent, "--ring": accent } : {},
28636
+ ...accentForeground ? { "--primary-foreground": accentForeground } : {}
28637
+ }),
28638
+ [accent, accentForeground, resize.style]
28639
+ );
28640
+ const Header = renderers?.Header ?? AgentChatHeader;
28641
+ const EmptyState2 = renderers?.EmptyState ?? AgentChatEmptyState;
28642
+ const Composer2 = renderers?.Composer ?? AgentChatComposer;
27652
28643
  return /* @__PURE__ */ jsx(ToolRenderersProvider, { renderers: renderers?.toolRenderers, children: /* @__PURE__ */ jsxs(
27653
28644
  "section",
27654
28645
  {
27655
28646
  className: cn$2(
27656
- "relative flex h-[720px] min-h-[360px] max-h-[calc(100vh-2rem)] flex-col overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-sm",
28647
+ // Fills a sized parent; in an unsized one it grows with the transcript to the viewport cap, then scrolls.
28648
+ "agent-chat relative flex h-full max-h-[calc(100vh-2rem)] min-h-[360px] flex-col overflow-hidden rounded-2xl border border-border bg-background text-sm text-foreground shadow-[0_10px_30px_rgba(20,18,12,.06)]",
27657
28649
  className
27658
28650
  ),
27659
28651
  style: rootStyle,
27660
28652
  children: [
27661
- resizeOptions.enabled && resizeOptions.edge === "left" && /* @__PURE__ */ jsx(ResizeHandle, { edge: "left", onPointerDown: beginResize }),
27662
- resizeOptions.enabled && resizeOptions.edge !== "left" && /* @__PURE__ */ jsx(ResizeHandle, { edge: "right", onPointerDown: beginResize }),
28653
+ resize.enabled && /* @__PURE__ */ jsx(ResizeHandle, { edge: resize.edge, onPointerDown: resize.begin }),
27663
28654
  features?.header !== false && /* @__PURE__ */ jsx(
27664
28655
  Header,
27665
28656
  {
27666
- name: displayName,
27667
- description: displayDescription,
28657
+ name: profile.name,
28658
+ description: profile.description,
28659
+ avatarUrl: profile.avatarUrl,
27668
28660
  statusText,
27669
28661
  phase: chat.phase,
27670
28662
  isWorking: chat.isWorking,
27671
28663
  canAbort: chat.canAbort,
27672
- tokenUsage: features?.tokenUsage ? chat.tokenUsage ?? void 0 : void 0
28664
+ tokenUsage: features?.tokenUsage ? chat.tokenUsage ?? void 0 : void 0,
28665
+ onNewChat: onNewChat && !chat.mutationsBlocked ? newChat : void 0,
28666
+ isCompacting: chat.isCompacting,
28667
+ labels,
28668
+ headerLeft,
28669
+ headerRight
27673
28670
  }
27674
28671
  ),
27675
- /* @__PURE__ */ jsxs(
27676
- "div",
28672
+ /* @__PURE__ */ jsx(
28673
+ AgentChatTranscript,
27677
28674
  {
27678
- ref: scrollViewportRef,
27679
- className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4",
27680
- onScroll: (event) => {
27681
- const viewport = event.currentTarget;
27682
- const distanceFromBottom = viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight;
27683
- stickToBottomRef.current = distanceFromBottom < 96;
27684
- },
27685
- children: [
27686
- features?.loadEarlier !== false && chat.canLoadEarlier && /* @__PURE__ */ jsx("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsx(LoadEarlierButton, { loading: chat.isLoadingEarlier, onClick: chat.loadEarlier }) }),
27687
- chat.isLoadingHistory && !hasMessages ? /* @__PURE__ */ jsx(LoadingState, {}) : !hasMessages ? /* @__PURE__ */ jsx(EmptyState2, {}) : /* @__PURE__ */ jsx("div", { className: "space-y-5", role: "log", "aria-live": "polite", children: chat.turns.map((turn) => {
27688
- const isLastTurn = turn.id === lastTurnId;
27689
- const groupAssistants = !renderers?.AssistantMessage && !renderers?.ContentBlock;
27690
- return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
27691
- turn.systems?.map((message, index2) => /* @__PURE__ */ jsx(
27692
- AgentChatMessage,
27693
- {
27694
- message,
27695
- turn,
27696
- renderers,
27697
- appearance,
27698
- isLast: isLastTurn,
27699
- isFirstInTurn: index2 === 0,
27700
- isLastInTurn: index2 === (turn.systems?.length ?? 0) - 1
27701
- },
27702
- message.id
27703
- )),
27704
- turn.user && /* @__PURE__ */ jsx(
27705
- AgentChatMessage,
27706
- {
27707
- message: turn.user,
27708
- turn,
27709
- renderers,
27710
- appearance,
27711
- isLast: isLastTurn,
27712
- isFirstInTurn: true,
27713
- isLastInTurn: true
27714
- }
27715
- ),
27716
- groupAssistants ? /* @__PURE__ */ jsx(
27717
- DefaultAssistantTurn,
27718
- {
27719
- messages: turn.assistants,
27720
- isStreaming: chat.isStreaming && isLastTurn,
27721
- toolDetails: features?.toolDetails,
27722
- appearance
27723
- }
27724
- ) : turn.assistants.map((message, index2) => /* @__PURE__ */ jsx(
27725
- AgentChatMessage,
27726
- {
27727
- message,
27728
- turn,
27729
- renderers,
27730
- appearance,
27731
- isStreaming: chat.isStreaming && isLastTurn && index2 === turn.assistants.length - 1,
27732
- isLast: isLastTurn && index2 === turn.assistants.length - 1,
27733
- isFirstInTurn: index2 === 0,
27734
- isLastInTurn: index2 === turn.assistants.length - 1
27735
- },
27736
- message.id
27737
- ))
27738
- ] }, turn.id);
27739
- }) }),
27740
- chat.error ? /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(ErrorState, { error: chat.error, retry: chat.loadHistory }) }) : null,
27741
- children2
27742
- ]
28675
+ turns: chat.turns,
28676
+ isStreaming: chat.isStreaming,
28677
+ isCompacting: chat.isCompacting,
28678
+ isLoadingHistory: chat.isLoadingHistory,
28679
+ canLoadEarlier: features?.loadEarlier !== false && chat.canLoadEarlier,
28680
+ isLoadingEarlier: chat.isLoadingEarlier,
28681
+ onLoadEarlier: chat.loadEarlier,
28682
+ error: chat.error,
28683
+ onRetryHistory: chat.loadHistory,
28684
+ onRetryTurn: chat.mutationsBlocked ? void 0 : retryTurn,
28685
+ toolDetails: features?.toolDetails,
28686
+ labels,
28687
+ renderers,
28688
+ emptyState: /* @__PURE__ */ jsx(
28689
+ EmptyState2,
28690
+ {
28691
+ name: profile.name,
28692
+ description: profile.description ?? labels.emptyDescription,
28693
+ suggestions,
28694
+ onPick: chat.mutationsBlocked ? void 0 : (prompt) => void send(prompt)
28695
+ }
28696
+ ),
28697
+ children: children2
27743
28698
  }
27744
28699
  ),
27745
- !chat.hideComposer ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(
28700
+ !chat.hideComposer && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(
27746
28701
  Composer2,
27747
28702
  {
27748
28703
  state: {
@@ -27751,26 +28706,61 @@ function AgentChat({
27751
28706
  disabled: chat.mutationsBlocked,
27752
28707
  phase: chat.phase,
27753
28708
  queueLength: chat.queueLength,
27754
- canSubmit: chat.canSubmit,
28709
+ canSubmit,
27755
28710
  canAbort: chat.canAbort,
27756
- placeholder: labels.placeholder
28711
+ inFlight: chat.isWorking,
28712
+ placeholder: chat.hasActive && queueWhileStreaming ? "Queue a follow-up…" : labels.placeholder,
28713
+ hint: labels.hint,
28714
+ sendLabel: labels.send,
28715
+ stopLabel: labels.stop,
28716
+ chips: composerChips,
28717
+ webSearchEnabled: chat.webSearchEnabled
27757
28718
  },
27758
28719
  actions: {
27759
28720
  setValue: chat.setInput,
27760
- submit: async () => {
27761
- await chat.sendMessage();
27762
- },
27763
- abort: chat.abort,
28721
+ submit: send,
28722
+ abort: stop,
27764
28723
  attachFiles: attachmentsEnabled ? chat.attachFiles : void 0,
27765
- removePendingFile: chat.removePendingFile
28724
+ removePendingFile: chat.removePendingFile,
28725
+ pickChip: (value) => void send(value),
28726
+ setWebSearchEnabled: chat.setWebSearchEnabled
27766
28727
  }
27767
28728
  }
27768
- ) }) : null
28729
+ ) }),
28730
+ /* @__PURE__ */ jsx(AgentChatToast, { text: toast })
27769
28731
  ]
27770
28732
  }
27771
28733
  ) });
27772
28734
  }
27773
- const DEFAULT_RESIZE_OPTIONS = {
28735
+ function useAgentProfile({
28736
+ agentId,
28737
+ agent,
28738
+ name: name2,
28739
+ description,
28740
+ loadAgent,
28741
+ needsWebSearchDefault
28742
+ }) {
28743
+ const [loaded, setLoaded] = useState(void 0);
28744
+ const complete = Boolean(name2 && description || agent?.name && agent?.description) && !(needsWebSearchDefault && agent?.webSearchEnabled === void 0);
28745
+ useEffect(() => {
28746
+ if (complete || !loadAgent) return;
28747
+ let cancelled = false;
28748
+ loadAgent({ agentId }).then((profile) => {
28749
+ if (!cancelled) setLoaded(profile);
28750
+ }).catch(() => {
28751
+ });
28752
+ return () => {
28753
+ cancelled = true;
28754
+ };
28755
+ }, [agentId, complete, loadAgent]);
28756
+ return {
28757
+ name: name2 ?? agent?.name ?? loaded?.name ?? "Agent chat",
28758
+ description: description ?? agent?.description ?? loaded?.description,
28759
+ avatarUrl: agent?.avatarUrl ?? loaded?.avatarUrl,
28760
+ webSearchEnabled: agent?.webSearchEnabled ?? loaded?.webSearchEnabled
28761
+ };
28762
+ }
28763
+ const DEFAULT_RESIZE = {
27774
28764
  enabled: false,
27775
28765
  defaultWidth: 420,
27776
28766
  minWidth: 320,
@@ -27778,19 +28768,50 @@ const DEFAULT_RESIZE_OPTIONS = {
27778
28768
  edge: "right"
27779
28769
  };
27780
28770
  function normalizeResizableWidth(value) {
27781
- if (!value) return DEFAULT_RESIZE_OPTIONS;
27782
- if (value === true) return { ...DEFAULT_RESIZE_OPTIONS, enabled: true };
27783
- return {
27784
- ...DEFAULT_RESIZE_OPTIONS,
27785
- ...value,
27786
- enabled: value.enabled ?? true
27787
- };
27788
- }
27789
- function initialResizableWidth(options) {
27790
- return options.enabled ? clampWidth(options.defaultWidth, options) : void 0;
27791
- }
27792
- function clampWidth(width, options) {
27793
- return Math.min(options.maxWidth, Math.max(options.minWidth, Math.round(width)));
28771
+ if (!value) return DEFAULT_RESIZE;
28772
+ if (value === true) return { ...DEFAULT_RESIZE, enabled: true };
28773
+ return { ...DEFAULT_RESIZE, ...value, enabled: value.enabled ?? true };
28774
+ }
28775
+ function useResizableWidth(value) {
28776
+ const options = useMemo(() => normalizeResizableWidth(value), [value]);
28777
+ const clamp2 = useCallback(
28778
+ (width2) => Math.min(options.maxWidth, Math.max(options.minWidth, Math.round(width2))),
28779
+ [options.maxWidth, options.minWidth]
28780
+ );
28781
+ const [width, setWidth] = useState(
28782
+ () => options.enabled ? clamp2(options.defaultWidth) : void 0
28783
+ );
28784
+ useEffect(() => {
28785
+ if (!options.enabled || !options.storageKey || typeof window === "undefined") return;
28786
+ const stored = Number(window.localStorage.getItem(options.storageKey));
28787
+ if (Number.isFinite(stored) && stored > 0) setWidth(clamp2(stored));
28788
+ }, [clamp2, options.enabled, options.storageKey]);
28789
+ const begin = useCallback(
28790
+ (event) => {
28791
+ if (!options.enabled || !width) return;
28792
+ event.preventDefault();
28793
+ const startX = event.clientX;
28794
+ const startWidth = width;
28795
+ const direction = options.edge === "left" ? -1 : 1;
28796
+ const onMove = (moveEvent) => {
28797
+ const next2 = clamp2(startWidth + (moveEvent.clientX - startX) * direction);
28798
+ setWidth(next2);
28799
+ if (options.storageKey) window.localStorage.setItem(options.storageKey, String(next2));
28800
+ };
28801
+ const onUp = () => {
28802
+ window.removeEventListener("pointermove", onMove);
28803
+ window.removeEventListener("pointerup", onUp);
28804
+ };
28805
+ window.addEventListener("pointermove", onMove);
28806
+ window.addEventListener("pointerup", onUp);
28807
+ },
28808
+ [clamp2, options.edge, options.enabled, options.storageKey, width]
28809
+ );
28810
+ const style2 = useMemo(
28811
+ () => options.enabled && width ? { width, maxWidth: options.maxWidth } : void 0,
28812
+ [options.enabled, options.maxWidth, width]
28813
+ );
28814
+ return { enabled: options.enabled, edge: options.edge, style: style2, begin };
27794
28815
  }
27795
28816
  function ResizeHandle({
27796
28817
  edge,
@@ -27808,421 +28829,6 @@ function ResizeHandle({
27808
28829
  }
27809
28830
  );
27810
28831
  }
27811
- function AgentChatMessage({
27812
- message,
27813
- turn,
27814
- renderers,
27815
- isStreaming,
27816
- isLast,
27817
- isFirstInTurn,
27818
- isLastInTurn,
27819
- appearance
27820
- }) {
27821
- const rendererProps = { message, turn, isStreaming, isLast, isFirstInTurn, isLastInTurn, appearance };
27822
- if (message.role === "user") {
27823
- const UserMessage = renderers?.UserMessage ?? DefaultUserMessage;
27824
- return /* @__PURE__ */ jsx(UserMessage, { ...rendererProps });
27825
- }
27826
- if (message.role === "system") {
27827
- const SystemMessage = renderers?.SystemMessage ?? DefaultSystemMessage;
27828
- return /* @__PURE__ */ jsx(SystemMessage, { ...rendererProps });
27829
- }
27830
- if (renderers?.AssistantMessage) {
27831
- const AssistantMessage = renderers.AssistantMessage;
27832
- return /* @__PURE__ */ jsx(AssistantMessage, { ...rendererProps });
27833
- }
27834
- return /* @__PURE__ */ jsx(
27835
- DefaultAssistantMessage,
27836
- {
27837
- ...rendererProps,
27838
- ContentBlock: renderers?.ContentBlock
27839
- }
27840
- );
27841
- }
27842
- function DefaultHeader({ name: name2, description, statusText, isWorking, tokenUsage }) {
27843
- const busy = isWorking;
27844
- return /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border bg-card px-4 py-3", children: [
27845
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
27846
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-semibold", children: [
27847
- /* @__PURE__ */ jsx(Bot, { className: "size-4 text-primary" }),
27848
- /* @__PURE__ */ jsx("span", { children: name2 })
27849
- ] }),
27850
- /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: description || statusText })
27851
- ] }),
27852
- /* @__PURE__ */ jsxs(
27853
- "div",
27854
- {
27855
- className: cn$2(
27856
- "flex shrink-0 items-center gap-1.5 rounded-full px-2.5 py-1 text-xs",
27857
- busy ? "bg-primary/10 text-foreground" : "bg-muted text-muted-foreground"
27858
- ),
27859
- children: [
27860
- busy && /* @__PURE__ */ jsxs("span", { className: "relative flex size-1.5", "aria-hidden": true, children: [
27861
- /* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-primary/60" }),
27862
- /* @__PURE__ */ jsx("span", { className: "relative inline-flex size-1.5 rounded-full bg-primary" })
27863
- ] }),
27864
- tokenUsage ? `${(tokenUsage.total ?? tokenUsage.input + tokenUsage.output).toLocaleString()} tokens` : statusText
27865
- ]
27866
- }
27867
- )
27868
- ] });
27869
- }
27870
- function DefaultUserMessage({ message, appearance }) {
27871
- return /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
27872
- "div",
27873
- {
27874
- className: cn$2(
27875
- "max-w-[82%] rounded-2xl bg-secondary text-secondary-foreground shadow-sm",
27876
- appearance === "flat" ? "rounded-br-md px-3.5 py-2 text-[13px]" : "px-4 py-2.5 text-sm"
27877
- ),
27878
- children: [
27879
- /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap", children: message.content }),
27880
- /* @__PURE__ */ jsx(MessageStatus, { status: message.status, error: message.error })
27881
- ]
27882
- }
27883
- ) });
27884
- }
27885
- function DefaultAssistantTurn({
27886
- messages,
27887
- isStreaming,
27888
- toolDetails,
27889
- appearance = "card"
27890
- }) {
27891
- const segments = useMemo(() => {
27892
- const built = [];
27893
- for (const message of messages) {
27894
- normalizedBlocks$1(message.blocks, message.content).forEach((block, index2) => {
27895
- const key = `${message.id}:${blockKey$1(block, index2)}`;
27896
- const last = built[built.length - 1];
27897
- if (isActivityBlock(block)) {
27898
- if (toolDetails === false) return;
27899
- if (last?.kind === "activity") last.items.push({ block, key });
27900
- else built.push({ kind: "activity", items: [{ block, key }], key: `activity:${message.id}:${built.length}` });
27901
- } else {
27902
- const entry = { message, block, key };
27903
- if (last?.kind === "content") last.entries.push(entry);
27904
- else built.push({ kind: "content", entries: [entry], key: `content:${message.id}:${built.length}` });
27905
- }
27906
- });
27907
- }
27908
- return built;
27909
- }, [messages, toolDetails]);
27910
- if (segments.length === 0 && !isStreaming) return null;
27911
- const flat = appearance === "flat";
27912
- const lastTimestamp = messages[messages.length - 1]?.timestamp;
27913
- return /* @__PURE__ */ jsxs("div", { className: cn$2("flex justify-start", !flat && "gap-2"), children: [
27914
- !flat && /* @__PURE__ */ jsx("div", { className: "mt-1 flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx(Bot, { className: "size-4" }) }),
27915
- /* @__PURE__ */ jsxs("div", { className: cn$2("min-w-0 space-y-2", flat ? "w-full space-y-1.5" : "max-w-[88%]"), children: [
27916
- segments.length === 0 ? /* @__PURE__ */ jsxs(
27917
- "div",
27918
- {
27919
- className: cn$2(
27920
- "flex items-center gap-2 text-muted-foreground",
27921
- flat ? "px-2 py-1 text-[13px]" : "rounded-2xl border border-border bg-card px-4 py-3 text-sm shadow-sm"
27922
- ),
27923
- children: [
27924
- /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }),
27925
- /* @__PURE__ */ jsx("span", { children: "Thinking…" })
27926
- ]
27927
- }
27928
- ) : segments.map(
27929
- (segment, index2) => segment.kind === "activity" ? /* @__PURE__ */ jsx(
27930
- ActivityStrip,
27931
- {
27932
- items: segment.items,
27933
- isStreaming: Boolean(isStreaming && index2 === segments.length - 1)
27934
- },
27935
- segment.key
27936
- ) : /* @__PURE__ */ jsx(
27937
- "div",
27938
- {
27939
- className: cn$2(
27940
- !flat && "rounded-2xl border border-border bg-card px-4 py-3 text-sm shadow-sm",
27941
- flat && "px-2"
27942
- ),
27943
- children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: segment.entries.map((entry, entryIndex) => /* @__PURE__ */ jsx(
27944
- DefaultContentBlock,
27945
- {
27946
- block: entry.block,
27947
- message: entry.message,
27948
- appearance,
27949
- isStreaming: Boolean(
27950
- isStreaming && index2 === segments.length - 1 && entryIndex === segment.entries.length - 1
27951
- )
27952
- },
27953
- entry.key
27954
- )) })
27955
- },
27956
- segment.key
27957
- )
27958
- ),
27959
- flat && !isStreaming && lastTimestamp && /* @__PURE__ */ jsx("div", { className: "px-2 pt-0.5 text-[10.5px] text-muted-foreground/70", children: formatMessageTime(lastTimestamp) })
27960
- ] })
27961
- ] });
27962
- }
27963
- function formatMessageTime(iso) {
27964
- const t = new Date(iso);
27965
- if (Number.isNaN(t.getTime())) return "";
27966
- return t.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
27967
- }
27968
- function DefaultSystemMessage({ message }) {
27969
- return /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-center gap-2 text-xs text-muted-foreground", children: [
27970
- /* @__PURE__ */ jsx(Info$1, { className: "mt-0.5 size-3.5" }),
27971
- /* @__PURE__ */ jsx("span", { children: message.content })
27972
- ] });
27973
- }
27974
- function DefaultAssistantMessage({
27975
- message,
27976
- isStreaming,
27977
- appearance,
27978
- ContentBlock: ContentBlock2 = DefaultContentBlock
27979
- }) {
27980
- const blocks = normalizedBlocks$1(message.blocks, message.content);
27981
- const flat = appearance === "flat";
27982
- return /* @__PURE__ */ jsxs("div", { className: cn$2("flex justify-start", !flat && "gap-2"), children: [
27983
- !flat && /* @__PURE__ */ jsx("div", { className: "mt-1 flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx(Bot, { className: "size-4" }) }),
27984
- /* @__PURE__ */ jsx(
27985
- "div",
27986
- {
27987
- className: cn$2(
27988
- "min-w-0",
27989
- flat ? "w-full px-2" : "max-w-[88%] rounded-2xl border border-border bg-card px-4 py-3 text-sm shadow-sm"
27990
- ),
27991
- children: isStreaming && blocks.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [
27992
- /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }),
27993
- /* @__PURE__ */ jsx("span", { children: "Thinking…" })
27994
- ] }) : /* @__PURE__ */ jsx("div", { className: "space-y-2", children: blocks.map((block, index2) => /* @__PURE__ */ jsx(
27995
- ContentBlock2,
27996
- {
27997
- block,
27998
- message,
27999
- appearance,
28000
- isStreaming: isStreaming && index2 === blocks.length - 1
28001
- },
28002
- blockKey$1(block, index2)
28003
- )) })
28004
- }
28005
- )
28006
- ] });
28007
- }
28008
- function DefaultContentBlock({ block, isStreaming, appearance }) {
28009
- switch (block.type) {
28010
- case "text":
28011
- return /* @__PURE__ */ jsx(AgentChatMarkdown, { isStreaming, variant: appearance === "flat" ? "chat" : "prose", children: block.content });
28012
- case "thinking":
28013
- return /* @__PURE__ */ jsx(ThinkingBlock, { content: block.content, isStreaming });
28014
- case "tool_call":
28015
- return /* @__PURE__ */ jsx(ToolCallCard, { toolCall: block.toolCall });
28016
- case "action":
28017
- return /* @__PURE__ */ jsx(ActionCard, { action: block.action });
28018
- case "file":
28019
- return /* @__PURE__ */ jsx(ArtifactCard, { file: block.file });
28020
- case "info":
28021
- return /* @__PURE__ */ jsx(InfoBlock, { content: block.content, tone: block.tone });
28022
- case "compaction_summary":
28023
- return /* @__PURE__ */ jsx(InfoBlock, { content: block.content });
28024
- case "custom":
28025
- if (block.kind === "tool_call_args_progress") {
28026
- return /* @__PURE__ */ jsx(ToolArgsProgress, { payload: block.payload });
28027
- }
28028
- return /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto rounded-md bg-muted p-3 text-xs text-muted-foreground", children: JSON.stringify(block.payload, null, 2) });
28029
- }
28030
- }
28031
- function DefaultComposer({ state, actions }) {
28032
- const fileInputRef = useRef(null);
28033
- return /* @__PURE__ */ jsxs(
28034
- "form",
28035
- {
28036
- className: "border-t border-border bg-card p-3",
28037
- onSubmit: (event) => {
28038
- event.preventDefault();
28039
- if (state.canSubmit) void actions.submit();
28040
- },
28041
- children: [
28042
- state.pendingFiles.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-2 flex flex-wrap gap-2", children: state.pendingFiles.map((file) => /* @__PURE__ */ jsxs(
28043
- "span",
28044
- {
28045
- className: cn$2(
28046
- "inline-flex items-center gap-1 rounded-full border px-2 py-1 text-xs",
28047
- file.status === "failed" ? "border-destructive/40 bg-destructive/10 text-destructive" : "border-border bg-muted text-muted-foreground"
28048
- ),
28049
- children: [
28050
- /* @__PURE__ */ jsx(File, { className: "size-3" }),
28051
- file.name,
28052
- file.status === "uploading" && /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 animate-spin" }),
28053
- actions.removePendingFile && /* @__PURE__ */ jsx("button", { type: "button", className: "ml-1", onClick: () => actions.removePendingFile?.(file.id), children: "×" })
28054
- ]
28055
- },
28056
- file.id
28057
- )) }),
28058
- /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2 rounded-xl border border-input bg-background p-2 focus-within:ring-2 focus-within:ring-ring/40", children: [
28059
- actions.attachFiles && /* @__PURE__ */ jsxs(Fragment, { children: [
28060
- /* @__PURE__ */ jsx(
28061
- "input",
28062
- {
28063
- ref: fileInputRef,
28064
- type: "file",
28065
- multiple: true,
28066
- className: "hidden",
28067
- onChange: (event) => {
28068
- const files = Array.from(event.currentTarget.files ?? []);
28069
- if (files.length > 0) void actions.attachFiles?.(files);
28070
- event.currentTarget.value = "";
28071
- }
28072
- }
28073
- ),
28074
- /* @__PURE__ */ jsx(
28075
- "button",
28076
- {
28077
- type: "button",
28078
- className: "rounded-lg p-2 text-muted-foreground hover:bg-muted hover:text-foreground",
28079
- onClick: () => fileInputRef.current?.click(),
28080
- disabled: state.disabled,
28081
- "aria-label": "Attach files",
28082
- children: /* @__PURE__ */ jsx(Paperclip, { className: "size-4" })
28083
- }
28084
- )
28085
- ] }),
28086
- /* @__PURE__ */ jsx(
28087
- "textarea",
28088
- {
28089
- value: state.value,
28090
- placeholder: state.placeholder,
28091
- disabled: state.disabled,
28092
- className: "max-h-40 min-h-10 flex-1 resize-none bg-transparent px-1 py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-60",
28093
- rows: 1,
28094
- onChange: (event) => actions.setValue(event.target.value),
28095
- onKeyDown: (event) => {
28096
- if (event.key === "Enter" && !event.shiftKey) {
28097
- event.preventDefault();
28098
- if (state.canSubmit) void actions.submit();
28099
- }
28100
- }
28101
- }
28102
- ),
28103
- state.canAbort ? /* @__PURE__ */ jsx(
28104
- "button",
28105
- {
28106
- type: "button",
28107
- className: "inline-flex size-9 items-center justify-center rounded-lg bg-destructive text-destructive-foreground hover:opacity-90 disabled:opacity-50",
28108
- onClick: () => void actions.abort(),
28109
- disabled: state.phase === "aborting",
28110
- "aria-label": "Stop response",
28111
- children: state.phase === "aborting" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(Square, { className: "size-4" })
28112
- }
28113
- ) : /* @__PURE__ */ jsx(
28114
- "button",
28115
- {
28116
- type: "submit",
28117
- className: "inline-flex size-9 items-center justify-center rounded-lg bg-primary text-primary-foreground hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",
28118
- disabled: !state.canSubmit,
28119
- "aria-label": "Send message",
28120
- children: state.phase === "submitting" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(Send, { className: "size-4" })
28121
- }
28122
- )
28123
- ] }),
28124
- state.queueLength > 0 && /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
28125
- state.queueLength,
28126
- " queued"
28127
- ] })
28128
- ]
28129
- }
28130
- );
28131
- }
28132
- function ActionCard({ action }) {
28133
- return /* @__PURE__ */ jsxs(
28134
- "div",
28135
- {
28136
- className: cn$2(
28137
- "flex items-start gap-2 rounded-lg border px-3 py-2 text-xs",
28138
- action.status === "error" ? "border-destructive/40 bg-destructive/10 text-destructive" : "border-border bg-muted/40 text-muted-foreground"
28139
- ),
28140
- children: [
28141
- /* @__PURE__ */ jsx(ToolStatusIcon, { status: action.status }),
28142
- /* @__PURE__ */ jsxs("div", { children: [
28143
- /* @__PURE__ */ jsx("div", { children: action.label }),
28144
- action.error && /* @__PURE__ */ jsx("div", { className: "mt-1 text-destructive", children: action.error })
28145
- ] })
28146
- ]
28147
- }
28148
- );
28149
- }
28150
- function InfoBlock({ content: content2, tone }) {
28151
- return /* @__PURE__ */ jsxs(
28152
- "div",
28153
- {
28154
- className: cn$2(
28155
- "flex items-center gap-2 rounded-lg px-3 py-2 text-xs",
28156
- tone === "error" ? "bg-destructive/10 text-destructive" : tone === "success" ? "bg-status-success-bg text-status-success-foreground" : tone === "warning" ? "bg-status-warning-bg text-status-warning-foreground" : "bg-muted text-muted-foreground"
28157
- ),
28158
- children: [
28159
- /* @__PURE__ */ jsx(Info$1, { className: "size-3.5" }),
28160
- content2
28161
- ]
28162
- }
28163
- );
28164
- }
28165
- function MessageStatus({ status, error: error2 }) {
28166
- if (!status || status === "completed") return null;
28167
- const active = status === "queued" || status === "claimed" || status === "preparing" || status === "submitting" || status === "running";
28168
- return /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center justify-end gap-1 text-[11px] opacity-80", children: [
28169
- active ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 animate-spin" }) : /* @__PURE__ */ jsx(TriangleAlert, { className: "size-3" }),
28170
- /* @__PURE__ */ jsx("span", { children: error2 || status })
28171
- ] });
28172
- }
28173
- function ToolStatusIcon({ status }) {
28174
- if (status === "running") return /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin text-primary" });
28175
- if (status === "error") return /* @__PURE__ */ jsx(CircleX, { className: "size-3.5 text-destructive" });
28176
- return /* @__PURE__ */ jsx(CircleCheck, { className: "size-3.5 text-status-success-foreground" });
28177
- }
28178
- function DefaultEmptyState() {
28179
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-64 flex-col items-center justify-center text-center text-muted-foreground", children: [
28180
- /* @__PURE__ */ jsx(User, { className: "mb-3 size-8" }),
28181
- /* @__PURE__ */ jsx("p", { className: "font-medium text-foreground", children: DEFAULT_LABELS.emptyTitle }),
28182
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm", children: DEFAULT_LABELS.emptyDescription })
28183
- ] });
28184
- }
28185
- function DefaultLoadingState() {
28186
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-64 items-center justify-center gap-2 text-sm text-muted-foreground", children: [
28187
- /* @__PURE__ */ jsx(LoaderCircle, { className: "size-4 animate-spin" }),
28188
- "Loading conversation…"
28189
- ] });
28190
- }
28191
- function DefaultErrorState({ error: error2, retry }) {
28192
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: [
28193
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
28194
- /* @__PURE__ */ jsx(TriangleAlert, { className: "size-4 shrink-0" }),
28195
- /* @__PURE__ */ jsx("span", { className: "truncate", children: error2 instanceof Error ? error2.message : String(error2) })
28196
- ] }),
28197
- retry && /* @__PURE__ */ jsx("button", { type: "button", className: "shrink-0 rounded-md px-2 py-1 text-xs hover:bg-destructive/10", onClick: retry, children: "Retry" })
28198
- ] });
28199
- }
28200
- function DefaultLoadEarlierButton({ loading, onClick }) {
28201
- return /* @__PURE__ */ jsxs(
28202
- "button",
28203
- {
28204
- type: "button",
28205
- className: "inline-flex items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground shadow-sm hover:bg-muted disabled:opacity-50",
28206
- onClick,
28207
- disabled: loading,
28208
- children: [
28209
- loading && /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3 animate-spin" }),
28210
- "Load earlier"
28211
- ]
28212
- }
28213
- );
28214
- }
28215
- function normalizedBlocks$1(blocks, content2) {
28216
- if (blocks && blocks.length > 0) return blocks;
28217
- return content2 ? [{ type: "text", content: content2 }] : [];
28218
- }
28219
- function blockKey$1(block, index2) {
28220
- if (block.type === "tool_call") return `tool:${block.toolCall.id}`;
28221
- if (block.type === "action") return `action:${block.action.id}`;
28222
- if (block.type === "file") return `file:${block.file.id ?? block.file.url ?? block.file.name}:${index2}`;
28223
- if (block.type === "custom") return `custom:${block.kind}:${index2}`;
28224
- return `${block.type}:${index2}`;
28225
- }
28226
28832
  function isSessionActive(activity) {
28227
28833
  return activity?.status === "active";
28228
28834
  }
@@ -28510,6 +29116,7 @@ function parseAgentProfile(body) {
28510
29116
  id: stringValue(data.id) ?? stringValue(data.external_id),
28511
29117
  name: stringValue(data.name),
28512
29118
  description: stringValue(data.description),
29119
+ ...typeof data.web_search_enabled === "boolean" && { webSearchEnabled: data.web_search_enabled },
28513
29120
  metadata: data
28514
29121
  };
28515
29122
  }
@@ -29711,7 +30318,7 @@ function SessionRail({
29711
30318
  ] }) : sessions.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-2 py-6 text-center text-xs text-muted-foreground", children: "No conversations yet." }) : /* @__PURE__ */ jsx("div", { className: "space-y-3", children: groupSessions(sessions).map((group) => /* @__PURE__ */ jsxs("div", { children: [
29712
30319
  /* @__PURE__ */ jsx("p", { className: "px-2 pb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/80", children: group.label }),
29713
30320
  /* @__PURE__ */ jsx("ul", { className: "space-y-0.5", children: group.items.map((session) => {
29714
- const isActive = session.id === activeSessionId;
30321
+ const isActive2 = session.id === activeSessionId;
29715
30322
  const isRenaming = renamingId === session.id;
29716
30323
  const title = prettySessionTitle(session);
29717
30324
  return /* @__PURE__ */ jsx("li", { children: isRenaming ? /* @__PURE__ */ jsx(
@@ -29738,7 +30345,7 @@ function SessionRail({
29738
30345
  onDoubleClick: onRename ? () => startRename(session.id, title) : void 0,
29739
30346
  className: cn$2(
29740
30347
  "group flex w-full flex-col items-start gap-0.5 rounded-lg px-2.5 py-2 text-left transition",
29741
- isActive ? "bg-primary/10 text-primary" : "hover:bg-accent"
30348
+ isActive2 ? "bg-primary/10 text-primary" : "hover:bg-accent"
29742
30349
  ),
29743
30350
  children: [
29744
30351
  /* @__PURE__ */ jsxs("span", { className: "flex w-full items-center gap-1", children: [
@@ -36161,7 +36768,7 @@ const popupStoreSelectors = {
36161
36768
  * Whether the popup is mounted and was activated by a trigger with the given ID.
36162
36769
  */
36163
36770
  isMountedByTrigger: createSelector((state, triggerId) => triggerId !== void 0 && state.activeTriggerId === triggerId && state.mounted),
36164
- triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps),
36771
+ triggerProps: createSelector((state, isActive2) => isActive2 ? state.activeTriggerProps : state.inactiveTriggerProps),
36165
36772
  popupProps: createSelector((state) => state.popupProps),
36166
36773
  popupElement: createSelector((state) => state.popupElement),
36167
36774
  positionerElement: createSelector((state) => state.positionerElement)
@@ -41115,14 +41722,15 @@ function RecordSheet({
41115
41722
  }
41116
41723
  export {
41117
41724
  ActivityStrip as A,
41118
- useDataSyncTransport as B,
41119
- useToolRenderers as C,
41725
+ summarizeActivityLabels as B,
41726
+ useDataSyncTransport as C,
41120
41727
  DataTable as D,
41121
- warmCollectionCache as E,
41122
- withDataSync as F,
41123
- po as G,
41124
- R as H,
41125
- At as I,
41728
+ useToolRenderers as E,
41729
+ warmCollectionCache as F,
41730
+ withDataSync as G,
41731
+ po as H,
41732
+ R as I,
41733
+ At as J,
41126
41734
  Li as L,
41127
41735
  RecordSheet as R,
41128
41736
  ToolCallCard as T,
@@ -41136,20 +41744,20 @@ export {
41136
41744
  AutomationRunner as h,
41137
41745
  DataTableFilters as i,
41138
41746
  DataTablePagination as j,
41139
- ToolRenderersProvider as k,
41140
- activityDurationSeconds as l,
41141
- chatMarkdownComponents as m,
41142
- clipLabel as n,
41143
- createLumeraAgentChatTransport as o,
41144
- defaultToolRenderers as p,
41145
- encodeActivityLabels as q,
41146
- findRenderer as r,
41147
- getCollectionMap as s,
41148
- humanizeCollectionName as t,
41149
- isActivityBlock as u,
41150
- isExploratoryToolCallError as v,
41151
- isMutatingToolCall as w,
41152
- isSessionActive as x,
41153
- parseSessionActivity as y,
41154
- summarizeActivityLabels as z
41747
+ DefaultContentBlock as k,
41748
+ ToolRenderersProvider as l,
41749
+ activityDurationSeconds as m,
41750
+ chatMarkdownComponents as n,
41751
+ clipLabel as o,
41752
+ createLumeraAgentChatTransport as p,
41753
+ defaultToolRenderers as q,
41754
+ encodeActivityLabels as r,
41755
+ findRenderer as s,
41756
+ getCollectionMap as t,
41757
+ humanizeCollectionName as u,
41758
+ isActivityBlock as v,
41759
+ isExploratoryToolCallError as w,
41760
+ isMutatingToolCall as x,
41761
+ isSessionActive as y,
41762
+ parseSessionActivity as z
41155
41763
  };