@adecore/agents-react 0.54.16 → 0.55.1
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/agents/AgentModelLabel.d.ts +5 -0
- package/dist/agents/AgentModelLabel.js +32 -7
- package/dist/chat/account-choice.d.ts +1 -0
- package/dist/chat/account-choice.js +13 -4
- package/dist/chat/mentions.d.ts +24 -2
- package/dist/chat/mentions.js +84 -10
- package/dist/chat/subagent-list.d.ts +0 -1
- package/dist/chat/subagent-list.js +1 -9
- package/dist/chat/tag-suggestions.d.ts +22 -0
- package/dist/chat/tag-suggestions.js +71 -0
- package/dist/chat/ui/Composer.js +489 -447
- package/dist/chat/ui/ComposerInput.d.ts +1 -0
- package/dist/chat/ui/ComposerInput.js +9 -1
- package/dist/chat/ui/Markdown.js +41 -25
- package/dist/chat/ui/NamedChip.d.ts +5 -0
- package/dist/chat/ui/NamedChip.js +118 -0
- package/dist/chat/ui/Pickers.d.ts +0 -4
- package/dist/chat/ui/Pickers.js +1 -141
- package/dist/chat/ui/PromptEditor.js +2 -1
- package/dist/chat/ui/ReferenceChip.d.ts +3 -2
- package/dist/chat/ui/ReferenceChip.js +58 -36
- package/dist/chat/ui/RunSettings.d.ts +3 -2
- package/dist/chat/ui/RunSettings.js +386 -361
- package/dist/chat/ui/SubagentInfo.js +98 -114
- package/dist/chat/ui/SubagentTimeline.js +65 -43
- package/dist/chat/ui/Timeline.js +14 -8
- package/dist/chat/ui/chip-clipboard.js +10 -0
- package/dist/chat/ui/composer/ComposerControls.d.ts +6 -1
- package/dist/chat/ui/composer/ComposerControls.js +171 -158
- package/dist/chat/ui/composer/ComposerMenu.js +184 -55
- package/dist/chat/ui/composer/ComposerPlusMenu.d.ts +18 -0
- package/dist/chat/ui/composer/ComposerPlusMenu.js +400 -0
- package/dist/chat/ui/composer/ComposerStatusLine.d.ts +4 -0
- package/dist/chat/ui/composer/ComposerStatusLine.js +239 -0
- package/dist/chat/ui/composer/chips.d.ts +2 -0
- package/dist/chat/ui/composer/chips.js +66 -5
- package/dist/chat/ui/composer/insert.d.ts +1 -0
- package/dist/chat/ui/composer/insert.js +24 -0
- package/dist/chat/ui/composer/use-composer-menus.js +34 -17
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +10 -2
- package/dist/chat/ui/composer/use-prompt-menus.js +290 -202
- package/dist/chat/ui/covered-bottom.d.ts +1 -0
- package/dist/chat/ui/covered-bottom.js +6 -0
- package/dist/chat/ui/named-chip-look.d.ts +14 -0
- package/dist/chat/ui/named-chip-look.js +72 -0
- package/dist/chat/ui/rehype-chips.js +13 -2
- package/dist/host-hooks.d.ts +2 -1
- package/dist/host-hooks.js +6 -0
- package/dist/host.d.ts +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +14 -2
- package/dist/locales/en/agent-chat.js +16 -4
- package/dist/locales/nl/agent-chat.d.ts +14 -2
- package/dist/locales/nl/agent-chat.js +16 -4
- package/dist/state/chats.d.ts +1 -0
- package/dist/state/chats.js +45 -0
- package/package.json +9 -9
- package/src/agents/AgentModelLabel.tsx +10 -1
- package/src/chat/account-choice.ts +8 -0
- package/src/chat/mentions.ts +110 -13
- package/src/chat/subagent-list.ts +1 -14
- package/src/chat/tag-suggestions.ts +121 -0
- package/src/chat/ui/Composer.tsx +24 -12
- package/src/chat/ui/ComposerInput.tsx +13 -1
- package/src/chat/ui/Markdown.tsx +5 -0
- package/src/chat/ui/NamedChip.tsx +34 -0
- package/src/chat/ui/Pickers.tsx +1 -51
- package/src/chat/ui/PromptEditor.tsx +7 -1
- package/src/chat/ui/ReferenceChip.tsx +15 -4
- package/src/chat/ui/RunSettings.tsx +51 -29
- package/src/chat/ui/SubagentInfo.tsx +17 -17
- package/src/chat/ui/SubagentTimeline.tsx +7 -2
- package/src/chat/ui/Timeline.tsx +11 -5
- package/src/chat/ui/chip-clipboard.ts +8 -1
- package/src/chat/ui/composer/ComposerControls.tsx +24 -17
- package/src/chat/ui/composer/ComposerMenu.tsx +82 -15
- package/src/chat/ui/composer/ComposerPlusMenu.tsx +158 -0
- package/src/chat/ui/composer/ComposerStatusLine.tsx +94 -0
- package/src/chat/ui/composer/chips.ts +78 -7
- package/src/chat/ui/composer/insert.ts +12 -0
- package/src/chat/ui/composer/use-composer-menus.ts +5 -2
- package/src/chat/ui/composer/use-prompt-menus.ts +55 -10
- package/src/chat/ui/covered-bottom.ts +7 -0
- package/src/chat/ui/named-chip-look.ts +64 -0
- package/src/chat/ui/rehype-chips.ts +17 -2
- package/src/host-hooks.ts +11 -1
- package/src/host.ts +29 -0
- package/src/index.ts +2 -0
- package/src/locales/en/agent-chat.ts +16 -4
- package/src/locales/nl/agent-chat.ts +16 -4
- package/src/state/chats.ts +26 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useNow } from '@adecore/ui';
|
|
3
|
-
import { Fragment } from 'react';
|
|
2
|
+
import { Tooltip, useNow } from '@adecore/ui';
|
|
4
3
|
import { useTranslation } from 'react-i18next';
|
|
5
4
|
import { useModelName } from '../../agents/model-name.js';
|
|
6
5
|
import { useHostTask } from '../../host-hooks.js';
|
|
7
6
|
import { useChatScope } from '../../scope.js';
|
|
8
7
|
import { useChatRow } from '../../state/chats.js';
|
|
9
|
-
import { entryTimeOf, statusWordOf,
|
|
8
|
+
import { entryTimeOf, statusWordOf, taskIdOf } from '../subagent-list.js';
|
|
10
9
|
import { useSubagentItem } from '../subagent-view.js';
|
|
11
10
|
import { StatusIcon } from './ChatActivity.js';
|
|
12
11
|
import { SubagentActions, SubagentBreadcrumb } from './SubagentControls.js';
|
|
13
12
|
/*
|
|
14
|
-
* What a sub-agent is, over its conversation:
|
|
15
|
-
*
|
|
13
|
+
* What a sub-agent is, over its conversation: its state, with its time in the tooltip, the way down to
|
|
14
|
+
* it, the model it runs on, and the way out. Only the way down and out for a conversation whose row the
|
|
15
|
+
* thread lost.
|
|
16
16
|
*/
|
|
17
17
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
export function SubagentInfo(t0) {
|
|
19
|
-
const $ = _c(
|
|
19
|
+
const $ = _c(31);
|
|
20
20
|
const {
|
|
21
21
|
chatId,
|
|
22
22
|
toolUseId
|
|
@@ -51,135 +51,119 @@ export function SubagentInfo(t0) {
|
|
|
51
51
|
}
|
|
52
52
|
const word = t2;
|
|
53
53
|
let t3;
|
|
54
|
+
if ($[5] !== item || $[6] !== now || $[7] !== task) {
|
|
55
|
+
t3 = item === null ? "" : entryTimeOf(item, task, now);
|
|
56
|
+
$[5] = item;
|
|
57
|
+
$[6] = now;
|
|
58
|
+
$[7] = task;
|
|
59
|
+
$[8] = t3;
|
|
60
|
+
} else {
|
|
61
|
+
t3 = $[8];
|
|
62
|
+
}
|
|
63
|
+
const time = t3;
|
|
54
64
|
let t4;
|
|
65
|
+
if ($[9] !== t) {
|
|
66
|
+
t4 = t("subagents.info.label");
|
|
67
|
+
$[9] = t;
|
|
68
|
+
$[10] = t4;
|
|
69
|
+
} else {
|
|
70
|
+
t4 = $[10];
|
|
71
|
+
}
|
|
55
72
|
let t5;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
$[19] = t7;
|
|
65
|
-
} else {
|
|
66
|
-
t7 = $[19];
|
|
67
|
-
}
|
|
68
|
-
t8 = "shrink-0 border-b border-border py-1.5 pr-1.5 pl-4";
|
|
69
|
-
t3 = "flex min-w-0 items-center gap-2 text-xs text-text-faint";
|
|
70
|
-
if ($[20] !== chatId) {
|
|
71
|
-
t4 = /*#__PURE__*/_jsx(SubagentBreadcrumb, {
|
|
72
|
-
chatId: chatId,
|
|
73
|
-
className: "max-w-1/3 shrink-0 font-medium"
|
|
74
|
-
});
|
|
75
|
-
$[20] = chatId;
|
|
76
|
-
$[21] = t4;
|
|
77
|
-
} else {
|
|
78
|
-
t4 = $[21];
|
|
79
|
-
}
|
|
80
|
-
if ($[22] !== item || $[23] !== now || $[24] !== t || $[25] !== task || $[26] !== word) {
|
|
81
|
-
t5 = item !== null && word !== null && /*#__PURE__*/_jsxs(_Fragment, {
|
|
82
|
-
children: [/*#__PURE__*/_jsx(StatusIcon, {
|
|
73
|
+
if ($[11] !== t || $[12] !== time || $[13] !== word) {
|
|
74
|
+
t5 = word !== null && /*#__PURE__*/_jsx(Tooltip, {
|
|
75
|
+
label: time === "" ? t(`common.status.${word}`) : time,
|
|
76
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
77
|
+
className: "flex shrink-0",
|
|
78
|
+
role: "img",
|
|
79
|
+
"aria-label": t(`common.status.${word}`),
|
|
80
|
+
children: /*#__PURE__*/_jsx(StatusIcon, {
|
|
83
81
|
word: word
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})]
|
|
91
|
-
});
|
|
92
|
-
$[22] = item;
|
|
93
|
-
$[23] = now;
|
|
94
|
-
$[24] = t;
|
|
95
|
-
$[25] = task;
|
|
96
|
-
$[26] = word;
|
|
97
|
-
$[27] = t5;
|
|
98
|
-
} else {
|
|
99
|
-
t5 = $[27];
|
|
100
|
-
}
|
|
101
|
-
t6 = facts.map(_temp2);
|
|
102
|
-
$[5] = chatId;
|
|
103
|
-
$[6] = item;
|
|
104
|
-
$[7] = modelName;
|
|
105
|
-
$[8] = now;
|
|
106
|
-
$[9] = t;
|
|
107
|
-
$[10] = task;
|
|
108
|
-
$[11] = word;
|
|
109
|
-
$[12] = t3;
|
|
110
|
-
$[13] = t4;
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
$[11] = t;
|
|
86
|
+
$[12] = time;
|
|
87
|
+
$[13] = word;
|
|
111
88
|
$[14] = t5;
|
|
112
|
-
$[15] = t6;
|
|
113
|
-
$[16] = t7;
|
|
114
|
-
$[17] = t8;
|
|
115
89
|
} else {
|
|
116
|
-
t3 = $[12];
|
|
117
|
-
t4 = $[13];
|
|
118
90
|
t5 = $[14];
|
|
119
|
-
t6 = $[15];
|
|
120
|
-
t7 = $[16];
|
|
121
|
-
t8 = $[17];
|
|
122
91
|
}
|
|
123
|
-
let
|
|
124
|
-
if ($[
|
|
125
|
-
|
|
92
|
+
let t6;
|
|
93
|
+
if ($[15] !== chatId) {
|
|
94
|
+
t6 = /*#__PURE__*/_jsx(SubagentBreadcrumb, {
|
|
95
|
+
chatId: chatId,
|
|
96
|
+
className: "max-w-1/2 shrink-0 font-medium"
|
|
97
|
+
});
|
|
98
|
+
$[15] = chatId;
|
|
99
|
+
$[16] = t6;
|
|
100
|
+
} else {
|
|
101
|
+
t6 = $[16];
|
|
102
|
+
}
|
|
103
|
+
let t7;
|
|
104
|
+
if ($[17] !== item?.model || $[18] !== modelName) {
|
|
105
|
+
t7 = item?.model !== undefined && modelName !== "" && /*#__PURE__*/_jsxs(_Fragment, {
|
|
106
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
children: "\xB7"
|
|
109
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
110
|
+
className: "min-w-0 truncate",
|
|
111
|
+
children: modelName
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
$[17] = item?.model;
|
|
115
|
+
$[18] = modelName;
|
|
116
|
+
$[19] = t7;
|
|
117
|
+
} else {
|
|
118
|
+
t7 = $[19];
|
|
119
|
+
}
|
|
120
|
+
let t8;
|
|
121
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
122
|
+
t8 = /*#__PURE__*/_jsx("span", {
|
|
126
123
|
className: "grow"
|
|
127
124
|
});
|
|
128
|
-
$[
|
|
125
|
+
$[20] = t8;
|
|
129
126
|
} else {
|
|
130
|
-
|
|
127
|
+
t8 = $[20];
|
|
131
128
|
}
|
|
132
|
-
let
|
|
133
|
-
if ($[
|
|
134
|
-
|
|
129
|
+
let t9;
|
|
130
|
+
if ($[21] !== chatId) {
|
|
131
|
+
t9 = /*#__PURE__*/_jsx(SubagentActions, {
|
|
135
132
|
chatId: chatId
|
|
136
133
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
134
|
+
$[21] = chatId;
|
|
135
|
+
$[22] = t9;
|
|
139
136
|
} else {
|
|
140
|
-
|
|
137
|
+
t9 = $[22];
|
|
141
138
|
}
|
|
142
|
-
let
|
|
143
|
-
if ($[
|
|
144
|
-
|
|
145
|
-
className:
|
|
146
|
-
children: [
|
|
139
|
+
let t10;
|
|
140
|
+
if ($[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t9) {
|
|
141
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
142
|
+
className: "flex min-w-0 items-center gap-2 text-xs text-text-faint",
|
|
143
|
+
children: [t5, t6, t7, t8, t9]
|
|
147
144
|
});
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[36] = t11;
|
|
145
|
+
$[23] = t5;
|
|
146
|
+
$[24] = t6;
|
|
147
|
+
$[25] = t7;
|
|
148
|
+
$[26] = t9;
|
|
149
|
+
$[27] = t10;
|
|
154
150
|
} else {
|
|
155
|
-
|
|
151
|
+
t10 = $[27];
|
|
156
152
|
}
|
|
157
|
-
let
|
|
158
|
-
if ($[
|
|
159
|
-
|
|
160
|
-
"aria-label":
|
|
161
|
-
className:
|
|
162
|
-
children:
|
|
153
|
+
let t11;
|
|
154
|
+
if ($[28] !== t10 || $[29] !== t4) {
|
|
155
|
+
t11 = /*#__PURE__*/_jsx("section", {
|
|
156
|
+
"aria-label": t4,
|
|
157
|
+
className: "shrink-0 border-b border-border py-1.5 pr-1.5 pl-4",
|
|
158
|
+
children: t10
|
|
163
159
|
});
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[40] = t12;
|
|
160
|
+
$[28] = t10;
|
|
161
|
+
$[29] = t4;
|
|
162
|
+
$[30] = t11;
|
|
168
163
|
} else {
|
|
169
|
-
|
|
164
|
+
t11 = $[30];
|
|
170
165
|
}
|
|
171
|
-
return
|
|
172
|
-
}
|
|
173
|
-
function _temp2(fact) {
|
|
174
|
-
return /*#__PURE__*/_jsxs(Fragment, {
|
|
175
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
176
|
-
"aria-hidden": "true",
|
|
177
|
-
children: "\xB7"
|
|
178
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
179
|
-
className: "min-w-0 truncate",
|
|
180
|
-
children: fact
|
|
181
|
-
})]
|
|
182
|
-
}, fact);
|
|
166
|
+
return t11;
|
|
183
167
|
}
|
|
184
168
|
function _temp(row) {
|
|
185
169
|
return row?.info.provider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { EmptyState, ContextMenu, Icon, ScrollArea } from '@adecore/ui';
|
|
3
3
|
import { Bot, LoaderCircle } from 'lucide-react';
|
|
4
|
-
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useChatHost } from '../../host.js';
|
|
7
7
|
import { useHostHidesToolCalls } from '../../host-hooks.js';
|
|
@@ -15,6 +15,7 @@ import { INITIAL_CONVERSATION, SubagentConversation } from '../subagent-conversa
|
|
|
15
15
|
import { useSubagentSupport } from '../subagent-support.js';
|
|
16
16
|
import { openBelow, useSubagentTrail } from '../subagent-view.js';
|
|
17
17
|
import { firstRowInView, restoreAnchor, wantsEarlier } from '../timeline-scroll.js';
|
|
18
|
+
import { CoveredBottomContext } from './covered-bottom.js';
|
|
18
19
|
import { FileLinkContext } from './file-links.js';
|
|
19
20
|
import { ReplyContext } from './reply-context.js';
|
|
20
21
|
import { FOLLOW_THRESHOLD_PX, rowRhythm } from './rows/row-rhythm.js';
|
|
@@ -32,7 +33,7 @@ const NO_TURNS = new Set();
|
|
|
32
33
|
* own trail instead of the chat's.
|
|
33
34
|
*/
|
|
34
35
|
export function SubagentTimeline(t0) {
|
|
35
|
-
const $ = _c(
|
|
36
|
+
const $ = _c(49);
|
|
36
37
|
const {
|
|
37
38
|
chatId,
|
|
38
39
|
toolUseId,
|
|
@@ -59,6 +60,7 @@ export function SubagentTimeline(t0) {
|
|
|
59
60
|
const threadRef = useRef(null);
|
|
60
61
|
const [target, setTarget] = useState(EMPTY_TARGET);
|
|
61
62
|
const followRef = useRef(true);
|
|
63
|
+
const covered = useContext(CoveredBottomContext);
|
|
62
64
|
let t2;
|
|
63
65
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
64
66
|
t2 = () => {
|
|
@@ -220,58 +222,72 @@ export function SubagentTimeline(t0) {
|
|
|
220
222
|
} else {
|
|
221
223
|
t12 = $[27];
|
|
222
224
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
const t13 = state.status === "ready" ? 0 : covered;
|
|
226
|
+
let t14;
|
|
227
|
+
if ($[28] !== t12 || $[29] !== t13) {
|
|
228
|
+
t14 = {
|
|
229
|
+
...t12,
|
|
230
|
+
paddingBottom: t13
|
|
231
|
+
};
|
|
232
|
+
$[28] = t12;
|
|
233
|
+
$[29] = t13;
|
|
234
|
+
$[30] = t14;
|
|
235
|
+
} else {
|
|
236
|
+
t14 = $[30];
|
|
237
|
+
}
|
|
238
|
+
let t15;
|
|
239
|
+
if ($[31] !== chatId || $[32] !== info || $[33] !== toolUseId) {
|
|
240
|
+
t15 = info && /*#__PURE__*/_jsx(SubagentInfo, {
|
|
226
241
|
chatId: chatId,
|
|
227
242
|
toolUseId: toolUseId
|
|
228
243
|
});
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
244
|
+
$[31] = chatId;
|
|
245
|
+
$[32] = info;
|
|
246
|
+
$[33] = toolUseId;
|
|
247
|
+
$[34] = t15;
|
|
233
248
|
} else {
|
|
234
|
-
|
|
249
|
+
t15 = $[34];
|
|
235
250
|
}
|
|
236
|
-
let
|
|
237
|
-
if ($[
|
|
238
|
-
|
|
251
|
+
let t16;
|
|
252
|
+
if ($[35] !== state.status || $[36] !== t) {
|
|
253
|
+
t16 = state.status === "loading" && /*#__PURE__*/_jsx("div", {
|
|
239
254
|
className: "chat-column-content px-4 pt-4 text-xs text-text-faint",
|
|
240
255
|
children: t("subagents.loading")
|
|
241
256
|
});
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
257
|
+
$[35] = state.status;
|
|
258
|
+
$[36] = t;
|
|
259
|
+
$[37] = t16;
|
|
245
260
|
} else {
|
|
246
|
-
|
|
261
|
+
t16 = $[37];
|
|
247
262
|
}
|
|
248
|
-
let
|
|
249
|
-
if ($[
|
|
250
|
-
|
|
263
|
+
let t17;
|
|
264
|
+
if ($[38] !== state.error || $[39] !== state.status || $[40] !== state.unsupported || $[41] !== t) {
|
|
265
|
+
t17 = state.status === "failed" && /*#__PURE__*/_jsx(EmptyState, {
|
|
251
266
|
icon: Bot,
|
|
252
267
|
children: state.unsupported ? t("subagents.unsupported") : state.error ?? t("subagents.unreadable")
|
|
253
268
|
});
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
269
|
+
$[38] = state.error;
|
|
270
|
+
$[39] = state.status;
|
|
271
|
+
$[40] = state.unsupported;
|
|
272
|
+
$[41] = t;
|
|
273
|
+
$[42] = t17;
|
|
259
274
|
} else {
|
|
260
|
-
|
|
275
|
+
t17 = $[42];
|
|
261
276
|
}
|
|
262
|
-
const
|
|
277
|
+
const t18 = state.status === "ready" && /*#__PURE__*/_jsx(FileLinkContext.Provider, {
|
|
263
278
|
value: state.context?.cwd ?? cwd,
|
|
264
279
|
children: /*#__PURE__*/_jsx(ReplyContext.Provider, {
|
|
265
280
|
value: state.context ?? {
|
|
266
281
|
provider: state.source === "codex-thread" ? "codex" : "claude"
|
|
267
282
|
},
|
|
268
|
-
children: /*#__PURE__*/
|
|
283
|
+
children: /*#__PURE__*/_jsxs(ScrollArea, {
|
|
269
284
|
axis: "y",
|
|
270
285
|
viewportRef: scrollRef,
|
|
271
286
|
"data-file-cwd": state.context?.cwd ?? cwd ?? "",
|
|
272
287
|
"data-file-scope-id": scope.id,
|
|
273
288
|
className: "grow",
|
|
274
289
|
viewportClassName: "chat-thread relative px-4 pt-4 pb-3",
|
|
290
|
+
coveredBottom: covered,
|
|
275
291
|
style: {
|
|
276
292
|
overflowAnchor: "none"
|
|
277
293
|
},
|
|
@@ -280,7 +296,7 @@ export function SubagentTimeline(t0) {
|
|
|
280
296
|
followRef.current = element_1.scrollHeight - element_1.scrollTop - element_1.clientHeight < FOLLOW_THRESHOLD_PX;
|
|
281
297
|
loadEarlier();
|
|
282
298
|
},
|
|
283
|
-
children: /*#__PURE__*/_jsxs(ContextMenu.Root, {
|
|
299
|
+
children: [/*#__PURE__*/_jsxs(ContextMenu.Root, {
|
|
284
300
|
children: [/*#__PURE__*/_jsxs(ContextMenu.Trigger, {
|
|
285
301
|
ref: threadRef,
|
|
286
302
|
className: "chat-column-content",
|
|
@@ -322,27 +338,33 @@ export function SubagentTimeline(t0) {
|
|
|
322
338
|
target: target,
|
|
323
339
|
thread: threadRef
|
|
324
340
|
})]
|
|
325
|
-
})
|
|
341
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
342
|
+
className: "shrink-0",
|
|
343
|
+
style: {
|
|
344
|
+
height: covered
|
|
345
|
+
},
|
|
346
|
+
"aria-hidden": true
|
|
347
|
+
})]
|
|
326
348
|
})
|
|
327
349
|
})
|
|
328
350
|
});
|
|
329
|
-
let
|
|
330
|
-
if ($[
|
|
331
|
-
|
|
351
|
+
let t19;
|
|
352
|
+
if ($[43] !== t14 || $[44] !== t15 || $[45] !== t16 || $[46] !== t17 || $[47] !== t18) {
|
|
353
|
+
t19 = /*#__PURE__*/_jsxs("div", {
|
|
332
354
|
className: t11,
|
|
333
|
-
style:
|
|
334
|
-
children: [
|
|
355
|
+
style: t14,
|
|
356
|
+
children: [t15, t16, t17, t18]
|
|
335
357
|
});
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
358
|
+
$[43] = t14;
|
|
359
|
+
$[44] = t15;
|
|
360
|
+
$[45] = t16;
|
|
361
|
+
$[46] = t17;
|
|
362
|
+
$[47] = t18;
|
|
363
|
+
$[48] = t19;
|
|
342
364
|
} else {
|
|
343
|
-
|
|
365
|
+
t19 = $[48];
|
|
344
366
|
}
|
|
345
|
-
return
|
|
367
|
+
return t19;
|
|
346
368
|
}
|
|
347
369
|
function _temp4() {}
|
|
348
370
|
function _temp3() {}
|
package/dist/chat/ui/Timeline.js
CHANGED
|
@@ -24,6 +24,7 @@ import { useTimelineFlash } from '../timeline-flash.js';
|
|
|
24
24
|
import { registerItemJumper, registerMessageStepper, registerTimeline, registerTurnJumper, setTimelineAtEnd, wantsEarlier } from '../timeline-scroll.js';
|
|
25
25
|
import { BookmarkMarker } from './BookmarkMarker.js';
|
|
26
26
|
import { ChatEmptyScene } from './ChatEmptyScene.js';
|
|
27
|
+
import { CoveredBottomContext } from './covered-bottom.js';
|
|
27
28
|
import { FileLinkContext } from './file-links.js';
|
|
28
29
|
import { FindRevealContext } from './find-reveal.js';
|
|
29
30
|
import { MessageActions } from './MessageActions.js';
|
|
@@ -414,8 +415,9 @@ const ThreadRow = memo(function ThreadRow(t0) {
|
|
|
414
415
|
return t6;
|
|
415
416
|
});
|
|
416
417
|
/*
|
|
417
|
-
* `overlay` stands in the thread's place and
|
|
418
|
-
* where it was underneath and the composer stays in
|
|
418
|
+
* `overlay` stands in the thread's place and runs on under the composer as the thread does
|
|
419
|
+
* (`CoveredBottomContext`), so the thread keeps where it was underneath and the composer stays in
|
|
420
|
+
* reach for the prompts it answers.
|
|
419
421
|
* `onContentHeight` hears what the thread's rows and its padding take, without the composer, once
|
|
420
422
|
* the rows in view are laid out at their real heights, for a host that sizes its frame to the thread.
|
|
421
423
|
* Rows out of view still count at an estimate, so a frame up to the viewport's height gets it exact.
|
|
@@ -452,6 +454,7 @@ export function Timeline({
|
|
|
452
454
|
// Read when the menu opens rather than subscribed to, for the same reason the rows use the structure.
|
|
453
455
|
const fullItems = () => useChats.getState().byKey[keyOf(chatId)]?.items;
|
|
454
456
|
const scrollRef = useRef(null);
|
|
457
|
+
const overlayRef = useRef(null);
|
|
455
458
|
const threadRef = useRef(null);
|
|
456
459
|
const contentRef = useRef(null);
|
|
457
460
|
const quoteTakerRef = useRef(null);
|
|
@@ -1170,9 +1173,11 @@ export function Timeline({
|
|
|
1170
1173
|
bottom: 0
|
|
1171
1174
|
},
|
|
1172
1175
|
onWheel: e_1 => {
|
|
1173
|
-
|
|
1176
|
+
// A sub-agent's conversation scrolls under the composer too, in a scroller of its own.
|
|
1177
|
+
const scroller_1 = overlay ? overlayRef.current?.querySelector('.chat-thread') ?? null : scrollRef.current;
|
|
1174
1178
|
// A wheel over the composer moves the thread it lies over, as it did inside the scroller.
|
|
1175
|
-
|
|
1179
|
+
// A popup of the composer is portaled elsewhere, but its wheel still bubbles here through React.
|
|
1180
|
+
if (scroller_1 === null || coveredHeight === 0 || !e_1.currentTarget.contains(e_1.target) || e_1.ctrlKey || scrollsWithin(e_1.target, e_1.currentTarget, e_1.deltaX, e_1.deltaY)) {
|
|
1176
1181
|
return;
|
|
1177
1182
|
}
|
|
1178
1183
|
const unit = e_1.deltaMode === 1 ? WHEEL_LINE_PX : e_1.deltaMode === 2 ? scroller_1.clientHeight : 1;
|
|
@@ -1224,11 +1229,12 @@ export function Timeline({
|
|
|
1224
1229
|
})
|
|
1225
1230
|
})
|
|
1226
1231
|
}), overlay && /*#__PURE__*/_jsx("div", {
|
|
1232
|
+
ref: overlayRef,
|
|
1227
1233
|
className: "absolute inset-0 z-5 flex flex-col bg-surface",
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1234
|
+
children: /*#__PURE__*/_jsx(CoveredBottomContext, {
|
|
1235
|
+
value: coveredHeight,
|
|
1236
|
+
children: overlay
|
|
1237
|
+
})
|
|
1232
1238
|
})]
|
|
1233
1239
|
})
|
|
1234
1240
|
})
|
|
@@ -42,6 +42,16 @@ function segmentOf(chip) {
|
|
|
42
42
|
name
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
case 'model':
|
|
46
|
+
case 'account':
|
|
47
|
+
{
|
|
48
|
+
const slash = value.indexOf('/');
|
|
49
|
+
return slash < 1 ? null : {
|
|
50
|
+
kind: chip.getAttribute('data-chip'),
|
|
51
|
+
cli: value.slice(0, slash),
|
|
52
|
+
id: value.slice(slash + 1)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
45
55
|
default:
|
|
46
56
|
return null;
|
|
47
57
|
}
|
|
@@ -3,6 +3,7 @@ import { type Shortcut } from '@adecore/ui';
|
|
|
3
3
|
import { type Ref } from 'react';
|
|
4
4
|
import { type ComposerSendAction, type ComposerSendDraft } from '../../../host.js';
|
|
5
5
|
import type { StashedPrompt } from '../../stash.js';
|
|
6
|
+
import { type PlusMenuSigils } from './ComposerPlusMenu.js';
|
|
6
7
|
import type { ChatControls } from './use-chat-controls.js';
|
|
7
8
|
interface SendProps {
|
|
8
9
|
visible: boolean;
|
|
@@ -20,12 +21,16 @@ interface ComposerControlsProps {
|
|
|
20
21
|
providerFixed: boolean;
|
|
21
22
|
writable: boolean;
|
|
22
23
|
attachable: boolean;
|
|
24
|
+
emptyDraft: boolean;
|
|
25
|
+
sigils: PlusMenuSigils;
|
|
23
26
|
controls: ChatControls;
|
|
24
27
|
send: SendProps;
|
|
25
28
|
dictationToolbar: Ref<HTMLDivElement>;
|
|
26
29
|
onFiles(files: File[]): void;
|
|
27
30
|
onRestore(prompt: StashedPrompt): void;
|
|
31
|
+
onStash(): void;
|
|
32
|
+
onSigil(sigil: string): void;
|
|
28
33
|
insert(text: string): void;
|
|
29
34
|
}
|
|
30
|
-
export declare function ComposerControls({ chatId, info, providerFixed, writable, attachable, controls, send, dictationToolbar, onFiles, onRestore, insert }: ComposerControlsProps): import("react").JSX.Element;
|
|
35
|
+
export declare function ComposerControls({ chatId, info, providerFixed, writable, attachable, emptyDraft, sigils, controls, send, dictationToolbar, onFiles, onRestore, onStash, onSigil, insert }: ComposerControlsProps): import("react").JSX.Element;
|
|
31
36
|
export {};
|