@adecore/agents-react 0.51.0 → 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/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/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
|
@@ -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;
|