@adecore/agents-react 0.46.3 → 0.48.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 (105) hide show
  1. package/dist/agents/accounts.d.ts +9 -1
  2. package/dist/agents/accounts.js +31 -7
  3. package/dist/chat/account-choice.d.ts +5 -4
  4. package/dist/chat/account-choice.js +47 -39
  5. package/dist/chat/index.d.ts +1 -0
  6. package/dist/chat/index.js +1 -0
  7. package/dist/chat/logic/scrubber.js +12 -0
  8. package/dist/chat/logic/timeline-copy.js +2 -0
  9. package/dist/chat/logic/timeline.d.ts +6 -1
  10. package/dist/chat/logic/timeline.js +36 -10
  11. package/dist/chat/preferences.d.ts +2 -2
  12. package/dist/chat/preferences.js +11 -5
  13. package/dist/chat/ui/AccountPill.js +9 -6
  14. package/dist/chat/ui/ChatActivity.d.ts +2 -1
  15. package/dist/chat/ui/ChatActivity.js +295 -61
  16. package/dist/chat/ui/Composer.d.ts +2 -1
  17. package/dist/chat/ui/Composer.js +492 -486
  18. package/dist/chat/ui/LimitState.js +180 -172
  19. package/dist/chat/ui/PromptEditor.js +4 -1
  20. package/dist/chat/ui/ReferenceChip.d.ts +2 -1
  21. package/dist/chat/ui/ReferenceChip.js +135 -100
  22. package/dist/chat/ui/UnifiedDiff.js +22 -19
  23. package/dist/chat/ui/composer/ComposerControls.js +1 -1
  24. package/dist/chat/ui/composer/ComposerMenu.js +17 -11
  25. package/dist/chat/ui/composer/chips.d.ts +3 -0
  26. package/dist/chat/ui/composer/chips.js +14 -10
  27. package/dist/chat/ui/composer/use-chat-controls.js +70 -67
  28. package/dist/chat/ui/diff/EditorEditDiff.d.ts +3 -1
  29. package/dist/chat/ui/diff/EditorEditDiff.js +24 -18
  30. package/dist/chat/ui/diff/EditorPatchDiff.d.ts +3 -1
  31. package/dist/chat/ui/diff/EditorPatchDiff.js +4 -2
  32. package/dist/chat/ui/diff/diff-props.d.ts +2 -0
  33. package/dist/chat/ui/reference-icons.d.ts +3 -0
  34. package/dist/chat/ui/reference-icons.js +15 -2
  35. package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
  36. package/dist/chat/ui/rows/MessageRows.js +166 -10
  37. package/dist/chat/ui/rows/RowContainer.js +21 -22
  38. package/dist/chat/ui/rows/Rows.js +37 -19
  39. package/dist/chat/ui/rows/WorkflowRow.d.ts +2 -1
  40. package/dist/chat/ui/rows/WorkflowRow.js +197 -191
  41. package/dist/chat/ui/rows/row-rhythm.d.ts +1 -0
  42. package/dist/chat/ui/rows/row-rhythm.js +12 -3
  43. package/dist/chat/workflow-list.d.ts +12 -0
  44. package/dist/chat/workflow-list.js +54 -0
  45. package/dist/host-hooks.d.ts +3 -0
  46. package/dist/host-hooks.js +8 -0
  47. package/dist/host.d.ts +11 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/locales/en/agent-chat.d.ts +9 -0
  50. package/dist/locales/en/agent-chat.js +9 -0
  51. package/dist/locales/en/agent-providers.d.ts +5 -0
  52. package/dist/locales/en/agent-providers.js +8 -3
  53. package/dist/locales/nl/agent-chat.d.ts +9 -0
  54. package/dist/locales/nl/agent-chat.js +9 -0
  55. package/dist/locales/nl/agent-providers.d.ts +5 -0
  56. package/dist/locales/nl/agent-providers.js +8 -3
  57. package/dist/providers/AccountOrderList.d.ts +10 -0
  58. package/dist/providers/AccountOrderList.js +158 -0
  59. package/dist/providers/CliDetail.js +55 -61
  60. package/dist/providers/account-actions.d.ts +1 -0
  61. package/dist/providers/account-actions.js +39 -0
  62. package/dist/providers/index.d.ts +1 -1
  63. package/dist/providers/index.js +1 -1
  64. package/dist/usage/limit-groups.js +6 -1
  65. package/package.json +8 -8
  66. package/src/agents/accounts.ts +42 -6
  67. package/src/chat/account-choice.ts +31 -10
  68. package/src/chat/index.ts +1 -0
  69. package/src/chat/logic/scrubber.ts +5 -0
  70. package/src/chat/logic/timeline-copy.ts +2 -0
  71. package/src/chat/logic/timeline.ts +33 -2
  72. package/src/chat/preferences.ts +33 -8
  73. package/src/chat/ui/AccountPill.tsx +3 -3
  74. package/src/chat/ui/ChatActivity.tsx +52 -6
  75. package/src/chat/ui/Composer.tsx +19 -3
  76. package/src/chat/ui/LimitState.tsx +4 -2
  77. package/src/chat/ui/PromptEditor.tsx +3 -1
  78. package/src/chat/ui/ReferenceChip.tsx +15 -5
  79. package/src/chat/ui/UnifiedDiff.tsx +12 -1
  80. package/src/chat/ui/composer/ComposerControls.tsx +1 -1
  81. package/src/chat/ui/composer/ComposerMenu.tsx +4 -2
  82. package/src/chat/ui/composer/chips.ts +15 -9
  83. package/src/chat/ui/composer/use-chat-controls.ts +4 -1
  84. package/src/chat/ui/diff/EditorEditDiff.tsx +9 -4
  85. package/src/chat/ui/diff/EditorPatchDiff.tsx +5 -1
  86. package/src/chat/ui/diff/diff-props.ts +3 -0
  87. package/src/chat/ui/reference-icons.ts +13 -1
  88. package/src/chat/ui/rows/MessageRows.tsx +35 -0
  89. package/src/chat/ui/rows/RowContainer.tsx +2 -2
  90. package/src/chat/ui/rows/Rows.tsx +3 -0
  91. package/src/chat/ui/rows/WorkflowRow.tsx +9 -4
  92. package/src/chat/ui/rows/row-rhythm.ts +12 -3
  93. package/src/chat/workflow-list.ts +65 -0
  94. package/src/host-hooks.ts +13 -0
  95. package/src/host.ts +23 -1
  96. package/src/index.ts +1 -0
  97. package/src/locales/en/agent-chat.ts +9 -0
  98. package/src/locales/en/agent-providers.ts +8 -3
  99. package/src/locales/nl/agent-chat.ts +9 -0
  100. package/src/locales/nl/agent-providers.ts +8 -3
  101. package/src/providers/AccountOrderList.tsx +124 -0
  102. package/src/providers/CliDetail.tsx +33 -28
  103. package/src/providers/account-actions.ts +30 -0
  104. package/src/providers/index.ts +11 -1
  105. package/src/usage/limit-groups.ts +8 -1
