ghostykit 0.2.1 → 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.
- package/README.md +8 -4
- package/dist/fonts.css +3 -3
- package/dist/react/Bubble.d.ts +4 -2
- package/dist/react/Chips.d.ts +7 -3
- package/dist/react/Composer.d.ts +4 -1
- package/dist/react/Status.d.ts +1 -1
- package/dist/react/Steps.d.ts +11 -6
- package/dist/react/index.js +510 -339
- package/dist/styles.css +652 -534
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -262,8 +262,25 @@ function createLucideIcon(iconDataOrName, iconNode = [], aliases = []) {
|
|
|
262
262
|
return Component;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
// ../../node_modules/lucide-react/dist/esm/icons/
|
|
265
|
+
// ../../node_modules/lucide-react/dist/esm/icons/activity.mjs
|
|
266
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 = {
|
|
267
284
|
name: "app-window",
|
|
268
285
|
size: 24,
|
|
269
286
|
node: [
|
|
@@ -273,11 +290,11 @@ var __iconData = {
|
|
|
273
290
|
["path", { d: "M6 4v4", key: "1svtjw" }]
|
|
274
291
|
]
|
|
275
292
|
};
|
|
276
|
-
|
|
277
|
-
var AppWindow = createLucideIcon(
|
|
293
|
+
__iconData2.node;
|
|
294
|
+
var AppWindow = createLucideIcon(__iconData2);
|
|
278
295
|
|
|
279
296
|
// ../../node_modules/lucide-react/dist/esm/icons/arrow-down.mjs
|
|
280
|
-
var
|
|
297
|
+
var __iconData3 = {
|
|
281
298
|
name: "arrow-down",
|
|
282
299
|
size: 24,
|
|
283
300
|
node: [
|
|
@@ -285,11 +302,11 @@ var __iconData2 = {
|
|
|
285
302
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
286
303
|
]
|
|
287
304
|
};
|
|
288
|
-
|
|
289
|
-
var ArrowDown = createLucideIcon(
|
|
305
|
+
__iconData3.node;
|
|
306
|
+
var ArrowDown = createLucideIcon(__iconData3);
|
|
290
307
|
|
|
291
308
|
// ../../node_modules/lucide-react/dist/esm/icons/arrow-up-right.mjs
|
|
292
|
-
var
|
|
309
|
+
var __iconData4 = {
|
|
293
310
|
name: "arrow-up-right",
|
|
294
311
|
size: 24,
|
|
295
312
|
node: [
|
|
@@ -297,11 +314,11 @@ var __iconData3 = {
|
|
|
297
314
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
298
315
|
]
|
|
299
316
|
};
|
|
300
|
-
|
|
301
|
-
var ArrowUpRight = createLucideIcon(
|
|
317
|
+
__iconData4.node;
|
|
318
|
+
var ArrowUpRight = createLucideIcon(__iconData4);
|
|
302
319
|
|
|
303
320
|
// ../../node_modules/lucide-react/dist/esm/icons/arrow-up.mjs
|
|
304
|
-
var
|
|
321
|
+
var __iconData5 = {
|
|
305
322
|
name: "arrow-up",
|
|
306
323
|
size: 24,
|
|
307
324
|
node: [
|
|
@@ -309,20 +326,8 @@ var __iconData4 = {
|
|
|
309
326
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
310
327
|
]
|
|
311
328
|
};
|
|
312
|
-
__iconData4.node;
|
|
313
|
-
var ArrowUp = createLucideIcon(__iconData4);
|
|
314
|
-
|
|
315
|
-
// ../../node_modules/lucide-react/dist/esm/icons/at-sign.mjs
|
|
316
|
-
var __iconData5 = {
|
|
317
|
-
name: "at-sign",
|
|
318
|
-
size: 24,
|
|
319
|
-
node: [
|
|
320
|
-
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
321
|
-
["path", { d: "M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8", key: "7n84p3" }]
|
|
322
|
-
]
|
|
323
|
-
};
|
|
324
329
|
__iconData5.node;
|
|
325
|
-
var
|
|
330
|
+
var ArrowUp = createLucideIcon(__iconData5);
|
|
326
331
|
|
|
327
332
|
// ../../node_modules/lucide-react/dist/esm/icons/book-open.mjs
|
|
328
333
|
var __iconData6 = {
|
|
@@ -470,8 +475,23 @@ var __iconData16 = {
|
|
|
470
475
|
__iconData16.node;
|
|
471
476
|
var Cpu = createLucideIcon(__iconData16);
|
|
472
477
|
|
|
473
|
-
// ../../node_modules/lucide-react/dist/esm/icons/
|
|
478
|
+
// ../../node_modules/lucide-react/dist/esm/icons/crosshair.mjs
|
|
474
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 = {
|
|
475
495
|
name: "external-link",
|
|
476
496
|
size: 24,
|
|
477
497
|
node: [
|
|
@@ -480,11 +500,11 @@ var __iconData17 = {
|
|
|
480
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" }]
|
|
481
501
|
]
|
|
482
502
|
};
|
|
483
|
-
|
|
484
|
-
var ExternalLink = createLucideIcon(
|
|
503
|
+
__iconData18.node;
|
|
504
|
+
var ExternalLink = createLucideIcon(__iconData18);
|
|
485
505
|
|
|
486
506
|
// ../../node_modules/lucide-react/dist/esm/icons/file-pen-line.mjs
|
|
487
|
-
var
|
|
507
|
+
var __iconData19 = {
|
|
488
508
|
name: "file-pen-line",
|
|
489
509
|
size: 24,
|
|
490
510
|
node: [
|
|
@@ -507,11 +527,11 @@ var __iconData18 = {
|
|
|
507
527
|
],
|
|
508
528
|
aliases: ["file-signature"]
|
|
509
529
|
};
|
|
510
|
-
|
|
511
|
-
var FilePenLine = createLucideIcon(
|
|
530
|
+
__iconData19.node;
|
|
531
|
+
var FilePenLine = createLucideIcon(__iconData19);
|
|
512
532
|
|
|
513
533
|
// ../../node_modules/lucide-react/dist/esm/icons/file-spreadsheet.mjs
|
|
514
|
-
var
|
|
534
|
+
var __iconData20 = {
|
|
515
535
|
name: "file-spreadsheet",
|
|
516
536
|
size: 24,
|
|
517
537
|
node: [
|
|
@@ -529,11 +549,11 @@ var __iconData19 = {
|
|
|
529
549
|
["path", { d: "M14 17h2", key: "10kma7" }]
|
|
530
550
|
]
|
|
531
551
|
};
|
|
532
|
-
|
|
533
|
-
var FileSpreadsheet = createLucideIcon(
|
|
552
|
+
__iconData20.node;
|
|
553
|
+
var FileSpreadsheet = createLucideIcon(__iconData20);
|
|
534
554
|
|
|
535
555
|
// ../../node_modules/lucide-react/dist/esm/icons/file-text.mjs
|
|
536
|
-
var
|
|
556
|
+
var __iconData21 = {
|
|
537
557
|
name: "file-text",
|
|
538
558
|
size: 24,
|
|
539
559
|
node: [
|
|
@@ -550,11 +570,11 @@ var __iconData20 = {
|
|
|
550
570
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
551
571
|
]
|
|
552
572
|
};
|
|
553
|
-
|
|
554
|
-
var FileText = createLucideIcon(
|
|
573
|
+
__iconData21.node;
|
|
574
|
+
var FileText = createLucideIcon(__iconData21);
|
|
555
575
|
|
|
556
576
|
// ../../node_modules/lucide-react/dist/esm/icons/folder.mjs
|
|
557
|
-
var
|
|
577
|
+
var __iconData22 = {
|
|
558
578
|
name: "folder",
|
|
559
579
|
size: 24,
|
|
560
580
|
node: [
|
|
@@ -567,11 +587,11 @@ var __iconData21 = {
|
|
|
567
587
|
]
|
|
568
588
|
]
|
|
569
589
|
};
|
|
570
|
-
|
|
571
|
-
var Folder = createLucideIcon(
|
|
590
|
+
__iconData22.node;
|
|
591
|
+
var Folder = createLucideIcon(__iconData22);
|
|
572
592
|
|
|
573
593
|
// ../../node_modules/lucide-react/dist/esm/icons/gauge.mjs
|
|
574
|
-
var
|
|
594
|
+
var __iconData23 = {
|
|
575
595
|
name: "gauge",
|
|
576
596
|
size: 24,
|
|
577
597
|
node: [
|
|
@@ -579,11 +599,11 @@ var __iconData22 = {
|
|
|
579
599
|
["path", { d: "M3.34 19a10 10 0 1 1 17.32 0", key: "19p75a" }]
|
|
580
600
|
]
|
|
581
601
|
};
|
|
582
|
-
|
|
583
|
-
var Gauge = createLucideIcon(
|
|
602
|
+
__iconData23.node;
|
|
603
|
+
var Gauge = createLucideIcon(__iconData23);
|
|
584
604
|
|
|
585
605
|
// ../../node_modules/lucide-react/dist/esm/icons/globe.mjs
|
|
586
|
-
var
|
|
606
|
+
var __iconData24 = {
|
|
587
607
|
name: "globe",
|
|
588
608
|
size: 24,
|
|
589
609
|
node: [
|
|
@@ -592,11 +612,11 @@ var __iconData23 = {
|
|
|
592
612
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
593
613
|
]
|
|
594
614
|
};
|
|
595
|
-
|
|
596
|
-
var Globe = createLucideIcon(
|
|
615
|
+
__iconData24.node;
|
|
616
|
+
var Globe = createLucideIcon(__iconData24);
|
|
597
617
|
|
|
598
618
|
// ../../node_modules/lucide-react/dist/esm/icons/image.mjs
|
|
599
|
-
var
|
|
619
|
+
var __iconData25 = {
|
|
600
620
|
name: "image",
|
|
601
621
|
size: 24,
|
|
602
622
|
node: [
|
|
@@ -605,11 +625,29 @@ var __iconData24 = {
|
|
|
605
625
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
606
626
|
]
|
|
607
627
|
};
|
|
608
|
-
|
|
609
|
-
var Image = createLucideIcon(
|
|
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);
|
|
610
648
|
|
|
611
649
|
// ../../node_modules/lucide-react/dist/esm/icons/list-checks.mjs
|
|
612
|
-
var
|
|
650
|
+
var __iconData27 = {
|
|
613
651
|
name: "list-checks",
|
|
614
652
|
size: 24,
|
|
615
653
|
node: [
|
|
@@ -620,21 +658,21 @@ var __iconData25 = {
|
|
|
620
658
|
["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
|
|
621
659
|
]
|
|
622
660
|
};
|
|
623
|
-
|
|
624
|
-
var ListChecks = createLucideIcon(
|
|
661
|
+
__iconData27.node;
|
|
662
|
+
var ListChecks = createLucideIcon(__iconData27);
|
|
625
663
|
|
|
626
664
|
// ../../node_modules/lucide-react/dist/esm/icons/loader-circle.mjs
|
|
627
|
-
var
|
|
665
|
+
var __iconData28 = {
|
|
628
666
|
name: "loader-circle",
|
|
629
667
|
size: 24,
|
|
630
668
|
node: [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]],
|
|
631
669
|
aliases: ["loader-2"]
|
|
632
670
|
};
|
|
633
|
-
|
|
634
|
-
var LoaderCircle = createLucideIcon(
|
|
671
|
+
__iconData28.node;
|
|
672
|
+
var LoaderCircle = createLucideIcon(__iconData28);
|
|
635
673
|
|
|
636
674
|
// ../../node_modules/lucide-react/dist/esm/icons/mic.mjs
|
|
637
|
-
var
|
|
675
|
+
var __iconData29 = {
|
|
638
676
|
name: "mic",
|
|
639
677
|
size: 24,
|
|
640
678
|
node: [
|
|
@@ -643,11 +681,31 @@ var __iconData27 = {
|
|
|
643
681
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
644
682
|
]
|
|
645
683
|
};
|
|
646
|
-
|
|
647
|
-
var Mic = createLucideIcon(
|
|
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);
|
|
648
706
|
|
|
649
707
|
// ../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs
|
|
650
|
-
var
|
|
708
|
+
var __iconData31 = {
|
|
651
709
|
name: "paperclip",
|
|
652
710
|
size: 24,
|
|
653
711
|
node: [
|
|
@@ -660,11 +718,11 @@ var __iconData28 = {
|
|
|
660
718
|
]
|
|
661
719
|
]
|
|
662
720
|
};
|
|
663
|
-
|
|
664
|
-
var Paperclip = createLucideIcon(
|
|
721
|
+
__iconData31.node;
|
|
722
|
+
var Paperclip = createLucideIcon(__iconData31);
|
|
665
723
|
|
|
666
724
|
// ../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.mjs
|
|
667
|
-
var
|
|
725
|
+
var __iconData32 = {
|
|
668
726
|
name: "rotate-ccw",
|
|
669
727
|
size: 24,
|
|
670
728
|
node: [
|
|
@@ -672,11 +730,11 @@ var __iconData29 = {
|
|
|
672
730
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
673
731
|
]
|
|
674
732
|
};
|
|
675
|
-
|
|
676
|
-
var RotateCcw = createLucideIcon(
|
|
733
|
+
__iconData32.node;
|
|
734
|
+
var RotateCcw = createLucideIcon(__iconData32);
|
|
677
735
|
|
|
678
736
|
// ../../node_modules/lucide-react/dist/esm/icons/search.mjs
|
|
679
|
-
var
|
|
737
|
+
var __iconData33 = {
|
|
680
738
|
name: "search",
|
|
681
739
|
size: 24,
|
|
682
740
|
node: [
|
|
@@ -684,11 +742,11 @@ var __iconData30 = {
|
|
|
684
742
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
685
743
|
]
|
|
686
744
|
};
|
|
687
|
-
|
|
688
|
-
var Search = createLucideIcon(
|
|
745
|
+
__iconData33.node;
|
|
746
|
+
var Search = createLucideIcon(__iconData33);
|
|
689
747
|
|
|
690
748
|
// ../../node_modules/lucide-react/dist/esm/icons/send.mjs
|
|
691
|
-
var
|
|
749
|
+
var __iconData34 = {
|
|
692
750
|
name: "send",
|
|
693
751
|
size: 24,
|
|
694
752
|
node: [
|
|
@@ -702,11 +760,11 @@ var __iconData31 = {
|
|
|
702
760
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
703
761
|
]
|
|
704
762
|
};
|
|
705
|
-
|
|
706
|
-
var Send = createLucideIcon(
|
|
763
|
+
__iconData34.node;
|
|
764
|
+
var Send = createLucideIcon(__iconData34);
|
|
707
765
|
|
|
708
766
|
// ../../node_modules/lucide-react/dist/esm/icons/shield-alert.mjs
|
|
709
|
-
var
|
|
767
|
+
var __iconData35 = {
|
|
710
768
|
name: "shield-alert",
|
|
711
769
|
size: 24,
|
|
712
770
|
node: [
|
|
@@ -721,34 +779,20 @@ var __iconData32 = {
|
|
|
721
779
|
["path", { d: "M12 16h.01", key: "1drbdi" }]
|
|
722
780
|
]
|
|
723
781
|
};
|
|
724
|
-
|
|
725
|
-
var ShieldAlert = createLucideIcon(
|
|
726
|
-
|
|
727
|
-
// ../../node_modules/lucide-react/dist/esm/icons/square-terminal.mjs
|
|
728
|
-
var __iconData33 = {
|
|
729
|
-
name: "square-terminal",
|
|
730
|
-
size: 24,
|
|
731
|
-
node: [
|
|
732
|
-
["path", { d: "m7 11 2-2-2-2", key: "1lz0vl" }],
|
|
733
|
-
["path", { d: "M11 13h4", key: "1p7l4v" }],
|
|
734
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }]
|
|
735
|
-
],
|
|
736
|
-
aliases: ["terminal-square"]
|
|
737
|
-
};
|
|
738
|
-
__iconData33.node;
|
|
739
|
-
var SquareTerminal = createLucideIcon(__iconData33);
|
|
782
|
+
__iconData35.node;
|
|
783
|
+
var ShieldAlert = createLucideIcon(__iconData35);
|
|
740
784
|
|
|
741
785
|
// ../../node_modules/lucide-react/dist/esm/icons/square.mjs
|
|
742
|
-
var
|
|
786
|
+
var __iconData36 = {
|
|
743
787
|
name: "square",
|
|
744
788
|
size: 24,
|
|
745
789
|
node: [["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]]
|
|
746
790
|
};
|
|
747
|
-
|
|
748
|
-
var Square = createLucideIcon(
|
|
791
|
+
__iconData36.node;
|
|
792
|
+
var Square = createLucideIcon(__iconData36);
|
|
749
793
|
|
|
750
794
|
// ../../node_modules/lucide-react/dist/esm/icons/users-round.mjs
|
|
751
|
-
var
|
|
795
|
+
var __iconData37 = {
|
|
752
796
|
name: "users-round",
|
|
753
797
|
size: 24,
|
|
754
798
|
node: [
|
|
@@ -758,11 +802,11 @@ var __iconData35 = {
|
|
|
758
802
|
],
|
|
759
803
|
aliases: ["users-2"]
|
|
760
804
|
};
|
|
761
|
-
|
|
762
|
-
var UsersRound = createLucideIcon(
|
|
805
|
+
__iconData37.node;
|
|
806
|
+
var UsersRound = createLucideIcon(__iconData37);
|
|
763
807
|
|
|
764
808
|
// ../../node_modules/lucide-react/dist/esm/icons/x.mjs
|
|
765
|
-
var
|
|
809
|
+
var __iconData38 = {
|
|
766
810
|
name: "x",
|
|
767
811
|
size: 24,
|
|
768
812
|
node: [
|
|
@@ -770,8 +814,8 @@ var __iconData36 = {
|
|
|
770
814
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
771
815
|
]
|
|
772
816
|
};
|
|
773
|
-
|
|
774
|
-
var X = createLucideIcon(
|
|
817
|
+
__iconData38.node;
|
|
818
|
+
var X = createLucideIcon(__iconData38);
|
|
775
819
|
|
|
776
820
|
// src/react/Piloto.tsx
|
|
777
821
|
import {
|
|
@@ -1173,7 +1217,7 @@ function useChunkRegistry() {
|
|
|
1173
1217
|
return useMemo2(() => /* @__PURE__ */ new Map(), []);
|
|
1174
1218
|
}
|
|
1175
1219
|
var UNTOUCHED = /* @__PURE__ */ new Set(["pre", "code", "svg", "math", "script", "style"]);
|
|
1176
|
-
var STYLE = `
|
|
1220
|
+
var STYLE = `gs-tramo ${CHUNK_MS}ms linear both`;
|
|
1177
1221
|
function chunksPlugin(state) {
|
|
1178
1222
|
return () => (tree) => {
|
|
1179
1223
|
let total = 0;
|
|
@@ -1243,7 +1287,7 @@ var ChunkedBlock = memo(function ChunkedBlock2(props) {
|
|
|
1243
1287
|
// src/react/Markdown.tsx
|
|
1244
1288
|
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1245
1289
|
function LinkSafetyModal({ isOpen, onClose, onConfirm, url }) {
|
|
1246
|
-
const { strings: t,
|
|
1290
|
+
const { strings: t, skin } = usePiloto();
|
|
1247
1291
|
const [copied, setCopied] = useState3(false);
|
|
1248
1292
|
if (!isOpen) return null;
|
|
1249
1293
|
const copy = async () => {
|
|
@@ -1256,37 +1300,37 @@ function LinkSafetyModal({ isOpen, onClose, onConfirm, url }) {
|
|
|
1256
1300
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
1257
1301
|
onConfirm();
|
|
1258
1302
|
};
|
|
1259
|
-
return /* @__PURE__ */ jsx3("div", { ...rootProps(
|
|
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(
|
|
1260
1304
|
"div",
|
|
1261
1305
|
{
|
|
1262
|
-
className: "
|
|
1306
|
+
className: "w-full max-w-md rounded-2xl border border-border-primary bg-background-primary p-6 shadow-2xl",
|
|
1263
1307
|
onClick: (e) => e.stopPropagation(),
|
|
1264
1308
|
role: "dialog",
|
|
1265
1309
|
"aria-modal": "true",
|
|
1266
1310
|
"aria-label": t.linkTitle,
|
|
1267
1311
|
children: [
|
|
1268
1312
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-start justify-between gap-4", children: [
|
|
1269
|
-
/* @__PURE__ */ jsxs2("h2", { className: "flex items-center gap-2 text-base
|
|
1313
|
+
/* @__PURE__ */ jsxs2("h2", { className: "flex items-center gap-2 text-base text-text-primary", children: [
|
|
1270
1314
|
/* @__PURE__ */ jsx3(ExternalLink, { className: "h-4 w-4 text-text-secondary" }),
|
|
1271
1315
|
t.linkTitle
|
|
1272
1316
|
] }),
|
|
1273
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" }) })
|
|
1274
1318
|
] }),
|
|
1275
|
-
/* @__PURE__ */ jsx3("p", { className: "mt-4 break-all rounded-
|
|
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 }),
|
|
1276
1320
|
/* @__PURE__ */ jsxs2("div", { className: "mt-5 flex gap-2", children: [
|
|
1277
1321
|
/* @__PURE__ */ jsx3(
|
|
1278
1322
|
"button",
|
|
1279
1323
|
{
|
|
1280
1324
|
type: "button",
|
|
1281
1325
|
onClick: copy,
|
|
1282
|
-
className: "flex flex-1 items-center justify-center gap-2 rounded-
|
|
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",
|
|
1283
1327
|
children: copied ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1284
1328
|
/* @__PURE__ */ jsx3(Check, { className: "h-4 w-4 text-text-success" }),
|
|
1285
1329
|
t.linkCopied
|
|
1286
1330
|
] }) : t.linkCopy
|
|
1287
1331
|
}
|
|
1288
1332
|
),
|
|
1289
|
-
/* @__PURE__ */ jsx3("button", { type: "button", onClick: open, className: "
|
|
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 })
|
|
1290
1334
|
] })
|
|
1291
1335
|
]
|
|
1292
1336
|
}
|
|
@@ -1307,11 +1351,19 @@ function Markdown({ children, animate = false, className }) {
|
|
|
1307
1351
|
} : void 0;
|
|
1308
1352
|
return (
|
|
1309
1353
|
// `min-w-0 break-words` y el scroll interno en pre/tablas: una URL larga no ensancha el chat.
|
|
1310
|
-
/* @__PURE__ */ jsx3(
|
|
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
|
+
)
|
|
1311
1362
|
);
|
|
1312
1363
|
}
|
|
1313
1364
|
|
|
1314
1365
|
// src/react/Steps.tsx
|
|
1366
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
1315
1367
|
import { useState as useState4 } from "react";
|
|
1316
1368
|
|
|
1317
1369
|
// src/react/InlineMarkdown.tsx
|
|
@@ -1347,22 +1399,32 @@ function InlineMarkdown({ children }) {
|
|
|
1347
1399
|
// src/react/Steps.tsx
|
|
1348
1400
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1349
1401
|
function ClawIcon({ className }) {
|
|
1350
|
-
return /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", className: `
|
|
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: [
|
|
1351
1403
|
/* @__PURE__ */ jsx5("path", { d: "M12 2v4" }),
|
|
1352
1404
|
/* @__PURE__ */ jsx5("rect", { x: "8.5", y: "6", width: "7", height: "3.5", rx: "1" }),
|
|
1353
|
-
/* @__PURE__ */ jsx5("g", { className: "
|
|
1354
|
-
/* @__PURE__ */ jsx5("g", { className: "
|
|
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" }) }),
|
|
1355
1407
|
/* @__PURE__ */ jsx5("path", { d: "M12 9.5v4" })
|
|
1356
1408
|
] }) });
|
|
1357
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
|
+
}
|
|
1358
1422
|
var DEFAULT_TOOL_ICONS = {
|
|
1359
1423
|
tool_search: Search,
|
|
1360
|
-
bash:
|
|
1361
|
-
shell:
|
|
1362
|
-
terminal:
|
|
1363
|
-
execute:
|
|
1364
|
-
code: SquareTerminal,
|
|
1365
|
-
script: SquareTerminal,
|
|
1424
|
+
bash: RobotArmIcon,
|
|
1425
|
+
shell: RobotArmIcon,
|
|
1426
|
+
terminal: RobotArmIcon,
|
|
1427
|
+
execute: RobotArmIcon,
|
|
1366
1428
|
read: FileText,
|
|
1367
1429
|
read_file: FileText,
|
|
1368
1430
|
write: FilePenLine,
|
|
@@ -1374,19 +1436,26 @@ var DEFAULT_TOOL_ICONS = {
|
|
|
1374
1436
|
search: Search,
|
|
1375
1437
|
web_search: Globe,
|
|
1376
1438
|
web_fetch: Globe,
|
|
1377
|
-
fetch: Globe,
|
|
1378
|
-
browser: Globe,
|
|
1379
1439
|
site_publish: Globe,
|
|
1380
1440
|
pdf: FileText,
|
|
1441
|
+
connector: ArcadeIcon,
|
|
1442
|
+
fetch: Globe,
|
|
1443
|
+
browser: Globe,
|
|
1381
1444
|
todo: ListChecks,
|
|
1382
1445
|
list: ListChecks,
|
|
1446
|
+
code: RobotArmIcon,
|
|
1447
|
+
script: RobotArmIcon,
|
|
1383
1448
|
folder: Folder,
|
|
1449
|
+
mcp: ArcadeIcon,
|
|
1384
1450
|
image: Image,
|
|
1385
1451
|
delegate: UsersRound,
|
|
1386
1452
|
guide: BookOpen,
|
|
1387
1453
|
deliver: Send,
|
|
1388
1454
|
sheet: FileSpreadsheet,
|
|
1389
|
-
view: AppWindow
|
|
1455
|
+
view: AppWindow,
|
|
1456
|
+
collect: Inbox,
|
|
1457
|
+
status: Activity,
|
|
1458
|
+
stop: OctagonX
|
|
1390
1459
|
};
|
|
1391
1460
|
function iconFor(t, icons) {
|
|
1392
1461
|
const name = toolName(t);
|
|
@@ -1396,39 +1465,47 @@ var VISIBLE = 5;
|
|
|
1396
1465
|
function AgentSteps({ tools, live }) {
|
|
1397
1466
|
const { strings: t, toolVerbs } = usePiloto();
|
|
1398
1467
|
const [open, setOpen] = useState4(false);
|
|
1399
|
-
const label = (x) => stepLabel(x, toolVerbs, t.step);
|
|
1400
1468
|
const failed = tools.filter((x) => x.status === "failed").length;
|
|
1401
|
-
const groups = groupSteps(tools,
|
|
1469
|
+
const groups = groupSteps(tools, (x) => stepLabel(x, toolVerbs, t.step));
|
|
1402
1470
|
const shown = groups.slice(-VISIBLE);
|
|
1403
1471
|
const hidden = groups.length - shown.length;
|
|
1404
|
-
return /* @__PURE__ */ jsxs3(
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
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
|
+
);
|
|
1420
1494
|
}
|
|
1421
1495
|
function StepLine({ tool, times, live }) {
|
|
1422
1496
|
const { strings: t, toolVerbs, toolIcons } = usePiloto();
|
|
1423
|
-
const
|
|
1497
|
+
const KindIcon = iconFor(tool, toolIcons);
|
|
1424
1498
|
const spins = isRunning(tool) && live;
|
|
1425
1499
|
const label = stepLabel(tool, toolVerbs, t.step);
|
|
1426
|
-
return /* @__PURE__ */ jsxs3("li", { className: "
|
|
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: [
|
|
1427
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" }) }),
|
|
1428
|
-
/* @__PURE__ */ jsx5(
|
|
1502
|
+
/* @__PURE__ */ jsx5(KindIcon, { className: "h-[22px] w-[22px] shrink-0 text-text-secondary" }),
|
|
1429
1503
|
/* @__PURE__ */ jsxs3("span", { className: "min-w-0 truncate", children: [
|
|
1430
1504
|
/* @__PURE__ */ jsx5("span", { className: spins ? "text-text-primary" : void 0, children: label }),
|
|
1431
|
-
tool.detail && /* @__PURE__ */
|
|
1505
|
+
tool.detail && /* @__PURE__ */ jsxs3("span", { className: "text-text-tertiary", children: [
|
|
1506
|
+
" \xB7 ",
|
|
1507
|
+
tool.detail
|
|
1508
|
+
] }),
|
|
1432
1509
|
times > 1 && /* @__PURE__ */ jsxs3("span", { className: "ml-1 tabular-nums text-text-tertiary", children: [
|
|
1433
1510
|
"\xD7",
|
|
1434
1511
|
times
|
|
@@ -1445,45 +1522,47 @@ var STATUS = {
|
|
|
1445
1522
|
function ToolRow({ tool }) {
|
|
1446
1523
|
const { strings: t, toolVerbs, toolIcons } = usePiloto();
|
|
1447
1524
|
const s = STATUS[tool.status ?? "pending"] ?? STATUS.pending;
|
|
1525
|
+
const StatusIcon = s.Icon;
|
|
1448
1526
|
const KindIcon = iconFor(tool, toolIcons);
|
|
1449
|
-
return /* @__PURE__ */ jsxs3("li", { className: "
|
|
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: [
|
|
1450
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" }) }),
|
|
1451
1529
|
/* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
|
|
1452
|
-
/* @__PURE__ */ jsx5("span", { className: "
|
|
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) }) }),
|
|
1453
1531
|
tool.detail && /* @__PURE__ */ jsx5("span", { className: "mt-0.5 block truncate text-[11px] text-text-tertiary", children: tool.detail }),
|
|
1454
1532
|
tool.path && /* @__PURE__ */ jsx5("span", { className: "mt-0.5 block truncate font-mono text-[10px] text-text-tertiary", children: tool.path })
|
|
1455
1533
|
] }),
|
|
1456
|
-
/* @__PURE__ */ jsx5("span", { className: "mt-0.5 shrink-0", title: t[s.key], "aria-label": t[s.key], children: /* @__PURE__ */ jsx5(
|
|
1457
|
-
] });
|
|
1458
|
-
}
|
|
1459
|
-
function Narration({ steps, children }) {
|
|
1460
|
-
return /* @__PURE__ */ jsxs3("ul", { className: "piloto-narration mb-3 flex flex-col gap-1.5", children: [
|
|
1461
|
-
steps.map((p, i) => /* @__PURE__ */ jsxs3("li", { className: "piloto-fade-up flex items-start gap-2 text-text-secondary", children: [
|
|
1462
|
-
/* @__PURE__ */ jsx5("span", { className: "mt-[3px] grid size-4 shrink-0 place-items-center rounded-full bg-brand-500/15 text-brand-600", children: /* @__PURE__ */ jsx5(CheckMini, {}) }),
|
|
1463
|
-
/* @__PURE__ */ jsx5("span", { className: "piloto-narration-text min-w-0", children: /* @__PURE__ */ jsx5(InlineMarkdown, { children: p }) })
|
|
1464
|
-
] }, i)),
|
|
1465
|
-
children
|
|
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}` }) })
|
|
1466
1535
|
] });
|
|
1467
1536
|
}
|
|
1468
|
-
function
|
|
1469
|
-
return /* @__PURE__ */ jsx5("
|
|
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
|
+
)) }) });
|
|
1470
1552
|
}
|
|
1471
1553
|
|
|
1472
1554
|
// src/react/Bubble.tsx
|
|
1473
1555
|
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
} catch {
|
|
1479
|
-
return false;
|
|
1480
|
-
}
|
|
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 }) });
|
|
1481
1560
|
}
|
|
1482
1561
|
function UserBubble({ turn }) {
|
|
1483
1562
|
const { strings: t, formatUserText } = usePiloto();
|
|
1484
1563
|
const note = systemNoteOf(turn.text);
|
|
1485
1564
|
if (note) {
|
|
1486
|
-
return /* @__PURE__ */ jsx6("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs4("span", { className: "
|
|
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: [
|
|
1487
1566
|
"\u23F0 ",
|
|
1488
1567
|
note
|
|
1489
1568
|
] }) });
|
|
@@ -1492,16 +1571,26 @@ function UserBubble({ turn }) {
|
|
|
1492
1571
|
const atts = turn.attachments ?? [];
|
|
1493
1572
|
const inBubble = atts.filter((a) => a.mimeType.startsWith("image/") && (a.data || a.uri) || a.mimeType.startsWith("audio/") && a.uri);
|
|
1494
1573
|
const docs = atts.filter((a) => !inBubble.includes(a));
|
|
1495
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
1574
|
+
return /* @__PURE__ */ jsxs4("div", { className: "group/msg flex flex-col items-end gap-1", children: [
|
|
1496
1575
|
turn.steer && /* @__PURE__ */ jsxs4("span", { className: "text-[11px] text-text-tertiary", children: [
|
|
1497
1576
|
"\u21AA ",
|
|
1498
1577
|
t.steered
|
|
1499
1578
|
] }),
|
|
1500
|
-
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(
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
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: [
|
|
1505
1594
|
inBubble.length > 0 && /* @__PURE__ */ jsx6("div", { className: `flex flex-wrap justify-end gap-1.5 ${visible.trim() ? "mb-2" : ""}`, children: inBubble.map(
|
|
1506
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)
|
|
1507
1596
|
) }),
|
|
@@ -1518,33 +1607,30 @@ function CopyUserMessage({ text }) {
|
|
|
1518
1607
|
{
|
|
1519
1608
|
type: "button",
|
|
1520
1609
|
onClick: async () => {
|
|
1521
|
-
|
|
1610
|
+
try {
|
|
1611
|
+
await navigator.clipboard.writeText(text);
|
|
1522
1612
|
setCopied(true);
|
|
1523
1613
|
setTimeout(() => setCopied(false), 1500);
|
|
1614
|
+
} catch {
|
|
1524
1615
|
}
|
|
1525
1616
|
},
|
|
1526
1617
|
"aria-label": copied ? t.copied : t.copyMessage,
|
|
1527
1618
|
title: copied ? t.copied : t.copy,
|
|
1528
|
-
className: `
|
|
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"}`,
|
|
1529
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" })
|
|
1530
1621
|
}
|
|
1531
1622
|
);
|
|
1532
1623
|
}
|
|
1533
|
-
function AnswerText({ text, live, whole = false }) {
|
|
1534
|
-
const { visible, animate } = useTextAtPace(text, live, whole);
|
|
1535
|
-
if (!visible) return null;
|
|
1536
|
-
return /* @__PURE__ */ jsx6(Markdown, { animate, children: visible });
|
|
1537
|
-
}
|
|
1538
1624
|
function ReplyOptionButtons({ options, onPick }) {
|
|
1539
1625
|
const { strings: t } = usePiloto();
|
|
1540
|
-
return /* @__PURE__ */ jsx6("ul", { className: "
|
|
1626
|
+
return /* @__PURE__ */ jsx6("ul", { className: "mt-3 flex flex-col gap-2", "aria-label": t.replyOptions, children: options.items.map((item, i) => {
|
|
1541
1627
|
const clean = cleanReplyOption(item);
|
|
1542
|
-
return /* @__PURE__ */ jsx6("li", {
|
|
1628
|
+
return /* @__PURE__ */ jsx6("li", { style: { animation: "gs-tramo 400ms linear both" }, children: /* @__PURE__ */ jsxs4(
|
|
1543
1629
|
"button",
|
|
1544
1630
|
{
|
|
1545
1631
|
type: "button",
|
|
1546
1632
|
onClick: () => onPick(clean),
|
|
1547
|
-
className: "
|
|
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",
|
|
1548
1634
|
children: [
|
|
1549
1635
|
options.numbered && /* @__PURE__ */ jsxs4("span", { className: "shrink-0 tabular-nums text-text-tertiary", children: [
|
|
1550
1636
|
i + 1,
|
|
@@ -1561,7 +1647,7 @@ function UsageStats({ used, size, cost }) {
|
|
|
1561
1647
|
const { strings: t } = usePiloto();
|
|
1562
1648
|
if (!used && !cost) return null;
|
|
1563
1649
|
const pct = size > 0 ? Math.min(100, Math.round(used / size * 100)) : 0;
|
|
1564
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
1650
|
+
return /* @__PURE__ */ jsxs4("div", { className: "mt-2 flex items-center gap-4 text-[11px] text-text-tertiary", children: [
|
|
1565
1651
|
/* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1", children: [
|
|
1566
1652
|
/* @__PURE__ */ jsx6(Gauge, { className: "h-3 w-3" }),
|
|
1567
1653
|
used.toLocaleString(t.numberLocale),
|
|
@@ -1573,19 +1659,21 @@ function UsageStats({ used, size, cost }) {
|
|
|
1573
1659
|
] })
|
|
1574
1660
|
] });
|
|
1575
1661
|
}
|
|
1576
|
-
function TurnFooter({ text, seconds, onRetry, showCopy = true }) {
|
|
1662
|
+
function TurnFooter({ text, seconds, onRetry, showCopy = true, showDuration = true }) {
|
|
1577
1663
|
const { strings: t } = usePiloto();
|
|
1578
1664
|
const [copied, setCopied] = useState5(false);
|
|
1579
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
1580
|
-
seconds ? /* @__PURE__ */ jsx6("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,
|
|
1581
1667
|
showCopy && /* @__PURE__ */ jsxs4(
|
|
1582
1668
|
"button",
|
|
1583
1669
|
{
|
|
1584
1670
|
type: "button",
|
|
1585
1671
|
onClick: async () => {
|
|
1586
|
-
|
|
1672
|
+
try {
|
|
1673
|
+
await navigator.clipboard.writeText(text);
|
|
1587
1674
|
setCopied(true);
|
|
1588
1675
|
setTimeout(() => setCopied(false), 1500);
|
|
1676
|
+
} catch {
|
|
1589
1677
|
}
|
|
1590
1678
|
},
|
|
1591
1679
|
className: "flex items-center gap-1 transition-colors hover:text-text-primary",
|
|
@@ -1604,18 +1692,18 @@ function TurnFooter({ text, seconds, onRetry, showCopy = true }) {
|
|
|
1604
1692
|
function DeliveryChips({ deliveries }) {
|
|
1605
1693
|
const shown = deliveries.filter((d) => !d.capture);
|
|
1606
1694
|
if (!shown.length) return null;
|
|
1607
|
-
return /* @__PURE__ */ jsx6("div", { className: "mt-2 flex flex-wrap gap-1.5", children: shown.map((d, i) => /* @__PURE__ */ jsxs4("span", { className: "
|
|
1608
|
-
/* @__PURE__ */ jsx6(
|
|
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}" }),
|
|
1609
1697
|
/* @__PURE__ */ jsx6("span", { className: "truncate", children: d.name })
|
|
1610
1698
|
] }, i)) });
|
|
1611
1699
|
}
|
|
1612
|
-
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 }) {
|
|
1613
1701
|
const { strings: t } = usePiloto();
|
|
1614
1702
|
const narrated = splitNarration(turn.text ?? "", turn.cuts);
|
|
1615
1703
|
const visible = narrated.rest;
|
|
1616
1704
|
const options = onOption && !live && visible ? extractReplyOptions(visible) : null;
|
|
1617
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
1618
|
-
turn.thought && /* @__PURE__ */ jsxs4("details", { className: "
|
|
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: [
|
|
1619
1707
|
/* @__PURE__ */ jsx6("summary", { className: "cursor-pointer select-none", children: t.thinking }),
|
|
1620
1708
|
/* @__PURE__ */ jsx6("p", { className: "mt-2 whitespace-pre-wrap border-l-2 border-border-secondary pl-3", children: turn.thought })
|
|
1621
1709
|
] }),
|
|
@@ -1625,63 +1713,76 @@ function AgentBubble({ turn, live, onRetry, onOption, showUsage = true, showCopy
|
|
|
1625
1713
|
options.before && /* @__PURE__ */ jsx6(AnswerText, { text: options.before, live }),
|
|
1626
1714
|
/* @__PURE__ */ jsx6(ReplyOptionButtons, { options, onPick: onOption })
|
|
1627
1715
|
] }) : (
|
|
1628
|
-
// Cada tramo nuevo tras una herramienta monta su propio ritmo (empieza de cero).
|
|
1629
|
-
// entero fuera de un turno se escribe al mismo ritmo; al recargar ya sale completo.
|
|
1716
|
+
// Cada tramo nuevo tras una herramienta monta su propio ritmo (empieza de cero).
|
|
1630
1717
|
visible && /* @__PURE__ */ jsx6(AnswerText, { text: visible, live: live || !!turn.arrived, whole: !!turn.arrived }, `r${narrated.steps.length}`)
|
|
1631
1718
|
),
|
|
1632
1719
|
renderDeliveries ? renderDeliveries(turn, live) : turn.deliveries?.length ? /* @__PURE__ */ jsx6(DeliveryChips, { deliveries: turn.deliveries }) : null,
|
|
1633
1720
|
turn.decisions?.length ? /* @__PURE__ */ jsx6(DecisionLines, { decisions: turn.decisions }) : null,
|
|
1634
1721
|
showUsage && turn.usage && /* @__PURE__ */ jsx6(UsageStats, { ...turn.usage }),
|
|
1635
|
-
turn.text && !live && /* @__PURE__ */ jsx6(TurnFooter, { text: turn.text, seconds: turn.seconds, onRetry, showCopy })
|
|
1722
|
+
turn.text && !live && /* @__PURE__ */ jsx6(TurnFooter, { text: turn.text, seconds: turn.seconds, onRetry, showCopy, showDuration })
|
|
1636
1723
|
] });
|
|
1637
1724
|
}
|
|
1638
1725
|
|
|
1639
1726
|
// src/react/Chips.tsx
|
|
1640
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1641
|
-
function ReferenceChips({
|
|
1642
|
-
references,
|
|
1643
|
-
onRemove,
|
|
1644
|
-
onActivate
|
|
1645
|
-
}) {
|
|
1727
|
+
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1728
|
+
function ReferenceChips({ references, onRemove, onActivate }) {
|
|
1646
1729
|
const { strings: t } = usePiloto();
|
|
1647
1730
|
if (!references.length) return null;
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
r
|
|
1652
|
-
"
|
|
1653
|
-
r.
|
|
1654
|
-
"
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
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
|
+
] });
|
|
1667
1767
|
}
|
|
1668
|
-
function Suggestions({ items, onPick, onPrefill }) {
|
|
1768
|
+
function Suggestions({ items, onPick, onPrefill, disabled }) {
|
|
1669
1769
|
if (!items.length) return null;
|
|
1670
|
-
return /* @__PURE__ */ jsx7("div", { className: "
|
|
1770
|
+
return /* @__PURE__ */ jsx7("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: items.map((c) => /* @__PURE__ */ jsx7(
|
|
1671
1771
|
"button",
|
|
1672
1772
|
{
|
|
1673
1773
|
type: "button",
|
|
1674
|
-
onClick: () => onPrefill && /:\s*$/.test(
|
|
1675
|
-
|
|
1676
|
-
|
|
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
|
|
1677
1778
|
},
|
|
1678
|
-
|
|
1779
|
+
c
|
|
1679
1780
|
)) });
|
|
1680
1781
|
}
|
|
1681
1782
|
|
|
1682
1783
|
// src/react/Composer.tsx
|
|
1683
1784
|
import { useCallback, useEffect as useEffect3, useRef as useRef3, useState as useState6 } from "react";
|
|
1684
|
-
import { Fragment as
|
|
1785
|
+
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1685
1786
|
var MAX_HEIGHT = 240;
|
|
1686
1787
|
var BY_EXTENSION = {
|
|
1687
1788
|
png: "image/png",
|
|
@@ -1972,10 +2073,9 @@ function Composer({
|
|
|
1972
2073
|
}
|
|
1973
2074
|
};
|
|
1974
2075
|
const canSend = Boolean(value.trim() || files.length > 0 || references.length > 0);
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
/* @__PURE__ */ jsx8(Paperclip, { className: "size-7 text-brand-600" }),
|
|
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" }),
|
|
1979
2079
|
/* @__PURE__ */ jsx8("p", { className: "text-base font-semibold text-text-primary", children: t.dropFiles }),
|
|
1980
2080
|
/* @__PURE__ */ jsx8("p", { className: "text-xs text-text-secondary", children: t.dropHint })
|
|
1981
2081
|
] }) }),
|
|
@@ -1997,7 +2097,7 @@ function Composer({
|
|
|
1997
2097
|
/* @__PURE__ */ jsx8(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1998
2098
|
files.length > 1 ? t.uploadingN(files.length) : t.uploading
|
|
1999
2099
|
] }),
|
|
2000
|
-
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: [
|
|
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: [
|
|
2001
2101
|
mimeOf(a.file).startsWith("image/") ? /* @__PURE__ */ jsx8("img", { src: a.url, alt: a.file.name, className: "h-full w-full object-cover" }) : (
|
|
2002
2102
|
// Un PDF pintado con <img> es un recuadro roto: nombre, extensión y peso.
|
|
2003
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: [
|
|
@@ -2012,7 +2112,7 @@ function Composer({
|
|
|
2012
2112
|
type: "button",
|
|
2013
2113
|
onClick: () => removeFile(a.id),
|
|
2014
2114
|
"aria-label": t.removeAttachment,
|
|
2015
|
-
className: "absolute
|
|
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",
|
|
2016
2116
|
children: /* @__PURE__ */ jsx8(X, { className: "h-3 w-3" })
|
|
2017
2117
|
}
|
|
2018
2118
|
)
|
|
@@ -2030,18 +2130,29 @@ function Composer({
|
|
|
2030
2130
|
recRef.current?.stop();
|
|
2031
2131
|
},
|
|
2032
2132
|
"aria-label": t.cancelVoice,
|
|
2133
|
+
title: t.cancelVoice,
|
|
2033
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",
|
|
2034
2135
|
children: /* @__PURE__ */ jsx8(X, { className: "h-4 w-4" })
|
|
2035
2136
|
}
|
|
2036
2137
|
),
|
|
2037
|
-
/* @__PURE__ */ jsx8("span", { className: "
|
|
2138
|
+
/* @__PURE__ */ jsx8("span", { className: "h-2 w-2 shrink-0 animate-pulse rounded-full bg-red-500" }),
|
|
2038
2139
|
/* @__PURE__ */ jsxs6("span", { className: "w-10 shrink-0 font-mono text-xs tabular-nums text-text-secondary", children: [
|
|
2039
2140
|
Math.floor(seconds / 60),
|
|
2040
2141
|
":",
|
|
2041
2142
|
String(seconds % 60).padStart(2, "0")
|
|
2042
2143
|
] }),
|
|
2043
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)) }),
|
|
2044
|
-
/* @__PURE__ */ jsx8(
|
|
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
|
+
)
|
|
2045
2156
|
] })
|
|
2046
2157
|
) : /* @__PURE__ */ jsx8(
|
|
2047
2158
|
"textarea",
|
|
@@ -2060,12 +2171,12 @@ function Composer({
|
|
|
2060
2171
|
onRemoveReference?.(references[references.length - 1].id);
|
|
2061
2172
|
}
|
|
2062
2173
|
},
|
|
2063
|
-
className: "
|
|
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"
|
|
2064
2175
|
}
|
|
2065
2176
|
),
|
|
2066
2177
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2067
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden", children: [
|
|
2068
|
-
withFiles && /* @__PURE__ */ jsxs6(
|
|
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: [
|
|
2069
2180
|
/* @__PURE__ */ jsx8(
|
|
2070
2181
|
"button",
|
|
2071
2182
|
{
|
|
@@ -2078,10 +2189,11 @@ function Composer({
|
|
|
2078
2189
|
disabled: busy || !canSeeImages || files.length >= maxFiles,
|
|
2079
2190
|
"aria-label": canSeeImages ? t.attachImage : t.noImages,
|
|
2080
2191
|
title: canSeeImages ? t.attachImage : t.noImages,
|
|
2081
|
-
className:
|
|
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",
|
|
2082
2193
|
children: /* @__PURE__ */ jsx8(Image, { className: "h-4 w-4" })
|
|
2083
2194
|
}
|
|
2084
2195
|
),
|
|
2196
|
+
extras,
|
|
2085
2197
|
/* @__PURE__ */ jsx8(
|
|
2086
2198
|
"button",
|
|
2087
2199
|
{
|
|
@@ -2094,16 +2206,27 @@ function Composer({
|
|
|
2094
2206
|
disabled: busy || files.length >= maxFiles,
|
|
2095
2207
|
"aria-label": t.attachFile,
|
|
2096
2208
|
title: t.attachFile,
|
|
2097
|
-
className:
|
|
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",
|
|
2098
2210
|
children: /* @__PURE__ */ jsx8(Paperclip, { className: "h-4 w-4" })
|
|
2099
2211
|
}
|
|
2100
2212
|
)
|
|
2101
2213
|
] }),
|
|
2102
|
-
extras,
|
|
2214
|
+
!withFiles && extras,
|
|
2103
2215
|
models.length > 0 && onModelChange && /* @__PURE__ */ jsx8(ModelPicker, { models, current: currentModel, onChange: onModelChange })
|
|
2104
2216
|
] }),
|
|
2105
2217
|
/* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
2106
|
-
canRecord && !recording && /* @__PURE__ */ jsx8(
|
|
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
|
+
),
|
|
2107
2230
|
/* @__PURE__ */ jsx8(
|
|
2108
2231
|
"button",
|
|
2109
2232
|
{
|
|
@@ -2111,8 +2234,7 @@ function Composer({
|
|
|
2111
2234
|
onClick: busy ? onStop : () => void submit(),
|
|
2112
2235
|
disabled: !busy && !canSend || uploading,
|
|
2113
2236
|
"aria-label": busy ? t.stop : uploading ? t.uploading : t.send,
|
|
2114
|
-
|
|
2115
|
-
className: "piloto-send flex h-8 w-8 items-center justify-center rounded-full transition-colors",
|
|
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"}`,
|
|
2116
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" })
|
|
2117
2239
|
}
|
|
2118
2240
|
)
|
|
@@ -2137,7 +2259,7 @@ function ModelPicker({ models, current, onChange }) {
|
|
|
2137
2259
|
document.removeEventListener("keydown", escape);
|
|
2138
2260
|
};
|
|
2139
2261
|
}, [open]);
|
|
2140
|
-
if (
|
|
2262
|
+
if (models.length === 0) return null;
|
|
2141
2263
|
const active = models.find((m) => m.value === current) ?? null;
|
|
2142
2264
|
return /* @__PURE__ */ jsxs6("div", { ref: box, className: "relative", children: [
|
|
2143
2265
|
/* @__PURE__ */ jsxs6(
|
|
@@ -2146,7 +2268,7 @@ function ModelPicker({ models, current, onChange }) {
|
|
|
2146
2268
|
type: "button",
|
|
2147
2269
|
"aria-expanded": open,
|
|
2148
2270
|
onClick: () => setOpen((v) => !v),
|
|
2149
|
-
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",
|
|
2150
2272
|
children: [
|
|
2151
2273
|
/* @__PURE__ */ jsx8(Cpu, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
2152
2274
|
/* @__PURE__ */ jsx8("span", { className: "truncate", children: active?.name ?? t.model }),
|
|
@@ -2154,7 +2276,8 @@ function ModelPicker({ models, current, onChange }) {
|
|
|
2154
2276
|
]
|
|
2155
2277
|
}
|
|
2156
2278
|
),
|
|
2157
|
-
open &&
|
|
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(
|
|
2158
2281
|
"button",
|
|
2159
2282
|
{
|
|
2160
2283
|
type: "button",
|
|
@@ -2174,13 +2297,13 @@ function ModelPicker({ models, current, onChange }) {
|
|
|
2174
2297
|
}
|
|
2175
2298
|
|
|
2176
2299
|
// src/react/Status.tsx
|
|
2177
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
2300
|
+
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
|
|
2178
2301
|
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
2179
2302
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2180
2303
|
var WAKING_GIVEUP_S = 45;
|
|
2181
2304
|
var STILL_WORKING_S = 90;
|
|
2182
2305
|
function TypingDots() {
|
|
2183
|
-
return /* @__PURE__ */ jsx9("div", { className: "
|
|
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)) });
|
|
2184
2307
|
}
|
|
2185
2308
|
function WaitLabel({
|
|
2186
2309
|
phase,
|
|
@@ -2198,20 +2321,31 @@ function WaitLabel({
|
|
|
2198
2321
|
}, []);
|
|
2199
2322
|
const seconds = Math.max(0, Math.floor((now - (since || mounted)) / 1e3));
|
|
2200
2323
|
const phrases = t.thinkingPhrases;
|
|
2201
|
-
const what = phase !== "session" ? t.waitPhase[phase] : phrases?.length ? (
|
|
2202
|
-
// Frases propias de la app (el widget de un cliente): rotan cada 4 s.
|
|
2203
|
-
elsewhere || seconds >= STILL_WORKING_S ? t.stillWorking : phrases[Math.floor(seconds / 4) % phrases.length]
|
|
2204
|
-
) : 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);
|
|
2205
2325
|
const lost = phase === "waking" && seconds >= WAKING_GIVEUP_S;
|
|
2206
|
-
return /* @__PURE__ */ jsx9("div", { className: "
|
|
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: [
|
|
2207
2327
|
t.cantStart,
|
|
2208
2328
|
" ",
|
|
2209
2329
|
/* @__PURE__ */ jsx9("button", { type: "button", onClick: onLost, className: "cursor-pointer underline underline-offset-2", children: t.retry })
|
|
2210
2330
|
] }) : (
|
|
2211
|
-
// La frase cambia con fundido (sale y entra)
|
|
2331
|
+
// La frase cambia con fundido (sale y entra), como en claude.ai.
|
|
2212
2332
|
/* @__PURE__ */ jsxs7("p", { className: "flex items-center", children: [
|
|
2213
|
-
/* @__PURE__ */ jsx9(
|
|
2214
|
-
|
|
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
|
+
] })
|
|
2215
2349
|
] })
|
|
2216
2350
|
) });
|
|
2217
2351
|
}
|
|
@@ -2219,48 +2353,74 @@ var PHASES = ["waking", "connecting", "session"];
|
|
|
2219
2353
|
function ConnectingState({ phase, error, avatar, onRetry }) {
|
|
2220
2354
|
const { strings: t } = usePiloto();
|
|
2221
2355
|
const current = PHASES.indexOf(phase);
|
|
2222
|
-
return /* @__PURE__ */ jsxs7(
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
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 })
|
|
2256
2420
|
] })
|
|
2257
|
-
]
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
/* @__PURE__ */ jsx9("p", { className: "text-sm text-text-danger", children: error }),
|
|
2261
|
-
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 })
|
|
2262
|
-
] })
|
|
2263
|
-
] });
|
|
2421
|
+
]
|
|
2422
|
+
}
|
|
2423
|
+
);
|
|
2264
2424
|
}
|
|
2265
2425
|
|
|
2266
2426
|
// src/react/usePilot.ts
|
|
@@ -2436,7 +2596,7 @@ function useSseTransport(base, opts) {
|
|
|
2436
2596
|
}
|
|
2437
2597
|
|
|
2438
2598
|
// src/react/Piloto.tsx
|
|
2439
|
-
import { Fragment as
|
|
2599
|
+
import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2440
2600
|
var useIsoLayoutEffect = typeof window === "undefined" ? useEffect6 : useLayoutEffect;
|
|
2441
2601
|
var ANCHOR_GAP = 24;
|
|
2442
2602
|
var Piloto = forwardRef3(function Piloto2(props, handle) {
|
|
@@ -2611,51 +2771,61 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
|
|
|
2611
2771
|
const id = setTimeout(() => setSlowConnect(true), 800);
|
|
2612
2772
|
return () => clearTimeout(id);
|
|
2613
2773
|
}, [connected]);
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
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
|
+
] });
|
|
2638
2804
|
const permissionCards = cards.map((p) => /* @__PURE__ */ jsx10(ConfirmCard, { request: p, onRespond: respond, onSettled: settle, onExpire: pilot.expirePermission }, p.id));
|
|
2639
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 ? (
|
|
2640
|
-
//
|
|
2641
|
-
//
|
|
2642
|
-
/* @__PURE__ */ jsxs8("div", { className: "
|
|
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: [
|
|
2643
2809
|
slots.headerActions && /* @__PURE__ */ jsx10("div", { className: "absolute right-4 top-3 flex gap-2", children: slots.headerActions }),
|
|
2644
|
-
/* @__PURE__ */ jsxs8("div", { className: "
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
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 })) })
|
|
2655
2825
|
] })
|
|
2656
2826
|
] })
|
|
2657
|
-
) : /* @__PURE__ */ jsxs8(
|
|
2658
|
-
slots.headerActions && /* @__PURE__ */ jsx10("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 }),
|
|
2659
2829
|
/* @__PURE__ */ jsxs8(
|
|
2660
2830
|
"div",
|
|
2661
2831
|
{
|
|
@@ -2670,9 +2840,9 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
|
|
|
2670
2840
|
if (touchY.current != null && y != null && y > touchY.current + 4) release();
|
|
2671
2841
|
},
|
|
2672
2842
|
onKeyDown: (e) => ["ArrowUp", "PageUp", "Home"].includes(e.key) && release(),
|
|
2673
|
-
className: "
|
|
2843
|
+
className: "gs-scroll relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden",
|
|
2674
2844
|
children: [
|
|
2675
|
-
/* @__PURE__ */ jsxs8("div", { ref: column, className: "
|
|
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: [
|
|
2676
2846
|
turns.map((turn, i) => {
|
|
2677
2847
|
const isLast = i === turns.length - 1;
|
|
2678
2848
|
const live = busy && isLast;
|
|
@@ -2685,6 +2855,7 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
|
|
|
2685
2855
|
onOption: isLast && !busy && features.replyOptions !== false ? (text) => send(text) : void 0,
|
|
2686
2856
|
showUsage: features.usage !== false,
|
|
2687
2857
|
showCopy: features.copy !== false,
|
|
2858
|
+
showDuration: features.duration !== false,
|
|
2688
2859
|
renderDeliveries: slots.renderDeliveries
|
|
2689
2860
|
}
|
|
2690
2861
|
) }, i);
|
|
@@ -2694,26 +2865,26 @@ var Piloto = forwardRef3(function Piloto2(props, handle) {
|
|
|
2694
2865
|
/* @__PURE__ */ jsx10(TypingDots, {}),
|
|
2695
2866
|
/* @__PURE__ */ jsx10(WaitLabel, { phase, since: state.turnStartedAt, elsewhere: state.elsewhere, onLost: pilot.abandonAndRetry, showDuration: features.duration !== false })
|
|
2696
2867
|
] }),
|
|
2697
|
-
interrupted && !busy && /* @__PURE__ */ jsxs8("p", { className: "
|
|
2868
|
+
interrupted && !busy && /* @__PURE__ */ jsxs8("p", { className: "text-sm text-text-secondary", children: [
|
|
2698
2869
|
/me quedé a medias|i stopped halfway/i.test(last?.text ?? "") ? t.interruptedOurFault : t.interrupted(interrupted.reason),
|
|
2699
2870
|
" ",
|
|
2700
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 })
|
|
2701
2872
|
] }),
|
|
2702
|
-
notice && /* @__PURE__ */ jsx10("p", { className: "
|
|
2703
|
-
error && /* @__PURE__ */ jsx10("p", { className: "
|
|
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 })
|
|
2704
2875
|
] }),
|
|
2705
2876
|
/* @__PURE__ */ jsx10("div", { ref: spacer, "aria-hidden": true })
|
|
2706
2877
|
]
|
|
2707
2878
|
}
|
|
2708
2879
|
),
|
|
2709
|
-
/* @__PURE__ */ jsxs8("div", { className: "
|
|
2880
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative mx-auto w-full max-w-[784px] px-4 pb-4 sm:px-6 sm:pb-6", children: [
|
|
2710
2881
|
!atBottom && /* @__PURE__ */ jsx10(
|
|
2711
2882
|
"button",
|
|
2712
2883
|
{
|
|
2713
2884
|
type: "button",
|
|
2714
2885
|
onClick: toBottom,
|
|
2715
2886
|
"aria-label": t.goToLatest,
|
|
2716
|
-
className: "
|
|
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",
|
|
2717
2888
|
children: /* @__PURE__ */ jsx10(ArrowDown, { className: "h-4 w-4" })
|
|
2718
2889
|
}
|
|
2719
2890
|
),
|