@adecore/agents-react 0.37.2 → 0.37.3
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.
- package/dist/chat/chat-client.d.ts +1 -0
- package/dist/chat/chat-client.js +2 -1
- package/dist/chat/chat-references.d.ts +16 -1
- package/dist/chat/chat-references.js +29 -3
- package/dist/chat/drafts.d.ts +2 -0
- package/dist/chat/drafts.js +21 -5
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/mentions.d.ts +31 -14
- package/dist/chat/mentions.js +186 -41
- package/dist/chat/stash.d.ts +1 -0
- package/dist/chat/stash.js +4 -2
- package/dist/chat/ui/Composer.js +438 -429
- package/dist/chat/ui/ComposerInput.d.ts +1 -0
- package/dist/chat/ui/ComposerInput.js +2 -0
- package/dist/chat/ui/Markdown.d.ts +3 -1
- package/dist/chat/ui/Markdown.js +194 -120
- package/dist/chat/ui/MessageActions.js +70 -66
- package/dist/chat/ui/ReferenceChip.d.ts +15 -0
- package/dist/chat/ui/ReferenceChip.js +255 -0
- package/dist/chat/ui/Timeline.js +52 -29
- package/dist/chat/ui/TimelineMenu.js +84 -78
- package/dist/chat/ui/chip-clipboard.d.ts +9 -0
- package/dist/chat/ui/chip-clipboard.js +105 -0
- package/dist/chat/ui/chips.d.ts +5 -0
- package/dist/chat/ui/chips.js +15 -1
- package/dist/chat/ui/composer/ComposerMenu.js +140 -79
- package/dist/chat/ui/composer/DraftParts.d.ts +0 -4
- package/dist/chat/ui/composer/DraftParts.js +0 -41
- package/dist/chat/ui/composer/chip-paste.d.ts +15 -0
- package/dist/chat/ui/composer/chip-paste.js +104 -0
- package/dist/chat/ui/composer/chips.d.ts +5 -0
- package/dist/chat/ui/composer/chips.js +59 -9
- package/dist/chat/ui/composer/key-handler.js +9 -0
- package/dist/chat/ui/composer/use-composer-draft.d.ts +0 -1
- package/dist/chat/ui/composer/use-composer-draft.js +2 -10
- package/dist/chat/ui/composer/use-composer-menus.d.ts +12 -2
- package/dist/chat/ui/composer/use-composer-menus.js +192 -149
- package/dist/chat/ui/composer/use-composer-submit.js +17 -12
- package/dist/chat/ui/composer/use-draft-files.d.ts +7 -1
- package/dist/chat/ui/composer/use-draft-files.js +90 -58
- package/dist/chat/ui/composer/use-take-back.js +2 -1
- package/dist/chat/ui/index.d.ts +0 -1
- package/dist/chat/ui/index.js +0 -1
- package/dist/chat/ui/reference-icons.d.ts +3 -0
- package/dist/chat/ui/reference-icons.js +15 -0
- package/dist/chat/ui/reference-lookup.d.ts +7 -0
- package/dist/chat/ui/reference-lookup.js +6 -0
- package/dist/chat/ui/rehype-chips.d.ts +8 -1
- package/dist/chat/ui/rehype-chips.js +35 -11
- package/dist/chat/ui/rows/MessageRows.js +218 -158
- package/dist/chat/ui/thread-references.d.ts +4 -0
- package/dist/chat/ui/thread-references.js +78 -0
- package/dist/host-hooks.d.ts +2 -0
- package/dist/host-hooks.js +7 -0
- package/dist/host.d.ts +3 -0
- package/dist/locales/en/agent-chat.d.ts +20 -3
- package/dist/locales/en/agent-chat.js +24 -7
- package/dist/locales/nl/agent-chat.d.ts +20 -3
- package/dist/locales/nl/agent-chat.js +24 -7
- package/package.json +8 -8
- package/src/chat/chat-client.ts +4 -1
- package/src/chat/chat-references.ts +44 -3
- package/src/chat/drafts.ts +24 -6
- package/src/chat/index.ts +1 -1
- package/src/chat/mentions.ts +202 -36
- package/src/chat/stash.ts +6 -2
- package/src/chat/ui/Composer.tsx +14 -4
- package/src/chat/ui/ComposerInput.tsx +4 -0
- package/src/chat/ui/Markdown.tsx +57 -25
- package/src/chat/ui/MessageActions.tsx +5 -2
- package/src/chat/ui/ReferenceChip.tsx +74 -0
- package/src/chat/ui/Timeline.tsx +24 -2
- package/src/chat/ui/TimelineMenu.tsx +7 -3
- package/src/chat/ui/chip-clipboard.ts +115 -0
- package/src/chat/ui/chips.ts +20 -1
- package/src/chat/ui/composer/ComposerMenu.tsx +53 -37
- package/src/chat/ui/composer/DraftParts.tsx +0 -12
- package/src/chat/ui/composer/chip-paste.ts +122 -0
- package/src/chat/ui/composer/chips.ts +60 -10
- package/src/chat/ui/composer/key-handler.ts +9 -0
- package/src/chat/ui/composer/use-composer-draft.ts +1 -7
- package/src/chat/ui/composer/use-composer-menus.ts +68 -29
- package/src/chat/ui/composer/use-composer-submit.ts +13 -6
- package/src/chat/ui/composer/use-draft-files.ts +39 -5
- package/src/chat/ui/composer/use-take-back.ts +2 -1
- package/src/chat/ui/index.ts +0 -1
- package/src/chat/ui/reference-icons.ts +17 -0
- package/src/chat/ui/reference-lookup.ts +13 -0
- package/src/chat/ui/rehype-chips.ts +38 -13
- package/src/chat/ui/rows/MessageRows.tsx +88 -64
- package/src/chat/ui/thread-references.ts +47 -0
- package/src/host-hooks.ts +9 -0
- package/src/host.ts +6 -1
- package/src/locales/en/agent-chat.ts +24 -7
- package/src/locales/nl/agent-chat.ts +24 -7
- package/dist/chat/ui/ChatReferenceChip.d.ts +0 -4
- package/dist/chat/ui/ChatReferenceChip.js +0 -110
- package/src/chat/ui/ChatReferenceChip.tsx +0 -26
|
@@ -10,7 +10,10 @@ import { useChatScope } from '../../../scope.js';
|
|
|
10
10
|
import { splitQuote } from '../../quote.js';
|
|
11
11
|
import { jumpToTimelineItem } from '../../timeline-scroll.js';
|
|
12
12
|
import { useProviders } from '../../../state/providers.js';
|
|
13
|
-
import {
|
|
13
|
+
import { referenceTokens } from '../../chat-references.js';
|
|
14
|
+
import { presentReferences } from '../../mentions.js';
|
|
15
|
+
import { ReferenceChip } from '../ReferenceChip.js';
|
|
16
|
+
import { ReferenceLookupContext } from '../reference-lookup.js';
|
|
14
17
|
import { ImageThumb } from '../ImageView.js';
|
|
15
18
|
import { Markdown, MessageMarkdown, ReplyMarkdown } from '../Markdown.js';
|
|
16
19
|
import { FadingWords } from '../FadingWords.js';
|
|
@@ -26,6 +29,8 @@ import { useOpenForFind } from '../find-reveal.js';
|
|
|
26
29
|
import { ReplyContext, UiReplyNavigationContext } from '../reply-context.js';
|
|
27
30
|
import { UiReply } from '../intelligent-ui/UiReply.js';
|
|
28
31
|
import { useHostAttachmentUrl, useHostChatPlace, useHostReplyAuthor, useHostStreaming } from '../../../host-hooks.js';
|
|
32
|
+
import { copySelectionWithChips } from '../chip-clipboard.js';
|
|
33
|
+
import { useReferenceLookup } from '../thread-references.js';
|
|
29
34
|
// A long prompt folds so the answer stays in view; the reader can open it.
|
|
30
35
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
36
|
const USER_FOLD_LINES = 8;
|
|
@@ -183,7 +188,7 @@ function AttachmentThumb(t0) {
|
|
|
183
188
|
return t1;
|
|
184
189
|
}
|
|
185
190
|
export function UserRow(t0) {
|
|
186
|
-
const $ = _c(
|
|
191
|
+
const $ = _c(51);
|
|
187
192
|
const {
|
|
188
193
|
chatId,
|
|
189
194
|
item
|
|
@@ -210,33 +215,43 @@ export function UserRow(t0) {
|
|
|
210
215
|
t2 = $[3];
|
|
211
216
|
}
|
|
212
217
|
const attachments = t2;
|
|
213
|
-
let t3;
|
|
214
|
-
if ($[4] !== item.chats) {
|
|
215
|
-
t3 = item.chats ?? [];
|
|
216
|
-
$[4] = item.chats;
|
|
217
|
-
$[5] = t3;
|
|
218
|
-
} else {
|
|
219
|
-
t3 = $[5];
|
|
220
|
-
}
|
|
221
|
-
const chats = t3;
|
|
222
218
|
const [missing, setMissing] = useState(false);
|
|
223
219
|
const {
|
|
224
220
|
keyOf
|
|
225
221
|
} = useChatScope();
|
|
222
|
+
const lookup = useReferenceLookup(chatId);
|
|
223
|
+
let references;
|
|
224
|
+
let t3;
|
|
225
|
+
if ($[4] !== item.chats || $[5] !== item.references || $[6] !== item.text || $[7] !== lookup.items) {
|
|
226
|
+
const referenced = [...(item.chats ?? []), ...(item.references ?? [])];
|
|
227
|
+
references = referenceTokens(referenced, lookup.items);
|
|
228
|
+
const placed = presentReferences(item.text, referenced, references);
|
|
229
|
+
t3 = referenced.filter(id => !placed.includes(id));
|
|
230
|
+
$[4] = item.chats;
|
|
231
|
+
$[5] = item.references;
|
|
232
|
+
$[6] = item.text;
|
|
233
|
+
$[7] = lookup.items;
|
|
234
|
+
$[8] = references;
|
|
235
|
+
$[9] = t3;
|
|
236
|
+
} else {
|
|
237
|
+
references = $[8];
|
|
238
|
+
t3 = $[9];
|
|
239
|
+
}
|
|
240
|
+
const beside = t3;
|
|
226
241
|
useOpenForFind(item.id, "text", setOpen);
|
|
227
242
|
let t4;
|
|
228
|
-
if ($[
|
|
243
|
+
if ($[10] !== item.quoteSource || $[11] !== item.text) {
|
|
229
244
|
t4 = item.quoteSource === undefined ? null : splitQuote(item.text);
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
245
|
+
$[10] = item.quoteSource;
|
|
246
|
+
$[11] = item.text;
|
|
247
|
+
$[12] = t4;
|
|
233
248
|
} else {
|
|
234
|
-
t4 = $[
|
|
249
|
+
t4 = $[12];
|
|
235
250
|
}
|
|
236
251
|
const quoted = t4;
|
|
237
252
|
const source = item.quoteSource?.itemId;
|
|
238
253
|
let t5;
|
|
239
|
-
if ($[
|
|
254
|
+
if ($[13] !== chatId || $[14] !== keyOf || $[15] !== source) {
|
|
240
255
|
t5 = function goToSource() {
|
|
241
256
|
if (source !== undefined) {
|
|
242
257
|
setMissing(false);
|
|
@@ -246,35 +261,35 @@ export function UserRow(t0) {
|
|
|
246
261
|
});
|
|
247
262
|
}
|
|
248
263
|
};
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
264
|
+
$[13] = chatId;
|
|
265
|
+
$[14] = keyOf;
|
|
266
|
+
$[15] = source;
|
|
267
|
+
$[16] = t5;
|
|
253
268
|
} else {
|
|
254
|
-
t5 = $[
|
|
269
|
+
t5 = $[16];
|
|
255
270
|
}
|
|
256
271
|
const goToSource = t5;
|
|
257
272
|
const t6 = item.id;
|
|
258
273
|
let t7;
|
|
259
|
-
if ($[
|
|
274
|
+
if ($[17] !== t) {
|
|
260
275
|
t7 = t("rows.user.heading");
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
276
|
+
$[17] = t;
|
|
277
|
+
$[18] = t7;
|
|
263
278
|
} else {
|
|
264
|
-
t7 = $[
|
|
279
|
+
t7 = $[18];
|
|
265
280
|
}
|
|
266
281
|
let t8;
|
|
267
|
-
if ($[
|
|
282
|
+
if ($[19] !== t7) {
|
|
268
283
|
t8 = /*#__PURE__*/_jsx(MessageHeading, {
|
|
269
284
|
children: t7
|
|
270
285
|
});
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
286
|
+
$[19] = t7;
|
|
287
|
+
$[20] = t8;
|
|
273
288
|
} else {
|
|
274
|
-
t8 = $[
|
|
289
|
+
t8 = $[20];
|
|
275
290
|
}
|
|
276
291
|
let t9;
|
|
277
|
-
if ($[
|
|
292
|
+
if ($[21] !== attachments || $[22] !== chatId) {
|
|
278
293
|
t9 = attachments.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
279
294
|
className: "mb-1.5 flex max-w-[80%] flex-wrap justify-end gap-1.5",
|
|
280
295
|
children: attachments.map(attachment => isImageAttachment(attachment.mime) ? /*#__PURE__*/_jsx(AttachmentThumb, {
|
|
@@ -285,37 +300,37 @@ export function UserRow(t0) {
|
|
|
285
300
|
attachment: attachment
|
|
286
301
|
}, attachment.id))
|
|
287
302
|
});
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
303
|
+
$[21] = attachments;
|
|
304
|
+
$[22] = chatId;
|
|
305
|
+
$[23] = t9;
|
|
291
306
|
} else {
|
|
292
|
-
t9 = $[
|
|
307
|
+
t9 = $[23];
|
|
293
308
|
}
|
|
294
309
|
let t10;
|
|
295
|
-
if ($[
|
|
296
|
-
t10 =
|
|
310
|
+
if ($[24] !== beside) {
|
|
311
|
+
t10 = beside.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
297
312
|
className: "mb-1.5 flex max-w-[80%] flex-wrap justify-end gap-1.5",
|
|
298
|
-
children:
|
|
313
|
+
children: beside.map(_temp2)
|
|
299
314
|
});
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
315
|
+
$[24] = beside;
|
|
316
|
+
$[25] = t10;
|
|
302
317
|
} else {
|
|
303
|
-
t10 = $[
|
|
318
|
+
t10 = $[25];
|
|
304
319
|
}
|
|
305
320
|
let t11;
|
|
306
|
-
if ($[
|
|
321
|
+
if ($[26] !== chatId || $[27] !== item.uiChoice) {
|
|
307
322
|
t11 = item.uiChoice !== undefined && /*#__PURE__*/_jsx(ChoiceLine, {
|
|
308
323
|
chatId: chatId,
|
|
309
324
|
choice: item.uiChoice
|
|
310
325
|
});
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
326
|
+
$[26] = chatId;
|
|
327
|
+
$[27] = item.uiChoice;
|
|
328
|
+
$[28] = t11;
|
|
314
329
|
} else {
|
|
315
|
-
t11 = $[
|
|
330
|
+
t11 = $[28];
|
|
316
331
|
}
|
|
317
332
|
let t12;
|
|
318
|
-
if ($[
|
|
333
|
+
if ($[29] !== goToSource || $[30] !== item.mentions || $[31] !== item.skills || $[32] !== item.text || $[33] !== long || $[34] !== missing || $[35] !== open || $[36] !== quoted || $[37] !== references || $[38] !== source || $[39] !== t) {
|
|
319
334
|
t12 = item.text !== "" && /*#__PURE__*/_jsxs("div", {
|
|
320
335
|
className: "relative max-w-[80%] rounded-2xl bg-surface-active px-3.5 py-2.5 text-sm wrap-anywhere text-text select-text",
|
|
321
336
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -329,9 +344,9 @@ export function UserRow(t0) {
|
|
|
329
344
|
tabIndex: 0,
|
|
330
345
|
className: "mb-2 cursor-pointer rounded-sm border-l-2 border-border-strong pl-2.5 text-text-muted hover:bg-text/5 hover:text-text focus-visible:outline-2 focus-visible:outline-accent",
|
|
331
346
|
onClick: goToSource,
|
|
332
|
-
onKeyDown:
|
|
333
|
-
if (
|
|
334
|
-
|
|
347
|
+
onKeyDown: e_0 => {
|
|
348
|
+
if (e_0.key === "Enter" || e_0.key === " ") {
|
|
349
|
+
e_0.preventDefault();
|
|
335
350
|
goToSource();
|
|
336
351
|
}
|
|
337
352
|
},
|
|
@@ -345,16 +360,18 @@ export function UserRow(t0) {
|
|
|
345
360
|
}), quoted.rest !== "" && /*#__PURE__*/_jsx(MessageMarkdown, {
|
|
346
361
|
text: quoted.rest,
|
|
347
362
|
mentions: item.mentions,
|
|
348
|
-
skills: item.skills
|
|
363
|
+
skills: item.skills,
|
|
364
|
+
references: references
|
|
349
365
|
})]
|
|
350
366
|
}) : /*#__PURE__*/_jsx(MessageMarkdown, {
|
|
351
367
|
text: item.text,
|
|
352
368
|
mentions: item.mentions,
|
|
353
|
-
skills: item.skills
|
|
369
|
+
skills: item.skills,
|
|
370
|
+
references: references
|
|
354
371
|
})
|
|
355
372
|
}), long && /*#__PURE__*/_jsxs("button", {
|
|
356
373
|
className: "mt-1 flex items-center gap-1 text-xs text-text-muted hover:text-text",
|
|
357
|
-
onClick: () => setOpen(
|
|
374
|
+
onClick: () => setOpen(_temp3),
|
|
358
375
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
359
376
|
icon: ChevronDown,
|
|
360
377
|
size: 12,
|
|
@@ -362,50 +379,67 @@ export function UserRow(t0) {
|
|
|
362
379
|
}), " ", open ? t("rows.user.showLess") : t("rows.user.showAll")]
|
|
363
380
|
})]
|
|
364
381
|
});
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
|
|
377
|
-
|
|
382
|
+
$[29] = goToSource;
|
|
383
|
+
$[30] = item.mentions;
|
|
384
|
+
$[31] = item.skills;
|
|
385
|
+
$[32] = item.text;
|
|
386
|
+
$[33] = long;
|
|
387
|
+
$[34] = missing;
|
|
388
|
+
$[35] = open;
|
|
389
|
+
$[36] = quoted;
|
|
390
|
+
$[37] = references;
|
|
391
|
+
$[38] = source;
|
|
392
|
+
$[39] = t;
|
|
393
|
+
$[40] = t12;
|
|
394
|
+
} else {
|
|
395
|
+
t12 = $[40];
|
|
378
396
|
}
|
|
379
397
|
let t13;
|
|
380
|
-
if ($[
|
|
398
|
+
if ($[41] !== item.id || $[42] !== t10 || $[43] !== t11 || $[44] !== t12 || $[45] !== t8 || $[46] !== t9) {
|
|
381
399
|
t13 = /*#__PURE__*/_jsxs("div", {
|
|
382
400
|
"data-find-item": t6,
|
|
383
401
|
className: "flex flex-col items-end",
|
|
402
|
+
onCopy: _temp,
|
|
384
403
|
children: [t8, t9, t10, t11, t12]
|
|
385
404
|
});
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
405
|
+
$[41] = item.id;
|
|
406
|
+
$[42] = t10;
|
|
407
|
+
$[43] = t11;
|
|
408
|
+
$[44] = t12;
|
|
409
|
+
$[45] = t8;
|
|
410
|
+
$[46] = t9;
|
|
411
|
+
$[47] = t13;
|
|
412
|
+
} else {
|
|
413
|
+
t13 = $[47];
|
|
414
|
+
}
|
|
415
|
+
let t14;
|
|
416
|
+
if ($[48] !== lookup || $[49] !== t13) {
|
|
417
|
+
t14 = /*#__PURE__*/_jsx(ReferenceLookupContext, {
|
|
418
|
+
value: lookup,
|
|
419
|
+
children: t13
|
|
420
|
+
});
|
|
421
|
+
$[48] = lookup;
|
|
422
|
+
$[49] = t13;
|
|
423
|
+
$[50] = t14;
|
|
393
424
|
} else {
|
|
394
|
-
|
|
425
|
+
t14 = $[50];
|
|
395
426
|
}
|
|
396
|
-
return
|
|
427
|
+
return t14;
|
|
397
428
|
}
|
|
398
429
|
/*
|
|
399
430
|
* The choice a message answers. The label stays out of the message, which holds exactly what the agent
|
|
400
431
|
* read, and out of a copied selection; a screen reader hears it between the heading and the message.
|
|
401
432
|
*/
|
|
402
|
-
function
|
|
433
|
+
function _temp3(o) {
|
|
403
434
|
return !o;
|
|
404
435
|
}
|
|
405
|
-
function
|
|
406
|
-
return /*#__PURE__*/_jsx(
|
|
407
|
-
|
|
408
|
-
},
|
|
436
|
+
function _temp2(id_0) {
|
|
437
|
+
return /*#__PURE__*/_jsx(ReferenceChip, {
|
|
438
|
+
id: id_0
|
|
439
|
+
}, id_0);
|
|
440
|
+
}
|
|
441
|
+
function _temp(e) {
|
|
442
|
+
return copySelectionWithChips(e.nativeEvent);
|
|
409
443
|
}
|
|
410
444
|
function ChoiceLine(t0) {
|
|
411
445
|
const $ = _c(19);
|
|
@@ -610,7 +644,7 @@ function ReplyHeading(t0) {
|
|
|
610
644
|
} = useTranslation("agent-chat");
|
|
611
645
|
const context = useContext(ReplyContext);
|
|
612
646
|
const author = useReplyAuthor(chatId);
|
|
613
|
-
const kind = useChatRow(chatId,
|
|
647
|
+
const kind = useChatRow(chatId, _temp4);
|
|
614
648
|
let t1;
|
|
615
649
|
if ($[0] !== context?.provider || $[1] !== kind) {
|
|
616
650
|
t1 = s => s.providers.find(provider => provider.kind === (context?.provider ?? kind))?.name;
|
|
@@ -647,7 +681,7 @@ function ReplyHeading(t0) {
|
|
|
647
681
|
* The line over a reply with who wrote it and how long ago, when the host names its author. A screen
|
|
648
682
|
* reader hears the name from the reply's own heading, so this line is for the eye only.
|
|
649
683
|
*/
|
|
650
|
-
function
|
|
684
|
+
function _temp4(row) {
|
|
651
685
|
return row?.info.provider;
|
|
652
686
|
}
|
|
653
687
|
export function ReplyHeader(t0) {
|
|
@@ -755,15 +789,17 @@ function Writing() {
|
|
|
755
789
|
* A reply. A word at a time, it follows the text as it arrives. A block at a time, the blocks that
|
|
756
790
|
* closed are drawn and fade in as they land, with "Writing…" where the next one will stand. Whole,
|
|
757
791
|
* it says it is being written and fades in once it is done. Only a row that saw the reply being
|
|
758
|
-
* written fades anything: an old reply scrolled back into view just stands there.
|
|
792
|
+
* written fades anything: an old reply scrolled back into view just stands there. A `#Name` it
|
|
793
|
+
* spells for a view, node or chat of the project is a chip that opens it.
|
|
759
794
|
*/
|
|
760
795
|
export function AssistantRow(t0) {
|
|
761
|
-
const $ = _c(
|
|
796
|
+
const $ = _c(67);
|
|
762
797
|
const {
|
|
763
798
|
chatId,
|
|
764
799
|
item: derived
|
|
765
800
|
} = t0;
|
|
766
801
|
const item = useCurrentItem(chatId, derived);
|
|
802
|
+
const lookup = useReferenceLookup(chatId);
|
|
767
803
|
const scope = useChatScope();
|
|
768
804
|
const context = useContext(ReplyContext);
|
|
769
805
|
let t1;
|
|
@@ -880,154 +916,178 @@ export function AssistantRow(t0) {
|
|
|
880
916
|
t3 = $[29];
|
|
881
917
|
}
|
|
882
918
|
let t4;
|
|
883
|
-
if ($[30] !==
|
|
919
|
+
if ($[30] !== lookup || $[31] !== reply || $[32] !== sawWriting || $[33] !== settled) {
|
|
884
920
|
t4 = settled !== "" && /*#__PURE__*/_jsx("div", {
|
|
885
921
|
"data-find-field": "text",
|
|
886
922
|
"data-quote-answer": true,
|
|
887
923
|
className: "contents",
|
|
888
|
-
children: /*#__PURE__*/_jsx(
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
924
|
+
children: /*#__PURE__*/_jsx(ReferenceLookupContext, {
|
|
925
|
+
value: lookup,
|
|
926
|
+
children: /*#__PURE__*/_jsx(ReplyMarkdown, {
|
|
927
|
+
text: settled,
|
|
928
|
+
streaming: false,
|
|
929
|
+
arriving: sawWriting,
|
|
930
|
+
reply: reply
|
|
931
|
+
})
|
|
893
932
|
})
|
|
894
933
|
});
|
|
895
|
-
$[30] =
|
|
896
|
-
$[31] =
|
|
897
|
-
$[32] =
|
|
898
|
-
$[33] =
|
|
934
|
+
$[30] = lookup;
|
|
935
|
+
$[31] = reply;
|
|
936
|
+
$[32] = sawWriting;
|
|
937
|
+
$[33] = settled;
|
|
938
|
+
$[34] = t4;
|
|
899
939
|
} else {
|
|
900
|
-
t4 = $[
|
|
940
|
+
t4 = $[34];
|
|
901
941
|
}
|
|
902
942
|
let t5;
|
|
903
|
-
if ($[
|
|
943
|
+
if ($[35] !== item.streaming) {
|
|
904
944
|
t5 = item.streaming && /*#__PURE__*/_jsx(Writing, {});
|
|
905
|
-
$[
|
|
906
|
-
$[
|
|
945
|
+
$[35] = item.streaming;
|
|
946
|
+
$[36] = t5;
|
|
907
947
|
} else {
|
|
908
|
-
t5 = $[
|
|
948
|
+
t5 = $[36];
|
|
909
949
|
}
|
|
910
950
|
let t6;
|
|
911
|
-
if ($[
|
|
951
|
+
if ($[37] !== item.id || $[38] !== t3 || $[39] !== t4 || $[40] !== t5) {
|
|
912
952
|
t6 = /*#__PURE__*/_jsxs("div", {
|
|
913
953
|
"data-find-item": item.id,
|
|
914
954
|
className: "-mx-1 px-1 pb-2",
|
|
955
|
+
onCopy: _temp5,
|
|
915
956
|
children: [t3, t4, t5]
|
|
916
957
|
});
|
|
917
|
-
$[
|
|
918
|
-
$[
|
|
919
|
-
$[
|
|
920
|
-
$[
|
|
921
|
-
$[
|
|
958
|
+
$[37] = item.id;
|
|
959
|
+
$[38] = t3;
|
|
960
|
+
$[39] = t4;
|
|
961
|
+
$[40] = t5;
|
|
962
|
+
$[41] = t6;
|
|
922
963
|
} else {
|
|
923
|
-
t6 = $[
|
|
964
|
+
t6 = $[41];
|
|
924
965
|
}
|
|
925
966
|
return t6;
|
|
926
967
|
}
|
|
927
968
|
if (mode === "whole" && item.streaming) {
|
|
928
969
|
let t2;
|
|
929
|
-
if ($[
|
|
970
|
+
if ($[42] !== chatId) {
|
|
930
971
|
t2 = /*#__PURE__*/_jsx(ReplyHeading, {
|
|
931
972
|
chatId: chatId
|
|
932
973
|
});
|
|
933
|
-
$[
|
|
934
|
-
$[
|
|
974
|
+
$[42] = chatId;
|
|
975
|
+
$[43] = t2;
|
|
935
976
|
} else {
|
|
936
|
-
t2 = $[
|
|
977
|
+
t2 = $[43];
|
|
937
978
|
}
|
|
938
979
|
let t3;
|
|
939
|
-
if ($[
|
|
980
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
940
981
|
t3 = /*#__PURE__*/_jsx(Writing, {});
|
|
941
|
-
$[
|
|
982
|
+
$[44] = t3;
|
|
942
983
|
} else {
|
|
943
|
-
t3 = $[
|
|
984
|
+
t3 = $[44];
|
|
944
985
|
}
|
|
945
986
|
let t4;
|
|
946
|
-
if ($[
|
|
987
|
+
if ($[45] !== t2) {
|
|
947
988
|
t4 = /*#__PURE__*/_jsxs("div", {
|
|
948
989
|
className: "-mx-1 px-1 pb-2",
|
|
949
990
|
children: [t2, t3]
|
|
950
991
|
});
|
|
951
|
-
$[
|
|
952
|
-
$[
|
|
992
|
+
$[45] = t2;
|
|
993
|
+
$[46] = t4;
|
|
953
994
|
} else {
|
|
954
|
-
t4 = $[
|
|
995
|
+
t4 = $[46];
|
|
955
996
|
}
|
|
956
997
|
return t4;
|
|
957
998
|
}
|
|
958
999
|
const t2 = item.id;
|
|
959
1000
|
const t3 = mode === "whole" && sawWriting && WHOLE_FADE_CLASS;
|
|
960
1001
|
let t4;
|
|
961
|
-
if ($[
|
|
1002
|
+
if ($[47] !== t3) {
|
|
962
1003
|
t4 = clsx("-mx-1 px-1 pb-2", t3);
|
|
963
|
-
$[
|
|
964
|
-
$[
|
|
1004
|
+
$[47] = t3;
|
|
1005
|
+
$[48] = t4;
|
|
965
1006
|
} else {
|
|
966
|
-
t4 = $[
|
|
1007
|
+
t4 = $[48];
|
|
967
1008
|
}
|
|
968
1009
|
let t5;
|
|
969
|
-
if ($[
|
|
1010
|
+
if ($[49] !== chatId) {
|
|
970
1011
|
t5 = /*#__PURE__*/_jsx(ReplyHeading, {
|
|
971
1012
|
chatId: chatId
|
|
972
1013
|
});
|
|
973
|
-
$[
|
|
974
|
-
$[
|
|
1014
|
+
$[49] = chatId;
|
|
1015
|
+
$[50] = t5;
|
|
975
1016
|
} else {
|
|
976
|
-
t5 = $[
|
|
1017
|
+
t5 = $[50];
|
|
977
1018
|
}
|
|
978
1019
|
let t6;
|
|
979
|
-
if ($[
|
|
980
|
-
t6 = /*#__PURE__*/_jsx(
|
|
1020
|
+
if ($[51] !== reply || $[52] !== reveal.active || $[53] !== reveal.text) {
|
|
1021
|
+
t6 = /*#__PURE__*/_jsx(ReplyMarkdown, {
|
|
1022
|
+
text: reveal.text,
|
|
1023
|
+
streaming: reveal.active,
|
|
1024
|
+
reply: reply
|
|
1025
|
+
});
|
|
1026
|
+
$[51] = reply;
|
|
1027
|
+
$[52] = reveal.active;
|
|
1028
|
+
$[53] = reveal.text;
|
|
1029
|
+
$[54] = t6;
|
|
1030
|
+
} else {
|
|
1031
|
+
t6 = $[54];
|
|
1032
|
+
}
|
|
1033
|
+
let t7;
|
|
1034
|
+
if ($[55] !== lookup || $[56] !== t6) {
|
|
1035
|
+
t7 = /*#__PURE__*/_jsx("div", {
|
|
981
1036
|
"data-find-field": "text",
|
|
982
1037
|
"data-quote-answer": true,
|
|
983
1038
|
className: "contents",
|
|
984
|
-
children: /*#__PURE__*/_jsx(
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
reply: reply
|
|
1039
|
+
children: /*#__PURE__*/_jsx(ReferenceLookupContext, {
|
|
1040
|
+
value: lookup,
|
|
1041
|
+
children: t6
|
|
988
1042
|
})
|
|
989
1043
|
});
|
|
990
|
-
$[
|
|
991
|
-
$[
|
|
992
|
-
$[
|
|
993
|
-
$[53] = t6;
|
|
1044
|
+
$[55] = lookup;
|
|
1045
|
+
$[56] = t6;
|
|
1046
|
+
$[57] = t7;
|
|
994
1047
|
} else {
|
|
995
|
-
|
|
1048
|
+
t7 = $[57];
|
|
996
1049
|
}
|
|
997
|
-
let
|
|
998
|
-
if ($[
|
|
999
|
-
|
|
1050
|
+
let t8;
|
|
1051
|
+
if ($[58] !== item.text || $[59] !== live) {
|
|
1052
|
+
t8 = live && item.text === "" && /*#__PURE__*/_jsx("span", {
|
|
1000
1053
|
className: "inline-block h-3.5 w-1.5 animate-pulse rounded-sm bg-text-faint align-middle"
|
|
1001
1054
|
});
|
|
1002
|
-
$[
|
|
1003
|
-
$[
|
|
1004
|
-
$[
|
|
1055
|
+
$[58] = item.text;
|
|
1056
|
+
$[59] = live;
|
|
1057
|
+
$[60] = t8;
|
|
1005
1058
|
} else {
|
|
1006
|
-
|
|
1059
|
+
t8 = $[60];
|
|
1007
1060
|
}
|
|
1008
|
-
let
|
|
1009
|
-
if ($[
|
|
1010
|
-
|
|
1061
|
+
let t9;
|
|
1062
|
+
if ($[61] !== item.id || $[62] !== t4 || $[63] !== t5 || $[64] !== t7 || $[65] !== t8) {
|
|
1063
|
+
t9 = /*#__PURE__*/_jsxs("div", {
|
|
1011
1064
|
"data-find-item": t2,
|
|
1012
1065
|
className: t4,
|
|
1013
|
-
|
|
1066
|
+
onCopy: _temp6,
|
|
1067
|
+
children: [t5, t7, t8]
|
|
1014
1068
|
});
|
|
1015
|
-
$[
|
|
1016
|
-
$[
|
|
1017
|
-
$[
|
|
1018
|
-
$[
|
|
1019
|
-
$[
|
|
1020
|
-
$[
|
|
1069
|
+
$[61] = item.id;
|
|
1070
|
+
$[62] = t4;
|
|
1071
|
+
$[63] = t5;
|
|
1072
|
+
$[64] = t7;
|
|
1073
|
+
$[65] = t8;
|
|
1074
|
+
$[66] = t9;
|
|
1021
1075
|
} else {
|
|
1022
|
-
|
|
1076
|
+
t9 = $[66];
|
|
1023
1077
|
}
|
|
1024
|
-
return
|
|
1078
|
+
return t9;
|
|
1025
1079
|
}
|
|
1026
1080
|
/*
|
|
1027
1081
|
* What the model thought before it answered. It shimmers while it streams and folds itself away
|
|
1028
1082
|
* once the answer starts, because the thought is worth a glance and rarely worth reading twice:
|
|
1029
1083
|
* folded, it shows the heading it opens with or itself on one line, and opened, it reads as Markdown.
|
|
1030
1084
|
*/
|
|
1085
|
+
function _temp6(e_0) {
|
|
1086
|
+
return copySelectionWithChips(e_0.nativeEvent);
|
|
1087
|
+
}
|
|
1088
|
+
function _temp5(e) {
|
|
1089
|
+
return copySelectionWithChips(e.nativeEvent);
|
|
1090
|
+
}
|
|
1031
1091
|
export function ThinkingRow(t0) {
|
|
1032
1092
|
const $ = _c(27);
|
|
1033
1093
|
const {
|
|
@@ -1082,7 +1142,7 @@ export function ThinkingRow(t0) {
|
|
|
1082
1142
|
const t6 = item.streaming ? undefined : open;
|
|
1083
1143
|
let t7;
|
|
1084
1144
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1085
|
-
t7 = () => setOpen(
|
|
1145
|
+
t7 = () => setOpen(_temp7);
|
|
1086
1146
|
$[11] = t7;
|
|
1087
1147
|
} else {
|
|
1088
1148
|
t7 = $[11];
|
|
@@ -1188,7 +1248,7 @@ export function ThinkingRow(t0) {
|
|
|
1188
1248
|
* The latest thought of a running turn over the call it led to, as its heading or first sentence,
|
|
1189
1249
|
* so what the model found stays in view while it checks it. Nothing while the thought has no line yet.
|
|
1190
1250
|
*/
|
|
1191
|
-
function
|
|
1251
|
+
function _temp7(o) {
|
|
1192
1252
|
return !o;
|
|
1193
1253
|
}
|
|
1194
1254
|
export function LiveThoughtRow(t0) {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ChatItem } from '@adecore/agent-contracts';
|
|
2
|
+
import type { ReferenceLookup } from './reference-lookup.js';
|
|
3
|
+
export declare function threadReferencedKey(structure: Record<string, ChatItem> | undefined): string;
|
|
4
|
+
export declare function useReferenceLookup(chatId: string): ReferenceLookup;
|