@@ -127,7 +127,7 @@ function ResumeAtResetToggle(t0) {
127
127
  */
128
128
  function _temp() {}
129
129
  function ContinueOn(t0) {
130
- const $ = _c(65);
130
+ const $ = _c(67);
131
131
  const {
132
132
  chatId,
133
133
  info,
@@ -141,280 +141,288 @@ function ContinueOn(t0) {
141
141
  const actions = useChatActions();
142
142
  const limits = useUsageLimits();
143
143
  const [busy, setBusy] = useState(false);
144
- const targets = continueTargets(choice.accounts, limits, info.provider, info.account);
145
144
  let t1;
146
- if ($[0] !== choice.accounts || $[1] !== info.account || $[2] !== info.provider || $[3] !== limits) {
147
- t1 = limits !== null && hasUnreadAccount(choice.accounts, limits, info.provider, info.account);
148
- $[0] = choice.accounts;
149
- $[1] = info.account;
150
- $[2] = info.provider;
151
- $[3] = limits;
152
- $[4] = t1;
145
+ if ($[0] !== choice.offered) {
146
+ t1 = target => choice.offered.some(entry => entry.id === target.id);
147
+ $[0] = choice.offered;
148
+ $[1] = t1;
153
149
  } else {
154
- t1 = $[4];
150
+ t1 = $[1];
155
151
  }
156
- const unread = t1;
152
+ const targets = continueTargets(choice.accounts, limits, info.provider, info.account).filter(t1);
157
153
  let t2;
154
+ if ($[2] !== choice.accounts || $[3] !== info.account || $[4] !== info.provider || $[5] !== limits) {
155
+ t2 = limits !== null && hasUnreadAccount(choice.accounts, limits, info.provider, info.account);
156
+ $[2] = choice.accounts;
157
+ $[3] = info.account;
158
+ $[4] = info.provider;
159
+ $[5] = limits;
160
+ $[6] = t2;
161
+ } else {
162
+ t2 = $[6];
163
+ }
164
+ const unread = t2;
158
165
  let t3;
159
- if ($[5] !== scope || $[6] !== unread) {
160
- t2 = () => {
166
+ let t4;
167
+ if ($[7] !== scope || $[8] !== unread) {
168
+ t3 = () => {
161
169
  if (unread) {
162
170
  readUnreadAccounts(scope);
163
171
  }
164
172
  };
165
- t3 = [scope, unread];
166
- $[5] = scope;
167
- $[6] = unread;
168
- $[7] = t2;
169
- $[8] = t3;
170
- } else {
171
- t2 = $[7];
172
- t3 = $[8];
173
- }
174
- useEffect(t2, t3);
175
- const target = targets[0];
176
- if (target === undefined) {
173
+ t4 = [scope, unread];
174
+ $[7] = scope;
175
+ $[8] = unread;
176
+ $[9] = t3;
177
+ $[10] = t4;
178
+ } else {
179
+ t3 = $[9];
180
+ t4 = $[10];
181
+ }
182
+ useEffect(t3, t4);
183
+ const target_0 = targets[0];
184
+ if (target_0 === undefined) {
177
185
  return null;
178
186
  }
179
- let t4;
180
- if ($[9] !== actions || $[10] !== chatId || $[11] !== choice || $[12] !== host || $[13] !== t) {
181
- t4 = entry => {
187
+ let t5;
188
+ if ($[11] !== actions || $[12] !== chatId || $[13] !== choice || $[14] !== host || $[15] !== t) {
189
+ t5 = entry_0 => {
182
190
  setBusy(true);
183
- actions.continueOn(chatId, entry.id).catch(e => host.notify({
191
+ actions.continueOn(chatId, entry_0.id).catch(e => host.notify({
184
192
  kind: "error",
185
193
  title: t("limit.continueFailed", {
186
- account: choice.nameOf(entry)
194
+ account: choice.nameOf(entry_0)
187
195
  }),
188
196
  description: errorMessage(e)
189
197
  })).finally(() => setBusy(false));
190
198
  };
191
- $[9] = actions;
192
- $[10] = chatId;
193
- $[11] = choice;
194
- $[12] = host;
195
- $[13] = t;
196
- $[14] = t4;
199
+ $[11] = actions;
200
+ $[12] = chatId;
201
+ $[13] = choice;
202
+ $[14] = host;
203
+ $[15] = t;
204
+ $[16] = t5;
197
205
  } else {
198
- t4 = $[14];
206
+ t5 = $[16];
199
207
  }
200
- const go = t4;
201
- const name = choice.nameOf(target);
208
+ const go = t5;
209
+ const name = choice.nameOf(target_0);
202
210
  const split = targets.length > 1;
203
211
  const T0 = Tooltip;
204
- const t5 = t("limit.continueOnTip", {
212
+ const t6 = t("limit.continueOnTip", {
205
213
  account: name
206
214
  });
207
215
  const T1 = Button;
208
- const t6 = "secondary";
209
- const t7 = "sm";
210
- const t8 = split && "rounded-r-none";
211
- let t9;
212
- if ($[15] !== t8) {
213
- t9 = clsx("shrink-0 gap-1.5 whitespace-nowrap", t8);
214
- $[15] = t8;
215
- $[16] = t9;
216
+ const t7 = "secondary";
217
+ const t8 = "sm";
218
+ const t9 = split && "rounded-r-none";
219
+ let t10;
220
+ if ($[17] !== t9) {
221
+ t10 = clsx("shrink-0 gap-1.5 whitespace-nowrap", t9);
222
+ $[17] = t9;
223
+ $[18] = t10;
216
224
  } else {
217
- t9 = $[16];
225
+ t10 = $[18];
218
226
  }
219
- const t10 = t("limit.continueOnAria", {
227
+ const t11 = t("limit.continueOnAria", {
220
228
  account: name
221
229
  });
222
- let t11;
223
- if ($[17] !== go || $[18] !== target) {
224
- t11 = () => go(target);
225
- $[17] = go;
226
- $[18] = target;
227
- $[19] = t11;
228
- } else {
229
- t11 = $[19];
230
- }
231
230
  let t12;
232
- if ($[20] !== t) {
233
- t12 = t("limit.continueOn");
234
- $[20] = t;
231
+ if ($[19] !== go || $[20] !== target_0) {
232
+ t12 = () => go(target_0);
233
+ $[19] = go;
234
+ $[20] = target_0;
235
235
  $[21] = t12;
236
236
  } else {
237
237
  t12 = $[21];
238
238
  }
239
239
  let t13;
240
- if ($[22] !== target.account.color) {
241
- t13 = /*#__PURE__*/_jsx(AccountDot, {
242
- color: target.account.color,
243
- className: "size-1.75"
244
- });
245
- $[22] = target.account.color;
240
+ if ($[22] !== t) {
241
+ t13 = t("limit.continueOn");
242
+ $[22] = t;
246
243
  $[23] = t13;
247
244
  } else {
248
245
  t13 = $[23];
249
246
  }
250
247
  let t14;
251
- if ($[24] !== T1 || $[25] !== busy || $[26] !== name || $[27] !== t10 || $[28] !== t11 || $[29] !== t12 || $[30] !== t13 || $[31] !== t9) {
252
- t14 = /*#__PURE__*/_jsxs(T1, {
253
- variant: t6,
254
- size: t7,
255
- className: t9,
256
- disabled: busy,
257
- "aria-label": t10,
258
- onClick: t11,
259
- children: [t12, t13, name]
248
+ if ($[24] !== target_0.account.color) {
249
+ t14 = /*#__PURE__*/_jsx(AccountDot, {
250
+ color: target_0.account.color,
251
+ className: "size-1.75"
260
252
  });
261
- $[24] = T1;
262
- $[25] = busy;
263
- $[26] = name;
264
- $[27] = t10;
265
- $[28] = t11;
266
- $[29] = t12;
267
- $[30] = t13;
268
- $[31] = t9;
269
- $[32] = t14;
253
+ $[24] = target_0.account.color;
254
+ $[25] = t14;
270
255
  } else {
271
- t14 = $[32];
256
+ t14 = $[25];
272
257
  }
273
258
  let t15;
274
- if ($[33] !== T0 || $[34] !== t14 || $[35] !== t5) {
275
- t15 = /*#__PURE__*/_jsx(T0, {
276
- label: t5,
277
- children: t14
259
+ if ($[26] !== T1 || $[27] !== busy || $[28] !== name || $[29] !== t10 || $[30] !== t11 || $[31] !== t12 || $[32] !== t13 || $[33] !== t14) {
260
+ t15 = /*#__PURE__*/_jsxs(T1, {
261
+ variant: t7,
262
+ size: t8,
263
+ className: t10,
264
+ disabled: busy,
265
+ "aria-label": t11,
266
+ onClick: t12,
267
+ children: [t13, t14, name]
278
268
  });
279
- $[33] = T0;
280
- $[34] = t14;
281
- $[35] = t5;
269
+ $[26] = T1;
270
+ $[27] = busy;
271
+ $[28] = name;
272
+ $[29] = t10;
273
+ $[30] = t11;
274
+ $[31] = t12;
275
+ $[32] = t13;
276
+ $[33] = t14;
277
+ $[34] = t15;
278
+ } else {
279
+ t15 = $[34];
280
+ }
281
+ let t16;
282
+ if ($[35] !== T0 || $[36] !== t15 || $[37] !== t6) {
283
+ t16 = /*#__PURE__*/_jsx(T0, {
284
+ label: t6,
285
+ children: t15
286
+ });
287
+ $[35] = T0;
282
288
  $[36] = t15;
289
+ $[37] = t6;
290
+ $[38] = t16;
283
291
  } else {
284
- t15 = $[36];
292
+ t16 = $[38];
285
293
  }
286
- const suggestion = t15;
294
+ const suggestion = t16;
287
295
  if (!split) {
288
296
  return suggestion;
289
297
  }
290
- let t16;
291
- if ($[37] !== t) {
292
- t16 = t("limit.chooseAccount");
293
- $[37] = t;
294
- $[38] = t16;
298
+ let t17;
299
+ if ($[39] !== t) {
300
+ t17 = t("limit.chooseAccount");
301
+ $[39] = t;
302
+ $[40] = t17;
295
303
  } else {
296
- t16 = $[38];
304
+ t17 = $[40];
297
305
  }
298
- let t17;
299
- if ($[39] !== busy) {
300
- t17 = /*#__PURE__*/_jsx(Button, {
306
+ let t18;
307
+ if ($[41] !== busy) {
308
+ t18 = /*#__PURE__*/_jsx(Button, {
301
309
  variant: "secondary",
302
310
  size: "sm",
303
311
  className: "-ml-px rounded-l-none border-l-0 px-1.5",
304
312
  disabled: busy
305
313
  });
306
- $[39] = busy;
307
- $[40] = t17;
314
+ $[41] = busy;
315
+ $[42] = t18;
308
316
  } else {
309
- t17 = $[40];
317
+ t18 = $[42];
310
318
  }
311
- let t18;
312
- if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
313
- t18 = /*#__PURE__*/_jsx(Icon, {
319
+ let t19;
320
+ if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
321
+ t19 = /*#__PURE__*/_jsx(Icon, {
314
322
  icon: ChevronDown,
315
323
  size: 14
316
324
  });
317
- $[41] = t18;
318
- } else {
319
- t18 = $[41];
320
- }
321
- let t19;
322
- if ($[42] !== t17) {
323
- t19 = /*#__PURE__*/_jsx(Menu.Trigger, {
324
- render: t17,
325
- children: t18
326
- });
327
- $[42] = t17;
328
325
  $[43] = t19;
329
326
  } else {
330
327
  t19 = $[43];
331
328
  }
332
329
  let t20;
333
- if ($[44] !== t16 || $[45] !== t19) {
334
- t20 = /*#__PURE__*/_jsx(Tooltip, {
335
- label: t16,
336
- name: true,
330
+ if ($[44] !== t18) {
331
+ t20 = /*#__PURE__*/_jsx(Menu.Trigger, {
332
+ render: t18,
337
333
  children: t19
338
334
  });
339
- $[44] = t16;
340
- $[45] = t19;
341
- $[46] = t20;
335
+ $[44] = t18;
336
+ $[45] = t20;
342
337
  } else {
343
- t20 = $[46];
338
+ t20 = $[45];
344
339
  }
345
340
  let t21;
346
- if ($[47] !== t) {
347
- t21 = t("limit.continueOn");
348
- $[47] = t;
341
+ if ($[46] !== t17 || $[47] !== t20) {
342
+ t21 = /*#__PURE__*/_jsx(Tooltip, {
343
+ label: t17,
344
+ name: true,
345
+ children: t20
346
+ });
347
+ $[46] = t17;
348
+ $[47] = t20;
349
349
  $[48] = t21;
350
350
  } else {
351
351
  t21 = $[48];
352
352
  }
353
353
  let t22;
354
- if ($[49] !== t21) {
355
- t22 = /*#__PURE__*/_jsx(Menu.GroupLabel, {
356
- children: t21
357
- });
358
- $[49] = t21;
354
+ if ($[49] !== t) {
355
+ t22 = t("limit.continueOn");
356
+ $[49] = t;
359
357
  $[50] = t22;
360
358
  } else {
361
359
  t22 = $[50];
362
360
  }
363
361
  let t23;
364
- if ($[51] !== choice || $[52] !== go || $[53] !== info || $[54] !== targets) {
365
- t23 = /*#__PURE__*/_jsx(ContinueOnRows, {
362
+ if ($[51] !== t22) {
363
+ t23 = /*#__PURE__*/_jsx(Menu.GroupLabel, {
364
+ children: t22
365
+ });
366
+ $[51] = t22;
367
+ $[52] = t23;
368
+ } else {
369
+ t23 = $[52];
370
+ }
371
+ let t24;
372
+ if ($[53] !== choice || $[54] !== go || $[55] !== info || $[56] !== targets) {
373
+ t24 = /*#__PURE__*/_jsx(ContinueOnRows, {
366
374
  targets: targets,
367
375
  info: info,
368
376
  choice: choice,
369
377
  onPick: go
370
378
  });
371
- $[51] = choice;
372
- $[52] = go;
373
- $[53] = info;
374
- $[54] = targets;
375
- $[55] = t23;
379
+ $[53] = choice;
380
+ $[54] = go;
381
+ $[55] = info;
382
+ $[56] = targets;
383
+ $[57] = t24;
376
384
  } else {
377
- t23 = $[55];
385
+ t24 = $[57];
378
386
  }
379
- let t24;
380
- if ($[56] !== t22 || $[57] !== t23) {
381
- t24 = /*#__PURE__*/_jsx(Menu.Popup, {
387
+ let t25;
388
+ if ($[58] !== t23 || $[59] !== t24) {
389
+ t25 = /*#__PURE__*/_jsx(Menu.Popup, {
382
390
  align: "end",
383
391
  className: "min-w-64",
384
392
  children: /*#__PURE__*/_jsxs(Menu.Group, {
385
- children: [t22, t23]
393
+ children: [t23, t24]
386
394
  })
387
395
  });
388
- $[56] = t22;
389
- $[57] = t23;
390
- $[58] = t24;
396
+ $[58] = t23;
397
+ $[59] = t24;
398
+ $[60] = t25;
391
399
  } else {
392
- t24 = $[58];
400
+ t25 = $[60];
393
401
  }
394
- let t25;
395
- if ($[59] !== t20 || $[60] !== t24) {
396
- t25 = /*#__PURE__*/_jsxs(Menu.Root, {
397
- children: [t20, t24]
402
+ let t26;
403
+ if ($[61] !== t21 || $[62] !== t25) {
404
+ t26 = /*#__PURE__*/_jsxs(Menu.Root, {
405
+ children: [t21, t25]
398
406
  });
399
- $[59] = t20;
400
- $[60] = t24;
401
- $[61] = t25;
407
+ $[61] = t21;
408
+ $[62] = t25;
409
+ $[63] = t26;
402
410
  } else {
403
- t25 = $[61];
411
+ t26 = $[63];
404
412
  }
405
- let t26;
406
- if ($[62] !== suggestion || $[63] !== t25) {
407
- t26 = /*#__PURE__*/_jsxs(ButtonGroup, {
413
+ let t27;
414
+ if ($[64] !== suggestion || $[65] !== t26) {
415
+ t27 = /*#__PURE__*/_jsxs(ButtonGroup, {
408
416
  className: "shrink-0",
409
- children: [suggestion, t25]
417
+ children: [suggestion, t26]
410
418
  });
411
- $[62] = suggestion;
412
- $[63] = t25;
413
- $[64] = t26;
419
+ $[64] = suggestion;
420
+ $[65] = t26;
421
+ $[66] = t27;
414
422
  } else {
415
- t26 = $[64];
423
+ t27 = $[66];
416
424
  }
417
- return t26;
425
+ return t27;
418
426
  }
419
427
  /* Mounted only while the menu is open, so the clock of the session lines only ticks while someone reads them. */
420
428
  function ContinueOnRows(t0) {
@@ -499,7 +507,7 @@ export function LimitDock(t0) {
499
507
  } = useTranslation("agent-chat");
500
508
  useFormatLocale();
501
509
  const now = useNow(MINUTE_MS, info.limit !== undefined);
502
- const choice = useAccountChoice(info.provider, info.account);
510
+ const choice = useAccountChoice(info.provider, info.account, chatId);
503
511
  let t1;
504
512
  if ($[0] !== info || $[1] !== now) {
505
513
  t1 = limitView(info, now);
@@ -1,6 +1,7 @@
1
1
  import { useLayoutEffect, useRef } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { Surface } from '@adecore/ui';
4
+ import { useChatHost } from '../../host.js';
4
5
  import { ComposerInput } from './ComposerInput.js';
5
6
  import { chipDecorations } from './composer/chips.js';
6
7
  import { ComposerMenu } from './composer/ComposerMenu.js';
@@ -26,6 +27,7 @@ export function PromptEditor({
26
27
  disabled = false,
27
28
  className
28
29
  }) {
30
+ const host = useChatHost();
29
31
  const inputRef = useRef(null);
30
32
  // A pick writes twice in one event (the text, then what it picked), and the second must build on the first.
31
33
  const latest = useRef(value);
@@ -63,7 +65,8 @@ export function PromptEditor({
63
65
  const extensions = chipDecorations({
64
66
  mentions: value.mentions,
65
67
  skills: value.skills,
66
- references: menus.referenceChips
68
+ references: menus.referenceChips,
69
+ referenceIcon: host.ReferenceIcon
67
70
  });
68
71
  const onKeyDown = e => {
69
72
  if (e.isComposing) {
@@ -9,7 +9,8 @@ interface TokenChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children
9
9
  onOpen?: () => void;
10
10
  }
11
11
  export declare function TokenChip({ kind, value, sigil, icon, label, tone, onOpen, className, ...rest }: TokenChipProps): import("react").JSX.Element;
12
- export declare function ReferenceChip({ id }: {
12
+ export declare function ReferenceChip({ id, lastName }: {
13
13
  id: string;
14
+ lastName?: string;
14
15
  }): import("react").JSX.Element;
15
16
  export {};