@adecore/agents-react 0.74.1 → 0.75.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/chat/logic/timeline.js +3 -0
- package/dist/chat/mentions.d.ts +11 -2
- package/dist/chat/mentions.js +57 -18
- package/dist/chat/stop-task.d.ts +1 -0
- package/dist/chat/stop-task.js +34 -0
- package/dist/chat/tag-suggestions.d.ts +3 -1
- package/dist/chat/tag-suggestions.js +54 -10
- package/dist/chat/ui/ChatActivity.js +20 -42
- package/dist/chat/ui/Composer.js +397 -381
- package/dist/chat/ui/NamedChip.js +49 -44
- package/dist/chat/ui/ReferenceChip.d.ts +2 -1
- package/dist/chat/ui/ReferenceChip.js +64 -48
- package/dist/chat/ui/chip-clipboard.js +17 -6
- package/dist/chat/ui/composer/ComposerMenu.js +28 -24
- package/dist/chat/ui/composer/QueuedMessages.d.ts +5 -1
- package/dist/chat/ui/composer/QueuedMessages.js +60 -30
- package/dist/chat/ui/composer/chips.js +19 -8
- package/dist/chat/ui/composer/use-prompt-menus.js +138 -137
- package/dist/chat/ui/named-chip-look.d.ts +2 -1
- package/dist/chat/ui/named-chip-look.js +18 -8
- package/dist/chat/ui/rehype-chips.js +6 -3
- package/dist/chat/ui/rows/MessageRows.d.ts +6 -2
- package/dist/chat/ui/rows/MessageRows.js +122 -45
- package/dist/chat/ui/rows/Rows.js +65 -61
- package/dist/chat/waiting-on.d.ts +6 -0
- package/dist/chat/waiting-on.js +13 -2
- package/dist/host/timeline-row.d.ts +1 -0
- package/dist/locales/en/agent-chat.d.ts +4 -0
- package/dist/locales/en/agent-chat.js +5 -1
- package/dist/locales/nl/agent-chat.d.ts +4 -0
- package/dist/locales/nl/agent-chat.js +5 -1
- package/package.json +9 -9
- package/src/chat/logic/timeline.ts +2 -1
- package/src/chat/mentions.ts +69 -18
- package/src/chat/stop-task.ts +17 -0
- package/src/chat/tag-suggestions.ts +73 -11
- package/src/chat/ui/ChatActivity.tsx +2 -10
- package/src/chat/ui/Composer.tsx +3 -0
- package/src/chat/ui/NamedChip.tsx +10 -10
- package/src/chat/ui/ReferenceChip.tsx +4 -1
- package/src/chat/ui/chip-clipboard.ts +9 -5
- package/src/chat/ui/composer/ComposerMenu.tsx +6 -3
- package/src/chat/ui/composer/QueuedMessages.tsx +21 -1
- package/src/chat/ui/composer/chips.ts +18 -7
- package/src/chat/ui/composer/use-prompt-menus.ts +2 -2
- package/src/chat/ui/named-chip-look.ts +19 -8
- package/src/chat/ui/rehype-chips.ts +7 -3
- package/src/chat/ui/rows/MessageRows.tsx +34 -3
- package/src/chat/ui/rows/Rows.tsx +1 -1
- package/src/chat/waiting-on.ts +13 -2
- package/src/host/timeline-row.ts +1 -1
- package/src/locales/en/agent-chat.ts +5 -1
- package/src/locales/nl/agent-chat.ts +5 -1
|
@@ -5,7 +5,7 @@ import { createElement, Fragment } from 'react';
|
|
|
5
5
|
import { createRoot } from 'react-dom/client';
|
|
6
6
|
import { MarkGlyph } from '../../../agents/AgentIcon.js';
|
|
7
7
|
import { CliMark } from '../../../agents/AgentModelLabel.js';
|
|
8
|
-
import { chipRanges, withNamedChips } from '../../mentions.js';
|
|
8
|
+
import { chipRanges, namedChipParts, withNamedChips } from '../../mentions.js';
|
|
9
9
|
import { CHIP_IN_EDITOR, MENTION_TONE, REFERENCE_TONE, SKILL_TONE, TOKEN_ICON_IN_EDITOR } from '../chips.js';
|
|
10
10
|
import { referenceGlyph } from '../reference-icons.js';
|
|
11
11
|
import { ReferenceTrail } from '../ReferenceTrail.js';
|
|
@@ -84,7 +84,7 @@ class NamedChipWidget extends WidgetType {
|
|
|
84
84
|
this.look = look;
|
|
85
85
|
}
|
|
86
86
|
eq(other) {
|
|
87
|
-
return other.cli === this.cli && other.look.label === this.look.label && other.look.color === this.look.color;
|
|
87
|
+
return other.cli === this.cli && other.look.label === this.look.label && other.look.color === this.look.color && other.look.account === this.look.account;
|
|
88
88
|
}
|
|
89
89
|
toDOM() {
|
|
90
90
|
const chip = document.createElement('span');
|
|
@@ -100,7 +100,14 @@ class NamedChipWidget extends WidgetType {
|
|
|
100
100
|
size: 12
|
|
101
101
|
}));
|
|
102
102
|
roots.set(chip, root);
|
|
103
|
-
chip.append(mark
|
|
103
|
+
chip.append(mark);
|
|
104
|
+
if (this.look.account !== undefined) {
|
|
105
|
+
const account = document.createElement('span');
|
|
106
|
+
account.className = 'text-text-muted';
|
|
107
|
+
account.textContent = `${this.look.account} / `;
|
|
108
|
+
chip.append(account);
|
|
109
|
+
}
|
|
110
|
+
chip.append(this.look.label);
|
|
104
111
|
return chip;
|
|
105
112
|
}
|
|
106
113
|
destroy(dom) {
|
|
@@ -158,12 +165,16 @@ function chipMarks(state) {
|
|
|
158
165
|
// `@a.ts` in backticks is code, not a mention.
|
|
159
166
|
for (const range of withNamedChips(text, chipRanges(text, mentions, skills, code, references), code)) {
|
|
160
167
|
if (range.kind === 'model' || range.kind === 'account') {
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
// A named range always holds a `<cli>/`, since the pattern that found it requires one.
|
|
169
|
+
const {
|
|
170
|
+
cli,
|
|
171
|
+
id,
|
|
172
|
+
account
|
|
173
|
+
} = namedChipParts(range.value);
|
|
174
|
+
const look = named?.(range.kind, cli, id, account) ?? {
|
|
165
175
|
label: id,
|
|
166
|
-
color: undefined
|
|
176
|
+
color: undefined,
|
|
177
|
+
account
|
|
167
178
|
};
|
|
168
179
|
const atom = Decoration.replace({
|
|
169
180
|
widget: new NamedChipWidget(cli, look)
|
|
@@ -48,7 +48,7 @@ function sameQuery(left, right) {
|
|
|
48
48
|
* follow that one.
|
|
49
49
|
*/
|
|
50
50
|
export function usePromptMenus(t0) {
|
|
51
|
-
const $ = _c(
|
|
51
|
+
const $ = _c(122);
|
|
52
52
|
const {
|
|
53
53
|
draft: t1,
|
|
54
54
|
inputRef,
|
|
@@ -209,38 +209,39 @@ export function usePromptMenus(t0) {
|
|
|
209
209
|
let accountMatches;
|
|
210
210
|
let modelMatches;
|
|
211
211
|
let t11;
|
|
212
|
-
if ($[21] !== accountRule || $[22] !== accounts || $[23] !==
|
|
213
|
-
modelMatches = mention === null ? [] : modelSuggestions(providers, accounts, mention.query, reportedOf);
|
|
212
|
+
if ($[21] !== accountRule || $[22] !== accounts || $[23] !== home || $[24] !== mention || $[25] !== providers || $[26] !== reportedOf) {
|
|
213
|
+
modelMatches = mention === null ? [] : modelSuggestions(providers, accounts, mention.query, reportedOf, accountRule, home);
|
|
214
214
|
accountMatches = mention === null ? [] : accountSuggestions(providers, accounts, accountRule, mention.query);
|
|
215
215
|
t11 = [...modelMatches, ...accountMatches];
|
|
216
216
|
$[21] = accountRule;
|
|
217
217
|
$[22] = accounts;
|
|
218
|
-
$[23] =
|
|
219
|
-
$[24] =
|
|
220
|
-
$[25] =
|
|
221
|
-
$[26] =
|
|
222
|
-
$[27] =
|
|
223
|
-
$[28] =
|
|
218
|
+
$[23] = home;
|
|
219
|
+
$[24] = mention;
|
|
220
|
+
$[25] = providers;
|
|
221
|
+
$[26] = reportedOf;
|
|
222
|
+
$[27] = accountMatches;
|
|
223
|
+
$[28] = modelMatches;
|
|
224
|
+
$[29] = t11;
|
|
224
225
|
} else {
|
|
225
|
-
accountMatches = $[
|
|
226
|
-
modelMatches = $[
|
|
227
|
-
t11 = $[
|
|
226
|
+
accountMatches = $[27];
|
|
227
|
+
modelMatches = $[28];
|
|
228
|
+
t11 = $[29];
|
|
228
229
|
}
|
|
229
230
|
const named = t11;
|
|
230
231
|
const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null && (cwd !== null || named.length > 0);
|
|
231
232
|
const mentionCount = files_0.length + named.length;
|
|
232
233
|
let t12;
|
|
233
|
-
if ($[
|
|
234
|
+
if ($[30] !== referables.chatsOnly) {
|
|
234
235
|
t12 = item => !referables.chatsOnly || item.kind === "chat";
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
236
|
+
$[30] = referables.chatsOnly;
|
|
237
|
+
$[31] = t12;
|
|
237
238
|
} else {
|
|
238
|
-
t12 = $[
|
|
239
|
+
t12 = $[31];
|
|
239
240
|
}
|
|
240
241
|
const offersReferences = referables.items.some(t12);
|
|
241
242
|
const referenceMenuOpen = !commandMenuOpen && !skillMenuOpen && !mentionMenuOpen && referenceQuery !== null && offersReferences;
|
|
242
243
|
let t13;
|
|
243
|
-
if ($[
|
|
244
|
+
if ($[32] !== referables.items) {
|
|
244
245
|
t13 = token => {
|
|
245
246
|
const item_0 = referables.items.find(candidate => candidate.id === token.id);
|
|
246
247
|
return {
|
|
@@ -249,10 +250,10 @@ export function usePromptMenus(t0) {
|
|
|
249
250
|
trail: item_0?.trail
|
|
250
251
|
};
|
|
251
252
|
};
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
253
|
+
$[32] = referables.items;
|
|
254
|
+
$[33] = t13;
|
|
254
255
|
} else {
|
|
255
|
-
t13 = $[
|
|
256
|
+
t13 = $[33];
|
|
256
257
|
}
|
|
257
258
|
const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t13);
|
|
258
259
|
const picked = presentReferences(text, [...draft.chats, ...draft.references], referenceChips);
|
|
@@ -270,7 +271,7 @@ export function usePromptMenus(t0) {
|
|
|
270
271
|
count: menuCount
|
|
271
272
|
});
|
|
272
273
|
let t14;
|
|
273
|
-
if ($[
|
|
274
|
+
if ($[34] !== draft.mentions || $[35] !== draft.skills || $[36] !== referenceChips) {
|
|
274
275
|
t14 = (value, selection, state) => {
|
|
275
276
|
const empty = selection.from === selection.to;
|
|
276
277
|
const tree = empty ? ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state) : null;
|
|
@@ -283,39 +284,39 @@ export function usePromptMenus(t0) {
|
|
|
283
284
|
const reference = caret === null ? null : queryOutsideChips(findReferenceQuery(value, caret), chips);
|
|
284
285
|
setReferenceQuery(current_1 => sameQuery(current_1, reference) ? current_1 : reference);
|
|
285
286
|
};
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
287
|
+
$[34] = draft.mentions;
|
|
288
|
+
$[35] = draft.skills;
|
|
289
|
+
$[36] = referenceChips;
|
|
290
|
+
$[37] = t14;
|
|
290
291
|
} else {
|
|
291
|
-
t14 = $[
|
|
292
|
+
t14 = $[37];
|
|
292
293
|
}
|
|
293
294
|
const trackTriggers = t14;
|
|
294
295
|
let t15;
|
|
295
|
-
if ($[
|
|
296
|
+
if ($[38] !== inputRef) {
|
|
296
297
|
t15 = caret_0 => {
|
|
297
298
|
requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
|
|
298
299
|
};
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
300
|
+
$[38] = inputRef;
|
|
301
|
+
$[39] = t15;
|
|
301
302
|
} else {
|
|
302
|
-
t15 = $[
|
|
303
|
+
t15 = $[39];
|
|
303
304
|
}
|
|
304
305
|
const moveCaret = t15;
|
|
305
306
|
let t16;
|
|
306
|
-
if ($[
|
|
307
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
307
308
|
t16 = () => {
|
|
308
309
|
setMention(null);
|
|
309
310
|
setSkillQuery(null);
|
|
310
311
|
setReferenceQuery(null);
|
|
311
312
|
};
|
|
312
|
-
$[
|
|
313
|
+
$[40] = t16;
|
|
313
314
|
} else {
|
|
314
|
-
t16 = $[
|
|
315
|
+
t16 = $[40];
|
|
315
316
|
}
|
|
316
317
|
const close = t16;
|
|
317
318
|
let t17;
|
|
318
|
-
if ($[
|
|
319
|
+
if ($[41] !== draft.mentions || $[42] !== mention || $[43] !== moveCaret || $[44] !== setText || $[45] !== text) {
|
|
319
320
|
t17 = path => {
|
|
320
321
|
if (!mention) {
|
|
321
322
|
return;
|
|
@@ -325,38 +326,38 @@ export function usePromptMenus(t0) {
|
|
|
325
326
|
setMention(null);
|
|
326
327
|
moveCaret(result.caret);
|
|
327
328
|
};
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
$[
|
|
329
|
+
$[41] = draft.mentions;
|
|
330
|
+
$[42] = mention;
|
|
331
|
+
$[43] = moveCaret;
|
|
332
|
+
$[44] = setText;
|
|
333
|
+
$[45] = text;
|
|
334
|
+
$[46] = t17;
|
|
334
335
|
} else {
|
|
335
|
-
t17 = $[
|
|
336
|
+
t17 = $[46];
|
|
336
337
|
}
|
|
337
338
|
const chooseMention = t17;
|
|
338
339
|
let t18;
|
|
339
|
-
if ($[
|
|
340
|
+
if ($[47] !== mention || $[48] !== moveCaret || $[49] !== setText || $[50] !== text) {
|
|
340
341
|
t18 = pick => {
|
|
341
342
|
if (!mention) {
|
|
342
343
|
return;
|
|
343
344
|
}
|
|
344
|
-
const result_0 = insertToken(text, mention, "", namedChipToken(pick.kind, pick.cli, pick.id));
|
|
345
|
+
const result_0 = insertToken(text, mention, "", namedChipToken(pick.kind, pick.cli, pick.id, pick.account));
|
|
345
346
|
setText(result_0.text);
|
|
346
347
|
setMention(null);
|
|
347
348
|
moveCaret(result_0.caret);
|
|
348
349
|
};
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
350
|
+
$[47] = mention;
|
|
351
|
+
$[48] = moveCaret;
|
|
352
|
+
$[49] = setText;
|
|
353
|
+
$[50] = text;
|
|
354
|
+
$[51] = t18;
|
|
354
355
|
} else {
|
|
355
|
-
t18 = $[
|
|
356
|
+
t18 = $[51];
|
|
356
357
|
}
|
|
357
358
|
const chooseNamed = t18;
|
|
358
359
|
let t19;
|
|
359
|
-
if ($[
|
|
360
|
+
if ($[52] !== chooseMention || $[53] !== chooseNamed || $[54] !== files_0 || $[55] !== mention || $[56] !== named || $[57] !== searched) {
|
|
360
361
|
t19 = index => {
|
|
361
362
|
const pick_0 = mention === null ? null : mentionPick(index, {
|
|
362
363
|
query: searched.query,
|
|
@@ -371,19 +372,19 @@ export function usePromptMenus(t0) {
|
|
|
371
372
|
chooseNamed(pick_0);
|
|
372
373
|
}
|
|
373
374
|
};
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
375
|
+
$[52] = chooseMention;
|
|
376
|
+
$[53] = chooseNamed;
|
|
377
|
+
$[54] = files_0;
|
|
378
|
+
$[55] = mention;
|
|
379
|
+
$[56] = named;
|
|
380
|
+
$[57] = searched;
|
|
381
|
+
$[58] = t19;
|
|
381
382
|
} else {
|
|
382
|
-
t19 = $[
|
|
383
|
+
t19 = $[58];
|
|
383
384
|
}
|
|
384
385
|
const chooseMentionAt = t19;
|
|
385
386
|
let t20;
|
|
386
|
-
if ($[
|
|
387
|
+
if ($[59] !== moveCaret || $[60] !== referenceQuery || $[61] !== setDraft || $[62] !== setText || $[63] !== text) {
|
|
387
388
|
t20 = item_1 => {
|
|
388
389
|
if (!referenceQuery) {
|
|
389
390
|
return;
|
|
@@ -409,33 +410,33 @@ export function usePromptMenus(t0) {
|
|
|
409
410
|
setReferenceQuery(null);
|
|
410
411
|
moveCaret(result_1.caret);
|
|
411
412
|
};
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
413
|
+
$[59] = moveCaret;
|
|
414
|
+
$[60] = referenceQuery;
|
|
415
|
+
$[61] = setDraft;
|
|
416
|
+
$[62] = setText;
|
|
417
|
+
$[63] = text;
|
|
418
|
+
$[64] = t20;
|
|
418
419
|
} else {
|
|
419
|
-
t20 = $[
|
|
420
|
+
t20 = $[64];
|
|
420
421
|
}
|
|
421
422
|
const chooseReference = t20;
|
|
422
423
|
let t21;
|
|
423
|
-
if ($[
|
|
424
|
+
if ($[65] !== chooseReference || $[66] !== referenceMatches) {
|
|
424
425
|
t21 = index_0 => {
|
|
425
426
|
const item_2 = referenceMatches[index_0] ?? referenceMatches[0];
|
|
426
427
|
if (item_2 !== undefined) {
|
|
427
428
|
chooseReference(item_2);
|
|
428
429
|
}
|
|
429
430
|
};
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
431
|
+
$[65] = chooseReference;
|
|
432
|
+
$[66] = referenceMatches;
|
|
433
|
+
$[67] = t21;
|
|
433
434
|
} else {
|
|
434
|
-
t21 = $[
|
|
435
|
+
t21 = $[67];
|
|
435
436
|
}
|
|
436
437
|
const chooseReferenceAt = t21;
|
|
437
438
|
let t22;
|
|
438
|
-
if ($[
|
|
439
|
+
if ($[68] !== draft.mentions || $[69] !== draft.skills || $[70] !== moveCaret || $[71] !== setText || $[72] !== skillQuery || $[73] !== text) {
|
|
439
440
|
t22 = name_2 => {
|
|
440
441
|
const result_2 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
|
|
441
442
|
text: `$${name_2} `,
|
|
@@ -445,19 +446,19 @@ export function usePromptMenus(t0) {
|
|
|
445
446
|
setSkillQuery(null);
|
|
446
447
|
moveCaret(result_2.caret);
|
|
447
448
|
};
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
449
|
+
$[68] = draft.mentions;
|
|
450
|
+
$[69] = draft.skills;
|
|
451
|
+
$[70] = moveCaret;
|
|
452
|
+
$[71] = setText;
|
|
453
|
+
$[72] = skillQuery;
|
|
454
|
+
$[73] = text;
|
|
455
|
+
$[74] = t22;
|
|
455
456
|
} else {
|
|
456
|
-
t22 = $[
|
|
457
|
+
t22 = $[74];
|
|
457
458
|
}
|
|
458
459
|
const chooseSkill = t22;
|
|
459
460
|
let t23;
|
|
460
|
-
if ($[
|
|
461
|
+
if ($[75] !== chooseSkill || $[76] !== expandInto || $[77] !== inputRef || $[78] !== setText) {
|
|
461
462
|
t23 = (command_2, index_1) => {
|
|
462
463
|
setMenuIndex(index_1);
|
|
463
464
|
if (command_2.expand !== undefined) {
|
|
@@ -471,17 +472,17 @@ export function usePromptMenus(t0) {
|
|
|
471
472
|
setText(`/${command_2.name}`);
|
|
472
473
|
inputRef.current?.focus();
|
|
473
474
|
};
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
475
|
+
$[75] = chooseSkill;
|
|
476
|
+
$[76] = expandInto;
|
|
477
|
+
$[77] = inputRef;
|
|
478
|
+
$[78] = setText;
|
|
479
|
+
$[79] = t23;
|
|
479
480
|
} else {
|
|
480
|
-
t23 = $[
|
|
481
|
+
t23 = $[79];
|
|
481
482
|
}
|
|
482
483
|
const pickCommand = t23;
|
|
483
484
|
let t24;
|
|
484
|
-
if ($[
|
|
485
|
+
if ($[80] !== chooseSkill || $[81] !== expandInto || $[82] !== setText) {
|
|
485
486
|
t24 = command_3 => {
|
|
486
487
|
if (command_3.expand !== undefined) {
|
|
487
488
|
expandInto(command_3);
|
|
@@ -493,16 +494,16 @@ export function usePromptMenus(t0) {
|
|
|
493
494
|
}
|
|
494
495
|
setText(`/${command_3.name} `);
|
|
495
496
|
};
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
497
|
+
$[80] = chooseSkill;
|
|
498
|
+
$[81] = expandInto;
|
|
499
|
+
$[82] = setText;
|
|
500
|
+
$[83] = t24;
|
|
500
501
|
} else {
|
|
501
|
-
t24 = $[
|
|
502
|
+
t24 = $[83];
|
|
502
503
|
}
|
|
503
504
|
const completeCommand = t24;
|
|
504
505
|
let t25;
|
|
505
|
-
if ($[
|
|
506
|
+
if ($[84] === Symbol.for("react.memo_cache_sentinel")) {
|
|
506
507
|
t25 = (key, count) => {
|
|
507
508
|
if (key === "ArrowDown") {
|
|
508
509
|
setMenuIndex(i => (i + 1) % count);
|
|
@@ -514,24 +515,24 @@ export function usePromptMenus(t0) {
|
|
|
514
515
|
}
|
|
515
516
|
return false;
|
|
516
517
|
};
|
|
517
|
-
$[
|
|
518
|
+
$[84] = t25;
|
|
518
519
|
} else {
|
|
519
|
-
t25 = $[
|
|
520
|
+
t25 = $[84];
|
|
520
521
|
}
|
|
521
522
|
const moveInMenu = t25;
|
|
522
523
|
const t26 = skills.length > 0 || hostSkills.length > 0;
|
|
523
524
|
const t27 = offersReferences && !referables.chatsOnly;
|
|
524
525
|
let t28;
|
|
525
|
-
if ($[
|
|
526
|
+
if ($[85] !== hostSkills || $[86] !== skills) {
|
|
526
527
|
t28 = [...hostSkills.map(_temp6), ...skills.map(_temp7)];
|
|
527
|
-
$[
|
|
528
|
-
$[
|
|
529
|
-
$[
|
|
528
|
+
$[85] = hostSkills;
|
|
529
|
+
$[86] = skills;
|
|
530
|
+
$[87] = t28;
|
|
530
531
|
} else {
|
|
531
|
-
t28 = $[
|
|
532
|
+
t28 = $[87];
|
|
532
533
|
}
|
|
533
534
|
let t29;
|
|
534
|
-
if ($[
|
|
535
|
+
if ($[88] !== accountMatches || $[89] !== activeIndex || $[90] !== chooseMention || $[91] !== chooseMentionAt || $[92] !== chooseNamed || $[93] !== chooseReference || $[94] !== chooseReferenceAt || $[95] !== chooseSkill || $[96] !== commandMenuOpen || $[97] !== commandQuery || $[98] !== commands || $[99] !== completeCommand || $[100] !== files_0 || $[101] !== hostSkills || $[102] !== inputAria || $[103] !== listId || $[104] !== mention || $[105] !== mentionCount || $[106] !== mentionMenuOpen || $[107] !== menuOpen || $[108] !== modelMatches || $[109] !== namedLook || $[110] !== pickCommand || $[111] !== referables || $[112] !== referenceChips || $[113] !== referenceMatches || $[114] !== referenceMenuOpen || $[115] !== skillMatches || $[116] !== skillMenuOpen || $[117] !== t26 || $[118] !== t27 || $[119] !== t28 || $[120] !== trackTriggers) {
|
|
535
536
|
t29 = {
|
|
536
537
|
listId,
|
|
537
538
|
activeIndex,
|
|
@@ -570,42 +571,42 @@ export function usePromptMenus(t0) {
|
|
|
570
571
|
completeCommand,
|
|
571
572
|
moveInMenu
|
|
572
573
|
};
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
$[
|
|
588
|
-
$[
|
|
589
|
-
$[
|
|
590
|
-
$[
|
|
591
|
-
$[
|
|
592
|
-
$[
|
|
593
|
-
$[
|
|
594
|
-
$[
|
|
595
|
-
$[
|
|
596
|
-
$[
|
|
597
|
-
$[
|
|
598
|
-
$[
|
|
599
|
-
$[
|
|
600
|
-
$[
|
|
601
|
-
$[
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
606
|
-
$[
|
|
574
|
+
$[88] = accountMatches;
|
|
575
|
+
$[89] = activeIndex;
|
|
576
|
+
$[90] = chooseMention;
|
|
577
|
+
$[91] = chooseMentionAt;
|
|
578
|
+
$[92] = chooseNamed;
|
|
579
|
+
$[93] = chooseReference;
|
|
580
|
+
$[94] = chooseReferenceAt;
|
|
581
|
+
$[95] = chooseSkill;
|
|
582
|
+
$[96] = commandMenuOpen;
|
|
583
|
+
$[97] = commandQuery;
|
|
584
|
+
$[98] = commands;
|
|
585
|
+
$[99] = completeCommand;
|
|
586
|
+
$[100] = files_0;
|
|
587
|
+
$[101] = hostSkills;
|
|
588
|
+
$[102] = inputAria;
|
|
589
|
+
$[103] = listId;
|
|
590
|
+
$[104] = mention;
|
|
591
|
+
$[105] = mentionCount;
|
|
592
|
+
$[106] = mentionMenuOpen;
|
|
593
|
+
$[107] = menuOpen;
|
|
594
|
+
$[108] = modelMatches;
|
|
595
|
+
$[109] = namedLook;
|
|
596
|
+
$[110] = pickCommand;
|
|
597
|
+
$[111] = referables;
|
|
598
|
+
$[112] = referenceChips;
|
|
599
|
+
$[113] = referenceMatches;
|
|
600
|
+
$[114] = referenceMenuOpen;
|
|
601
|
+
$[115] = skillMatches;
|
|
602
|
+
$[116] = skillMenuOpen;
|
|
603
|
+
$[117] = t26;
|
|
604
|
+
$[118] = t27;
|
|
605
|
+
$[119] = t28;
|
|
606
|
+
$[120] = trackTriggers;
|
|
607
|
+
$[121] = t29;
|
|
607
608
|
} else {
|
|
608
|
-
t29 = $[
|
|
609
|
+
t29 = $[121];
|
|
609
610
|
}
|
|
610
611
|
return t29;
|
|
611
612
|
}
|
|
@@ -4,8 +4,9 @@ import type { NamedChipKind } from '../mentions.js';
|
|
|
4
4
|
export interface NamedChipLook {
|
|
5
5
|
label: string;
|
|
6
6
|
color: string | undefined;
|
|
7
|
+
account?: string;
|
|
7
8
|
}
|
|
8
|
-
export type NamedChipLookup = (kind: NamedChipKind, cli: string, id: string) => NamedChipLook;
|
|
9
|
+
export type NamedChipLookup = (kind: NamedChipKind, cli: string, id: string, account?: string) => NamedChipLook;
|
|
9
10
|
export interface NamedChipHome {
|
|
10
11
|
provider: AgentKind;
|
|
11
12
|
account: string | undefined;
|
|
@@ -15,19 +15,29 @@ export function namedChipLookup(providers, accounts, accents, home) {
|
|
|
15
15
|
const kind = UsageProviderSchema.safeParse(cli);
|
|
16
16
|
return accountColor(entry?.account.color, accents) ?? (kind.success ? PROVIDER_COLORS[kind.data] : undefined);
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
const nameOf = (cli, accountId, providerName) => {
|
|
19
|
+
const entry = accountsOfKind(accounts, cli).find(candidate => candidate.id === accountId);
|
|
20
|
+
return entry === undefined ? accountId : accountName(entry, providerName ?? cli);
|
|
21
|
+
};
|
|
22
|
+
return (kind, cli, id, account) => {
|
|
19
23
|
const provider = providers.find(entry => entry.kind === cli);
|
|
20
|
-
if (kind === '
|
|
21
|
-
|
|
24
|
+
if (kind === 'account') {
|
|
25
|
+
return {
|
|
26
|
+
label: nameOf(cli, id, provider?.name),
|
|
27
|
+
color: colorOf(cli, id)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const label = provider?.models.find(model => model.slug === id)?.name ?? id;
|
|
31
|
+
if (account !== undefined) {
|
|
22
32
|
return {
|
|
23
|
-
label
|
|
24
|
-
color: colorOf(cli, account)
|
|
33
|
+
label,
|
|
34
|
+
color: colorOf(cli, account),
|
|
35
|
+
account: nameOf(cli, account, provider?.name)
|
|
25
36
|
};
|
|
26
37
|
}
|
|
27
|
-
const entry = accountsOfKind(accounts, cli).find(candidate => candidate.id === id);
|
|
28
38
|
return {
|
|
29
|
-
label
|
|
30
|
-
color: colorOf(cli,
|
|
39
|
+
label,
|
|
40
|
+
color: colorOf(cli, home?.provider === cli ? home.account ?? cli : undefined)
|
|
31
41
|
};
|
|
32
42
|
};
|
|
33
43
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { chipText, tokenizeChips, tokenizeNamedReferences } from '../mentions.js';
|
|
1
|
+
import { chipText, namedChipValue, tokenizeChips, tokenizeNamedReferences } from '../mentions.js';
|
|
2
2
|
function valueOf(segment) {
|
|
3
3
|
if (segment.kind === 'mention') {
|
|
4
4
|
return segment.path;
|
|
5
5
|
}
|
|
6
|
-
if (segment.kind === 'model'
|
|
7
|
-
return
|
|
6
|
+
if (segment.kind === 'model') {
|
|
7
|
+
return namedChipValue(segment.cli, segment.id, segment.account);
|
|
8
|
+
}
|
|
9
|
+
if (segment.kind === 'account') {
|
|
10
|
+
return namedChipValue(segment.cli, segment.id);
|
|
8
11
|
}
|
|
9
12
|
return segment.kind === 'skill' ? segment.name : segment.id;
|
|
10
13
|
}
|
|
@@ -35,13 +35,16 @@ export declare function LiveThoughtRow({ chatId, item: derived }: {
|
|
|
35
35
|
chatId: string;
|
|
36
36
|
item: ChatThinkingItem;
|
|
37
37
|
}): import("react").JSX.Element | null;
|
|
38
|
-
|
|
38
|
+
interface NoteRowProps {
|
|
39
39
|
id: string;
|
|
40
40
|
level: 'info' | 'warning' | 'error';
|
|
41
41
|
text: string;
|
|
42
42
|
from?: string;
|
|
43
43
|
said?: true;
|
|
44
|
-
|
|
44
|
+
chatId?: string;
|
|
45
|
+
stops?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function NoteRow({ id, level, text, from, said, chatId, stops }: NoteRowProps): import("react").JSX.Element;
|
|
45
48
|
export declare function UnknownRow({ id, waits }: {
|
|
46
49
|
id: string;
|
|
47
50
|
waits: boolean;
|
|
@@ -69,3 +72,4 @@ export declare function SecretRow({ item }: {
|
|
|
69
72
|
export declare function QuestionHistoryRow({ item }: {
|
|
70
73
|
item: ChatQuestionItem;
|
|
71
74
|
}): import("react").JSX.Element;
|
|
75
|
+
export {};
|