@adecore/agents-react 0.41.0 → 0.42.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 (34) hide show
  1. package/dist/chat/actions.js +4 -0
  2. package/dist/chat/logic/lightbox.d.ts +31 -0
  3. package/dist/chat/logic/lightbox.js +61 -0
  4. package/dist/chat/logic/timeline.d.ts +1 -0
  5. package/dist/chat/logic/timeline.js +3 -0
  6. package/dist/chat/ui/AnsiOutput.d.ts +3 -2
  7. package/dist/chat/ui/AnsiOutput.js +26 -22
  8. package/dist/chat/ui/ImageView.d.ts +3 -0
  9. package/dist/chat/ui/ImageView.js +761 -437
  10. package/dist/chat/ui/intelligent-ui/renderers/content.js +4 -2
  11. package/dist/chat/ui/rows/MessageRows.js +10 -8
  12. package/dist/chat/ui/rows/Rows.js +42 -39
  13. package/dist/chat/ui/rows/WorkRows.d.ts +4 -2
  14. package/dist/chat/ui/rows/WorkRows.js +580 -211
  15. package/dist/chat/ui/rows/WorkflowRow.js +43 -41
  16. package/dist/host.d.ts +1 -0
  17. package/dist/locales/en/agent-chat.d.ts +9 -0
  18. package/dist/locales/en/agent-chat.js +11 -2
  19. package/dist/locales/nl/agent-chat.d.ts +9 -0
  20. package/dist/locales/nl/agent-chat.js +11 -2
  21. package/package.json +8 -8
  22. package/src/chat/actions.ts +1 -0
  23. package/src/chat/logic/lightbox.ts +88 -0
  24. package/src/chat/logic/timeline.ts +13 -2
  25. package/src/chat/ui/AnsiOutput.tsx +13 -2
  26. package/src/chat/ui/ImageView.tsx +255 -63
  27. package/src/chat/ui/intelligent-ui/renderers/content.tsx +4 -2
  28. package/src/chat/ui/rows/MessageRows.tsx +10 -8
  29. package/src/chat/ui/rows/Rows.tsx +9 -1
  30. package/src/chat/ui/rows/WorkRows.tsx +127 -27
  31. package/src/chat/ui/rows/WorkflowRow.tsx +1 -1
  32. package/src/host.ts +2 -0
  33. package/src/locales/en/agent-chat.ts +11 -2
  34. package/src/locales/nl/agent-chat.ts +11 -2
@@ -8,7 +8,7 @@ import { formatNumber } from '@adecore/ui/format';
8
8
  import { useChatHost } from '../../../../host.js';
9
9
  import { CodeBlock } from '../../CodeBlock.js';
10
10
  import { CodeStreamingContext } from '../../code-streaming.js';
11
- import { ImageThumb } from '../../ImageView.js';
11
+ import { ImageGroup, ImageThumb } from '../../ImageView.js';
12
12
  import { uiChildrenOf, uiNodeLabel, uiNodeText, uiUrlDomain } from '../node-text.js';
13
13
  import { useTruncated } from '../use-truncated.js';
14
14
  import { useHostAttachmentUrl } from '../../../../host-hooks.js';
