@adecore/agents-react 0.54.16 → 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.
Files changed (91) hide show
  1. package/dist/agents/AgentModelLabel.d.ts +5 -0
  2. package/dist/agents/AgentModelLabel.js +32 -7
  3. package/dist/chat/account-choice.d.ts +1 -0
  4. package/dist/chat/account-choice.js +13 -4
  5. package/dist/chat/mentions.d.ts +24 -2
  6. package/dist/chat/mentions.js +84 -10
  7. package/dist/chat/subagent-list.d.ts +0 -1
  8. package/dist/chat/subagent-list.js +1 -9
  9. package/dist/chat/tag-suggestions.d.ts +22 -0
  10. package/dist/chat/tag-suggestions.js +71 -0
  11. package/dist/chat/ui/Composer.js +489 -447
  12. package/dist/chat/ui/ComposerInput.d.ts +1 -0
  13. package/dist/chat/ui/ComposerInput.js +9 -1
  14. package/dist/chat/ui/Markdown.js +41 -25
  15. package/dist/chat/ui/NamedChip.d.ts +5 -0
  16. package/dist/chat/ui/NamedChip.js +118 -0
  17. package/dist/chat/ui/Pickers.d.ts +0 -4
  18. package/dist/chat/ui/Pickers.js +1 -141
  19. package/dist/chat/ui/PromptEditor.js +2 -1
  20. package/dist/chat/ui/ReferenceChip.d.ts +3 -2
  21. package/dist/chat/ui/ReferenceChip.js +58 -36
  22. package/dist/chat/ui/RunSettings.d.ts +3 -2
  23. package/dist/chat/ui/RunSettings.js +386 -361
  24. package/dist/chat/ui/SubagentInfo.js +98 -114
  25. package/dist/chat/ui/SubagentTimeline.js +65 -43
  26. package/dist/chat/ui/Timeline.js +14 -8
  27. package/dist/chat/ui/chip-clipboard.js +10 -0
  28. package/dist/chat/ui/composer/ComposerControls.d.ts +6 -1
  29. package/dist/chat/ui/composer/ComposerControls.js +171 -158
  30. package/dist/chat/ui/composer/ComposerMenu.js +187 -55
  31. package/dist/chat/ui/composer/ComposerPlusMenu.d.ts +18 -0
  32. package/dist/chat/ui/composer/ComposerPlusMenu.js +400 -0
  33. package/dist/chat/ui/composer/ComposerStatusLine.d.ts +4 -0
  34. package/dist/chat/ui/composer/ComposerStatusLine.js +239 -0
  35. package/dist/chat/ui/composer/chips.d.ts +2 -0
  36. package/dist/chat/ui/composer/chips.js +66 -5
  37. package/dist/chat/ui/composer/insert.d.ts +1 -0
  38. package/dist/chat/ui/composer/insert.js +24 -0
  39. package/dist/chat/ui/composer/use-composer-menus.js +34 -17
  40. package/dist/chat/ui/composer/use-prompt-menus.d.ts +10 -2
  41. package/dist/chat/ui/composer/use-prompt-menus.js +290 -202
  42. package/dist/chat/ui/covered-bottom.d.ts +1 -0
  43. package/dist/chat/ui/covered-bottom.js +6 -0
  44. package/dist/chat/ui/named-chip-look.d.ts +14 -0
  45. package/dist/chat/ui/named-chip-look.js +72 -0
  46. package/dist/chat/ui/rehype-chips.js +13 -2
  47. package/dist/host-hooks.d.ts +2 -1
  48. package/dist/host-hooks.js +6 -0
  49. package/dist/host.d.ts +17 -0
  50. package/dist/index.d.ts +1 -1
  51. package/dist/locales/en/agent-chat.d.ts +14 -2
  52. package/dist/locales/en/agent-chat.js +16 -4
  53. package/dist/locales/nl/agent-chat.d.ts +14 -2
  54. package/dist/locales/nl/agent-chat.js +16 -4
  55. package/dist/state/chats.d.ts +1 -0
  56. package/dist/state/chats.js +45 -0
  57. package/package.json +9 -9
  58. package/src/agents/AgentModelLabel.tsx +10 -1
  59. package/src/chat/account-choice.ts +8 -0
  60. package/src/chat/mentions.ts +110 -13
  61. package/src/chat/subagent-list.ts +1 -14
  62. package/src/chat/tag-suggestions.ts +121 -0
  63. package/src/chat/ui/Composer.tsx +24 -12
  64. package/src/chat/ui/ComposerInput.tsx +13 -1
  65. package/src/chat/ui/Markdown.tsx +5 -0
  66. package/src/chat/ui/NamedChip.tsx +34 -0
  67. package/src/chat/ui/Pickers.tsx +1 -51
  68. package/src/chat/ui/PromptEditor.tsx +7 -1
  69. package/src/chat/ui/ReferenceChip.tsx +15 -4
  70. package/src/chat/ui/RunSettings.tsx +51 -29
  71. package/src/chat/ui/SubagentInfo.tsx +17 -17
  72. package/src/chat/ui/SubagentTimeline.tsx +7 -2
  73. package/src/chat/ui/Timeline.tsx +11 -5
  74. package/src/chat/ui/chip-clipboard.ts +8 -1
  75. package/src/chat/ui/composer/ComposerControls.tsx +24 -17
  76. package/src/chat/ui/composer/ComposerMenu.tsx +83 -15
  77. package/src/chat/ui/composer/ComposerPlusMenu.tsx +158 -0
  78. package/src/chat/ui/composer/ComposerStatusLine.tsx +94 -0
  79. package/src/chat/ui/composer/chips.ts +78 -7
  80. package/src/chat/ui/composer/insert.ts +12 -0
  81. package/src/chat/ui/composer/use-composer-menus.ts +5 -2
  82. package/src/chat/ui/composer/use-prompt-menus.ts +55 -10
  83. package/src/chat/ui/covered-bottom.ts +7 -0
  84. package/src/chat/ui/named-chip-look.ts +64 -0
  85. package/src/chat/ui/rehype-chips.ts +17 -2
  86. package/src/host-hooks.ts +11 -1
  87. package/src/host.ts +29 -0
  88. package/src/index.ts +2 -0
  89. package/src/locales/en/agent-chat.ts +16 -4
  90. package/src/locales/nl/agent-chat.ts +16 -4
  91. 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(96);
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 t3;
61
- let t4;
73
+ let t5;
74
+ let t6;
62
75
  if ($[0] !== cwd || $[1] !== mention || $[2] !== scope || $[3] !== searchFiles) {
63
- t3 = () => {
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(_temp);
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
- t4 = [scope, cwd, mention, searchFiles];
107
+ t6 = [scope, cwd, mention, searchFiles];
95
108
  $[0] = cwd;
96
109
  $[1] = mention;
97
110
  $[2] = scope;
98
111
  $[3] = searchFiles;
99
- $[4] = t3;
100
- $[5] = t4;
112
+ $[4] = t5;
113
+ $[5] = t6;
101
114
  } else {
102
- t3 = $[4];
103
- t4 = $[5];
115
+ t5 = $[4];
116
+ t6 = $[5];
104
117
  }
105
- useEffect(t3, t4);
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 t5;
121
+ let t7;
109
122
  if ($[6] !== setText || $[7] !== text) {
110
- t5 = command => {
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] = t5;
129
+ $[8] = t7;
117
130
  } else {
118
- t5 = $[8];
131
+ t7 = $[8];
119
132
  }
120
- const expandInto = t5;
121
- let t6;
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
- t6 = query => {
124
- const known = new Set(skills.map(_temp2));
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(_temp3);
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] = t6;
168
+ $[16] = t8;
156
169
  } else {
157
- t6 = $[16];
170
+ t8 = $[16];
158
171
  }
