@adecore/agents-react 0.54.15 → 0.55.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/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 +187 -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 +83 -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
|
@@ -5,9 +5,14 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import { useChatHost } from '../../../host.js';
|
|
6
6
|
import { useHostExpandingCommands } from '../../../host-hooks.js';
|
|
7
7
|
import { useChatScope } from '../../../scope.js';
|
|
8
|
+
import { useReportedModelsByProvider } from '../../../state/chats.js';
|
|
9
|
+
import { useProviderAccounts } from '../../../state/provider-accounts.js';
|
|
10
|
+
import { useProviders } from '../../../state/providers.js';
|
|
8
11
|
import { referenceSuggestions, referenceTokens } from '../../chat-references.js';
|
|
9
12
|
import { usableSlashCommands } from '../../guards.js';
|
|
10
|
-
import { chipRanges, findMentionQuery, findReferenceQuery, findSkillQuery, insertMention, insertReference, insertSkill, mentionPick, NO_MENTION_SEARCH, presentReferences, queryOutsideChips } from '../../mentions.js';
|
|
13
|
+
import { chipRanges, findMentionQuery, findReferenceQuery, findSkillQuery, insertMention, insertReference, insertSkill, insertToken, mentionPick, namedChipToken, NO_MENTION_SEARCH, presentReferences, queryOutsideChips, withNamedChips } from '../../mentions.js';
|
|
14
|
+
import { accountSuggestions, modelSuggestions } from '../../tag-suggestions.js';
|
|
15
|
+
import { useNamedChipLookup } from '../named-chip-look.js';
|
|
11
16
|
import { inCode } from './keys.js';
|
|
12
17
|
import { clampMenuIndex, composerMenuAria } from './menu-aria.js';
|
|
13
18
|
const SEARCH_DEBOUNCE_MS = 80;
|
|
@@ -24,7 +29,7 @@ function sameQuery(left, right) {
|
|
|
24
29
|
* follow that one.
|
|
25
30
|
*/
|
|
26
31
|
export function usePromptMenus(t0) {
|
|
27
|
-
const $ = _c(
|
|
32
|
+
const $ = _c(119);
|
|
28
33
|
const {
|
|
29
34
|
draft: t1,
|
|
30
35
|
inputRef,
|
|
@@ -36,7 +41,9 @@ export function usePromptMenus(t0) {
|
|
|
36
41
|
providerName,
|
|
37
42
|
referables,
|
|
38
43
|
ownId,
|
|
39
|
-
label
|
|
44
|
+
label,
|
|
45
|
+
accountRule: t3,
|
|
46
|
+
home: t4
|
|
40
47
|
} = t0;
|
|
41
48
|
const {
|
|
42
49
|
draft,
|
|
@@ -44,6 +51,8 @@ export function usePromptMenus(t0) {
|
|
|
44
51
|
setText
|
|
45
52
|
} = t1;
|
|
46
53
|
const localCommands = t2 === undefined ? NO_COMMANDS : t2;
|
|
54
|
+
const accountRule = t3 === undefined ? null : t3;
|
|
55
|
+
const home = t4 === undefined ? null : t4;
|
|
47
56
|
const {
|
|
48
57
|
t
|
|
49
58
|
} = useTranslation("agent-chat");
|
|
@@ -56,11 +65,15 @@ export function usePromptMenus(t0) {
|
|
|
56
65
|
const [referenceQuery, setReferenceQuery] = useState(null);
|
|
57
66
|
const [skillQuery, setSkillQuery] = useState(null);
|
|
58
67
|
const [searched, setSearched] = useState(NO_MENTION_SEARCH);
|
|
68
|
+
const providers = useProviders(_temp);
|
|
69
|
+
const accounts = useProviderAccounts(_temp2);
|
|
70
|
+
const reportedOf = useReportedModelsByProvider();
|
|
71
|
+
const namedLook = useNamedChipLookup(home);
|
|
59
72
|
const text = draft.text;
|
|
60
|
-
let
|
|
61
|
-
let
|
|
73
|
+
let t5;
|
|
74
|
+
let t6;
|
|
62
75
|
if ($[0] !== cwd || $[1] !== mention || $[2] !== scope || $[3] !== searchFiles) {
|
|
63
|
-
|
|
76
|
+
t5 = () => {
|
|
64
77
|
if (mention === null || cwd === null) {
|
|
65
78
|
return;
|
|
66
79
|
}
|
|
@@ -77,7 +90,7 @@ export function usePromptMenus(t0) {
|
|
|
77
90
|
});
|
|
78
91
|
setMenuIndex(0);
|
|
79
92
|
}
|
|
80
|
-
}).catch(
|
|
93
|
+
}).catch(_temp3);
|
|
81
94
|
};
|
|
82
95
|
if (mention.query === "") {
|
|
83
96
|
search();
|
|
@@ -91,37 +104,37 @@ export function usePromptMenus(t0) {
|
|
|
91
104
|
clearTimeout(timer);
|
|
92
105
|
};
|
|
93
106
|
};
|
|
94
|
-
|
|
107
|
+
t6 = [scope, cwd, mention, searchFiles];
|
|
95
108
|
$[0] = cwd;
|
|
96
109
|
$[1] = mention;
|
|
97
110
|
$[2] = scope;
|
|
98
111
|
$[3] = searchFiles;
|
|
99
|
-
$[4] =
|
|
100
|
-
$[5] =
|
|
112
|
+
$[4] = t5;
|
|
113
|
+
$[5] = t6;
|
|
101
114
|
} else {
|
|
102
|
-
|
|
103
|
-
|
|
115
|
+
t5 = $[4];
|
|
116
|
+
t6 = $[5];
|
|
104
117
|
}
|
|
105
|
-
useEffect(
|
|
118
|
+
useEffect(t5, t6);
|
|
106
119
|
const commandQuery = text.startsWith("/") && !text.includes("\n") ? text.slice(1).trim().toLowerCase() : null;
|
|
107
120
|
const expanding = useHostExpandingCommands();
|
|
108
|
-
let
|
|
121
|
+
let t7;
|
|
109
122
|
if ($[6] !== setText || $[7] !== text) {
|
|
110
|
-
|
|
123
|
+
t7 = command => {
|
|
111
124
|
const args = text.replace(/^\/\S*\s*/, "");
|
|
112
125
|
command.expand?.(args).then(expanded => setText(expanded));
|
|
113
126
|
};
|
|
114
127
|
$[6] = setText;
|
|
115
128
|
$[7] = text;
|
|
116
|
-
$[8] =
|
|
129
|
+
$[8] = t7;
|
|
117
130
|
} else {
|
|
118
|
-
|
|
131
|
+
t7 = $[8];
|
|
119
132
|
}
|
|
120
|
-
const expandInto =
|
|
121
|
-
let
|
|
133
|
+
const expandInto = t7;
|
|
134
|
+
let t8;
|
|
122
135
|
if ($[9] !== expanding || $[10] !== goals || $[11] !== localCommands || $[12] !== providerName || $[13] !== skills || $[14] !== slashCommands || $[15] !== t) {
|
|
123
|
-
|
|
124
|
-
const known = new Set(skills.map(
|
|
136
|
+
t8 = query => {
|
|
137
|
+
const known = new Set(skills.map(_temp4));
|
|
125
138
|
const own = localCommands.map(name => ({
|
|
126
139
|
name,
|
|
127
140
|
hint: t(`composer.commands.${name}`),
|
|
@@ -142,7 +155,7 @@ export function usePromptMenus(t0) {
|
|
|
142
155
|
local: false,
|
|
143
156
|
skill: known.has(name_1)
|
|
144
157
|
}));
|
|
145
|
-
const hosted = expanding.map(
|
|
158
|
+
const hosted = expanding.map(_temp5);
|
|
146
159
|
return [...hosted, ...own, ...goal, ...cli].filter(command_1 => command_1.name.startsWith(query)).slice(0, 8);
|
|
147
160
|
};
|
|
148
161
|
$[9] = expanding;
|
|
@@ -152,31 +165,62 @@ export function usePromptMenus(t0) {
|
|
|
152
165
|
$[13] = skills;
|
|
153
166
|
$[14] = slashCommands;
|
|
154
167
|
$[15] = t;
|
|
155
|
-
$[16] =
|
|
168
|
+
$[16] = t8;
|
|
156
169
|
} else {
|
|
157
|
-
|
|
170
|
+
t8 = $[16];
|
|
158
171
|
}
|
|
159
|
-
const commandsOf =
|
|
172
|
+
const commandsOf = t8;
|
|
160
173
|
const commands = commandQuery === null ? [] : commandsOf(commandQuery);
|
|
161
174
|
const skillMatches = skillQuery === null ? [] : skills.filter(skill_0 => skill_0.name.toLowerCase().includes(skillQuery.query.toLowerCase())).slice(0, 8);
|
|
162
175
|
const commandMenuOpen = commandQuery !== null && commands.length > 0;
|
|
163
176
|
const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
$[
|
|
171
|
-
$[18] = t7;
|
|
177
|
+
let t9;
|
|
178
|
+
if ($[17] !== cwd || $[18] !== mention || $[19] !== searched) {
|
|
179
|
+
t9 = mention === null || cwd === null ? [] : searched.files;
|
|
180
|
+
$[17] = cwd;
|
|
181
|
+
$[18] = mention;
|
|
182
|
+
$[19] = searched;
|
|
183
|
+
$[20] = t9;
|
|
172
184
|
} else {
|
|
173
|
-
|
|
185
|
+
t9 = $[20];
|
|
174
186
|
}
|
|
175
|
-
const
|
|
187
|
+
const files_0 = t9;
|
|
188
|
+
let accountMatches;
|
|
189
|
+
let modelMatches;
|
|
190
|
+
let t10;
|
|
191
|
+
if ($[21] !== accountRule || $[22] !== accounts || $[23] !== mention || $[24] !== providers || $[25] !== reportedOf) {
|
|
192
|
+
modelMatches = mention === null ? [] : modelSuggestions(providers, accounts, mention.query, reportedOf);
|
|
193
|
+
accountMatches = mention === null ? [] : accountSuggestions(providers, accounts, accountRule, mention.query);
|
|
194
|
+
t10 = [...modelMatches, ...accountMatches];
|
|
195
|
+
$[21] = accountRule;
|
|
196
|
+
$[22] = accounts;
|
|
197
|
+
$[23] = mention;
|
|
198
|
+
$[24] = providers;
|
|
199
|
+
$[25] = reportedOf;
|
|
200
|
+
$[26] = accountMatches;
|
|
201
|
+
$[27] = modelMatches;
|
|
202
|
+
$[28] = t10;
|
|
203
|
+
} else {
|
|
204
|
+
accountMatches = $[26];
|
|
205
|
+
modelMatches = $[27];
|
|
206
|
+
t10 = $[28];
|
|
207
|
+
}
|
|
208
|
+
const named = t10;
|
|
209
|
+
const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null && (cwd !== null || named.length > 0);
|
|
210
|
+
const mentionCount = files_0.length + named.length;
|
|
211
|
+
let t11;
|
|
212
|
+
if ($[29] !== referables.chatsOnly) {
|
|
213
|
+
t11 = item => !referables.chatsOnly || item.kind === "chat";
|
|
214
|
+
$[29] = referables.chatsOnly;
|
|
215
|
+
$[30] = t11;
|
|
216
|
+
} else {
|
|
217
|
+
t11 = $[30];
|
|
218
|
+
}
|
|
219
|
+
const offersReferences = referables.items.some(t11);
|
|
176
220
|
const referenceMenuOpen = !commandMenuOpen && !skillMenuOpen && !mentionMenuOpen && referenceQuery !== null && offersReferences;
|
|
177
|
-
let
|
|
178
|
-
if ($[
|
|
179
|
-
|
|
221
|
+
let t12;
|
|
222
|
+
if ($[31] !== referables.items) {
|
|
223
|
+
t12 = token => {
|
|
180
224
|
const item_0 = referables.items.find(candidate => candidate.id === token.id);
|
|
181
225
|
return {
|
|
182
226
|
...token,
|
|
@@ -184,12 +228,12 @@ export function usePromptMenus(t0) {
|
|
|
184
228
|
trail: item_0?.trail
|
|
185
229
|
};
|
|
186
230
|
};
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
231
|
+
$[31] = referables.items;
|
|
232
|
+
$[32] = t12;
|
|
189
233
|
} else {
|
|
190
|
-
|
|
234
|
+
t12 = $[32];
|
|
191
235
|
}
|
|
192
|
-
const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(
|
|
236
|
+
const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t12);
|
|
193
237
|
const picked = presentReferences(text, [...draft.chats, ...draft.references], referenceChips);
|
|
194
238
|
const excluded = ownId === undefined ? picked : [ownId, ...picked];
|
|
195
239
|
const referenceMatches = referenceMenuOpen ? referenceSuggestions(referables, referenceQuery.query, excluded, REFERENCE_RESULTS) : [];
|
|
@@ -204,55 +248,54 @@ export function usePromptMenus(t0) {
|
|
|
204
248
|
activeIndex,
|
|
205
249
|
count: menuCount
|
|
206
250
|
});
|
|
207
|
-
let
|
|
208
|
-
if ($[
|
|
209
|
-
|
|
251
|
+
let t13;
|
|
252
|
+
if ($[33] !== draft.mentions || $[34] !== draft.skills || $[35] !== referenceChips) {
|
|
253
|
+
t13 = (value, selection, state) => {
|
|
210
254
|
const empty = selection.from === selection.to;
|
|
211
255
|
const tree = empty ? ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state) : null;
|
|
212
256
|
const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
|
|
213
|
-
const chips = caret === null ? [] : chipRanges(value, draft.mentions, draft.skills, [], referenceChips);
|
|
257
|
+
const chips = caret === null ? [] : withNamedChips(value, chipRanges(value, draft.mentions, draft.skills, [], referenceChips));
|
|
214
258
|
const skill_1 = caret === null ? null : queryOutsideChips(findSkillQuery(value, caret), chips);
|
|
215
259
|
setSkillQuery(current => sameQuery(current, skill_1) ? current : skill_1);
|
|
216
|
-
const next = caret === null
|
|
260
|
+
const next = caret === null ? null : queryOutsideChips(findMentionQuery(value, caret), chips);
|
|
217
261
|
setMention(current_0 => sameQuery(current_0, next) ? current_0 : next);
|
|
218
262
|
const reference = caret === null ? null : queryOutsideChips(findReferenceQuery(value, caret), chips);
|
|
219
263
|
setReferenceQuery(current_1 => sameQuery(current_1, reference) ? current_1 : reference);
|
|
220
264
|
};
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[25] = t9;
|
|
265
|
+
$[33] = draft.mentions;
|
|
266
|
+
$[34] = draft.skills;
|
|
267
|
+
$[35] = referenceChips;
|
|
268
|
+
$[36] = t13;
|
|
226
269
|
} else {
|
|
227
|
-
|
|
270
|
+
t13 = $[36];
|
|
228
271
|
}
|
|
229
|
-
const trackTriggers =
|
|
230
|
-
let
|
|
231
|
-
if ($[
|
|
232
|
-
|
|
272
|
+
const trackTriggers = t13;
|
|
273
|
+
let t14;
|
|
274
|
+
if ($[37] !== inputRef) {
|
|
275
|
+
t14 = caret_0 => {
|
|
233
276
|
requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
|
|
234
277
|
};
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
278
|
+
$[37] = inputRef;
|
|
279
|
+
$[38] = t14;
|
|
237
280
|
} else {
|
|
238
|
-
|
|
281
|
+
t14 = $[38];
|
|
239
282
|
}
|
|
240
|
-
const moveCaret =
|
|
241
|
-
let
|
|
242
|
-
if ($[
|
|
243
|
-
|
|
283
|
+
const moveCaret = t14;
|
|
284
|
+
let t15;
|
|
285
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
286
|
+
t15 = () => {
|
|
244
287
|
setMention(null);
|
|
245
288
|
setSkillQuery(null);
|
|
246
289
|
setReferenceQuery(null);
|
|
247
290
|
};
|
|
248
|
-
$[
|
|
291
|
+
$[39] = t15;
|
|
249
292
|
} else {
|
|
250
|
-
|
|
293
|
+
t15 = $[39];
|
|
251
294
|
}
|
|
252
|
-
const close =
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
295
|
+
const close = t15;
|
|
296
|
+
let t16;
|
|
297
|
+
if ($[40] !== draft.mentions || $[41] !== mention || $[42] !== moveCaret || $[43] !== setText || $[44] !== text) {
|
|
298
|
+
t16 = path => {
|
|
256
299
|
if (!mention) {
|
|
257
300
|
return;
|
|
258
301
|
}
|
|
@@ -261,49 +304,80 @@ export function usePromptMenus(t0) {
|
|
|
261
304
|
setMention(null);
|
|
262
305
|
moveCaret(result.caret);
|
|
263
306
|
};
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
307
|
+
$[40] = draft.mentions;
|
|
308
|
+
$[41] = mention;
|
|
309
|
+
$[42] = moveCaret;
|
|
310
|
+
$[43] = setText;
|
|
311
|
+
$[44] = text;
|
|
312
|
+
$[45] = t16;
|
|
270
313
|
} else {
|
|
271
|
-
|
|
314
|
+
t16 = $[45];
|
|
272
315
|
}
|
|
273
|
-
const chooseMention =
|
|
274
|
-
let
|
|
275
|
-
if ($[
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
chooseMention(path_0);
|
|
316
|
+
const chooseMention = t16;
|
|
317
|
+
let t17;
|
|
318
|
+
if ($[46] !== mention || $[47] !== moveCaret || $[48] !== setText || $[49] !== text) {
|
|
319
|
+
t17 = pick => {
|
|
320
|
+
if (!mention) {
|
|
321
|
+
return;
|
|
280
322
|
}
|
|
323
|
+
const result_0 = insertToken(text, mention, "", namedChipToken(pick.kind, pick.cli, pick.id));
|
|
324
|
+
setText(result_0.text);
|
|
325
|
+
setMention(null);
|
|
326
|
+
moveCaret(result_0.caret);
|
|
281
327
|
};
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
328
|
+
$[46] = mention;
|
|
329
|
+
$[47] = moveCaret;
|
|
330
|
+
$[48] = setText;
|
|
331
|
+
$[49] = text;
|
|
332
|
+
$[50] = t17;
|
|
286
333
|
} else {
|
|
287
|
-
|
|
334
|
+
t17 = $[50];
|
|
288
335
|
}
|
|
289
|
-
const
|
|
290
|
-
let
|
|
291
|
-
if ($[
|
|
292
|
-
|
|
336
|
+
const chooseNamed = t17;
|
|
337
|
+
let t18;
|
|
338
|
+
if ($[51] !== chooseMention || $[52] !== chooseNamed || $[53] !== files_0 || $[54] !== mention || $[55] !== named || $[56] !== searched) {
|
|
339
|
+
t18 = index => {
|
|
340
|
+
const pick_0 = mention === null ? null : mentionPick(index, {
|
|
341
|
+
query: searched.query,
|
|
342
|
+
files: files_0
|
|
343
|
+
}, mention.query, named);
|
|
344
|
+
if (pick_0 === null) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (pick_0.kind === "file") {
|
|
348
|
+
chooseMention(pick_0.path);
|
|
349
|
+
} else {
|
|
350
|
+
chooseNamed(pick_0);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
$[51] = chooseMention;
|
|
354
|
+
$[52] = chooseNamed;
|
|
355
|
+
$[53] = files_0;
|
|
356
|
+
$[54] = mention;
|
|
357
|
+
$[55] = named;
|
|
358
|
+
$[56] = searched;
|
|
359
|
+
$[57] = t18;
|
|
360
|
+
} else {
|
|
361
|
+
t18 = $[57];
|
|
362
|
+
}
|
|
363
|
+
const chooseMentionAt = t18;
|
|
364
|
+
let t19;
|
|
365
|
+
if ($[58] !== moveCaret || $[59] !== referenceQuery || $[60] !== setDraft || $[61] !== setText || $[62] !== text) {
|
|
366
|
+
t19 = item_1 => {
|
|
293
367
|
if (!referenceQuery) {
|
|
294
368
|
return;
|
|
295
369
|
}
|
|
296
|
-
const
|
|
370
|
+
const result_1 = insertReference(text, referenceQuery, item_1.name);
|
|
297
371
|
if (item_1.read !== undefined) {
|
|
298
372
|
setReferenceQuery(null);
|
|
299
|
-
item_1.read().then(content => setText(
|
|
373
|
+
item_1.read().then(content => setText(result_1.text.replace(`#${item_1.name}`, content)));
|
|
300
374
|
return;
|
|
301
375
|
}
|
|
302
376
|
const chat = item_1.kind === "chat";
|
|
303
377
|
const add = ids => ids.includes(item_1.id) ? ids : [...ids, item_1.id];
|
|
304
378
|
setDraft(current_2 => ({
|
|
305
379
|
...current_2,
|
|
306
|
-
text:
|
|
380
|
+
text: result_1.text,
|
|
307
381
|
chats: chat ? add(current_2.chats) : current_2.chats,
|
|
308
382
|
references: chat ? current_2.references : add(current_2.references),
|
|
309
383
|
referenceNames: {
|
|
@@ -312,58 +386,58 @@ export function usePromptMenus(t0) {
|
|
|
312
386
|
}
|
|
313
387
|
}));
|
|
314
388
|
setReferenceQuery(null);
|
|
315
|
-
moveCaret(
|
|
389
|
+
moveCaret(result_1.caret);
|
|
316
390
|
};
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
391
|
+
$[58] = moveCaret;
|
|
392
|
+
$[59] = referenceQuery;
|
|
393
|
+
$[60] = setDraft;
|
|
394
|
+
$[61] = setText;
|
|
395
|
+
$[62] = text;
|
|
396
|
+
$[63] = t19;
|
|
323
397
|
} else {
|
|
324
|
-
|
|
398
|
+
t19 = $[63];
|
|
325
399
|
}
|
|
326
|
-
const chooseReference =
|
|
327
|
-
let
|
|
328
|
-
if ($[
|
|
329
|
-
|
|
400
|
+
const chooseReference = t19;
|
|
401
|
+
let t20;
|
|
402
|
+
if ($[64] !== chooseReference || $[65] !== referenceMatches) {
|
|
403
|
+
t20 = index_0 => {
|
|
330
404
|
const item_2 = referenceMatches[index_0] ?? referenceMatches[0];
|
|
331
405
|
if (item_2 !== undefined) {
|
|
332
406
|
chooseReference(item_2);
|
|
333
407
|
}
|
|
334
408
|
};
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
409
|
+
$[64] = chooseReference;
|
|
410
|
+
$[65] = referenceMatches;
|
|
411
|
+
$[66] = t20;
|
|
338
412
|
} else {
|
|
339
|
-
|
|
413
|
+
t20 = $[66];
|
|
340
414
|
}
|
|
341
|
-
const chooseReferenceAt =
|
|
342
|
-
let
|
|
343
|
-
if ($[
|
|
344
|
-
|
|
345
|
-
const
|
|
415
|
+
const chooseReferenceAt = t20;
|
|
416
|
+
let t21;
|
|
417
|
+
if ($[67] !== draft.mentions || $[68] !== draft.skills || $[69] !== moveCaret || $[70] !== setText || $[71] !== skillQuery || $[72] !== text) {
|
|
418
|
+
t21 = name_2 => {
|
|
419
|
+
const result_2 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
|
|
346
420
|
text: `$${name_2} `,
|
|
347
421
|
caret: name_2.length + 2
|
|
348
422
|
};
|
|
349
|
-
setText(
|
|
423
|
+
setText(result_2.text, draft.mentions, draft.skills.includes(name_2) ? draft.skills : [...draft.skills, name_2]);
|
|
350
424
|
setSkillQuery(null);
|
|
351
|
-
moveCaret(
|
|
425
|
+
moveCaret(result_2.caret);
|
|
352
426
|
};
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
427
|
+
$[67] = draft.mentions;
|
|
428
|
+
$[68] = draft.skills;
|
|
429
|
+
$[69] = moveCaret;
|
|
430
|
+
$[70] = setText;
|
|
431
|
+
$[71] = skillQuery;
|
|
432
|
+
$[72] = text;
|
|
433
|
+
$[73] = t21;
|
|
360
434
|
} else {
|
|
361
|
-
|
|
435
|
+
t21 = $[73];
|
|
362
436
|
}
|
|
363
|
-
const chooseSkill =
|
|
364
|
-
let
|
|
365
|
-
if ($[
|
|
366
|
-
|
|
437
|
+
const chooseSkill = t21;
|
|
438
|
+
let t22;
|
|
439
|
+
if ($[74] !== chooseSkill || $[75] !== expandInto || $[76] !== inputRef || $[77] !== setText) {
|
|
440
|
+
t22 = (command_2, index_1) => {
|
|
367
441
|
setMenuIndex(index_1);
|
|
368
442
|
if (command_2.expand !== undefined) {
|
|
369
443
|
expandInto(command_2);
|
|
@@ -376,18 +450,18 @@ export function usePromptMenus(t0) {
|
|
|
376
450
|
setText(`/${command_2.name}`);
|
|
377
451
|
inputRef.current?.focus();
|
|
378
452
|
};
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
453
|
+
$[74] = chooseSkill;
|
|
454
|
+
$[75] = expandInto;
|
|
455
|
+
$[76] = inputRef;
|
|
456
|
+
$[77] = setText;
|
|
457
|
+
$[78] = t22;
|
|
384
458
|
} else {
|
|
385
|
-
|
|
459
|
+
t22 = $[78];
|
|
386
460
|
}
|
|
387
|
-
const pickCommand =
|
|
388
|
-
let
|
|
389
|
-
if ($[
|
|
390
|
-
|
|
461
|
+
const pickCommand = t22;
|
|
462
|
+
let t23;
|
|
463
|
+
if ($[79] !== chooseSkill || $[80] !== expandInto || $[81] !== setText) {
|
|
464
|
+
t23 = command_3 => {
|
|
391
465
|
if (command_3.expand !== undefined) {
|
|
392
466
|
expandInto(command_3);
|
|
393
467
|
return;
|
|
@@ -398,17 +472,17 @@ export function usePromptMenus(t0) {
|
|
|
398
472
|
}
|
|
399
473
|
setText(`/${command_3.name} `);
|
|
400
474
|
};
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
475
|
+
$[79] = chooseSkill;
|
|
476
|
+
$[80] = expandInto;
|
|
477
|
+
$[81] = setText;
|
|
478
|
+
$[82] = t23;
|
|
405
479
|
} else {
|
|
406
|
-
|
|
480
|
+
t23 = $[82];
|
|
407
481
|
}
|
|
408
|
-
const completeCommand =
|
|
409
|
-
let
|
|
410
|
-
if ($[
|
|
411
|
-
|
|
482
|
+
const completeCommand = t23;
|
|
483
|
+
let t24;
|
|
484
|
+
if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
|
|
485
|
+
t24 = (key, count) => {
|
|
412
486
|
if (key === "ArrowDown") {
|
|
413
487
|
setMenuIndex(i => (i + 1) % count);
|
|
414
488
|
return true;
|
|
@@ -419,31 +493,31 @@ export function usePromptMenus(t0) {
|
|
|
419
493
|
}
|
|
420
494
|
return false;
|
|
421
495
|
};
|
|
422
|
-
$[
|
|
496
|
+
$[83] = t24;
|
|
423
497
|
} else {
|
|
424
|
-
|
|
498
|
+
t24 = $[83];
|
|
425
499
|
}
|
|
426
|
-
const moveInMenu =
|
|
427
|
-
const
|
|
428
|
-
const
|
|
429
|
-
let
|
|
430
|
-
if ($[
|
|
431
|
-
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
500
|
+
const moveInMenu = t24;
|
|
501
|
+
const t25 = skills.length > 0;
|
|
502
|
+
const t26 = offersReferences && !referables.chatsOnly;
|
|
503
|
+
let t27;
|
|
504
|
+
if ($[84] !== skills) {
|
|
505
|
+
t27 = skills.map(_temp6);
|
|
506
|
+
$[84] = skills;
|
|
507
|
+
$[85] = t27;
|
|
434
508
|
} else {
|
|
435
|
-
|
|
509
|
+
t27 = $[85];
|
|
436
510
|
}
|
|
437
|
-
let
|
|
438
|
-
if ($[
|
|
439
|
-
|
|
511
|
+
let t28;
|
|
512
|
+
if ($[86] !== accountMatches || $[87] !== activeIndex || $[88] !== chooseMention || $[89] !== chooseMentionAt || $[90] !== chooseNamed || $[91] !== chooseReference || $[92] !== chooseReferenceAt || $[93] !== chooseSkill || $[94] !== commandMenuOpen || $[95] !== commandQuery || $[96] !== commands || $[97] !== completeCommand || $[98] !== files_0 || $[99] !== inputAria || $[100] !== listId || $[101] !== mention || $[102] !== mentionCount || $[103] !== mentionMenuOpen || $[104] !== menuOpen || $[105] !== modelMatches || $[106] !== namedLook || $[107] !== pickCommand || $[108] !== referables || $[109] !== referenceChips || $[110] !== referenceMatches || $[111] !== referenceMenuOpen || $[112] !== skillMatches || $[113] !== skillMenuOpen || $[114] !== t25 || $[115] !== t26 || $[116] !== t27 || $[117] !== trackTriggers) {
|
|
513
|
+
t28 = {
|
|
440
514
|
listId,
|
|
441
515
|
activeIndex,
|
|
442
516
|
inputAria,
|
|
443
517
|
menuOpen,
|
|
444
|
-
hasSkills:
|
|
445
|
-
offersViews:
|
|
446
|
-
skillNames:
|
|
518
|
+
hasSkills: t25,
|
|
519
|
+
offersViews: t26,
|
|
520
|
+
skillNames: t27,
|
|
447
521
|
commandQuery,
|
|
448
522
|
commands,
|
|
449
523
|
commandMenuOpen,
|
|
@@ -453,6 +527,9 @@ export function usePromptMenus(t0) {
|
|
|
453
527
|
mentionMenuOpen,
|
|
454
528
|
mentionCount,
|
|
455
529
|
files: files_0,
|
|
530
|
+
modelMatches,
|
|
531
|
+
accountMatches,
|
|
532
|
+
namedLook,
|
|
456
533
|
referenceMenuOpen,
|
|
457
534
|
referenceMatches,
|
|
458
535
|
referables,
|
|
@@ -461,6 +538,7 @@ export function usePromptMenus(t0) {
|
|
|
461
538
|
trackTriggers,
|
|
462
539
|
close,
|
|
463
540
|
chooseMention,
|
|
541
|
+
chooseNamed,
|
|
464
542
|
chooseMentionAt,
|
|
465
543
|
chooseReference,
|
|
466
544
|
chooseReferenceAt,
|
|
@@ -469,44 +547,48 @@ export function usePromptMenus(t0) {
|
|
|
469
547
|
completeCommand,
|
|
470
548
|
moveInMenu
|
|
471
549
|
};
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
550
|
+
$[86] = accountMatches;
|
|
551
|
+
$[87] = activeIndex;
|
|
552
|
+
$[88] = chooseMention;
|
|
553
|
+
$[89] = chooseMentionAt;
|
|
554
|
+
$[90] = chooseNamed;
|
|
555
|
+
$[91] = chooseReference;
|
|
556
|
+
$[92] = chooseReferenceAt;
|
|
557
|
+
$[93] = chooseSkill;
|
|
558
|
+
$[94] = commandMenuOpen;
|
|
559
|
+
$[95] = commandQuery;
|
|
560
|
+
$[96] = commands;
|
|
561
|
+
$[97] = completeCommand;
|
|
562
|
+
$[98] = files_0;
|
|
563
|
+
$[99] = inputAria;
|
|
564
|
+
$[100] = listId;
|
|
565
|
+
$[101] = mention;
|
|
566
|
+
$[102] = mentionCount;
|
|
567
|
+
$[103] = mentionMenuOpen;
|
|
568
|
+
$[104] = menuOpen;
|
|
569
|
+
$[105] = modelMatches;
|
|
570
|
+
$[106] = namedLook;
|
|
571
|
+
$[107] = pickCommand;
|
|
572
|
+
$[108] = referables;
|
|
573
|
+
$[109] = referenceChips;
|
|
574
|
+
$[110] = referenceMatches;
|
|
575
|
+
$[111] = referenceMenuOpen;
|
|
576
|
+
$[112] = skillMatches;
|
|
577
|
+
$[113] = skillMenuOpen;
|
|
578
|
+
$[114] = t25;
|
|
579
|
+
$[115] = t26;
|
|
580
|
+
$[116] = t27;
|
|
581
|
+
$[117] = trackTriggers;
|
|
582
|
+
$[118] = t28;
|
|
501
583
|
} else {
|
|
502
|
-
|
|
584
|
+
t28 = $[118];
|
|
503
585
|
}
|
|
504
|
-
return
|
|
586
|
+
return t28;
|
|
505
587
|
}
|
|
506
|
-
function
|
|
588
|
+
function _temp6(skill_2) {
|
|
507
589
|
return skill_2.name;
|
|
508
590
|
}
|
|
509
|
-
function
|
|
591
|
+
function _temp5(command_0) {
|
|
510
592
|
return {
|
|
511
593
|
name: command_0.name,
|
|
512
594
|
hint: command_0.hint,
|
|
@@ -515,7 +597,13 @@ function _temp3(command_0) {
|
|
|
515
597
|
expand: command_0.expand
|
|
516
598
|
};
|
|
517
599
|
}
|
|
518
|
-
function
|
|
600
|
+
function _temp4(skill) {
|
|
519
601
|
return skill.name;
|
|
520
602
|
}
|
|
521
|
-
function
|
|
603
|
+
function _temp3() {}
|
|
604
|
+
function _temp2(row_0) {
|
|
605
|
+
return row_0.accounts;
|
|
606
|
+
}
|
|
607
|
+
function _temp(row) {
|
|
608
|
+
return row.providers;
|
|
609
|
+
}
|