@adecore/agents-react 0.70.1 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/chat/ui/CodeBlock.d.ts +6 -1
  2. package/dist/chat/ui/CodeBlock.js +39 -23
  3. package/dist/chat/ui/intelligent-ui/UiReply.js +11 -2
  4. package/dist/chat/ui/intelligent-ui/key-caps.d.ts +1 -0
  5. package/dist/chat/ui/intelligent-ui/key-caps.js +45 -0
  6. package/dist/chat/ui/intelligent-ui/link-action.d.ts +9 -0
  7. package/dist/chat/ui/intelligent-ui/link-action.js +32 -0
  8. package/dist/chat/ui/intelligent-ui/node-text.js +1 -1
  9. package/dist/chat/ui/intelligent-ui/patch-clip.d.ts +4 -0
  10. package/dist/chat/ui/intelligent-ui/patch-clip.js +64 -0
  11. package/dist/chat/ui/intelligent-ui/registry.js +31 -5
  12. package/dist/chat/ui/intelligent-ui/render-context.d.ts +13 -0
  13. package/dist/chat/ui/intelligent-ui/renderers/alternatives.d.ts +6 -0
  14. package/dist/chat/ui/intelligent-ui/renderers/alternatives.js +296 -0
  15. package/dist/chat/ui/intelligent-ui/renderers/changes.d.ts +4 -0
  16. package/dist/chat/ui/intelligent-ui/renderers/changes.js +266 -0
  17. package/dist/chat/ui/intelligent-ui/renderers/chart.js +522 -371
  18. package/dist/chat/ui/intelligent-ui/renderers/content.d.ts +1 -1
  19. package/dist/chat/ui/intelligent-ui/renderers/content.js +94 -43
  20. package/dist/chat/ui/intelligent-ui/renderers/data.js +478 -245
  21. package/dist/chat/ui/intelligent-ui/renderers/diff.d.ts +4 -0
  22. package/dist/chat/ui/intelligent-ui/renderers/diff.js +427 -0
  23. package/dist/chat/ui/intelligent-ui/renderers/inputs.d.ts +1 -0
  24. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +354 -110
  25. package/dist/chat/ui/intelligent-ui/renderers/keys.d.ts +3 -0
  26. package/dist/chat/ui/intelligent-ui/renderers/keys.js +60 -0
  27. package/dist/chat/ui/intelligent-ui/renderers/links.d.ts +13 -2
  28. package/dist/chat/ui/intelligent-ui/renderers/links.js +65 -85
  29. package/dist/chat/ui/intelligent-ui/renderers/meter.d.ts +4 -0
  30. package/dist/chat/ui/intelligent-ui/renderers/meter.js +371 -0
  31. package/dist/chat/ui/intelligent-ui/renderers/quote.d.ts +3 -0
  32. package/dist/chat/ui/intelligent-ui/renderers/quote.js +123 -0
  33. package/dist/chat/ui/intelligent-ui/renderers/radio.d.ts +3 -0
  34. package/dist/chat/ui/intelligent-ui/renderers/radio.js +205 -0
  35. package/dist/chat/ui/intelligent-ui/renderers/structure.d.ts +2 -0
  36. package/dist/chat/ui/intelligent-ui/renderers/structure.js +156 -45
  37. package/dist/chat/ui/intelligent-ui/renderers/text.js +365 -215
  38. package/dist/chat/ui/intelligent-ui/renderers/tree.d.ts +5 -0
  39. package/dist/chat/ui/intelligent-ui/renderers/tree.js +284 -0
  40. package/dist/chat/ui/intelligent-ui/table-data.d.ts +9 -2
  41. package/dist/chat/ui/intelligent-ui/table-data.js +68 -3
  42. package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
  43. package/dist/chat/ui/intelligent-ui/tones.js +7 -7
  44. package/dist/chat/ui/intelligent-ui/use-ui-diffs.d.ts +4 -0
  45. package/dist/chat/ui/intelligent-ui/use-ui-diffs.js +201 -0
  46. package/dist/host/host.d.ts +2 -1
  47. package/dist/locales/en/agent-chat.d.ts +56 -0
  48. package/dist/locales/en/agent-chat.js +57 -1
  49. package/dist/locales/nl/agent-chat.d.ts +56 -0
  50. package/dist/locales/nl/agent-chat.js +57 -1
  51. package/dist/theme.css +6 -0
  52. package/package.json +9 -9
  53. package/src/chat/ui/CodeBlock.tsx +38 -18
  54. package/src/chat/ui/intelligent-ui/UiReply.tsx +13 -2
  55. package/src/chat/ui/intelligent-ui/key-caps.ts +51 -0
  56. package/src/chat/ui/intelligent-ui/link-action.ts +32 -0
  57. package/src/chat/ui/intelligent-ui/node-text.ts +1 -0
  58. package/src/chat/ui/intelligent-ui/patch-clip.ts +83 -0
  59. package/src/chat/ui/intelligent-ui/registry.ts +31 -4
  60. package/src/chat/ui/intelligent-ui/render-context.ts +21 -0
  61. package/src/chat/ui/intelligent-ui/renderers/alternatives.tsx +76 -0
  62. package/src/chat/ui/intelligent-ui/renderers/changes.tsx +97 -0
  63. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +122 -46
  64. package/src/chat/ui/intelligent-ui/renderers/content.tsx +27 -7
  65. package/src/chat/ui/intelligent-ui/renderers/data.tsx +165 -52
  66. package/src/chat/ui/intelligent-ui/renderers/diff.tsx +144 -0
  67. package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +111 -19
  68. package/src/chat/ui/intelligent-ui/renderers/keys.tsx +26 -0
  69. package/src/chat/ui/intelligent-ui/renderers/links.tsx +40 -24
  70. package/src/chat/ui/intelligent-ui/renderers/meter.tsx +105 -0
  71. package/src/chat/ui/intelligent-ui/renderers/quote.tsx +29 -0
  72. package/src/chat/ui/intelligent-ui/renderers/radio.tsx +130 -0
  73. package/src/chat/ui/intelligent-ui/renderers/structure.tsx +54 -7
  74. package/src/chat/ui/intelligent-ui/renderers/text.tsx +70 -36
  75. package/src/chat/ui/intelligent-ui/renderers/tree.tsx +85 -0
  76. package/src/chat/ui/intelligent-ui/table-data.ts +84 -6
  77. package/src/chat/ui/intelligent-ui/tones.ts +7 -7
  78. package/src/chat/ui/intelligent-ui/use-ui-diffs.ts +119 -0
  79. package/src/host/host.ts +4 -0
  80. package/src/locales/en/agent-chat.ts +57 -1
  81. package/src/locales/nl/agent-chat.ts +57 -1
  82. package/src/theme.css +6 -0
