@adecore/agents-react 0.41.1 → 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.
- package/dist/chat/actions.js +4 -0
- package/dist/chat/logic/lightbox.d.ts +31 -0
- package/dist/chat/logic/lightbox.js +61 -0
- package/dist/chat/logic/timeline.d.ts +1 -0
- package/dist/chat/logic/timeline.js +3 -0
- package/dist/chat/ui/AnsiOutput.d.ts +3 -2
- package/dist/chat/ui/AnsiOutput.js +26 -22
- package/dist/chat/ui/ImageView.d.ts +3 -0
- package/dist/chat/ui/ImageView.js +761 -437
- package/dist/chat/ui/intelligent-ui/renderers/content.js +4 -2
- package/dist/chat/ui/rows/MessageRows.js +10 -8
- package/dist/chat/ui/rows/Rows.js +42 -39
- package/dist/chat/ui/rows/WorkRows.d.ts +4 -2
- package/dist/chat/ui/rows/WorkRows.js +580 -211
- package/dist/chat/ui/rows/WorkflowRow.js +43 -41
- package/dist/host.d.ts +1 -0
- package/dist/locales/en/agent-chat.d.ts +9 -0
- package/dist/locales/en/agent-chat.js +11 -2
- package/dist/locales/nl/agent-chat.d.ts +9 -0
- package/dist/locales/nl/agent-chat.js +11 -2
- package/package.json +8 -8
- package/src/chat/actions.ts +1 -0
- package/src/chat/logic/lightbox.ts +88 -0
- package/src/chat/logic/timeline.ts +13 -2
- package/src/chat/ui/AnsiOutput.tsx +13 -2
- package/src/chat/ui/ImageView.tsx +255 -63
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +4 -2
- package/src/chat/ui/rows/MessageRows.tsx +10 -8
- package/src/chat/ui/rows/Rows.tsx +9 -1
- package/src/chat/ui/rows/WorkRows.tsx +127 -27
- package/src/chat/ui/rows/WorkflowRow.tsx +1 -1
- package/src/host.ts +2 -0
- package/src/locales/en/agent-chat.ts +11 -2
- 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:
|
|
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:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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(
|
|
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
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
-
|
|
369
|
+
t2 = $[65];
|
|
367
370
|
}
|
|
368
|
-
return
|
|
371
|
+
return t2;
|
|
369
372
|
}
|
|
370
373
|
case "approval":
|
|
371
374
|
{
|
|
372
375
|
let t1;
|
|
373
|
-
if ($[
|
|
376
|
+
if ($[66] !== row.item) {
|
|
374
377
|
t1 = /*#__PURE__*/_jsx(ApprovalHistoryRow, {
|
|
375
378
|
item: row.item
|
|
376
379
|
});
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
380
|
+
$[66] = row.item;
|
|
381
|
+
$[67] = t1;
|
|
379
382
|
} else {
|
|
380
|
-
t1 = $[
|
|
383
|
+
t1 = $[67];
|
|
381
384
|
}
|
|
382
385
|
return t1;
|
|
383
386
|
}
|
|
384
387
|
case "question":
|
|
385
388
|
{
|
|
386
389
|
let t1;
|
|
387
|
-
if ($[
|
|
390
|
+
if ($[68] !== row.item) {
|
|
388
391
|
t1 = /*#__PURE__*/_jsx(QuestionHistoryRow, {
|
|
389
392
|
item: row.item
|
|
390
393
|
});
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
394
|
+
$[68] = row.item;
|
|
395
|
+
$[69] = t1;
|
|
393
396
|
} else {
|
|
394
|
-
t1 = $[
|
|
397
|
+
t1 = $[69];
|
|
395
398
|
}
|
|
396
399
|
return t1;
|
|
397
400
|
}
|
|
398
401
|
case "note":
|
|
399
402
|
{
|
|
400
403
|
let t1;
|
|
401
|
-
if ($[
|
|
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
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
411
|
+
$[70] = row.from;
|
|
412
|
+
$[71] = row.id;
|
|
413
|
+
$[72] = row.level;
|
|
414
|
+
$[73] = row.text;
|
|
415
|
+
$[74] = t1;
|
|
413
416
|
} else {
|
|
414
|
-
t1 = $[
|
|
417
|
+
t1 = $[74];
|
|
415
418
|
}
|
|
416
419
|
return t1;
|
|
417
420
|
}
|
|
418
421
|
case "compaction":
|
|
419
422
|
{
|
|
420
423
|
let t1;
|
|
421
|
-
if ($[
|
|
424
|
+
if ($[75] !== row.preTokens) {
|
|
422
425
|
t1 = /*#__PURE__*/_jsx(CompactionRow, {
|
|
423
426
|
preTokens: row.preTokens
|
|
424
427
|
});
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
428
|
+
$[75] = row.preTokens;
|
|
429
|
+
$[76] = t1;
|
|
427
430
|
} else {
|
|
428
|
-
t1 = $[
|
|
431
|
+
t1 = $[76];
|
|
429
432
|
}
|
|
430
433
|
return t1;
|
|
431
434
|
}
|
|
432
435
|
case "working":
|
|
433
436
|
{
|
|
434
437
|
let t1;
|
|
435
|
-
if ($[
|
|
438
|
+
if ($[77] !== row.startedAt) {
|
|
436
439
|
t1 = /*#__PURE__*/_jsx(WorkingRow, {
|
|
437
440
|
startedAt: row.startedAt
|
|
438
441
|
});
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
442
|
+
$[77] = row.startedAt;
|
|
443
|
+
$[78] = t1;
|
|
441
444
|
} else {
|
|
442
|
-
t1 = $[
|
|
445
|
+
t1 = $[78];
|
|
443
446
|
}
|
|
444
447
|
return t1;
|
|
445
448
|
}
|
|
446
449
|
case "app-card":
|
|
447
450
|
{
|
|
448
451
|
let t1;
|
|
449
|
-
if ($[
|
|
452
|
+
if ($[79] !== row.card) {
|
|
450
453
|
t1 = /*#__PURE__*/_jsx(AppCardRow, {
|
|
451
454
|
card: row.card
|
|
452
455
|
});
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
456
|
+
$[79] = row.card;
|
|
457
|
+
$[80] = t1;
|
|
455
458
|
} else {
|
|
456
|
-
t1 = $[
|
|
459
|
+
t1 = $[80];
|
|
457
460
|
}
|
|
458
461
|
return t1;
|
|
459
462
|
}
|
|
460
463
|
case "visual":
|
|
461
464
|
{
|
|
462
465
|
let t1;
|
|
463
|
-
if ($[
|
|
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
|
-
$[
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
+
$[81] = chatId;
|
|
472
|
+
$[82] = row.visual;
|
|
473
|
+
$[83] = t1;
|
|
471
474
|
} else {
|
|
472
|
-
t1 = $[
|
|
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;
|