159
- const commandsOf = t6;
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
- const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null;
165
- const files_0 = mention === null ? [] : searched.files;
166
- const mentionCount = files_0.length;
167
- let t7;
168
- if ($[17] !== referables.chatsOnly) {
169
- t7 = item => !referables.chatsOnly || item.kind === "chat";
170
- $[17] = referables.chatsOnly;
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
- t7 = $[18];
185
+ t9 = $[20];
174
186
  }
175
- const offersReferences = referables.items.some(t7);
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 t8;
178
- if ($[19] !== referables.items) {
179
- t8 = token => {
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
- $[19] = referables.items;
188
- $[20] = t8;
231
+ $[31] = referables.items;
232
+ $[32] = t12;
189
233
  } else {
190
- t8 = $[20];
234
+ t12 = $[32];
191
235
  }
192
- const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t8);
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 t9;
208
- if ($[21] !== cwd || $[22] !== draft.mentions || $[23] !== draft.skills || $[24] !== referenceChips) {
209
- t9 = (value, selection, state) => {
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 || cwd === null ? null : queryOutsideChips(findMentionQuery(value, caret), chips);
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
- $[21] = cwd;
222
- $[22] = draft.mentions;
223
- $[23] = draft.skills;
224
- $[24] = referenceChips;
225
- $[25] = t9;
265
+ $[33] = draft.mentions;
266
+ $[34] = draft.skills;
267
+ $[35] = referenceChips;
268
+ $[36] = t13;
226
269
  } else {
227
- t9 = $[25];
270
+ t13 = $[36];
228
271
  }
229
- const trackTriggers = t9;
230
- let t10;
231
- if ($[26] !== inputRef) {
232
- t10 = caret_0 => {
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
- $[26] = inputRef;
236
- $[27] = t10;
278
+ $[37] = inputRef;
279
+ $[38] = t14;
237
280
  } else {
238
- t10 = $[27];
281
+ t14 = $[38];
239
282
  }
240
- const moveCaret = t10;
241
- let t11;
242
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
243
- t11 = () => {
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
- $[28] = t11;
291
+ $[39] = t15;
249
292
  } else {
250
- t11 = $[28];
293
+ t15 = $[39];
251
294
  }
252
- const close = t11;
253
- let t12;
254
- if ($[29] !== draft.mentions || $[30] !== mention || $[31] !== moveCaret || $[32] !== setText || $[33] !== text) {
255
- t12 = path => {
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
- $[29] = draft.mentions;
265
- $[30] = mention;
266
- $[31] = moveCaret;
267
- $[32] = setText;
268
- $[33] = text;
269
- $[34] = t12;
307
+ $[40] = draft.mentions;
308
+ $[41] = mention;
309
+ $[42] = moveCaret;
310
+ $[43] = setText;
311
+ $[44] = text;
312
+ $[45] = t16;
270
313
  } else {
271
- t12 = $[34];
314
+ t16 = $[45];
272
315
  }
273
- const chooseMention = t12;
274
- let t13;
275
- if ($[35] !== chooseMention || $[36] !== mention || $[37] !== searched) {
276
- t13 = index => {
277
- const path_0 = mention === null ? null : mentionPick(index, searched, mention.query);
278
- if (path_0 !== null) {
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
- $[35] = chooseMention;
283
- $[36] = mention;
284
- $[37] = searched;
285
- $[38] = t13;
328
+ $[46] = mention;
329
+ $[47] = moveCaret;
330
+ $[48] = setText;
331
+ $[49] = text;
332
+ $[50] = t17;
286
333
  } else {
287
- t13 = $[38];
334
+ t17 = $[50];
288
335
  }
289
- const chooseMentionAt = t13;
290
- let t14;
291
- if ($[39] !== moveCaret || $[40] !== referenceQuery || $[41] !== setDraft || $[42] !== setText || $[43] !== text) {
292
- t14 = item_1 => {
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 result_0 = insertReference(text, referenceQuery, item_1.name);
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(result_0.text.replace(`#${item_1.name}`, content)));
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: result_0.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(result_0.caret);
389
+ moveCaret(result_1.caret);
316
390
  };
317
- $[39] = moveCaret;
318
- $[40] = referenceQuery;
319
- $[41] = setDraft;
320
- $[42] = setText;
321
- $[43] = text;
322
- $[44] = t14;
391
+ $[58] = moveCaret;
392
+ $[59] = referenceQuery;
393
+ $[60] = setDraft;
394
+ $[61] = setText;
395
+ $[62] = text;
396
+ $[63] = t19;
323
397
  } else {
324
- t14 = $[44];
398
+ t19 = $[63];
325
399
  }
326
- const chooseReference = t14;
327
- let t15;
328
- if ($[45] !== chooseReference || $[46] !== referenceMatches) {
329
- t15 = index_0 => {
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
- $[45] = chooseReference;
336
- $[46] = referenceMatches;
337
- $[47] = t15;
409
+ $[64] = chooseReference;
410
+ $[65] = referenceMatches;
411
+ $[66] = t20;
338
412
  } else {
339
- t15 = $[47];
413
+ t20 = $[66];
340
414
  }
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 => {
345
- const result_1 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
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(result_1.text, draft.mentions, draft.skills.includes(name_2) ? draft.skills : [...draft.skills, name_2]);
423
+ setText(result_2.text, draft.mentions, draft.skills.includes(name_2) ? draft.skills : [...draft.skills, name_2]);
350
424
  setSkillQuery(null);
351
- moveCaret(result_1.caret);
425
+ moveCaret(result_2.caret);
352
426
  };
353
- $[48] = draft.mentions;
354
- $[49] = draft.skills;
355
- $[50] = moveCaret;
356
- $[51] = setText;
357
- $[52] = skillQuery;
358
- $[53] = text;
359
- $[54] = t16;
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
- t16 = $[54];
435
+ t21 = $[73];
362
436
  }
363
- const chooseSkill = t16;
364
- let t17;
365
- if ($[55] !== chooseSkill || $[56] !== expandInto || $[57] !== inputRef || $[58] !== setText) {
366
- t17 = (command_2, index_1) => {
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
- $[55] = chooseSkill;
380
- $[56] = expandInto;
381
- $[57] = inputRef;
382
- $[58] = setText;
383
- $[59] = t17;
453
+ $[74] = chooseSkill;
454
+ $[75] = expandInto;
455
+ $[76] = inputRef;
456
+ $[77] = setText;
457
+ $[78] = t22;
384
458
  } else {
385
- t17 = $[59];
459
+ t22 = $[78];
386
460
  }
387
- const pickCommand = t17;
388
- let t18;
389
- if ($[60] !== chooseSkill || $[61] !== expandInto || $[62] !== setText) {
390
- t18 = command_3 => {
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
- $[60] = chooseSkill;
402
- $[61] = expandInto;
403
- $[62] = setText;
404
- $[63] = t18;
475
+ $[79] = chooseSkill;
476
+ $[80] = expandInto;
477
+ $[81] = setText;
478
+ $[82] = t23;
405
479
  } else {
406
- t18 = $[63];
480
+ t23 = $[82];
407
481
  }
408
- const completeCommand = t18;
409
- let t19;
410
- if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
411
- t19 = (key, count) => {
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
- $[64] = t19;
496
+ $[83] = t24;
423
497
  } else {
424
- t19 = $[64];
498
+ t24 = $[83];
425
499
  }
426
- const moveInMenu = t19;
427
- const t20 = skills.length > 0;
428
- const t21 = offersReferences && !referables.chatsOnly;
429
- let t22;
430
- if ($[65] !== skills) {
431
- t22 = skills.map(_temp4);
432
- $[65] = skills;
433
- $[66] = t22;
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
- t22 = $[66];
509
+ t27 = $[85];
436
510
  }
437
- let t23;
438
- 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] !== t22 || $[94] !== trackTriggers) {
439
- t23 = {
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: t20,
445
- offersViews: t21,
446
- skillNames: t22,
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
- $[67] = activeIndex;
473
- $[68] = chooseMention;
474
- $[69] = chooseMentionAt;
475
- $[70] = chooseReference;
476
- $[71] = chooseReferenceAt;
477
- $[72] = chooseSkill;
478
- $[73] = commandMenuOpen;
479
- $[74] = commandQuery;
480
- $[75] = commands;
481
- $[76] = completeCommand;
482
- $[77] = files_0;
483
- $[78] = inputAria;
484
- $[79] = listId;
485
- $[80] = mention;
486
- $[81] = mentionCount;
487
- $[82] = mentionMenuOpen;
488
- $[83] = menuOpen;
489
- $[84] = pickCommand;
490
- $[85] = referables;
491
- $[86] = referenceChips;
492
- $[87] = referenceMatches;
493
- $[88] = referenceMenuOpen;
494
- $[89] = skillMatches;
495
- $[90] = skillMenuOpen;
496
- $[91] = t20;
497
- $[92] = t21;
498
- $[93] = t22;
499
- $[94] = trackTriggers;
500
- $[95] = t23;
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
- t23 = $[95];
584
+ t28 = $[118];
503
585
  }
504
- return t23;
586
+ return t28;
505
587
  }
506
- function _temp4(skill_2) {
588
+ function _temp6(skill_2) {
507
589
  return skill_2.name;
508
590
  }
509
- function _temp3(command_0) {
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 _temp2(skill) {
600
+ function _temp4(skill) {
519
601
  return skill.name;
520
602
  }
521
- function _temp() {}
603
+ function _temp3() {}
604
+ function _temp2(row_0) {
605
+ return row_0.accounts;
606
+ }
607
+ function _temp(row) {
608
+ return row.providers;
609
+ }