@adecore/agents-react 0.50.5 → 0.50.7
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/chat-references.d.ts +1 -0
- package/dist/chat/ui/Markdown.js +20 -39
- package/dist/chat/ui/MessageActions.js +69 -51
- package/dist/chat/ui/Timeline.js +38 -25
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +1 -0
- package/dist/chat/ui/composer/use-prompt-menus.js +238 -213
- package/dist/chat/ui/rows/WorkRows.js +46 -0
- package/dist/host-hooks.d.ts +1 -0
- package/dist/host-hooks.js +7 -0
- package/dist/host.d.ts +25 -0
- package/package.json +8 -8
- package/src/chat/chat-references.ts +2 -0
- package/src/chat/ui/Markdown.tsx +2 -1
- package/src/chat/ui/MessageActions.tsx +1 -0
- package/src/chat/ui/Timeline.tsx +2 -0
- package/src/chat/ui/composer/use-prompt-menus.ts +32 -1
- package/src/chat/ui/rows/WorkRows.tsx +11 -0
- package/src/host-hooks.ts +10 -0
- package/src/host.ts +18 -0
|
@@ -3,6 +3,7 @@ import { useEffect, useId, useState } from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
|
|
5
5
|
import { useChatHost } from '../../../host.js';
|
|
6
|
+
import { useHostExpandingCommands } from '../../../host-hooks.js';
|
|
6
7
|
import { useChatScope } from '../../../scope.js';
|
|
7
8
|
import { referenceSuggestions, referenceTokens } from '../../chat-references.js';
|
|
8
9
|
import { usableSlashCommands } from '../../guards.js';
|
|
@@ -23,7 +24,7 @@ function sameQuery(left, right) {
|
|
|
23
24
|
* follow that one.
|
|
24
25
|
*/
|
|
25
26
|
export function usePromptMenus(t0) {
|
|
26
|
-
const $ = _c(
|
|
27
|
+
const $ = _c(95);
|
|
27
28
|
const {
|
|
28
29
|
draft: t1,
|
|
29
30
|
inputRef,
|
|
@@ -102,81 +103,80 @@ export function usePromptMenus(t0) {
|
|
|
102
103
|
t4 = $[5];
|
|
103
104
|
}
|
|
104
105
|
useEffect(t3, t4);
|
|
105
|
-
|
|
106
|
+
const commandQuery = text.startsWith("/") && !text.includes("\n") ? text.slice(1).trim().toLowerCase() : null;
|
|
107
|
+
const expanding = useHostExpandingCommands();
|
|
106
108
|
let t5;
|
|
107
|
-
if ($[6] !==
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
hint: t(`composer.commands.${name}`),
|
|
116
|
-
local: true,
|
|
117
|
-
skill: false
|
|
118
|
-
}));
|
|
119
|
-
const goal = goals ? [{
|
|
120
|
-
name: "goal",
|
|
121
|
-
hint: t("composer.commands.goal"),
|
|
122
|
-
local: false,
|
|
123
|
-
skill: false
|
|
124
|
-
}] : [];
|
|
125
|
-
const cli = usableSlashCommands([...slashCommands]).filter(name_0 => !localCommands.includes(name_0) && (!goals || name_0 !== "goal")).map(name_1 => ({
|
|
126
|
-
name: name_1,
|
|
127
|
-
hint: known.has(name_1) ? t("composer.commands.skill") : t("composer.commands.cli", {
|
|
128
|
-
cli: providerName ?? t("composer.commands.anyCli")
|
|
129
|
-
}),
|
|
130
|
-
local: false,
|
|
131
|
-
skill: known.has(name_1)
|
|
132
|
-
}));
|
|
133
|
-
return [...own, ...goal, ...cli].filter(command => command.name.startsWith(query)).slice(0, 8);
|
|
134
|
-
};
|
|
135
|
-
$[15] = goals;
|
|
136
|
-
$[16] = localCommands;
|
|
137
|
-
$[17] = providerName;
|
|
138
|
-
$[18] = skills;
|
|
139
|
-
$[19] = slashCommands;
|
|
140
|
-
$[20] = t;
|
|
141
|
-
$[21] = t6;
|
|
142
|
-
} else {
|
|
143
|
-
t6 = $[21];
|
|
144
|
-
}
|
|
145
|
-
const commandsOf = t6;
|
|
146
|
-
t5 = commandQuery === null ? [] : commandsOf(commandQuery);
|
|
147
|
-
$[6] = goals;
|
|
148
|
-
$[7] = localCommands;
|
|
149
|
-
$[8] = providerName;
|
|
150
|
-
$[9] = skills;
|
|
151
|
-
$[10] = slashCommands;
|
|
152
|
-
$[11] = t;
|
|
153
|
-
$[12] = text;
|
|
154
|
-
$[13] = commandQuery;
|
|
155
|
-
$[14] = t5;
|
|
109
|
+
if ($[6] !== setText || $[7] !== text) {
|
|
110
|
+
t5 = command => {
|
|
111
|
+
const args = text.replace(/^\/\S*\s*/, "");
|
|
112
|
+
command.expand?.(args).then(expanded => setText(expanded));
|
|
113
|
+
};
|
|
114
|
+
$[6] = setText;
|
|
115
|
+
$[7] = text;
|
|
116
|
+
$[8] = t5;
|
|
156
117
|
} else {
|
|
157
|
-
|
|
158
|
-
t5 = $[14];
|
|
118
|
+
t5 = $[8];
|
|
159
119
|
}
|
|
160
|
-
const
|
|
120
|
+
const expandInto = t5;
|
|
121
|
+
let t6;
|
|
122
|
+
if ($[9] !== expanding || $[10] !== goals || $[11] !== localCommands || $[12] !== providerName || $[13] !== skills || $[14] !== slashCommands || $[15] !== t) {
|
|
123
|
+
t6 = query => {
|
|
124
|
+
const known = new Set(skills.map(_temp2));
|
|
125
|
+
const own = localCommands.map(name => ({
|
|
126
|
+
name,
|
|
127
|
+
hint: t(`composer.commands.${name}`),
|
|
128
|
+
local: true,
|
|
129
|
+
skill: false
|
|
130
|
+
}));
|
|
131
|
+
const goal = goals ? [{
|
|
132
|
+
name: "goal",
|
|
133
|
+
hint: t("composer.commands.goal"),
|
|
134
|
+
local: false,
|
|
135
|
+
skill: false
|
|
136
|
+
}] : [];
|
|
137
|
+
const cli = usableSlashCommands([...slashCommands]).filter(name_0 => !localCommands.includes(name_0) && (!goals || name_0 !== "goal")).map(name_1 => ({
|
|
138
|
+
name: name_1,
|
|
139
|
+
hint: known.has(name_1) ? t("composer.commands.skill") : t("composer.commands.cli", {
|
|
140
|
+
cli: providerName ?? t("composer.commands.anyCli")
|
|
141
|
+
}),
|
|
142
|
+
local: false,
|
|
143
|
+
skill: known.has(name_1)
|
|
144
|
+
}));
|
|
145
|
+
const hosted = expanding.map(_temp3);
|
|
146
|
+
return [...hosted, ...own, ...goal, ...cli].filter(command_1 => command_1.name.startsWith(query)).slice(0, 8);
|
|
147
|
+
};
|
|
148
|
+
$[9] = expanding;
|
|
149
|
+
$[10] = goals;
|
|
150
|
+
$[11] = localCommands;
|
|
151
|
+
$[12] = providerName;
|
|
152
|
+
$[13] = skills;
|
|
153
|
+
$[14] = slashCommands;
|
|
154
|
+
$[15] = t;
|
|
155
|
+
$[16] = t6;
|
|
156
|
+
} else {
|
|
157
|
+
t6 = $[16];
|
|
158
|
+
}
|
|
159
|
+
const commandsOf = t6;
|
|
160
|
+
const commands = commandQuery === null ? [] : commandsOf(commandQuery);
|
|
161
161
|
const skillMatches = skillQuery === null ? [] : skills.filter(skill_0 => skill_0.name.toLowerCase().includes(skillQuery.query.toLowerCase())).slice(0, 8);
|
|
162
162
|
const commandMenuOpen = commandQuery !== null && commands.length > 0;
|
|
163
163
|
const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
|
|
164
164
|
const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null;
|
|
165
165
|
const files_0 = mention === null ? [] : searched.files;
|
|
166
166
|
const mentionCount = files_0.length;
|
|
167
|
-
let
|
|
168
|
-
if ($[
|
|
169
|
-
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
167
|
+
let t7;
|
|
168
|
+
if ($[17] !== referables.chatsOnly) {
|
|
169
|
+
t7 = item => !referables.chatsOnly || item.kind === "chat";
|
|
170
|
+
$[17] = referables.chatsOnly;
|
|
171
|
+
$[18] = t7;
|
|
172
172
|
} else {
|
|
173
|
-
|
|
173
|
+
t7 = $[18];
|
|
174
174
|
}
|
|
175
|
-
const offersReferences = referables.items.some(
|
|
175
|
+
const offersReferences = referables.items.some(t7);
|
|
176
176
|
const referenceMenuOpen = !commandMenuOpen && !skillMenuOpen && !mentionMenuOpen && referenceQuery !== null && offersReferences;
|
|
177
|
-
let
|
|
178
|
-
if ($[
|
|
179
|
-
|
|
177
|
+
let t8;
|
|
178
|
+
if ($[19] !== referables.items) {
|
|
179
|
+
t8 = token => {
|
|
180
180
|
const item_0 = referables.items.find(candidate => candidate.id === token.id);
|
|
181
181
|
return {
|
|
182
182
|
...token,
|
|
@@ -184,12 +184,12 @@ export function usePromptMenus(t0) {
|
|
|
184
184
|
trail: item_0?.trail
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
187
|
+
$[19] = referables.items;
|
|
188
|
+
$[20] = t8;
|
|
189
189
|
} else {
|
|
190
|
-
|
|
190
|
+
t8 = $[20];
|
|
191
191
|
}
|
|
192
|
-
const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(
|
|
192
|
+
const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t8);
|
|
193
193
|
const picked = presentReferences(text, [...draft.chats, ...draft.references], referenceChips);
|
|
194
194
|
const excluded = ownId === undefined ? picked : [ownId, ...picked];
|
|
195
195
|
const referenceMatches = referenceMenuOpen ? referenceSuggestions(referables, referenceQuery.query, excluded, REFERENCE_RESULTS) : [];
|
|
@@ -204,9 +204,9 @@ export function usePromptMenus(t0) {
|
|
|
204
204
|
activeIndex,
|
|
205
205
|
count: menuCount
|
|
206
206
|
});
|
|
207
|
-
let
|
|
208
|
-
if ($[
|
|
209
|
-
|
|
207
|
+
let t9;
|
|
208
|
+
if ($[21] !== cwd || $[22] !== draft.mentions || $[23] !== draft.skills || $[24] !== referenceChips) {
|
|
209
|
+
t9 = (value, selection, state) => {
|
|
210
210
|
const empty = selection.from === selection.to;
|
|
211
211
|
const tree = empty ? ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state) : null;
|
|
212
212
|
const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
|
|
@@ -218,41 +218,41 @@ export function usePromptMenus(t0) {
|
|
|
218
218
|
const reference = caret === null ? null : queryOutsideChips(findReferenceQuery(value, caret), chips);
|
|
219
219
|
setReferenceQuery(current_1 => sameQuery(current_1, reference) ? current_1 : reference);
|
|
220
220
|
};
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
221
|
+
$[21] = cwd;
|
|
222
|
+
$[22] = draft.mentions;
|
|
223
|
+
$[23] = draft.skills;
|
|
224
|
+
$[24] = referenceChips;
|
|
225
|
+
$[25] = t9;
|
|
226
226
|
} else {
|
|
227
|
-
|
|
227
|
+
t9 = $[25];
|
|
228
228
|
}
|
|
229
|
-
const trackTriggers =
|
|
230
|
-
let
|
|
231
|
-
if ($[
|
|
232
|
-
|
|
229
|
+
const trackTriggers = t9;
|
|
230
|
+
let t10;
|
|
231
|
+
if ($[26] !== inputRef) {
|
|
232
|
+
t10 = caret_0 => {
|
|
233
233
|
requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
|
|
234
234
|
};
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
235
|
+
$[26] = inputRef;
|
|
236
|
+
$[27] = t10;
|
|
237
237
|
} else {
|
|
238
|
-
|
|
238
|
+
t10 = $[27];
|
|
239
239
|
}
|
|
240
|
-
const moveCaret =
|
|
241
|
-
let
|
|
242
|
-
if ($[
|
|
243
|
-
|
|
240
|
+
const moveCaret = t10;
|
|
241
|
+
let t11;
|
|
242
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
243
|
+
t11 = () => {
|
|
244
244
|
setMention(null);
|
|
245
245
|
setSkillQuery(null);
|
|
246
246
|
setReferenceQuery(null);
|
|
247
247
|
};
|
|
248
|
-
$[
|
|
248
|
+
$[28] = t11;
|
|
249
249
|
} else {
|
|
250
|
-
|
|
250
|
+
t11 = $[28];
|
|
251
251
|
}
|
|
252
|
-
const close =
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
252
|
+
const close = t11;
|
|
253
|
+
let t12;
|
|
254
|
+
if ($[29] !== draft.mentions || $[30] !== mention || $[31] !== moveCaret || $[32] !== setText || $[33] !== text) {
|
|
255
|
+
t12 = path => {
|
|
256
256
|
if (!mention) {
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
@@ -261,39 +261,44 @@ export function usePromptMenus(t0) {
|
|
|
261
261
|
setMention(null);
|
|
262
262
|
moveCaret(result.caret);
|
|
263
263
|
};
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
264
|
+
$[29] = draft.mentions;
|
|
265
|
+
$[30] = mention;
|
|
266
|
+
$[31] = moveCaret;
|
|
267
|
+
$[32] = setText;
|
|
268
|
+
$[33] = text;
|
|
269
|
+
$[34] = t12;
|
|
270
270
|
} else {
|
|
271
|
-
|
|
271
|
+
t12 = $[34];
|
|
272
272
|
}
|
|
273
|
-
const chooseMention =
|
|
274
|
-
let
|
|
275
|
-
if ($[
|
|
276
|
-
|
|
273
|
+
const chooseMention = t12;
|
|
274
|
+
let t13;
|
|
275
|
+
if ($[35] !== chooseMention || $[36] !== mention || $[37] !== searched) {
|
|
276
|
+
t13 = index => {
|
|
277
277
|
const path_0 = mention === null ? null : mentionPick(index, searched, mention.query);
|
|
278
278
|
if (path_0 !== null) {
|
|
279
279
|
chooseMention(path_0);
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
282
|
+
$[35] = chooseMention;
|
|
283
|
+
$[36] = mention;
|
|
284
|
+
$[37] = searched;
|
|
285
|
+
$[38] = t13;
|
|
286
286
|
} else {
|
|
287
|
-
|
|
287
|
+
t13 = $[38];
|
|
288
288
|
}
|
|
289
|
-
const chooseMentionAt =
|
|
290
|
-
let
|
|
291
|
-
if ($[
|
|
292
|
-
|
|
289
|
+
const chooseMentionAt = t13;
|
|
290
|
+
let t14;
|
|
291
|
+
if ($[39] !== moveCaret || $[40] !== referenceQuery || $[41] !== setDraft || $[42] !== setText || $[43] !== text) {
|
|
292
|
+
t14 = item_1 => {
|
|
293
293
|
if (!referenceQuery) {
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
296
|
const result_0 = insertReference(text, referenceQuery, item_1.name);
|
|
297
|
+
if (item_1.read !== undefined) {
|
|
298
|
+
setReferenceQuery(null);
|
|
299
|
+
item_1.read().then(content => setText(result_0.text.replace(`#${item_1.name}`, content)));
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
297
302
|
const chat = item_1.kind === "chat";
|
|
298
303
|
const add = ids => ids.includes(item_1.id) ? ids : [...ids, item_1.id];
|
|
299
304
|
setDraft(current_2 => ({
|
|
@@ -309,33 +314,34 @@ export function usePromptMenus(t0) {
|
|
|
309
314
|
setReferenceQuery(null);
|
|
310
315
|
moveCaret(result_0.caret);
|
|
311
316
|
};
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
+
$[39] = moveCaret;
|
|
318
|
+
$[40] = referenceQuery;
|
|
319
|
+
$[41] = setDraft;
|
|
320
|
+
$[42] = setText;
|
|
321
|
+
$[43] = text;
|
|
322
|
+
$[44] = t14;
|
|
317
323
|
} else {
|
|
318
|
-
|
|
324
|
+
t14 = $[44];
|
|
319
325
|
}
|
|
320
|
-
const chooseReference =
|
|
321
|
-
let
|
|
322
|
-
if ($[
|
|
323
|
-
|
|
326
|
+
const chooseReference = t14;
|
|
327
|
+
let t15;
|
|
328
|
+
if ($[45] !== chooseReference || $[46] !== referenceMatches) {
|
|
329
|
+
t15 = index_0 => {
|
|
324
330
|
const item_2 = referenceMatches[index_0] ?? referenceMatches[0];
|
|
325
331
|
if (item_2 !== undefined) {
|
|
326
332
|
chooseReference(item_2);
|
|
327
333
|
}
|
|
328
334
|
};
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
335
|
+
$[45] = chooseReference;
|
|
336
|
+
$[46] = referenceMatches;
|
|
337
|
+
$[47] = t15;
|
|
332
338
|
} else {
|
|
333
|
-
|
|
339
|
+
t15 = $[47];
|
|
334
340
|
}
|
|
335
|
-
const chooseReferenceAt =
|
|
336
|
-
let
|
|
337
|
-
if ($[
|
|
338
|
-
|
|
341
|
+
const chooseReferenceAt = t15;
|
|
342
|
+
let t16;
|
|
343
|
+
if ($[48] !== draft.mentions || $[49] !== draft.skills || $[50] !== moveCaret || $[51] !== setText || $[52] !== skillQuery || $[53] !== text) {
|
|
344
|
+
t16 = name_2 => {
|
|
339
345
|
const result_1 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
|
|
340
346
|
text: `$${name_2} `,
|
|
341
347
|
caret: name_2.length + 2
|
|
@@ -344,55 +350,65 @@ export function usePromptMenus(t0) {
|
|
|
344
350
|
setSkillQuery(null);
|
|
345
351
|
moveCaret(result_1.caret);
|
|
346
352
|
};
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
353
|
+
$[48] = draft.mentions;
|
|
354
|
+
$[49] = draft.skills;
|
|
355
|
+
$[50] = moveCaret;
|
|
356
|
+
$[51] = setText;
|
|
357
|
+
$[52] = skillQuery;
|
|
358
|
+
$[53] = text;
|
|
359
|
+
$[54] = t16;
|
|
354
360
|
} else {
|
|
355
|
-
|
|
361
|
+
t16 = $[54];
|
|
356
362
|
}
|
|
357
|
-
const chooseSkill =
|
|
358
|
-
let
|
|
359
|
-
if ($[
|
|
360
|
-
|
|
363
|
+
const chooseSkill = t16;
|
|
364
|
+
let t17;
|
|
365
|
+
if ($[55] !== chooseSkill || $[56] !== expandInto || $[57] !== inputRef || $[58] !== setText) {
|
|
366
|
+
t17 = (command_2, index_1) => {
|
|
361
367
|
setMenuIndex(index_1);
|
|
362
|
-
if (
|
|
363
|
-
|
|
368
|
+
if (command_2.expand !== undefined) {
|
|
369
|
+
expandInto(command_2);
|
|
364
370
|
return;
|
|
365
371
|
}
|
|
366
|
-
|
|
372
|
+
if (command_2.skill) {
|
|
373
|
+
chooseSkill(command_2.name);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
setText(`/${command_2.name}`);
|
|
367
377
|
inputRef.current?.focus();
|
|
368
378
|
};
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
379
|
+
$[55] = chooseSkill;
|
|
380
|
+
$[56] = expandInto;
|
|
381
|
+
$[57] = inputRef;
|
|
382
|
+
$[58] = setText;
|
|
383
|
+
$[59] = t17;
|
|
373
384
|
} else {
|
|
374
|
-
|
|
385
|
+
t17 = $[59];
|
|
375
386
|
}
|
|
376
|
-
const pickCommand =
|
|
377
|
-
let
|
|
378
|
-
if ($[
|
|
379
|
-
|
|
380
|
-
if (
|
|
381
|
-
|
|
387
|
+
const pickCommand = t17;
|
|
388
|
+
let t18;
|
|
389
|
+
if ($[60] !== chooseSkill || $[61] !== expandInto || $[62] !== setText) {
|
|
390
|
+
t18 = command_3 => {
|
|
391
|
+
if (command_3.expand !== undefined) {
|
|
392
|
+
expandInto(command_3);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (command_3.skill) {
|
|
396
|
+
chooseSkill(command_3.name);
|
|
382
397
|
return;
|
|
383
398
|
}
|
|
384
|
-
setText(`/${
|
|
399
|
+
setText(`/${command_3.name} `);
|
|
385
400
|
};
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
401
|
+
$[60] = chooseSkill;
|
|
402
|
+
$[61] = expandInto;
|
|
403
|
+
$[62] = setText;
|
|
404
|
+
$[63] = t18;
|
|
389
405
|
} else {
|
|
390
|
-
|
|
406
|
+
t18 = $[63];
|
|
391
407
|
}
|
|
392
|
-
const completeCommand =
|
|
393
|
-
let
|
|
394
|
-
if ($[
|
|
395
|
-
|
|
408
|
+
const completeCommand = t18;
|
|
409
|
+
let t19;
|
|
410
|
+
if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
|
|
411
|
+
t19 = (key, count) => {
|
|
396
412
|
if (key === "ArrowDown") {
|
|
397
413
|
setMenuIndex(i => (i + 1) % count);
|
|
398
414
|
return true;
|
|
@@ -403,29 +419,29 @@ export function usePromptMenus(t0) {
|
|
|
403
419
|
}
|
|
404
420
|
return false;
|
|
405
421
|
};
|
|
406
|
-
$[
|
|
422
|
+
$[64] = t19;
|
|
407
423
|
} else {
|
|
408
|
-
|
|
424
|
+
t19 = $[64];
|
|
409
425
|
}
|
|
410
|
-
const moveInMenu =
|
|
411
|
-
const
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
426
|
+
const moveInMenu = t19;
|
|
427
|
+
const t20 = skills.length > 0;
|
|
428
|
+
let t21;
|
|
429
|
+
if ($[65] !== skills) {
|
|
430
|
+
t21 = skills.map(_temp4);
|
|
431
|
+
$[65] = skills;
|
|
432
|
+
$[66] = t21;
|
|
417
433
|
} else {
|
|
418
|
-
|
|
434
|
+
t21 = $[66];
|
|
419
435
|
}
|
|
420
|
-
let
|
|
421
|
-
if ($[
|
|
422
|
-
|
|
436
|
+
let t22;
|
|
437
|
+
if ($[67] !== activeIndex || $[68] !== chooseMention || $[69] !== chooseMentionAt || $[70] !== chooseReference || $[71] !== chooseReferenceAt || $[72] !== chooseSkill || $[73] !== commandMenuOpen || $[74] !== commandQuery || $[75] !== commands || $[76] !== completeCommand || $[77] !== files_0 || $[78] !== inputAria || $[79] !== listId || $[80] !== mention || $[81] !== mentionCount || $[82] !== mentionMenuOpen || $[83] !== menuOpen || $[84] !== pickCommand || $[85] !== referables || $[86] !== referenceChips || $[87] !== referenceMatches || $[88] !== referenceMenuOpen || $[89] !== skillMatches || $[90] !== skillMenuOpen || $[91] !== t20 || $[92] !== t21 || $[93] !== trackTriggers) {
|
|
438
|
+
t22 = {
|
|
423
439
|
listId,
|
|
424
440
|
activeIndex,
|
|
425
441
|
inputAria,
|
|
426
442
|
menuOpen,
|
|
427
|
-
hasSkills:
|
|
428
|
-
skillNames:
|
|
443
|
+
hasSkills: t20,
|
|
444
|
+
skillNames: t21,
|
|
429
445
|
commandQuery,
|
|
430
446
|
commands,
|
|
431
447
|
commandMenuOpen,
|
|
@@ -451,42 +467,51 @@ export function usePromptMenus(t0) {
|
|
|
451
467
|
completeCommand,
|
|
452
468
|
moveInMenu
|
|
453
469
|
};
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
470
|
+
$[67] = activeIndex;
|
|
471
|
+
$[68] = chooseMention;
|
|
472
|
+
$[69] = chooseMentionAt;
|
|
473
|
+
$[70] = chooseReference;
|
|
474
|
+
$[71] = chooseReferenceAt;
|
|
475
|
+
$[72] = chooseSkill;
|
|
476
|
+
$[73] = commandMenuOpen;
|
|
477
|
+
$[74] = commandQuery;
|
|
478
|
+
$[75] = commands;
|
|
479
|
+
$[76] = completeCommand;
|
|
480
|
+
$[77] = files_0;
|
|
481
|
+
$[78] = inputAria;
|
|
482
|
+
$[79] = listId;
|
|
483
|
+
$[80] = mention;
|
|
484
|
+
$[81] = mentionCount;
|
|
485
|
+
$[82] = mentionMenuOpen;
|
|
486
|
+
$[83] = menuOpen;
|
|
487
|
+
$[84] = pickCommand;
|
|
488
|
+
$[85] = referables;
|
|
489
|
+
$[86] = referenceChips;
|
|
490
|
+
$[87] = referenceMatches;
|
|
491
|
+
$[88] = referenceMenuOpen;
|
|
492
|
+
$[89] = skillMatches;
|
|
493
|
+
$[90] = skillMenuOpen;
|
|
494
|
+
$[91] = t20;
|
|
495
|
+
$[92] = t21;
|
|
496
|
+
$[93] = trackTriggers;
|
|
497
|
+
$[94] = t22;
|
|
482
498
|
} else {
|
|
483
|
-
|
|
499
|
+
t22 = $[94];
|
|
484
500
|
}
|
|
485
|
-
return
|
|
501
|
+
return t22;
|
|
486
502
|
}
|
|
487
|
-
function
|
|
503
|
+
function _temp4(skill_2) {
|
|
488
504
|
return skill_2.name;
|
|
489
505
|
}
|
|
506
|
+
function _temp3(command_0) {
|
|
507
|
+
return {
|
|
508
|
+
name: command_0.name,
|
|
509
|
+
hint: command_0.hint,
|
|
510
|
+
local: false,
|
|
511
|
+
skill: false,
|
|
512
|
+
expand: command_0.expand
|
|
513
|
+
};
|
|
514
|
+
}
|
|
490
515
|
function _temp2(skill) {
|
|
491
516
|
return skill.name;
|
|
492
517
|
}
|
|
@@ -978,6 +978,52 @@ function ToolOutput(t0) {
|
|
|
978
978
|
}
|
|
979
979
|
/* An opened call without a card: what it was asked in the foreground, what it answered muted below. With `chatId` it can ask for an output the thread keeps only the beginning of. */
|
|
980
980
|
export function ToolBody(t0) {
|
|
981
|
+
const $ = _c(11);
|
|
982
|
+
const {
|
|
983
|
+
tool,
|
|
984
|
+
chatId
|
|
985
|
+
} = t0;
|
|
986
|
+
const {
|
|
987
|
+
renderToolActions,
|
|
988
|
+
renderToolResult
|
|
989
|
+
} = useChatHost();
|
|
990
|
+
let t1;
|
|
991
|
+
if ($[0] !== chatId || $[1] !== renderToolActions || $[2] !== tool) {
|
|
992
|
+
t1 = renderToolActions?.(tool, chatId);
|
|
993
|
+
$[0] = chatId;
|
|
994
|
+
$[1] = renderToolActions;
|
|
995
|
+
$[2] = tool;
|
|
996
|
+
$[3] = t1;
|
|
997
|
+
} else {
|
|
998
|
+
t1 = $[3];
|
|
999
|
+
}
|
|
1000
|
+
let t2;
|
|
1001
|
+
if ($[4] !== chatId || $[5] !== renderToolResult || $[6] !== tool) {
|
|
1002
|
+
t2 = renderToolResult?.(tool, chatId) ?? /*#__PURE__*/_jsx(OwnToolBody, {
|
|
1003
|
+
tool: tool,
|
|
1004
|
+
chatId: chatId
|
|
1005
|
+
});
|
|
1006
|
+
$[4] = chatId;
|
|
1007
|
+
$[5] = renderToolResult;
|
|
1008
|
+
$[6] = tool;
|
|
1009
|
+
$[7] = t2;
|
|
1010
|
+
} else {
|
|
1011
|
+
t2 = $[7];
|
|
1012
|
+
}
|
|
1013
|
+
let t3;
|
|
1014
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
1015
|
+
t3 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
1016
|
+
children: [t1, t2]
|
|
1017
|
+
});
|
|
1018
|
+
$[8] = t1;
|
|
1019
|
+
$[9] = t2;
|
|
1020
|
+
$[10] = t3;
|
|
1021
|
+
} else {
|
|
1022
|
+
t3 = $[10];
|
|
1023
|
+
}
|
|
1024
|
+
return t3;
|
|
1025
|
+
}
|
|
1026
|
+
function OwnToolBody(t0) {
|
|
981
1027
|
const $ = _c(18);
|
|
982
1028
|
const {
|
|
983
1029
|
tool,
|
package/dist/host-hooks.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare function useHostTimelineFind(...args: Parameters<ChatHost['useTim
|
|
|
18
18
|
export declare function useHostReferableChats(): ReturnType<ChatHost['useReferableChats']>;
|
|
19
19
|
export declare function useHostReferables(scopeId: string, chatId: string): Referables;
|
|
20
20
|
export declare function useHostLoginBlocked(...args: Parameters<ChatHost['useLoginBlocked']>): ReturnType<ChatHost['useLoginBlocked']>;
|
|
21
|
+
export declare function useHostExpandingCommands(): ReturnType<NonNullable<ChatHost['useExpandingCommands']>>;
|
|
21
22
|
export declare function useHostMachinePlatform(scopeId: string): ProviderPlatform | null;
|
|
22
23
|
export declare function useHostProjectLook(...args: Parameters<ChatHost['useProjectLook']>): ReturnType<ChatHost['useProjectLook']>;
|
|
23
24
|
export declare function useHostMachineLabel(...args: Parameters<ChatHost['useMachineLabel']>): ReturnType<ChatHost['useMachineLabel']>;
|
package/dist/host-hooks.js
CHANGED
|
@@ -44,6 +44,13 @@ export function useHostReferables(scopeId, chatId) {
|
|
|
44
44
|
export function useHostLoginBlocked(...args) {
|
|
45
45
|
return useChatHost().useLoginBlocked(...args);
|
|
46
46
|
}
|
|
47
|
+
const NO_EXPANDING = [];
|
|
48
|
+
const noExpanding = () => NO_EXPANDING;
|
|
49
|
+
/* None where the host has no commands of its own. */
|
|
50
|
+
export function useHostExpandingCommands() {
|
|
51
|
+
const useExpanding = useChatHost().useExpandingCommands ?? noExpanding;
|
|
52
|
+
return useExpanding();
|
|
53
|
+
}
|
|
47
54
|
const noPlatform = () => null;
|
|
48
55
|
/* Null where the host does not say, as it need not. */
|
|
49
56
|
export function useHostMachinePlatform(scopeId) {
|