@adecore/agents-react 0.50.4 → 0.50.6
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/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat/logic/command-looks.d.ts +6 -1
- package/dist/chat/logic/command-looks.js +50 -1
- package/dist/chat/logic/timeline-copy.js +2 -0
- package/dist/chat/logic/timeline.d.ts +6 -1
- package/dist/chat/logic/timeline.js +21 -3
- package/dist/chat/ui/ReferenceChip.d.ts +2 -1
- package/dist/chat/ui/ReferenceChip.js +90 -72
- package/dist/chat/ui/rows/MessageRows.d.ts +8 -1
- package/dist/chat/ui/rows/MessageRows.js +356 -108
- package/dist/chat/ui/rows/Rows.js +44 -24
- package/dist/chat/ui/rows/row-rhythm.js +3 -2
- package/dist/host.d.ts +15 -0
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +12 -0
- package/dist/locales/en/agent-chat.js +19 -7
- package/dist/locales/nl/agent-chat.d.ts +12 -0
- package/dist/locales/nl/agent-chat.js +31 -19
- package/dist/locales/nl/agent-prompts.js +1 -1
- package/package.json +8 -8
- package/src/chat/index.ts +1 -1
- package/src/chat/logic/command-looks.ts +62 -2
- package/src/chat/logic/timeline-copy.ts +2 -0
- package/src/chat/logic/timeline.ts +19 -4
- package/src/chat/ui/ReferenceChip.tsx +12 -4
- package/src/chat/ui/rows/MessageRows.tsx +88 -9
- package/src/chat/ui/rows/Rows.tsx +3 -0
- package/src/chat/ui/rows/row-rhythm.ts +7 -2
- package/src/host.ts +29 -0
- package/src/index.ts +2 -0
- package/src/locales/en/agent-chat.ts +19 -7
- package/src/locales/nl/agent-chat.ts +31 -19
- package/src/locales/nl/agent-prompts.ts +1 -1
|
@@ -2,7 +2,7 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import { useContext, useState } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { Bot, Brain, Check, ChevronDown, CircleAlert, File, Info, MessageCircleQuestionMark, Reply, TriangleAlert, X } from 'lucide-react';
|
|
5
|
+
import { Bot, Brain, Check, ChevronDown, CircleAlert, File, Info, MessageCircleQuestionMark, Reply, Send, SquareTerminal, TriangleAlert, X } from 'lucide-react';
|
|
6
6
|
import { WAITING_NOTE_PREFIX } from '@adecore/agent-contracts';
|
|
7
7
|
import { fileBadge, formatBytes, isImageAttachment } from '../../attachments.js';
|
|
8
8
|
import { useChatRow, useCurrentItem } from '../../../state/chats.js';
|
|
@@ -21,9 +21,9 @@ import { settledBlocksText } from '../markdown-blocks.js';
|
|
|
21
21
|
import { WHOLE_FADE_CLASS } from '../rehype-fade.js';
|
|
22
22
|
import { useRevealedText } from '../reveal.js';
|
|
23
23
|
import { formatAgo, formatElapsedShort, formatMoment, formatTokens } from '@adecore/ui/format';
|
|
24
|
-
import { Icon, MiddleTruncate, Tooltip, useTickingText } from '@adecore/ui';
|
|
24
|
+
import { Icon, IconButton, MiddleTruncate, Tooltip, useTickingText } from '@adecore/ui';
|
|
25
25
|
import { thoughtLine, thoughtPreview } from '../../logic/thought.js';
|
|
26
|
-
import { toolSummary, toolSummaryIsPath } from '../../logic/tools.js';
|
|
26
|
+
import { toolStartedAt, toolSummary, toolSummaryIsPath } from '../../logic/tools.js';
|
|
27
27
|
import { ROW_GUTTER } from '../icons.js';
|
|
28
28
|
import { useOpenForFind } from '../find-reveal.js';
|
|
29
29
|
import { ReplyContext, UiReplyNavigationContext } from '../reply-context.js';
|
|
@@ -33,6 +33,7 @@ import { useHostAttachmentUrl, useHostChatPlace, useHostReplyAuthor, useHostStre
|
|
|
33
33
|
import { REFERENCE_TONE, TOKEN_IN_MESSAGE } from '../chips.js';
|
|
34
34
|
import { copySelectionWithChips } from '../chip-clipboard.js';
|
|
35
35
|
import { useReferenceLookup } from '../thread-references.js';
|
|
36
|
+
import { RunningFor, ToolBody } from './WorkRows.js';
|
|
36
37
|
// A long prompt folds so the answer stays in view; the reader can open it.
|
|
37
38
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
38
39
|
const USER_FOLD_LINES = 8;
|
|
@@ -458,7 +459,9 @@ export function SentMessageRow(t0) {
|
|
|
458
459
|
const lookup = useReferenceLookup(chatId);
|
|
459
460
|
let t1;
|
|
460
461
|
if ($[0] !== message.title || $[1] !== t) {
|
|
461
|
-
t1 =
|
|
462
|
+
t1 = t("rows.message.heading", {
|
|
463
|
+
name: message.title || t("rows.message.unnamed")
|
|
464
|
+
});
|
|
462
465
|
$[0] = message.title;
|
|
463
466
|
$[1] = t;
|
|
464
467
|
$[2] = t1;
|
|
@@ -481,7 +484,7 @@ export function SentMessageRow(t0) {
|
|
|
481
484
|
if ($[6] !== id || $[7] !== message.text || $[8] !== t1 || $[9] !== t2) {
|
|
482
485
|
t3 = /*#__PURE__*/_jsx(SaidMessage, {
|
|
483
486
|
id: id,
|
|
484
|
-
|
|
487
|
+
heading: t1,
|
|
485
488
|
chip: t2,
|
|
486
489
|
text: message.text
|
|
487
490
|
});
|
|
@@ -520,14 +523,244 @@ export function SentMessageRow(t0) {
|
|
|
520
523
|
}
|
|
521
524
|
return t5;
|
|
522
525
|
}
|
|
526
|
+
/*
|
|
527
|
+
* A message this chat's agent sent another node: said by the agent, so outlined rather than filled like what is
|
|
528
|
+
* said to it, under a chip that names and opens where it went, with how it went and its call below.
|
|
529
|
+
*/
|
|
530
|
+
export function SentByAgentRow(t0) {
|
|
531
|
+
const $ = _c(56);
|
|
532
|
+
const {
|
|
533
|
+
chatId,
|
|
534
|
+
id,
|
|
535
|
+
tool,
|
|
536
|
+
sent
|
|
537
|
+
} = t0;
|
|
538
|
+
const {
|
|
539
|
+
t
|
|
540
|
+
} = useTranslation("agent-chat");
|
|
541
|
+
const lookup = useReferenceLookup(chatId);
|
|
542
|
+
const [open, setOpen] = useState(false);
|
|
543
|
+
let T0;
|
|
544
|
+
let T1;
|
|
545
|
+
let status;
|
|
546
|
+
let t1;
|
|
547
|
+
let t2;
|
|
548
|
+
let t3;
|
|
549
|
+
if ($[0] !== id || $[1] !== lookup || $[2] !== sent.state || $[3] !== sent.title || $[4] !== t) {
|
|
550
|
+
const name = sent.title || t("rows.message.unnamed");
|
|
551
|
+
const t4 = `rows.sent.${sent.state}`;
|
|
552
|
+
let t5;
|
|
553
|
+
if ($[11] !== t || $[12] !== t4) {
|
|
554
|
+
t5 = t(t4);
|
|
555
|
+
$[11] = t;
|
|
556
|
+
$[12] = t4;
|
|
557
|
+
$[13] = t5;
|
|
558
|
+
} else {
|
|
559
|
+
t5 = $[13];
|
|
560
|
+
}
|
|
561
|
+
status = t5;
|
|
562
|
+
T1 = ReferenceLookupContext;
|
|
563
|
+
t3 = lookup;
|
|
564
|
+
T0 = SaidMessage;
|
|
565
|
+
t1 = id;
|
|
566
|
+
t2 = t("rows.sent.heading", {
|
|
567
|
+
name
|
|
568
|
+
});
|
|
569
|
+
$[0] = id;
|
|
570
|
+
$[1] = lookup;
|
|
571
|
+
$[2] = sent.state;
|
|
572
|
+
$[3] = sent.title;
|
|
573
|
+
$[4] = t;
|
|
574
|
+
$[5] = T0;
|
|
575
|
+
$[6] = T1;
|
|
576
|
+
$[7] = status;
|
|
577
|
+
$[8] = t1;
|
|
578
|
+
$[9] = t2;
|
|
579
|
+
$[10] = t3;
|
|
580
|
+
} else {
|
|
581
|
+
T0 = $[5];
|
|
582
|
+
T1 = $[6];
|
|
583
|
+
status = $[7];
|
|
584
|
+
t1 = $[8];
|
|
585
|
+
t2 = $[9];
|
|
586
|
+
t3 = $[10];
|
|
587
|
+
}
|
|
588
|
+
let t4;
|
|
589
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
590
|
+
t4 = /*#__PURE__*/_jsx(Icon, {
|
|
591
|
+
icon: Send,
|
|
592
|
+
size: 12
|
|
593
|
+
});
|
|
594
|
+
$[14] = t4;
|
|
595
|
+
} else {
|
|
596
|
+
t4 = $[14];
|
|
597
|
+
}
|
|
598
|
+
let t5;
|
|
599
|
+
if ($[15] !== t) {
|
|
600
|
+
t5 = t("rows.sent.to");
|
|
601
|
+
$[15] = t;
|
|
602
|
+
$[16] = t5;
|
|
603
|
+
} else {
|
|
604
|
+
t5 = $[16];
|
|
605
|
+
}
|
|
606
|
+
const t6 = sent.title ?? "";
|
|
607
|
+
const t7 = sent.hint ?? sent.to;
|
|
608
|
+
let t8;
|
|
609
|
+
if ($[17] !== sent.to || $[18] !== t6 || $[19] !== t7) {
|
|
610
|
+
t8 = /*#__PURE__*/_jsx(ReferenceChip, {
|
|
611
|
+
id: sent.to,
|
|
612
|
+
lastName: t6,
|
|
613
|
+
goneHint: t7
|
|
614
|
+
});
|
|
615
|
+
$[17] = sent.to;
|
|
616
|
+
$[18] = t6;
|
|
617
|
+
$[19] = t7;
|
|
618
|
+
$[20] = t8;
|
|
619
|
+
} else {
|
|
620
|
+
t8 = $[20];
|
|
621
|
+
}
|
|
622
|
+
let t9;
|
|
623
|
+
if ($[21] !== t5 || $[22] !== t8) {
|
|
624
|
+
t9 = /*#__PURE__*/_jsxs("span", {
|
|
625
|
+
className: "flex items-center gap-1.5 text-xs text-text-muted",
|
|
626
|
+
children: [t4, t5, t8]
|
|
627
|
+
});
|
|
628
|
+
$[21] = t5;
|
|
629
|
+
$[22] = t8;
|
|
630
|
+
$[23] = t9;
|
|
631
|
+
} else {
|
|
632
|
+
t9 = $[23];
|
|
633
|
+
}
|
|
634
|
+
const t10 = sent.state === "failed";
|
|
635
|
+
let t11;
|
|
636
|
+
if ($[24] !== T0 || $[25] !== sent.text || $[26] !== t1 || $[27] !== t10 || $[28] !== t2 || $[29] !== t9) {
|
|
637
|
+
t11 = /*#__PURE__*/_jsx(T0, {
|
|
638
|
+
id: t1,
|
|
639
|
+
heading: t2,
|
|
640
|
+
chip: t9,
|
|
641
|
+
text: sent.text,
|
|
642
|
+
outlined: true,
|
|
643
|
+
dimmed: t10
|
|
644
|
+
});
|
|
645
|
+
$[24] = T0;
|
|
646
|
+
$[25] = sent.text;
|
|
647
|
+
$[26] = t1;
|
|
648
|
+
$[27] = t10;
|
|
649
|
+
$[28] = t2;
|
|
650
|
+
$[29] = t9;
|
|
651
|
+
$[30] = t11;
|
|
652
|
+
} else {
|
|
653
|
+
t11 = $[30];
|
|
654
|
+
}
|
|
655
|
+
const t12 = sent.reason === undefined ? status : `${status} · ${sent.reason}`;
|
|
656
|
+
let t13;
|
|
657
|
+
if ($[31] !== t12) {
|
|
658
|
+
t13 = /*#__PURE__*/_jsx("span", {
|
|
659
|
+
children: t12
|
|
660
|
+
});
|
|
661
|
+
$[31] = t12;
|
|
662
|
+
$[32] = t13;
|
|
663
|
+
} else {
|
|
664
|
+
t13 = $[32];
|
|
665
|
+
}
|
|
666
|
+
let t14;
|
|
667
|
+
if ($[33] !== sent.state || $[34] !== tool) {
|
|
668
|
+
t14 = sent.state === "sending" && /*#__PURE__*/_jsx(RunningFor, {
|
|
669
|
+
startedAt: toolStartedAt(tool)
|
|
670
|
+
});
|
|
671
|
+
$[33] = sent.state;
|
|
672
|
+
$[34] = tool;
|
|
673
|
+
$[35] = t14;
|
|
674
|
+
} else {
|
|
675
|
+
t14 = $[35];
|
|
676
|
+
}
|
|
677
|
+
const t15 = open ? "rows.sent.hideCall" : "rows.sent.showCall";
|
|
678
|
+
let t16;
|
|
679
|
+
if ($[36] !== t || $[37] !== t15) {
|
|
680
|
+
t16 = t(t15);
|
|
681
|
+
$[36] = t;
|
|
682
|
+
$[37] = t15;
|
|
683
|
+
$[38] = t16;
|
|
684
|
+
} else {
|
|
685
|
+
t16 = $[38];
|
|
686
|
+
}
|
|
687
|
+
let t17;
|
|
688
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
689
|
+
t17 = () => setOpen(_temp4);
|
|
690
|
+
$[39] = t17;
|
|
691
|
+
} else {
|
|
692
|
+
t17 = $[39];
|
|
693
|
+
}
|
|
694
|
+
let t18;
|
|
695
|
+
if ($[40] !== t16) {
|
|
696
|
+
t18 = /*#__PURE__*/_jsx(IconButton, {
|
|
697
|
+
icon: SquareTerminal,
|
|
698
|
+
size: "sm",
|
|
699
|
+
label: t16,
|
|
700
|
+
onClick: t17
|
|
701
|
+
});
|
|
702
|
+
$[40] = t16;
|
|
703
|
+
$[41] = t18;
|
|
704
|
+
} else {
|
|
705
|
+
t18 = $[41];
|
|
706
|
+
}
|
|
707
|
+
let t19;
|
|
708
|
+
if ($[42] !== t13 || $[43] !== t14 || $[44] !== t18) {
|
|
709
|
+
t19 = /*#__PURE__*/_jsxs("div", {
|
|
710
|
+
className: "mt-1 flex items-center gap-1.5 text-xs text-text-muted",
|
|
711
|
+
children: [t13, t14, t18]
|
|
712
|
+
});
|
|
713
|
+
$[42] = t13;
|
|
714
|
+
$[43] = t14;
|
|
715
|
+
$[44] = t18;
|
|
716
|
+
$[45] = t19;
|
|
717
|
+
} else {
|
|
718
|
+
t19 = $[45];
|
|
719
|
+
}
|
|
720
|
+
let t20;
|
|
721
|
+
if ($[46] !== chatId || $[47] !== open || $[48] !== tool) {
|
|
722
|
+
t20 = open && /*#__PURE__*/_jsx(ToolBody, {
|
|
723
|
+
tool: tool,
|
|
724
|
+
chatId: chatId
|
|
725
|
+
});
|
|
726
|
+
$[46] = chatId;
|
|
727
|
+
$[47] = open;
|
|
728
|
+
$[48] = tool;
|
|
729
|
+
$[49] = t20;
|
|
730
|
+
} else {
|
|
731
|
+
t20 = $[49];
|
|
732
|
+
}
|
|
733
|
+
let t21;
|
|
734
|
+
if ($[50] !== T1 || $[51] !== t11 || $[52] !== t19 || $[53] !== t20 || $[54] !== t3) {
|
|
735
|
+
t21 = /*#__PURE__*/_jsxs(T1, {
|
|
736
|
+
value: t3,
|
|
737
|
+
children: [t11, t19, t20]
|
|
738
|
+
});
|
|
739
|
+
$[50] = T1;
|
|
740
|
+
$[51] = t11;
|
|
741
|
+
$[52] = t19;
|
|
742
|
+
$[53] = t20;
|
|
743
|
+
$[54] = t3;
|
|
744
|
+
$[55] = t21;
|
|
745
|
+
} else {
|
|
746
|
+
t21 = $[55];
|
|
747
|
+
}
|
|
748
|
+
return t21;
|
|
749
|
+
}
|
|
523
750
|
/* What the host told the agent in front of a prompt, said under the host's own name, which the text no longer has to lead with. */
|
|
751
|
+
function _temp4(was) {
|
|
752
|
+
return !was;
|
|
753
|
+
}
|
|
524
754
|
function HostSaidRow(t0) {
|
|
525
|
-
const $ = _c(
|
|
755
|
+
const $ = _c(17);
|
|
526
756
|
const {
|
|
527
757
|
id,
|
|
528
758
|
text,
|
|
529
759
|
author
|
|
530
760
|
} = t0;
|
|
761
|
+
const {
|
|
762
|
+
t
|
|
763
|
+
} = useTranslation("agent-chat");
|
|
531
764
|
const prefix = `${author.name}: `;
|
|
532
765
|
let t1;
|
|
533
766
|
if ($[0] !== prefix || $[1] !== text) {
|
|
@@ -547,136 +780,150 @@ function HostSaidRow(t0) {
|
|
|
547
780
|
t1 = $[2];
|
|
548
781
|
}
|
|
549
782
|
const words = t1;
|
|
550
|
-
|
|
783
|
+
let t2;
|
|
784
|
+
if ($[5] !== author.name || $[6] !== t) {
|
|
785
|
+
t2 = t("rows.message.heading", {
|
|
786
|
+
name: author.name
|
|
787
|
+
});
|
|
788
|
+
$[5] = author.name;
|
|
789
|
+
$[6] = t;
|
|
790
|
+
$[7] = t2;
|
|
791
|
+
} else {
|
|
792
|
+
t2 = $[7];
|
|
793
|
+
}
|
|
551
794
|
let t3;
|
|
552
|
-
if ($[
|
|
795
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
553
796
|
t3 = clsx(TOKEN_IN_MESSAGE, REFERENCE_TONE, "inline-flex items-center gap-1");
|
|
554
|
-
$[
|
|
797
|
+
$[8] = t3;
|
|
555
798
|
} else {
|
|
556
|
-
t3 = $[
|
|
799
|
+
t3 = $[8];
|
|
557
800
|
}
|
|
558
801
|
let t4;
|
|
559
|
-
if ($[
|
|
802
|
+
if ($[9] !== author.mark || $[10] !== author.name) {
|
|
560
803
|
t4 = /*#__PURE__*/_jsxs("span", {
|
|
561
804
|
className: t3,
|
|
562
805
|
children: [author.mark, author.name]
|
|
563
806
|
});
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
807
|
+
$[9] = author.mark;
|
|
808
|
+
$[10] = author.name;
|
|
809
|
+
$[11] = t4;
|
|
567
810
|
} else {
|
|
568
|
-
t4 = $[
|
|
811
|
+
t4 = $[11];
|
|
569
812
|
}
|
|
570
813
|
let t5;
|
|
571
|
-
if ($[
|
|
814
|
+
if ($[12] !== id || $[13] !== t2 || $[14] !== t4 || $[15] !== words) {
|
|
572
815
|
t5 = /*#__PURE__*/_jsx(SaidMessage, {
|
|
573
816
|
id: id,
|
|
574
|
-
|
|
817
|
+
heading: t2,
|
|
575
818
|
chip: t4,
|
|
576
819
|
text: words
|
|
577
820
|
});
|
|
578
|
-
$[
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
821
|
+
$[12] = id;
|
|
822
|
+
$[13] = t2;
|
|
823
|
+
$[14] = t4;
|
|
824
|
+
$[15] = words;
|
|
825
|
+
$[16] = t5;
|
|
583
826
|
} else {
|
|
584
|
-
t5 = $[
|
|
827
|
+
t5 = $[16];
|
|
585
828
|
}
|
|
586
829
|
return t5;
|
|
587
830
|
}
|
|
588
831
|
/* A message the person did not write: a bubble on the left, quieter than theirs, under a chip of who said it. A long one folds. */
|
|
589
832
|
function SaidMessage(t0) {
|
|
590
|
-
const $ = _c(
|
|
833
|
+
const $ = _c(29);
|
|
591
834
|
const {
|
|
592
835
|
id,
|
|
593
|
-
|
|
836
|
+
heading,
|
|
594
837
|
chip,
|
|
595
|
-
text
|
|
838
|
+
text,
|
|
839
|
+
outlined: t1,
|
|
840
|
+
dimmed: t2
|
|
596
841
|
} = t0;
|
|
842
|
+
const outlined = t1 === undefined ? false : t1;
|
|
843
|
+
const dimmed = t2 === undefined ? false : t2;
|
|
597
844
|
const {
|
|
598
845
|
t
|
|
599
846
|
} = useTranslation("agent-chat");
|
|
600
847
|
const [open, setOpen] = useState(false);
|
|
601
|
-
let
|
|
848
|
+
let t3;
|
|
602
849
|
if ($[0] !== text) {
|
|
603
|
-
|
|
850
|
+
t3 = text.split("\n").length > USER_FOLD_LINES || text.length > USER_FOLD_CHARS;
|
|
604
851
|
$[0] = text;
|
|
605
|
-
$[1] =
|
|
852
|
+
$[1] = t3;
|
|
606
853
|
} else {
|
|
607
|
-
|
|
854
|
+
t3 = $[1];
|
|
608
855
|
}
|
|
609
|
-
const long =
|
|
856
|
+
const long = t3;
|
|
610
857
|
useOpenForFind(id, "text", setOpen);
|
|
611
|
-
let
|
|
612
|
-
if ($[2] !==
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
});
|
|
616
|
-
$[2] = name;
|
|
617
|
-
$[3] = t;
|
|
618
|
-
$[4] = t2;
|
|
619
|
-
} else {
|
|
620
|
-
t2 = $[4];
|
|
621
|
-
}
|
|
622
|
-
let t3;
|
|
623
|
-
if ($[5] !== t2) {
|
|
624
|
-
t3 = /*#__PURE__*/_jsx(MessageHeading, {
|
|
625
|
-
children: t2
|
|
858
|
+
let t4;
|
|
859
|
+
if ($[2] !== heading) {
|
|
860
|
+
t4 = /*#__PURE__*/_jsx(MessageHeading, {
|
|
861
|
+
children: heading
|
|
626
862
|
});
|
|
627
|
-
$[
|
|
628
|
-
$[
|
|
863
|
+
$[2] = heading;
|
|
864
|
+
$[3] = t4;
|
|
629
865
|
} else {
|
|
630
|
-
|
|
866
|
+
t4 = $[3];
|
|
631
867
|
}
|
|
632
|
-
let
|
|
633
|
-
if ($[
|
|
634
|
-
|
|
868
|
+
let t5;
|
|
869
|
+
if ($[4] !== chip) {
|
|
870
|
+
t5 = /*#__PURE__*/_jsx("div", {
|
|
635
871
|
className: "mb-1.5 flex max-w-[80%]",
|
|
636
872
|
children: chip
|
|
637
873
|
});
|
|
638
|
-
$[
|
|
639
|
-
$[
|
|
874
|
+
$[4] = chip;
|
|
875
|
+
$[5] = t5;
|
|
640
876
|
} else {
|
|
641
|
-
|
|
877
|
+
t5 = $[5];
|
|
642
878
|
}
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
$[
|
|
879
|
+
const t6 = outlined ? "border border-border" : "bg-surface-hover";
|
|
880
|
+
const t7 = dimmed && "opacity-60";
|
|
881
|
+
let t8;
|
|
882
|
+
if ($[6] !== t6 || $[7] !== t7) {
|
|
883
|
+
t8 = clsx("relative max-w-[80%] rounded-2xl px-3.5 py-2.5 text-sm wrap-anywhere text-text select-text", t6, t7);
|
|
884
|
+
$[6] = t6;
|
|
885
|
+
$[7] = t7;
|
|
886
|
+
$[8] = t8;
|
|
649
887
|
} else {
|
|
650
|
-
|
|
888
|
+
t8 = $[8];
|
|
651
889
|
}
|
|
652
|
-
|
|
890
|
+
const t9 = long && !open && FOLD;
|
|
891
|
+
let t10;
|
|
892
|
+
if ($[9] !== t9) {
|
|
893
|
+
t10 = clsx(t9);
|
|
894
|
+
$[9] = t9;
|
|
895
|
+
$[10] = t10;
|
|
896
|
+
} else {
|
|
897
|
+
t10 = $[10];
|
|
898
|
+
}
|
|
899
|
+
let t11;
|
|
653
900
|
if ($[11] !== text) {
|
|
654
|
-
|
|
901
|
+
t11 = /*#__PURE__*/_jsx(MessageMarkdown, {
|
|
655
902
|
text: text
|
|
656
903
|
});
|
|
657
904
|
$[11] = text;
|
|
658
|
-
$[12] =
|
|
905
|
+
$[12] = t11;
|
|
659
906
|
} else {
|
|
660
|
-
|
|
907
|
+
t11 = $[12];
|
|
661
908
|
}
|
|
662
|
-
let
|
|
663
|
-
if ($[13] !==
|
|
664
|
-
|
|
909
|
+
let t12;
|
|
910
|
+
if ($[13] !== t10 || $[14] !== t11) {
|
|
911
|
+
t12 = /*#__PURE__*/_jsx("div", {
|
|
665
912
|
"data-find-field": "text",
|
|
666
|
-
className:
|
|
667
|
-
children:
|
|
913
|
+
className: t10,
|
|
914
|
+
children: t11
|
|
668
915
|
});
|
|
669
|
-
$[13] =
|
|
670
|
-
$[14] =
|
|
671
|
-
$[15] =
|
|
916
|
+
$[13] = t10;
|
|
917
|
+
$[14] = t11;
|
|
918
|
+
$[15] = t12;
|
|
672
919
|
} else {
|
|
673
|
-
|
|
920
|
+
t12 = $[15];
|
|
674
921
|
}
|
|
675
|
-
let
|
|
922
|
+
let t13;
|
|
676
923
|
if ($[16] !== long || $[17] !== open || $[18] !== t) {
|
|
677
|
-
|
|
924
|
+
t13 = long && /*#__PURE__*/_jsxs("button", {
|
|
678
925
|
className: "mt-1 flex items-center gap-1 text-xs text-text-muted hover:text-text",
|
|
679
|
-
onClick: () => setOpen(
|
|
926
|
+
onClick: () => setOpen(_temp5),
|
|
680
927
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
681
928
|
icon: ChevronDown,
|
|
682
929
|
size: 12,
|
|
@@ -686,44 +933,45 @@ function SaidMessage(t0) {
|
|
|
686
933
|
$[16] = long;
|
|
687
934
|
$[17] = open;
|
|
688
935
|
$[18] = t;
|
|
689
|
-
$[19] =
|
|
936
|
+
$[19] = t13;
|
|
690
937
|
} else {
|
|
691
|
-
|
|
938
|
+
t13 = $[19];
|
|
692
939
|
}
|
|
693
|
-
let
|
|
694
|
-
if ($[20] !==
|
|
695
|
-
|
|
696
|
-
className:
|
|
697
|
-
children: [
|
|
940
|
+
let t14;
|
|
941
|
+
if ($[20] !== t12 || $[21] !== t13 || $[22] !== t8) {
|
|
942
|
+
t14 = /*#__PURE__*/_jsxs("div", {
|
|
943
|
+
className: t8,
|
|
944
|
+
children: [t12, t13]
|
|
698
945
|
});
|
|
699
|
-
$[20] =
|
|
700
|
-
$[21] =
|
|
701
|
-
$[22] =
|
|
946
|
+
$[20] = t12;
|
|
947
|
+
$[21] = t13;
|
|
948
|
+
$[22] = t8;
|
|
949
|
+
$[23] = t14;
|
|
702
950
|
} else {
|
|
703
|
-
|
|
951
|
+
t14 = $[23];
|
|
704
952
|
}
|
|
705
|
-
let
|
|
706
|
-
if ($[
|
|
707
|
-
|
|
953
|
+
let t15;
|
|
954
|
+
if ($[24] !== id || $[25] !== t14 || $[26] !== t4 || $[27] !== t5) {
|
|
955
|
+
t15 = /*#__PURE__*/_jsxs("div", {
|
|
708
956
|
"data-find-item": id,
|
|
709
957
|
className: "flex flex-col items-start",
|
|
710
|
-
children: [
|
|
958
|
+
children: [t4, t5, t14]
|
|
711
959
|
});
|
|
712
|
-
$[
|
|
713
|
-
$[
|
|
714
|
-
$[25] = t3;
|
|
960
|
+
$[24] = id;
|
|
961
|
+
$[25] = t14;
|
|
715
962
|
$[26] = t4;
|
|
716
|
-
$[27] =
|
|
963
|
+
$[27] = t5;
|
|
964
|
+
$[28] = t15;
|
|
717
965
|
} else {
|
|
718
|
-
|
|
966
|
+
t15 = $[28];
|
|
719
967
|
}
|
|
720
|
-
return
|
|
968
|
+
return t15;
|
|
721
969
|
}
|
|
722
970
|
/*
|
|
723
971
|
* The choice a message answers. The label stays out of the message, which holds exactly what the agent
|
|
724
972
|
* read, and out of a copied selection; a screen reader hears it between the heading and the message.
|
|
725
973
|
*/
|
|
726
|
-
function
|
|
974
|
+
function _temp5(o) {
|
|
727
975
|
return !o;
|
|
728
976
|
}
|
|
729
977
|
function ChoiceLine(t0) {
|
|
@@ -929,7 +1177,7 @@ function ReplyHeading(t0) {
|
|
|
929
1177
|
} = useTranslation("agent-chat");
|
|
930
1178
|
const context = useContext(ReplyContext);
|
|
931
1179
|
const author = useReplyAuthor(chatId);
|
|
932
|
-
const kind = useChatRow(chatId,
|
|
1180
|
+
const kind = useChatRow(chatId, _temp6);
|
|
933
1181
|
let t1;
|
|
934
1182
|
if ($[0] !== context?.provider || $[1] !== kind) {
|
|
935
1183
|
t1 = s => s.providers.find(provider => provider.kind === (context?.provider ?? kind))?.name;
|
|
@@ -966,7 +1214,7 @@ function ReplyHeading(t0) {
|
|
|
966
1214
|
* The line over a reply with who wrote it and how long ago, when the host names its author. A screen
|
|
967
1215
|
* reader hears the name from the reply's own heading, so this line is for the eye only.
|
|
968
1216
|
*/
|
|
969
|
-
function
|
|
1217
|
+
function _temp6(row) {
|
|
970
1218
|
return row?.info.provider;
|
|
971
1219
|
}
|
|
972
1220
|
export function ReplyHeader(t0) {
|
|
@@ -1234,7 +1482,7 @@ export function AssistantRow(t0) {
|
|
|
1234
1482
|
t6 = /*#__PURE__*/_jsxs("div", {
|
|
1235
1483
|
"data-find-item": item.id,
|
|
1236
1484
|
className: "-mx-1 px-1 pb-2",
|
|
1237
|
-
onCopy:
|
|
1485
|
+
onCopy: _temp7,
|
|
1238
1486
|
children: [t3, t4, t5]
|
|
1239
1487
|
});
|
|
1240
1488
|
$[37] = item.id;
|
|
@@ -1345,7 +1593,7 @@ export function AssistantRow(t0) {
|
|
|
1345
1593
|
t9 = /*#__PURE__*/_jsxs("div", {
|
|
1346
1594
|
"data-find-item": t2,
|
|
1347
1595
|
className: t4,
|
|
1348
|
-
onCopy:
|
|
1596
|
+
onCopy: _temp8,
|
|
1349
1597
|
children: [t5, t7, t8]
|
|
1350
1598
|
});
|
|
1351
1599
|
$[61] = item.id;
|
|
@@ -1364,10 +1612,10 @@ export function AssistantRow(t0) {
|
|
|
1364
1612
|
* once the answer starts, because the thought is worth a glance and rarely worth reading twice:
|
|
1365
1613
|
* folded, it shows the heading it opens with or itself on one line, and opened, it reads as Markdown.
|
|
1366
1614
|
*/
|
|
1367
|
-
function
|
|
1615
|
+
function _temp8(e_0) {
|
|
1368
1616
|
return copySelectionWithChips(e_0.nativeEvent);
|
|
1369
1617
|
}
|
|
1370
|
-
function
|
|
1618
|
+
function _temp7(e) {
|
|
1371
1619
|
return copySelectionWithChips(e.nativeEvent);
|
|
1372
1620
|
}
|
|
1373
1621
|
export function ThinkingRow(t0) {
|
|
@@ -1424,7 +1672,7 @@ export function ThinkingRow(t0) {
|
|
|
1424
1672
|
const t6 = item.streaming ? undefined : open;
|
|
1425
1673
|
let t7;
|
|
1426
1674
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1427
|
-
t7 = () => setOpen(
|
|
1675
|
+
t7 = () => setOpen(_temp9);
|
|
1428
1676
|
$[11] = t7;
|
|
1429
1677
|
} else {
|
|
1430
1678
|
t7 = $[11];
|
|
@@ -1530,7 +1778,7 @@ export function ThinkingRow(t0) {
|
|
|
1530
1778
|
* The latest thought of a running turn over the call it led to, as its heading or first sentence,
|
|
1531
1779
|
* so what the model found stays in view while it checks it. Nothing while the thought has no line yet.
|
|
1532
1780
|
*/
|
|
1533
|
-
function
|
|
1781
|
+
function _temp9(o) {
|
|
1534
1782
|
return !o;
|
|
1535
1783
|
}
|
|
1536
1784
|
export function LiveThoughtRow(t0) {
|