@adecore/agents-react 0.47.0 → 0.48.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/agents/accounts.d.ts +9 -1
- package/dist/agents/accounts.js +31 -7
- package/dist/chat/account-choice.d.ts +5 -4
- package/dist/chat/account-choice.js +47 -39
- package/dist/chat/preferences.d.ts +2 -2
- package/dist/chat/preferences.js +11 -5
- package/dist/chat/ui/AccountPill.js +9 -6
- package/dist/chat/ui/LimitState.js +180 -172
- package/dist/chat/ui/UnifiedDiff.js +22 -19
- package/dist/chat/ui/composer/ComposerControls.js +1 -1
- package/dist/chat/ui/composer/use-chat-controls.js +70 -67
- package/dist/chat/ui/diff/EditorEditDiff.d.ts +3 -1
- package/dist/chat/ui/diff/EditorEditDiff.js +24 -18
- package/dist/chat/ui/diff/EditorPatchDiff.d.ts +3 -1
- package/dist/chat/ui/diff/EditorPatchDiff.js +4 -2
- package/dist/chat/ui/diff/diff-props.d.ts +2 -0
- package/dist/host-hooks.d.ts +3 -0
- package/dist/host-hooks.js +8 -0
- package/dist/host.d.ts +3 -0
- package/dist/locales/en/agent-providers.d.ts +5 -0
- package/dist/locales/en/agent-providers.js +8 -3
- package/dist/locales/nl/agent-providers.d.ts +5 -0
- package/dist/locales/nl/agent-providers.js +8 -3
- package/dist/providers/AccountOrderList.d.ts +10 -0
- package/dist/providers/AccountOrderList.js +158 -0
- package/dist/providers/CliDetail.js +55 -61
- package/dist/providers/account-actions.d.ts +1 -0
- package/dist/providers/account-actions.js +39 -0
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/usage/limit-groups.js +6 -1
- package/package.json +8 -8
- package/src/agents/accounts.ts +42 -6
- package/src/chat/account-choice.ts +31 -10
- package/src/chat/preferences.ts +33 -8
- package/src/chat/ui/AccountPill.tsx +3 -3
- package/src/chat/ui/LimitState.tsx +4 -2
- package/src/chat/ui/UnifiedDiff.tsx +12 -1
- package/src/chat/ui/composer/ComposerControls.tsx +1 -1
- package/src/chat/ui/composer/use-chat-controls.ts +4 -1
- package/src/chat/ui/diff/EditorEditDiff.tsx +9 -4
- package/src/chat/ui/diff/EditorPatchDiff.tsx +5 -1
- package/src/chat/ui/diff/diff-props.ts +3 -0
- package/src/host-hooks.ts +13 -0
- package/src/host.ts +8 -0
- package/src/locales/en/agent-providers.ts +8 -3
- package/src/locales/nl/agent-providers.ts +8 -3
- package/src/providers/AccountOrderList.tsx +124 -0
- package/src/providers/CliDetail.tsx +33 -28
- package/src/providers/account-actions.ts +30 -0
- package/src/providers/index.ts +11 -1
- package/src/usage/limit-groups.ts +8 -1
|
@@ -2,6 +2,7 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useChatHost } from '../../../host.js';
|
|
5
|
+
import { useHostCanReorderAccounts } from '../../../host-hooks.js';
|
|
5
6
|
import { useChatScope } from '../../../scope.js';
|
|
6
7
|
import { errorCode } from '../../../transport.js';
|
|
7
8
|
import { useChatActions } from '../../actions.js';
|
|
@@ -9,7 +10,7 @@ import { rememberChatAccount, rememberChatSelection } from '../../preferences.js
|
|
|
9
10
|
import { composerStopOf } from '../../subagent-list.js';
|
|
10
11
|
/* What the composer does to the chat rather than to its draft: its settings, a stop, a clear and a compaction. */
|
|
11
12
|
export function useChatControls(t0) {
|
|
12
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(51);
|
|
13
14
|
const {
|
|
14
15
|
chatId,
|
|
15
16
|
info,
|
|
@@ -25,6 +26,7 @@ export function useChatControls(t0) {
|
|
|
25
26
|
} = useTranslation("agent-chat");
|
|
26
27
|
const host = useChatHost();
|
|
27
28
|
const scope = useChatScope();
|
|
29
|
+
const ordered = useHostCanReorderAccounts(scope.id);
|
|
28
30
|
const actions = useChatActions();
|
|
29
31
|
const configuring = useRef(false);
|
|
30
32
|
const [configurationPending, setConfigurationPending] = useState(false);
|
|
@@ -50,13 +52,13 @@ export function useChatControls(t0) {
|
|
|
50
52
|
}
|
|
51
53
|
const runConfiguration = t2;
|
|
52
54
|
let t3;
|
|
53
|
-
if ($[2] !== actions || $[3] !== chatId || $[4] !== info || $[5] !==
|
|
55
|
+
if ($[2] !== actions || $[3] !== chatId || $[4] !== info || $[5] !== ordered || $[6] !== runConfiguration || $[7] !== scope.id) {
|
|
54
56
|
t3 = patch => {
|
|
55
57
|
runConfiguration(() => actions.configure(chatId, patch).then(() => {
|
|
56
58
|
if (patch.selection) {
|
|
57
59
|
rememberChatSelection(info.provider, patch.selection);
|
|
58
60
|
}
|
|
59
|
-
if (patch.account) {
|
|
61
|
+
if (patch.account && !ordered) {
|
|
60
62
|
rememberChatAccount(scope.id, info.provider, patch.account);
|
|
61
63
|
}
|
|
62
64
|
}));
|
|
@@ -64,15 +66,16 @@ export function useChatControls(t0) {
|
|
|
64
66
|
$[2] = actions;
|
|
65
67
|
$[3] = chatId;
|
|
66
68
|
$[4] = info;
|
|
67
|
-
$[5] =
|
|
68
|
-
$[6] =
|
|
69
|
-
$[7] =
|
|
69
|
+
$[5] = ordered;
|
|
70
|
+
$[6] = runConfiguration;
|
|
71
|
+
$[7] = scope.id;
|
|
72
|
+
$[8] = t3;
|
|
70
73
|
} else {
|
|
71
|
-
t3 = $[
|
|
74
|
+
t3 = $[8];
|
|
72
75
|
}
|
|
73
76
|
const configure = t3;
|
|
74
77
|
let t4;
|
|
75
|
-
if ($[
|
|
78
|
+
if ($[9] !== configure || $[10] !== info || $[11] !== onRetarget || $[12] !== runConfiguration) {
|
|
76
79
|
t4 = (provider, slug) => {
|
|
77
80
|
const selection = {
|
|
78
81
|
model: slug,
|
|
@@ -86,17 +89,17 @@ export function useChatControls(t0) {
|
|
|
86
89
|
selection
|
|
87
90
|
});
|
|
88
91
|
};
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
92
|
+
$[9] = configure;
|
|
93
|
+
$[10] = info;
|
|
94
|
+
$[11] = onRetarget;
|
|
95
|
+
$[12] = runConfiguration;
|
|
96
|
+
$[13] = t4;
|
|
94
97
|
} else {
|
|
95
|
-
t4 = $[
|
|
98
|
+
t4 = $[13];
|
|
96
99
|
}
|
|
97
100
|
const chooseModel = t4;
|
|
98
101
|
let t5;
|
|
99
|
-
if ($[
|
|
102
|
+
if ($[14] !== actions || $[15] !== chatId || $[16] !== host || $[17] !== scope.id || $[18] !== showError) {
|
|
100
103
|
t5 = shiftKey => {
|
|
101
104
|
if (composerStopOf(shiftKey) === "turn") {
|
|
102
105
|
actions.stopTurn(chatId, false).catch(showError);
|
|
@@ -104,18 +107,18 @@ export function useChatControls(t0) {
|
|
|
104
107
|
}
|
|
105
108
|
host.confirm.stopSubagents(scope.id, chatId, () => void actions.stopTurn(chatId, true).catch(showError));
|
|
106
109
|
};
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
110
|
+
$[14] = actions;
|
|
111
|
+
$[15] = chatId;
|
|
112
|
+
$[16] = host;
|
|
113
|
+
$[17] = scope.id;
|
|
114
|
+
$[18] = showError;
|
|
115
|
+
$[19] = t5;
|
|
113
116
|
} else {
|
|
114
|
-
t5 = $[
|
|
117
|
+
t5 = $[19];
|
|
115
118
|
}
|
|
116
119
|
const stop = t5;
|
|
117
120
|
let t6;
|
|
118
|
-
if ($[
|
|
121
|
+
if ($[20] !== actions || $[21] !== chatId || $[22] !== setNotice || $[23] !== t) {
|
|
119
122
|
t6 = async () => {
|
|
120
123
|
;
|
|
121
124
|
try {
|
|
@@ -129,44 +132,44 @@ export function useChatControls(t0) {
|
|
|
129
132
|
setNotice(t("composer.notice.clearFailed"));
|
|
130
133
|
}
|
|
131
134
|
};
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
135
|
+
$[20] = actions;
|
|
136
|
+
$[21] = chatId;
|
|
137
|
+
$[22] = setNotice;
|
|
138
|
+
$[23] = t;
|
|
139
|
+
$[24] = t6;
|
|
137
140
|
} else {
|
|
138
|
-
t6 = $[
|
|
141
|
+
t6 = $[24];
|
|
139
142
|
}
|
|
140
143
|
const clearThread = t6;
|
|
141
144
|
let t7;
|
|
142
|
-
if ($[
|
|
145
|
+
if ($[25] !== actions || $[26] !== chatId) {
|
|
143
146
|
t7 = async () => {
|
|
144
147
|
await actions.clear(chatId, true);
|
|
145
148
|
setConfirmClear(false);
|
|
146
149
|
};
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
+
$[25] = actions;
|
|
151
|
+
$[26] = chatId;
|
|
152
|
+
$[27] = t7;
|
|
150
153
|
} else {
|
|
151
|
-
t7 = $[
|
|
154
|
+
t7 = $[27];
|
|
152
155
|
}
|
|
153
156
|
const forceClearThread = t7;
|
|
154
157
|
let t8;
|
|
155
|
-
if ($[
|
|
158
|
+
if ($[28] !== actions || $[29] !== chatId || $[30] !== setNotice || $[31] !== t) {
|
|
156
159
|
t8 = () => {
|
|
157
160
|
actions.compact(chatId).catch(() => setNotice(t("composer.notice.compactFailed")));
|
|
158
161
|
};
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
162
|
+
$[28] = actions;
|
|
163
|
+
$[29] = chatId;
|
|
164
|
+
$[30] = setNotice;
|
|
165
|
+
$[31] = t;
|
|
166
|
+
$[32] = t8;
|
|
164
167
|
} else {
|
|
165
|
-
t8 = $[
|
|
168
|
+
t8 = $[32];
|
|
166
169
|
}
|
|
167
170
|
const compact = t8;
|
|
168
171
|
let t9;
|
|
169
|
-
if ($[
|
|
172
|
+
if ($[33] !== actions || $[34] !== chatId || $[35] !== clearThread) {
|
|
170
173
|
t9 = name => {
|
|
171
174
|
switch (name) {
|
|
172
175
|
case "model":
|
|
@@ -190,33 +193,33 @@ export function useChatControls(t0) {
|
|
|
190
193
|
}
|
|
191
194
|
}
|
|
192
195
|
};
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
196
|
+
$[33] = actions;
|
|
197
|
+
$[34] = chatId;
|
|
198
|
+
$[35] = clearThread;
|
|
199
|
+
$[36] = t9;
|
|
197
200
|
} else {
|
|
198
|
-
t9 = $[
|
|
201
|
+
t9 = $[36];
|
|
199
202
|
}
|
|
200
203
|
const runCommand = t9;
|
|
201
204
|
let t10;
|
|
202
|
-
if ($[
|
|
205
|
+
if ($[37] !== configure) {
|
|
203
206
|
t10 = account => configure({
|
|
204
207
|
account
|
|
205
208
|
});
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
209
|
+
$[37] = configure;
|
|
210
|
+
$[38] = t10;
|
|
208
211
|
} else {
|
|
209
|
-
t10 = $[
|
|
212
|
+
t10 = $[38];
|
|
210
213
|
}
|
|
211
214
|
let t11;
|
|
212
|
-
if ($[
|
|
215
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
213
216
|
t11 = () => setConfirmClear(false);
|
|
214
|
-
$[
|
|
217
|
+
$[39] = t11;
|
|
215
218
|
} else {
|
|
216
|
-
t11 = $[
|
|
219
|
+
t11 = $[39];
|
|
217
220
|
}
|
|
218
221
|
let t12;
|
|
219
|
-
if ($[
|
|
222
|
+
if ($[40] !== chooseModel || $[41] !== compact || $[42] !== configurationPending || $[43] !== configure || $[44] !== confirmClear || $[45] !== forceClearThread || $[46] !== modelPickerOpen || $[47] !== runCommand || $[48] !== stop || $[49] !== t10) {
|
|
220
223
|
t12 = {
|
|
221
224
|
configurationPending,
|
|
222
225
|
configure,
|
|
@@ -231,19 +234,19 @@ export function useChatControls(t0) {
|
|
|
231
234
|
cancelClear: t11,
|
|
232
235
|
forceClearThread
|
|
233
236
|
};
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
237
|
+
$[40] = chooseModel;
|
|
238
|
+
$[41] = compact;
|
|
239
|
+
$[42] = configurationPending;
|
|
240
|
+
$[43] = configure;
|
|
241
|
+
$[44] = confirmClear;
|
|
242
|
+
$[45] = forceClearThread;
|
|
243
|
+
$[46] = modelPickerOpen;
|
|
244
|
+
$[47] = runCommand;
|
|
245
|
+
$[48] = stop;
|
|
246
|
+
$[49] = t10;
|
|
247
|
+
$[50] = t12;
|
|
245
248
|
} else {
|
|
246
|
-
t12 = $[
|
|
249
|
+
t12 = $[50];
|
|
247
250
|
}
|
|
248
251
|
return t12;
|
|
249
252
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { EditorEngine } from '@adecore/editor';
|
|
3
|
+
import { type DiffSource } from '@adecore/editor-react';
|
|
3
4
|
import { type DiffDocument } from '@adecore/merge';
|
|
4
5
|
import type { FileChange } from '../../logic/tools.js';
|
|
5
6
|
type EngineLoader = () => Promise<EditorEngine>;
|
|
6
|
-
export declare function EditorDocumentDiff({ document, path, loadEngine, fallback, wrap, fill, layout, maxHeight }: {
|
|
7
|
+
export declare function EditorDocumentDiff({ document, path, loadEngine, fallback, wrap, fill, layout, maxHeight, onSource }: {
|
|
7
8
|
document: DiffDocument;
|
|
8
9
|
path: string;
|
|
9
10
|
loadEngine: EngineLoader;
|
|
@@ -12,6 +13,7 @@ export declare function EditorDocumentDiff({ document, path, loadEngine, fallbac
|
|
|
12
13
|
fill?: boolean;
|
|
13
14
|
layout?: 'unified' | 'split';
|
|
14
15
|
maxHeight?: number;
|
|
16
|
+
onSource?(source: DiffSource): void | (() => void);
|
|
15
17
|
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
16
18
|
export default function EditorEditDiff({ change, loadEngine, fallback, maxHeight, sourceChecked }: {
|
|
17
19
|
change: FileChange;
|
|
@@ -14,7 +14,7 @@ import { useHostCodeMode, useHostCodeThemes } from '../../../host-hooks.js';
|
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const engines = new WeakMap();
|
|
16
16
|
function ReadyDiff(t0) {
|
|
17
|
-
const $ = _c(
|
|
17
|
+
const $ = _c(16);
|
|
18
18
|
const {
|
|
19
19
|
document,
|
|
20
20
|
path,
|
|
@@ -22,7 +22,8 @@ function ReadyDiff(t0) {
|
|
|
22
22
|
wrap,
|
|
23
23
|
fill,
|
|
24
24
|
layout,
|
|
25
|
-
maxHeight
|
|
25
|
+
maxHeight,
|
|
26
|
+
onSource
|
|
26
27
|
} = t0;
|
|
27
28
|
useReviewSettled();
|
|
28
29
|
const {
|
|
@@ -52,7 +53,7 @@ function ReadyDiff(t0) {
|
|
|
52
53
|
t2 = $[4];
|
|
53
54
|
}
|
|
54
55
|
let t3;
|
|
55
|
-
if ($[5] !== document || $[6] !== engine || $[7] !== fill || $[8] !== layout || $[9] !== maxHeight || $[10] !==
|
|
56
|
+
if ($[5] !== document || $[6] !== engine || $[7] !== fill || $[8] !== layout || $[9] !== maxHeight || $[10] !== onSource || $[11] !== t2 || $[12] !== theme || $[13] !== tokens || $[14] !== wrap) {
|
|
56
57
|
t3 = /*#__PURE__*/_jsx(DiffView, {
|
|
57
58
|
engine: engine,
|
|
58
59
|
document: document,
|
|
@@ -64,25 +65,27 @@ function ReadyDiff(t0) {
|
|
|
64
65
|
layout: layout,
|
|
65
66
|
wrap: wrap,
|
|
66
67
|
fill: fill,
|
|
67
|
-
className: "chat-diff select-text"
|
|
68
|
+
className: "chat-diff select-text",
|
|
69
|
+
onSource: onSource
|
|
68
70
|
});
|
|
69
71
|
$[5] = document;
|
|
70
72
|
$[6] = engine;
|
|
71
73
|
$[7] = fill;
|
|
72
74
|
$[8] = layout;
|
|
73
75
|
$[9] = maxHeight;
|
|
74
|
-
$[10] =
|
|
75
|
-
$[11] =
|
|
76
|
-
$[12] =
|
|
77
|
-
$[13] =
|
|
78
|
-
$[14] =
|
|
76
|
+
$[10] = onSource;
|
|
77
|
+
$[11] = t2;
|
|
78
|
+
$[12] = theme;
|
|
79
|
+
$[13] = tokens;
|
|
80
|
+
$[14] = wrap;
|
|
81
|
+
$[15] = t3;
|
|
79
82
|
} else {
|
|
80
|
-
t3 = $[
|
|
83
|
+
t3 = $[15];
|
|
81
84
|
}
|
|
82
85
|
return t3;
|
|
83
86
|
}
|
|
84
87
|
export function EditorDocumentDiff(t0) {
|
|
85
|
-
const $ = _c(
|
|
88
|
+
const $ = _c(25);
|
|
86
89
|
const {
|
|
87
90
|
document,
|
|
88
91
|
path,
|
|
@@ -91,7 +94,8 @@ export function EditorDocumentDiff(t0) {
|
|
|
91
94
|
wrap: t1,
|
|
92
95
|
fill: t2,
|
|
93
96
|
layout: t3,
|
|
94
|
-
maxHeight: t4
|
|
97
|
+
maxHeight: t4,
|
|
98
|
+
onSource
|
|
95
99
|
} = t0;
|
|
96
100
|
const wrap = t1 === undefined ? true : t1;
|
|
97
101
|
const fill = t2 === undefined ? false : t2;
|
|
@@ -195,7 +199,7 @@ export function EditorDocumentDiff(t0) {
|
|
|
195
199
|
return t10;
|
|
196
200
|
}
|
|
197
201
|
let t9;
|
|
198
|
-
if ($[15] !== document || $[16] !== engine_0 || $[17] !== fallback || $[18] !== fill || $[19] !== layout || $[20] !== maxHeight || $[21] !==
|
|
202
|
+
if ($[15] !== document || $[16] !== engine_0 || $[17] !== fallback || $[18] !== fill || $[19] !== layout || $[20] !== maxHeight || $[21] !== onSource || $[22] !== path || $[23] !== wrap) {
|
|
199
203
|
t9 = engine_0 === null ? fallback : /*#__PURE__*/_jsx(ReadyDiff, {
|
|
200
204
|
document: document,
|
|
201
205
|
path: path,
|
|
@@ -203,7 +207,8 @@ export function EditorDocumentDiff(t0) {
|
|
|
203
207
|
wrap: wrap,
|
|
204
208
|
fill: fill,
|
|
205
209
|
layout: layout,
|
|
206
|
-
maxHeight: maxHeight
|
|
210
|
+
maxHeight: maxHeight,
|
|
211
|
+
onSource: onSource
|
|
207
212
|
});
|
|
208
213
|
$[15] = document;
|
|
209
214
|
$[16] = engine_0;
|
|
@@ -211,11 +216,12 @@ export function EditorDocumentDiff(t0) {
|
|
|
211
216
|
$[18] = fill;
|
|
212
217
|
$[19] = layout;
|
|
213
218
|
$[20] = maxHeight;
|
|
214
|
-
$[21] =
|
|
215
|
-
$[22] =
|
|
216
|
-
$[23] =
|
|
219
|
+
$[21] = onSource;
|
|
220
|
+
$[22] = path;
|
|
221
|
+
$[23] = wrap;
|
|
222
|
+
$[24] = t9;
|
|
217
223
|
} else {
|
|
218
|
-
t9 = $[
|
|
224
|
+
t9 = $[24];
|
|
219
225
|
}
|
|
220
226
|
return t9;
|
|
221
227
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { ChatFileChange } from '@adecore/agent-contracts';
|
|
3
3
|
import type { EditorEngine } from '@adecore/editor';
|
|
4
|
+
import type { DiffSource } from '@adecore/editor-react';
|
|
4
5
|
import type { DiffContents } from '../full-diff.js';
|
|
5
|
-
export default function EditorPatchDiff({ change, sourceChecked, contents, ignoreWhitespace, wrap, fill, maxHeight, layout, loadEngine, fallback }: {
|
|
6
|
+
export default function EditorPatchDiff({ change, sourceChecked, contents, ignoreWhitespace, wrap, fill, maxHeight, layout, loadEngine, fallback, onSource }: {
|
|
6
7
|
change: ChatFileChange;
|
|
7
8
|
sourceChecked?: boolean;
|
|
8
9
|
contents?: DiffContents;
|
|
@@ -13,4 +14,5 @@ export default function EditorPatchDiff({ change, sourceChecked, contents, ignor
|
|
|
13
14
|
maxHeight?: number;
|
|
14
15
|
loadEngine: () => Promise<EditorEngine>;
|
|
15
16
|
fallback: ReactNode;
|
|
17
|
+
onSource?(source: DiffSource): void | (() => void);
|
|
16
18
|
}): import("react").JSX.Element;
|
|
@@ -14,7 +14,8 @@ export default function EditorPatchDiff({
|
|
|
14
14
|
maxHeight,
|
|
15
15
|
layout = 'unified',
|
|
16
16
|
loadEngine,
|
|
17
|
-
fallback
|
|
17
|
+
fallback,
|
|
18
|
+
onSource
|
|
18
19
|
}) {
|
|
19
20
|
const oldText = contents?.old;
|
|
20
21
|
const newText = contents?.new;
|
|
@@ -40,6 +41,7 @@ export default function EditorPatchDiff({
|
|
|
40
41
|
wrap: wrap,
|
|
41
42
|
fill: fill,
|
|
42
43
|
layout: layout,
|
|
43
|
-
maxHeight: maxHeight
|
|
44
|
+
maxHeight: maxHeight,
|
|
45
|
+
onSource: onSource
|
|
44
46
|
});
|
|
45
47
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChatFileChange } from '@adecore/agent-contracts';
|
|
2
|
+
import type { DiffSource } from '@adecore/editor-react';
|
|
2
3
|
import type { DiffContents } from '../full-diff.js';
|
|
3
4
|
export interface UnifiedDiffProps {
|
|
4
5
|
allowEditor?: boolean;
|
|
@@ -9,4 +10,5 @@ export interface UnifiedDiffProps {
|
|
|
9
10
|
diffStyle?: 'unified' | 'split';
|
|
10
11
|
fill?: boolean;
|
|
11
12
|
contents?: DiffContents;
|
|
13
|
+
onSource?(source: DiffSource): void | (() => void);
|
|
12
14
|
}
|
package/dist/host-hooks.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderPlatform } from '@adecore/agent-contracts';
|
|
2
|
+
import type { AccountRule } from './agents/accounts.js';
|
|
2
3
|
import { type Referables } from './chat/chat-references.js';
|
|
3
4
|
import { type ChatHost, type CommandLook, type ComposerSendAction } from './host.js';
|
|
4
5
|
export declare function useHostCodeMode(): 'light' | 'dark';
|
|
@@ -31,3 +32,5 @@ export declare function useHostThreadCards(...args: Parameters<ChatHost['useThre
|
|
|
31
32
|
export declare function useHostReplyAuthor(...args: Parameters<ChatHost['useReplyAuthor']>): ReturnType<ChatHost['useReplyAuthor']>;
|
|
32
33
|
export declare function useHostMapSource(maps: NonNullable<ChatHost['maps']>, scopeId: string): ReturnType<NonNullable<ChatHost['maps']>['useSource']>;
|
|
33
34
|
export declare function useCommandNames(look: Required<Pick<CommandLook, 'useNames'>>, scopeId: string, chatId: string): ReturnType<NonNullable<CommandLook['useNames']>>;
|
|
35
|
+
export declare function useHostCanReorderAccounts(scopeId: string): boolean;
|
|
36
|
+
export declare function useHostAccountRule(scopeId: string, chatId: string): AccountRule | null;
|
package/dist/host-hooks.js
CHANGED
|
@@ -91,4 +91,12 @@ export function useHostMapSource(maps, scopeId) {
|
|
|
91
91
|
}
|
|
92
92
|
export function useCommandNames(look, scopeId, chatId) {
|
|
93
93
|
return look.useNames(scopeId, chatId);
|
|
94
|
+
}
|
|
95
|
+
export function useHostCanReorderAccounts(scopeId) {
|
|
96
|
+
const useCanReorder = useChatHost().useCanReorderAccounts ?? (() => true);
|
|
97
|
+
return useCanReorder(scopeId);
|
|
98
|
+
}
|
|
99
|
+
export function useHostAccountRule(scopeId, chatId) {
|
|
100
|
+
const useRule = useChatHost().useAccountRule ?? (() => null);
|
|
101
|
+
return useRule(scopeId, chatId);
|
|
94
102
|
}
|
package/dist/host.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { Highlighter, ThemeRegistration } from 'shiki';
|
|
|
5
5
|
import type { LucideIcon } from 'lucide-react';
|
|
6
6
|
import type { EditorEngine } from '@adecore/editor';
|
|
7
7
|
import type { AgentKind, ChatAttachment, ChatCheckpointDiff, ChatConfigurePayload, ChatGoalAction, ChatItem, ChatSubagentItem, ChatUiChoicePayload, ChatUiQueryPayload, ChatUiQueryReading, ChatUiLinkPayload, ChatUiLinkReading, ChatVisual, ModelSelection, ProviderPlatform, RuntimeMode } from '@adecore/agent-contracts';
|
|
8
|
+
import type { AccountRule } from './agents/accounts.js';
|
|
8
9
|
import type { ReferableKind, Referables } from './chat/chat-references.js';
|
|
9
10
|
import type { TimelineRow } from './chat/logic/timeline.js';
|
|
10
11
|
import type { FindReveal } from './chat/ui/find-reveal.js';
|
|
@@ -292,6 +293,8 @@ export interface ChatHost {
|
|
|
292
293
|
openReference?(scopeId: string, id: string): void;
|
|
293
294
|
openLogin: ((scopeId: string, kind: AgentKind, accountId: string, name: string) => Promise<void>) | null;
|
|
294
295
|
useLoginBlocked(scopeId: string): string | null;
|
|
296
|
+
useCanReorderAccounts?(scopeId: string): boolean;
|
|
297
|
+
useAccountRule?(scopeId: string, chatId: string): AccountRule | null;
|
|
295
298
|
runProviderCommand?(scopeId: string, kind: AgentKind, command: string): void;
|
|
296
299
|
useMachinePlatform?(scopeId: string): ProviderPlatform | null;
|
|
297
300
|
providerKeyNote?(variable: string): string | null;
|
|
@@ -76,6 +76,7 @@ declare const _default: {
|
|
|
76
76
|
defaults: {
|
|
77
77
|
title: string;
|
|
78
78
|
description: string;
|
|
79
|
+
descriptionWithAccount: string;
|
|
79
80
|
account: string;
|
|
80
81
|
accountFor: string;
|
|
81
82
|
model: string;
|
|
@@ -86,6 +87,9 @@ declare const _default: {
|
|
|
86
87
|
legacyModel: string;
|
|
87
88
|
};
|
|
88
89
|
accounts: string;
|
|
90
|
+
accountsOrder: string;
|
|
91
|
+
defaultTag: string;
|
|
92
|
+
reorderHandle: string;
|
|
89
93
|
};
|
|
90
94
|
account: {
|
|
91
95
|
kind: string;
|
|
@@ -145,6 +149,7 @@ declare const _default: {
|
|
|
145
149
|
confirm: string;
|
|
146
150
|
};
|
|
147
151
|
saveFailed: string;
|
|
152
|
+
reorderFailed: string;
|
|
148
153
|
};
|
|
149
154
|
add: {
|
|
150
155
|
title: string;
|
|
@@ -75,7 +75,8 @@ export default {
|
|
|
75
75
|
onlyDefault: '{{provider}} supports only its default account.',
|
|
76
76
|
defaults: {
|
|
77
77
|
title: 'Defaults for new chats',
|
|
78
|
-
description: 'Picking a model
|
|
78
|
+
description: 'Picking a model in a chat also changes its default here.',
|
|
79
|
+
descriptionWithAccount: 'Picking a model or account in a chat also changes its default here.',
|
|
79
80
|
account: 'Account',
|
|
80
81
|
accountFor: 'Default account for {{provider}}',
|
|
81
82
|
model: 'Model',
|
|
@@ -85,7 +86,10 @@ export default {
|
|
|
85
86
|
providerDefault: 'Provider default',
|
|
86
87
|
legacyModel: '{{name}} (legacy)'
|
|
87
88
|
},
|
|
88
|
-
accounts: 'Accounts'
|
|
89
|
+
accounts: 'Accounts',
|
|
90
|
+
accountsOrder: 'New chats and agents start on the top account that is on.',
|
|
91
|
+
defaultTag: 'Default',
|
|
92
|
+
reorderHandle: 'Move {{account}}. Alt+Up and Alt+Down move it too.'
|
|
89
93
|
},
|
|
90
94
|
account: {
|
|
91
95
|
kind: '{{provider}} account',
|
|
@@ -144,7 +148,8 @@ export default {
|
|
|
144
148
|
confirmDescription: 'Its folder and login stay at {{folder}}.',
|
|
145
149
|
confirm: 'Remove account'
|
|
146
150
|
},
|
|
147
|
-
saveFailed: 'Could not save the account'
|
|
151
|
+
saveFailed: 'Could not save the account',
|
|
152
|
+
reorderFailed: 'Could not change the order of the accounts'
|
|
148
153
|
},
|
|
149
154
|
add: {
|
|
150
155
|
title: 'Add {{provider}} account',
|
|
@@ -76,6 +76,7 @@ declare const _default: {
|
|
|
76
76
|
defaults: {
|
|
77
77
|
title: string;
|
|
78
78
|
description: string;
|
|
79
|
+
descriptionWithAccount: string;
|
|
79
80
|
account: string;
|
|
80
81
|
accountFor: string;
|
|
81
82
|
model: string;
|
|
@@ -86,6 +87,9 @@ declare const _default: {
|
|
|
86
87
|
legacyModel: string;
|
|
87
88
|
};
|
|
88
89
|
accounts: string;
|
|
90
|
+
accountsOrder: string;
|
|
91
|
+
defaultTag: string;
|
|
92
|
+
reorderHandle: string;
|
|
89
93
|
};
|
|
90
94
|
account: {
|
|
91
95
|
kind: string;
|
|
@@ -145,6 +149,7 @@ declare const _default: {
|
|
|
145
149
|
confirm: string;
|
|
146
150
|
};
|
|
147
151
|
saveFailed: string;
|
|
152
|
+
reorderFailed: string;
|
|
148
153
|
};
|
|
149
154
|
add: {
|
|
150
155
|
title: string;
|
|
@@ -75,7 +75,8 @@ export default {
|
|
|
75
75
|
onlyDefault: '{{provider}} kent alleen zijn standaardaccount.',
|
|
76
76
|
defaults: {
|
|
77
77
|
title: 'Standaarden voor nieuwe chats',
|
|
78
|
-
description: 'Een model
|
|
78
|
+
description: 'Een model kiezen in een chat verandert hier ook de standaard.',
|
|
79
|
+
descriptionWithAccount: 'Een model of account kiezen in een chat verandert hier ook de standaard.',
|
|
79
80
|
account: 'Account',
|
|
80
81
|
accountFor: 'Standaardaccount voor {{provider}}',
|
|
81
82
|
model: 'Model',
|
|
@@ -85,7 +86,10 @@ export default {
|
|
|
85
86
|
providerDefault: 'Standaard van de provider',
|
|
86
87
|
legacyModel: '{{name}} (legacy)'
|
|
87
88
|
},
|
|
88
|
-
accounts: 'Accounts'
|
|
89
|
+
accounts: 'Accounts',
|
|
90
|
+
accountsOrder: 'Nieuwe chats en agents starten op het bovenste account dat aanstaat.',
|
|
91
|
+
defaultTag: 'Standaard',
|
|
92
|
+
reorderHandle: 'Verplaats {{account}}. Alt+Omhoog en Alt+Omlaag verplaatsen het ook.'
|
|
89
93
|
},
|
|
90
94
|
account: {
|
|
91
95
|
kind: '{{provider}}-account',
|
|
@@ -144,7 +148,8 @@ export default {
|
|
|
144
148
|
confirmDescription: 'De map en de login blijven in {{folder}}.',
|
|
145
149
|
confirm: 'Account verwijderen'
|
|
146
150
|
},
|
|
147
|
-
saveFailed: 'Kon het account niet opslaan'
|
|
151
|
+
saveFailed: 'Kon het account niet opslaan',
|
|
152
|
+
reorderFailed: 'Kon de volgorde van de accounts niet wijzigen'
|
|
148
153
|
},
|
|
149
154
|
add: {
|
|
150
155
|
title: '{{provider}}-account toevoegen',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AccountEntry, type AccountLogin } from '../agents/accounts.js';
|
|
2
|
+
interface AccountOrderListProps {
|
|
3
|
+
entries: readonly AccountEntry[];
|
|
4
|
+
providerName: string;
|
|
5
|
+
login: AccountLogin;
|
|
6
|
+
onReorder: ((ids: string[]) => void) | null;
|
|
7
|
+
onPickAccount(id: string): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function AccountOrderList({ entries, providerName, login, onReorder, onPickAccount }: AccountOrderListProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|