@adecore/agents-react 0.37.3 → 0.39.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 (66) hide show
  1. package/dist/agents/AgentModelLabel.d.ts +10 -0
  2. package/dist/agents/AgentModelLabel.js +97 -0
  3. package/dist/chat/logic/visual-height.d.ts +1 -0
  4. package/dist/chat/logic/visual-height.js +1 -1
  5. package/dist/chat/ui/Composer.js +385 -360
  6. package/dist/chat/ui/HostMenuItems.d.ts +4 -0
  7. package/dist/chat/ui/HostMenuItems.js +15 -0
  8. package/dist/chat/ui/Pickers.d.ts +2 -1
  9. package/dist/chat/ui/Pickers.js +126 -123
  10. package/dist/chat/ui/PromptEditor.d.ts +19 -0
  11. package/dist/chat/ui/PromptEditor.js +115 -0
  12. package/dist/chat/ui/Timeline.d.ts +2 -1
  13. package/dist/chat/ui/Timeline.js +13 -1
  14. package/dist/chat/ui/VisualFrame.d.ts +8 -0
  15. package/dist/chat/ui/VisualFrame.js +217 -115
  16. package/dist/chat/ui/composer/ComposerControls.d.ts +3 -0
  17. package/dist/chat/ui/composer/ComposerControls.js +235 -38
  18. package/dist/chat/ui/composer/key-handler.d.ts +1 -1
  19. package/dist/chat/ui/composer/key-handler.js +3 -11
  20. package/dist/chat/ui/composer/prompt-picks.d.ts +4 -0
  21. package/dist/chat/ui/composer/prompt-picks.js +14 -0
  22. package/dist/chat/ui/composer/use-composer-menus.d.ts +4 -49
  23. package/dist/chat/ui/composer/use-composer-menus.js +65 -519
  24. package/dist/chat/ui/composer/use-prompt-menus.d.ts +73 -0
  25. package/dist/chat/ui/composer/use-prompt-menus.js +536 -0
  26. package/dist/chat/ui/index.d.ts +4 -0
  27. package/dist/chat/ui/index.js +3 -0
  28. package/dist/chat/ui/rows/GeneratedImageRow.js +8 -4
  29. package/dist/chat/ui/rows/VisualRow.js +184 -142
  30. package/dist/chat/ui/rows/row-rhythm.js +6 -4
  31. package/dist/host-hooks.d.ts +2 -1
  32. package/dist/host-hooks.js +6 -0
  33. package/dist/host.d.ts +27 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/locales/en/agent-chat.d.ts +1 -0
  36. package/dist/locales/en/agent-chat.js +1 -0
  37. package/dist/locales/nl/agent-chat.d.ts +1 -0
  38. package/dist/locales/nl/agent-chat.js +1 -0
  39. package/dist/providers/index.d.ts +1 -0
  40. package/dist/providers/index.js +1 -0
  41. package/dist/theme.css +3 -0
  42. package/package.json +8 -8
  43. package/src/agents/AgentModelLabel.tsx +40 -0
  44. package/src/chat/logic/visual-height.ts +1 -1
  45. package/src/chat/ui/Composer.tsx +12 -3
  46. package/src/chat/ui/HostMenuItems.tsx +11 -0
  47. package/src/chat/ui/Pickers.tsx +4 -1
  48. package/src/chat/ui/PromptEditor.tsx +130 -0
  49. package/src/chat/ui/Timeline.tsx +22 -1
  50. package/src/chat/ui/VisualFrame.tsx +68 -21
  51. package/src/chat/ui/composer/ComposerControls.tsx +65 -15
  52. package/src/chat/ui/composer/key-handler.ts +3 -9
  53. package/src/chat/ui/composer/prompt-picks.ts +17 -0
  54. package/src/chat/ui/composer/use-composer-menus.ts +18 -275
  55. package/src/chat/ui/composer/use-prompt-menus.ts +341 -0
  56. package/src/chat/ui/index.ts +4 -0
  57. package/src/chat/ui/rows/GeneratedImageRow.tsx +9 -4
  58. package/src/chat/ui/rows/VisualRow.tsx +5 -1
  59. package/src/chat/ui/rows/row-rhythm.ts +6 -4
  60. package/src/host-hooks.ts +9 -1
  61. package/src/host.ts +45 -1
  62. package/src/index.ts +3 -0
  63. package/src/locales/en/agent-chat.ts +1 -0
  64. package/src/locales/nl/agent-chat.ts +1 -0
  65. package/src/providers/index.ts +1 -0
  66. package/src/theme.css +3 -0
@@ -43,7 +43,7 @@ import { usePromptHistory } from './composer/use-prompt-history.js';
43
43
  import { usePromptHold } from './composer/use-prompt-hold.js';
44
44
  import { surfacePartOf } from './composer/surface.js';
45
45
  import { useTakeBack } from './composer/use-take-back.js';
