@adecore/agents-react 0.67.1 → 0.69.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 (77) hide show
  1. package/dist/agents/AgentIcon.d.ts +7 -0
  2. package/dist/agents/AgentIcon.js +70 -31
  3. package/dist/chat/logic/timeline.d.ts +2 -0
  4. package/dist/chat/logic/timeline.js +47 -0
  5. package/dist/chat/subagent-list.d.ts +1 -2
  6. package/dist/chat/ui/Composer.js +491 -447
  7. package/dist/chat/ui/Markdown.d.ts +1 -1
  8. package/dist/chat/ui/Markdown.js +277 -203
  9. package/dist/chat/ui/PromptEditor.d.ts +3 -1
  10. package/dist/chat/ui/PromptEditor.js +4 -1
  11. package/dist/chat/ui/Timeline.js +5 -4
  12. package/dist/chat/ui/composer/ComposerMenu.js +22 -12
  13. package/dist/chat/ui/composer/chips.d.ts +2 -1
  14. package/dist/chat/ui/composer/chips.js +44 -1
  15. package/dist/chat/ui/composer/key-handler.d.ts +2 -0
  16. package/dist/chat/ui/composer/key-handler.js +12 -2
  17. package/dist/chat/ui/composer/placeholder.d.ts +2 -1
  18. package/dist/chat/ui/composer/placeholder.js +31 -10
  19. package/dist/chat/ui/composer/use-composer-menus.js +49 -39
  20. package/dist/chat/ui/composer/use-prompt-menus.d.ts +10 -7
  21. package/dist/chat/ui/composer/use-prompt-menus.js +183 -157
  22. package/dist/chat/ui/composer/use-prompt-suggestion.d.ts +16 -0
  23. package/dist/chat/ui/composer/use-prompt-suggestion.js +55 -0
  24. package/dist/chat/ui/index.d.ts +1 -1
  25. package/dist/chat/ui/index.js +1 -1
  26. package/dist/chat/ui/markdown-cache.d.ts +4 -0
  27. package/dist/chat/ui/markdown-cache.js +47 -0
  28. package/dist/chat/ui/reference-lookup.d.ts +2 -1
  29. package/dist/chat/ui/reference-lookup.js +1 -1
  30. package/dist/chat/ui/rows/SubagentRow.js +26 -24
  31. package/dist/chat/ui/rows/TaskRow.d.ts +11 -1
  32. package/dist/chat/ui/rows/TaskRow.js +281 -197
  33. package/dist/chat/ui/thread-references.js +12 -9
  34. package/dist/chat-client.d.ts +3 -1
  35. package/dist/chat-client.js +82 -30
  36. package/dist/chat-sink.d.ts +1 -0
  37. package/dist/host/host-hooks.d.ts +4 -1
  38. package/dist/host/host-hooks.js +11 -0
  39. package/dist/host/host.d.ts +18 -0
  40. package/dist/index.d.ts +1 -1
  41. package/dist/locales/en/agent-chat.d.ts +1 -0
  42. package/dist/locales/en/agent-chat.js +2 -1
  43. package/dist/locales/nl/agent-chat.d.ts +1 -0
  44. package/dist/locales/nl/agent-chat.js +2 -1
  45. package/dist/state/chats.d.ts +2 -0
  46. package/dist/state/chats.js +21 -5
  47. package/dist/theme.css +6 -0
  48. package/package.json +9 -9
  49. package/src/agents/AgentIcon.tsx +6 -2
  50. package/src/chat/logic/timeline.ts +63 -0
  51. package/src/chat/subagent-list.ts +1 -4
  52. package/src/chat/ui/Composer.tsx +15 -2
  53. package/src/chat/ui/Markdown.tsx +97 -55
  54. package/src/chat/ui/PromptEditor.tsx +7 -2
  55. package/src/chat/ui/Timeline.tsx +17 -14
  56. package/src/chat/ui/composer/ComposerMenu.tsx +14 -6
  57. package/src/chat/ui/composer/chips.ts +51 -2
  58. package/src/chat/ui/composer/key-handler.ts +17 -2
  59. package/src/chat/ui/composer/placeholder.ts +14 -3
  60. package/src/chat/ui/composer/use-composer-menus.ts +8 -3
  61. package/src/chat/ui/composer/use-prompt-menus.ts +33 -4
  62. package/src/chat/ui/composer/use-prompt-suggestion.ts +36 -0
  63. package/src/chat/ui/index.ts +1 -1
  64. package/src/chat/ui/markdown-cache.ts +60 -0
  65. package/src/chat/ui/reference-lookup.ts +4 -2
  66. package/src/chat/ui/rows/SubagentRow.tsx +1 -1
  67. package/src/chat/ui/rows/TaskRow.tsx +54 -9
  68. package/src/chat/ui/thread-references.ts +4 -2
  69. package/src/chat-client.ts +79 -22
  70. package/src/chat-sink.ts +6 -1
  71. package/src/host/host-hooks.ts +19 -1
  72. package/src/host/host.ts +41 -0
  73. package/src/index.ts +3 -0
  74. package/src/locales/en/agent-chat.ts +2 -1
  75. package/src/locales/nl/agent-chat.ts +2 -1
  76. package/src/state/chats.ts +22 -6
  77. package/src/theme.css +6 -0