@@ -8,7 +8,7 @@ import { useContext } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { uiEventTime, uiNodeLabel } from '../node-text.js';
10
10
  import { UiHeadContext } from '../render-context.js';
11
- import { UI_STEP_PILL, UI_TONE_FILL, UI_TONE_ICONS, UI_TONE_PILL, UI_TONE_SURFACE, UI_TONE_TEXT } from '../tones.js';
11
+ import { UI_TONE_FILL, UI_TONE_ICONS, UI_TONE_PILL, UI_TONE_SURFACE, UI_TONE_TEXT } from '../tones.js';
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const STEP_ICONS = {
14
14
  done: CircleCheck,
@@ -34,12 +34,13 @@ const ICON_ROW = 'flex items-start gap-3 rounded-xl p-3';
34
34
  const ICON_SQUARE = 'grid size-8.5 shrink-0 place-items-center rounded-lg';
35
35
  const ICON_TEXT = 'flex min-h-8.5 min-w-0 grow flex-col justify-center gap-0.5';
36
36
  /*
37
- * A tile in its tone; the badge stands under the title in the tone's color. The head of the block
38
- * carries its icon in a square of its own, a Summary further down is a subheading without one. The
39
- * icon is the ground's ink in the dark theme, where its tones are too light for white.
37
+ * A tile in its tone. A short badge is a tag at the end of the row; a longer one stands under the
38
+ * title, since a tag cannot wrap. The head of the block carries its icon in a square of its own, a
39
+ * Summary further down is a subheading without one. The icon is the ground's ink in the dark theme,
40
+ * where its tones are too light for white.
40
41
  */
41
42
  export function SummaryRenderer(t0) {
42
- const $ = _c(17);
43
+ const $ = _c(28);
43
44
  const {
44
45
  node,
45
46
  children
@@ -48,9 +49,12 @@ export function SummaryRenderer(t0) {
48
49
  const head = headId === undefined || headId === node.id;
49
50
  const {
50
51
  tone,
51
- badge
52
+ badge,
53
+ detail
52
54
  } = node.props;
53
55
  const shown = tone ?? "neutral";
56
+ const badged = badge !== undefined && badge !== "";
57
+ const tagged = badged && badge.length <= DETAIL_AS_TAG;
54
58
  const t1 = tone === undefined ? "bg-ui-tile" : UI_TONE_SURFACE[tone];
55
59
  let t2;
56
60
  if ($[0] !== t1) {
@@ -88,47 +92,83 @@ export function SummaryRenderer(t0) {
88
92
  t4 = $[6];
89
93
  }
90
94
  let t5;
91
- if ($[7] !== badge || $[8] !== tone) {
92
- t5 = badge !== undefined && badge !== "" && /*#__PURE__*/_jsx("p", {
93
- className: clsx("text-2xs font-medium wrap-anywhere", tone === undefined ? "text-text-muted" : UI_TONE_TEXT[tone]),
94
- children: badge
95
+ if ($[7] !== detail || $[8] !== tone) {
96
+ t5 = detail !== undefined && detail !== "" && /*#__PURE__*/_jsx("p", {
97
+ className: clsx("text-xs wrap-break-word", tone === undefined ? "text-text-muted" : "text-text"),
98
+ children: detail
95
99
  });
96
- $[7] = badge;
100
+ $[7] = detail;
97
101
  $[8] = tone;
98
102
  $[9] = t5;
99
103
  } else {
100
104
  t5 = $[9];
101
105
  }
102
106
  let t6;
103
- if ($[10] !== t4 || $[11] !== t5) {
104
- t6 = /*#__PURE__*/_jsxs("div", {
105
- className: ICON_TEXT,
106
- children: [t4, t5]
107
+ if ($[10] !== badge || $[11] !== badged || $[12] !== tagged || $[13] !== tone) {
108
+ t6 = badged && !tagged && /*#__PURE__*/_jsx("p", {
109
+ className: clsx("text-2xs font-medium wrap-anywhere", tone === undefined ? "text-text-muted" : UI_TONE_TEXT[tone]),
110
+ children: badge
107
111
  });
108
- $[10] = t4;
109
- $[11] = t5;
110
- $[12] = t6;
112
+ $[10] = badge;
113
+ $[11] = badged;
114
+ $[12] = tagged;
115
+ $[13] = tone;
116
+ $[14] = t6;
111
117
  } else {
112
- t6 = $[12];
118
+ t6 = $[14];
113
119
  }
114
120
  let t7;
115
- if ($[13] !== t2 || $[14] !== t3 || $[15] !== t6) {
121
+ if ($[15] !== t4 || $[16] !== t5 || $[17] !== t6) {
116
122
  t7 = /*#__PURE__*/_jsxs("div", {
123
+ className: ICON_TEXT,
124
+ children: [t4, t5, t6]
125
+ });
126
+ $[15] = t4;
127
+ $[16] = t5;
128
+ $[17] = t6;
129
+ $[18] = t7;
130
+ } else {
131
+ t7 = $[18];
132
+ }
133
+ let t8;
134
+ if ($[19] !== badge || $[20] !== shown || $[21] !== tagged) {
135
+ t8 = tagged && /*#__PURE__*/_jsx(Pill, {
136
+ shape: "tag",
137
+ size: "sm",
138
+ tone: UI_TONE_PILL[shown],
139
+ className: "mt-0.5 shrink-0",
140
+ children: badge
141
+ });
142
+ $[19] = badge;
143
+ $[20] = shown;
144
+ $[21] = tagged;
145
+ $[22] = t8;
146
+ } else {
147
+ t8 = $[22];
148
+ }
149
+ let t9;
150
+ if ($[23] !== t2 || $[24] !== t3 || $[25] !== t7 || $[26] !== t8) {
151
+ t9 = /*#__PURE__*/_jsxs("div", {
117
152
  className: t2,
118
- children: [t3, t6]
153
+ children: [t3, t7, t8]
119
154
  });
120
- $[13] = t2;
121
- $[14] = t3;
122
- $[15] = t6;
123
- $[16] = t7;
155
+ $[23] = t2;
156
+ $[24] = t3;
157
+ $[25] = t7;
158
+ $[26] = t8;
159
+ $[27] = t9;
124
160
  } else {
125
- t7 = $[16];
161
+ t9 = $[27];
126
162
  }
127
- return t7;
163
+ return t9;
128
164
  }
129
- /* A quiet tile whatever its tone: only the square of its icon wears the tone. */
165
+ /*
166
+ * A quiet tile whose icon square wears the tone. A warning and a danger take the surface of their tone
167
+ * for the whole tile, and keep it inside a Section, where a quiet tile goes flat. Their words are the full
168
+ * text color: muted text does not reach 4.5 to 1 on a tinted surface.
169
+ */
130
170
  export function CalloutRenderer(t0) {
131
- const $ = _c(19);
171
+ const $ = _c(22);
132
172
  const {
133
173
  node,
134
174
  children
@@ -137,96 +177,102 @@ export function CalloutRenderer(t0) {
137
177
  tone,
138
178
  title
139
179
  } = node.props;
140
- let t1;
141
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
142
- t1 = clsx("chat-ui-flat bg-ui-tile text-xs", ICON_ROW);
180
+ const tinted = tone === "warning" || tone === "danger";
181
+ const t1 = tinted ? UI_TONE_SURFACE[tone] : "chat-ui-flat bg-ui-tile";
182
+ let t2;
183
+ if ($[0] !== t1) {
184
+ t2 = clsx("text-xs", ICON_ROW, t1);
143
185
  $[0] = t1;
186
+ $[1] = t2;
144
187
  } else {
145
- t1 = $[0];
188
+ t2 = $[1];
146
189
  }
147
- const t2 = UI_TONE_SURFACE[tone];
148
- const t3 = UI_TONE_TEXT[tone];
149
- let t4;
150
- if ($[1] !== t2 || $[2] !== t3) {
151
- t4 = clsx(ICON_SQUARE, t2, t3);
152
- $[1] = t2;
190
+ const t3 = UI_TONE_SURFACE[tone];
191
+ const t4 = UI_TONE_TEXT[tone];
192
+ let t5;
193
+ if ($[2] !== t3 || $[3] !== t4) {
194
+ t5 = clsx(ICON_SQUARE, t3, t4);
153
195
  $[2] = t3;
154
196
  $[3] = t4;
197
+ $[4] = t5;
155
198
  } else {
156
- t4 = $[3];
199
+ t5 = $[4];
157
200
  }
158
- const t5 = UI_TONE_ICONS[tone];
159
- let t6;
160
- if ($[4] !== t5) {
161
- t6 = /*#__PURE__*/_jsx(Icon, {
162
- icon: t5,
201
+ const t6 = UI_TONE_ICONS[tone];
202
+ let t7;
203
+ if ($[5] !== t6) {
204
+ t7 = /*#__PURE__*/_jsx(Icon, {
205
+ icon: t6,
163
206
  size: 16
164
207
  });
165
- $[4] = t5;
166
208
  $[5] = t6;
209
+ $[6] = t7;
167
210
  } else {
168
- t6 = $[5];
211
+ t7 = $[6];
169
212
  }
170
- let t7;
171
- if ($[6] !== t4 || $[7] !== t6) {
172
- t7 = /*#__PURE__*/_jsx("span", {
213
+ let t8;
214
+ if ($[7] !== t5 || $[8] !== t7) {
215
+ t8 = /*#__PURE__*/_jsx("span", {
173
216
  "aria-hidden": true,
174
- className: t4,
175
- children: t6
217
+ className: t5,
218
+ children: t7
176
219
  });
177
- $[6] = t4;
178
- $[7] = t6;
220
+ $[7] = t5;
179
221
  $[8] = t7;
222
+ $[9] = t8;
180
223
  } else {
181
- t7 = $[8];
224
+ t8 = $[9];
182
225
  }
183
- let t8;
184
- if ($[9] !== title) {
185
- t8 = title !== undefined && title !== "" && /*#__PURE__*/_jsx("div", {
226
+ let t9;
227
+ if ($[10] !== title) {
228
+ t9 = title !== undefined && title !== "" && /*#__PURE__*/_jsx("div", {
186
229
  className: "font-semibold text-text",
187
230
  children: title
188
231
  });
189
- $[9] = title;
190
- $[10] = t8;
232
+ $[10] = title;
233
+ $[11] = t9;
191
234
  } else {
192
- t8 = $[10];
235
+ t9 = $[11];
193
236
  }
194
- let t9;
195
- if ($[11] !== children) {
196
- t9 = /*#__PURE__*/_jsx("div", {
197
- className: "text-text-muted",
237
+ const t10 = tinted ? "text-text" : "text-text-muted";
238
+ let t11;
239
+ if ($[12] !== children || $[13] !== t10) {
240
+ t11 = /*#__PURE__*/_jsx("div", {
241
+ className: t10,
198
242
  children: children
199
243
  });
200
- $[11] = children;
201
- $[12] = t9;
244
+ $[12] = children;
245
+ $[13] = t10;
246
+ $[14] = t11;
202
247
  } else {
203
- t9 = $[12];
248
+ t11 = $[14];
204
249
  }
205
- let t10;
206
- if ($[13] !== t8 || $[14] !== t9) {
207
- t10 = /*#__PURE__*/_jsxs("div", {
250
+ let t12;
251
+ if ($[15] !== t11 || $[16] !== t9) {
252
+ t12 = /*#__PURE__*/_jsxs("div", {
208
253
  className: ICON_TEXT,
209
- children: [t8, t9]
254
+ children: [t9, t11]
210
255
  });
211
- $[13] = t8;
212
- $[14] = t9;
213
- $[15] = t10;
256
+ $[15] = t11;
257
+ $[16] = t9;
258
+ $[17] = t12;
214
259
  } else {
215
- t10 = $[15];
260
+ t12 = $[17];
216
261
  }
217
- let t11;
218
- if ($[16] !== t10 || $[17] !== t7) {
219
- t11 = /*#__PURE__*/_jsxs("div", {
220
- className: t1,
221
- children: [t7, t10]
262
+ let t13;
263
+ if ($[18] !== t12 || $[19] !== t2 || $[20] !== t8) {
264
+ t13 = /*#__PURE__*/_jsxs("div", {
265
+ className: t2,
266
+ children: [t8, t12]
222
267
  });
223
- $[16] = t10;
224
- $[17] = t7;
225
- $[18] = t11;
268
+ $[18] = t12;
269
+ $[19] = t2;
270
+ $[20] = t8;
271
+ $[21] = t13;
226
272
  } else {
227
- t11 = $[18];
273
+ t13 = $[21];
228
274
  }
229
- return t11;
275
+ return t13;
230
276
  }
231
277
  export function TagRenderer(t0) {
232
278
  const $ = _c(3);
@@ -254,9 +300,12 @@ export function TagRenderer(t0) {
254
300
  }
255
301
  return t2;
256
302
  }
257
- /* Without a value the progress is indeterminate; without a max the value is a percentage. */
303
+ /*
304
+ * Without a value the progress is indeterminate; without a max the value is a percentage. The tone colors
305
+ * the reading and gives it the tone's icon; the bar stays the accent.
306
+ */
258
307
  export function ProgressRenderer(t0) {
259
- const $ = _c(25);
308
+ const $ = _c(43);
260
309
  const {
261
310
  node,
262
311
  children,
@@ -267,9 +316,12 @@ export function ProgressRenderer(t0) {
267
316
  } = useTranslation("agent-chat");
268
317
  const {
269
318
  value,
270
- max
319
+ max,
320
+ tone,
321
+ detail
271
322
  } = node.props;
272
323
  const limit = max ?? 100;
324
+ const toned = tone !== undefined && tone !== "neutral";
273
325
  let t1;
274
326
  if ($[0] !== limit || $[1] !== t || $[2] !== value) {
275
327
  t1 = value === undefined ? null : limit === 100 ? formatPercent(value) : t("blocks.progress.of", {
@@ -284,93 +336,157 @@ export function ProgressRenderer(t0) {
284
336
  t1 = $[3];
285
337
  }
286
338
  const reading = t1;
287
- let t2;
288
- if ($[4] !== node) {
289
- t2 = uiNodeLabel(node);
290
- $[4] = node;
291
- $[5] = t2;
292
- } else {
293
- t2 = $[5];
294
- }
295
- const label = t2;
339
+ const t2 = reading ?? "";
296
340
  let t3;
297
- if ($[6] !== children) {
298
- t3 = /*#__PURE__*/_jsx("span", {
299
- className: "min-w-0 text-text",
300
- children: children
301
- });
302
- $[6] = children;
341
+ if ($[4] !== t || $[5] !== tone || $[6] !== toned) {
342
+ t3 = toned ? t(`blocks.event.tone.${tone}`) : "";
343
+ $[4] = t;
344
+ $[5] = tone;
345
+ $[6] = toned;
303
346
  $[7] = t3;
304
347
  } else {
305
348
  t3 = $[7];
306
349
  }
307
350
  let t4;
308
- if ($[8] !== context || $[9] !== reading) {
309
- t4 = reading !== null ? /*#__PURE__*/_jsx("span", {
310
- className: "shrink-0 text-text-muted tabular-nums",
311
- children: reading
312
- }) : isLive(context) && /*#__PURE__*/_jsx(Spinner, {
313
- size: 12,
314
- className: "shrink-0 self-center text-text-faint"
315
- });
316
- $[8] = context;
317
- $[9] = reading;
351
+ if ($[8] !== t2 || $[9] !== t3) {
352
+ t4 = [t2, t3].filter(_temp);
353
+ $[8] = t2;
354
+ $[9] = t3;
318
355
  $[10] = t4;
319
356
  } else {
320
357
  t4 = $[10];
321
358
  }
359
+ const said = t4.join(", ");
322
360
  let t5;
323
- if ($[11] !== t3 || $[12] !== t4) {
324
- t5 = /*#__PURE__*/_jsxs("div", {
325
- className: "flex items-baseline justify-between gap-3 text-xs",
326
- children: [t3, t4]
361
+ if ($[11] !== node) {
362
+ t5 = uiNodeLabel(node);
363
+ $[11] = node;
364
+ $[12] = t5;
365
+ } else {
366
+ t5 = $[12];
367
+ }
368
+ const label = t5;
369
+ let t6;
370
+ if ($[13] !== children) {
371
+ t6 = /*#__PURE__*/_jsx("span", {
372
+ className: "min-w-0 text-text",
373
+ children: children
327
374
  });
328
- $[11] = t3;
329
- $[12] = t4;
330
- $[13] = t5;
375
+ $[13] = children;
376
+ $[14] = t6;
331
377
  } else {
332
- t5 = $[13];
378
+ t6 = $[14];
333
379
  }
334
- const t6 = value ?? null;
335
380
  let t7;
336
- if ($[14] !== label || $[15] !== t) {
337
- t7 = label === "" ? t("blocks.progress.label") : label;
338
- $[14] = label;
339
- $[15] = t;
340
- $[16] = t7;
381
+ if ($[15] !== tone || $[16] !== toned) {
382
+ t7 = toned && /*#__PURE__*/_jsx(Icon, {
383
+ icon: UI_TONE_ICONS[tone],
384
+ size: 12,
385
+ className: clsx("self-center", UI_TONE_TEXT[tone])
386
+ });
387
+ $[15] = tone;
388
+ $[16] = toned;
389
+ $[17] = t7;
390
+ } else {
391
+ t7 = $[17];
392
+ }
393
+ let t8;
394
+ if ($[18] !== context || $[19] !== reading || $[20] !== tone || $[21] !== toned) {
395
+ t8 = reading !== null ? /*#__PURE__*/_jsx("span", {
396
+ className: toned ? UI_TONE_TEXT[tone] : "text-text-muted",
397
+ children: reading
398
+ }) : isLive(context) && /*#__PURE__*/_jsx(Spinner, {
399
+ size: 12,
400
+ className: "self-center text-text-faint"
401
+ });
402
+ $[18] = context;
403
+ $[19] = reading;
404
+ $[20] = tone;
405
+ $[21] = toned;
406
+ $[22] = t8;
341
407
  } else {
342
- t7 = $[16];
408
+ t8 = $[22];
343
409
  }
344
- const t8 = reading ?? undefined;
345
410
  let t9;
346
- if ($[17] !== limit || $[18] !== t6 || $[19] !== t7 || $[20] !== t8) {
347
- t9 = /*#__PURE__*/_jsx(Meter, {
348
- value: t6,
349
- max: limit,
350
- label: t7,
351
- valueText: t8
411
+ if ($[23] !== t7 || $[24] !== t8) {
412
+ t9 = /*#__PURE__*/_jsxs("span", {
413
+ "aria-hidden": true,
414
+ className: "flex shrink-0 items-baseline gap-1 tabular-nums",
415
+ children: [t7, t8]
352
416
  });
353
- $[17] = limit;
354
- $[18] = t6;
355
- $[19] = t7;
356
- $[20] = t8;
357
- $[21] = t9;
417
+ $[23] = t7;
418
+ $[24] = t8;
419
+ $[25] = t9;
358
420
  } else {
359
- t9 = $[21];
421
+ t9 = $[25];
360
422
  }
361
423
  let t10;
362
- if ($[22] !== t5 || $[23] !== t9) {
424
+ if ($[26] !== t6 || $[27] !== t9) {
363
425
  t10 = /*#__PURE__*/_jsxs("div", {
426
+ className: "flex items-baseline justify-between gap-3 text-xs",
427
+ children: [t6, t9]
428
+ });
429
+ $[26] = t6;
430
+ $[27] = t9;
431
+ $[28] = t10;
432
+ } else {
433
+ t10 = $[28];
434
+ }
435
+ const t11 = value ?? null;
436
+ let t12;
437
+ if ($[29] !== label || $[30] !== t) {
438
+ t12 = label === "" ? t("blocks.progress.label") : label;
439
+ $[29] = label;
440
+ $[30] = t;
441
+ $[31] = t12;
442
+ } else {
443
+ t12 = $[31];
444
+ }
445
+ const t13 = said === "" ? undefined : said;
446
+ let t14;
447
+ if ($[32] !== limit || $[33] !== t11 || $[34] !== t12 || $[35] !== t13) {
448
+ t14 = /*#__PURE__*/_jsx(Meter, {
449
+ value: t11,
450
+ max: limit,
451
+ label: t12,
452
+ valueText: t13
453
+ });
454
+ $[32] = limit;
455
+ $[33] = t11;
456
+ $[34] = t12;
457
+ $[35] = t13;
458
+ $[36] = t14;
459
+ } else {
460
+ t14 = $[36];
461
+ }
462
+ let t15;
463
+ if ($[37] !== detail) {
464
+ t15 = detail !== undefined && detail !== "" && /*#__PURE__*/_jsx("p", {
465
+ className: "text-2xs wrap-anywhere text-text-muted",
466
+ children: detail
467
+ });
468
+ $[37] = detail;
469
+ $[38] = t15;
470
+ } else {
471
+ t15 = $[38];
472
+ }
473
+ let t16;
474
+ if ($[39] !== t10 || $[40] !== t14 || $[41] !== t15) {
475
+ t16 = /*#__PURE__*/_jsxs("div", {
364
476
  className: "chat-ui-flat flex flex-col gap-2 rounded-xl bg-ui-tile p-3",
365
- children: [t5, t9]
477
+ children: [t10, t14, t15]
366
478
  });
367
- $[22] = t5;
368
- $[23] = t9;
369
- $[24] = t10;
479
+ $[39] = t10;
480
+ $[40] = t14;
481
+ $[41] = t15;
482
+ $[42] = t16;
370
483
  } else {
371
- t10 = $[24];
484
+ t16 = $[42];
372
485
  }
373
- return t10;
486
+ return t16;
487
+ }
488
+ function _temp(part) {
489
+ return part !== "";
374
490
  }
375
491
  export function StepsRenderer(t0) {
376
492
  const $ = _c(2);
@@ -380,7 +496,7 @@ export function StepsRenderer(t0) {
380
496
  let t1;
381
497
  if ($[0] !== children) {
382
498
  t1 = /*#__PURE__*/_jsx("ol", {
383
- className: "chat-ui-nodes flex flex-col gap-1.5",
499
+ className: "chat-ui-nodes chat-ui-flat flex flex-col rounded-xl bg-ui-tile p-3",
384
500
  children: children
385
501
  });
386
502
  $[0] = children;
@@ -390,9 +506,14 @@ export function StepsRenderer(t0) {
390
506
  }
391
507
  return t1;
392
508
  }
393
- /* A tile per step with its state in words at the end. A running step spins only while the block is live; in a quiet block it is a still dot. */
509
+ /*
510
+ * A row of the sequence's tile: the state as an icon on a rail that runs to the next step, the label, and
511
+ * the detail at the end, or under the label once it does not fit beside it. Only a failed step says its
512
+ * state in sight; every other one says it to a screen reader. A running step spins only while the block
513
+ * is live; in a quiet block it is a still dot.
514
+ */
394
515
  export function StepRenderer(t0) {
395
- const $ = _c(28);
516
+ const $ = _c(33);
396
517
  const {
397
518
  node,
398
519
  children,
@@ -444,90 +565,119 @@ export function StepRenderer(t0) {
444
565
  } else {
445
566
  t4 = $[7];
446
567
  }
447
- const t5 = quiet ? "text-text-muted" : "text-text";
448
- let t6;
449
- if ($[8] !== t5) {
450
- t6 = clsx("max-w-full min-w-0 font-medium wrap-break-word", t5);
568
+ let t5;
569
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
570
+ t5 = /*#__PURE__*/_jsx("span", {
571
+ "aria-hidden": true,
572
+ className: "my-1 w-px grow bg-border group-last:hidden"
573
+ });
451
574
  $[8] = t5;
452
- $[9] = t6;
453
575
  } else {
454
- t6 = $[9];
576
+ t5 = $[8];
455
577
  }
456
- let t7;
457
- if ($[10] !== children || $[11] !== t6) {
458
- t7 = /*#__PURE__*/_jsx("span", {
459
- className: t6,
460
- children: children
578
+ let t6;
579
+ if ($[9] !== t4) {
580
+ t6 = /*#__PURE__*/_jsxs("span", {
581
+ className: "flex w-4 shrink-0 flex-col items-center",
582
+ children: [t4, t5]
461
583
  });
462
- $[10] = children;
463
- $[11] = t6;
464
- $[12] = t7;
584
+ $[9] = t4;
585
+ $[10] = t6;
465
586
  } else {
466
- t7 = $[12];
587
+ t6 = $[10];
467
588
  }
589
+ const t7 = quiet ? "text-text-muted" : "text-text";
468
590
  let t8;
469
- if ($[13] !== detail) {
470
- t8 = detail !== undefined && detail !== "" && /*#__PURE__*/_jsx("span", {
591
+ if ($[11] !== t7) {
592
+ t8 = clsx("max-w-full min-w-0 font-medium wrap-break-word", t7);
593
+ $[11] = t7;
594
+ $[12] = t8;
595
+ } else {
596
+ t8 = $[12];
597
+ }
598
+ let t9;
599
+ if ($[13] !== children || $[14] !== t8) {
600
+ t9 = /*#__PURE__*/_jsx("span", {
601
+ className: t8,
602
+ children: children
603
+ });
604
+ $[13] = children;
605
+ $[14] = t8;
606
+ $[15] = t9;
607
+ } else {
608
+ t9 = $[15];
609
+ }
610
+ let t10;
611
+ if ($[16] !== detail) {
612
+ t10 = detail !== undefined && detail !== "" && /*#__PURE__*/_jsx("span", {
471
613
  className: "max-w-full text-2xs wrap-anywhere text-text-muted tabular-nums",
472
614
  children: detail
473
615
  });
474
- $[13] = detail;
475
- $[14] = t8;
616
+ $[16] = detail;
617
+ $[17] = t10;
476
618
  } else {
477
- t8 = $[14];
619
+ t10 = $[17];
478
620
  }
479
- let t9;
480
- if ($[15] !== t7 || $[16] !== t8) {
481
- t9 = /*#__PURE__*/_jsxs("span", {
482
- className: "flex min-w-0 grow flex-wrap items-baseline gap-x-2",
483
- children: [t7, t8]
621
+ let t11;
622
+ if ($[18] !== t10 || $[19] !== t9) {
623
+ t11 = /*#__PURE__*/_jsxs("span", {
624
+ className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-3",
625
+ children: [t9, t10]
484
626
  });
485
- $[15] = t7;
486
- $[16] = t8;
487
- $[17] = t9;
627
+ $[18] = t10;
628
+ $[19] = t9;
629
+ $[20] = t11;
488
630
  } else {
489
- t9 = $[17];
631
+ t11 = $[20];
490
632
  }
491
- const t10 = UI_STEP_PILL[state];
492
- const t11 = `blocks.step.${state}`;
493
- let t12;
494
- if ($[18] !== t || $[19] !== t11) {
495
- t12 = t(t11);
496
- $[18] = t;
497
- $[19] = t11;
498
- $[20] = t12;
633
+ const t12 = state === "failed" ? "text-2xs text-status-error" : "sr-only";
634
+ const t13 = `blocks.step.${state}`;
635
+ let t14;
636
+ if ($[21] !== t || $[22] !== t13) {
637
+ t14 = t(t13);
638
+ $[21] = t;
639
+ $[22] = t13;
640
+ $[23] = t14;
499
641
  } else {
500
- t12 = $[20];
642
+ t14 = $[23];
501
643
  }
502
- let t13;
503
- if ($[21] !== t10 || $[22] !== t12) {
504
- t13 = /*#__PURE__*/_jsx(Pill, {
505
- shape: "tag",
506
- size: "sm",
507
- tone: t10,
508
- className: "shrink-0",
509
- children: t12
644
+ let t15;
645
+ if ($[24] !== t12 || $[25] !== t14) {
646
+ t15 = /*#__PURE__*/_jsx("span", {
647
+ className: t12,
648
+ children: t14
510
649
  });
511
- $[21] = t10;
512
- $[22] = t12;
513
- $[23] = t13;
650
+ $[24] = t12;
651
+ $[25] = t14;
652
+ $[26] = t15;
514
653
  } else {
515
- t13 = $[23];
654
+ t15 = $[26];
516
655
  }
517
- let t14;
518
- if ($[24] !== t13 || $[25] !== t4 || $[26] !== t9) {
519
- t14 = /*#__PURE__*/_jsxs("li", {
520
- className: "flex min-h-10 items-start gap-3 rounded-xl bg-ui-tile px-3 py-2.5 text-xs",
521
- children: [t4, t9, t13]
656
+ let t16;
657
+ if ($[27] !== t11 || $[28] !== t15) {
658
+ t16 = /*#__PURE__*/_jsxs("span", {
659
+ className: "flex min-w-0 grow flex-col gap-0.5 pb-3 group-last:pb-0",
660
+ children: [t11, t15]
522
661
  });
523
- $[24] = t13;
524
- $[25] = t4;
525
- $[26] = t9;
526
- $[27] = t14;
662
+ $[27] = t11;
663
+ $[28] = t15;
664
+ $[29] = t16;
527
665
  } else {
528
- t14 = $[27];
666
+ t16 = $[29];
529
667
  }
530
- return t14;
668
+ let t17;
669
+ if ($[30] !== t16 || $[31] !== t6) {
670
+ t17 = /*#__PURE__*/_jsxs("li", {
671
+ className: "group flex items-stretch gap-3 text-xs",
672
+ children: [t6, t16]
673
+ });
674
+ $[30] = t16;
675
+ $[31] = t6;
676
+ $[32] = t17;
677
+ } else {
678
+ t17 = $[32];
679
+ }
680
+ return t17;
531
681
  }
532
682
  export function TimelineRenderer(t0) {
533
683
  const $ = _c(2);
@@ -591,7 +741,7 @@ export function EventRenderer(t0) {
591
741
  const t4 = detail ?? "";
592
742
  let t5;
593
743
  if ($[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== time) {
594
- t5 = [time, t2, t3, t4].filter(_temp);
744
+ t5 = [time, t2, t3, t4].filter(_temp2);
595
745
  $[7] = t2;
596
746
  $[8] = t3;
597
747
  $[9] = t4;
@@ -709,6 +859,6 @@ export function EventRenderer(t0) {
709
859
  }
710
860
  return t14;
711
861
  }
712
- function _temp(part) {
862
+ function _temp2(part) {
713
863
  return part !== "";
714
864
  }