ghostykit 0.2.0 → 0.3.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.
@@ -4,6 +4,7 @@ import {
4
4
  TOOL_VERBS_EN,
5
5
  TOOL_VERBS_ES,
6
6
  appendAgentMessages,
7
+ applyHistory,
7
8
  beginSend,
8
9
  cleanReplyOption,
9
10
  createPilotState,
@@ -28,13 +29,13 @@ import {
28
29
  stopTurn,
29
30
  summarizeTools,
30
31
  toolName
31
- } from "../chunks/chunk-XWOGK2HN.js";
32
+ } from "../chunks/chunk-O6FCE4CS.js";
32
33
  import {
33
34
  PilotHttpError,
34
35
  createPostStreamTransport,
35
36
  createSseTransport,
36
37
  readSse
37
- } from "../chunks/chunk-KZOMMG2D.js";
38
+ } from "../chunks/chunk-D6JXJWYM.js";
38
39
  import {
39
40
  applyReferences,
40
41
  cleanUserText,
@@ -261,8 +262,25 @@ function createLucideIcon(iconDataOrName, iconNode = [], aliases = []) {
261
262
  return Component;
262
263
  }
263
264
 
264
- // ../../node_modules/lucide-react/dist/esm/icons/app-window.mjs
265
+ // ../../node_modules/lucide-react/dist/esm/icons/activity.mjs
265
266
  var __iconData = {
267
+ name: "activity",
268
+ size: 24,
269
+ node: [
270
+ [
271
+ "path",
272
+ {
273
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
274
+ key: "169zse"
275
+ }
276
+ ]
277
+ ]
278
+ };
279
+ __iconData.node;
280
+ var Activity = createLucideIcon(__iconData);
281
+
282
+ // ../../node_modules/lucide-react/dist/esm/icons/app-window.mjs
283
+ var __iconData2 = {
266
284
  name: "app-window",
267
285
  size: 24,
268
286
  node: [
@@ -272,11 +290,11 @@ var __iconData = {
272
290
  ["path", { d: "M6 4v4", key: "1svtjw" }]
273
291
  ]
274
292
  };
275
- __iconData.node;
276
- var AppWindow = createLucideIcon(__iconData);
293
+ __iconData2.node;
294
+ var AppWindow = createLucideIcon(__iconData2);
277
295
 
278
296
  // ../../node_modules/lucide-react/dist/esm/icons/arrow-down.mjs
279
- var __iconData2 = {
297
+ var __iconData3 = {
280
298
  name: "arrow-down",
281
299
  size: 24,
282
300
  node: [
@@ -284,11 +302,11 @@ var __iconData2 = {
284
302
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
285
303
  ]
286
304
  };
287
- __iconData2.node;
288
- var ArrowDown = createLucideIcon(__iconData2);
305
+ __iconData3.node;
306
+ var ArrowDown = createLucideIcon(__iconData3);
289
307
 
290
308
  // ../../node_modules/lucide-react/dist/esm/icons/arrow-up-right.mjs
291
- var __iconData3 = {
309
+ var __iconData4 = {
292
310
  name: "arrow-up-right",
293
311
  size: 24,
294
312
  node: [
@@ -296,11 +314,11 @@ var __iconData3 = {
296
314
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
297
315
  ]
298
316
  };
299
- __iconData3.node;
300
- var ArrowUpRight = createLucideIcon(__iconData3);
317
+ __iconData4.node;
318
+ var ArrowUpRight = createLucideIcon(__iconData4);
301
319
 
302
320
  // ../../node_modules/lucide-react/dist/esm/icons/arrow-up.mjs
303
- var __iconData4 = {
321
+ var __iconData5 = {
304
322
  name: "arrow-up",
305
323
  size: 24,
306
324
  node: [
@@ -308,20 +326,8 @@ var __iconData4 = {
308
326
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
309
327
  ]
310
328
  };
311
- __iconData4.node;
312
- var ArrowUp = createLucideIcon(__iconData4);
313
-
314
- // ../../node_modules/lucide-react/dist/esm/icons/at-sign.mjs
315
- var __iconData5 = {
316
- name: "at-sign",
317
- size: 24,
318
- node: [
319
- ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
320
- ["path", { d: "M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8", key: "7n84p3" }]
321
- ]
322
- };
323
329
  __iconData5.node;
324
- var AtSign = createLucideIcon(__iconData5);
330
+ var ArrowUp = createLucideIcon(__iconData5);
325
331
 
326
332
  // ../../node_modules/lucide-react/dist/esm/icons/book-open.mjs
327
333
  var __iconData6 = {
@@ -469,8 +475,23 @@ var __iconData16 = {
469
475
  __iconData16.node;
470
476
  var Cpu = createLucideIcon(__iconData16);
471
477
 
472
- // ../../node_modules/lucide-react/dist/esm/icons/external-link.mjs
478
+ // ../../node_modules/lucide-react/dist/esm/icons/crosshair.mjs
473
479
  var __iconData17 = {
480
+ name: "crosshair",
481
+ size: 24,
482
+ node: [
483
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
484
+ ["line", { x1: "22", x2: "18", y1: "12", y2: "12", key: "l9bcsi" }],
485
+ ["line", { x1: "6", x2: "2", y1: "12", y2: "12", key: "13hhkx" }],
486
+ ["line", { x1: "12", x2: "12", y1: "6", y2: "2", key: "10w3f3" }],
487
+ ["line", { x1: "12", x2: "12", y1: "22", y2: "18", key: "15g9kq" }]
488
+ ]
489
+ };
490
+ __iconData17.node;
491
+ var Crosshair = createLucideIcon(__iconData17);
492
+
493
+ // ../../node_modules/lucide-react/dist/esm/icons/external-link.mjs
494
+ var __iconData18 = {
474
495
  name: "external-link",
475
496
  size: 24,
476
497
  node: [
@@ -479,11 +500,11 @@ var __iconData17 = {
479
500
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
480
501
  ]
481
502
  };
482
- __iconData17.node;
483
- var ExternalLink = createLucideIcon(__iconData17);
503
+ __iconData18.node;
504
+ var ExternalLink = createLucideIcon(__iconData18);
484
505
 
485
506
  // ../../node_modules/lucide-react/dist/esm/icons/file-pen-line.mjs
486
- var __iconData18 = {
507
+ var __iconData19 = {
487
508
  name: "file-pen-line",
488
509
  size: 24,
489
510
  node: [
@@ -506,11 +527,11 @@ var __iconData18 = {
506
527
  ],
507
528
  aliases: ["file-signature"]
508
529
  };
509
- __iconData18.node;
510
- var FilePenLine = createLucideIcon(__iconData18);
530
+ __iconData19.node;
531
+ var FilePenLine = createLucideIcon(__iconData19);
511
532
 
512
533
  // ../../node_modules/lucide-react/dist/esm/icons/file-spreadsheet.mjs
513
- var __iconData19 = {
534
+ var __iconData20 = {
514
535
  name: "file-spreadsheet",
515
536
  size: 24,
516
537
  node: [
@@ -528,11 +549,11 @@ var __iconData19 = {
528
549
  ["path", { d: "M14 17h2", key: "10kma7" }]
529
550
  ]
530
551
  };
531
- __iconData19.node;
532
- var FileSpreadsheet = createLucideIcon(__iconData19);
552
+ __iconData20.node;
553
+ var FileSpreadsheet = createLucideIcon(__iconData20);
533
554
 
534
555
  // ../../node_modules/lucide-react/dist/esm/icons/file-text.mjs
535
- var __iconData20 = {
556
+ var __iconData21 = {
536
557
  name: "file-text",
537
558
  size: 24,
538
559
  node: [
@@ -549,11 +570,11 @@ var __iconData20 = {
549
570
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
550
571
  ]
551
572
  };
552
- __iconData20.node;
553
- var FileText = createLucideIcon(__iconData20);
573
+ __iconData21.node;
574
+ var FileText = createLucideIcon(__iconData21);
554
575
 
555
576
  // ../../node_modules/lucide-react/dist/esm/icons/folder.mjs
556
- var __iconData21 = {
577
+ var __iconData22 = {
557
578
  name: "folder",
558
579
  size: 24,
559
580
  node: [
@@ -566,11 +587,11 @@ var __iconData21 = {
566
587
  ]
567
588
  ]
568
589
  };
569
- __iconData21.node;
570
- var Folder = createLucideIcon(__iconData21);
590
+ __iconData22.node;
591
+ var Folder = createLucideIcon(__iconData22);
571
592
 
572
593
  // ../../node_modules/lucide-react/dist/esm/icons/gauge.mjs
573
- var __iconData22 = {
594
+ var __iconData23 = {
574
595
  name: "gauge",
575
596
  size: 24,
576
597
  node: [
@@ -578,11 +599,11 @@ var __iconData22 = {
578
599
  ["path", { d: "M3.34 19a10 10 0 1 1 17.32 0", key: "19p75a" }]
579
600
  ]
580
601
  };
581
- __iconData22.node;
582
- var Gauge = createLucideIcon(__iconData22);
602
+ __iconData23.node;
603
+ var Gauge = createLucideIcon(__iconData23);
583
604
 
584
605
  // ../../node_modules/lucide-react/dist/esm/icons/globe.mjs
585
- var __iconData23 = {
606
+ var __iconData24 = {
586
607
  name: "globe",
587
608
  size: 24,
588
609
  node: [
@@ -591,11 +612,11 @@ var __iconData23 = {
591
612
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
592
613
  ]
593
614
  };
594
- __iconData23.node;
595
- var Globe = createLucideIcon(__iconData23);
615
+ __iconData24.node;
616
+ var Globe = createLucideIcon(__iconData24);
596
617
 
597
618
  // ../../node_modules/lucide-react/dist/esm/icons/image.mjs
598
- var __iconData24 = {
619
+ var __iconData25 = {
599
620
  name: "image",
600
621
  size: 24,
601
622
  node: [
@@ -604,11 +625,29 @@ var __iconData24 = {
604
625
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
605
626
  ]
606
627
  };
607
- __iconData24.node;
608
- var Image = createLucideIcon(__iconData24);
628
+ __iconData25.node;
629
+ var Image = createLucideIcon(__iconData25);
630
+
631
+ // ../../node_modules/lucide-react/dist/esm/icons/inbox.mjs
632
+ var __iconData26 = {
633
+ name: "inbox",
634
+ size: 24,
635
+ node: [
636
+ ["polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12", key: "o97t9d" }],
637
+ [
638
+ "path",
639
+ {
640
+ d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",
641
+ key: "oot6mr"
642
+ }
643
+ ]
644
+ ]
645
+ };
646
+ __iconData26.node;
647
+ var Inbox = createLucideIcon(__iconData26);
609
648
 
610
649
  // ../../node_modules/lucide-react/dist/esm/icons/list-checks.mjs
611
- var __iconData25 = {
650
+ var __iconData27 = {
612
651
  name: "list-checks",
613
652
  size: 24,
614
653
  node: [
@@ -619,21 +658,21 @@ var __iconData25 = {
619
658
  ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
620
659
  ]
621
660
  };
622
- __iconData25.node;
623
- var ListChecks = createLucideIcon(__iconData25);
661
+ __iconData27.node;
662
+ var ListChecks = createLucideIcon(__iconData27);
624
663
 
625
664
  // ../../node_modules/lucide-react/dist/esm/icons/loader-circle.mjs
626
- var __iconData26 = {
665
+ var __iconData28 = {
627
666
  name: "loader-circle",
628
667
  size: 24,
629
668
  node: [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]],
630
669
  aliases: ["loader-2"]
631
670
  };
632
- __iconData26.node;
633
- var LoaderCircle = createLucideIcon(__iconData26);
671
+ __iconData28.node;
672
+ var LoaderCircle = createLucideIcon(__iconData28);
634
673
 
635
674
  // ../../node_modules/lucide-react/dist/esm/icons/mic.mjs
636
- var __iconData27 = {
675
+ var __iconData29 = {
637
676
  name: "mic",
638
677
  size: 24,
639
678
  node: [
@@ -642,11 +681,31 @@ var __iconData27 = {
642
681
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
643
682
  ]
644
683
  };
645
- __iconData27.node;
646
- var Mic = createLucideIcon(__iconData27);
684
+ __iconData29.node;
685
+ var Mic = createLucideIcon(__iconData29);
686
+
687
+ // ../../node_modules/lucide-react/dist/esm/icons/octagon-x.mjs
688
+ var __iconData30 = {
689
+ name: "octagon-x",
690
+ size: 24,
691
+ node: [
692
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
693
+ [
694
+ "path",
695
+ {
696
+ d: "M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",
697
+ key: "2d38gg"
698
+ }
699
+ ],
700
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
701
+ ],
702
+ aliases: ["x-octagon"]
703
+ };
704
+ __iconData30.node;
705
+ var OctagonX = createLucideIcon(__iconData30);
647
706
 
648
707
  // ../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs
649
- var __iconData28 = {
708
+ var __iconData31 = {
650
709
  name: "paperclip",
651
710
  size: 24,
652
711
  node: [
@@ -659,11 +718,11 @@ var __iconData28 = {
659
718
  ]
660
719
  ]
661
720
  };
662
- __iconData28.node;
663
- var Paperclip = createLucideIcon(__iconData28);
721
+ __iconData31.node;
722
+ var Paperclip = createLucideIcon(__iconData31);
664
723
 
665
724
  // ../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.mjs
666
- var __iconData29 = {
725
+ var __iconData32 = {
667
726
  name: "rotate-ccw",
668
727
  size: 24,
669
728
  node: [
@@ -671,11 +730,11 @@ var __iconData29 = {
671
730
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
672
731
  ]
673
732
  };
674
- __iconData29.node;
675
- var RotateCcw = createLucideIcon(__iconData29);
733
+ __iconData32.node;
734
+ var RotateCcw = createLucideIcon(__iconData32);
676
735
 
677
736
  // ../../node_modules/lucide-react/dist/esm/icons/search.mjs
678
- var __iconData30 = {
737
+ var __iconData33 = {
679
738
  name: "search",
680
739
  size: 24,
681
740
  node: [
@@ -683,11 +742,11 @@ var __iconData30 = {
683
742
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
684
743
  ]
685
744
  };
686
- __iconData30.node;
687
- var Search = createLucideIcon(__iconData30);
745
+ __iconData33.node;
746
+ var Search = createLucideIcon(__iconData33);
688
747
 
689
748
  // ../../node_modules/lucide-react/dist/esm/icons/send.mjs
690
- var __iconData31 = {
749
+ var __iconData34 = {
691
750
  name: "send",
692
751
  size: 24,
693
752
  node: [
@@ -701,11 +760,11 @@ var __iconData31 = {
701
760
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
702
761
  ]
703
762
  };
704
- __iconData31.node;
705
- var Send = createLucideIcon(__iconData31);
763
+ __iconData34.node;
764
+ var Send = createLucideIcon(__iconData34);
706
765
 
707
766
  // ../../node_modules/lucide-react/dist/esm/icons/shield-alert.mjs
708
- var __iconData32 = {
767
+ var __iconData35 = {
709
768
  name: "shield-alert",
710
769
  size: 24,
711
770
  node: [
@@ -720,34 +779,20 @@ var __iconData32 = {
720
779
  ["path", { d: "M12 16h.01", key: "1drbdi" }]
721
780
  ]
722
781
  };
723
- __iconData32.node;
724
- var ShieldAlert = createLucideIcon(__iconData32);
725
-
726
- // ../../node_modules/lucide-react/dist/esm/icons/square-terminal.mjs
727
- var __iconData33 = {
728
- name: "square-terminal",
729
- size: 24,
730
- node: [
731
- ["path", { d: "m7 11 2-2-2-2", key: "1lz0vl" }],
732
- ["path", { d: "M11 13h4", key: "1p7l4v" }],
733
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }]
734
- ],
735
- aliases: ["terminal-square"]
736
- };
737
- __iconData33.node;
738
- var SquareTerminal = createLucideIcon(__iconData33);
782
+ __iconData35.node;
783
+ var ShieldAlert = createLucideIcon(__iconData35);
739
784
 
740
785
  // ../../node_modules/lucide-react/dist/esm/icons/square.mjs
741
- var __iconData34 = {
786
+ var __iconData36 = {
742
787
  name: "square",
743
788
  size: 24,
744
789
  node: [["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]]
745
790
  };
746
- __iconData34.node;
747
- var Square = createLucideIcon(__iconData34);
791
+ __iconData36.node;
792
+ var Square = createLucideIcon(__iconData36);
748
793
 
749
794
  // ../../node_modules/lucide-react/dist/esm/icons/users-round.mjs
750
- var __iconData35 = {
795
+ var __iconData37 = {
751
796
  name: "users-round",
752
797
  size: 24,
753
798
  node: [
@@ -757,11 +802,11 @@ var __iconData35 = {
757
802
  ],
758
803
  aliases: ["users-2"]
759
804
  };
760
- __iconData35.node;
761
- var UsersRound = createLucideIcon(__iconData35);
805
+ __iconData37.node;
806
+ var UsersRound = createLucideIcon(__iconData37);
762
807
 
763
808
  // ../../node_modules/lucide-react/dist/esm/icons/x.mjs
764
- var __iconData36 = {
809
+ var __iconData38 = {
765
810
  name: "x",
766
811
  size: 24,
767
812
  node: [
@@ -769,8 +814,8 @@ var __iconData36 = {
769
814
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
770
815
  ]
771
816
  };
772
- __iconData36.node;
773
- var X = createLucideIcon(__iconData36);
817
+ __iconData38.node;
818
+ var X = createLucideIcon(__iconData38);
774
819
 
775
820
  // src/react/Piloto.tsx
776
821
  import {
@@ -1172,7 +1217,7 @@ function useChunkRegistry() {
1172
1217
  return useMemo2(() => /* @__PURE__ */ new Map(), []);
1173
1218
  }
1174
1219
  var UNTOUCHED = /* @__PURE__ */ new Set(["pre", "code", "svg", "math", "script", "style"]);
1175
- var STYLE = `piloto-chunk ${CHUNK_MS}ms linear both`;
1220
+ var STYLE = `gs-tramo ${CHUNK_MS}ms linear both`;
1176
1221
  function chunksPlugin(state) {
1177
1222
  return () => (tree) => {
1178
1223
  let total = 0;
@@ -1242,7 +1287,7 @@ var ChunkedBlock = memo(function ChunkedBlock2(props) {
1242
1287
  // src/react/Markdown.tsx
1243
1288
  import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1244
1289
  function LinkSafetyModal({ isOpen, onClose, onConfirm, url }) {
1245
- const { strings: t, theme, skin } = usePiloto();
1290
+ const { strings: t, skin } = usePiloto();
1246
1291
  const [copied, setCopied] = useState3(false);
1247
1292
  if (!isOpen) return null;
1248
1293
  const copy = async () => {
@@ -1255,37 +1300,37 @@ function LinkSafetyModal({ isOpen, onClose, onConfirm, url }) {
1255
1300
  window.open(url, "_blank", "noopener,noreferrer");
1256
1301
  onConfirm();
1257
1302
  };
1258
- return /* @__PURE__ */ jsx3("div", { ...rootProps(theme, skin), style: { display: "contents" }, children: /* @__PURE__ */ jsx3("div", { className: "piloto-overlay fixed inset-0 z-[1000] flex items-center justify-center bg-black/60 px-4", onClick: onClose, role: "presentation", children: /* @__PURE__ */ jsxs2(
1303
+ return /* @__PURE__ */ jsx3("div", { ...rootProps("dark", skin), style: { display: "contents" }, children: /* @__PURE__ */ jsx3("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4", onClick: onClose, role: "presentation", children: /* @__PURE__ */ jsxs2(
1259
1304
  "div",
1260
1305
  {
1261
- className: "piloto-dialog w-full max-w-md rounded-(--piloto-radius-card) border border-border-primary bg-background-primary p-6 text-text-primary shadow-(--piloto-shadow-card)",
1306
+ className: "w-full max-w-md rounded-2xl border border-border-primary bg-background-primary p-6 shadow-2xl",
1262
1307
  onClick: (e) => e.stopPropagation(),
1263
1308
  role: "dialog",
1264
1309
  "aria-modal": "true",
1265
1310
  "aria-label": t.linkTitle,
1266
1311
  children: [
1267
1312
  /* @__PURE__ */ jsxs2("div", { className: "flex items-start justify-between gap-4", children: [
1268
- /* @__PURE__ */ jsxs2("h2", { className: "flex items-center gap-2 text-base font-semibold", children: [
1313
+ /* @__PURE__ */ jsxs2("h2", { className: "flex items-center gap-2 text-base text-text-primary", children: [
1269
1314
  /* @__PURE__ */ jsx3(ExternalLink, { className: "h-4 w-4 text-text-secondary" }),
1270
1315
  t.linkTitle
1271
1316
  ] }),
1272
1317
  /* @__PURE__ */ jsx3("button", { type: "button", onClick: onClose, "aria-label": t.close, className: "text-text-secondary transition hover:text-text-primary", children: /* @__PURE__ */ jsx3(X, { className: "h-4 w-4" }) })
1273
1318
  ] }),
1274
- /* @__PURE__ */ jsx3("p", { className: "mt-4 break-all rounded-(--piloto-radius-input) border border-border-primary bg-background-secondary px-3 py-2.5 font-mono text-xs", children: url }),
1319
+ /* @__PURE__ */ jsx3("p", { className: "mt-4 break-all rounded-xl border border-border-primary bg-background-secondary px-3 py-2.5 font-mono text-xs text-text-primary", children: url }),
1275
1320
  /* @__PURE__ */ jsxs2("div", { className: "mt-5 flex gap-2", children: [
1276
1321
  /* @__PURE__ */ jsx3(
1277
1322
  "button",
1278
1323
  {
1279
1324
  type: "button",
1280
1325
  onClick: copy,
1281
- className: "flex flex-1 items-center justify-center gap-2 rounded-(--piloto-radius-button) border border-border-primary bg-background-secondary px-4 py-2 text-sm transition hover:border-text-tertiary",
1326
+ className: "flex flex-1 items-center justify-center gap-2 rounded-xl border border-border-primary bg-background-secondary px-4 py-2 text-sm text-text-primary transition hover:border-text-tertiary",
1282
1327
  children: copied ? /* @__PURE__ */ jsxs2(Fragment, { children: [
1283
1328
  /* @__PURE__ */ jsx3(Check, { className: "h-4 w-4 text-text-success" }),
1284
1329
  t.linkCopied
1285
1330
  ] }) : t.linkCopy
1286
1331
  }
1287
1332
  ),
1288
- /* @__PURE__ */ jsx3("button", { type: "button", onClick: open, className: "piloto-primary flex-1 rounded-(--piloto-radius-button) px-4 py-2 text-sm transition hover:opacity-90", children: t.linkOpen })
1333
+ /* @__PURE__ */ jsx3("button", { type: "button", onClick: open, className: "flex-1 rounded-xl bg-text-primary px-4 py-2 text-sm text-text-inverse transition hover:opacity-90", children: t.linkOpen })
1289
1334
  ] })
1290
1335
  ]
1291
1336
  }
@@ -1306,30 +1351,80 @@ function Markdown({ children, animate = false, className }) {
1306
1351
  } : void 0;
1307
1352
  return (
1308
1353
  // `min-w-0 break-words` y el scroll interno en pre/tablas: una URL larga no ensancha el chat.
1309
- /* @__PURE__ */ jsx3("div", { onClickCapture: onClick, className: `piloto-md min-w-0 max-w-full break-words ${className ?? ""}`, children: animate ? /* @__PURE__ */ jsx3(ChunksContext.Provider, { value: { registry, part: 0 }, children: /* @__PURE__ */ jsx3(Streamdown, { BlockComponent: ChunkedBlock, linkSafety, children: text }) }) : /* @__PURE__ */ jsx3(Streamdown, { linkSafety, children: text }) })
1354
+ /* @__PURE__ */ jsx3(
1355
+ "div",
1356
+ {
1357
+ onClickCapture: onClick,
1358
+ className: `ghosty-md min-w-0 max-w-full break-words ${className ?? "text-text-primary"} [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:block [&_table]:max-w-full [&_table]:overflow-x-auto`,
1359
+ children: animate ? /* @__PURE__ */ jsx3(ChunksContext.Provider, { value: { registry, part: 0 }, children: /* @__PURE__ */ jsx3(Streamdown, { BlockComponent: ChunkedBlock, linkSafety, children: text }) }) : /* @__PURE__ */ jsx3(Streamdown, { linkSafety, children: text })
1360
+ }
1361
+ )
1310
1362
  );
1311
1363
  }
1312
1364
 
1313
1365
  // src/react/Steps.tsx
1366
+ import { AnimatePresence, motion } from "motion/react";
1314
1367
  import { useState as useState4 } from "react";
1315
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1368
+
1369
+ // src/react/InlineMarkdown.tsx
1370
+ import { Fragment as Fragment2 } from "react";
1371
+ import { jsx as jsx4 } from "react/jsx-runtime";
1372
+ var TOKEN = /(`[^`\n]+`)|(\*\*[^*\n]+\*\*|__[^_\n]+__)|(\*[^*\s][^*\n]*\*|_[^_\s][^_\n]*_)|(\[[^\]\n]+\]\(https?:\/\/[^)\s]+\))/g;
1373
+ function renderInline(text) {
1374
+ const out = [];
1375
+ let last = 0;
1376
+ let k = 0;
1377
+ for (const m of text.matchAll(TOKEN)) {
1378
+ const at = m.index ?? 0;
1379
+ if (at > last) out.push(text.slice(last, at));
1380
+ const t = m[0];
1381
+ if (m[1]) out.push(/* @__PURE__ */ jsx4("code", { children: t.slice(1, -1) }, k++));
1382
+ else if (m[2]) out.push(/* @__PURE__ */ jsx4("strong", { children: renderInline(t.slice(2, -2)) }, k++));
1383
+ else if (m[3]) out.push(/* @__PURE__ */ jsx4("em", { children: renderInline(t.slice(1, -1)) }, k++));
1384
+ else {
1385
+ const [, label, href] = /^\[([^\]]+)\]\(([^)]+)\)$/.exec(t) ?? [];
1386
+ out.push(
1387
+ /* @__PURE__ */ jsx4("a", { href, target: "_blank", rel: "noopener noreferrer", children: label }, k++)
1388
+ );
1389
+ }
1390
+ last = at + t.length;
1391
+ }
1392
+ if (last < text.length) out.push(text.slice(last));
1393
+ return out;
1394
+ }
1395
+ function InlineMarkdown({ children }) {
1396
+ return /* @__PURE__ */ jsx4(Fragment2, { children: renderInline(children) });
1397
+ }
1398
+
1399
+ // src/react/Steps.tsx
1400
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
1316
1401
  function ClawIcon({ className }) {
1317
- return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", className: `piloto-claw ${className ?? ""}`, "aria-hidden": "true", children: /* @__PURE__ */ jsxs3("g", { className: "piloto-claw-rig", children: [
1318
- /* @__PURE__ */ jsx4("path", { d: "M12 2v4" }),
1319
- /* @__PURE__ */ jsx4("rect", { x: "8.5", y: "6", width: "7", height: "3.5", rx: "1" }),
1320
- /* @__PURE__ */ jsx4("g", { className: "piloto-claw-l", children: /* @__PURE__ */ jsx4("path", { d: "M9.5 9.5 6 14l2 4.5" }) }),
1321
- /* @__PURE__ */ jsx4("g", { className: "piloto-claw-r", children: /* @__PURE__ */ jsx4("path", { d: "M14.5 9.5 18 14l-2 4.5" }) }),
1322
- /* @__PURE__ */ jsx4("path", { d: "M12 9.5v4" })
1402
+ return /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", className: `gs-garra ${className ?? ""}`, "aria-hidden": "true", children: /* @__PURE__ */ jsxs3("g", { className: "gs-garra-rig", children: [
1403
+ /* @__PURE__ */ jsx5("path", { d: "M12 2v4" }),
1404
+ /* @__PURE__ */ jsx5("rect", { x: "8.5", y: "6", width: "7", height: "3.5", rx: "1" }),
1405
+ /* @__PURE__ */ jsx5("g", { className: "gs-garra-l", children: /* @__PURE__ */ jsx5("path", { d: "M9.5 9.5 6 14l2 4.5" }) }),
1406
+ /* @__PURE__ */ jsx5("g", { className: "gs-garra-r", children: /* @__PURE__ */ jsx5("path", { d: "M14.5 9.5 18 14l-2 4.5" }) }),
1407
+ /* @__PURE__ */ jsx5("path", { d: "M12 9.5v4" })
1323
1408
  ] }) });
1324
1409
  }
1410
+ function RobotArmIcon({ className }) {
1411
+ return /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 512 512", fill: "currentColor", className, "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M301.4 51.96c-46.6.1-85.3 18.16-105.2 50.84c-13.2 21.8-16.8 49.4-9.2 78q3 11.4 8.4 23.1q1.65-1.95 3.6-3.9c7.8-7.8 16.8-13.6 26.4-17.5c-1.5-3.8-2.7-7.4-3.6-10.9c-5.5-20.7-2.7-37 5.2-50.1c15.9-26.16 57.6-42.41 114.7-28.49l8.6-34.98c-16.9-4.11-33.3-6.09-48.9-6.07M454 161.7l-35 8.6c13.9 57.1-2.3 98.8-28.5 114.7c-13.1 7.9-29.4 10.7-50.1 5.2c-3.5-.9-7.1-2.1-10.7-3.5c-3.9 9.6-9.8 18.6-17.6 26.4c-1.3 1.3-2.5 2.5-3.9 3.6c7.8 3.5 15.4 6.3 23 8.3c28.6 7.6 56.2 4 78-9.2c43.6-26.5 61.3-86.6 44.8-154.1m-198.4 32.8c-15.9 0-31.8 6-43.9 18.2c-24.3 24.3-24.2 63.4 0 87.7c24.3 24.2 63.4 24.2 87.7 0c24.3-24.3 24.2-63.4 0-87.7c-12.1-12.2-28-18.2-43.8-18.2m0 21.1c10.5 0 21 4 28.9 11.9c16 15.9 16 42.1.1 58c-16 16-42.1 15.9-58 0s-16-42 0-58c7.9-8 18.5-11.9 29-11.9m0 17.9c-5.9 0-11.7 2.3-16.3 6.8c-9.1 9-9.1 23.4 0 32.5c9 9 23.5 9 32.5 0c9.1-9.1 9.1-23.5 0-32.5c-4.5-4.5-10.3-6.8-16.2-6.8m-80 25.1l-54.5 54.5l43.7 43.7l34.2 34.1l54.4-54.5c-19.8-.5-39.4-8.3-54.4-23.3c-15.1-15.1-22.9-34.7-23.4-54.5M63.41 313.2l8.11 40.6l86.68 86.7l40.6 8.1l-8.1-40.6l-86.7-86.6zM18.1 358.5l8.13 40.7l86.57 86.6l40.7 8.1l-8.1-40.6l-86.59-86.7zm-.1 57.9v64.8l32.45-32.4zm45.2 45.2L30.8 494h64.78z" }) });
1412
+ }
1413
+ function ArcadeIcon({ className }) {
1414
+ return /* @__PURE__ */ jsxs3("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.8, className, "aria-hidden": "true", children: [
1415
+ /* @__PURE__ */ jsx5("path", { d: "M11 8.5L9.8 9l-7.448 3.386a.6.6 0 0 0-.352.546v.136a.6.6 0 0 0 .352.546l8.82 4.01a2 2 0 0 0 1.656 0l8.82-4.01a.6.6 0 0 0 .352-.546v-.136a.6.6 0 0 0-.352-.546L14.2 9L13 8.5" }),
1416
+ /* @__PURE__ */ jsx5("path", { d: "M22 13v4.112a.6.6 0 0 1-.354.547l-8.825 3.972a2 2 0 0 1-1.642 0l-8.825-3.972A.6.6 0 0 1 2 17.112V13" }),
1417
+ /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8a3 3 0 1 1 0-6a3 3 0 0 1 0 6" }),
1418
+ /* @__PURE__ */ jsx5("path", { d: "M11 8v5a1 1 0 1 0 2 0V8" }),
1419
+ /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 13h1" })
1420
+ ] });
1421
+ }
1325
1422
  var DEFAULT_TOOL_ICONS = {
1326
1423
  tool_search: Search,
1327
- bash: SquareTerminal,
1328
- shell: SquareTerminal,
1329
- terminal: SquareTerminal,
1330
- execute: SquareTerminal,
1331
- code: SquareTerminal,
1332
- script: SquareTerminal,
1424
+ bash: RobotArmIcon,
1425
+ shell: RobotArmIcon,
1426
+ terminal: RobotArmIcon,
1427
+ execute: RobotArmIcon,
1333
1428
  read: FileText,
1334
1429
  read_file: FileText,
1335
1430
  write: FilePenLine,
@@ -1341,19 +1436,26 @@ var DEFAULT_TOOL_ICONS = {
1341
1436
  search: Search,
1342
1437
  web_search: Globe,
1343
1438
  web_fetch: Globe,
1344
- fetch: Globe,
1345
- browser: Globe,
1346
1439
  site_publish: Globe,
1347
1440
  pdf: FileText,
1441
+ connector: ArcadeIcon,
1442
+ fetch: Globe,
1443
+ browser: Globe,
1348
1444
  todo: ListChecks,
1349
1445
  list: ListChecks,
1446
+ code: RobotArmIcon,
1447
+ script: RobotArmIcon,
1350
1448
  folder: Folder,
1449
+ mcp: ArcadeIcon,
1351
1450
  image: Image,
1352
1451
  delegate: UsersRound,
1353
1452
  guide: BookOpen,
1354
1453
  deliver: Send,
1355
1454
  sheet: FileSpreadsheet,
1356
- view: AppWindow
1455
+ view: AppWindow,
1456
+ collect: Inbox,
1457
+ status: Activity,
1458
+ stop: OctagonX
1357
1459
  };
1358
1460
  function iconFor(t, icons) {
1359
1461
  const name = toolName(t);
@@ -1363,39 +1465,47 @@ var VISIBLE = 5;
1363
1465
  function AgentSteps({ tools, live }) {
1364
1466
  const { strings: t, toolVerbs } = usePiloto();
1365
1467
  const [open, setOpen] = useState4(false);
1366
- const label = (x) => stepLabel(x, toolVerbs, t.step);
1367
1468
  const failed = tools.filter((x) => x.status === "failed").length;
1368
- const groups = groupSteps(tools, label);
1469
+ const groups = groupSteps(tools, (x) => stepLabel(x, toolVerbs, t.step));
1369
1470
  const shown = groups.slice(-VISIBLE);
1370
1471
  const hidden = groups.length - shown.length;
1371
- return /* @__PURE__ */ jsxs3("div", { className: "piloto-steps mb-3 rounded-(--piloto-radius-card) px-3 py-2.5 transition-[background-color,border-color] duration-300", "data-live": live || void 0, children: [
1372
- /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, title: open ? t.stepsCollapse : t.stepsExpand, className: "block w-full cursor-pointer text-left", children: open ? /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1.5 text-xs font-medium text-text-primary", children: [
1373
- /* @__PURE__ */ jsx4(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 rotate-90 text-text-tertiary" }),
1374
- /* @__PURE__ */ jsxs3("span", { className: "truncate", children: [
1375
- summarizeTools(tools, toolVerbs),
1376
- failed > 0 && /* @__PURE__ */ jsxs3("span", { className: "text-text-danger", children: [
1377
- ", ",
1378
- t.withProblems(failed)
1379
- ] })
1380
- ] })
1381
- ] }) : /* @__PURE__ */ jsxs3("ul", { className: "flex flex-col gap-1.5", children: [
1382
- hidden > 0 && /* @__PURE__ */ jsx4("li", { className: "text-[11px] font-medium text-text-tertiary", children: t.earlierSteps(hidden) }),
1383
- shown.map((g) => /* @__PURE__ */ jsx4(StepLine, { tool: g.tool, times: g.times, live }, g.tool.id))
1384
- ] }) }),
1385
- open && /* @__PURE__ */ jsx4("ul", { className: "mt-2 flex flex-col gap-1", children: tools.map((x) => /* @__PURE__ */ jsx4(ToolRow, { tool: x }, x.id)) })
1386
- ] });
1472
+ return /* @__PURE__ */ jsxs3(
1473
+ "div",
1474
+ {
1475
+ className: `piloto-steps mb-3 rounded-2xl border px-3 py-2.5 transition-[background-color,border-color] duration-300 ${live ? "border-transparent bg-transparent" : "border-border-primary bg-background-primary hover:bg-background-secondary/60"}`,
1476
+ children: [
1477
+ /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, title: open ? t.stepsCollapse : t.stepsExpand, className: "block w-full cursor-pointer text-left", children: open ? /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1.5 text-xs font-medium text-text-primary", children: [
1478
+ /* @__PURE__ */ jsx5(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 rotate-90 text-text-tertiary" }),
1479
+ /* @__PURE__ */ jsxs3("span", { className: "truncate", children: [
1480
+ summarizeTools(tools, toolVerbs),
1481
+ failed > 0 && /* @__PURE__ */ jsxs3("span", { className: "text-text-danger", children: [
1482
+ " \xB7 ",
1483
+ t.withProblems(failed)
1484
+ ] })
1485
+ ] })
1486
+ ] }) : /* @__PURE__ */ jsxs3("ul", { className: "flex flex-col gap-1.5", children: [
1487
+ hidden > 0 && /* @__PURE__ */ jsx5("li", { className: "text-[11px] font-medium text-text-tertiary", children: t.earlierSteps(hidden) }),
1488
+ shown.map((g) => /* @__PURE__ */ jsx5(StepLine, { tool: g.tool, times: g.times, live }, g.tool.id))
1489
+ ] }) }),
1490
+ open && /* @__PURE__ */ jsx5("div", { className: "mt-2", children: /* @__PURE__ */ jsx5("ul", { className: "flex flex-col gap-1", children: tools.map((x) => /* @__PURE__ */ jsx5(ToolRow, { tool: x }, x.id)) }) })
1491
+ ]
1492
+ }
1493
+ );
1387
1494
  }
1388
1495
  function StepLine({ tool, times, live }) {
1389
1496
  const { strings: t, toolVerbs, toolIcons } = usePiloto();
1390
- const Icon2 = iconFor(tool, toolIcons);
1497
+ const KindIcon = iconFor(tool, toolIcons);
1391
1498
  const spins = isRunning(tool) && live;
1392
1499
  const label = stepLabel(tool, toolVerbs, t.step);
1393
- return /* @__PURE__ */ jsxs3("li", { className: "piloto-step flex min-w-0 items-center gap-2 text-[13px] leading-6 text-text-secondary", children: [
1394
- /* @__PURE__ */ jsx4("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center", "aria-label": spins ? t.running : tool.status === "failed" ? t.failed : t.done, children: spins ? /* @__PURE__ */ jsx4(LoaderCircle, { className: "h-4 w-4 animate-spin text-text-info" }) : tool.status === "failed" ? /* @__PURE__ */ jsx4(CircleX, { className: "h-4 w-4 text-text-danger" }) : /* @__PURE__ */ jsx4(CircleCheck, { className: "h-4 w-4 text-text-success" }) }),
1395
- /* @__PURE__ */ jsx4(Icon2, { className: "h-[22px] w-[22px] shrink-0 text-text-secondary" }),
1500
+ return /* @__PURE__ */ jsxs3("li", { className: "gs-paso-in flex min-w-0 items-center gap-2 text-[13px] leading-6 text-text-secondary", children: [
1501
+ /* @__PURE__ */ jsx5("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center", "aria-label": spins ? t.running : tool.status === "failed" ? t.failed : t.done, children: spins ? /* @__PURE__ */ jsx5(LoaderCircle, { className: "h-4 w-4 animate-spin text-text-info" }) : tool.status === "failed" ? /* @__PURE__ */ jsx5(CircleX, { className: "h-4 w-4 text-text-danger" }) : /* @__PURE__ */ jsx5(CircleCheck, { className: "h-4 w-4 text-text-success" }) }),
1502
+ /* @__PURE__ */ jsx5(KindIcon, { className: "h-[22px] w-[22px] shrink-0 text-text-secondary" }),
1396
1503
  /* @__PURE__ */ jsxs3("span", { className: "min-w-0 truncate", children: [
1397
- /* @__PURE__ */ jsx4("span", { className: spins ? "text-text-primary" : void 0, children: label }),
1398
- tool.detail && /* @__PURE__ */ jsx4("span", { className: "piloto-step-detail", children: tool.detail }),
1504
+ /* @__PURE__ */ jsx5("span", { className: spins ? "text-text-primary" : void 0, children: label }),
1505
+ tool.detail && /* @__PURE__ */ jsxs3("span", { className: "text-text-tertiary", children: [
1506
+ " \xB7 ",
1507
+ tool.detail
1508
+ ] }),
1399
1509
  times > 1 && /* @__PURE__ */ jsxs3("span", { className: "ml-1 tabular-nums text-text-tertiary", children: [
1400
1510
  "\xD7",
1401
1511
  times
@@ -1412,45 +1522,47 @@ var STATUS = {
1412
1522
  function ToolRow({ tool }) {
1413
1523
  const { strings: t, toolVerbs, toolIcons } = usePiloto();
1414
1524
  const s = STATUS[tool.status ?? "pending"] ?? STATUS.pending;
1525
+ const StatusIcon = s.Icon;
1415
1526
  const KindIcon = iconFor(tool, toolIcons);
1416
- return /* @__PURE__ */ jsxs3("li", { className: "piloto-tool-row flex items-start gap-2.5 rounded-(--piloto-radius-input) border border-border-secondary bg-background-secondary/50 px-3 py-2 transition-colors hover:border-border-primary hover:bg-background-secondary", children: [
1417
- /* @__PURE__ */ jsx4("span", { className: "mt-px flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background-primary text-text-secondary shadow-sm", children: /* @__PURE__ */ jsx4(KindIcon, { className: "h-3.5 w-3.5" }) }),
1527
+ return /* @__PURE__ */ jsxs3("li", { className: "flex items-start gap-2.5 rounded-lg border border-border-secondary bg-background-secondary/50 px-3 py-2 transition-colors hover:border-border-primary hover:bg-background-secondary", children: [
1528
+ /* @__PURE__ */ jsx5("span", { className: "mt-px flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background-primary text-text-secondary shadow-sm", children: /* @__PURE__ */ jsx5(KindIcon, { className: "h-3.5 w-3.5" }) }),
1418
1529
  /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
1419
- /* @__PURE__ */ jsx4("span", { className: "block min-w-0 truncate text-xs font-medium text-text-primary", children: stepLabel(tool, toolVerbs, tool.id) }),
1420
- tool.detail && /* @__PURE__ */ jsx4("span", { className: "mt-0.5 block truncate text-[11px] text-text-tertiary", children: tool.detail }),
1421
- tool.path && /* @__PURE__ */ jsx4("span", { className: "mt-0.5 block truncate font-mono text-[10px] text-text-tertiary", children: tool.path })
1530
+ /* @__PURE__ */ jsx5("span", { className: "flex items-baseline gap-2", children: /* @__PURE__ */ jsx5("span", { className: "min-w-0 truncate text-xs font-medium text-text-primary", children: stepLabel(tool, toolVerbs, tool.id) }) }),
1531
+ tool.detail && /* @__PURE__ */ jsx5("span", { className: "mt-0.5 block truncate text-[11px] text-text-tertiary", children: tool.detail }),
1532
+ tool.path && /* @__PURE__ */ jsx5("span", { className: "mt-0.5 block truncate font-mono text-[10px] text-text-tertiary", children: tool.path })
1422
1533
  ] }),
1423
- /* @__PURE__ */ jsx4("span", { className: "mt-0.5 shrink-0", title: t[s.key], "aria-label": t[s.key], children: /* @__PURE__ */ jsx4(s.Icon, { className: `h-3.5 w-3.5 ${s.className}` }) })
1534
+ /* @__PURE__ */ jsx5("span", { className: "mt-0.5 shrink-0", title: t[s.key], "aria-label": t[s.key], children: /* @__PURE__ */ jsx5(StatusIcon, { className: `h-3.5 w-3.5 ${s.className}` }) })
1424
1535
  ] });
1425
1536
  }
1426
- function Narration({ steps, children }) {
1427
- return /* @__PURE__ */ jsxs3("ul", { className: "piloto-narration mb-3 flex flex-col gap-1.5", children: [
1428
- steps.map((p, i) => /* @__PURE__ */ jsxs3("li", { className: "piloto-fade-up flex items-start gap-2 text-text-secondary", children: [
1429
- /* @__PURE__ */ jsx4("span", { className: "mt-[3px] grid size-4 shrink-0 place-items-center rounded-full bg-brand-500/15 text-brand-600", children: /* @__PURE__ */ jsx4(CheckMini, {}) }),
1430
- /* @__PURE__ */ jsx4("span", { className: "min-w-0", children: p })
1431
- ] }, i)),
1432
- children
1433
- ] });
1434
- }
1435
- function CheckMini() {
1436
- return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", width: "11", height: "11", fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx4("path", { d: "M20 6 9 17l-5-5" }) });
1537
+ function Narration({ steps }) {
1538
+ return /* @__PURE__ */ jsx5("ul", { className: "gs-narracion mb-3 flex flex-col gap-1.5", children: /* @__PURE__ */ jsx5(AnimatePresence, { initial: false, children: steps.map((p, i) => /* @__PURE__ */ jsxs3(
1539
+ motion.li,
1540
+ {
1541
+ initial: { opacity: 0, y: 4 },
1542
+ animate: { opacity: 1, y: 0 },
1543
+ transition: { duration: 0.25, ease: "easeOut" },
1544
+ className: "flex items-start gap-2 text-text-secondary",
1545
+ children: [
1546
+ /* @__PURE__ */ jsx5("span", { className: "mt-[3px] grid size-4 shrink-0 place-items-center rounded-full bg-brand-500/15 text-brand-500", children: /* @__PURE__ */ jsx5(Check, { size: 11, strokeWidth: 3 }) }),
1547
+ /* @__PURE__ */ jsx5("span", { className: "piloto-narration-text min-w-0", children: /* @__PURE__ */ jsx5(InlineMarkdown, { children: p }) })
1548
+ ]
1549
+ },
1550
+ i
1551
+ )) }) });
1437
1552
  }
1438
1553
 
1439
1554
  // src/react/Bubble.tsx
1440
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1441
- async function copyText(text) {
1442
- try {
1443
- await navigator.clipboard.writeText(text);
1444
- return true;
1445
- } catch {
1446
- return false;
1447
- }
1555
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
1556
+ function AnswerText({ text, live, whole = false }) {
1557
+ const { visible, animate } = useTextAtPace(text, live, whole);
1558
+ if (!visible) return null;
1559
+ return /* @__PURE__ */ jsx6("div", { className: "gs-prosa", children: /* @__PURE__ */ jsx6(Markdown, { animate, children: visible }) });
1448
1560
  }
1449
1561
  function UserBubble({ turn }) {
1450
1562
  const { strings: t, formatUserText } = usePiloto();
1451
1563
  const note = systemNoteOf(turn.text);
1452
1564
  if (note) {
1453
- return /* @__PURE__ */ jsx5("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs4("span", { className: "piloto-system-note max-w-[80%] truncate rounded-full bg-background-secondary px-3 py-1 text-[11px] text-text-tertiary", children: [
1565
+ return /* @__PURE__ */ jsx6("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs4("span", { className: "max-w-[80%] truncate rounded-full bg-background-secondary px-3 py-1 text-[11px] text-text-tertiary", children: [
1454
1566
  "\u23F0 ",
1455
1567
  note
1456
1568
  ] }) });
@@ -1459,66 +1571,73 @@ function UserBubble({ turn }) {
1459
1571
  const atts = turn.attachments ?? [];
1460
1572
  const inBubble = atts.filter((a) => a.mimeType.startsWith("image/") && (a.data || a.uri) || a.mimeType.startsWith("audio/") && a.uri);
1461
1573
  const docs = atts.filter((a) => !inBubble.includes(a));
1462
- return /* @__PURE__ */ jsxs4("div", { className: "piloto-user group/msg flex flex-col items-end gap-1", children: [
1574
+ return /* @__PURE__ */ jsxs4("div", { className: "group/msg flex flex-col items-end gap-1", children: [
1463
1575
  turn.steer && /* @__PURE__ */ jsxs4("span", { className: "text-[11px] text-text-tertiary", children: [
1464
1576
  "\u21AA ",
1465
1577
  t.steered
1466
1578
  ] }),
1467
- docs.length > 0 && /* @__PURE__ */ jsx5("div", { className: "mb-1 flex max-w-[75%] flex-wrap justify-end gap-2", children: docs.map((a, i) => /* @__PURE__ */ jsxs4("span", { className: "piloto-attachment-card inline-flex max-w-[16rem] items-center gap-1.5 rounded-(--piloto-radius-input) border border-border-primary bg-background-primary px-2.5 py-1.5 text-xs text-text-secondary", children: [
1468
- /* @__PURE__ */ jsx5(FileText, { className: "h-3.5 w-3.5 shrink-0" }),
1469
- a.uri ? /* @__PURE__ */ jsx5("a", { href: a.uri, target: "_blank", rel: "noopener noreferrer", className: "truncate hover:underline", children: a.name ?? a.mimeType }) : /* @__PURE__ */ jsx5("span", { className: "truncate", children: a.name ?? a.mimeType })
1470
- ] }, i)) }),
1471
- (inBubble.length > 0 || visible.trim()) && /* @__PURE__ */ jsxs4("div", { className: "piloto-bubble-user max-w-[75%] whitespace-pre-wrap break-words rounded-(--piloto-radius-bubble) px-4 py-3 text-[15px] leading-[22px]", children: [
1472
- inBubble.length > 0 && /* @__PURE__ */ jsx5("div", { className: `flex flex-wrap justify-end gap-1.5 ${visible.trim() ? "mb-2" : ""}`, children: inBubble.map(
1473
- (a, i) => a.mimeType.startsWith("image/") ? /* @__PURE__ */ jsx5("img", { src: a.data ? `data:${a.mimeType};base64,${a.data}` : a.uri, alt: "", className: "h-20 w-20 rounded-lg object-cover" }, i) : /* @__PURE__ */ jsx5("audio", { src: a.uri, controls: true, preload: "metadata", className: "h-9 max-w-[16rem]" }, i)
1579
+ docs.length > 0 && /* @__PURE__ */ jsx6("div", { className: "mb-1 flex max-w-[75%] flex-wrap justify-end gap-2", children: docs.map((a, i) => /* @__PURE__ */ jsxs4(
1580
+ "a",
1581
+ {
1582
+ href: a.uri,
1583
+ target: "_blank",
1584
+ rel: "noopener noreferrer",
1585
+ className: "inline-flex max-w-[16rem] items-center gap-1.5 rounded-lg border border-border-primary px-2 py-1 text-xs text-text-tertiary",
1586
+ children: [
1587
+ /* @__PURE__ */ jsx6("span", { "aria-hidden": true, children: "\u{1F4C4}" }),
1588
+ /* @__PURE__ */ jsx6("span", { className: "truncate", children: a.name ?? a.mimeType })
1589
+ ]
1590
+ },
1591
+ i
1592
+ )) }),
1593
+ (inBubble.length > 0 || visible.trim()) && /* @__PURE__ */ jsxs4("div", { className: "gc-msg-user max-w-[75%] whitespace-pre-wrap break-words rounded-(--piloto-radius-bubble) bg-(--piloto-user-bubble) px-4 py-3 font-sans text-base leading-[22px] text-(--piloto-user-text)", children: [
1594
+ inBubble.length > 0 && /* @__PURE__ */ jsx6("div", { className: `flex flex-wrap justify-end gap-1.5 ${visible.trim() ? "mb-2" : ""}`, children: inBubble.map(
1595
+ (a, i) => a.mimeType.startsWith("image/") ? /* @__PURE__ */ jsx6("img", { src: a.data ? `data:${a.mimeType};base64,${a.data}` : a.uri, alt: "", className: "h-20 w-20 rounded-lg object-cover" }, i) : /* @__PURE__ */ jsx6("audio", { src: a.uri, controls: true, preload: "metadata", className: "h-9 max-w-[16rem]" }, i)
1474
1596
  ) }),
1475
1597
  visible
1476
1598
  ] }),
1477
- visible.trim() && /* @__PURE__ */ jsx5(CopyUserMessage, { text: visible })
1599
+ visible.trim() && /* @__PURE__ */ jsx6(CopyUserMessage, { text: visible })
1478
1600
  ] });
1479
1601
  }
1480
1602
  function CopyUserMessage({ text }) {
1481
1603
  const { strings: t } = usePiloto();
1482
1604
  const [copied, setCopied] = useState5(false);
1483
- return /* @__PURE__ */ jsx5(
1605
+ return /* @__PURE__ */ jsx6(
1484
1606
  "button",
1485
1607
  {
1486
1608
  type: "button",
1487
1609
  onClick: async () => {
1488
- if (await copyText(text)) {
1610
+ try {
1611
+ await navigator.clipboard.writeText(text);
1489
1612
  setCopied(true);
1490
1613
  setTimeout(() => setCopied(false), 1500);
1614
+ } catch {
1491
1615
  }
1492
1616
  },
1493
1617
  "aria-label": copied ? t.copied : t.copyMessage,
1494
1618
  title: copied ? t.copied : t.copy,
1495
- className: `piloto-copy-user grid h-7 w-7 place-items-center rounded-md text-text-tertiary transition-opacity hover:bg-background-secondary hover:text-text-primary focus-visible:opacity-100 [@media(hover:none)]:opacity-100 ${copied ? "opacity-100" : "opacity-0 group-hover/msg:opacity-100"}`,
1496
- children: copied ? /* @__PURE__ */ jsx5(Check, { className: "h-3.5 w-3.5 text-text-success" }) : /* @__PURE__ */ jsx5(Copy, { className: "h-3.5 w-3.5" })
1619
+ className: `grid h-7 w-7 place-items-center rounded-md text-text-tertiary transition-opacity hover:bg-black/5 hover:text-text-primary focus-visible:opacity-100 [@media(hover:none)]:opacity-100 ${copied ? "opacity-100" : "opacity-0 group-hover/msg:opacity-100"}`,
1620
+ children: copied ? /* @__PURE__ */ jsx6(Check, { className: "h-3.5 w-3.5 text-text-success" }) : /* @__PURE__ */ jsx6(Copy, { className: "h-3.5 w-3.5" })
1497
1621
  }
1498
1622
  );
1499
1623
  }
1500
- function AnswerText({ text, live, whole = false }) {
1501
- const { visible, animate } = useTextAtPace(text, live, whole);
1502
- if (!visible) return null;
1503
- return /* @__PURE__ */ jsx5(Markdown, { animate, children: visible });
1504
- }
1505
1624
  function ReplyOptionButtons({ options, onPick }) {
1506
1625
  const { strings: t } = usePiloto();
1507
- return /* @__PURE__ */ jsx5("ul", { className: "piloto-options mt-3 flex flex-col gap-2", "aria-label": t.replyOptions, children: options.items.map((item, i) => {
1626
+ return /* @__PURE__ */ jsx6("ul", { className: "mt-3 flex flex-col gap-2", "aria-label": t.replyOptions, children: options.items.map((item, i) => {
1508
1627
  const clean = cleanReplyOption(item);
1509
- return /* @__PURE__ */ jsx5("li", { className: "piloto-chunk-in", children: /* @__PURE__ */ jsxs4(
1628
+ return /* @__PURE__ */ jsx6("li", { style: { animation: "gs-tramo 400ms linear both" }, children: /* @__PURE__ */ jsxs4(
1510
1629
  "button",
1511
1630
  {
1512
1631
  type: "button",
1513
1632
  onClick: () => onPick(clean),
1514
- className: "piloto-option group flex w-full cursor-pointer items-center gap-3 rounded-(--piloto-radius-input) border border-border-primary bg-background-primary px-4 py-2.5 text-left text-sm text-text-primary transition-colors hover:border-brand-300 hover:bg-background-secondary",
1633
+ className: "group flex w-full cursor-pointer items-center gap-3 rounded-xl border border-border-primary bg-background-primary px-4 py-2.5 text-left font-sans text-sm text-text-primary transition-colors hover:border-brand-300 hover:bg-background-secondary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-600",
1515
1634
  children: [
1516
1635
  options.numbered && /* @__PURE__ */ jsxs4("span", { className: "shrink-0 tabular-nums text-text-tertiary", children: [
1517
1636
  i + 1,
1518
1637
  "."
1519
1638
  ] }),
1520
- /* @__PURE__ */ jsx5("span", { className: "min-w-0 flex-1", children: clean }),
1521
- /* @__PURE__ */ jsx5(ArrowUpRight, { className: "h-4 w-4 shrink-0 text-text-tertiary transition-colors group-hover:text-text-primary" })
1639
+ /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1", children: clean }),
1640
+ /* @__PURE__ */ jsx6(ArrowUpRight, { className: "h-4 w-4 shrink-0 text-text-tertiary transition-colors group-hover:text-text-primary" })
1522
1641
  ]
1523
1642
  }
1524
1643
  ) }, i);
@@ -1528,42 +1647,44 @@ function UsageStats({ used, size, cost }) {
1528
1647
  const { strings: t } = usePiloto();
1529
1648
  if (!used && !cost) return null;
1530
1649
  const pct = size > 0 ? Math.min(100, Math.round(used / size * 100)) : 0;
1531
- return /* @__PURE__ */ jsxs4("div", { className: "piloto-usage mt-2 flex items-center gap-4 text-[11px] text-text-tertiary", children: [
1650
+ return /* @__PURE__ */ jsxs4("div", { className: "mt-2 flex items-center gap-4 text-[11px] text-text-tertiary", children: [
1532
1651
  /* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1", children: [
1533
- /* @__PURE__ */ jsx5(Gauge, { className: "h-3 w-3" }),
1652
+ /* @__PURE__ */ jsx6(Gauge, { className: "h-3 w-3" }),
1534
1653
  used.toLocaleString(t.numberLocale),
1535
1654
  size > 0 && ` / ${size.toLocaleString(t.numberLocale)} (${pct}%)`
1536
1655
  ] }),
1537
1656
  cost > 0 && /* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1", children: [
1538
- /* @__PURE__ */ jsx5(Coins, { className: "h-3 w-3" }),
1657
+ /* @__PURE__ */ jsx6(Coins, { className: "h-3 w-3" }),
1539
1658
  cost.toLocaleString(t.numberLocale, { style: "currency", currency: "USD", maximumFractionDigits: 4 })
1540
1659
  ] })
1541
1660
  ] });
1542
1661
  }
1543
- function TurnFooter({ text, seconds, onRetry, showCopy = true }) {
1662
+ function TurnFooter({ text, seconds, onRetry, showCopy = true, showDuration = true }) {
1544
1663
  const { strings: t } = usePiloto();
1545
1664
  const [copied, setCopied] = useState5(false);
1546
- return /* @__PURE__ */ jsxs4("div", { className: "piloto-footer mt-2 flex items-center gap-3 text-xs text-text-tertiary", children: [
1547
- seconds ? /* @__PURE__ */ jsx5("span", { children: t.worked(seconds) }) : null,
1665
+ return /* @__PURE__ */ jsxs4("div", { className: "mt-2 flex items-center gap-3 text-xs text-text-tertiary", children: [
1666
+ seconds && showDuration ? /* @__PURE__ */ jsx6("span", { children: t.worked(seconds) }) : null,
1548
1667
  showCopy && /* @__PURE__ */ jsxs4(
1549
1668
  "button",
1550
1669
  {
1551
1670
  type: "button",
1552
1671
  onClick: async () => {
1553
- if (await copyText(text)) {
1672
+ try {
1673
+ await navigator.clipboard.writeText(text);
1554
1674
  setCopied(true);
1555
1675
  setTimeout(() => setCopied(false), 1500);
1676
+ } catch {
1556
1677
  }
1557
1678
  },
1558
1679
  className: "flex items-center gap-1 transition-colors hover:text-text-primary",
1559
1680
  children: [
1560
- copied ? /* @__PURE__ */ jsx5(Check, { className: "h-3.5 w-3.5 text-text-success" }) : /* @__PURE__ */ jsx5(Copy, { className: "h-3.5 w-3.5" }),
1681
+ copied ? /* @__PURE__ */ jsx6(Check, { className: "h-3.5 w-3.5 text-text-success" }) : /* @__PURE__ */ jsx6(Copy, { className: "h-3.5 w-3.5" }),
1561
1682
  copied ? t.copied : t.copy
1562
1683
  ]
1563
1684
  }
1564
1685
  ),
1565
1686
  onRetry && /* @__PURE__ */ jsxs4("button", { type: "button", onClick: onRetry, className: "flex items-center gap-1 transition-colors hover:text-text-primary", children: [
1566
- /* @__PURE__ */ jsx5(RotateCcw, { className: "h-3.5 w-3.5" }),
1687
+ /* @__PURE__ */ jsx6(RotateCcw, { className: "h-3.5 w-3.5" }),
1567
1688
  t.retry
1568
1689
  ] })
1569
1690
  ] });
@@ -1571,84 +1692,97 @@ function TurnFooter({ text, seconds, onRetry, showCopy = true }) {
1571
1692
  function DeliveryChips({ deliveries }) {
1572
1693
  const shown = deliveries.filter((d) => !d.capture);
1573
1694
  if (!shown.length) return null;
1574
- return /* @__PURE__ */ jsx5("div", { className: "mt-2 flex flex-wrap gap-1.5", children: shown.map((d, i) => /* @__PURE__ */ jsxs4("span", { className: "piloto-delivery inline-flex max-w-[16rem] items-center gap-1.5 rounded-(--piloto-radius-input) border border-border-primary px-2 py-1 text-xs text-text-secondary", children: [
1575
- /* @__PURE__ */ jsx5(FileText, { className: "h-3.5 w-3.5 shrink-0" }),
1576
- /* @__PURE__ */ jsx5("span", { className: "truncate", children: d.name })
1695
+ return /* @__PURE__ */ jsx6("div", { className: "mt-2 flex flex-wrap gap-1.5", children: shown.map((d, i) => /* @__PURE__ */ jsxs4("span", { className: "inline-flex max-w-[16rem] items-center gap-1.5 rounded-lg border border-border-primary px-2 py-1 text-xs text-text-tertiary", children: [
1696
+ /* @__PURE__ */ jsx6("span", { "aria-hidden": true, children: "\u{1F4C4}" }),
1697
+ /* @__PURE__ */ jsx6("span", { className: "truncate", children: d.name })
1577
1698
  ] }, i)) });
1578
1699
  }
1579
- function AgentBubble({ turn, live, onRetry, onOption, showUsage = true, showCopy = true, renderDeliveries }) {
1700
+ function AgentBubble({ turn, live, onRetry, onOption, showUsage = true, showCopy = true, showDuration = true, renderDeliveries }) {
1580
1701
  const { strings: t } = usePiloto();
1581
1702
  const narrated = splitNarration(turn.text ?? "", turn.cuts);
1582
1703
  const visible = narrated.rest;
1583
1704
  const options = onOption && !live && visible ? extractReplyOptions(visible) : null;
1584
- return /* @__PURE__ */ jsxs4("div", { className: "piloto-agent min-w-0 max-w-[92%]", children: [
1585
- turn.thought && /* @__PURE__ */ jsxs4("details", { className: "piloto-thought mb-3 text-xs text-text-secondary", children: [
1586
- /* @__PURE__ */ jsx5("summary", { className: "cursor-pointer select-none", children: t.thinking }),
1587
- /* @__PURE__ */ jsx5("p", { className: "mt-2 whitespace-pre-wrap border-l-2 border-border-secondary pl-3", children: turn.thought })
1705
+ return /* @__PURE__ */ jsxs4("div", { className: "gc-msg-agent min-w-0 max-w-[90%]", children: [
1706
+ turn.thought && /* @__PURE__ */ jsxs4("details", { className: "mb-3 text-xs text-text-secondary", children: [
1707
+ /* @__PURE__ */ jsx6("summary", { className: "cursor-pointer select-none", children: t.thinking }),
1708
+ /* @__PURE__ */ jsx6("p", { className: "mt-2 whitespace-pre-wrap border-l-2 border-border-secondary pl-3", children: turn.thought })
1588
1709
  ] }),
1589
- turn.tools && turn.tools.length > 0 && /* @__PURE__ */ jsx5(AgentSteps, { tools: turn.tools, live }),
1590
- narrated.steps.length > 0 && /* @__PURE__ */ jsx5(Narration, { steps: narrated.steps }),
1591
- options ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
1592
- options.before && /* @__PURE__ */ jsx5(AnswerText, { text: options.before, live }),
1593
- /* @__PURE__ */ jsx5(ReplyOptionButtons, { options, onPick: onOption })
1710
+ turn.tools && turn.tools.length > 0 && /* @__PURE__ */ jsx6(AgentSteps, { tools: turn.tools, live }),
1711
+ narrated.steps.length > 0 && /* @__PURE__ */ jsx6(Narration, { steps: narrated.steps }),
1712
+ options ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
1713
+ options.before && /* @__PURE__ */ jsx6(AnswerText, { text: options.before, live }),
1714
+ /* @__PURE__ */ jsx6(ReplyOptionButtons, { options, onPick: onOption })
1594
1715
  ] }) : (
1595
- // Cada tramo nuevo tras una herramienta monta su propio ritmo (empieza de cero). Lo que llegó
1596
- // entero fuera de un turno se escribe al mismo ritmo; al recargar ya sale completo.
1597
- visible && /* @__PURE__ */ jsx5(AnswerText, { text: visible, live: live || !!turn.arrived, whole: !!turn.arrived }, `r${narrated.steps.length}`)
1716
+ // Cada tramo nuevo tras una herramienta monta su propio ritmo (empieza de cero).
1717
+ visible && /* @__PURE__ */ jsx6(AnswerText, { text: visible, live: live || !!turn.arrived, whole: !!turn.arrived }, `r${narrated.steps.length}`)
1598
1718
  ),
1599
- renderDeliveries ? renderDeliveries(turn, live) : turn.deliveries?.length ? /* @__PURE__ */ jsx5(DeliveryChips, { deliveries: turn.deliveries }) : null,
1600
- turn.decisions?.length ? /* @__PURE__ */ jsx5(DecisionLines, { decisions: turn.decisions }) : null,
1601
- showUsage && turn.usage && /* @__PURE__ */ jsx5(UsageStats, { ...turn.usage }),
1602
- turn.text && !live && /* @__PURE__ */ jsx5(TurnFooter, { text: turn.text, seconds: turn.seconds, onRetry, showCopy })
1719
+ renderDeliveries ? renderDeliveries(turn, live) : turn.deliveries?.length ? /* @__PURE__ */ jsx6(DeliveryChips, { deliveries: turn.deliveries }) : null,
1720
+ turn.decisions?.length ? /* @__PURE__ */ jsx6(DecisionLines, { decisions: turn.decisions }) : null,
1721
+ showUsage && turn.usage && /* @__PURE__ */ jsx6(UsageStats, { ...turn.usage }),
1722
+ turn.text && !live && /* @__PURE__ */ jsx6(TurnFooter, { text: turn.text, seconds: turn.seconds, onRetry, showCopy, showDuration })
1603
1723
  ] });
1604
1724
  }
1605
1725
 
1606
1726
  // src/react/Chips.tsx
1607
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1608
- function ReferenceChips({
1609
- references,
1610
- onRemove,
1611
- onActivate
1612
- }) {
1727
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1728
+ function ReferenceChips({ references, onRemove, onActivate }) {
1613
1729
  const { strings: t } = usePiloto();
1614
1730
  if (!references.length) return null;
1615
- return /* @__PURE__ */ jsx6("div", { className: "piloto-references flex flex-wrap gap-1.5", children: references.map((r) => /* @__PURE__ */ jsxs5("span", { className: "piloto-reference inline-flex max-w-full items-center gap-1.5 rounded-full border py-1 pl-2.5 pr-1 text-xs text-text-primary", children: [
1616
- /* @__PURE__ */ jsx6(AtSign, { className: "h-3 w-3 shrink-0 text-brand-600" }),
1617
- /* @__PURE__ */ jsx6("button", { type: "button", onClick: () => onActivate?.(r), className: "shrink-0 font-semibold underline-offset-2 hover:underline", children: r.label }),
1618
- r.hint && /* @__PURE__ */ jsxs5("span", { className: "truncate text-text-secondary", children: [
1619
- "\xAB",
1620
- r.hint,
1621
- "\xBB"
1622
- ] }),
1623
- /* @__PURE__ */ jsx6(
1624
- "button",
1625
- {
1626
- type: "button",
1627
- onClick: () => onRemove(r.id),
1628
- "aria-label": t.removeReference,
1629
- className: "grid size-5 shrink-0 cursor-pointer place-items-center rounded-full text-text-tertiary hover:bg-background-secondary hover:text-text-primary",
1630
- children: /* @__PURE__ */ jsx6(X, { className: "h-3 w-3" })
1631
- }
1632
- )
1633
- ] }, r.id)) });
1731
+ const pointed = references.filter((r) => r.prompt);
1732
+ const plain = references.filter((r) => !r.prompt);
1733
+ return /* @__PURE__ */ jsxs5(Fragment4, { children: [
1734
+ pointed.map((r) => /* @__PURE__ */ jsx7("div", { className: "mb-2 flex", children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-full border border-brand-500/40 bg-brand-500/10 py-1 pl-2.5 pr-1 text-xs text-text-primary", children: [
1735
+ /* @__PURE__ */ jsx7(Crosshair, { size: 13, className: "shrink-0 text-brand-500" }),
1736
+ /* @__PURE__ */ jsx7("span", { className: "shrink-0 font-semibold", children: r.label }),
1737
+ r.hint && /* @__PURE__ */ jsxs5("span", { className: "truncate text-text-secondary", children: [
1738
+ "\xAB",
1739
+ r.hint,
1740
+ "\xBB"
1741
+ ] }),
1742
+ /* @__PURE__ */ jsx7(
1743
+ "button",
1744
+ {
1745
+ type: "button",
1746
+ onClick: () => onRemove(r.id),
1747
+ "aria-label": t.removeReference,
1748
+ className: "grid size-5 shrink-0 cursor-pointer place-items-center rounded-full text-text-tertiary hover:bg-background-secondary hover:text-text-primary",
1749
+ children: /* @__PURE__ */ jsx7(X, { size: 12 })
1750
+ }
1751
+ )
1752
+ ] }) }, r.id)),
1753
+ plain.length > 0 && /* @__PURE__ */ jsx7("div", { className: "flex flex-wrap gap-1.5", children: plain.map((r) => /* @__PURE__ */ jsxs5("span", { className: "inline-flex items-center gap-1 rounded-full border border-border-primary bg-background-secondary py-0.5 pl-2 pr-1 text-xs text-text-primary", children: [
1754
+ /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => onActivate?.(r), className: "underline-offset-2 hover:underline", children: r.label }),
1755
+ /* @__PURE__ */ jsx7(
1756
+ "button",
1757
+ {
1758
+ type: "button",
1759
+ onClick: () => onRemove(r.id),
1760
+ "aria-label": t.removeReference,
1761
+ className: "flex h-4 w-4 items-center justify-center rounded-full text-text-tertiary hover:bg-background-tertiary hover:text-text-primary",
1762
+ children: /* @__PURE__ */ jsx7(X, { className: "h-3 w-3" })
1763
+ }
1764
+ )
1765
+ ] }, r.id)) })
1766
+ ] });
1634
1767
  }
1635
- function Suggestions({ items, onPick, onPrefill }) {
1768
+ function Suggestions({ items, onPick, onPrefill, disabled }) {
1636
1769
  if (!items.length) return null;
1637
- return /* @__PURE__ */ jsx6("div", { className: "piloto-suggestions mt-3 flex flex-wrap justify-center gap-2", children: items.map((s, i) => /* @__PURE__ */ jsx6(
1770
+ return /* @__PURE__ */ jsx7("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: items.map((c) => /* @__PURE__ */ jsx7(
1638
1771
  "button",
1639
1772
  {
1640
1773
  type: "button",
1641
- onClick: () => onPrefill && /:\s*$/.test(s) ? onPrefill(s) : onPick(s),
1642
- className: "piloto-suggestion rounded-full border border-border-primary bg-background-primary px-3.5 py-1.5 text-sm text-text-secondary transition-colors hover:border-brand-300 hover:text-text-primary",
1643
- children: s
1774
+ onClick: () => onPrefill && /:\s*$/.test(c) ? onPrefill(c) : onPick(c),
1775
+ disabled,
1776
+ className: "gc-chip rounded-full bg-irongray/10 px-3.5 py-1.5 text-xs font-medium text-metal transition-colors hover:bg-irongray/20 hover:text-dark disabled:opacity-40",
1777
+ children: c
1644
1778
  },
1645
- i
1779
+ c
1646
1780
  )) });
1647
1781
  }
1648
1782
 
1649
1783
  // src/react/Composer.tsx
1650
1784
  import { useCallback, useEffect as useEffect3, useRef as useRef3, useState as useState6 } from "react";
1651
- import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1785
+ import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1652
1786
  var MAX_HEIGHT = 240;
1653
1787
  var BY_EXTENSION = {
1654
1788
  png: "image/png",
@@ -1939,14 +2073,13 @@ function Composer({
1939
2073
  }
1940
2074
  };
1941
2075
  const canSend = Boolean(value.trim() || files.length > 0 || references.length > 0);
1942
- const iconButton = "flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-background-secondary hover:text-text-primary disabled:opacity-30";
1943
- return /* @__PURE__ */ jsx7("div", { className: "piloto-composer rounded-(--piloto-radius-input)", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2 p-3", children: [
1944
- withFiles && dragging && /* @__PURE__ */ jsx7("div", { className: "piloto-drop pointer-events-none fixed inset-0 z-[1000] flex items-center justify-center p-6", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-2 rounded-(--piloto-radius-card) border-2 border-dashed border-brand-500 bg-background-primary px-10 py-8 text-center shadow-(--piloto-shadow-card)", children: [
1945
- /* @__PURE__ */ jsx7(Paperclip, { className: "size-7 text-brand-600" }),
1946
- /* @__PURE__ */ jsx7("p", { className: "text-base font-semibold text-text-primary", children: t.dropFiles }),
1947
- /* @__PURE__ */ jsx7("p", { className: "text-xs text-text-secondary", children: t.dropHint })
2076
+ return /* @__PURE__ */ jsx8("div", { className: "gc-input rounded-(--piloto-radius-input) border-(length:--piloto-border-width) border-outlines bg-(--piloto-composer-bg) shadow-(--piloto-shadow-input) transition-colors focus-within:border-brand-300", children: /* @__PURE__ */ jsxs6("div", { className: `flex flex-col gap-2 p-3 transition-shadow ${withFiles && dragging ? "rounded-2xl bg-background-secondary/40 ring-2 ring-inset ring-ring-info" : ""}`, children: [
2077
+ withFiles && dragging && /* @__PURE__ */ jsx8("div", { className: "pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-background-primary/80 p-6 backdrop-blur-sm", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-2 rounded-3xl border-2 border-dashed border-brand-500 bg-background-primary px-10 py-8 text-center shadow-lg", children: [
2078
+ /* @__PURE__ */ jsx8(Paperclip, { className: "size-7 text-brand-500" }),
2079
+ /* @__PURE__ */ jsx8("p", { className: "text-base font-semibold text-text-primary", children: t.dropFiles }),
2080
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-text-secondary", children: t.dropHint })
1948
2081
  ] }) }),
1949
- /* @__PURE__ */ jsx7(
2082
+ /* @__PURE__ */ jsx8(
1950
2083
  "input",
1951
2084
  {
1952
2085
  ref: fileRef,
@@ -1959,36 +2092,36 @@ function Composer({
1959
2092
  }
1960
2093
  }
1961
2094
  ),
1962
- notice && /* @__PURE__ */ jsx7("p", { className: "text-xs text-text-danger", children: notice }),
2095
+ notice && /* @__PURE__ */ jsx8("p", { className: "text-xs text-text-danger", children: notice }),
1963
2096
  uploading && /* @__PURE__ */ jsxs6("p", { className: "flex items-center gap-1.5 text-xs text-text-secondary", children: [
1964
- /* @__PURE__ */ jsx7(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
2097
+ /* @__PURE__ */ jsx8(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
1965
2098
  files.length > 1 ? t.uploadingN(files.length) : t.uploading
1966
2099
  ] }),
1967
- files.length > 0 && /* @__PURE__ */ jsx7("div", { className: "flex flex-wrap gap-2", children: files.map((a) => /* @__PURE__ */ jsxs6("div", { className: "relative h-16 w-16 overflow-hidden rounded-lg border border-border-primary bg-background-secondary", children: [
1968
- mimeOf(a.file).startsWith("image/") ? /* @__PURE__ */ jsx7("img", { src: a.url, alt: a.file.name, className: "h-full w-full object-cover" }) : (
2100
+ withFiles && files.length > 0 && /* @__PURE__ */ jsx8("div", { className: "flex flex-wrap gap-2", children: files.map((a) => /* @__PURE__ */ jsxs6("div", { className: "relative h-16 w-16 overflow-hidden rounded-lg border border-border-primary bg-background-secondary", children: [
2101
+ mimeOf(a.file).startsWith("image/") ? /* @__PURE__ */ jsx8("img", { src: a.url, alt: a.file.name, className: "h-full w-full object-cover" }) : (
1969
2102
  // Un PDF pintado con <img> es un recuadro roto: nombre, extensión y peso.
1970
2103
  /* @__PURE__ */ jsxs6("span", { className: "flex h-full w-full flex-col items-center justify-center gap-1 px-1 text-center", title: a.file.name, children: [
1971
- /* @__PURE__ */ jsx7(FileText, { className: "h-4 w-4 shrink-0 text-text-tertiary" }),
1972
- /* @__PURE__ */ jsx7("span", { className: "w-full truncate text-[9px] font-medium uppercase leading-none text-text-secondary", children: a.file.name.match(/\.([A-Za-z0-9]+)$/)?.[1] ?? "file" }),
1973
- /* @__PURE__ */ jsx7("span", { className: "w-full truncate text-[9px] leading-none text-text-tertiary", children: shortSize(a.file.size) })
2104
+ /* @__PURE__ */ jsx8(FileText, { className: "h-4 w-4 shrink-0 text-text-tertiary" }),
2105
+ /* @__PURE__ */ jsx8("span", { className: "w-full truncate text-[9px] font-medium uppercase leading-none text-text-secondary", children: a.file.name.match(/\.([A-Za-z0-9]+)$/)?.[1] ?? "file" }),
2106
+ /* @__PURE__ */ jsx8("span", { className: "w-full truncate text-[9px] leading-none text-text-tertiary", children: shortSize(a.file.size) })
1974
2107
  ] })
1975
2108
  ),
1976
- /* @__PURE__ */ jsx7(
2109
+ /* @__PURE__ */ jsx8(
1977
2110
  "button",
1978
2111
  {
1979
2112
  type: "button",
1980
2113
  onClick: () => removeFile(a.id),
1981
2114
  "aria-label": t.removeAttachment,
1982
- className: "absolute right-0.5 top-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-background-inverse/80 text-text-inverse shadow-sm transition-colors hover:bg-background-inverse",
1983
- children: /* @__PURE__ */ jsx7(X, { className: "h-3 w-3" })
2115
+ className: "absolute top-0.5 right-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-background-inverse/80 text-text-inverse shadow-sm transition-colors hover:bg-background-inverse",
2116
+ children: /* @__PURE__ */ jsx8(X, { className: "h-3 w-3" })
1984
2117
  }
1985
2118
  )
1986
2119
  ] }, a.id)) }),
1987
- /* @__PURE__ */ jsx7(ReferenceChips, { references, onRemove: (id) => onRemoveReference?.(id), onActivate: onActivateReference }),
2120
+ /* @__PURE__ */ jsx8(ReferenceChips, { references, onRemove: (id) => onRemoveReference?.(id), onActivate: onActivateReference }),
1988
2121
  recording ? (
1989
2122
  // Grabando: la barra sustituye al campo de texto — punto rojo, reloj, la onda y las dos salidas.
1990
2123
  /* @__PURE__ */ jsxs6("div", { className: "flex min-h-[24px] items-center gap-3 px-1", children: [
1991
- /* @__PURE__ */ jsx7(
2124
+ /* @__PURE__ */ jsx8(
1992
2125
  "button",
1993
2126
  {
1994
2127
  type: "button",
@@ -1997,20 +2130,31 @@ function Composer({
1997
2130
  recRef.current?.stop();
1998
2131
  },
1999
2132
  "aria-label": t.cancelVoice,
2133
+ title: t.cancelVoice,
2000
2134
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-text-secondary hover:bg-background-secondary hover:text-text-primary",
2001
- children: /* @__PURE__ */ jsx7(X, { className: "h-4 w-4" })
2135
+ children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" })
2002
2136
  }
2003
2137
  ),
2004
- /* @__PURE__ */ jsx7("span", { className: "piloto-rec-dot h-2 w-2 shrink-0 rounded-full" }),
2138
+ /* @__PURE__ */ jsx8("span", { className: "h-2 w-2 shrink-0 animate-pulse rounded-full bg-red-500" }),
2005
2139
  /* @__PURE__ */ jsxs6("span", { className: "w-10 shrink-0 font-mono text-xs tabular-nums text-text-secondary", children: [
2006
2140
  Math.floor(seconds / 60),
2007
2141
  ":",
2008
2142
  String(seconds % 60).padStart(2, "0")
2009
2143
  ] }),
2010
- /* @__PURE__ */ jsx7("div", { className: "flex h-6 min-w-0 flex-1 items-center gap-[2px] overflow-hidden", children: Array.from({ length: 60 }, (_, i) => wave[wave.length - 60 + i] ?? 0).map((v, i) => /* @__PURE__ */ jsx7("span", { className: "w-[3px] shrink-0 rounded-full bg-text-secondary/70", style: { height: `${Math.max(3, Math.round(v * 22))}px` } }, i)) }),
2011
- /* @__PURE__ */ jsx7("button", { type: "button", onClick: toggleRecording, "aria-label": t.stopAndSendVoice, className: "piloto-send flex h-8 w-8 shrink-0 items-center justify-center rounded-full", children: /* @__PURE__ */ jsx7(ArrowUp, { className: "h-4 w-4" }) })
2144
+ /* @__PURE__ */ jsx8("div", { className: "flex h-6 min-w-0 flex-1 items-center gap-[2px] overflow-hidden", children: Array.from({ length: 60 }, (_, i) => wave[wave.length - 60 + i] ?? 0).map((v, i) => /* @__PURE__ */ jsx8("span", { className: "w-[3px] shrink-0 rounded-full bg-text-secondary/70", style: { height: `${Math.max(3, Math.round(v * 22))}px` } }, i)) }),
2145
+ /* @__PURE__ */ jsx8(
2146
+ "button",
2147
+ {
2148
+ type: "button",
2149
+ onClick: toggleRecording,
2150
+ "aria-label": t.stopAndSendVoice,
2151
+ title: t.send,
2152
+ className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-brand-500 text-white hover:bg-brand-600",
2153
+ children: /* @__PURE__ */ jsx8(ArrowUp, { className: "h-4 w-4" })
2154
+ }
2155
+ )
2012
2156
  ] })
2013
- ) : /* @__PURE__ */ jsx7(
2157
+ ) : /* @__PURE__ */ jsx8(
2014
2158
  "textarea",
2015
2159
  {
2016
2160
  ref,
@@ -2027,13 +2171,13 @@ function Composer({
2027
2171
  onRemoveReference?.(references[references.length - 1].id);
2028
2172
  }
2029
2173
  },
2030
- className: "piloto-textarea max-h-60 min-h-[24px] w-full flex-none resize-none overflow-y-auto bg-transparent px-1 text-sm leading-6 text-text-primary outline-none placeholder:text-text-tertiary"
2174
+ className: "max-h-60 min-h-[24px] w-full flex-none resize-none overflow-y-auto bg-transparent px-1 text-sm leading-6 text-text-primary outline-none placeholder:text-text-tertiary"
2031
2175
  }
2032
2176
  ),
2033
2177
  /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-2", children: [
2034
- /* @__PURE__ */ jsxs6("div", { className: "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden", children: [
2035
- withFiles && /* @__PURE__ */ jsxs6(Fragment3, { children: [
2036
- /* @__PURE__ */ jsx7(
2178
+ /* @__PURE__ */ jsxs6("div", { className: "@container flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden", children: [
2179
+ withFiles && /* @__PURE__ */ jsxs6(Fragment5, { children: [
2180
+ /* @__PURE__ */ jsx8(
2037
2181
  "button",
2038
2182
  {
2039
2183
  type: "button",
@@ -2045,11 +2189,12 @@ function Composer({
2045
2189
  disabled: busy || !canSeeImages || files.length >= maxFiles,
2046
2190
  "aria-label": canSeeImages ? t.attachImage : t.noImages,
2047
2191
  title: canSeeImages ? t.attachImage : t.noImages,
2048
- className: iconButton,
2049
- children: /* @__PURE__ */ jsx7(Image, { className: "h-4 w-4" })
2192
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-background-secondary hover:text-text-primary disabled:opacity-30",
2193
+ children: /* @__PURE__ */ jsx8(Image, { className: "h-4 w-4" })
2050
2194
  }
2051
2195
  ),
2052
- /* @__PURE__ */ jsx7(
2196
+ extras,
2197
+ /* @__PURE__ */ jsx8(
2053
2198
  "button",
2054
2199
  {
2055
2200
  type: "button",
@@ -2061,26 +2206,36 @@ function Composer({
2061
2206
  disabled: busy || files.length >= maxFiles,
2062
2207
  "aria-label": t.attachFile,
2063
2208
  title: t.attachFile,
2064
- className: iconButton,
2065
- children: /* @__PURE__ */ jsx7(Paperclip, { className: "h-4 w-4" })
2209
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-background-secondary hover:text-text-primary disabled:opacity-40",
2210
+ children: /* @__PURE__ */ jsx8(Paperclip, { className: "h-4 w-4" })
2066
2211
  }
2067
2212
  )
2068
2213
  ] }),
2069
- extras,
2070
- models.length > 0 && onModelChange && /* @__PURE__ */ jsx7(ModelPicker, { models, current: currentModel, onChange: onModelChange })
2214
+ !withFiles && extras,
2215
+ models.length > 0 && onModelChange && /* @__PURE__ */ jsx8(ModelPicker, { models, current: currentModel, onChange: onModelChange })
2071
2216
  ] }),
2072
2217
  /* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 items-center gap-1.5", children: [
2073
- canRecord && !recording && /* @__PURE__ */ jsx7("button", { type: "button", onClick: toggleRecording, disabled: busy || transcribing, "aria-label": t.recordVoice, title: t.voiceNote, className: `${iconButton} h-8 w-8`, children: transcribing ? /* @__PURE__ */ jsx7(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx7(Mic, { className: "h-4 w-4" }) }),
2074
- /* @__PURE__ */ jsx7(
2218
+ canRecord && !recording && /* @__PURE__ */ jsx8(
2219
+ "button",
2220
+ {
2221
+ type: "button",
2222
+ onClick: toggleRecording,
2223
+ disabled: busy || transcribing,
2224
+ "aria-label": t.recordVoice,
2225
+ title: t.voiceNote,
2226
+ className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-background-secondary hover:text-text-primary disabled:opacity-40",
2227
+ children: transcribing ? /* @__PURE__ */ jsx8("span", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx8(Mic, { className: "h-4 w-4" })
2228
+ }
2229
+ ),
2230
+ /* @__PURE__ */ jsx8(
2075
2231
  "button",
2076
2232
  {
2077
2233
  type: "button",
2078
2234
  onClick: busy ? onStop : () => void submit(),
2079
2235
  disabled: !busy && !canSend || uploading,
2080
2236
  "aria-label": busy ? t.stop : uploading ? t.uploading : t.send,
2081
- "data-ready": busy || canSend || uploading || void 0,
2082
- className: "piloto-send flex h-8 w-8 items-center justify-center rounded-full transition-colors",
2083
- children: busy ? /* @__PURE__ */ jsx7(Square, { className: "h-3 w-3 fill-current" }) : uploading ? /* @__PURE__ */ jsx7(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx7(ArrowUp, { className: "h-4 w-4" })
2237
+ className: `gc-send flex h-8 w-8 items-center justify-center rounded-full transition-colors ${busy || canSend || uploading ? "bg-brand-500 text-white hover:bg-brand-600" : "bg-background-disabled text-text-disabled"}`,
2238
+ children: busy ? /* @__PURE__ */ jsx8(Square, { className: "h-3 w-3 fill-current" }) : uploading ? /* @__PURE__ */ jsx8(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx8(ArrowUp, { className: "h-4 w-4" })
2084
2239
  }
2085
2240
  )
2086
2241
  ] })
@@ -2104,7 +2259,7 @@ function ModelPicker({ models, current, onChange }) {
2104
2259
  document.removeEventListener("keydown", escape);
2105
2260
  };
2106
2261
  }, [open]);
2107
- if (!models.length) return null;
2262
+ if (models.length === 0) return null;
2108
2263
  const active = models.find((m) => m.value === current) ?? null;
2109
2264
  return /* @__PURE__ */ jsxs6("div", { ref: box, className: "relative", children: [
2110
2265
  /* @__PURE__ */ jsxs6(
@@ -2113,15 +2268,16 @@ function ModelPicker({ models, current, onChange }) {
2113
2268
  type: "button",
2114
2269
  "aria-expanded": open,
2115
2270
  onClick: () => setOpen((v) => !v),
2116
- className: "flex max-w-56 items-center gap-1.5 rounded-full border border-border-primary px-2.5 py-1 text-xs text-text-secondary transition-colors hover:bg-background-secondary hover:text-text-primary",
2271
+ className: "flex max-w-56 items-center gap-1.5 rounded-full border border-border-primary px-2.5 py-1 text-xs text-text-secondary transition-colors outline-none hover:bg-background-secondary hover:text-text-primary",
2117
2272
  children: [
2118
- /* @__PURE__ */ jsx7(Cpu, { className: "h-3.5 w-3.5 shrink-0" }),
2119
- /* @__PURE__ */ jsx7("span", { className: "truncate", children: active?.name ?? t.model }),
2120
- /* @__PURE__ */ jsx7(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 opacity-70" })
2273
+ /* @__PURE__ */ jsx8(Cpu, { className: "h-3.5 w-3.5 shrink-0" }),
2274
+ /* @__PURE__ */ jsx8("span", { className: "truncate", children: active?.name ?? t.model }),
2275
+ /* @__PURE__ */ jsx8(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 opacity-70" })
2121
2276
  ]
2122
2277
  }
2123
2278
  ),
2124
- open && /* @__PURE__ */ jsx7("div", { className: "piloto-menu absolute bottom-full left-0 z-20 mb-1 max-h-80 min-w-52 overflow-y-auto rounded-(--piloto-radius-input) border border-border-primary bg-background-primary py-1 shadow-(--piloto-shadow-card)", children: models.map((m) => /* @__PURE__ */ jsxs6(
2279
+ open && // Hacia ARRIBA: el selector vive pegado al borde inferior del input.
2280
+ /* @__PURE__ */ jsx8("div", { className: "absolute bottom-full left-0 z-20 mb-1 max-h-80 min-w-52 overflow-y-auto rounded-xl border border-border-primary bg-background-primary py-1 shadow-lg", children: models.map((m) => /* @__PURE__ */ jsxs6(
2125
2281
  "button",
2126
2282
  {
2127
2283
  type: "button",
@@ -2131,8 +2287,8 @@ function ModelPicker({ models, current, onChange }) {
2131
2287
  },
2132
2288
  className: "flex w-full items-center justify-between gap-3 px-3 py-1.5 text-left text-xs text-text-secondary transition-colors hover:bg-background-secondary hover:text-text-primary",
2133
2289
  children: [
2134
- /* @__PURE__ */ jsx7("span", { className: "truncate", children: m.name }),
2135
- m.value === current && /* @__PURE__ */ jsx7(Check, { className: "h-3.5 w-3.5 shrink-0 text-text-success" })
2290
+ /* @__PURE__ */ jsx8("span", { className: "truncate", children: m.name }),
2291
+ m.value === current && /* @__PURE__ */ jsx8(Check, { className: "h-3.5 w-3.5 shrink-0 text-text-success" })
2136
2292
  ]
2137
2293
  },
2138
2294
  m.value
@@ -2141,13 +2297,13 @@ function ModelPicker({ models, current, onChange }) {
2141
2297
  }
2142
2298
 
2143
2299
  // src/react/Status.tsx
2144
- import { AnimatePresence, motion } from "motion/react";
2300
+ import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
2145
2301
  import { useEffect as useEffect4, useState as useState7 } from "react";
2146
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2302
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2147
2303
  var WAKING_GIVEUP_S = 45;
2148
2304
  var STILL_WORKING_S = 90;
2149
2305
  function TypingDots() {
2150
- return /* @__PURE__ */ jsx8("div", { className: "piloto-typing", "aria-hidden": true, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx8("span", { className: "piloto-typing-dot" }, i)) });
2306
+ return /* @__PURE__ */ jsx9("div", { className: "gc-typing flex gap-1", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx9("span", { className: "gc-typing-dot h-2 w-2 animate-bounce rounded-full", style: { "--i": i } }, i)) });
2151
2307
  }
2152
2308
  function WaitLabel({
2153
2309
  phase,
@@ -2165,20 +2321,31 @@ function WaitLabel({
2165
2321
  }, []);
2166
2322
  const seconds = Math.max(0, Math.floor((now - (since || mounted)) / 1e3));
2167
2323
  const phrases = t.thinkingPhrases;
2168
- const what = phase !== "session" ? t.waitPhase[phase] : phrases?.length ? (
2169
- // Frases propias de la app (el widget de un cliente): rotan cada 4 s.
2170
- elsewhere || seconds >= STILL_WORKING_S ? t.stillWorking : phrases[Math.floor(seconds / 4) % phrases.length]
2171
- ) : elsewhere ? t.stillWorking : t.howItGoes(seconds);
2324
+ const what = phase !== "session" ? t.waitPhase[phase] : phrases?.length ? elsewhere || seconds >= STILL_WORKING_S ? t.stillWorking : phrases[Math.floor(seconds / 4) % phrases.length] : elsewhere ? t.stillWorking : t.howItGoes(seconds);
2172
2325
  const lost = phase === "waking" && seconds >= WAKING_GIVEUP_S;
2173
- return /* @__PURE__ */ jsx8("div", { className: "piloto-wait flex flex-col gap-0.5 text-sm text-text-secondary", children: lost ? /* @__PURE__ */ jsxs7("p", { className: "text-text-primary", children: [
2326
+ return /* @__PURE__ */ jsx9("div", { className: "flex flex-col gap-0.5 text-sm text-text-secondary", children: lost ? /* @__PURE__ */ jsxs7("p", { className: "text-text-primary", children: [
2174
2327
  t.cantStart,
2175
2328
  " ",
2176
- /* @__PURE__ */ jsx8("button", { type: "button", onClick: onLost, className: "cursor-pointer underline underline-offset-2", children: t.retry })
2329
+ /* @__PURE__ */ jsx9("button", { type: "button", onClick: onLost, className: "cursor-pointer underline underline-offset-2", children: t.retry })
2177
2330
  ] }) : (
2178
- // La frase cambia con fundido (sale y entra): de golpe se leía brusco.
2331
+ // La frase cambia con fundido (sale y entra), como en claude.ai.
2179
2332
  /* @__PURE__ */ jsxs7("p", { className: "flex items-center", children: [
2180
- /* @__PURE__ */ jsx8(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx8(motion.span, { className: "piloto-wait-text", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3, ease: "easeInOut" }, children: what }, what) }),
2181
- showDuration && /* @__PURE__ */ jsx8("span", { className: "piloto-wait-time", children: formatDuration(seconds) })
2333
+ /* @__PURE__ */ jsx9(AnimatePresence2, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx9(
2334
+ motion2.span,
2335
+ {
2336
+ className: "gc-wait-text",
2337
+ initial: { opacity: 0 },
2338
+ animate: { opacity: 1 },
2339
+ exit: { opacity: 0 },
2340
+ transition: { duration: 0.3, ease: "easeInOut" },
2341
+ children: what
2342
+ },
2343
+ what
2344
+ ) }),
2345
+ showDuration && /* @__PURE__ */ jsxs7("span", { className: "tabular-nums text-text-tertiary", children: [
2346
+ "\xA0\xB7 ",
2347
+ formatDuration(seconds)
2348
+ ] })
2182
2349
  ] })
2183
2350
  ) });
2184
2351
  }
@@ -2186,48 +2353,74 @@ var PHASES = ["waking", "connecting", "session"];
2186
2353
  function ConnectingState({ phase, error, avatar, onRetry }) {
2187
2354
  const { strings: t } = usePiloto();
2188
2355
  const current = PHASES.indexOf(phase);
2189
- return /* @__PURE__ */ jsxs7(motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 }, className: "piloto-connecting flex min-h-[40vh] flex-col items-center justify-center gap-8 text-center", children: [
2190
- /* @__PURE__ */ jsxs7("div", { className: "relative flex h-20 w-20 items-center justify-center", children: [
2191
- !error && [0, 1].map((i) => /* @__PURE__ */ jsx8(
2192
- motion.span,
2193
- {
2194
- className: "absolute inset-0 rounded-full border border-border-primary",
2195
- initial: { scale: 0.6, opacity: 0.8 },
2196
- animate: { scale: 1.6, opacity: 0 },
2197
- transition: { duration: 2.2, repeat: Infinity, ease: "easeOut", delay: i * 1.1 }
2198
- },
2199
- i
2200
- )),
2201
- /* @__PURE__ */ jsx8(
2202
- motion.div,
2203
- {
2204
- className: "grid h-12 w-12 place-items-center",
2205
- animate: error ? { scale: 1, filter: "grayscale(1)" } : { scale: [1, 1.06, 1] },
2206
- transition: error ? { duration: 0.3 } : { duration: 2.2, repeat: Infinity, ease: "easeInOut" },
2207
- children: avatar ?? /* @__PURE__ */ jsx8("span", { className: "piloto-avatar-default" })
2208
- }
2209
- )
2210
- ] }),
2211
- /* @__PURE__ */ jsx8("ol", { className: "flex flex-col gap-3 text-left", children: t.connectSteps.map((step, i) => {
2212
- const done = !error && i < current;
2213
- const active = !error && i === current;
2214
- const failed = !!error && i === current;
2215
- return /* @__PURE__ */ jsxs7("li", { className: "flex items-center gap-3", children: [
2216
- /* @__PURE__ */ jsx8("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: done ? /* @__PURE__ */ jsx8("span", { className: "piloto-pop flex h-5 w-5 items-center justify-center rounded-full bg-background-success", children: /* @__PURE__ */ jsx8(Check, { className: "h-3 w-3 text-text-inverse", strokeWidth: 3 }) }) : active ? /* @__PURE__ */ jsx8("span", { className: "piloto-pulse h-2.5 w-2.5 rounded-full bg-text-primary" }) : failed ? /* @__PURE__ */ jsx8("span", { className: "h-2.5 w-2.5 rounded-full bg-text-danger" }) : /* @__PURE__ */ jsx8("span", { className: "h-2 w-2 rounded-full bg-border-primary" }) }),
2217
- /* @__PURE__ */ jsxs7("div", { className: "leading-tight", children: [
2218
- /* @__PURE__ */ jsxs7("p", { className: `text-sm ${active || failed ? "text-text-primary" : done ? "text-text-secondary" : "text-text-tertiary"}`, children: [
2219
- step.label,
2220
- active && /* @__PURE__ */ jsx8("span", { className: "piloto-ellipsis inline-block w-4 text-left", children: "\u2026" })
2221
- ] }),
2222
- active && /* @__PURE__ */ jsx8("p", { className: "text-xs text-text-tertiary", children: step.hint })
2356
+ return /* @__PURE__ */ jsxs7(
2357
+ motion2.div,
2358
+ {
2359
+ initial: { opacity: 0, y: 8 },
2360
+ animate: { opacity: 1, y: 0 },
2361
+ exit: { opacity: 0, y: -8 },
2362
+ transition: { duration: 0.3 },
2363
+ className: "flex min-h-[50vh] flex-col items-center justify-center gap-8 text-center",
2364
+ children: [
2365
+ /* @__PURE__ */ jsxs7("div", { className: "relative flex h-20 w-20 items-center justify-center", children: [
2366
+ !error && [0, 1].map((i) => /* @__PURE__ */ jsx9(
2367
+ motion2.span,
2368
+ {
2369
+ className: "absolute inset-0 rounded-full border border-border-primary",
2370
+ initial: { scale: 0.6, opacity: 0.8 },
2371
+ animate: { scale: 1.6, opacity: 0 },
2372
+ transition: { duration: 2.2, repeat: Infinity, ease: "easeOut", delay: i * 1.1 }
2373
+ },
2374
+ i
2375
+ )),
2376
+ /* @__PURE__ */ jsx9(
2377
+ motion2.div,
2378
+ {
2379
+ className: "grid h-12 w-12 place-items-center",
2380
+ animate: error ? { scale: 1, filter: "grayscale(1)" } : { scale: [1, 1.06, 1] },
2381
+ transition: error ? { duration: 0.3 } : { duration: 2.2, repeat: Infinity, ease: "easeInOut" },
2382
+ children: avatar ?? /* @__PURE__ */ jsx9("span", { className: "h-12 w-12 rounded-full bg-brand-500" })
2383
+ }
2384
+ )
2385
+ ] }),
2386
+ /* @__PURE__ */ jsx9("ol", { className: "flex flex-col gap-3 text-left", children: t.connectSteps.map((step, i) => {
2387
+ const done = !error && i < current;
2388
+ const active = !error && i === current;
2389
+ const failed = !!error && i === current;
2390
+ return /* @__PURE__ */ jsxs7("li", { className: "flex items-center gap-3", children: [
2391
+ /* @__PURE__ */ jsx9("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx9(AnimatePresence2, { mode: "wait", initial: false, children: done ? /* @__PURE__ */ jsx9(motion2.span, { initial: { scale: 0 }, animate: { scale: 1 }, className: "flex h-5 w-5 items-center justify-center rounded-full bg-background-success", children: /* @__PURE__ */ jsx9(Check, { className: "h-3 w-3 text-text-success", strokeWidth: 3 }) }, "done") : active ? /* @__PURE__ */ jsx9(
2392
+ motion2.span,
2393
+ {
2394
+ className: "h-2.5 w-2.5 rounded-full bg-text-primary",
2395
+ animate: { scale: [1, 1.5, 1], opacity: [1, 0.5, 1] },
2396
+ transition: { duration: 1.1, repeat: Infinity, ease: "easeInOut" }
2397
+ },
2398
+ "active"
2399
+ ) : failed ? /* @__PURE__ */ jsx9("span", { className: "h-2.5 w-2.5 rounded-full bg-text-danger" }, "failed") : /* @__PURE__ */ jsx9("span", { className: "h-2 w-2 rounded-full bg-border-primary" }, "idle") }) }),
2400
+ /* @__PURE__ */ jsxs7("div", { className: "leading-tight", children: [
2401
+ /* @__PURE__ */ jsxs7("p", { className: `text-sm ${active || failed ? "text-text-primary" : done ? "text-text-secondary" : "text-text-tertiary"}`, children: [
2402
+ step.label,
2403
+ active && /* @__PURE__ */ jsx9(
2404
+ motion2.span,
2405
+ {
2406
+ className: "inline-block w-4 text-left",
2407
+ animate: { opacity: [0, 1, 1, 0] },
2408
+ transition: { duration: 1.4, repeat: Infinity, times: [0, 0.2, 0.8, 1] },
2409
+ children: "\u2026"
2410
+ }
2411
+ )
2412
+ ] }),
2413
+ active && /* @__PURE__ */ jsx9("p", { className: "text-xs text-text-tertiary", children: step.hint })
2414
+ ] })
2415
+ ] }, i);
2416
+ }) }),
2417
+ error && /* @__PURE__ */ jsxs7(motion2.div, { initial: { opacity: 0, y: 6 }, animate: { opacity: 1, y: 0 }, className: "flex max-w-md flex-col items-center gap-3", children: [
2418
+ /* @__PURE__ */ jsx9("p", { className: "text-sm text-text-danger", children: error }),
2419
+ onRetry && /* @__PURE__ */ jsx9("button", { type: "button", onClick: onRetry, className: "rounded-full border border-border-primary px-4 py-1.5 text-sm text-text-primary hover:bg-background-secondary", children: t.connectRetry })
2223
2420
  ] })
2224
- ] }, i);
2225
- }) }),
2226
- error && /* @__PURE__ */ jsxs7("div", { className: "flex max-w-md flex-col items-center gap-3", children: [
2227
- /* @__PURE__ */ jsx8("p", { className: "text-sm text-text-danger", children: error }),
2228
- onRetry && /* @__PURE__ */ jsx8("button", { type: "button", onClick: onRetry, className: "rounded-full border border-border-primary px-4 py-1.5 text-sm text-text-primary hover:bg-background-secondary", children: t.connectRetry })
2229
- ] })
2230
- ] });
2421
+ ]
2422
+ }
2423
+ );
2231
2424
  }
2232
2425
 
2233
2426
  // src/react/usePilot.ts
@@ -2279,8 +2472,10 @@ function usePilot(transport, opts = {}) {
2279
2472
  );
2280
2473
  };
2281
2474
  if (transport.history && !optsRef.current.initialTurns) {
2282
- transport.history().then((turns) => {
2283
- if (!gone && turns.length && !ref.current.turns.length) commit({ ...ref.current, turns, effects: [] });
2475
+ transport.history().then((h) => {
2476
+ if (gone) return;
2477
+ const { turns, permissions } = Array.isArray(h) ? { turns: h, permissions: [] } : h;
2478
+ commit(applyHistory(ref.current, turns, permissions));
2284
2479
  }).catch(() => {
2285
2480
  }).finally(subscribe);
2286
2481
  } else subscribe();
@@ -2401,7 +2596,7 @@ function useSseTransport(base, opts) {
2401
2596
  }
2402
2597
 
2403
2598
  // src/react/Piloto.tsx
2404
- import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
2599
+ import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2405
2600
  var useIsoLayoutEffect = typeof window === "undefined" ? useEffect6 : useLayoutEffect;
2406
2601
  var ANCHOR_GAP = 24;
2407
2602
  var Piloto = forwardRef3(function Piloto2(props, handle) {
@@ -2435,8 +2630,17 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
2435
2630
  },
2436
2631
  [props.references, props.onReferencesChange]
2437
2632
  );
2438
- const [draft, setDraftState] = useState9({ text: "", n: 0 });
2439
2633
  const composerBox = useRef5(null);
2634
+ const draftText = typeof props.draft === "string" ? props.draft : props.draft?.text;
2635
+ const draftKey = typeof props.draft === "object" && props.draft ? props.draft.key : void 0;
2636
+ const [draft, setDraftState] = useState9(() => ({ text: draftText ?? "", n: 0 }));
2637
+ const draftSeen = useRef5(`${draftText}\0${draftKey}`);
2638
+ useEffect6(() => {
2639
+ const id = `${draftText}\0${draftKey}`;
2640
+ if (draftText == null || id === draftSeen.current) return;
2641
+ draftSeen.current = id;
2642
+ setDraftState((d) => ({ text: draftText, n: d.n + 1 }));
2643
+ }, [draftText, draftKey]);
2440
2644
  const send = useCallback3(
2441
2645
  (text, attachments = []) => {
2442
2646
  const current = refsRef.current;
@@ -2567,44 +2771,61 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
2567
2771
  const id = setTimeout(() => setSlowConnect(true), 800);
2568
2772
  return () => clearTimeout(id);
2569
2773
  }, [connected]);
2570
- const composer = /* @__PURE__ */ jsx9("div", { ref: composerBox, children: /* @__PURE__ */ jsx9(
2571
- Composer,
2572
- {
2573
- initialValue: draft.text,
2574
- onSubmit: send,
2575
- onStop: pilot.stop,
2576
- busy,
2577
- canSteer: (external ? true : transport?.steer) !== false,
2578
- placeholder,
2579
- canSeeImages: state.canSeeImages,
2580
- attachments: showFiles,
2581
- upload: props.upload,
2582
- transcribe: props.transcribe,
2583
- voiceNoteText: props.voiceNoteText,
2584
- models: features.models === false ? [] : state.models,
2585
- currentModel: state.currentModel,
2586
- onModelChange: pilot.setModel,
2587
- references: refs,
2588
- onRemoveReference: (id) => setRefs(refsRef.current.filter((r) => r.id !== id)),
2589
- onActivateReference: props.onReferenceClick,
2590
- extras: slots.composerExtras
2591
- },
2592
- draft.n
2593
- ) });
2594
- const permissionCards = cards.map((p) => /* @__PURE__ */ jsx9(ConfirmCard, { request: p, onRespond: respond, onSettled: settle, onExpire: pilot.expirePermission }, p.id));
2595
- return /* @__PURE__ */ jsx9(PilotoContext.Provider, { value: config, children: /* @__PURE__ */ jsx9("div", { ...rootProps(theme, props.skin), "data-busy": busy || void 0, className: `piloto ${props.className ?? ""}`, style: props.style, children: empty ? /* @__PURE__ */ jsxs8("div", { className: "piloto-empty flex min-h-0 flex-1 flex-col items-center justify-center px-4 pb-[8vh]", children: [
2596
- slots.headerActions && /* @__PURE__ */ jsx9("div", { className: "absolute right-4 top-3 flex gap-2", children: slots.headerActions }),
2597
- !connected && slowConnect ? /* @__PURE__ */ jsx9(ConnectingState, { phase, error, avatar: props.avatar }) : slots.emptyState ?? /* @__PURE__ */ jsxs8("div", { className: "piloto-welcome mb-6 flex flex-col items-center gap-3 text-center", children: [
2598
- props.avatar,
2599
- props.welcome && /* @__PURE__ */ jsx9("div", { className: "text-2xl font-semibold text-text-primary", children: props.welcome })
2600
- ] }),
2601
- /* @__PURE__ */ jsxs8("div", { className: "w-full max-w-3xl", children: [
2602
- slots.aboveComposer,
2603
- composer,
2604
- props.suggestions && /* @__PURE__ */ jsx9(Suggestions, { items: props.suggestions, onPick: (s) => send(s), onPrefill: (s) => setDraftState((d) => ({ text: s, n: d.n + 1 })) })
2774
+ const pointedRefs = refs.filter((r) => r.prompt);
2775
+ const plainRefs = refs.filter((r) => !r.prompt);
2776
+ const removeRef = (id) => setRefs(refsRef.current.filter((r) => r.id !== id));
2777
+ const composer = /* @__PURE__ */ jsxs8("div", { ref: composerBox, children: [
2778
+ /* @__PURE__ */ jsx10(ReferenceChips, { references: pointedRefs, onRemove: removeRef, onActivate: props.onReferenceClick }),
2779
+ /* @__PURE__ */ jsx10(
2780
+ Composer,
2781
+ {
2782
+ initialValue: draft.text,
2783
+ onSubmit: send,
2784
+ onStop: pilot.stop,
2785
+ busy,
2786
+ canSteer: (external ? true : transport?.steer) !== false,
2787
+ placeholder,
2788
+ canSeeImages: state.canSeeImages,
2789
+ attachments: showFiles,
2790
+ upload: props.upload,
2791
+ transcribe: props.transcribe,
2792
+ voiceNoteText: props.voiceNoteText,
2793
+ models: features.models === false ? [] : state.models,
2794
+ currentModel: state.currentModel,
2795
+ onModelChange: pilot.setModel,
2796
+ references: plainRefs,
2797
+ onRemoveReference: removeRef,
2798
+ onActivateReference: props.onReferenceClick,
2799
+ extras: slots.composerExtras
2800
+ },
2801
+ draft.n
2802
+ )
2803
+ ] });
2804
+ const permissionCards = cards.map((p) => /* @__PURE__ */ jsx10(ConfirmCard, { request: p, onRespond: respond, onSettled: settle, onExpire: pilot.expirePermission }, p.id));
2805
+ return /* @__PURE__ */ jsx10(PilotoContext.Provider, { value: config, children: /* @__PURE__ */ jsx10("div", { ...rootProps(theme, props.skin), "data-busy": busy || void 0, className: `piloto ${props.className ?? ""}`, style: props.style, children: empty ? (
2806
+ // Un hilo vacío enseña lo mismo que la portada: la cara, el saludo, la caja y por dónde
2807
+ // empezar. Si no cabe (panel bajo), se desplaza: `safe center` nunca empuja nada fuera.
2808
+ /* @__PURE__ */ jsxs8("div", { className: "gs-scroll flex min-h-0 flex-1 flex-col items-center justify-center overflow-y-auto px-4 pb-[10vh] [justify-content:safe_center]", children: [
2809
+ slots.headerActions && /* @__PURE__ */ jsx10("div", { className: "absolute right-4 top-3 flex gap-2", children: slots.headerActions }),
2810
+ !connected && slowConnect ? /* @__PURE__ */ jsx10(ConnectingState, { phase, error, avatar: props.avatar }) : slots.emptyState ?? /* @__PURE__ */ jsxs8("div", { className: "mb-6 flex flex-col items-center", children: [
2811
+ props.avatar && /* @__PURE__ */ jsx10("div", { className: "mb-3", children: props.avatar }),
2812
+ props.welcome && // Un saludo largo (una explicación del copiloto) baja a letra de lectura.
2813
+ /* @__PURE__ */ jsx10(
2814
+ "h1",
2815
+ {
2816
+ className: typeof props.welcome === "string" && props.welcome.length > 60 ? "max-w-xl text-center text-base font-medium leading-6 text-metal" : "text-center text-3xl font-extrabold tracking-tight text-dark",
2817
+ children: props.welcome
2818
+ }
2819
+ )
2820
+ ] }),
2821
+ /* @__PURE__ */ jsxs8("div", { className: "w-full max-w-3xl", children: [
2822
+ slots.aboveComposer,
2823
+ composer,
2824
+ props.suggestions && /* @__PURE__ */ jsx10(Suggestions, { items: props.suggestions, onPick: (s) => send(s), onPrefill: (s) => setDraftState((d) => ({ text: s, n: d.n + 1 })) })
2825
+ ] })
2605
2826
  ] })
2606
- ] }) : /* @__PURE__ */ jsxs8(Fragment4, { children: [
2607
- slots.headerActions && /* @__PURE__ */ jsx9("div", { className: "flex shrink-0 justify-end gap-2 px-4 pt-3", children: slots.headerActions }),
2827
+ ) : /* @__PURE__ */ jsxs8(Fragment6, { children: [
2828
+ slots.headerActions && /* @__PURE__ */ jsx10("div", { className: "flex shrink-0 justify-end gap-2 px-4 pt-3 sm:px-6", children: slots.headerActions }),
2608
2829
  /* @__PURE__ */ jsxs8(
2609
2830
  "div",
2610
2831
  {
@@ -2619,13 +2840,13 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
2619
2840
  if (touchY.current != null && y != null && y > touchY.current + 4) release();
2620
2841
  },
2621
2842
  onKeyDown: (e) => ["ArrowUp", "PageUp", "Home"].includes(e.key) && release(),
2622
- className: "piloto-scroll relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden",
2843
+ className: "gs-scroll relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden",
2623
2844
  children: [
2624
- /* @__PURE__ */ jsxs8("div", { ref: column, className: "piloto-column mx-auto flex w-full flex-col gap-6 px-4 py-6", children: [
2845
+ /* @__PURE__ */ jsxs8("div", { ref: column, className: "mx-auto flex w-full max-w-[784px] flex-col gap-6 px-4 py-8 sm:px-6", children: [
2625
2846
  turns.map((turn, i) => {
2626
2847
  const isLast = i === turns.length - 1;
2627
2848
  const live = busy && isLast;
2628
- return /* @__PURE__ */ jsx9("div", { "data-turn": i, children: turn.role === "user" ? /* @__PURE__ */ jsx9(UserBubble, { turn }) : /* @__PURE__ */ jsx9(
2849
+ return /* @__PURE__ */ jsx10("div", { "data-turn": i, children: turn.role === "user" ? /* @__PURE__ */ jsx10(UserBubble, { turn }) : /* @__PURE__ */ jsx10(
2629
2850
  AgentBubble,
2630
2851
  {
2631
2852
  turn,
@@ -2634,36 +2855,37 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
2634
2855
  onOption: isLast && !busy && features.replyOptions !== false ? (text) => send(text) : void 0,
2635
2856
  showUsage: features.usage !== false,
2636
2857
  showCopy: features.copy !== false,
2858
+ showDuration: features.duration !== false,
2637
2859
  renderDeliveries: slots.renderDeliveries
2638
2860
  }
2639
2861
  ) }, i);
2640
2862
  }),
2641
2863
  permissionCards,
2642
2864
  busy && !toolRunning && !cards.length && /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5", children: [
2643
- /* @__PURE__ */ jsx9(TypingDots, {}),
2644
- /* @__PURE__ */ jsx9(WaitLabel, { phase, since: state.turnStartedAt, elsewhere: state.elsewhere, onLost: pilot.abandonAndRetry, showDuration: features.duration !== false })
2865
+ /* @__PURE__ */ jsx10(TypingDots, {}),
2866
+ /* @__PURE__ */ jsx10(WaitLabel, { phase, since: state.turnStartedAt, elsewhere: state.elsewhere, onLost: pilot.abandonAndRetry, showDuration: features.duration !== false })
2645
2867
  ] }),
2646
- interrupted && !busy && /* @__PURE__ */ jsxs8("p", { className: "piloto-interrupted text-sm text-text-secondary", children: [
2868
+ interrupted && !busy && /* @__PURE__ */ jsxs8("p", { className: "text-sm text-text-secondary", children: [
2647
2869
  /me quedé a medias|i stopped halfway/i.test(last?.text ?? "") ? t.interruptedOurFault : t.interrupted(interrupted.reason),
2648
2870
  " ",
2649
- /* @__PURE__ */ jsx9("button", { type: "button", onClick: pilot.resume, className: "cursor-pointer text-text-primary underline underline-offset-2", children: interrupted.canContinue ? t.continueTurn : t.resume })
2871
+ /* @__PURE__ */ jsx10("button", { type: "button", onClick: pilot.resume, className: "cursor-pointer text-text-primary underline underline-offset-2", children: interrupted.canContinue ? t.continueTurn : t.resume })
2650
2872
  ] }),
2651
- notice && /* @__PURE__ */ jsx9("p", { className: "piloto-notice text-sm text-text-tertiary", children: notice }),
2652
- error && /* @__PURE__ */ jsx9("p", { className: "piloto-error text-sm text-text-danger", children: error })
2873
+ notice && /* @__PURE__ */ jsx10("p", { className: "text-sm text-text-tertiary", children: notice }),
2874
+ error && /* @__PURE__ */ jsx10("p", { className: "text-sm text-text-danger", children: error })
2653
2875
  ] }),
2654
- /* @__PURE__ */ jsx9("div", { ref: spacer, "aria-hidden": true })
2876
+ /* @__PURE__ */ jsx10("div", { ref: spacer, "aria-hidden": true })
2655
2877
  ]
2656
2878
  }
2657
2879
  ),
2658
- /* @__PURE__ */ jsxs8("div", { className: "piloto-dock relative mx-auto w-full px-4 pb-4", children: [
2659
- !atBottom && /* @__PURE__ */ jsx9(
2880
+ /* @__PURE__ */ jsxs8("div", { className: "relative mx-auto w-full max-w-[784px] px-4 pb-4 sm:px-6 sm:pb-6", children: [
2881
+ !atBottom && /* @__PURE__ */ jsx10(
2660
2882
  "button",
2661
2883
  {
2662
2884
  type: "button",
2663
2885
  onClick: toBottom,
2664
2886
  "aria-label": t.goToLatest,
2665
- className: "piloto-to-bottom absolute -top-12 left-1/2 z-10 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border border-border-primary bg-background-secondary text-text-secondary shadow-(--piloto-shadow-card) transition hover:text-text-primary",
2666
- children: /* @__PURE__ */ jsx9(ArrowDown, { className: "h-4 w-4" })
2887
+ className: "absolute -top-12 left-1/2 z-10 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border border-border-primary bg-background-secondary text-text-secondary shadow-lg transition hover:text-text-primary",
2888
+ children: /* @__PURE__ */ jsx10(ArrowDown, { className: "h-4 w-4" })
2667
2889
  }
2668
2890
  ),
2669
2891
  slots.aboveComposer,
@@ -2682,6 +2904,7 @@ export {
2682
2904
  DEFAULT_TOOL_ICONS,
2683
2905
  DecisionLines,
2684
2906
  DeliveryChips,
2907
+ InlineMarkdown,
2685
2908
  LinkSafetyModal,
2686
2909
  Markdown,
2687
2910
  ModelPicker,
@@ -2705,6 +2928,7 @@ export {
2705
2928
  UserBubble,
2706
2929
  WaitLabel,
2707
2930
  appendAgentMessages,
2931
+ applyHistory,
2708
2932
  applyReferences,
2709
2933
  beginSend,
2710
2934
  cleanReplyOption,
@@ -2727,6 +2951,7 @@ export {
2727
2951
  reconcileTurns,
2728
2952
  reconcileWith,
2729
2953
  reducePilotEvent,
2954
+ renderInline,
2730
2955
  resolvePermission,
2731
2956
  resumeMode,
2732
2957
  sendAccepted,