@@ -301,7 +301,9 @@ export function GalleryRenderer(t0) {
301
301
  if ($[3] !== children) {
302
302
  t2 = /*#__PURE__*/_jsx("div", {
303
303
  className: "chat-ui-nodes grid grid-cols-2 gap-2 @min-[420px]:grid-cols-3",
304
- children: children
304
+ children: /*#__PURE__*/_jsx(ImageGroup, {
305
+ children: children
306
+ })
305
307
  });
306
308
  $[3] = children;
307
309
  $[4] = t2;
@@ -14,7 +14,7 @@ import { referenceTokens } from '../../chat-references.js';
14
14
  import { presentReferences } from '../../mentions.js';
15
15
  import { ReferenceChip } from '../ReferenceChip.js';
16
16
  import { ReferenceLookupContext } from '../reference-lookup.js';
17
- import { ImageThumb } from '../ImageView.js';
17
+ import { ImageGroup, ImageThumb } from '../ImageView.js';
18
18
  import { Markdown, MessageMarkdown, ReplyMarkdown } from '../Markdown.js';
19
19
  import { FadingWords } from '../FadingWords.js';
20
20
  import { settledBlocksText } from '../markdown-blocks.js';
@@ -292,13 +292,15 @@ export function UserRow(t0) {
292
292
  if ($[21] !== attachments || $[22] !== chatId) {
293
293
  t9 = attachments.length > 0 && /*#__PURE__*/_jsx("div", {
294
294
  className: "mb-1.5 flex max-w-[80%] flex-wrap justify-end gap-1.5",
295
- children: attachments.map(attachment => isImageAttachment(attachment.mime) ? /*#__PURE__*/_jsx(AttachmentThumb, {
296
- chatId: chatId,
297
- attachment: attachment
298
- }, attachment.id) : /*#__PURE__*/_jsx(AttachmentLink, {
299
- chatId: chatId,
300
- attachment: attachment
301
- }, attachment.id))
295
+ children: /*#__PURE__*/_jsx(ImageGroup, {
296
+ children: attachments.map(attachment => isImageAttachment(attachment.mime) ? /*#__PURE__*/_jsx(AttachmentThumb, {
297
+ chatId: chatId,
298
+ attachment: attachment
299
+ }, attachment.id) : /*#__PURE__*/_jsx(AttachmentLink, {
300
+ chatId: chatId,
301
+ attachment: attachment
302
+ }, attachment.id))
303
+ })
302
304
  });
303
305
  $[21] = attachments;
304
306
  $[22] = chatId;
@@ -70,7 +70,7 @@ function AppCardRow(t0) {
70
70
  }
71
71
  /* One row of a thread, the chat's own or a subagent's read back, drawn the same way in both. */
72
72
  export function Row(t0) {
73
- const $ = _c(83);
73
+ const $ = _c(84);
74
74
  const {
75
75
  row,
76
76
  chatId,
@@ -345,15 +345,17 @@ export function Row(t0) {
345
345
  }
346
346
  case "changed-files":
347
347
  {
348
- let t1;
349
- if ($[58] !== chatId || $[59] !== row.baseMoved || $[60] !== row.checkpoint || $[61] !== row.diff || $[62] !== row.tools || $[63] !== row.turnId) {
350
- t1 = /*#__PURE__*/_jsx(ChangedFilesRow, {
348
+ const t1 = row.heldBack === true;
349
+ let t2;
350
+ if ($[58] !== chatId || $[59] !== row.baseMoved || $[60] !== row.checkpoint || $[61] !== row.diff || $[62] !== row.tools || $[63] !== row.turnId || $[64] !== t1) {
351
+ t2 = /*#__PURE__*/_jsx(ChangedFilesRow, {
351
352
  chatId: chatId,
352
353
  turnId: row.turnId,
353
354
  tools: row.tools,
354
355
  diff: row.diff,
355
356
  checkpoint: row.checkpoint,
356
- baseMoved: row.baseMoved
357
+ baseMoved: row.baseMoved,
358
+ heldBack: t1
357
359
  });
358
360
  $[58] = chatId;
359
361
  $[59] = row.baseMoved;
@@ -362,114 +364,115 @@ export function Row(t0) {
362
364
  $[62] = row.tools;
363
365
  $[63] = row.turnId;
364
366
  $[64] = t1;
367
+ $[65] = t2;
365
368
  } else {
366
- t1 = $[64];
369
+ t2 = $[65];
367
370
  }
368
- return t1;
371
+ return t2;
369
372
  }
370
373
  case "approval":
371
374
  {
372
375
  let t1;
373
- if ($[65] !== row.item) {
376
+ if ($[66] !== row.item) {
374
377
  t1 = /*#__PURE__*/_jsx(ApprovalHistoryRow, {
375
378
  item: row.item
376
379
  });
377
- $[65] = row.item;
378
- $[66] = t1;
380
+ $[66] = row.item;
381
+ $[67] = t1;
379
382
  } else {
380
- t1 = $[66];
383
+ t1 = $[67];
381
384
  }
382
385
  return t1;
383
386
  }
384
387
  case "question":
385
388
  {
386
389
  let t1;
387
- if ($[67] !== row.item) {
390
+ if ($[68] !== row.item) {
388
391
  t1 = /*#__PURE__*/_jsx(QuestionHistoryRow, {
389
392
  item: row.item
390
393
  });
391
- $[67] = row.item;
392
- $[68] = t1;
394
+ $[68] = row.item;
395
+ $[69] = t1;
393
396
  } else {
394
- t1 = $[68];
397
+ t1 = $[69];
395
398
  }
396
399
  return t1;
397
400
  }
398
401
  case "note":
399
402
  {
400
403
  let t1;
401
- if ($[69] !== row.from || $[70] !== row.id || $[71] !== row.level || $[72] !== row.text) {
404
+ if ($[70] !== row.from || $[71] !== row.id || $[72] !== row.level || $[73] !== row.text) {
402
405
  t1 = /*#__PURE__*/_jsx(NoteRow, {
403
406
  id: row.id,
404
407
  level: row.level,
405
408
  text: row.text,
406
409
  from: row.from
407
410
  });
408
- $[69] = row.from;
409
- $[70] = row.id;
410
- $[71] = row.level;
411
- $[72] = row.text;
412
- $[73] = t1;
411
+ $[70] = row.from;
412
+ $[71] = row.id;
413
+ $[72] = row.level;
414
+ $[73] = row.text;
415
+ $[74] = t1;
413
416
  } else {
414
- t1 = $[73];
417
+ t1 = $[74];
415
418
  }
416
419
  return t1;
417
420
  }
418
421
  case "compaction":
419
422
  {
420
423
  let t1;
421
- if ($[74] !== row.preTokens) {
424
+ if ($[75] !== row.preTokens) {
422
425
  t1 = /*#__PURE__*/_jsx(CompactionRow, {
423
426
  preTokens: row.preTokens
424
427
  });
425
- $[74] = row.preTokens;
426
- $[75] = t1;
428
+ $[75] = row.preTokens;
429
+ $[76] = t1;
427
430
  } else {
428
- t1 = $[75];
431
+ t1 = $[76];
429
432
  }
430
433
  return t1;
431
434
  }
432
435
  case "working":
433
436
  {
434
437
  let t1;
435
- if ($[76] !== row.startedAt) {
438
+ if ($[77] !== row.startedAt) {
436
439
  t1 = /*#__PURE__*/_jsx(WorkingRow, {
437
440
  startedAt: row.startedAt
438
441
  });
439
- $[76] = row.startedAt;
440
- $[77] = t1;
442
+ $[77] = row.startedAt;
443
+ $[78] = t1;
441
444
  } else {
442
- t1 = $[77];
445
+ t1 = $[78];
443
446
  }
444
447
  return t1;
445
448
  }
446
449
  case "app-card":
447
450
  {
448
451
  let t1;
449
- if ($[78] !== row.card) {
452
+ if ($[79] !== row.card) {
450
453
  t1 = /*#__PURE__*/_jsx(AppCardRow, {
451
454
  card: row.card
452
455
  });
453
- $[78] = row.card;
454
- $[79] = t1;
456
+ $[79] = row.card;
457
+ $[80] = t1;
455
458
  } else {
456
- t1 = $[79];
459
+ t1 = $[80];
457
460
  }
458
461
  return t1;
459
462
  }
460
463
  case "visual":
461
464
  {
462
465
  let t1;
463
- if ($[80] !== chatId || $[81] !== row.visual) {
466
+ if ($[81] !== chatId || $[82] !== row.visual) {
464
467
  t1 = /*#__PURE__*/_jsx(VisualRow, {
465
468
  chatId: chatId,
466
469
  visual: row.visual
467
470
  });
468
- $[80] = chatId;
469
- $[81] = row.visual;
470
- $[82] = t1;
471
+ $[81] = chatId;
472
+ $[82] = row.visual;
473
+ $[83] = t1;
471
474
  } else {
472
- t1 = $[82];
475
+ t1 = $[83];
473
476
  }
474
477
  return t1;
475
478
  }
@@ -22,8 +22,9 @@ export declare function ToggleLine({ icon, label, brand, detail, command, look,
22
22
  time?: number;
23
23
  className?: string;
24
24
  }): import("react").JSX.Element;
25
- export declare function ToolBody({ tool }: {
25
+ export declare function ToolBody({ tool, chatId }: {
26
26
  tool: ChatToolItem;
27
+ chatId?: string | undefined;
27
28
  }): import("react").JSX.Element;
28
29
  export declare function WorkRow({ tool, chatId, nested, detail, icon, label, failed }: {
29
30
  tool: ChatToolItem;
@@ -55,13 +56,14 @@ export declare function TurnFoldRow({ turn, label, work, expanded, onToggle }: {
55
56
  expanded: boolean;
56
57
  onToggle(): void;
57
58
  }): import("react").JSX.Element;
58
- export declare function ChangedFilesRow({ tools, diff, checkpoint, baseMoved, chatId, turnId }: {
59
+ export declare function ChangedFilesRow({ tools, diff, checkpoint, baseMoved, chatId, turnId, heldBack }: {
59
60
  tools: ChatToolItem[];
60
61
  diff: ChatCheckpointDiff | null;
61
62
  checkpoint: boolean;
62
63
  baseMoved?: BaseMoved | undefined;
63
64
  chatId: string;
64
65
  turnId: string;
66
+ heldBack?: boolean;
65
67
  }): import("react").JSX.Element;
66
68
  export declare function WorkingRow({ startedAt }: {
67
69
  startedAt: number;