@adecore/agents-react 0.50.7 → 0.52.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/index.d.ts +2 -1
- package/dist/chat/index.js +2 -1
- package/dist/chat/logic/command-looks.d.ts +17 -5
- package/dist/chat/logic/command-looks.js +35 -7
- package/dist/chat/logic/timeline.d.ts +6 -4
- package/dist/chat/logic/timeline.js +19 -21
- package/dist/chat/logic/tool-looks.d.ts +16 -0
- package/dist/chat/logic/tool-looks.js +188 -0
- package/dist/chat/ui/Markdown.js +97 -103
- package/dist/chat/ui/ShellCommand.d.ts +2 -1
- package/dist/chat/ui/ShellCommand.js +73 -22
- package/dist/chat/ui/SubagentTimeline.js +5 -2
- package/dist/chat/ui/Timeline.js +2 -1
- package/dist/chat/ui/rows/RowContainer.js +26 -23
- package/dist/chat/ui/rows/WorkRows.d.ts +3 -4
- package/dist/chat/ui/rows/WorkRows.js +592 -519
- package/dist/chat/ui/rows/row-rhythm.d.ts +2 -2
- package/dist/chat/ui/rows/row-rhythm.js +9 -6
- package/dist/chat/ui/thread-references.d.ts +1 -0
- package/dist/chat/ui/thread-references.js +4 -3
- package/dist/host.d.ts +28 -0
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +3 -0
- package/dist/locales/en/agent-chat.js +3 -0
- package/dist/locales/nl/agent-chat.d.ts +3 -0
- package/dist/locales/nl/agent-chat.js +3 -0
- package/package.json +8 -8
- package/src/chat/index.ts +2 -1
- package/src/chat/logic/command-looks.ts +51 -10
- package/src/chat/logic/timeline.ts +28 -24
- package/src/chat/logic/tool-looks.ts +228 -0
- package/src/chat/ui/Markdown.tsx +21 -7
- package/src/chat/ui/ShellCommand.tsx +33 -6
- package/src/chat/ui/SubagentTimeline.tsx +3 -2
- package/src/chat/ui/Timeline.tsx +2 -1
- package/src/chat/ui/rows/RowContainer.tsx +4 -2
- package/src/chat/ui/rows/WorkRows.tsx +46 -33
- package/src/chat/ui/rows/row-rhythm.ts +9 -6
- package/src/chat/ui/thread-references.ts +5 -1
- package/src/host.ts +51 -0
- package/src/index.ts +3 -0
- package/src/locales/en/agent-chat.ts +3 -0
- package/src/locales/nl/agent-chat.ts +3 -0
package/dist/chat/ui/Markdown.js
CHANGED
|
@@ -576,7 +576,7 @@ const replyComponents = {
|
|
|
576
576
|
h6: replyHeading(6)
|
|
577
577
|
};
|
|
578
578
|
function ReplyCode(t0) {
|
|
579
|
-
const $ = _c(
|
|
579
|
+
const $ = _c(21);
|
|
580
580
|
const {
|
|
581
581
|
className,
|
|
582
582
|
children,
|
|
@@ -585,6 +585,7 @@ function ReplyCode(t0) {
|
|
|
585
585
|
const reply = useContext(ShellCodeBlockReplyContext);
|
|
586
586
|
const block = useContext(BlockCodeContext);
|
|
587
587
|
const {
|
|
588
|
+
renderCodeFence,
|
|
588
589
|
renderShellCodeBlock
|
|
589
590
|
} = useChatHost();
|
|
590
591
|
const properties = node?.properties;
|
|
@@ -592,7 +593,7 @@ function ReplyCode(t0) {
|
|
|
592
593
|
const code = properties?.["data-shell-code"];
|
|
593
594
|
let t1;
|
|
594
595
|
let text;
|
|
595
|
-
if ($[0] !== block || $[1] !== children || $[2] !== className || $[3] !== code || $[4] !== language || $[5] !== properties || $[6] !==
|
|
596
|
+
if ($[0] !== block || $[1] !== children || $[2] !== className || $[3] !== code || $[4] !== language || $[5] !== properties || $[6] !== renderCodeFence || $[7] !== renderShellCodeBlock || $[8] !== reply) {
|
|
596
597
|
t1 = Symbol.for("react.early_return_sentinel");
|
|
597
598
|
bb0: {
|
|
598
599
|
const shell = (language === "sh" || language === "bash" || language === "zsh") && typeof code === "string" ? {
|
|
@@ -601,62 +602,47 @@ function ReplyCode(t0) {
|
|
|
601
602
|
closed: properties?.["data-shell-closed"] === true
|
|
602
603
|
} : null;
|
|
603
604
|
text = String(children ?? "");
|
|
604
|
-
if (block
|
|
605
|
+
if (block) {
|
|
606
|
+
let body;
|
|
607
|
+
let lang;
|
|
605
608
|
let t2;
|
|
606
|
-
if ($[
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
$[
|
|
616
|
-
$[11] = t2;
|
|
609
|
+
if ($[11] !== className || $[12] !== renderCodeFence || $[13] !== text) {
|
|
610
|
+
lang = languageOf(className);
|
|
611
|
+
body = text.replace(/\n$/, "");
|
|
612
|
+
t2 = renderCodeFence?.(lang, body);
|
|
613
|
+
$[11] = className;
|
|
614
|
+
$[12] = renderCodeFence;
|
|
615
|
+
$[13] = text;
|
|
616
|
+
$[14] = body;
|
|
617
|
+
$[15] = lang;
|
|
618
|
+
$[16] = t2;
|
|
617
619
|
} else {
|
|
618
|
-
|
|
620
|
+
body = $[14];
|
|
621
|
+
lang = $[15];
|
|
622
|
+
t2 = $[16];
|
|
619
623
|
}
|
|
620
|
-
|
|
621
|
-
if (
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
});
|
|
625
|
-
$[13] = t2;
|
|
626
|
-
$[14] = t3;
|
|
627
|
-
} else {
|
|
628
|
-
t3 = $[14];
|
|
624
|
+
const drawn = t2;
|
|
625
|
+
if (drawn !== undefined && drawn !== null) {
|
|
626
|
+
t1 = drawn;
|
|
627
|
+
break bb0;
|
|
629
628
|
}
|
|
630
|
-
|
|
631
|
-
break bb0;
|
|
632
|
-
}
|
|
633
|
-
if (block) {
|
|
634
|
-
let t2;
|
|
635
|
-
if ($[15] !== text) {
|
|
629
|
+
if (lang === "mermaid") {
|
|
636
630
|
let t3;
|
|
637
|
-
if ($[17]
|
|
638
|
-
t3 =
|
|
639
|
-
|
|
631
|
+
if ($[17] !== body) {
|
|
632
|
+
t3 = /*#__PURE__*/_jsx(Diagram, {
|
|
633
|
+
code: body
|
|
634
|
+
});
|
|
635
|
+
$[17] = body;
|
|
636
|
+
$[18] = t3;
|
|
640
637
|
} else {
|
|
641
|
-
t3 = $[
|
|
638
|
+
t3 = $[18];
|
|
642
639
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
$[16] = t2;
|
|
646
|
-
} else {
|
|
647
|
-
t2 = $[16];
|
|
648
|
-
}
|
|
649
|
-
let t3;
|
|
650
|
-
if ($[18] !== className) {
|
|
651
|
-
t3 = languageOf(className);
|
|
652
|
-
$[18] = className;
|
|
653
|
-
$[19] = t3;
|
|
654
|
-
} else {
|
|
655
|
-
t3 = $[19];
|
|
640
|
+
t1 = t3;
|
|
641
|
+
break bb0;
|
|
656
642
|
}
|
|
657
643
|
t1 = /*#__PURE__*/_jsx(CodeBlock, {
|
|
658
|
-
code:
|
|
659
|
-
lang:
|
|
644
|
+
code: body,
|
|
645
|
+
lang: lang,
|
|
660
646
|
actions: shellCodeBlockActions(reply, shell, renderShellCodeBlock)
|
|
661
647
|
});
|
|
662
648
|
break bb0;
|
|
@@ -668,26 +654,27 @@ function ReplyCode(t0) {
|
|
|
668
654
|
$[3] = code;
|
|
669
655
|
$[4] = language;
|
|
670
656
|
$[5] = properties;
|
|
671
|
-
$[6] =
|
|
672
|
-
$[7] =
|
|
673
|
-
$[8] =
|
|
674
|
-
$[9] =
|
|
657
|
+
$[6] = renderCodeFence;
|
|
658
|
+
$[7] = renderShellCodeBlock;
|
|
659
|
+
$[8] = reply;
|
|
660
|
+
$[9] = t1;
|
|
661
|
+
$[10] = text;
|
|
675
662
|
} else {
|
|
676
|
-
t1 = $[
|
|
677
|
-
text = $[
|
|
663
|
+
t1 = $[9];
|
|
664
|
+
text = $[10];
|
|
678
665
|
}
|
|
679
666
|
if (t1 !== Symbol.for("react.early_return_sentinel")) {
|
|
680
667
|
return t1;
|
|
681
668
|
}
|
|
682
669
|
let t2;
|
|
683
|
-
if ($[
|
|
670
|
+
if ($[19] !== text) {
|
|
684
671
|
t2 = /*#__PURE__*/_jsx(InlineCode, {
|
|
685
672
|
text: text
|
|
686
673
|
});
|
|
687
|
-
$[
|
|
688
|
-
$[
|
|
674
|
+
$[19] = text;
|
|
675
|
+
$[20] = t2;
|
|
689
676
|
} else {
|
|
690
|
-
t2 = $[
|
|
677
|
+
t2 = $[20];
|
|
691
678
|
}
|
|
692
679
|
return t2;
|
|
693
680
|
}
|
|
@@ -947,57 +934,64 @@ const ReplyFence = memo(function ReplyFence(t0) {
|
|
|
947
934
|
reply
|
|
948
935
|
} = t0;
|
|
949
936
|
const {
|
|
937
|
+
renderCodeFence,
|
|
950
938
|
renderShellCodeBlock
|
|
951
939
|
} = useChatHost();
|
|
952
940
|
let t1;
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
941
|
+
let t2;
|
|
942
|
+
if ($[0] !== body || $[1] !== info || $[2] !== open || $[3] !== renderCodeFence || $[4] !== renderShellCodeBlock || $[5] !== reply || $[6] !== source) {
|
|
943
|
+
t2 = Symbol.for("react.early_return_sentinel");
|
|
944
|
+
bb0: {
|
|
945
|
+
let t3;
|
|
946
|
+
if ($[9] !== info) {
|
|
947
|
+
let t4;
|
|
948
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
949
|
+
t4 = /[ \t]/;
|
|
950
|
+
$[11] = t4;
|
|
951
|
+
} else {
|
|
952
|
+
t4 = $[11];
|
|
953
|
+
}
|
|
954
|
+
t3 = info.split(t4, 1);
|
|
955
|
+
$[9] = info;
|
|
956
|
+
$[10] = t3;
|
|
957
|
+
} else {
|
|
958
|
+
t3 = $[10];
|
|
959
|
+
}
|
|
960
|
+
const lang = languageOf(`language-${t3[0]}`);
|
|
961
|
+
const shell = reply === undefined ? null : shellFence(source);
|
|
962
|
+
const drawn = open ? null : renderCodeFence?.(lang, body);
|
|
963
|
+
if (drawn !== undefined && drawn !== null) {
|
|
964
|
+
t2 = drawn;
|
|
965
|
+
break bb0;
|
|
966
|
+
}
|
|
967
|
+
t1 = /*#__PURE__*/_jsx(CodeStreamingContext.Provider, {
|
|
968
|
+
value: open,
|
|
969
|
+
children: lang === "mermaid" ? /*#__PURE__*/_jsx(Diagram, {
|
|
970
|
+
code: body
|
|
971
|
+
}) : /*#__PURE__*/_jsx(CodeBlock, {
|
|
972
|
+
code: body,
|
|
973
|
+
lang: lang,
|
|
974
|
+
actions: shellCodeBlockActions(reply ?? null, shell, renderShellCodeBlock)
|
|
975
|
+
})
|
|
976
|
+
});
|
|
960
977
|
}
|
|
961
|
-
|
|
962
|
-
$[
|
|
963
|
-
$[
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
t3 = languageOf(t2);
|
|
971
|
-
$[3] = t2;
|
|
972
|
-
$[4] = t3;
|
|
978
|
+
$[0] = body;
|
|
979
|
+
$[1] = info;
|
|
980
|
+
$[2] = open;
|
|
981
|
+
$[3] = renderCodeFence;
|
|
982
|
+
$[4] = renderShellCodeBlock;
|
|
983
|
+
$[5] = reply;
|
|
984
|
+
$[6] = source;
|
|
985
|
+
$[7] = t1;
|
|
986
|
+
$[8] = t2;
|
|
973
987
|
} else {
|
|
974
|
-
|
|
988
|
+
t1 = $[7];
|
|
989
|
+
t2 = $[8];
|
|
975
990
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
if ($[5] !== body || $[6] !== lang || $[7] !== open || $[8] !== renderShellCodeBlock || $[9] !== reply || $[10] !== source) {
|
|
979
|
-
const shell = reply === undefined ? null : shellFence(source);
|
|
980
|
-
t4 = /*#__PURE__*/_jsx(CodeStreamingContext.Provider, {
|
|
981
|
-
value: open,
|
|
982
|
-
children: lang === "mermaid" ? /*#__PURE__*/_jsx(Diagram, {
|
|
983
|
-
code: body
|
|
984
|
-
}) : /*#__PURE__*/_jsx(CodeBlock, {
|
|
985
|
-
code: body,
|
|
986
|
-
lang: lang,
|
|
987
|
-
actions: shellCodeBlockActions(reply ?? null, shell, renderShellCodeBlock)
|
|
988
|
-
})
|
|
989
|
-
});
|
|
990
|
-
$[5] = body;
|
|
991
|
-
$[6] = lang;
|
|
992
|
-
$[7] = open;
|
|
993
|
-
$[8] = renderShellCodeBlock;
|
|
994
|
-
$[9] = reply;
|
|
995
|
-
$[10] = source;
|
|
996
|
-
$[11] = t4;
|
|
997
|
-
} else {
|
|
998
|
-
t4 = $[11];
|
|
991
|
+
if (t2 !== Symbol.for("react.early_return_sentinel")) {
|
|
992
|
+
return t2;
|
|
999
993
|
}
|
|
1000
|
-
return
|
|
994
|
+
return t1;
|
|
1001
995
|
});
|
|
1002
996
|
/*
|
|
1003
997
|
* A reply in a chat thread, parsed a block at a time so a delta only parses the block that grows,
|
|
@@ -6,8 +6,9 @@ export interface NamedWord {
|
|
|
6
6
|
readonly word: string;
|
|
7
7
|
readonly name: CommandName;
|
|
8
8
|
}
|
|
9
|
-
export declare function ShellCommand({ command, code, names }: {
|
|
9
|
+
export declare function ShellCommand({ command, code, names, plain }: {
|
|
10
10
|
command: string;
|
|
11
11
|
code?: readonly EmbeddedCode[];
|
|
12
12
|
names?: readonly NamedWord[];
|
|
13
|
+
plain?: boolean;
|
|
13
14
|
}): import("react").JSX.Element;
|
|
@@ -5,6 +5,7 @@ import { EMBEDDED_CODE_LIMIT, SHELL_LANGUAGE, embeddedCode } from '../logic/embe
|
|
|
5
5
|
import { useChatHost } from '../../host.js';
|
|
6
6
|
import { useCodeTheme } from './code-theme.js';
|
|
7
7
|
import { tokenStyle, useCodeHighlighter } from './highlighter.js';
|
|
8
|
+
import { ReferenceChip } from './ReferenceChip.js';
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
10
|
const NO_CODE = [];
|
|
10
11
|
const NO_NAMES = [];
|
|
@@ -123,50 +124,98 @@ function draw(command, runs, from, to) {
|
|
|
123
124
|
}
|
|
124
125
|
return parts;
|
|
125
126
|
}
|
|
126
|
-
/*
|
|
127
|
+
/*
|
|
128
|
+
* A word as its name: the `#` chip of the reference it is, else in a frame so it reads as one. The word itself
|
|
129
|
+
* stays in the text, for a find.
|
|
130
|
+
*/
|
|
127
131
|
function Name(t0) {
|
|
128
|
-
const $ = _c(
|
|
132
|
+
const $ = _c(17);
|
|
129
133
|
const {
|
|
130
134
|
named
|
|
131
135
|
} = t0;
|
|
136
|
+
const {
|
|
137
|
+
reference
|
|
138
|
+
} = named.name;
|
|
139
|
+
if (reference !== undefined) {
|
|
140
|
+
let t1;
|
|
141
|
+
if ($[0] !== named.name.name || $[1] !== reference) {
|
|
142
|
+
t1 = /*#__PURE__*/_jsx(ReferenceChip, {
|
|
143
|
+
id: reference,
|
|
144
|
+
lastName: named.name.name
|
|
145
|
+
});
|
|
146
|
+
$[0] = named.name.name;
|
|
147
|
+
$[1] = reference;
|
|
148
|
+
$[2] = t1;
|
|
149
|
+
} else {
|
|
150
|
+
t1 = $[2];
|
|
151
|
+
}
|
|
152
|
+
let t2;
|
|
153
|
+
if ($[3] !== named.word) {
|
|
154
|
+
t2 = /*#__PURE__*/_jsx("span", {
|
|
155
|
+
className: "sr-only",
|
|
156
|
+
children: named.word
|
|
157
|
+
});
|
|
158
|
+
$[3] = named.word;
|
|
159
|
+
$[4] = t2;
|
|
160
|
+
} else {
|
|
161
|
+
t2 = $[4];
|
|
162
|
+
}
|
|
163
|
+
let t3;
|
|
164
|
+
if ($[5] !== t1 || $[6] !== t2) {
|
|
165
|
+
t3 = /*#__PURE__*/_jsxs("span", {
|
|
166
|
+
className: "font-sans",
|
|
167
|
+
onClick: _temp,
|
|
168
|
+
children: [t1, t2]
|
|
169
|
+
});
|
|
170
|
+
$[5] = t1;
|
|
171
|
+
$[6] = t2;
|
|
172
|
+
$[7] = t3;
|
|
173
|
+
} else {
|
|
174
|
+
t3 = $[7];
|
|
175
|
+
}
|
|
176
|
+
return t3;
|
|
177
|
+
}
|
|
132
178
|
let t1;
|
|
133
|
-
if ($[
|
|
179
|
+
if ($[8] !== named.word) {
|
|
134
180
|
t1 = /*#__PURE__*/_jsx("span", {
|
|
135
181
|
className: "sr-only",
|
|
136
182
|
children: named.word
|
|
137
183
|
});
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
184
|
+
$[8] = named.word;
|
|
185
|
+
$[9] = t1;
|
|
140
186
|
} else {
|
|
141
|
-
t1 = $[
|
|
187
|
+
t1 = $[9];
|
|
142
188
|
}
|
|
143
189
|
let t2;
|
|
144
|
-
if ($[
|
|
190
|
+
if ($[10] !== named.name.icon || $[11] !== named.name.name || $[12] !== t1) {
|
|
145
191
|
t2 = /*#__PURE__*/_jsxs("span", {
|
|
146
192
|
className: "inline-flex items-center gap-1 rounded bg-surface-hover px-1 font-sans text-text ring-1 ring-border ring-inset",
|
|
147
193
|
children: [named.name.icon, named.name.name, t1]
|
|
148
194
|
});
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
195
|
+
$[10] = named.name.icon;
|
|
196
|
+
$[11] = named.name.name;
|
|
197
|
+
$[12] = t1;
|
|
198
|
+
$[13] = t2;
|
|
153
199
|
} else {
|
|
154
|
-
t2 = $[
|
|
200
|
+
t2 = $[13];
|
|
155
201
|
}
|
|
156
202
|
let t3;
|
|
157
|
-
if ($[
|
|
203
|
+
if ($[14] !== named.word || $[15] !== t2) {
|
|
158
204
|
t3 = /*#__PURE__*/_jsx(Tooltip, {
|
|
159
205
|
label: named.word,
|
|
160
206
|
children: t2
|
|
161
207
|
});
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
208
|
+
$[14] = named.word;
|
|
209
|
+
$[15] = t2;
|
|
210
|
+
$[16] = t3;
|
|
165
211
|
} else {
|
|
166
|
-
t3 = $[
|
|
212
|
+
t3 = $[16];
|
|
167
213
|
}
|
|
168
214
|
return t3;
|
|
169
215
|
}
|
|
216
|
+
function _temp(e) {
|
|
217
|
+
return e.stopPropagation();
|
|
218
|
+
}
|
|
170
219
|
function drawNamed(command, runs, names) {
|
|
171
220
|
const parts = [];
|
|
172
221
|
let at = 0;
|
|
@@ -187,11 +236,13 @@ function drawNamed(command, runs, names) {
|
|
|
187
236
|
* `python3 -c` argument, a heredoc) in its own language. Plain text until the grammars are in, which
|
|
188
237
|
* changes no size; a command past the limit stays plain. `code` adds stretches whose language the
|
|
189
238
|
* caller knows, and `names` draws words as the names a host gave them, both as offsets into `command`.
|
|
239
|
+
* `plain` draws text that is no shell source uncolored, with its names.
|
|
190
240
|
*/
|
|
191
241
|
export function ShellCommand({
|
|
192
242
|
command,
|
|
193
243
|
code = NO_CODE,
|
|
194
|
-
names = NO_NAMES
|
|
244
|
+
names = NO_NAMES,
|
|
245
|
+
plain = false
|
|
195
246
|
}) {
|
|
196
247
|
// The highlighter's cache fills in place; compiled, the runs it gave before its grammars loaded would stay.
|
|
197
248
|
'use no memo';
|
|
@@ -203,10 +254,10 @@ export function ShellCommand({
|
|
|
203
254
|
const highlighter = useCodeHighlighter();
|
|
204
255
|
// Bumped when a load settles, so the cache is asked again.
|
|
205
256
|
const [, setLoads] = useState(0);
|
|
206
|
-
const
|
|
207
|
-
const runs =
|
|
257
|
+
const uncolored = plain || command.length > EMBEDDED_CODE_LIMIT;
|
|
258
|
+
const runs = uncolored ? null : highlight(command, code, theme, highlighter);
|
|
208
259
|
useEffect(() => {
|
|
209
|
-
if (runs !== null ||
|
|
260
|
+
if (runs !== null || uncolored) {
|
|
210
261
|
return;
|
|
211
262
|
}
|
|
212
263
|
let cancelled = false;
|
|
@@ -214,7 +265,7 @@ export function ShellCommand({
|
|
|
214
265
|
return () => {
|
|
215
266
|
cancelled = true;
|
|
216
267
|
};
|
|
217
|
-
}, [highlighter, command, code, theme, custom, runs,
|
|
268
|
+
}, [highlighter, command, code, theme, custom, runs, uncolored]);
|
|
218
269
|
if (names.length > 0) {
|
|
219
270
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
220
271
|
children: drawNamed(command, runs, names)
|
|
@@ -45,7 +45,9 @@ export function SubagentTimeline(t0) {
|
|
|
45
45
|
} = useTranslation("agent-chat");
|
|
46
46
|
const scope = useChatScope();
|
|
47
47
|
const {
|
|
48
|
-
commandLooks
|
|
48
|
+
commandLooks,
|
|
49
|
+
toolLooks,
|
|
50
|
+
saidBy
|
|
49
51
|
} = useChatHost();
|
|
50
52
|
const {
|
|
51
53
|
trail,
|
|
@@ -131,6 +133,7 @@ export function SubagentTimeline(t0) {
|
|
|
131
133
|
expandedSubagents: subagents.ids,
|
|
132
134
|
activeTurnId: null,
|
|
133
135
|
commandLooks,
|
|
136
|
+
toolLooks,
|
|
134
137
|
hideTools
|
|
135
138
|
});
|
|
136
139
|
let t7;
|
|
@@ -298,7 +301,7 @@ export function SubagentTimeline(t0) {
|
|
|
298
301
|
const previous = index > 0 ? rows[index - 1] : null;
|
|
299
302
|
return /*#__PURE__*/_jsx("div", {
|
|
300
303
|
"data-item-id": row_0.id,
|
|
301
|
-
className: rowRhythm(row_0, previous),
|
|
304
|
+
className: rowRhythm(row_0, previous, saidBy !== undefined),
|
|
302
305
|
children: /*#__PURE__*/_jsx(Row, {
|
|
303
306
|
row: row_0,
|
|
304
307
|
chatId: chatId,
|
package/dist/chat/ui/Timeline.js
CHANGED
|
@@ -501,9 +501,10 @@ export function Timeline({
|
|
|
501
501
|
activeTurnId,
|
|
502
502
|
forkedTurns,
|
|
503
503
|
commandLooks: host.commandLooks,
|
|
504
|
+
toolLooks: host.toolLooks,
|
|
504
505
|
hideTools
|
|
505
506
|
});
|
|
506
|
-
}, [order, items, groups.ids, turns.ids, subagents.ids, activeTurnId, forkedTurns, host.commandLooks, hideTools]);
|
|
507
|
+
}, [order, items, groups.ids, turns.ids, subagents.ids, activeTurnId, forkedTurns, host.commandLooks, host.toolLooks, hideTools]);
|
|
507
508
|
const cards = useHostThreadCards(scopeId, chatId);
|
|
508
509
|
const drawsVisuals = host.visuals !== null;
|
|
509
510
|
// Where the part of the thread this client holds begins, while there is a page before it.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { useChatHost } from '../../../host.js';
|
|
3
4
|
import { rowPosition, rowRhythm, saidToChat } from './row-rhythm.js';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
export function RowContainer(t0) {
|
|
6
|
-
const $ = _c(
|
|
7
|
+
const $ = _c(16);
|
|
7
8
|
const {
|
|
8
9
|
row,
|
|
9
10
|
previous,
|
|
@@ -13,29 +14,31 @@ export function RowContainer(t0) {
|
|
|
13
14
|
children
|
|
14
15
|
} = t0;
|
|
15
16
|
const wide = row.kind === "visual" && row.visual.layout === "wide";
|
|
17
|
+
const hostSpeaks = useChatHost().saidBy !== undefined;
|
|
16
18
|
const t1 = row.id;
|
|
17
19
|
let t2;
|
|
18
|
-
if ($[0] !==
|
|
19
|
-
t2 = clsx("absolute inset-x-0 top-0 mx-auto w-full", wide ? "chat-wide-content" : "chat-column-content", rowRhythm(row, previous), saidToChat(row) && index > 0 && "pt-(--chat-turn-gap)");
|
|
20
|
-
$[0] =
|
|
21
|
-
$[1] =
|
|
22
|
-
$[2] =
|
|
23
|
-
$[3] =
|
|
24
|
-
$[4] =
|
|
20
|
+
if ($[0] !== hostSpeaks || $[1] !== index || $[2] !== previous || $[3] !== row || $[4] !== wide) {
|
|
21
|
+
t2 = clsx("absolute inset-x-0 top-0 mx-auto w-full", wide ? "chat-wide-content" : "chat-column-content", rowRhythm(row, previous, hostSpeaks), saidToChat(row, hostSpeaks) && index > 0 && "pt-(--chat-turn-gap)");
|
|
22
|
+
$[0] = hostSpeaks;
|
|
23
|
+
$[1] = index;
|
|
24
|
+
$[2] = previous;
|
|
25
|
+
$[3] = row;
|
|
26
|
+
$[4] = wide;
|
|
27
|
+
$[5] = t2;
|
|
25
28
|
} else {
|
|
26
|
-
t2 = $[
|
|
29
|
+
t2 = $[5];
|
|
27
30
|
}
|
|
28
31
|
let t3;
|
|
29
|
-
if ($[
|
|
32
|
+
if ($[6] !== row.kind || $[7] !== top) {
|
|
30
33
|
t3 = rowPosition(row.kind, top);
|
|
31
|
-
$[
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
+
$[6] = row.kind;
|
|
35
|
+
$[7] = top;
|
|
36
|
+
$[8] = t3;
|
|
34
37
|
} else {
|
|
35
|
-
t3 = $[
|
|
38
|
+
t3 = $[8];
|
|
36
39
|
}
|
|
37
40
|
let t4;
|
|
38
|
-
if ($[
|
|
41
|
+
if ($[9] !== children || $[10] !== index || $[11] !== ref || $[12] !== row.id || $[13] !== t2 || $[14] !== t3) {
|
|
39
42
|
t4 = /*#__PURE__*/_jsx("div", {
|
|
40
43
|
"data-index": index,
|
|
41
44
|
"data-item-id": t1,
|
|
@@ -44,15 +47,15 @@ export function RowContainer(t0) {
|
|
|
44
47
|
style: t3,
|
|
45
48
|
children: children
|
|
46
49
|
});
|
|
47
|
-
$[
|
|
48
|
-
$[
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
50
|
+
$[9] = children;
|
|
51
|
+
$[10] = index;
|
|
52
|
+
$[11] = ref;
|
|
53
|
+
$[12] = row.id;
|
|
54
|
+
$[13] = t2;
|
|
55
|
+
$[14] = t3;
|
|
56
|
+
$[15] = t4;
|
|
54
57
|
} else {
|
|
55
|
-
t4 = $[
|
|
58
|
+
t4 = $[15];
|
|
56
59
|
}
|
|
57
60
|
return t4;
|
|
58
61
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { ChatCheckpointDiff, ChatToolItem, ChatTurnItem } from '@adecore/agent-contracts';
|
|
3
3
|
import type { BaseMoved } from '../../logic/timeline.js';
|
|
4
|
-
import { type
|
|
5
|
-
import { type CommandLook } from '../../../host.js';
|
|
4
|
+
import { type Look, type LookRun } from '../../logic/command-looks.js';
|
|
6
5
|
export declare function ToggleLine({ icon, label, brand, detail, command, look, path, open, onToggle, failed, live, trailing, time, className }: {
|
|
7
6
|
icon: ReactNode;
|
|
8
7
|
label: ReactNode;
|
|
@@ -10,7 +9,7 @@ export declare function ToggleLine({ icon, label, brand, detail, command, look,
|
|
|
10
9
|
detail?: string;
|
|
11
10
|
command?: boolean;
|
|
12
11
|
look?: {
|
|
13
|
-
run:
|
|
12
|
+
run: LookRun;
|
|
14
13
|
chatId: string;
|
|
15
14
|
};
|
|
16
15
|
path?: boolean;
|
|
@@ -45,7 +44,7 @@ export declare function WorkLiveRow({ chatId, tool: derived }: {
|
|
|
45
44
|
export declare function WorkGroupRow({ tools, summary, look, expanded, onToggle }: {
|
|
46
45
|
tools: ChatToolItem[];
|
|
47
46
|
summary: string;
|
|
48
|
-
look?:
|
|
47
|
+
look?: Look;
|
|
49
48
|
expanded: boolean;
|
|
50
49
|
onToggle(): void;
|
|
51
50
|
}): import("react").JSX.Element;
|