@adecore/agents-react 0.54.9 → 0.54.11
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.
|
@@ -628,9 +628,9 @@ export function deriveTimelineRows(items, options) {
|
|
|
628
628
|
const finalAssistant = lastAssistantRow(work) ?? (cutShort ? work.findLast(row => row.kind === 'assistant') ?? null : null);
|
|
629
629
|
const closing = finalAssistant ? work.indexOf(finalAssistant) : work.length;
|
|
630
630
|
const before = work.slice(0, closing);
|
|
631
|
-
// Images remain a turn's visible result, and a workflow
|
|
631
|
+
// Images and subagents remain a turn's visible result, and a workflow may still be running after its turn ends.
|
|
632
632
|
// A compaction is never folded away, so a turn that only compacted shows its divider and no fold.
|
|
633
|
-
const standing = before.filter(row => isImageRow(row) || row.kind === 'compaction' || row.kind === '
|
|
633
|
+
const standing = before.filter(row => isImageRow(row) || row.kind === 'compaction' || row.kind === 'subagent' || row.kind === 'workflow' && row.tool.state === 'running');
|
|
634
634
|
const folded = before.length - standing.length;
|
|
635
635
|
// With the tool lines left out, a turn that only ran tools has nothing behind its fold to open.
|
|
636
636
|
const expandable = shownRows(before, options).some(row => !standing.includes(row));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
export declare function UsageLimitsCard({ side, children }: {
|
|
2
|
+
export declare function UsageLimitsCard({ side, open, children }: {
|
|
3
3
|
side?: 'top' | 'left';
|
|
4
|
+
open?: boolean;
|
|
4
5
|
children: ReactElement<Record<string, unknown>>;
|
|
5
6
|
}): import("react").JSX.Element;
|
|
@@ -68,68 +68,70 @@ export function UsageLimitsCard(t0) {
|
|
|
68
68
|
const $ = _c(13);
|
|
69
69
|
const {
|
|
70
70
|
side: t1,
|
|
71
|
+
open: t2,
|
|
71
72
|
children
|
|
72
73
|
} = t0;
|
|
73
74
|
const side = t1 === undefined ? "top" : t1;
|
|
75
|
+
const open = t2 === undefined ? false : t2;
|
|
76
|
+
const [hovered, setHovered] = useState(false);
|
|
74
77
|
const [opened, setOpened] = useState(false);
|
|
75
|
-
let
|
|
78
|
+
let t3;
|
|
76
79
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
77
|
-
|
|
78
|
-
$[0] =
|
|
80
|
+
t3 = new Set();
|
|
81
|
+
$[0] = t3;
|
|
79
82
|
} else {
|
|
80
|
-
|
|
83
|
+
t3 = $[0];
|
|
81
84
|
}
|
|
82
|
-
const [folded, setFolded] = useState(
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
$[1] = t3;
|
|
87
|
-
} else {
|
|
88
|
-
t3 = $[1];
|
|
85
|
+
const [folded, setFolded] = useState(t3);
|
|
86
|
+
const shown = hovered || open;
|
|
87
|
+
if (shown && !opened) {
|
|
88
|
+
setOpened(true);
|
|
89
89
|
}
|
|
90
90
|
let t4;
|
|
91
|
-
if ($[
|
|
91
|
+
if ($[1] !== children) {
|
|
92
92
|
t4 = /*#__PURE__*/_jsx(PreviewCard.Trigger, {
|
|
93
93
|
render: children,
|
|
94
94
|
delay: 500
|
|
95
95
|
});
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
96
|
+
$[1] = children;
|
|
97
|
+
$[2] = t4;
|
|
98
98
|
} else {
|
|
99
|
-
t4 = $[
|
|
99
|
+
t4 = $[2];
|
|
100
100
|
}
|
|
101
101
|
let t5;
|
|
102
|
-
if ($[
|
|
102
|
+
if ($[3] !== folded || $[4] !== opened) {
|
|
103
103
|
t5 = opened && /*#__PURE__*/_jsx(CardBody, {
|
|
104
104
|
folded: folded,
|
|
105
105
|
onFoldedChange: setFolded
|
|
106
106
|
});
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
107
|
+
$[3] = folded;
|
|
108
|
+
$[4] = opened;
|
|
109
|
+
$[5] = t5;
|
|
110
110
|
} else {
|
|
111
|
-
t5 = $[
|
|
111
|
+
t5 = $[5];
|
|
112
112
|
}
|
|
113
113
|
let t6;
|
|
114
|
-
if ($[
|
|
114
|
+
if ($[6] !== side || $[7] !== t5) {
|
|
115
115
|
t6 = /*#__PURE__*/_jsx(PreviewCard.Popup, {
|
|
116
116
|
side: side,
|
|
117
117
|
align: "end",
|
|
118
118
|
className: "w-85 p-2",
|
|
119
119
|
children: t5
|
|
120
120
|
});
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
121
|
+
$[6] = side;
|
|
122
|
+
$[7] = t5;
|
|
123
|
+
$[8] = t6;
|
|
124
124
|
} else {
|
|
125
|
-
t6 = $[
|
|
125
|
+
t6 = $[8];
|
|
126
126
|
}
|
|
127
127
|
let t7;
|
|
128
|
-
if ($[10] !== t4 || $[11] !== t6) {
|
|
128
|
+
if ($[9] !== shown || $[10] !== t4 || $[11] !== t6) {
|
|
129
129
|
t7 = /*#__PURE__*/_jsxs(PreviewCard.Root, {
|
|
130
|
-
|
|
130
|
+
open: shown,
|
|
131
|
+
onOpenChange: setHovered,
|
|
131
132
|
children: [t4, t6]
|
|
132
133
|
});
|
|
134
|
+
$[9] = shown;
|
|
133
135
|
$[10] = t4;
|
|
134
136
|
$[11] = t6;
|
|
135
137
|
$[12] = t7;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agents-react",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.11",
|
|
4
4
|
"description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@adecore/agent-contracts": "0.54.
|
|
76
|
-
"@adecore/editor": "0.54.
|
|
77
|
-
"@adecore/editor-react": "0.54.
|
|
78
|
-
"@adecore/intelligent-ui": "0.54.
|
|
79
|
-
"@adecore/merge": "0.54.
|
|
80
|
-
"@adecore/utils": "0.54.
|
|
75
|
+
"@adecore/agent-contracts": "0.54.11",
|
|
76
|
+
"@adecore/editor": "0.54.11",
|
|
77
|
+
"@adecore/editor-react": "0.54.11",
|
|
78
|
+
"@adecore/intelligent-ui": "0.54.11",
|
|
79
|
+
"@adecore/merge": "0.54.11",
|
|
80
|
+
"@adecore/utils": "0.54.11",
|
|
81
81
|
"@codemirror/commands": "^6.11.1",
|
|
82
82
|
"@codemirror/language": "^6.13.1",
|
|
83
83
|
"@codemirror/state": "^6.7.6",
|
|
@@ -101,14 +101,14 @@
|
|
|
101
101
|
"zustand": "^5.0.16"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@adecore/ui": "^0.54.
|
|
104
|
+
"@adecore/ui": "^0.54.11",
|
|
105
105
|
"i18next": "^26.4.2",
|
|
106
106
|
"react": "^19.3.0",
|
|
107
107
|
"react-dom": "^19.3.0",
|
|
108
108
|
"react-i18next": "^17.0.15"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@adecore/ui": "0.54.
|
|
111
|
+
"@adecore/ui": "0.54.11",
|
|
112
112
|
"@types/bun": "^1.4.4",
|
|
113
113
|
"@types/react": "^19.3.0",
|
|
114
114
|
"@types/react-dom": "^19.3.0",
|
|
@@ -733,14 +733,10 @@ export function deriveTimelineRows(items: ChatItem[], options: TimelineOptions):
|
|
|
733
733
|
const closing = finalAssistant ? work.indexOf(finalAssistant) : work.length;
|
|
734
734
|
const before = work.slice(0, closing);
|
|
735
735
|
|
|
736
|
-
// Images remain a turn's visible result, and a workflow
|
|
736
|
+
// Images and subagents remain a turn's visible result, and a workflow may still be running after its turn ends.
|
|
737
737
|
// A compaction is never folded away, so a turn that only compacted shows its divider and no fold.
|
|
738
738
|
const standing = before.filter(
|
|
739
|
-
(row) =>
|
|
740
|
-
isImageRow(row) ||
|
|
741
|
-
row.kind === 'compaction' ||
|
|
742
|
-
(row.kind === 'workflow' && row.tool.state === 'running') ||
|
|
743
|
-
(row.kind === 'subagent' && row.item.status === 'running')
|
|
739
|
+
(row) => isImageRow(row) || row.kind === 'compaction' || row.kind === 'subagent' || (row.kind === 'workflow' && row.tool.state === 'running')
|
|
744
740
|
);
|
|
745
741
|
|
|
746
742
|
const folded = before.length - standing.length;
|
|
@@ -29,17 +29,26 @@ function CardBody({ folded, onFoldedChange }: { folded: ReadonlySet<string>; onF
|
|
|
29
29
|
*/
|
|
30
30
|
export function UsageLimitsCard({
|
|
31
31
|
side = 'top',
|
|
32
|
+
open = false,
|
|
32
33
|
children
|
|
33
34
|
}: {
|
|
34
35
|
/* Where the card opens: above a button in a footer, or `left` beside one in a column at the window's right edge. */
|
|
35
36
|
side?: 'top' | 'left';
|
|
37
|
+
/* Holds the card open beside the hover, such as while the app's own key is down. */
|
|
38
|
+
open?: boolean;
|
|
36
39
|
children: ReactElement<Record<string, unknown>>;
|
|
37
40
|
}) {
|
|
41
|
+
const [hovered, setHovered] = useState(false);
|
|
38
42
|
const [opened, setOpened] = useState(false);
|
|
39
43
|
const [folded, setFolded] = useState<ReadonlySet<string>>(new Set());
|
|
44
|
+
const shown = hovered || open;
|
|
45
|
+
|
|
46
|
+
if (shown && !opened) {
|
|
47
|
+
setOpened(true);
|
|
48
|
+
}
|
|
40
49
|
|
|
41
50
|
return (
|
|
42
|
-
<PreviewCard.Root onOpenChange={
|
|
51
|
+
<PreviewCard.Root open={shown} onOpenChange={setHovered}>
|
|
43
52
|
<PreviewCard.Trigger render={children} delay={500} />
|
|
44
53
|
<PreviewCard.Popup side={side} align="end" className="w-85 p-2">
|
|
45
54
|
{opened && <CardBody folded={folded} onFoldedChange={setFolded} />}
|