@@ -21,6 +21,24 @@ const SEARCH_DEBOUNCE_MS = 80;
21
21
  const MENTION_RESULTS = 8;
22
22
  const REFERENCE_RESULTS = 20;
23
23
  const NO_COMMANDS = [];
24
+ const NO_HOST_SKILLS = [];
25
+ const SKILL_RESULTS = 8;
26
+ /* The host's skills first, found by title or name, then the CLI's; a CLI skill under a host skill's name is the host's. */
27
+ function skillMatchesOf(query, skills, hostSkills) {
28
+ const wanted = query.toLowerCase();
29
+ const own = new Set(hostSkills.map(skill => skill.name));
30
+ const hosted = hostSkills.filter(skill => skill.title.toLowerCase().includes(wanted) || skill.name.toLowerCase().includes(wanted)).map(skill => ({
31
+ name: skill.name,
32
+ description: skill.description,
33
+ host: skill
34
+ }));
35
+ const cli = skills.filter(skill => !own.has(skill.name) && skill.name.toLowerCase().includes(wanted)).map(skill => ({
36
+ name: skill.name,
37
+ description: skill.description,
38
+ host: null
39
+ }));
40
+ return [...hosted, ...cli].slice(0, SKILL_RESULTS);
41
+ }
24
42
  function sameQuery(left, right) {
25
43
  return left?.start === right?.start && left?.query === right?.query;
26
44
  }
