@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.
@@ -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(97);
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
- let commandQuery;
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] !== goals || $[7] !== localCommands || $[8] !== providerName || $[9] !== skills || $[10] !== slashCommands || $[11] !== t || $[12] !== text) {
108
- commandQuery = text.startsWith("/") && !text.includes("\n") ? text.slice(1).trim().toLowerCase() : null;
109
- let t6;
110
- if ($[15] !== goals || $[16] !== localCommands || $[17] !== providerName || $[18] !== skills || $[19] !== slashCommands || $[20] !== t) {
111
- t6 = query => {
112
- const known = new Set(skills.map(_temp2));
113
- const own = localCommands.map(name => ({
114
- name,
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
- commandQuery = $[13];
158
- t5 = $[14];
118
+ t5 = $[8];
159
119
  }
160
- const commands = t5;
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 t6;
168
- if ($[22] !== referables.chatsOnly) {
169
- t6 = item => !referables.chatsOnly || item.kind === "chat";
170
- $[22] = referables.chatsOnly;
171
- $[23] = t6;
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
- t6 = $[23];
173
+ t7 = $[18];
174
174
  }
175
- const offersReferences = referables.items.some(t6);
175
+ const offersReferences = referables.items.some(t7);
176
176
  const referenceMenuOpen = !commandMenuOpen && !skillMenuOpen && !mentionMenuOpen && referenceQuery !== null && offersReferences;
177
- let t7;
178
- if ($[24] !== referables.items) {
179
- t7 = token => {
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
- $[24] = referables.items;
188
- $[25] = t7;
187
+ $[19] = referables.items;
188
+ $[20] = t8;
189
189
  } else {
190
- t7 = $[25];
190
+ t8 = $[20];
191
191
  }
192
- const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t7);
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 t8;
208
- if ($[26] !== cwd || $[27] !== draft.mentions || $[28] !== draft.skills || $[29] !== referenceChips) {
209
- t8 = (value, selection, state) => {
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
- $[26] = cwd;
222
- $[27] = draft.mentions;
223
- $[28] = draft.skills;
224
- $[29] = referenceChips;
225
- $[30] = t8;
221
+ $[21] = cwd;
222
+ $[22] = draft.mentions;
223
+ $[23] = draft.skills;
224
+ $[24] = referenceChips;
225
+ $[25] = t9;
226
226
  } else {
227
- t8 = $[30];
227
+ t9 = $[25];
228
228
  }
229
- const trackTriggers = t8;
230
- let t9;
231
- if ($[31] !== inputRef) {
232
- t9 = caret_0 => {
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
- $[31] = inputRef;
236
- $[32] = t9;
235
+ $[26] = inputRef;
236
+ $[27] = t10;
237
237
  } else {
238
- t9 = $[32];
238
+ t10 = $[27];
239
239
  }
240
- const moveCaret = t9;
241
- let t10;
242
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
243
- t10 = () => {
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
- $[33] = t10;
248
+ $[28] = t11;
249
249
  } else {
250
- t10 = $[33];
250
+ t11 = $[28];
251
251
  }
252
- const close = t10;
253
- let t11;
254
- if ($[34] !== draft.mentions || $[35] !== mention || $[36] !== moveCaret || $[37] !== setText || $[38] !== text) {
255
- t11 = path => {
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
- $[34] = draft.mentions;
265
- $[35] = mention;
266
- $[36] = moveCaret;
267
- $[37] = setText;
268
- $[38] = text;
269
- $[39] = t11;
264
+ $[29] = draft.mentions;
265
+ $[30] = mention;
266
+ $[31] = moveCaret;
267
+ $[32] = setText;
268
+ $[33] = text;
269
+ $[34] = t12;
270
270
  } else {
271
- t11 = $[39];
271
+ t12 = $[34];
272
272
  }
273
- const chooseMention = t11;
274
- let t12;
275
- if ($[40] !== chooseMention || $[41] !== mention || $[42] !== searched) {
276
- t12 = index => {
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
- $[40] = chooseMention;
283
- $[41] = mention;
284
- $[42] = searched;
285
- $[43] = t12;
282
+ $[35] = chooseMention;
283
+ $[36] = mention;
284
+ $[37] = searched;
285
+ $[38] = t13;
286
286
  } else {
287
- t12 = $[43];
287
+ t13 = $[38];
288
288
  }
289
- const chooseMentionAt = t12;
290
- let t13;
291
- if ($[44] !== moveCaret || $[45] !== referenceQuery || $[46] !== setDraft || $[47] !== text) {
292
- t13 = item_1 => {
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
- $[44] = moveCaret;
313
- $[45] = referenceQuery;
314
- $[46] = setDraft;
315
- $[47] = text;
316
- $[48] = t13;
317
+ $[39] = moveCaret;
318
+ $[40] = referenceQuery;
319
+ $[41] = setDraft;
320
+ $[42] = setText;
321
+ $[43] = text;
322
+ $[44] = t14;
317
323
  } else {
318
- t13 = $[48];
324
+ t14 = $[44];
319
325
  }
320
- const chooseReference = t13;
321
- let t14;
322
- if ($[49] !== chooseReference || $[50] !== referenceMatches) {
323
- t14 = index_0 => {
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
- $[49] = chooseReference;
330
- $[50] = referenceMatches;
331
- $[51] = t14;
335
+ $[45] = chooseReference;
336
+ $[46] = referenceMatches;
337
+ $[47] = t15;
332
338
  } else {
333
- t14 = $[51];
339
+ t15 = $[47];
334
340
  }
335
- const chooseReferenceAt = t14;
336
- let t15;
337
- if ($[52] !== draft.mentions || $[53] !== draft.skills || $[54] !== moveCaret || $[55] !== setText || $[56] !== skillQuery || $[57] !== text) {
338
- t15 = name_2 => {
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
- $[52] = draft.mentions;
348
- $[53] = draft.skills;
349
- $[54] = moveCaret;
350
- $[55] = setText;
351
- $[56] = skillQuery;
352
- $[57] = text;
353
- $[58] = t15;
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
- t15 = $[58];
361
+ t16 = $[54];
356
362
  }
357
- const chooseSkill = t15;
358
- let t16;
359
- if ($[59] !== chooseSkill || $[60] !== inputRef || $[61] !== setText) {
360
- t16 = (command_0, index_1) => {
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 (command_0.skill) {
363
- chooseSkill(command_0.name);
368
+ if (command_2.expand !== undefined) {
369
+ expandInto(command_2);
364
370
  return;
365
371
  }
366
- setText(`/${command_0.name}`);
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
- $[59] = chooseSkill;
370
- $[60] = inputRef;
371
- $[61] = setText;
372
- $[62] = t16;
379
+ $[55] = chooseSkill;
380
+ $[56] = expandInto;
381
+ $[57] = inputRef;
382
+ $[58] = setText;
383
+ $[59] = t17;
373
384
  } else {
374
- t16 = $[62];
385
+ t17 = $[59];
375
386
  }
376
- const pickCommand = t16;
377
- let t17;
378
- if ($[63] !== chooseSkill || $[64] !== setText) {
379
- t17 = command_1 => {
380
- if (command_1.skill) {
381
- chooseSkill(command_1.name);
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(`/${command_1.name} `);
399
+ setText(`/${command_3.name} `);
385
400
  };
386
- $[63] = chooseSkill;
387
- $[64] = setText;
388
- $[65] = t17;
401
+ $[60] = chooseSkill;
402
+ $[61] = expandInto;
403
+ $[62] = setText;
404
+ $[63] = t18;
389
405
  } else {
390
- t17 = $[65];
406
+ t18 = $[63];
391
407
  }
392
- const completeCommand = t17;
393
- let t18;
394
- if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
395
- t18 = (key, count) => {
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
- $[66] = t18;
422
+ $[64] = t19;
407
423
  } else {
408
- t18 = $[66];
424
+ t19 = $[64];
409
425
  }
410
- const moveInMenu = t18;
411
- const t19 = skills.length > 0;
412
- let t20;
413
- if ($[67] !== skills) {
414
- t20 = skills.map(_temp3);
415
- $[67] = skills;
416
- $[68] = t20;
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
- t20 = $[68];
434
+ t21 = $[66];
419
435
  }
420
- let t21;
421
- if ($[69] !== activeIndex || $[70] !== chooseMention || $[71] !== chooseMentionAt || $[72] !== chooseReference || $[73] !== chooseReferenceAt || $[74] !== chooseSkill || $[75] !== commandMenuOpen || $[76] !== commandQuery || $[77] !== commands || $[78] !== completeCommand || $[79] !== files_0 || $[80] !== inputAria || $[81] !== listId || $[82] !== mention || $[83] !== mentionCount || $[84] !== mentionMenuOpen || $[85] !== menuOpen || $[86] !== pickCommand || $[87] !== referables || $[88] !== referenceChips || $[89] !== referenceMatches || $[90] !== referenceMenuOpen || $[91] !== skillMatches || $[92] !== skillMenuOpen || $[93] !== t19 || $[94] !== t20 || $[95] !== trackTriggers) {
422
- t21 = {
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: t19,
428
- skillNames: t20,
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
- $[69] = activeIndex;
455
- $[70] = chooseMention;
456
- $[71] = chooseMentionAt;
457
- $[72] = chooseReference;
458
- $[73] = chooseReferenceAt;
459
- $[74] = chooseSkill;
460
- $[75] = commandMenuOpen;
461
- $[76] = commandQuery;
462
- $[77] = commands;
463
- $[78] = completeCommand;
464
- $[79] = files_0;
465
- $[80] = inputAria;
466
- $[81] = listId;
467
- $[82] = mention;
468
- $[83] = mentionCount;
469
- $[84] = mentionMenuOpen;
470
- $[85] = menuOpen;
471
- $[86] = pickCommand;
472
- $[87] = referables;
473
- $[88] = referenceChips;
474
- $[89] = referenceMatches;
475
- $[90] = referenceMenuOpen;
476
- $[91] = skillMatches;
477
- $[92] = skillMenuOpen;
478
- $[93] = t19;
479
- $[94] = t20;
480
- $[95] = trackTriggers;
481
- $[96] = t21;
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
- t21 = $[96];
499
+ t22 = $[94];
484
500
  }
485
- return t21;
501
+ return t22;
486
502
  }
487
- function _temp3(skill_2) {
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,
@@ -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']>;
@@ -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) {