@adecore/agents-react 0.74.0 → 0.75.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.
@@ -220,58 +220,59 @@ function SkillMenu(t0) {
220
220
  }
221
221
  /* The CLI's mark of a model or account row, in the color of the account it runs on, as its chip wears it. */
222
222
  function NamedMark(t0) {
223
- const $ = _c(12);
223
+ const $ = _c(13);
224
224
  const {
225
225
  menus,
226
226
  pick
227
227
  } = t0;
228
228
  let t1;
229
- if ($[0] !== menus || $[1] !== pick.cli || $[2] !== pick.id || $[3] !== pick.kind) {
230
- t1 = menus.namedLook(pick.kind, pick.cli, pick.id);
229
+ if ($[0] !== menus || $[1] !== pick.account || $[2] !== pick.cli || $[3] !== pick.id || $[4] !== pick.kind) {
230
+ t1 = menus.namedLook(pick.kind, pick.cli, pick.id, pick.account);
231
231
  $[0] = menus;
232
- $[1] = pick.cli;
233
- $[2] = pick.id;
234
- $[3] = pick.kind;
235
- $[4] = t1;
232
+ $[1] = pick.account;
233
+ $[2] = pick.cli;
234
+ $[3] = pick.id;
235
+ $[4] = pick.kind;
236
+ $[5] = t1;
236
237
  } else {
237
- t1 = $[4];
238
+ t1 = $[5];
238
239
  }
239
240
  const {
240
241
  color
241
242
  } = t1;
242
243
  let t2;
243
- if ($[5] !== color) {
244
+ if ($[6] !== color) {
244
245
  t2 = color === undefined ? undefined : {
245
246
  color
246
247
  };
247
- $[5] = color;
248
- $[6] = t2;
248
+ $[6] = color;
249
+ $[7] = t2;
249
250
  } else {
250
- t2 = $[6];
251
+ t2 = $[7];
251
252
  }
252
253
  let t3;
253
- if ($[7] !== pick.cli) {
254
+ if ($[8] !== pick.cli) {
254
255
  t3 = /*#__PURE__*/_jsx(CliMark, {
255
256
  kind: pick.cli,
256
257
  size: 14
257
258
  });
258
- $[7] = pick.cli;
259
- $[8] = t3;
259
+ $[8] = pick.cli;
260
+ $[9] = t3;
260
261
  } else {
261
- t3 = $[8];
262
+ t3 = $[9];
262
263
  }
263
264
  let t4;
264
- if ($[9] !== t2 || $[10] !== t3) {
265
+ if ($[10] !== t2 || $[11] !== t3) {
265
266
  t4 = /*#__PURE__*/_jsx("span", {
266
267
  className: "flex shrink-0",
267
268
  style: t2,
268
269
  children: t3
269
270
  });
270
- $[9] = t2;
271
- $[10] = t3;
272
- $[11] = t4;
271
+ $[10] = t2;
272
+ $[11] = t3;
273
+ $[12] = t4;
273
274
  } else {
274
- t4 = $[11];
275
+ t4 = $[12];
275
276
  }
276
277
  return t4;
277
278
  }
@@ -328,13 +329,16 @@ function MentionMenu(t0) {
328
329
  children: [/*#__PURE__*/_jsx(NamedMark, {
329
330
  menus: menus,
330
331
  pick: match
331
- }), /*#__PURE__*/_jsx("span", {
332
+ }), /*#__PURE__*/_jsxs("span", {
332
333
  className: "truncate text-text",
333
- children: match.model.name
334
+ children: [match.accountName !== undefined && /*#__PURE__*/_jsx("span", {
335
+ className: "text-text-muted",
336
+ children: `${match.accountName} / `
337
+ }), match.model.name]
334
338
  }), /*#__PURE__*/_jsx(ModelMarks, {
335
339
  model: match.model
336
340
  })]
337
- }, `${match.cli}/${match.id}`))]
341
+ }, `${match.cli}:${match.account ?? ""}/${match.id}`))]
338
342
  }), accountMatches.length > 0 && /*#__PURE__*/_jsxs("div", {
339
343
  role: "group",
340
344
  "aria-labelledby": accountsLabelId,
@@ -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, this.look.label);
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
- const slash = range.value.indexOf('/');
162
- const cli = range.value.slice(0, slash);
163
- const id = range.value.slice(slash + 1);
164
- const look = named?.(range.kind, cli, id) ?? {
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(121);
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] !== mention || $[24] !== providers || $[25] !== reportedOf) {
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] = mention;
219
- $[24] = providers;
220
- $[25] = reportedOf;
221
- $[26] = accountMatches;
222
- $[27] = modelMatches;
223
- $[28] = t11;
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 = $[26];
226
- modelMatches = $[27];
227
- t11 = $[28];
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 ($[29] !== referables.chatsOnly) {
234
+ if ($[30] !== referables.chatsOnly) {
234
235
  t12 = item => !referables.chatsOnly || item.kind === "chat";
235
- $[29] = referables.chatsOnly;
236
- $[30] = t12;
236
+ $[30] = referables.chatsOnly;
237
+ $[31] = t12;
237
238
  } else {
238
- t12 = $[30];
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 ($[31] !== referables.items) {
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
- $[31] = referables.items;
253
- $[32] = t13;
253
+ $[32] = referables.items;
254
+ $[33] = t13;
254
255
  } else {
255
- t13 = $[32];
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 ($[33] !== draft.mentions || $[34] !== draft.skills || $[35] !== referenceChips) {
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
- $[33] = draft.mentions;
287
- $[34] = draft.skills;
288
- $[35] = referenceChips;
289
- $[36] = t14;
287
+ $[34] = draft.mentions;
288
+ $[35] = draft.skills;
289
+ $[36] = referenceChips;
290
+ $[37] = t14;
290
291
  } else {
291
- t14 = $[36];
292
+ t14 = $[37];
292
293
  }
293
294
  const trackTriggers = t14;
294
295
  let t15;
295
- if ($[37] !== inputRef) {
296
+ if ($[38] !== inputRef) {
296
297
  t15 = caret_0 => {
297
298
  requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
298
299
  };
299
- $[37] = inputRef;
300
- $[38] = t15;
300
+ $[38] = inputRef;
301
+ $[39] = t15;
301
302
  } else {
302
- t15 = $[38];
303
+ t15 = $[39];
303
304
  }
304
305
  const moveCaret = t15;
305
306
  let t16;
306
- if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[39] = t16;
313
+ $[40] = t16;
313
314
  } else {
314
- t16 = $[39];
315
+ t16 = $[40];
315
316
  }
316
317
  const close = t16;
317
318
  let t17;
318
- if ($[40] !== draft.mentions || $[41] !== mention || $[42] !== moveCaret || $[43] !== setText || $[44] !== text) {
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
- $[40] = draft.mentions;
329
- $[41] = mention;
330
- $[42] = moveCaret;
331
- $[43] = setText;
332
- $[44] = text;
333
- $[45] = t17;
329
+ $[41] = draft.mentions;
330
+ $[42] = mention;
331
+ $[43] = moveCaret;
332
+ $[44] = setText;
333
+ $[45] = text;
334
+ $[46] = t17;
334
335
  } else {
335
- t17 = $[45];
336
+ t17 = $[46];
336
337
  }
337
338
  const chooseMention = t17;
338
339
  let t18;
339
- if ($[46] !== mention || $[47] !== moveCaret || $[48] !== setText || $[49] !== text) {
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
- $[46] = mention;
350
- $[47] = moveCaret;
351
- $[48] = setText;
352
- $[49] = text;
353
- $[50] = t18;
350
+ $[47] = mention;
351
+ $[48] = moveCaret;
352
+ $[49] = setText;
353
+ $[50] = text;
354
+ $[51] = t18;
354
355
  } else {
355
- t18 = $[50];
356
+ t18 = $[51];
356
357
  }
357
358
  const chooseNamed = t18;
358
359
  let t19;
359
- if ($[51] !== chooseMention || $[52] !== chooseNamed || $[53] !== files_0 || $[54] !== mention || $[55] !== named || $[56] !== searched) {
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
- $[51] = chooseMention;
375
- $[52] = chooseNamed;
376
- $[53] = files_0;
377
- $[54] = mention;
378
- $[55] = named;
379
- $[56] = searched;
380
- $[57] = t19;
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 = $[57];
383
+ t19 = $[58];
383
384
  }
384
385
  const chooseMentionAt = t19;
385
386
  let t20;
386
- if ($[58] !== moveCaret || $[59] !== referenceQuery || $[60] !== setDraft || $[61] !== setText || $[62] !== text) {
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
- $[58] = moveCaret;
413
- $[59] = referenceQuery;
414
- $[60] = setDraft;
415
- $[61] = setText;
416
- $[62] = text;
417
- $[63] = t20;
413
+ $[59] = moveCaret;
414
+ $[60] = referenceQuery;
415
+ $[61] = setDraft;
416
+ $[62] = setText;
417
+ $[63] = text;
418
+ $[64] = t20;
418
419
  } else {
419
- t20 = $[63];
420
+ t20 = $[64];
420
421
  }
421
422
  const chooseReference = t20;
422
423
  let t21;
423
- if ($[64] !== chooseReference || $[65] !== referenceMatches) {
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
- $[64] = chooseReference;
431
- $[65] = referenceMatches;
432
- $[66] = t21;
431
+ $[65] = chooseReference;
432
+ $[66] = referenceMatches;
433
+ $[67] = t21;
433
434
  } else {
434
- t21 = $[66];
435
+ t21 = $[67];
435
436
  }
436
437
  const chooseReferenceAt = t21;
437
438
  let t22;
438
- if ($[67] !== draft.mentions || $[68] !== draft.skills || $[69] !== moveCaret || $[70] !== setText || $[71] !== skillQuery || $[72] !== text) {
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
- $[67] = draft.mentions;
449
- $[68] = draft.skills;
450
- $[69] = moveCaret;
451
- $[70] = setText;
452
- $[71] = skillQuery;
453
- $[72] = text;
454
- $[73] = t22;
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 = $[73];
457
+ t22 = $[74];
457
458
  }
458
459
  const chooseSkill = t22;
459
460
  let t23;
460
- if ($[74] !== chooseSkill || $[75] !== expandInto || $[76] !== inputRef || $[77] !== setText) {
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
- $[74] = chooseSkill;
475
- $[75] = expandInto;
476
- $[76] = inputRef;
477
- $[77] = setText;
478
- $[78] = t23;
475
+ $[75] = chooseSkill;
476
+ $[76] = expandInto;
477
+ $[77] = inputRef;
478
+ $[78] = setText;
479
+ $[79] = t23;
479
480
  } else {
480
- t23 = $[78];
481
+ t23 = $[79];
481
482
  }
482
483
  const pickCommand = t23;
483
484
  let t24;
484
- if ($[79] !== chooseSkill || $[80] !== expandInto || $[81] !== setText) {
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
- $[79] = chooseSkill;
497
- $[80] = expandInto;
498
- $[81] = setText;
499
- $[82] = t24;
497
+ $[80] = chooseSkill;
498
+ $[81] = expandInto;
499
+ $[82] = setText;
500
+ $[83] = t24;
500
501
  } else {
501
- t24 = $[82];
502
+ t24 = $[83];
502
503
  }
503
504
  const completeCommand = t24;
504
505
  let t25;
505
- if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
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
- $[83] = t25;
518
+ $[84] = t25;
518
519
  } else {
519
- t25 = $[83];
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 ($[84] !== hostSkills || $[85] !== skills) {
526
+ if ($[85] !== hostSkills || $[86] !== skills) {
526
527
  t28 = [...hostSkills.map(_temp6), ...skills.map(_temp7)];
527
- $[84] = hostSkills;
528
- $[85] = skills;
529
- $[86] = t28;
528
+ $[85] = hostSkills;
529
+ $[86] = skills;
530
+ $[87] = t28;
530
531
  } else {
531
- t28 = $[86];
532
+ t28 = $[87];
532
533
  }
533
534
  let t29;
534
- if ($[87] !== accountMatches || $[88] !== activeIndex || $[89] !== chooseMention || $[90] !== chooseMentionAt || $[91] !== chooseNamed || $[92] !== chooseReference || $[93] !== chooseReferenceAt || $[94] !== chooseSkill || $[95] !== commandMenuOpen || $[96] !== commandQuery || $[97] !== commands || $[98] !== completeCommand || $[99] !== files_0 || $[100] !== hostSkills || $[101] !== inputAria || $[102] !== listId || $[103] !== mention || $[104] !== mentionCount || $[105] !== mentionMenuOpen || $[106] !== menuOpen || $[107] !== modelMatches || $[108] !== namedLook || $[109] !== pickCommand || $[110] !== referables || $[111] !== referenceChips || $[112] !== referenceMatches || $[113] !== referenceMenuOpen || $[114] !== skillMatches || $[115] !== skillMenuOpen || $[116] !== t26 || $[117] !== t27 || $[118] !== t28 || $[119] !== trackTriggers) {
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
- $[87] = accountMatches;
574
- $[88] = activeIndex;
575
- $[89] = chooseMention;
576
- $[90] = chooseMentionAt;
577
- $[91] = chooseNamed;
578
- $[92] = chooseReference;
579
- $[93] = chooseReferenceAt;
580
- $[94] = chooseSkill;
581
- $[95] = commandMenuOpen;
582
- $[96] = commandQuery;
583
- $[97] = commands;
584
- $[98] = completeCommand;
585
- $[99] = files_0;
586
- $[100] = hostSkills;
587
- $[101] = inputAria;
588
- $[102] = listId;
589
- $[103] = mention;
590
- $[104] = mentionCount;
591
- $[105] = mentionMenuOpen;
592
- $[106] = menuOpen;
593
- $[107] = modelMatches;
594
- $[108] = namedLook;
595
- $[109] = pickCommand;
596
- $[110] = referables;
597
- $[111] = referenceChips;
598
- $[112] = referenceMatches;
599
- $[113] = referenceMenuOpen;
600
- $[114] = skillMatches;
601
- $[115] = skillMenuOpen;
602
- $[116] = t26;
603
- $[117] = t27;
604
- $[118] = t28;
605
- $[119] = trackTriggers;
606
- $[120] = t29;
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 = $[120];
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
- return (kind, cli, id) => {
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 === 'model') {
21
- const account = home?.provider === cli ? home.account ?? cli : undefined;
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: provider?.models.find(model => model.slug === id)?.name ?? id,
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: entry === undefined ? id : accountName(entry, provider?.name ?? cli),
30
- color: colorOf(cli, id)
39
+ label,
40
+ color: colorOf(cli, home?.provider === cli ? home.account ?? cli : undefined)
31
41
  };
32
42
  };
33
43
  }