@@ -30,30 +48,32 @@ function sameQuery(left, right) {
30
48
  * follow that one.
31
49
  */
32
50
  export function usePromptMenus(t0) {
33
- const $ = _c(119);
51
+ const $ = _c(121);
34
52
  const {
35
53
  draft: t1,
36
54
  inputRef,
37
55
  cwd,
38
56
  skills,
57
+ hostSkills: t2,
39
58
  slashCommands,
40
- localCommands: t2,
59
+ localCommands: t3,
41
60
  goals,
42
61
  providerName,
43
62
  referables,
44
63
  ownId,
45
64
  label,
46
- accountRule: t3,
47
- home: t4
65
+ accountRule: t4,
66
+ home: t5
48
67
  } = t0;
49
68
  const {
50
69
  draft,
51
70
  setDraft,
52
71
  setText
53
72
  } = t1;
54
- const localCommands = t2 === undefined ? NO_COMMANDS : t2;
55
- const accountRule = t3 === undefined ? null : t3;
56
- const home = t4 === undefined ? null : t4;
73
+ const hostSkills = t2 === undefined ? NO_HOST_SKILLS : t2;
74
+ const localCommands = t3 === undefined ? NO_COMMANDS : t3;
75
+ const accountRule = t4 === undefined ? null : t4;
76
+ const home = t5 === undefined ? null : t5;
57
77
  const {
58
78
  t
59
79
  } = useTranslation("agent-chat");
@@ -71,10 +91,10 @@ export function usePromptMenus(t0) {
71
91
  const reportedOf = useReportedModelsByProvider();
72
92
  const namedLook = useNamedChipLookup(home);
73
93
  const text = draft.text;
74
- let t5;
75
94
  let t6;
95
+ let t7;
76
96
  if ($[0] !== cwd || $[1] !== mention || $[2] !== scope || $[3] !== searchFiles) {
77
- t5 = () => {
97
+ t6 = () => {
78
98
  if (mention === null || cwd === null) {
79
99
  return;
80
100
  }
@@ -105,36 +125,36 @@ export function usePromptMenus(t0) {
105
125
  clearTimeout(timer);
106
126
  };
107
127
  };
108
- t6 = [scope, cwd, mention, searchFiles];
128
+ t7 = [scope, cwd, mention, searchFiles];
109
129
  $[0] = cwd;
110
130
  $[1] = mention;
111
131
  $[2] = scope;
112
132
  $[3] = searchFiles;
113
- $[4] = t5;
114
- $[5] = t6;
133
+ $[4] = t6;
134
+ $[5] = t7;
115
135
  } else {
116
- t5 = $[4];
117
- t6 = $[5];
136
+ t6 = $[4];
137
+ t7 = $[5];
118
138
  }
119
- useEffect(t5, t6);
139
+ useEffect(t6, t7);
120
140
  const commandQuery = text.startsWith("/") && !text.includes("\n") ? text.slice(1).trim().toLowerCase() : null;
121
141
  const expanding = useHostExpandingCommands();
122
- let t7;
142
+ let t8;
123
143
  if ($[6] !== setText || $[7] !== text) {
124
- t7 = command => {
144
+ t8 = command => {
125
145
  const args = text.replace(/^\/\S*\s*/, "");
126
146
  command.expand?.(args).then(expanded => setText(expanded));
127
147
  };
128
148
  $[6] = setText;
129
149
  $[7] = text;
130
- $[8] = t7;
150
+ $[8] = t8;
131
151
  } else {
132
- t7 = $[8];
152
+ t8 = $[8];
133
153
  }
134
- const expandInto = t7;
135
- let t8;
154
+ const expandInto = t8;
155
+ let t9;
136
156
  if ($[9] !== expanding || $[10] !== goals || $[11] !== localCommands || $[12] !== providerName || $[13] !== skills || $[14] !== slashCommands || $[15] !== t) {
137
- t8 = query => {
157
+ t9 = query => {
138
158
  const known = new Set(skills.map(_temp4));
139
159
  const own = localCommands.map(name => ({
140
160
  name,
@@ -166,33 +186,33 @@ export function usePromptMenus(t0) {
166
186
  $[13] = skills;
167
187
  $[14] = slashCommands;
168
188
  $[15] = t;
169
- $[16] = t8;
189
+ $[16] = t9;
170
190
  } else {
171
- t8 = $[16];
191
+ t9 = $[16];
172
192
  }
173
- const commandsOf = t8;
193
+ const commandsOf = t9;
174
194
  const commands = commandQuery === null ? [] : commandsOf(commandQuery);
175
- const skillMatches = skillQuery === null ? [] : skills.filter(skill_0 => skill_0.name.toLowerCase().includes(skillQuery.query.toLowerCase())).slice(0, 8);
195
+ const skillMatches = skillQuery === null ? [] : skillMatchesOf(skillQuery.query, skills, hostSkills);
176
196
  const commandMenuOpen = commandQuery !== null && commands.length > 0;
177
197
  const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
178
- let t9;
198
+ let t10;
179
199
  if ($[17] !== cwd || $[18] !== mention || $[19] !== searched) {
180
- t9 = mention === null || cwd === null ? [] : searched.files;
200
+ t10 = mention === null || cwd === null ? [] : searched.files;
181
201
  $[17] = cwd;
182
202
  $[18] = mention;
183
203
  $[19] = searched;
184
- $[20] = t9;
204
+ $[20] = t10;
185
205
  } else {
186
- t9 = $[20];
206
+ t10 = $[20];
187
207
  }
188
- const files_0 = t9;
208
+ const files_0 = t10;
189
209
  let accountMatches;
190
210
  let modelMatches;
191
- let t10;
211
+ let t11;
192
212
  if ($[21] !== accountRule || $[22] !== accounts || $[23] !== mention || $[24] !== providers || $[25] !== reportedOf) {
193
213
  modelMatches = mention === null ? [] : modelSuggestions(providers, accounts, mention.query, reportedOf);
194
214
  accountMatches = mention === null ? [] : accountSuggestions(providers, accounts, accountRule, mention.query);
195
- t10 = [...modelMatches, ...accountMatches];
215
+ t11 = [...modelMatches, ...accountMatches];
196
216
  $[21] = accountRule;
197
217
  $[22] = accounts;
198
218
  $[23] = mention;
@@ -200,28 +220,28 @@ export function usePromptMenus(t0) {
200
220
  $[25] = reportedOf;
201
221
  $[26] = accountMatches;
202
222
  $[27] = modelMatches;
203
- $[28] = t10;
223
+ $[28] = t11;
204
224
  } else {
205
225
  accountMatches = $[26];
206
226
  modelMatches = $[27];
207
- t10 = $[28];
227
+ t11 = $[28];
208
228
  }
209
- const named = t10;
229
+ const named = t11;
210
230
  const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null && (cwd !== null || named.length > 0);
211
231
  const mentionCount = files_0.length + named.length;
212
- let t11;
232
+ let t12;
213
233
  if ($[29] !== referables.chatsOnly) {
214
- t11 = item => !referables.chatsOnly || item.kind === "chat";
234
+ t12 = item => !referables.chatsOnly || item.kind === "chat";
215
235
  $[29] = referables.chatsOnly;
216
- $[30] = t11;
236
+ $[30] = t12;
217
237
  } else {
218
- t11 = $[30];
238
+ t12 = $[30];
219
239
  }
220
- const offersReferences = referables.items.some(t11);
240
+ const offersReferences = referables.items.some(t12);
221
241
  const referenceMenuOpen = !commandMenuOpen && !skillMenuOpen && !mentionMenuOpen && referenceQuery !== null && offersReferences;
222
- let t12;
242
+ let t13;
223
243
  if ($[31] !== referables.items) {
224
- t12 = token => {
244
+ t13 = token => {
225
245
  const item_0 = referables.items.find(candidate => candidate.id === token.id);
226
246
  return {
227
247
  ...token,
@@ -230,11 +250,11 @@ export function usePromptMenus(t0) {
230
250
  };
231
251
  };
232
252
  $[31] = referables.items;
233
- $[32] = t12;
253
+ $[32] = t13;
234
254
  } else {
235
- t12 = $[32];
255
+ t13 = $[32];
236
256
  }
237
- const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t12);
257
+ const referenceChips = referenceTokens([...draft.chats, ...draft.references], referables.items, draft.referenceNames).map(t13);
238
258
  const picked = presentReferences(text, [...draft.chats, ...draft.references], referenceChips);
239
259
  const excluded = ownId === undefined ? picked : [ownId, ...picked];
240
260
  const referenceMatches = referenceMenuOpen ? referenceSuggestions(referables, referenceQuery.query, excluded, REFERENCE_RESULTS) : [];
@@ -249,15 +269,15 @@ export function usePromptMenus(t0) {
249
269
  activeIndex,
250
270
  count: menuCount
251
271
  });
252
- let t13;
272
+ let t14;
253
273
  if ($[33] !== draft.mentions || $[34] !== draft.skills || $[35] !== referenceChips) {
254
- t13 = (value, selection, state) => {
274
+ t14 = (value, selection, state) => {
255
275
  const empty = selection.from === selection.to;
256
276
  const tree = empty ? ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state) : null;
257
277
  const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
258
278
  const chips = caret === null ? [] : withNamedChips(value, chipRanges(value, draft.mentions, draft.skills, [], referenceChips));
259
- const skill_1 = caret === null ? null : queryOutsideChips(findSkillQuery(value, caret), chips);
260
- setSkillQuery(current => sameQuery(current, skill_1) ? current : skill_1);
279
+ const skill_0 = caret === null ? null : queryOutsideChips(findSkillQuery(value, caret), chips);
280
+ setSkillQuery(current => sameQuery(current, skill_0) ? current : skill_0);
261
281
  const next = caret === null ? null : queryOutsideChips(findMentionQuery(value, caret), chips);
262
282
  setMention(current_0 => sameQuery(current_0, next) ? current_0 : next);
263
283
  const reference = caret === null ? null : queryOutsideChips(findReferenceQuery(value, caret), chips);
@@ -266,37 +286,37 @@ export function usePromptMenus(t0) {
266
286
  $[33] = draft.mentions;
267
287
  $[34] = draft.skills;
268
288
  $[35] = referenceChips;
269
- $[36] = t13;
289
+ $[36] = t14;
270
290
  } else {
271
- t13 = $[36];
291
+ t14 = $[36];
272
292
  }
273
- const trackTriggers = t13;
274
- let t14;
293
+ const trackTriggers = t14;
294
+ let t15;
275
295
  if ($[37] !== inputRef) {
276
- t14 = caret_0 => {
296
+ t15 = caret_0 => {
277
297
  requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
278
298
  };
279
299
  $[37] = inputRef;
280
- $[38] = t14;
300
+ $[38] = t15;
281
301
  } else {
282
- t14 = $[38];
302
+ t15 = $[38];
283
303
  }
284
- const moveCaret = t14;
285
- let t15;
304
+ const moveCaret = t15;
305
+ let t16;
286
306
  if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
287
- t15 = () => {
307
+ t16 = () => {
288
308
  setMention(null);
289
309
  setSkillQuery(null);
290
310
  setReferenceQuery(null);
291
311
  };
292
- $[39] = t15;
312
+ $[39] = t16;
293
313
  } else {
294
- t15 = $[39];
314
+ t16 = $[39];
295
315
  }
296
- const close = t15;
297
- let t16;
316
+ const close = t16;
317
+ let t17;
298
318
  if ($[40] !== draft.mentions || $[41] !== mention || $[42] !== moveCaret || $[43] !== setText || $[44] !== text) {
299
- t16 = path => {
319
+ t17 = path => {
300
320
  if (!mention) {
301
321
  return;
302
322
  }
@@ -310,14 +330,14 @@ export function usePromptMenus(t0) {
310
330
  $[42] = moveCaret;
311
331
  $[43] = setText;
312
332
  $[44] = text;
313
- $[45] = t16;
333
+ $[45] = t17;
314
334
  } else {
315
- t16 = $[45];
335
+ t17 = $[45];
316
336
  }
317
- const chooseMention = t16;
318
- let t17;
337
+ const chooseMention = t17;
338
+ let t18;
319
339
  if ($[46] !== mention || $[47] !== moveCaret || $[48] !== setText || $[49] !== text) {
320
- t17 = pick => {
340
+ t18 = pick => {
321
341
  if (!mention) {
322
342
  return;
323
343
  }
@@ -330,14 +350,14 @@ export function usePromptMenus(t0) {
330
350
  $[47] = moveCaret;
331
351
  $[48] = setText;
332
352
  $[49] = text;
333
- $[50] = t17;
353
+ $[50] = t18;
334
354
  } else {
335
- t17 = $[50];
355
+ t18 = $[50];
336
356
  }
337
- const chooseNamed = t17;
338
- let t18;
357
+ const chooseNamed = t18;
358
+ let t19;
339
359
  if ($[51] !== chooseMention || $[52] !== chooseNamed || $[53] !== files_0 || $[54] !== mention || $[55] !== named || $[56] !== searched) {
340
- t18 = index => {
360
+ t19 = index => {
341
361
  const pick_0 = mention === null ? null : mentionPick(index, {
342
362
  query: searched.query,
343
363
  files: files_0
@@ -357,14 +377,14 @@ export function usePromptMenus(t0) {
357
377
  $[54] = mention;
358
378
  $[55] = named;
359
379
  $[56] = searched;
360
- $[57] = t18;
380
+ $[57] = t19;
361
381
  } else {
362
- t18 = $[57];
382
+ t19 = $[57];
363
383
  }
364
- const chooseMentionAt = t18;
365
- let t19;
384
+ const chooseMentionAt = t19;
385
+ let t20;
366
386
  if ($[58] !== moveCaret || $[59] !== referenceQuery || $[60] !== setDraft || $[61] !== setText || $[62] !== text) {
367
- t19 = item_1 => {
387
+ t20 = item_1 => {
368
388
  if (!referenceQuery) {
369
389
  return;
370
390
  }
@@ -394,14 +414,14 @@ export function usePromptMenus(t0) {
394
414
  $[60] = setDraft;
395
415
  $[61] = setText;
396
416
  $[62] = text;
397
- $[63] = t19;
417
+ $[63] = t20;
398
418
  } else {
399
- t19 = $[63];
419
+ t20 = $[63];
400
420
  }
401
- const chooseReference = t19;
402
- let t20;
421
+ const chooseReference = t20;
422
+ let t21;
403
423
  if ($[64] !== chooseReference || $[65] !== referenceMatches) {
404
- t20 = index_0 => {
424
+ t21 = index_0 => {
405
425
  const item_2 = referenceMatches[index_0] ?? referenceMatches[0];
406
426
  if (item_2 !== undefined) {
407
427
  chooseReference(item_2);
@@ -409,14 +429,14 @@ export function usePromptMenus(t0) {
409
429
  };
410
430
  $[64] = chooseReference;
411
431
  $[65] = referenceMatches;
412
- $[66] = t20;
432
+ $[66] = t21;
413
433
  } else {
414
- t20 = $[66];
434
+ t21 = $[66];
415
435
  }
416
- const chooseReferenceAt = t20;
417
- let t21;
436
+ const chooseReferenceAt = t21;
437
+ let t22;
418
438
  if ($[67] !== draft.mentions || $[68] !== draft.skills || $[69] !== moveCaret || $[70] !== setText || $[71] !== skillQuery || $[72] !== text) {
419
- t21 = name_2 => {
439
+ t22 = name_2 => {
420
440
  const result_2 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
421
441
  text: `$${name_2} `,
422
442
  caret: name_2.length + 2
@@ -431,14 +451,14 @@ export function usePromptMenus(t0) {
431
451
  $[70] = setText;
432
452
  $[71] = skillQuery;
433
453
  $[72] = text;
434
- $[73] = t21;
454
+ $[73] = t22;
435
455
  } else {
436
- t21 = $[73];
456
+ t22 = $[73];
437
457
  }
438
- const chooseSkill = t21;
439
- let t22;
458
+ const chooseSkill = t22;
459
+ let t23;
440
460
  if ($[74] !== chooseSkill || $[75] !== expandInto || $[76] !== inputRef || $[77] !== setText) {
441
- t22 = (command_2, index_1) => {
461
+ t23 = (command_2, index_1) => {
442
462
  setMenuIndex(index_1);
443
463
  if (command_2.expand !== undefined) {
444
464
  expandInto(command_2);
@@ -455,14 +475,14 @@ export function usePromptMenus(t0) {
455
475
  $[75] = expandInto;
456
476
  $[76] = inputRef;
457
477
  $[77] = setText;
458
- $[78] = t22;
478
+ $[78] = t23;
459
479
  } else {
460
- t22 = $[78];
480
+ t23 = $[78];
461
481
  }
462
- const pickCommand = t22;
463
- let t23;
482
+ const pickCommand = t23;
483
+ let t24;
464
484
  if ($[79] !== chooseSkill || $[80] !== expandInto || $[81] !== setText) {
465
- t23 = command_3 => {
485
+ t24 = command_3 => {
466
486
  if (command_3.expand !== undefined) {
467
487
  expandInto(command_3);
468
488
  return;
@@ -476,14 +496,14 @@ export function usePromptMenus(t0) {
476
496
  $[79] = chooseSkill;
477
497
  $[80] = expandInto;
478
498
  $[81] = setText;
479
- $[82] = t23;
499
+ $[82] = t24;
480
500
  } else {
481
- t23 = $[82];
501
+ t24 = $[82];
482
502
  }
483
- const completeCommand = t23;
484
- let t24;
503
+ const completeCommand = t24;
504
+ let t25;
485
505
  if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
486
- t24 = (key, count) => {
506
+ t25 = (key, count) => {
487
507
  if (key === "ArrowDown") {
488
508
  setMenuIndex(i => (i + 1) % count);
489
509
  return true;
@@ -494,31 +514,33 @@ export function usePromptMenus(t0) {
494
514
  }
495
515
  return false;
496
516
  };
497
- $[83] = t24;
517
+ $[83] = t25;
498
518
  } else {
499
- t24 = $[83];
519
+ t25 = $[83];
500
520
  }
501
- const moveInMenu = t24;
502
- const t25 = skills.length > 0;
503
- const t26 = offersReferences && !referables.chatsOnly;
504
- let t27;
505
- if ($[84] !== skills) {
506
- t27 = skills.map(_temp6);
507
- $[84] = skills;
508
- $[85] = t27;
521
+ const moveInMenu = t25;
522
+ const t26 = skills.length > 0 || hostSkills.length > 0;
523
+ const t27 = offersReferences && !referables.chatsOnly;
524
+ let t28;
525
+ if ($[84] !== hostSkills || $[85] !== skills) {
526
+ t28 = [...hostSkills.map(_temp6), ...skills.map(_temp7)];
527
+ $[84] = hostSkills;
528
+ $[85] = skills;
529
+ $[86] = t28;
509
530
  } else {
510
- t27 = $[85];
531
+ t28 = $[86];
511
532
  }
512
- let t28;
513
- 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) {
514
- t28 = {
533
+ 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
+ t29 = {
515
536
  listId,
516
537
  activeIndex,
517
538
  inputAria,
518
539
  menuOpen,
519
- hasSkills: t25,
520
- offersViews: t26,
521
- skillNames: t27,
540
+ hasSkills: t26,
541
+ offersViews: t27,
542
+ skillNames: t28,
543
+ hostSkills,
522
544
  commandQuery,
523
545
  commands,
524
546
  commandMenuOpen,
@@ -548,47 +570,51 @@ export function usePromptMenus(t0) {
548
570
  completeCommand,
549
571
  moveInMenu
550
572
  };
551
- $[86] = accountMatches;
552
- $[87] = activeIndex;
553
- $[88] = chooseMention;
554
- $[89] = chooseMentionAt;
555
- $[90] = chooseNamed;
556
- $[91] = chooseReference;
557
- $[92] = chooseReferenceAt;
558
- $[93] = chooseSkill;
559
- $[94] = commandMenuOpen;
560
- $[95] = commandQuery;
561
- $[96] = commands;
562
- $[97] = completeCommand;
563
- $[98] = files_0;
564
- $[99] = inputAria;
565
- $[100] = listId;
566
- $[101] = mention;
567
- $[102] = mentionCount;
568
- $[103] = mentionMenuOpen;
569
- $[104] = menuOpen;
570
- $[105] = modelMatches;
571
- $[106] = namedLook;
572
- $[107] = pickCommand;
573
- $[108] = referables;
574
- $[109] = referenceChips;
575
- $[110] = referenceMatches;
576
- $[111] = referenceMenuOpen;
577
- $[112] = skillMatches;
578
- $[113] = skillMenuOpen;
579
- $[114] = t25;
580
- $[115] = t26;
581
- $[116] = t27;
582
- $[117] = trackTriggers;
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;
583
604
  $[118] = t28;
605
+ $[119] = trackTriggers;
606
+ $[120] = t29;
584
607
  } else {
585
- t28 = $[118];
608
+ t29 = $[120];
586
609
  }
587
- return t28;
610
+ return t29;
588
611
  }
589
- function _temp6(skill_2) {
612
+ function _temp7(skill_2) {
590
613
  return skill_2.name;
591
614
  }
615
+ function _temp6(skill_1) {
616
+ return skill_1.name;
617
+ }
592
618
  function _temp5(command_0) {
593
619
  return {
594
620
  name: command_0.name,
@@ -0,0 +1,16 @@
1
+ import type { ChatThreadInfo } from '../../../chat-sink.js';
2
+ export interface PromptSuggestion {
3
+ text: string;
4
+ accept(): void;
5
+ dismiss(): void;
6
+ }
7
+ interface SuggestionInput {
8
+ chatId: string;
9
+ info: Pick<ChatThreadInfo, 'activeTurnId'>;
10
+ empty: boolean;
11
+ writable: boolean;
12
+ asked: boolean;
13
+ fill(text: string): void;
14
+ }
15
+ export declare function usePromptSuggestion({ chatId, info, empty, writable, asked, fill }: SuggestionInput): PromptSuggestion | null;
16
+ export {};
@@ -0,0 +1,55 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useState } from 'react';
3
+ import { useChatRow } from '../../../state/chats.js';
4
+ /* The next prompt the CLI predicted, while the box is empty and nothing else asks for the person. */
5
+ export function usePromptSuggestion(t0) {
6
+ const $ = _c(9);
7
+ const {
8
+ chatId,
9
+ info,
10
+ empty,
11
+ writable,
12
+ asked,
13
+ fill
14
+ } = t0;
15
+ const suggestion = useChatRow(chatId, _temp);
16
+ const [dismissed, setDismissed] = useState(null);
17
+ if (suggestion === null || suggestion === dismissed || !empty || !writable || asked || info.activeTurnId !== null) {
18
+ return null;
19
+ }
20
+ let t1;
21
+ if ($[0] !== fill || $[1] !== suggestion) {
22
+ t1 = () => fill(suggestion);
23
+ $[0] = fill;
24
+ $[1] = suggestion;
25
+ $[2] = t1;
26
+ } else {
27
+ t1 = $[2];
28
+ }
29
+ let t2;
30
+ if ($[3] !== suggestion) {
31
+ t2 = () => setDismissed(suggestion);
32
+ $[3] = suggestion;
33
+ $[4] = t2;
34
+ } else {
35
+ t2 = $[4];
36
+ }
37
+ let t3;
38
+ if ($[5] !== suggestion || $[6] !== t1 || $[7] !== t2) {
39
+ t3 = {
40
+ text: suggestion,
41
+ accept: t1,
42
+ dismiss: t2
43
+ };
44
+ $[5] = suggestion;
45
+ $[6] = t1;
46
+ $[7] = t2;
47
+ $[8] = t3;
48
+ } else {
49
+ t3 = $[8];
50
+ }
51
+ return t3;
52
+ }
53
+ function _temp(row) {
54
+ return row?.suggestion ?? null;
55
+ }
@@ -39,7 +39,7 @@ export { uiTableColumns, type UiTableColumn } from './intelligent-ui/table-data.
39
39
  export { ForksRow } from './rows/ForksRow.js';
40
40
  export { GeneratedImageRow } from './rows/GeneratedImageRow.js';
41
41
  export { ReportRow, NoteRow, AgentTurnRow, CompactionRow } from './rows/MessageRows.js';
42
- export { TaskRow } from './rows/TaskRow.js';
42
+ export { TaskRow, TaskRowHead } from './rows/TaskRow.js';
43
43
  export { WorkRow, WorkGroupRow, WorkingRow } from './rows/WorkRows.js';
44
44
  export { WorkflowRow } from './rows/WorkflowRow.js';
45
45
  export { WorkflowAgentLine } from './WorkflowAgentLine.js';