46
- import { useHostExtraPrompts, useHostSendDelivery } from '../../host-hooks.js';
46
+ import { useHostComposerSendActions, useHostExtraPrompts, useHostSendDelivery } from '../../host-hooks.js';
47
47
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
48
48
  function sendLabelKey(busy, steerable, delivery) {
49
49
  if (!busy) {
@@ -55,7 +55,7 @@ function sendLabelKey(busy, steerable, delivery) {
55
55
  return delivery === 'steer' ? 'composer.steerButton' : 'composer.queueWithSteerButton';
56
56
  }
57
57
  export function Composer(t0) {
58
- const $ = _c(230);
58
+ const $ = _c(239);
59
59
  const {
60
60
  chatId,
61
61
  info,
@@ -205,6 +205,7 @@ export function Composer(t0) {
205
205
  const continuable = useContinuableTurn(chatId, info);
206
206
  const [sentFor, setSentFor] = useState(null);
207
207
  const extraPrompts = useHostExtraPrompts(scope.id, chatId);
208
+ const sendActions = useHostComposerSendActions(scope.id, chatId);
208
209
  let t11;
209
210
  if ($[35] !== continuable || $[36] !== onSend) {
210
211
  t11 = (text, extras) => {
@@ -367,16 +368,8 @@ export function Composer(t0) {
367
368
  }
368
369
  useEffect(t21, t22);
369
370
  let t23;
370
- if ($[66] !== box) {
371
- t23 = next => box.setText(next);
372
- $[66] = box;
373
- $[67] = t23;
374
- } else {
375
- t23 = $[67];
376
- }
377
- let t24;
378
- if ($[68] !== chatId || $[69] !== draft.text || $[70] !== files.noteKey || $[71] !== history || $[72] !== host || $[73] !== menus || $[74] !== sendKey || $[75] !== submit || $[76] !== t23 || $[77] !== toggleStash) {
379
- t24 = composerKeyHandler({
371
+ if ($[66] !== chatId || $[67] !== draft.text || $[68] !== files.noteKey || $[69] !== history || $[70] !== host || $[71] !== menus || $[72] !== sendKey || $[73] !== submit || $[74] !== toggleStash) {
372
+ t23 = composerKeyHandler({
380
373
  chatId,
381
374
  host,
382
375
  sendKey,
@@ -385,44 +378,42 @@ export function Composer(t0) {
385
378
  history,
386
379
  noteKey: files.noteKey,
387
380
  toggleStash,
388
- setText: t23,
389
381
  submit
390
382
  });
391
- $[68] = chatId;
392
- $[69] = draft.text;
393
- $[70] = files.noteKey;
394
- $[71] = history;
395
- $[72] = host;
396
- $[73] = menus;
397
- $[74] = sendKey;
398
- $[75] = submit;
399
- $[76] = t23;
400
- $[77] = toggleStash;
401
- $[78] = t24;
402
- } else {
403
- t24 = $[78];
404
- }
405
- const onKeyDown = t24;
383
+ $[66] = chatId;
384
+ $[67] = draft.text;
385
+ $[68] = files.noteKey;
386
+ $[69] = history;
387
+ $[70] = host;
388
+ $[71] = menus;
389
+ $[72] = sendKey;
390
+ $[73] = submit;
391
+ $[74] = toggleStash;
392
+ $[75] = t23;
393
+ } else {
394
+ t23 = $[75];
395
+ }
396
+ const onKeyDown = t23;
406
397
  const pointSurface = _temp4;
407
- let t25;
408
- if ($[79] !== writable) {
409
- t25 = event_0 => {
398
+ let t24;
399
+ if ($[76] !== writable) {
400
+ t24 = event_0 => {
410
401
  if (!writable || event_0.button !== 0 || event_0.defaultPrevented || surfacePartOf(event_0.target, event_0.currentTarget) !== "surface") {
411
402
  return;
412
403
  }
413
404
  event_0.preventDefault();
414
405
  inputRef.current?.setCaret(Infinity);
415
406
  };
416
- $[79] = writable;
417
- $[80] = t25;
407
+ $[76] = writable;
408
+ $[77] = t24;
418
409
  } else {
419
- t25 = $[80];
410
+ t24 = $[77];
420
411
  }
421
- const pressSurface = t25;
422
- const t26 = "chat-composer-content pointer-events-none relative z-10 w-full";
423
- let t27;
424
- if ($[81] !== atEnd || $[82] !== chatId || $[83] !== readOnly || $[84] !== t) {
425
- t27 = !atEnd && !readOnly && /*#__PURE__*/_jsx("div", {
412
+ const pressSurface = t24;
413
+ const t25 = "chat-composer-content pointer-events-none relative z-10 w-full";
414
+ let t26;
415
+ if ($[78] !== atEnd || $[79] !== chatId || $[80] !== readOnly || $[81] !== t) {
416
+ t26 = !atEnd && !readOnly && /*#__PURE__*/_jsx("div", {
426
417
  className: "absolute inset-x-0 bottom-full mb-2 flex justify-center",
427
418
  children: /*#__PURE__*/_jsx(Tooltip, {
428
419
  label: t("composer.jumpToEnd"),
@@ -439,477 +430,511 @@ export function Composer(t0) {
439
430
  })
440
431
  })
441
432
  });
442
- $[81] = atEnd;
443
- $[82] = chatId;
444
- $[83] = readOnly;
445
- $[84] = t;
446
- $[85] = t27;
433
+ $[78] = atEnd;
434
+ $[79] = chatId;
435
+ $[80] = readOnly;
436
+ $[81] = t;
437
+ $[82] = t26;
447
438
  } else {
448
- t27 = $[85];
439
+ t26 = $[82];
449
440
  }
450
- let t28;
451
- if ($[86] !== chatId) {
452
- t28 = /*#__PURE__*/_jsx(ChatActivity, {
441
+ let t27;
442
+ if ($[83] !== chatId) {
443
+ t27 = /*#__PURE__*/_jsx(ChatActivity, {
453
444
  chatId: chatId
454
445
  });
455
- $[86] = chatId;
456
- $[87] = t28;
446
+ $[83] = chatId;
447
+ $[84] = t27;
457
448
  } else {
458
- t28 = $[87];
449
+ t27 = $[84];
459
450
  }
460
- const t29 = files.dragging ? "border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]" : "border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]";
461
- let t30;
462
- if ($[88] !== t29) {
463
- t30 = clsx("@container/composer pointer-events-auto flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within", t29);
464
- $[88] = t29;
465
- $[89] = t30;
451
+ const t28 = files.dragging ? "border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]" : "border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]";
452
+ let t29;
453
+ if ($[85] !== t28) {
454
+ t29 = clsx("@container/composer pointer-events-auto flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within", t28);
455
+ $[85] = t28;
456
+ $[86] = t29;
466
457
  } else {
467
- t30 = $[89];
458
+ t29 = $[86];
468
459
  }
469
- const t31 = files.dropTarget;
460
+ const t30 = files.dropTarget;
470
461
  const T0 = PromptComposer;
471
- const t32 = !empty;
472
- const t33 = capabilities?.denyReason === true;
473
- let t34;
474
- if ($[90] === Symbol.for("react.memo_cache_sentinel")) {
475
- t34 = () => inputRef.current?.focus();
476
- $[90] = t34;
462
+ const t31 = !empty;
463
+ const t32 = capabilities?.denyReason === true;
464
+ let t33;
465
+ if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
466
+ t33 = () => inputRef.current?.focus();
467
+ $[87] = t33;
468
+ } else {
469
+ t33 = $[87];
470
+ }
471
+ const t34 = writable && "data-[text-cursor]:cursor-text";
472
+ let t35;
473
+ if ($[88] !== t34) {
474
+ t35 = clsx(t34);
475
+ $[88] = t34;
476
+ $[89] = t35;
477
477
  } else {
478
- t34 = $[90];
478
+ t35 = $[89];
479
479
  }
480
- const t35 = writable && "data-[text-cursor]:cursor-text";
481
480
  let t36;
482
- if ($[91] !== t35) {
483
- t36 = clsx(t35);
484
- $[91] = t35;
481
+ if ($[90] !== chatId || $[91] !== info) {
482
+ t36 = /*#__PURE__*/_jsx(LimitDock, {
483
+ chatId: chatId,
484
+ info: info
485
+ });
486
+ $[90] = chatId;
487
+ $[91] = info;
485
488
  $[92] = t36;
486
489
  } else {
487
490
  t36 = $[92];
488
491
  }
489
- let t37;
490
- if ($[93] !== chatId || $[94] !== info) {
491
- t37 = /*#__PURE__*/_jsx(LimitDock, {
492
+ const t37 = capabilities?.goals;
493
+ let t38;
494
+ if ($[93] !== chatId || $[94] !== info || $[95] !== t37) {
495
+ t38 = /*#__PURE__*/_jsx(GoalDock, {
492
496
  chatId: chatId,
493
- info: info
497
+ info: info,
498
+ goals: t37
494
499
  });
495
500
  $[93] = chatId;
496
501
  $[94] = info;
497
502
  $[95] = t37;
503
+ $[96] = t38;
498
504
  } else {
499
- t37 = $[95];
505
+ t38 = $[96];
500
506
  }
501
- const t38 = capabilities?.goals;
502
507
  let t39;
503
- if ($[96] !== chatId || $[97] !== info || $[98] !== t38) {
504
- t39 = /*#__PURE__*/_jsx(GoalDock, {
505
- chatId: chatId,
506
- info: info,
507
- goals: t38
508
- });
509
- $[96] = chatId;
510
- $[97] = info;
511
- $[98] = t38;
512
- $[99] = t39;
513
- } else {
514
- t39 = $[99];
515
- }
516
- let t40;
517
- if ($[100] !== chatId || $[101] !== compactionOffer || $[102] !== controls.compact || $[103] !== scope) {
518
- t40 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
508
+ if ($[97] !== chatId || $[98] !== compactionOffer || $[99] !== controls.compact || $[100] !== scope) {
509
+ t39 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
519
510
  tokens: compactionOffer.tokens,
520
511
  reason: compactionOffer.reason,
521
512
  onCompact: controls.compact,
522
513
  onDismiss: () => dismissResumeCompaction(scope, chatId, compactionOffer.turnId)
523
514
  });
524
- $[100] = chatId;
525
- $[101] = compactionOffer;
526
- $[102] = controls.compact;
527
- $[103] = scope;
528
- $[104] = t40;
515
+ $[97] = chatId;
516
+ $[98] = compactionOffer;
517
+ $[99] = controls.compact;
518
+ $[100] = scope;
519
+ $[101] = t39;
529
520
  } else {
530
- t40 = $[104];
521
+ t39 = $[101];
531
522
  }
532
- let t41;
533
- if ($[105] !== menus) {
534
- t41 = /*#__PURE__*/_jsx(ComposerMenu, {
523
+ let t40;
524
+ if ($[102] !== menus) {
525
+ t40 = /*#__PURE__*/_jsx(ComposerMenu, {
535
526
  menus: menus
536
527
  });
537
- $[105] = menus;
538
- $[106] = t41;
528
+ $[102] = menus;
529
+ $[103] = t40;
539
530
  } else {
540
- t41 = $[106];
531
+ t40 = $[103];
541
532
  }
542
- let t42;
543
- if ($[107] !== chatId || $[108] !== info.queuePaused || $[109] !== queue || $[110] !== takeBack || $[111] !== takingBack) {
544
- t42 = queue.length > 0 && /*#__PURE__*/_jsx(QueuedMessages, {
533
+ let t41;
534
+ if ($[104] !== chatId || $[105] !== info.queuePaused || $[106] !== queue || $[107] !== takeBack || $[108] !== takingBack) {
535
+ t41 = queue.length > 0 && /*#__PURE__*/_jsx(QueuedMessages, {
545
536
  chatId: chatId,
546
537
  queue: queue,
547
538
  paused: info.queuePaused === true,
548
539
  takingBack: takingBack !== null,
549
540
  onEdit: message => void takeBack(message)
550
541
  });
551
- $[107] = chatId;
552
- $[108] = info.queuePaused;
553
- $[109] = queue;
554
- $[110] = takeBack;
555
- $[111] = takingBack;
556
- $[112] = t42;
542
+ $[104] = chatId;
543
+ $[105] = info.queuePaused;
544
+ $[106] = queue;
545
+ $[107] = takeBack;
546
+ $[108] = takingBack;
547
+ $[109] = t41;
557
548
  } else {
558
- t42 = $[112];
549
+ t41 = $[109];
559
550
  }
560
- let t43;
561
- if ($[113] !== box.removeQuote || $[114] !== chatId || $[115] !== draft.quote || $[116] !== draft.quoteSource || $[117] !== notice || $[118] !== t) {
562
- t43 = draft.quote !== "" && /*#__PURE__*/_jsx(DraftQuote, {
551
+ let t42;
552
+ if ($[110] !== box.removeQuote || $[111] !== chatId || $[112] !== draft.quote || $[113] !== draft.quoteSource || $[114] !== notice || $[115] !== t) {
553
+ t42 = draft.quote !== "" && /*#__PURE__*/_jsx(DraftQuote, {
563
554
  chatId: chatId,
564
555
  quote: draft.quote,
565
556
  source: draft.quoteSource,
566
557
  onRemove: box.removeQuote,
567
558
  onSourceGone: () => notice.setNotice(t("rows.user.quoteGone"), "info")
568
559
  });
569
- $[113] = box.removeQuote;
570
- $[114] = chatId;
571
- $[115] = draft.quote;
572
- $[116] = draft.quoteSource;
573
- $[117] = notice;
574
- $[118] = t;
575
- $[119] = t43;
560
+ $[110] = box.removeQuote;
561
+ $[111] = chatId;
562
+ $[112] = draft.quote;
563
+ $[113] = draft.quoteSource;
564
+ $[114] = notice;
565
+ $[115] = t;
566
+ $[116] = t42;
576
567
  } else {
577
- t43 = $[119];
568
+ t42 = $[116];
578
569
  }
579
- let t44;
580
- if ($[120] !== box.removeAttachment || $[121] !== draft.attachments) {
581
- t44 = draft.attachments.length > 0 && /*#__PURE__*/_jsx(DraftAttachments, {
570
+ let t43;
571
+ if ($[117] !== box.removeAttachment || $[118] !== draft.attachments) {
572
+ t43 = draft.attachments.length > 0 && /*#__PURE__*/_jsx(DraftAttachments, {
582
573
  attachments: draft.attachments,
583
574
  onRemove: box.removeAttachment
584
575
  });
585
- $[120] = box.removeAttachment;
586
- $[121] = draft.attachments;
587
- $[122] = t44;
576
+ $[117] = box.removeAttachment;
577
+ $[118] = draft.attachments;
578
+ $[119] = t43;
588
579
  } else {
589
- t44 = $[122];
580
+ t43 = $[119];
590
581
  }
591
- const t45 = !writable;
592
- let t46;
593
- if ($[123] !== box || $[124] !== history || $[125] !== hold || $[126] !== menus) {
594
- t46 = (value, selection, state) => {
582
+ const t44 = !writable;
583
+ let t45;
584
+ if ($[120] !== box || $[121] !== history || $[122] !== hold || $[123] !== menus) {
585
+ t45 = (value, selection, state) => {
595
586
  hold.noteInput();
596
587
  box.setText(value);
597
588
  menus.setMenuIndex(0);
598
589
  menus.trackTriggers(value, selection, state);
599
590
  history.edited(value);
600
591
  };
601
- $[123] = box;
602
- $[124] = history;
603
- $[125] = hold;
604
- $[126] = menus;
605
- $[127] = t46;
592
+ $[120] = box;
593
+ $[121] = history;
594
+ $[122] = hold;
595
+ $[123] = menus;
596
+ $[124] = t45;
606
597
  } else {
607
- t46 = $[127];
598
+ t45 = $[124];
608
599
  }
609
- let t47;
610
- if ($[128] !== hold || $[129] !== menus) {
611
- t47 = () => {
600
+ let t46;
601
+ if ($[125] !== hold || $[126] !== menus) {
602
+ t46 = () => {
612
603
  menus.close();
613
604
  hold.release("blur");
614
605
  };
615
- $[128] = hold;
616
- $[129] = menus;
617
- $[130] = t47;
606
+ $[125] = hold;
607
+ $[126] = menus;
608
+ $[127] = t46;
618
609
  } else {
619
- t47 = $[130];
610
+ t46 = $[127];
620
611
  }
621
- let t48;
622
- if ($[131] !== dictationToolbar || $[132] !== draft.text || $[133] !== editorExtensions || $[134] !== files.onCopy || $[135] !== files.onPaste || $[136] !== focused || $[137] !== hold.setComposing || $[138] !== menus.inputAria || $[139] !== menus.trackTriggers || $[140] !== onKeyDown || $[141] !== placeholder || $[142] !== t45 || $[143] !== t46 || $[144] !== t47) {
623
- t48 = /*#__PURE__*/_jsx(ComposerInput, {
612
+ let t47;
613
+ if ($[128] !== dictationToolbar || $[129] !== draft.text || $[130] !== editorExtensions || $[131] !== files.onCopy || $[132] !== files.onPaste || $[133] !== focused || $[134] !== hold.setComposing || $[135] !== menus.inputAria || $[136] !== menus.trackTriggers || $[137] !== onKeyDown || $[138] !== placeholder || $[139] !== t44 || $[140] !== t45 || $[141] !== t46) {
614
+ t47 = /*#__PURE__*/_jsx(ComposerInput, {
624
615
  ref: inputRef,
625
616
  dictationToolbar: dictationToolbar,
626
617
  className: "composer-input select-text text-sm leading-normal text-text",
627
618
  value: draft.text,
628
619
  placeholder: placeholder,
629
- disabled: t45,
620
+ disabled: t44,
630
621
  tabbable: focused,
631
622
  extensions: editorExtensions,
632
623
  aria: menus.inputAria,
633
- onChange: t46,
624
+ onChange: t45,
634
625
  onSelectionChange: menus.trackTriggers,
635
- onBlur: t47,
626
+ onBlur: t46,
636
627
  onComposing: hold.setComposing,
637
628
  onKeyDown: onKeyDown,
638
629
  onPaste: files.onPaste,
639
630
  onCopy: files.onCopy
640
631
  });
641
- $[131] = dictationToolbar;
642
- $[132] = draft.text;
643
- $[133] = editorExtensions;
644
- $[134] = files.onCopy;
645
- $[135] = files.onPaste;
646
- $[136] = focused;
647
- $[137] = hold.setComposing;
648
- $[138] = menus.inputAria;
649
- $[139] = menus.trackTriggers;
650
- $[140] = onKeyDown;
651
- $[141] = placeholder;
652
- $[142] = t45;
653
- $[143] = t46;
654
- $[144] = t47;
655
- $[145] = t48;
656
- } else {
657
- t48 = $[145];
632
+ $[128] = dictationToolbar;
633
+ $[129] = draft.text;
634
+ $[130] = editorExtensions;
635
+ $[131] = files.onCopy;
636
+ $[132] = files.onPaste;
637
+ $[133] = focused;
638
+ $[134] = hold.setComposing;
639
+ $[135] = menus.inputAria;
640
+ $[136] = menus.trackTriggers;
641
+ $[137] = onKeyDown;
642
+ $[138] = placeholder;
643
+ $[139] = t44;
644
+ $[140] = t45;
645
+ $[141] = t46;
646
+ $[142] = t47;
647
+ } else {
648
+ t47 = $[142];
658
649
  }
659
- let t49;
660
- if ($[146] !== notice.notice || $[147] !== notice.tone) {
661
- t49 = notice.notice && /*#__PURE__*/_jsx("div", {
650
+ let t48;
651
+ if ($[143] !== notice.notice || $[144] !== notice.tone) {
652
+ t48 = notice.notice && /*#__PURE__*/_jsx("div", {
662
653
  className: clsx("px-5 pb-1 text-xs @max-md/composer:px-3.5", notice.tone === "error" ? "text-status-error" : "text-text-muted"),
663
654
  role: notice.tone === "error" ? "alert" : "status",
664
655
  children: notice.notice
665
656
  });
666
- $[146] = notice.notice;
667
- $[147] = notice.tone;
668
- $[148] = t49;
657
+ $[143] = notice.notice;
658
+ $[144] = notice.tone;
659
+ $[145] = t48;
669
660
  } else {
670
- t49 = $[148];
661
+ t48 = $[145];
671
662
  }
672
- const t50 = guard.visible && /*#__PURE__*/_jsxs("div", {
663
+ const t49 = guard.visible && /*#__PURE__*/_jsxs("div", {
673
664
  className: clsx("px-5 pb-1 text-right text-xs tabular-nums @max-md/composer:px-3.5", guard.tooLong ? "text-status-error" : "text-text-faint"),
674
665
  children: [formatNumber(guard.count), " / ", formatNumber(PROMPT_MAX_CHARS), guard.tooLong && ` ${t("composer.tooLong")}`]
675
666
  });
676
667
  const T1 = ComposerControls;
677
- const t51 = capabilities?.attachments !== false;
678
- const t52 = !busy || !empty;
679
- const t53 = empty || !writable || guard.tooLong;
680
- const t54 = t(sendLabelKey(busy, steerable, sendDelivery));
668
+ const t50 = capabilities?.attachments !== false;
669
+ const t51 = !busy || !empty;
670
+ const t52 = empty || !writable || guard.tooLong;
671
+ const t53 = t(sendLabelKey(busy, steerable, sendDelivery));
672
+ let t54;
673
+ if ($[146] !== draft.text || $[147] !== sendKey) {
674
+ t54 = sendShortcut(sendKey, draft.text.includes("\n"));
675
+ $[146] = draft.text;
676
+ $[147] = sendKey;
677
+ $[148] = t54;
678
+ } else {
679
+ t54 = $[148];
680
+ }
681
681
  let t55;
682
- if ($[149] !== draft.text || $[150] !== sendKey) {
683
- t55 = sendShortcut(sendKey, draft.text.includes("\n"));
684
- $[149] = draft.text;
685
- $[150] = sendKey;
686
- $[151] = t55;
682
+ if ($[149] !== submit) {
683
+ t55 = alternate => submit(alternate ? "alternate" : "default");
684
+ $[149] = submit;
685
+ $[150] = t55;
687
686
  } else {
688
- t55 = $[151];
687
+ t55 = $[150];
689
688
  }
690
- let t56;
691
- if ($[152] !== submit) {
692
- t56 = alternate => submit(alternate ? "alternate" : "default");
693
- $[152] = submit;
694
- $[153] = t56;
689
+ const t56 = continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0 ? continueTurn : null;
690
+ const t57 = scope.id;
691
+ let t58;
692
+ if ($[151] !== draft.quote || $[152] !== draft.text) {
693
+ t58 = withQuote(draft.quote, draft.text.trim());
694
+ $[151] = draft.quote;
695
+ $[152] = draft.text;
696
+ $[153] = t58;
695
697
  } else {
696
- t56 = $[153];
698
+ t58 = $[153];
697
699
  }
698
- const t57 = continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0 ? continueTurn : null;
699
- let t58;
700
- if ($[154] !== t52 || $[155] !== t53 || $[156] !== t54 || $[157] !== t55 || $[158] !== t56 || $[159] !== t57) {
701
- t58 = {
702
- visible: t52,
703
- disabled: t53,
704
- label: t54,
705
- kbd: t55,
706
- onSend: t56,
707
- onContinue: t57
700
+ let t59;
701
+ if ($[154] !== chatId || $[155] !== info.provider || $[156] !== info.runtimeMode || $[157] !== info.selection || $[158] !== scope.id || $[159] !== t58) {
702
+ t59 = {
703
+ scopeId: t57,
704
+ chatId,
705
+ text: t58,
706
+ provider: info.provider,
707
+ selection: info.selection,
708
+ runtimeMode: info.runtimeMode
708
709
  };
709
- $[154] = t52;
710
- $[155] = t53;
711
- $[156] = t54;
712
- $[157] = t55;
713
- $[158] = t56;
714
- $[159] = t57;
715
- $[160] = t58;
710
+ $[154] = chatId;
711
+ $[155] = info.provider;
712
+ $[156] = info.runtimeMode;
713
+ $[157] = info.selection;
714
+ $[158] = scope.id;
715
+ $[159] = t58;
716
+ $[160] = t59;
716
717
  } else {
717
- t58 = $[160];
718
+ t59 = $[160];
718
719
  }
719
- let t59;
720
- if ($[161] !== files) {
721
- t59 = picked => {
720
+ let t60;
721
+ if ($[161] !== sendActions || $[162] !== t51 || $[163] !== t52 || $[164] !== t53 || $[165] !== t54 || $[166] !== t55 || $[167] !== t56 || $[168] !== t59) {
722
+ t60 = {
723
+ visible: t51,
724
+ disabled: t52,
725
+ label: t53,
726
+ kbd: t54,
727
+ onSend: t55,
728
+ onContinue: t56,
729
+ actions: sendActions,
730
+ draft: t59
731
+ };
732
+ $[161] = sendActions;
733
+ $[162] = t51;
734
+ $[163] = t52;
735
+ $[164] = t53;
736
+ $[165] = t54;
737
+ $[166] = t55;
738
+ $[167] = t56;
739
+ $[168] = t59;
740
+ $[169] = t60;
741
+ } else {
742
+ t60 = $[169];
743
+ }
744
+ let t61;
745
+ if ($[170] !== files) {
746
+ t61 = picked => {
722
747
  files.addFiles(picked);
723
748
  inputRef.current?.focus();
724
749
  };
725
- $[161] = files;
726
- $[162] = t59;
750
+ $[170] = files;
751
+ $[171] = t61;
727
752
  } else {
728
- t59 = $[162];
753
+ t61 = $[171];
729
754
  }
730
- let t60;
731
- if ($[163] !== writable) {
732
- t60 = added => {
755
+ let t62;
756
+ if ($[172] !== writable) {
757
+ t62 = added => {
733
758
  if (writable) {
734
759
  inputRef.current?.insert(added);
735
760
  }
736
761
  };
737
- $[163] = writable;
738
- $[164] = t60;
762
+ $[172] = writable;
763
+ $[173] = t62;
739
764
  } else {
740
- t60 = $[164];
765
+ t62 = $[173];
741
766
  }
742
- let t61;
743
- if ($[165] !== T1 || $[166] !== chatId || $[167] !== controls || $[168] !== info || $[169] !== providerFixed || $[170] !== restoreStashed || $[171] !== setDictationToolbar || $[172] !== t51 || $[173] !== t58 || $[174] !== t59 || $[175] !== t60 || $[176] !== writable) {
744
- t61 = /*#__PURE__*/_jsx(T1, {
767
+ let t63;
768
+ if ($[174] !== T1 || $[175] !== chatId || $[176] !== controls || $[177] !== info || $[178] !== providerFixed || $[179] !== restoreStashed || $[180] !== setDictationToolbar || $[181] !== t50 || $[182] !== t60 || $[183] !== t61 || $[184] !== t62 || $[185] !== writable) {
769
+ t63 = /*#__PURE__*/_jsx(T1, {
745
770
  chatId: chatId,
746
771
  info: info,
747
772
  providerFixed: providerFixed,
748
773
  writable: writable,
749
- attachable: t51,
774
+ attachable: t50,
750
775
  controls: controls,
751
- send: t58,
776
+ send: t60,
752
777
  dictationToolbar: setDictationToolbar,
753
- onFiles: t59,
778
+ onFiles: t61,
754
779
  onRestore: restoreStashed,
755
- insert: t60
780
+ insert: t62
756
781
  });
757
- $[165] = T1;
758
- $[166] = chatId;
759
- $[167] = controls;
760
- $[168] = info;
761
- $[169] = providerFixed;
762
- $[170] = restoreStashed;
763
- $[171] = setDictationToolbar;
764
- $[172] = t51;
765
- $[173] = t58;
766
- $[174] = t59;
767
- $[175] = t60;
768
- $[176] = writable;
769
- $[177] = t61;
770
- } else {
771
- t61 = $[177];
782
+ $[174] = T1;
783
+ $[175] = chatId;
784
+ $[176] = controls;
785
+ $[177] = info;
786
+ $[178] = providerFixed;
787
+ $[179] = restoreStashed;
788
+ $[180] = setDictationToolbar;
789
+ $[181] = t50;
790
+ $[182] = t60;
791
+ $[183] = t61;
792
+ $[184] = t62;
793
+ $[185] = writable;
794
+ $[186] = t63;
795
+ } else {
796
+ t63 = $[186];
772
797
  }
773
- let t62;
774
- if ($[178] !== pointSurface || $[179] !== pressSurface || $[180] !== t36 || $[181] !== t37 || $[182] !== t39 || $[183] !== t40 || $[184] !== t41 || $[185] !== t42 || $[186] !== t43 || $[187] !== t44 || $[188] !== t48 || $[189] !== t49 || $[190] !== t50 || $[191] !== t61) {
775
- t62 = /*#__PURE__*/_jsxs("div", {
776
- className: t36,
798
+ let t64;
799
+ if ($[187] !== pointSurface || $[188] !== pressSurface || $[189] !== t35 || $[190] !== t36 || $[191] !== t38 || $[192] !== t39 || $[193] !== t40 || $[194] !== t41 || $[195] !== t42 || $[196] !== t43 || $[197] !== t47 || $[198] !== t48 || $[199] !== t49 || $[200] !== t63) {
800
+ t64 = /*#__PURE__*/_jsxs("div", {
801
+ className: t35,
777
802
  onPointerOver: pointSurface,
778
803
  onMouseDown: pressSurface,
779
- children: [t37, t39, t40, t41, t42, t43, t44, t48, t49, t50, t61]
804
+ children: [t36, t38, t39, t40, t41, t42, t43, t47, t48, t49, t63]
780
805
  });
781
- $[178] = pointSurface;
782
- $[179] = pressSurface;
783
- $[180] = t36;
784
- $[181] = t37;
785
- $[182] = t39;
786
- $[183] = t40;
787
- $[184] = t41;
788
- $[185] = t42;
789
- $[186] = t43;
790
- $[187] = t44;
791
- $[188] = t48;
792
- $[189] = t49;
793
- $[190] = t50;
794
- $[191] = t61;
795
- $[192] = t62;
796
- } else {
797
- t62 = $[192];
798
- }
799
- let t63;
800
- if ($[193] !== T0 || $[194] !== answerPromptsElsewhere || $[195] !== chatId || $[196] !== disabled || $[197] !== focused || $[198] !== hold || $[199] !== pending || $[200] !== t32 || $[201] !== t33 || $[202] !== t34 || $[203] !== t62) {
801
- t63 = /*#__PURE__*/_jsx(T0, {
806
+ $[187] = pointSurface;
807
+ $[188] = pressSurface;
808
+ $[189] = t35;
809
+ $[190] = t36;
810
+ $[191] = t38;
811
+ $[192] = t39;
812
+ $[193] = t40;
813
+ $[194] = t41;
814
+ $[195] = t42;
815
+ $[196] = t43;
816
+ $[197] = t47;
817
+ $[198] = t48;
818
+ $[199] = t49;
819
+ $[200] = t63;
820
+ $[201] = t64;
821
+ } else {
822
+ t64 = $[201];
823
+ }
824
+ let t65;
825
+ if ($[202] !== T0 || $[203] !== answerPromptsElsewhere || $[204] !== chatId || $[205] !== disabled || $[206] !== focused || $[207] !== hold || $[208] !== pending || $[209] !== t31 || $[210] !== t32 || $[211] !== t33 || $[212] !== t64) {
826
+ t65 = /*#__PURE__*/_jsx(T0, {
802
827
  chatId: chatId,
803
828
  pending: pending,
804
829
  focused: focused,
805
830
  onShowElsewhere: answerPromptsElsewhere,
806
831
  disabled: disabled,
807
- hasDraft: t32,
808
- denyReason: t33,
809
- onAllAnswered: t34,
832
+ hasDraft: t31,
833
+ denyReason: t32,
834
+ onAllAnswered: t33,
810
835
  hold: hold,
811
- children: t62
812
- });
813
- $[193] = T0;
814
- $[194] = answerPromptsElsewhere;
815
- $[195] = chatId;
816
- $[196] = disabled;
817
- $[197] = focused;
818
- $[198] = hold;
819
- $[199] = pending;
820
- $[200] = t32;
821
- $[201] = t33;
822
- $[202] = t34;
823
- $[203] = t62;
824
- $[204] = t63;
825
- } else {
826
- t63 = $[204];
827
- }
828
- let t64;
829
- if ($[205] !== files.dropTarget || $[206] !== t30 || $[207] !== t63) {
830
- t64 = /*#__PURE__*/_jsx("div", {
831
- className: t30,
832
- ...t31,
833
- children: t63
836
+ children: t64
834
837
  });
835
- $[205] = files.dropTarget;
836
- $[206] = t30;
837
- $[207] = t63;
838
- $[208] = t64;
839
- } else {
840
- t64 = $[208];
838
+ $[202] = T0;
839
+ $[203] = answerPromptsElsewhere;
840
+ $[204] = chatId;
841
+ $[205] = disabled;
842
+ $[206] = focused;
843
+ $[207] = hold;
844
+ $[208] = pending;
845
+ $[209] = t31;
846
+ $[210] = t32;
847
+ $[211] = t33;
848
+ $[212] = t64;
849
+ $[213] = t65;
850
+ } else {
851
+ t65 = $[213];
841
852
  }
842
- const t65 = controls.confirmClear;
843
853
  let t66;
844
- if ($[209] !== t) {
845
- t66 = t("composer.clear.title");
846
- $[209] = t;
847
- $[210] = t66;
848
- } else {
849
- t66 = $[210];
850
- }
851
- let t67;
852
- if ($[211] !== t) {
853
- t67 = t("composer.clear.description");
854
- $[211] = t;
855
- $[212] = t67;
854
+ if ($[214] !== files.dropTarget || $[215] !== t29 || $[216] !== t65) {
855
+ t66 = /*#__PURE__*/_jsx("div", {
856
+ className: t29,
857
+ ...t30,
858
+ children: t65
859
+ });
860
+ $[214] = files.dropTarget;
861
+ $[215] = t29;
862
+ $[216] = t65;
863
+ $[217] = t66;
856
864
  } else {
857
- t67 = $[212];
865
+ t66 = $[217];
858
866
  }
867
+ const t67 = controls.confirmClear;
859
868
  let t68;
860
- if ($[213] !== t) {
861
- t68 = t("composer.clear.confirm");
862
- $[213] = t;
863
- $[214] = t68;
869
+ if ($[218] !== t) {
870
+ t68 = t("composer.clear.title");
871
+ $[218] = t;
872
+ $[219] = t68;
864
873
  } else {
865
- t68 = $[214];
874
+ t68 = $[219];
866
875
  }
867
876
  let t69;
868
- if ($[215] !== t) {
869
- t69 = t("composer.notice.clearFailed");
870
- $[215] = t;
871
- $[216] = t69;
877
+ if ($[220] !== t) {
878
+ t69 = t("composer.clear.description");
879
+ $[220] = t;
880
+ $[221] = t69;
872
881
  } else {
873
- t69 = $[216];
882
+ t69 = $[221];
874
883
  }
875
884
  let t70;
876
- if ($[217] !== controls.cancelClear || $[218] !== controls.confirmClear || $[219] !== controls.forceClearThread || $[220] !== t66 || $[221] !== t67 || $[222] !== t68 || $[223] !== t69) {
877
- t70 = /*#__PURE__*/_jsx(PromptDialog, {
878
- open: t65,
879
- title: t66,
880
- description: t67,
881
- confirmLabel: t68,
885
+ if ($[222] !== t) {
886
+ t70 = t("composer.clear.confirm");
887
+ $[222] = t;
888
+ $[223] = t70;
889
+ } else {
890
+ t70 = $[223];
891
+ }
892
+ let t71;
893
+ if ($[224] !== t) {
894
+ t71 = t("composer.notice.clearFailed");
895
+ $[224] = t;
896
+ $[225] = t71;
897
+ } else {
898
+ t71 = $[225];
899
+ }
900
+ let t72;
901
+ if ($[226] !== controls.cancelClear || $[227] !== controls.confirmClear || $[228] !== controls.forceClearThread || $[229] !== t68 || $[230] !== t69 || $[231] !== t70 || $[232] !== t71) {
902
+ t72 = /*#__PURE__*/_jsx(PromptDialog, {
903
+ open: t67,
904
+ title: t68,
905
+ description: t69,
906
+ confirmLabel: t70,
882
907
  danger: true,
883
- fallbackMessage: t69,
908
+ fallbackMessage: t71,
884
909
  onConfirm: controls.forceClearThread,
885
910
  onOpenChange: controls.cancelClear
886
911
  });
887
- $[217] = controls.cancelClear;
888
- $[218] = controls.confirmClear;
889
- $[219] = controls.forceClearThread;
890
- $[220] = t66;
891
- $[221] = t67;
892
- $[222] = t68;
893
- $[223] = t69;
894
- $[224] = t70;
895
- } else {
896
- t70 = $[224];
897
- }
898
- let t71;
899
- if ($[225] !== t27 || $[226] !== t28 || $[227] !== t64 || $[228] !== t70) {
900
- t71 = /*#__PURE__*/_jsxs("div", {
901
- className: t26,
902
- children: [t27, t28, t64, t70]
912
+ $[226] = controls.cancelClear;
913
+ $[227] = controls.confirmClear;
914
+ $[228] = controls.forceClearThread;
915
+ $[229] = t68;
916
+ $[230] = t69;
917
+ $[231] = t70;
918
+ $[232] = t71;
919
+ $[233] = t72;
920
+ } else {
921
+ t72 = $[233];
922
+ }
923
+ let t73;
924
+ if ($[234] !== t26 || $[235] !== t27 || $[236] !== t66 || $[237] !== t72) {
925
+ t73 = /*#__PURE__*/_jsxs("div", {
926
+ className: t25,
927
+ children: [t26, t27, t66, t72]
903
928
  });
904
- $[225] = t27;
905
- $[226] = t28;
906
- $[227] = t64;
907
- $[228] = t70;
908
- $[229] = t71;
929
+ $[234] = t26;
930
+ $[235] = t27;
931
+ $[236] = t66;
932
+ $[237] = t72;
933
+ $[238] = t73;
909
934
  } else {
910
- t71 = $[229];
935
+ t73 = $[238];
911
936
  }
912
- return t71;
937
+ return t73;
913
938
  }
914
939
  function _temp4(event) {
915
940
  event.currentTarget.toggleAttribute("data-text-cursor", surfacePartOf(event.target, event.currentTarget) !== "action");