@lukeashford/aurelius 3.1.0 → 3.2.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/dist/index.d.mts +11 -60
- package/dist/index.d.ts +11 -60
- package/dist/index.js +248 -391
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -348
- package/dist/index.mjs.map +1 -1
- package/llms.md +3 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ __export(index_exports, {
|
|
|
53
53
|
BreadcrumbLink: () => BreadcrumbLink,
|
|
54
54
|
Button: () => Button,
|
|
55
55
|
Card: () => Card,
|
|
56
|
+
ChatBubbleIcon: () => ChatBubbleIcon,
|
|
56
57
|
ChatInput: () => ChatInput,
|
|
57
58
|
ChatInterface: () => ChatInterface,
|
|
58
59
|
ChatView: () => ChatView,
|
|
@@ -62,11 +63,9 @@ __export(index_exports, {
|
|
|
62
63
|
ChevronRightIcon: () => ChevronRightIcon,
|
|
63
64
|
CloseIcon: () => CloseIcon,
|
|
64
65
|
Col: () => Col,
|
|
65
|
-
CollapsedSidebarToggle: () => CollapsedSidebarToggle,
|
|
66
66
|
ColorSwatch: () => ColorSwatch,
|
|
67
67
|
ConfirmDialog: () => ConfirmDialog,
|
|
68
68
|
Container: () => Container,
|
|
69
|
-
ConversationSidebar: () => ConversationSidebar,
|
|
70
69
|
CrossSquareIcon: () => CrossSquareIcon,
|
|
71
70
|
Divider: () => Divider,
|
|
72
71
|
Drawer: () => Drawer,
|
|
@@ -3474,9 +3473,9 @@ var Stepper = import_react40.default.forwardRef(
|
|
|
3474
3473
|
);
|
|
3475
3474
|
Stepper.displayName = "Stepper";
|
|
3476
3475
|
|
|
3477
|
-
// src/components/icons/
|
|
3476
|
+
// src/components/icons/ChatBubbleIcon.tsx
|
|
3478
3477
|
var import_react41 = __toESM(require("react"));
|
|
3479
|
-
function
|
|
3478
|
+
function ChatBubbleIcon({ className, ...props }) {
|
|
3480
3479
|
return /* @__PURE__ */ import_react41.default.createElement(
|
|
3481
3480
|
"svg",
|
|
3482
3481
|
{
|
|
@@ -3487,6 +3486,27 @@ function ChevronLeftIcon({ className, ...props }) {
|
|
|
3487
3486
|
...props
|
|
3488
3487
|
},
|
|
3489
3488
|
/* @__PURE__ */ import_react41.default.createElement(
|
|
3489
|
+
"path",
|
|
3490
|
+
{
|
|
3491
|
+
d: "M2 3h16v11H6l-4 3V3z"
|
|
3492
|
+
}
|
|
3493
|
+
)
|
|
3494
|
+
);
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
// src/components/icons/ChevronLeftIcon.tsx
|
|
3498
|
+
var import_react42 = __toESM(require("react"));
|
|
3499
|
+
function ChevronLeftIcon({ className, ...props }) {
|
|
3500
|
+
return /* @__PURE__ */ import_react42.default.createElement(
|
|
3501
|
+
"svg",
|
|
3502
|
+
{
|
|
3503
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3504
|
+
viewBox: "0 0 20 20",
|
|
3505
|
+
fill: "currentColor",
|
|
3506
|
+
className,
|
|
3507
|
+
...props
|
|
3508
|
+
},
|
|
3509
|
+
/* @__PURE__ */ import_react42.default.createElement(
|
|
3490
3510
|
"path",
|
|
3491
3511
|
{
|
|
3492
3512
|
fillRule: "evenodd",
|
|
@@ -3498,9 +3518,9 @@ function ChevronLeftIcon({ className, ...props }) {
|
|
|
3498
3518
|
}
|
|
3499
3519
|
|
|
3500
3520
|
// src/components/icons/ChevronRightIcon.tsx
|
|
3501
|
-
var
|
|
3521
|
+
var import_react43 = __toESM(require("react"));
|
|
3502
3522
|
function ChevronRightIcon({ className, ...props }) {
|
|
3503
|
-
return /* @__PURE__ */
|
|
3523
|
+
return /* @__PURE__ */ import_react43.default.createElement(
|
|
3504
3524
|
"svg",
|
|
3505
3525
|
{
|
|
3506
3526
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3509,7 +3529,7 @@ function ChevronRightIcon({ className, ...props }) {
|
|
|
3509
3529
|
className,
|
|
3510
3530
|
...props
|
|
3511
3531
|
},
|
|
3512
|
-
/* @__PURE__ */
|
|
3532
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
3513
3533
|
"path",
|
|
3514
3534
|
{
|
|
3515
3535
|
fillRule: "evenodd",
|
|
@@ -3521,9 +3541,9 @@ function ChevronRightIcon({ className, ...props }) {
|
|
|
3521
3541
|
}
|
|
3522
3542
|
|
|
3523
3543
|
// src/components/icons/CloseIcon.tsx
|
|
3524
|
-
var
|
|
3544
|
+
var import_react44 = __toESM(require("react"));
|
|
3525
3545
|
function CloseIcon({ className, ...props }) {
|
|
3526
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
3527
3547
|
"svg",
|
|
3528
3548
|
{
|
|
3529
3549
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3532,7 +3552,7 @@ function CloseIcon({ className, ...props }) {
|
|
|
3532
3552
|
className,
|
|
3533
3553
|
...props
|
|
3534
3554
|
},
|
|
3535
|
-
/* @__PURE__ */
|
|
3555
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
|
3536
3556
|
"path",
|
|
3537
3557
|
{
|
|
3538
3558
|
d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
|
@@ -3542,9 +3562,9 @@ function CloseIcon({ className, ...props }) {
|
|
|
3542
3562
|
}
|
|
3543
3563
|
|
|
3544
3564
|
// src/components/icons/ExpandIcon.tsx
|
|
3545
|
-
var
|
|
3565
|
+
var import_react45 = __toESM(require("react"));
|
|
3546
3566
|
function ExpandIcon({ className, ...props }) {
|
|
3547
|
-
return /* @__PURE__ */
|
|
3567
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
3548
3568
|
"svg",
|
|
3549
3569
|
{
|
|
3550
3570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3553,7 +3573,7 @@ function ExpandIcon({ className, ...props }) {
|
|
|
3553
3573
|
className,
|
|
3554
3574
|
...props
|
|
3555
3575
|
},
|
|
3556
|
-
/* @__PURE__ */
|
|
3576
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
3557
3577
|
"path",
|
|
3558
3578
|
{
|
|
3559
3579
|
d: "M13.28 7.78l3.22-3.22v2.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25v-4.5a.75.75 0 011.5 0v2.69l3.22-3.22a.75.75 0 011.06 1.06L4.56 16.5h2.69a.75.75 0 010 1.5h-4.5a.75.75 0 01-.75-.75z"
|
|
@@ -3563,9 +3583,9 @@ function ExpandIcon({ className, ...props }) {
|
|
|
3563
3583
|
}
|
|
3564
3584
|
|
|
3565
3585
|
// src/components/icons/HistoryIcon.tsx
|
|
3566
|
-
var
|
|
3586
|
+
var import_react46 = __toESM(require("react"));
|
|
3567
3587
|
function HistoryIcon({ className, ...props }) {
|
|
3568
|
-
return /* @__PURE__ */
|
|
3588
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
3569
3589
|
"svg",
|
|
3570
3590
|
{
|
|
3571
3591
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3574,7 +3594,7 @@ function HistoryIcon({ className, ...props }) {
|
|
|
3574
3594
|
className,
|
|
3575
3595
|
...props
|
|
3576
3596
|
},
|
|
3577
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3578
3598
|
"path",
|
|
3579
3599
|
{
|
|
3580
3600
|
fillRule: "evenodd",
|
|
@@ -3586,9 +3606,9 @@ function HistoryIcon({ className, ...props }) {
|
|
|
3586
3606
|
}
|
|
3587
3607
|
|
|
3588
3608
|
// src/components/icons/LayersIcon.tsx
|
|
3589
|
-
var
|
|
3609
|
+
var import_react47 = __toESM(require("react"));
|
|
3590
3610
|
function LayersIcon({ className, ...props }) {
|
|
3591
|
-
return /* @__PURE__ */
|
|
3611
|
+
return /* @__PURE__ */ import_react47.default.createElement(
|
|
3592
3612
|
"svg",
|
|
3593
3613
|
{
|
|
3594
3614
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3597,19 +3617,19 @@ function LayersIcon({ className, ...props }) {
|
|
|
3597
3617
|
className,
|
|
3598
3618
|
...props
|
|
3599
3619
|
},
|
|
3600
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3601
3621
|
"path",
|
|
3602
3622
|
{
|
|
3603
3623
|
d: "M3.196 12.87l-.825.483a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.758 0l7.25-4.25a.75.75 0 000-1.294l-.825-.484-5.666 3.322a2.25 2.25 0 01-2.276 0L3.196 12.87z"
|
|
3604
3624
|
}
|
|
3605
3625
|
),
|
|
3606
|
-
/* @__PURE__ */
|
|
3626
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3607
3627
|
"path",
|
|
3608
3628
|
{
|
|
3609
3629
|
d: "M3.196 8.87l-.825.483a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.758 0l7.25-4.25a.75.75 0 000-1.294l-.825-.484-5.666 3.322a2.25 2.25 0 01-2.276 0L3.196 8.87z"
|
|
3610
3630
|
}
|
|
3611
3631
|
),
|
|
3612
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3613
3633
|
"path",
|
|
3614
3634
|
{
|
|
3615
3635
|
d: "M10.38 1.103a.75.75 0 00-.76 0l-7.25 4.25a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.76 0l7.25-4.25a.75.75 0 000-1.294l-7.25-4.25z"
|
|
@@ -3619,9 +3639,9 @@ function LayersIcon({ className, ...props }) {
|
|
|
3619
3639
|
}
|
|
3620
3640
|
|
|
3621
3641
|
// src/components/icons/MediaIcon.tsx
|
|
3622
|
-
var
|
|
3642
|
+
var import_react48 = __toESM(require("react"));
|
|
3623
3643
|
function MediaIcon({ className, ...props }) {
|
|
3624
|
-
return /* @__PURE__ */
|
|
3644
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
3625
3645
|
"svg",
|
|
3626
3646
|
{
|
|
3627
3647
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3630,7 +3650,7 @@ function MediaIcon({ className, ...props }) {
|
|
|
3630
3650
|
className,
|
|
3631
3651
|
...props
|
|
3632
3652
|
},
|
|
3633
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ import_react48.default.createElement(
|
|
3634
3654
|
"path",
|
|
3635
3655
|
{
|
|
3636
3656
|
fillRule: "evenodd",
|
|
@@ -3642,9 +3662,9 @@ function MediaIcon({ className, ...props }) {
|
|
|
3642
3662
|
}
|
|
3643
3663
|
|
|
3644
3664
|
// src/components/icons/PlusIcon.tsx
|
|
3645
|
-
var
|
|
3665
|
+
var import_react49 = __toESM(require("react"));
|
|
3646
3666
|
function PlusIcon({ className, ...props }) {
|
|
3647
|
-
return /* @__PURE__ */
|
|
3667
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
3648
3668
|
"svg",
|
|
3649
3669
|
{
|
|
3650
3670
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3653,7 +3673,7 @@ function PlusIcon({ className, ...props }) {
|
|
|
3653
3673
|
className,
|
|
3654
3674
|
...props
|
|
3655
3675
|
},
|
|
3656
|
-
/* @__PURE__ */
|
|
3676
|
+
/* @__PURE__ */ import_react49.default.createElement(
|
|
3657
3677
|
"path",
|
|
3658
3678
|
{
|
|
3659
3679
|
d: "M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"
|
|
@@ -3663,9 +3683,9 @@ function PlusIcon({ className, ...props }) {
|
|
|
3663
3683
|
}
|
|
3664
3684
|
|
|
3665
3685
|
// src/components/icons/CheckSquareIcon.tsx
|
|
3666
|
-
var
|
|
3686
|
+
var import_react50 = __toESM(require("react"));
|
|
3667
3687
|
function CheckSquareIcon({ className, ...props }) {
|
|
3668
|
-
return /* @__PURE__ */
|
|
3688
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
3669
3689
|
"div",
|
|
3670
3690
|
{
|
|
3671
3691
|
className: cx(
|
|
@@ -3674,14 +3694,14 @@ function CheckSquareIcon({ className, ...props }) {
|
|
|
3674
3694
|
),
|
|
3675
3695
|
...props
|
|
3676
3696
|
},
|
|
3677
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3678
3698
|
"svg",
|
|
3679
3699
|
{
|
|
3680
3700
|
viewBox: "0 0 16 16",
|
|
3681
3701
|
fill: "none",
|
|
3682
3702
|
className: "absolute inset-0 w-full h-full p-0.5"
|
|
3683
3703
|
},
|
|
3684
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3685
3705
|
"path",
|
|
3686
3706
|
{
|
|
3687
3707
|
d: "M3 8l3 3 7-7",
|
|
@@ -3697,9 +3717,9 @@ function CheckSquareIcon({ className, ...props }) {
|
|
|
3697
3717
|
}
|
|
3698
3718
|
|
|
3699
3719
|
// src/components/icons/EmptySquareIcon.tsx
|
|
3700
|
-
var
|
|
3720
|
+
var import_react51 = __toESM(require("react"));
|
|
3701
3721
|
function EmptySquareIcon({ className, ...props }) {
|
|
3702
|
-
return /* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
3703
3723
|
"div",
|
|
3704
3724
|
{
|
|
3705
3725
|
className: cx(
|
|
@@ -3712,9 +3732,9 @@ function EmptySquareIcon({ className, ...props }) {
|
|
|
3712
3732
|
}
|
|
3713
3733
|
|
|
3714
3734
|
// src/components/icons/CrossSquareIcon.tsx
|
|
3715
|
-
var
|
|
3735
|
+
var import_react52 = __toESM(require("react"));
|
|
3716
3736
|
function CrossSquareIcon({ className, variant = "cancelled", ...props }) {
|
|
3717
|
-
return /* @__PURE__ */
|
|
3737
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3718
3738
|
"div",
|
|
3719
3739
|
{
|
|
3720
3740
|
className: cx(
|
|
@@ -3724,14 +3744,14 @@ function CrossSquareIcon({ className, variant = "cancelled", ...props }) {
|
|
|
3724
3744
|
),
|
|
3725
3745
|
...props
|
|
3726
3746
|
},
|
|
3727
|
-
/* @__PURE__ */
|
|
3747
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
3728
3748
|
"svg",
|
|
3729
3749
|
{
|
|
3730
3750
|
viewBox: "0 0 16 16",
|
|
3731
3751
|
fill: "none",
|
|
3732
3752
|
className: "absolute inset-0 w-full h-full p-0.5"
|
|
3733
3753
|
},
|
|
3734
|
-
/* @__PURE__ */
|
|
3754
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
3735
3755
|
"path",
|
|
3736
3756
|
{
|
|
3737
3757
|
d: "M4 4l8 8M12 4l-8 8",
|
|
@@ -3746,15 +3766,15 @@ function CrossSquareIcon({ className, variant = "cancelled", ...props }) {
|
|
|
3746
3766
|
}
|
|
3747
3767
|
|
|
3748
3768
|
// src/components/icons/SquareLoaderIcon.tsx
|
|
3749
|
-
var
|
|
3769
|
+
var import_react53 = __toESM(require("react"));
|
|
3750
3770
|
function SquareLoaderIcon({ className, ...props }) {
|
|
3751
|
-
return /* @__PURE__ */
|
|
3771
|
+
return /* @__PURE__ */ import_react53.default.createElement("div", { className: cx("relative w-4 h-4 flex-shrink-0", className), ...props }, /* @__PURE__ */ import_react53.default.createElement(
|
|
3752
3772
|
"svg",
|
|
3753
3773
|
{
|
|
3754
3774
|
viewBox: "0 0 16 16",
|
|
3755
3775
|
className: "w-full h-full animate-snake-spin"
|
|
3756
3776
|
},
|
|
3757
|
-
/* @__PURE__ */
|
|
3777
|
+
/* @__PURE__ */ import_react53.default.createElement(
|
|
3758
3778
|
"rect",
|
|
3759
3779
|
{
|
|
3760
3780
|
x: "1",
|
|
@@ -3767,7 +3787,7 @@ function SquareLoaderIcon({ className, ...props }) {
|
|
|
3767
3787
|
className: "text-ash/40"
|
|
3768
3788
|
}
|
|
3769
3789
|
),
|
|
3770
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ import_react53.default.createElement(
|
|
3771
3791
|
"rect",
|
|
3772
3792
|
{
|
|
3773
3793
|
x: "1",
|
|
@@ -3786,10 +3806,10 @@ function SquareLoaderIcon({ className, ...props }) {
|
|
|
3786
3806
|
}
|
|
3787
3807
|
|
|
3788
3808
|
// src/components/Message.tsx
|
|
3789
|
-
var
|
|
3809
|
+
var import_react55 = __toESM(require("react"));
|
|
3790
3810
|
|
|
3791
3811
|
// src/components/MarkdownContent.tsx
|
|
3792
|
-
var
|
|
3812
|
+
var import_react54 = __toESM(require("react"));
|
|
3793
3813
|
var import_dompurify = __toESM(require("dompurify"));
|
|
3794
3814
|
var import_marked = require("marked");
|
|
3795
3815
|
var DEFAULT_SANITIZE_CONFIG = {
|
|
@@ -3860,7 +3880,7 @@ var DEFAULT_SANITIZE_CONFIG = {
|
|
|
3860
3880
|
ALLOWED_URI_REGEXP: /^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i
|
|
3861
3881
|
};
|
|
3862
3882
|
function useDOMPurifySetup() {
|
|
3863
|
-
(0,
|
|
3883
|
+
(0, import_react54.useMemo)(() => {
|
|
3864
3884
|
import_dompurify.default.addHook("afterSanitizeAttributes", (node) => {
|
|
3865
3885
|
if (node.tagName === "A") {
|
|
3866
3886
|
node.setAttribute("target", "_blank");
|
|
@@ -3896,10 +3916,10 @@ function injectStreamingCursor(html, cursorClassName) {
|
|
|
3896
3916
|
target.insertAdjacentHTML("beforeend", cursorHtml);
|
|
3897
3917
|
return container.innerHTML;
|
|
3898
3918
|
}
|
|
3899
|
-
var MarkdownContent =
|
|
3919
|
+
var MarkdownContent = import_react54.default.forwardRef(
|
|
3900
3920
|
({ className, content, isMarkdown = true, sanitizeConfig, isStreaming, cursorClassName, ...rest }, ref) => {
|
|
3901
3921
|
useDOMPurifySetup();
|
|
3902
|
-
const sanitizedHtml = (0,
|
|
3922
|
+
const sanitizedHtml = (0, import_react54.useMemo)(() => {
|
|
3903
3923
|
if (!content && !isStreaming) {
|
|
3904
3924
|
return "";
|
|
3905
3925
|
}
|
|
@@ -3921,7 +3941,7 @@ var MarkdownContent = import_react53.default.forwardRef(
|
|
|
3921
3941
|
}
|
|
3922
3942
|
return sanitized;
|
|
3923
3943
|
}, [content, sanitizeConfig, isStreaming, cursorClassName]);
|
|
3924
|
-
return /* @__PURE__ */
|
|
3944
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
3925
3945
|
"div",
|
|
3926
3946
|
{
|
|
3927
3947
|
ref,
|
|
@@ -3939,7 +3959,7 @@ var variantStyles2 = {
|
|
|
3939
3959
|
user: "bg-gold text-obsidian ml-auto",
|
|
3940
3960
|
assistant: "bg-charcoal border border-ash text-white mr-auto"
|
|
3941
3961
|
};
|
|
3942
|
-
var ActionButton = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
3962
|
+
var ActionButton = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ import_react55.default.createElement(
|
|
3943
3963
|
"button",
|
|
3944
3964
|
{
|
|
3945
3965
|
type: "button",
|
|
@@ -3955,7 +3975,7 @@ var ActionButton = ({ onClick, label, children, className, disabled }) => /* @__
|
|
|
3955
3975
|
},
|
|
3956
3976
|
children
|
|
3957
3977
|
);
|
|
3958
|
-
var CopyIcon = () => /* @__PURE__ */
|
|
3978
|
+
var CopyIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
3959
3979
|
"svg",
|
|
3960
3980
|
{
|
|
3961
3981
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3967,10 +3987,10 @@ var CopyIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
3967
3987
|
strokeLinejoin: "round",
|
|
3968
3988
|
className: "w-3.5 h-3.5"
|
|
3969
3989
|
},
|
|
3970
|
-
/* @__PURE__ */
|
|
3971
|
-
/* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ import_react55.default.createElement("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
3991
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
3972
3992
|
);
|
|
3973
|
-
var CheckIcon = () => /* @__PURE__ */
|
|
3993
|
+
var CheckIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
3974
3994
|
"svg",
|
|
3975
3995
|
{
|
|
3976
3996
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3982,9 +4002,9 @@ var CheckIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
3982
4002
|
strokeLinejoin: "round",
|
|
3983
4003
|
className: "w-3.5 h-3.5 text-success"
|
|
3984
4004
|
},
|
|
3985
|
-
/* @__PURE__ */
|
|
4005
|
+
/* @__PURE__ */ import_react55.default.createElement("polyline", { points: "20 6 9 17 4 12" })
|
|
3986
4006
|
);
|
|
3987
|
-
var PencilIcon = () => /* @__PURE__ */
|
|
4007
|
+
var PencilIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
3988
4008
|
"svg",
|
|
3989
4009
|
{
|
|
3990
4010
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3996,10 +4016,10 @@ var PencilIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
3996
4016
|
strokeLinejoin: "round",
|
|
3997
4017
|
className: "w-3.5 h-3.5"
|
|
3998
4018
|
},
|
|
3999
|
-
/* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4019
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" }),
|
|
4020
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "m15 5 4 4" })
|
|
4001
4021
|
);
|
|
4002
|
-
var RetryIcon = () => /* @__PURE__ */
|
|
4022
|
+
var RetryIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
4003
4023
|
"svg",
|
|
4004
4024
|
{
|
|
4005
4025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4011,12 +4031,12 @@ var RetryIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
4011
4031
|
strokeLinejoin: "round",
|
|
4012
4032
|
className: "w-3.5 h-3.5"
|
|
4013
4033
|
},
|
|
4014
|
-
/* @__PURE__ */
|
|
4015
|
-
/* @__PURE__ */
|
|
4016
|
-
/* @__PURE__ */
|
|
4017
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
4035
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M21 3v5h-5" }),
|
|
4036
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
4037
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M8 16H3v5" })
|
|
4018
4038
|
);
|
|
4019
|
-
var ChevronLeftIcon2 = () => /* @__PURE__ */
|
|
4039
|
+
var ChevronLeftIcon2 = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
4020
4040
|
"svg",
|
|
4021
4041
|
{
|
|
4022
4042
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4028,9 +4048,9 @@ var ChevronLeftIcon2 = () => /* @__PURE__ */ import_react54.default.createElemen
|
|
|
4028
4048
|
strokeLinejoin: "round",
|
|
4029
4049
|
className: "w-3 h-3"
|
|
4030
4050
|
},
|
|
4031
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "m15 18-6-6 6-6" })
|
|
4032
4052
|
);
|
|
4033
|
-
var ChevronRightIcon2 = () => /* @__PURE__ */
|
|
4053
|
+
var ChevronRightIcon2 = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
4034
4054
|
"svg",
|
|
4035
4055
|
{
|
|
4036
4056
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4042,9 +4062,9 @@ var ChevronRightIcon2 = () => /* @__PURE__ */ import_react54.default.createEleme
|
|
|
4042
4062
|
strokeLinejoin: "round",
|
|
4043
4063
|
className: "w-3 h-3"
|
|
4044
4064
|
},
|
|
4045
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "m9 18 6-6-6-6" })
|
|
4046
4066
|
);
|
|
4047
|
-
var GitBranchIcon = () => /* @__PURE__ */
|
|
4067
|
+
var GitBranchIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
4048
4068
|
"svg",
|
|
4049
4069
|
{
|
|
4050
4070
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4056,12 +4076,12 @@ var GitBranchIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
4056
4076
|
strokeLinejoin: "round",
|
|
4057
4077
|
className: "w-3 h-3 mr-0.5 text-silver/50"
|
|
4058
4078
|
},
|
|
4059
|
-
/* @__PURE__ */
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
/* @__PURE__ */
|
|
4062
|
-
/* @__PURE__ */
|
|
4079
|
+
/* @__PURE__ */ import_react55.default.createElement("line", { x1: "6", x2: "6", y1: "3", y2: "15" }),
|
|
4080
|
+
/* @__PURE__ */ import_react55.default.createElement("circle", { cx: "18", cy: "6", r: "3" }),
|
|
4081
|
+
/* @__PURE__ */ import_react55.default.createElement("circle", { cx: "6", cy: "18", r: "3" }),
|
|
4082
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })
|
|
4063
4083
|
);
|
|
4064
|
-
var XIcon = () => /* @__PURE__ */
|
|
4084
|
+
var XIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
4065
4085
|
"svg",
|
|
4066
4086
|
{
|
|
4067
4087
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4073,10 +4093,10 @@ var XIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
4073
4093
|
strokeLinejoin: "round",
|
|
4074
4094
|
className: "w-4 h-4"
|
|
4075
4095
|
},
|
|
4076
|
-
/* @__PURE__ */
|
|
4077
|
-
/* @__PURE__ */
|
|
4096
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M18 6 6 18" }),
|
|
4097
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "m6 6 12 12" })
|
|
4078
4098
|
);
|
|
4079
|
-
var SendIcon = () => /* @__PURE__ */
|
|
4099
|
+
var SendIcon = () => /* @__PURE__ */ import_react55.default.createElement(
|
|
4080
4100
|
"svg",
|
|
4081
4101
|
{
|
|
4082
4102
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4088,10 +4108,10 @@ var SendIcon = () => /* @__PURE__ */ import_react54.default.createElement(
|
|
|
4088
4108
|
strokeLinejoin: "round",
|
|
4089
4109
|
className: "w-4 h-4"
|
|
4090
4110
|
},
|
|
4091
|
-
/* @__PURE__ */
|
|
4092
|
-
/* @__PURE__ */
|
|
4111
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "m22 2-7 20-4-9-9-4Z" }),
|
|
4112
|
+
/* @__PURE__ */ import_react55.default.createElement("path", { d: "M22 2 11 13" })
|
|
4093
4113
|
);
|
|
4094
|
-
var Message =
|
|
4114
|
+
var Message = import_react55.default.forwardRef(
|
|
4095
4115
|
({
|
|
4096
4116
|
variant = "assistant",
|
|
4097
4117
|
className,
|
|
@@ -4103,13 +4123,13 @@ var Message = import_react54.default.forwardRef(
|
|
|
4103
4123
|
...rest
|
|
4104
4124
|
}, ref) => {
|
|
4105
4125
|
const isUser = variant === "user";
|
|
4106
|
-
const [copied, setCopied] = (0,
|
|
4107
|
-
const [isEditing, setIsEditing] = (0,
|
|
4108
|
-
const [editValue, setEditValue] = (0,
|
|
4109
|
-
const textareaRef = (0,
|
|
4126
|
+
const [copied, setCopied] = (0, import_react55.useState)(false);
|
|
4127
|
+
const [isEditing, setIsEditing] = (0, import_react55.useState)(false);
|
|
4128
|
+
const [editValue, setEditValue] = (0, import_react55.useState)(content);
|
|
4129
|
+
const textareaRef = (0, import_react55.useRef)(null);
|
|
4110
4130
|
const showBranchNav = branchInfo && branchInfo.total > 1;
|
|
4111
4131
|
const showActions = actions && !hideActions && !isStreaming;
|
|
4112
|
-
(0,
|
|
4132
|
+
(0, import_react55.useEffect)(() => {
|
|
4113
4133
|
if (isEditing && textareaRef.current) {
|
|
4114
4134
|
const textarea = textareaRef.current;
|
|
4115
4135
|
textarea.style.height = "auto";
|
|
@@ -4163,7 +4183,7 @@ var Message = import_react54.default.forwardRef(
|
|
|
4163
4183
|
textarea.style.height = "auto";
|
|
4164
4184
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
4165
4185
|
};
|
|
4166
|
-
return /* @__PURE__ */
|
|
4186
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
4167
4187
|
"div",
|
|
4168
4188
|
{
|
|
4169
4189
|
ref,
|
|
@@ -4174,7 +4194,7 @@ var Message = import_react54.default.forwardRef(
|
|
|
4174
4194
|
),
|
|
4175
4195
|
...rest
|
|
4176
4196
|
},
|
|
4177
|
-
isUser && isEditing ? /* @__PURE__ */
|
|
4197
|
+
isUser && isEditing ? /* @__PURE__ */ import_react55.default.createElement("div", { className: "w-full max-w-11/12" }, /* @__PURE__ */ import_react55.default.createElement("div", { className: "relative bg-gold" }, /* @__PURE__ */ import_react55.default.createElement(
|
|
4178
4198
|
"textarea",
|
|
4179
4199
|
{
|
|
4180
4200
|
ref: textareaRef,
|
|
@@ -4184,7 +4204,7 @@ var Message = import_react54.default.forwardRef(
|
|
|
4184
4204
|
className: "w-full bg-transparent text-obsidian px-3 py-2 pr-20 resize-none outline-none min-h-10 text-sm",
|
|
4185
4205
|
rows: 1
|
|
4186
4206
|
}
|
|
4187
|
-
), /* @__PURE__ */
|
|
4207
|
+
), /* @__PURE__ */ import_react55.default.createElement("div", { className: "absolute right-1 top-1/2 -translate-y-1/2 flex gap-0.5" }, /* @__PURE__ */ import_react55.default.createElement(
|
|
4188
4208
|
"button",
|
|
4189
4209
|
{
|
|
4190
4210
|
type: "button",
|
|
@@ -4192,8 +4212,8 @@ var Message = import_react54.default.forwardRef(
|
|
|
4192
4212
|
className: "p-1.5 text-obsidian/60 hover:text-obsidian transition-colors",
|
|
4193
4213
|
"aria-label": "Cancel edit"
|
|
4194
4214
|
},
|
|
4195
|
-
/* @__PURE__ */
|
|
4196
|
-
), /* @__PURE__ */
|
|
4215
|
+
/* @__PURE__ */ import_react55.default.createElement(XIcon, null)
|
|
4216
|
+
), /* @__PURE__ */ import_react55.default.createElement(
|
|
4197
4217
|
"button",
|
|
4198
4218
|
{
|
|
4199
4219
|
type: "button",
|
|
@@ -4202,8 +4222,8 @@ var Message = import_react54.default.forwardRef(
|
|
|
4202
4222
|
className: "p-1.5 text-obsidian/60 hover:text-obsidian transition-colors disabled:opacity-30",
|
|
4203
4223
|
"aria-label": "Submit edit"
|
|
4204
4224
|
},
|
|
4205
|
-
/* @__PURE__ */
|
|
4206
|
-
)))) : /* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ import_react55.default.createElement(SendIcon, null)
|
|
4226
|
+
)))) : /* @__PURE__ */ import_react55.default.createElement(
|
|
4207
4227
|
"div",
|
|
4208
4228
|
{
|
|
4209
4229
|
className: cx(
|
|
@@ -4211,7 +4231,7 @@ var Message = import_react54.default.forwardRef(
|
|
|
4211
4231
|
variantStyles2[variant]
|
|
4212
4232
|
)
|
|
4213
4233
|
},
|
|
4214
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ import_react55.default.createElement(
|
|
4215
4235
|
MarkdownContent,
|
|
4216
4236
|
{
|
|
4217
4237
|
content,
|
|
@@ -4221,17 +4241,17 @@ var Message = import_react54.default.forwardRef(
|
|
|
4221
4241
|
}
|
|
4222
4242
|
)
|
|
4223
4243
|
),
|
|
4224
|
-
showActions && !isEditing && /* @__PURE__ */
|
|
4244
|
+
showActions && !isEditing && /* @__PURE__ */ import_react55.default.createElement("div", { className: cx(
|
|
4225
4245
|
"flex items-center gap-0.5 mt-1",
|
|
4226
4246
|
isUser ? "mr-1" : "ml-1"
|
|
4227
|
-
) }, actions.showCopy !== false && /* @__PURE__ */
|
|
4247
|
+
) }, actions.showCopy !== false && /* @__PURE__ */ import_react55.default.createElement(
|
|
4228
4248
|
ActionButton,
|
|
4229
4249
|
{
|
|
4230
4250
|
onClick: handleCopy,
|
|
4231
4251
|
label: copied ? "Copied!" : "Copy message"
|
|
4232
4252
|
},
|
|
4233
|
-
copied ? /* @__PURE__ */
|
|
4234
|
-
), isUser && actions.onEdit && /* @__PURE__ */
|
|
4253
|
+
copied ? /* @__PURE__ */ import_react55.default.createElement(CheckIcon, null) : /* @__PURE__ */ import_react55.default.createElement(CopyIcon, null)
|
|
4254
|
+
), isUser && actions.onEdit && /* @__PURE__ */ import_react55.default.createElement(ActionButton, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react55.default.createElement(PencilIcon, null)), !isUser && actions.onRetry && /* @__PURE__ */ import_react55.default.createElement(ActionButton, { onClick: actions.onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react55.default.createElement(RetryIcon, null)), showBranchNav && /* @__PURE__ */ import_react55.default.createElement(import_react55.default.Fragment, null, /* @__PURE__ */ import_react55.default.createElement("div", { className: "w-px h-4 bg-ash/40 mx-1" }), /* @__PURE__ */ import_react55.default.createElement("div", { className: "flex items-center gap-0.5 text-silver/70" }, /* @__PURE__ */ import_react55.default.createElement(GitBranchIcon, null), /* @__PURE__ */ import_react55.default.createElement(
|
|
4235
4255
|
"button",
|
|
4236
4256
|
{
|
|
4237
4257
|
type: "button",
|
|
@@ -4243,8 +4263,8 @@ var Message = import_react54.default.forwardRef(
|
|
|
4243
4263
|
),
|
|
4244
4264
|
"aria-label": "Previous branch"
|
|
4245
4265
|
},
|
|
4246
|
-
/* @__PURE__ */
|
|
4247
|
-
), /* @__PURE__ */
|
|
4266
|
+
/* @__PURE__ */ import_react55.default.createElement(ChevronLeftIcon2, null)
|
|
4267
|
+
), /* @__PURE__ */ import_react55.default.createElement("span", { className: "text-xs tabular-nums min-w-6 text-center" }, branchInfo.current, "/", branchInfo.total), /* @__PURE__ */ import_react55.default.createElement(
|
|
4248
4268
|
"button",
|
|
4249
4269
|
{
|
|
4250
4270
|
type: "button",
|
|
@@ -4256,7 +4276,7 @@ var Message = import_react54.default.forwardRef(
|
|
|
4256
4276
|
),
|
|
4257
4277
|
"aria-label": "Next branch"
|
|
4258
4278
|
},
|
|
4259
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ import_react55.default.createElement(ChevronRightIcon2, null)
|
|
4260
4280
|
))))
|
|
4261
4281
|
);
|
|
4262
4282
|
}
|
|
@@ -4264,15 +4284,15 @@ var Message = import_react54.default.forwardRef(
|
|
|
4264
4284
|
Message.displayName = "Message";
|
|
4265
4285
|
|
|
4266
4286
|
// src/components/StreamingCursor.tsx
|
|
4267
|
-
var
|
|
4268
|
-
var StreamingCursor =
|
|
4287
|
+
var import_react56 = __toESM(require("react"));
|
|
4288
|
+
var StreamingCursor = import_react56.default.forwardRef(
|
|
4269
4289
|
({ className, variant = "line", ...rest }, ref) => {
|
|
4270
4290
|
const variantStyles3 = {
|
|
4271
4291
|
block: "w-2.5 h-cursor translate-y-cursor-offset",
|
|
4272
4292
|
line: "w-0.5 h-cursor translate-y-cursor-offset",
|
|
4273
4293
|
underscore: "w-2.5 h-0.5 self-end mb-0.5"
|
|
4274
4294
|
};
|
|
4275
|
-
return /* @__PURE__ */
|
|
4295
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
4276
4296
|
"span",
|
|
4277
4297
|
{
|
|
4278
4298
|
ref,
|
|
@@ -4293,15 +4313,15 @@ StreamingCursor.displayName = "StreamingCursor";
|
|
|
4293
4313
|
var import_react77 = __toESM(require("react"));
|
|
4294
4314
|
|
|
4295
4315
|
// src/components/chat/ChatView.tsx
|
|
4296
|
-
var
|
|
4316
|
+
var import_react60 = __toESM(require("react"));
|
|
4297
4317
|
|
|
4298
4318
|
// src/components/chat/hooks/useScrollAnchor.ts
|
|
4299
|
-
var
|
|
4319
|
+
var import_react57 = require("react");
|
|
4300
4320
|
function useScrollAnchor(options = {}) {
|
|
4301
4321
|
const { behavior = "smooth", block = "start" } = options;
|
|
4302
|
-
const containerRef = (0,
|
|
4303
|
-
const anchorRef = (0,
|
|
4304
|
-
const scrollToAnchor = (0,
|
|
4322
|
+
const containerRef = (0, import_react57.useRef)(null);
|
|
4323
|
+
const anchorRef = (0, import_react57.useRef)(null);
|
|
4324
|
+
const scrollToAnchor = (0, import_react57.useCallback)(() => {
|
|
4305
4325
|
const el = anchorRef.current;
|
|
4306
4326
|
if (!el) {
|
|
4307
4327
|
return;
|
|
@@ -4312,7 +4332,7 @@ function useScrollAnchor(options = {}) {
|
|
|
4312
4332
|
});
|
|
4313
4333
|
});
|
|
4314
4334
|
}, [behavior, block]);
|
|
4315
|
-
const scrollToBottom = (0,
|
|
4335
|
+
const scrollToBottom = (0, import_react57.useCallback)(() => {
|
|
4316
4336
|
const container = containerRef.current;
|
|
4317
4337
|
if (!container) {
|
|
4318
4338
|
return;
|
|
@@ -4323,7 +4343,7 @@ function useScrollAnchor(options = {}) {
|
|
|
4323
4343
|
container.scrollTop = container.scrollHeight;
|
|
4324
4344
|
}
|
|
4325
4345
|
}, [behavior]);
|
|
4326
|
-
const isScrolledToBottom = (0,
|
|
4346
|
+
const isScrolledToBottom = (0, import_react57.useCallback)(() => {
|
|
4327
4347
|
const container = containerRef.current;
|
|
4328
4348
|
if (!container) {
|
|
4329
4349
|
return true;
|
|
@@ -4342,15 +4362,15 @@ function useScrollAnchor(options = {}) {
|
|
|
4342
4362
|
}
|
|
4343
4363
|
|
|
4344
4364
|
// src/components/chat/hooks/useAdaptiveSpacer.ts
|
|
4345
|
-
var
|
|
4365
|
+
var import_react58 = require("react");
|
|
4346
4366
|
function useAdaptiveSpacer(options = {}) {
|
|
4347
4367
|
const { minHeight = 0, containerRef: externalContainerRef, anchorRef } = options;
|
|
4348
|
-
const internalContainerRef = (0,
|
|
4368
|
+
const internalContainerRef = (0, import_react58.useRef)(null);
|
|
4349
4369
|
const containerRef = externalContainerRef ?? internalContainerRef;
|
|
4350
|
-
const contentRef = (0,
|
|
4351
|
-
const spacerRef = (0,
|
|
4352
|
-
const [spacerHeight, setSpacerHeight] = (0,
|
|
4353
|
-
const recalculate = (0,
|
|
4370
|
+
const contentRef = (0, import_react58.useRef)(null);
|
|
4371
|
+
const spacerRef = (0, import_react58.useRef)(null);
|
|
4372
|
+
const [spacerHeight, setSpacerHeight] = (0, import_react58.useState)(0);
|
|
4373
|
+
const recalculate = (0, import_react58.useCallback)(() => {
|
|
4354
4374
|
const container = containerRef.current;
|
|
4355
4375
|
const content = contentRef.current;
|
|
4356
4376
|
if (!container || !content) {
|
|
@@ -4374,7 +4394,7 @@ function useAdaptiveSpacer(options = {}) {
|
|
|
4374
4394
|
}
|
|
4375
4395
|
setSpacerHeight(newSpacerHeight);
|
|
4376
4396
|
}, [minHeight, anchorRef]);
|
|
4377
|
-
(0,
|
|
4397
|
+
(0, import_react58.useEffect)(() => {
|
|
4378
4398
|
const container = containerRef.current;
|
|
4379
4399
|
const content = contentRef.current;
|
|
4380
4400
|
if (!container || !content) {
|
|
@@ -4409,7 +4429,7 @@ function useAdaptiveSpacer(options = {}) {
|
|
|
4409
4429
|
}
|
|
4410
4430
|
|
|
4411
4431
|
// src/components/chat/ThinkingIndicator.tsx
|
|
4412
|
-
var
|
|
4432
|
+
var import_react59 = __toESM(require("react"));
|
|
4413
4433
|
var THINKING_PHRASES = [
|
|
4414
4434
|
"Consulting the ancient tomes...",
|
|
4415
4435
|
"Parsing the ineffable...",
|
|
@@ -4425,7 +4445,7 @@ var THINKING_PHRASES = [
|
|
|
4425
4445
|
"Consulting my inner monologue...",
|
|
4426
4446
|
"Summoning the muse..."
|
|
4427
4447
|
];
|
|
4428
|
-
var ThinkingIndicator =
|
|
4448
|
+
var ThinkingIndicator = import_react59.default.forwardRef(
|
|
4429
4449
|
({
|
|
4430
4450
|
isVisible = true,
|
|
4431
4451
|
phraseInterval = 2500,
|
|
@@ -4433,11 +4453,11 @@ var ThinkingIndicator = import_react58.default.forwardRef(
|
|
|
4433
4453
|
className,
|
|
4434
4454
|
...rest
|
|
4435
4455
|
}, ref) => {
|
|
4436
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
4456
|
+
const [currentIndex, setCurrentIndex] = (0, import_react59.useState)(
|
|
4437
4457
|
() => Math.floor(Math.random() * phrases.length)
|
|
4438
4458
|
);
|
|
4439
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
4440
|
-
(0,
|
|
4459
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react59.useState)(false);
|
|
4460
|
+
(0, import_react59.useEffect)(() => {
|
|
4441
4461
|
if (!isVisible || phrases.length <= 1) {
|
|
4442
4462
|
return;
|
|
4443
4463
|
}
|
|
@@ -4453,7 +4473,7 @@ var ThinkingIndicator = import_react58.default.forwardRef(
|
|
|
4453
4473
|
if (!isVisible) {
|
|
4454
4474
|
return null;
|
|
4455
4475
|
}
|
|
4456
|
-
return /* @__PURE__ */
|
|
4476
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
4457
4477
|
"div",
|
|
4458
4478
|
{
|
|
4459
4479
|
ref,
|
|
@@ -4467,26 +4487,26 @@ var ThinkingIndicator = import_react58.default.forwardRef(
|
|
|
4467
4487
|
"aria-live": "polite",
|
|
4468
4488
|
...rest
|
|
4469
4489
|
},
|
|
4470
|
-
/* @__PURE__ */
|
|
4490
|
+
/* @__PURE__ */ import_react59.default.createElement("div", { className: "flex gap-1", "aria-hidden": "true" }, /* @__PURE__ */ import_react59.default.createElement(
|
|
4471
4491
|
"span",
|
|
4472
4492
|
{
|
|
4473
4493
|
className: "w-1.5 h-1.5 bg-gold/60 rounded-full animate-pulse",
|
|
4474
4494
|
style: { animationDelay: "0ms" }
|
|
4475
4495
|
}
|
|
4476
|
-
), /* @__PURE__ */
|
|
4496
|
+
), /* @__PURE__ */ import_react59.default.createElement(
|
|
4477
4497
|
"span",
|
|
4478
4498
|
{
|
|
4479
4499
|
className: "w-1.5 h-1.5 bg-gold/60 rounded-full animate-pulse",
|
|
4480
4500
|
style: { animationDelay: "150ms" }
|
|
4481
4501
|
}
|
|
4482
|
-
), /* @__PURE__ */
|
|
4502
|
+
), /* @__PURE__ */ import_react59.default.createElement(
|
|
4483
4503
|
"span",
|
|
4484
4504
|
{
|
|
4485
4505
|
className: "w-1.5 h-1.5 bg-gold/60 rounded-full animate-pulse",
|
|
4486
4506
|
style: { animationDelay: "300ms" }
|
|
4487
4507
|
}
|
|
4488
4508
|
)),
|
|
4489
|
-
/* @__PURE__ */
|
|
4509
|
+
/* @__PURE__ */ import_react59.default.createElement(
|
|
4490
4510
|
"span",
|
|
4491
4511
|
{
|
|
4492
4512
|
className: cx(
|
|
@@ -4502,7 +4522,7 @@ var ThinkingIndicator = import_react58.default.forwardRef(
|
|
|
4502
4522
|
ThinkingIndicator.displayName = "ThinkingIndicator";
|
|
4503
4523
|
|
|
4504
4524
|
// src/components/chat/ChatView.tsx
|
|
4505
|
-
var ChatView =
|
|
4525
|
+
var ChatView = import_react60.default.forwardRef(
|
|
4506
4526
|
({ messages, latestUserMessageIndex, isStreaming, isThinking, onScroll, className, ...rest }, ref) => {
|
|
4507
4527
|
const { containerRef, anchorRef, scrollToAnchor } = useScrollAnchor({
|
|
4508
4528
|
behavior: "smooth",
|
|
@@ -4512,7 +4532,7 @@ var ChatView = import_react59.default.forwardRef(
|
|
|
4512
4532
|
containerRef,
|
|
4513
4533
|
anchorRef
|
|
4514
4534
|
});
|
|
4515
|
-
(0,
|
|
4535
|
+
(0, import_react60.useEffect)(() => {
|
|
4516
4536
|
if (latestUserMessageIndex !== void 0 && latestUserMessageIndex >= 0) {
|
|
4517
4537
|
scrollToAnchor();
|
|
4518
4538
|
}
|
|
@@ -4524,7 +4544,7 @@ var ChatView = import_react59.default.forwardRef(
|
|
|
4524
4544
|
return found;
|
|
4525
4545
|
}, -1);
|
|
4526
4546
|
const showThinking = isThinking && messages.length > 0 && messages[messages.length - 1]?.variant === "user";
|
|
4527
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
4528
4548
|
"div",
|
|
4529
4549
|
{
|
|
4530
4550
|
ref: (node) => {
|
|
@@ -4544,7 +4564,7 @@ var ChatView = import_react59.default.forwardRef(
|
|
|
4544
4564
|
),
|
|
4545
4565
|
...rest
|
|
4546
4566
|
},
|
|
4547
|
-
/* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ import_react60.default.createElement("div", { ref: contentRef, className: "relative flex flex-col gap-3" }, messages.map(({
|
|
4548
4568
|
id,
|
|
4549
4569
|
variant,
|
|
4550
4570
|
className: messageClassName,
|
|
@@ -4557,14 +4577,14 @@ var ChatView = import_react59.default.forwardRef(
|
|
|
4557
4577
|
const isLastMessage = index === messages.length - 1;
|
|
4558
4578
|
const showStreaming = isLastMessage && isStreaming && variant === "assistant";
|
|
4559
4579
|
const isMessageStreaming = showStreaming || !!nodeIsStreaming;
|
|
4560
|
-
return /* @__PURE__ */
|
|
4580
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
4561
4581
|
"div",
|
|
4562
4582
|
{
|
|
4563
4583
|
key: id ?? `msg-${index}`,
|
|
4564
4584
|
ref: isAnchor ? anchorRef : void 0,
|
|
4565
4585
|
className: isAnchor ? "scroll-mt-4" : void 0
|
|
4566
4586
|
},
|
|
4567
|
-
/* @__PURE__ */
|
|
4587
|
+
/* @__PURE__ */ import_react60.default.createElement(
|
|
4568
4588
|
Message,
|
|
4569
4589
|
{
|
|
4570
4590
|
variant,
|
|
@@ -4577,8 +4597,8 @@ var ChatView = import_react59.default.forwardRef(
|
|
|
4577
4597
|
}
|
|
4578
4598
|
)
|
|
4579
4599
|
);
|
|
4580
|
-
}), showThinking && /* @__PURE__ */
|
|
4581
|
-
/* @__PURE__ */
|
|
4600
|
+
}), showThinking && /* @__PURE__ */ import_react60.default.createElement(ThinkingIndicator, { isVisible: true })),
|
|
4601
|
+
/* @__PURE__ */ import_react60.default.createElement(
|
|
4582
4602
|
"div",
|
|
4583
4603
|
{
|
|
4584
4604
|
ref: spacerRef,
|
|
@@ -4593,7 +4613,7 @@ var ChatView = import_react59.default.forwardRef(
|
|
|
4593
4613
|
ChatView.displayName = "ChatView";
|
|
4594
4614
|
|
|
4595
4615
|
// src/components/chat/ChatInput.tsx
|
|
4596
|
-
var
|
|
4616
|
+
var import_react61 = __toESM(require("react"));
|
|
4597
4617
|
var import_lucide_react11 = require("lucide-react");
|
|
4598
4618
|
|
|
4599
4619
|
// src/components/chat/types.ts
|
|
@@ -4762,7 +4782,7 @@ function isBranchPoint(tree, nodeId) {
|
|
|
4762
4782
|
}
|
|
4763
4783
|
|
|
4764
4784
|
// src/components/chat/ChatInput.tsx
|
|
4765
|
-
var ChatInput =
|
|
4785
|
+
var ChatInput = import_react61.default.forwardRef(
|
|
4766
4786
|
({
|
|
4767
4787
|
position = "bottom",
|
|
4768
4788
|
placeholder = "Send a message...",
|
|
@@ -4779,13 +4799,13 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4779
4799
|
className,
|
|
4780
4800
|
...rest
|
|
4781
4801
|
}, ref) => {
|
|
4782
|
-
const [value, setValue] = (0,
|
|
4783
|
-
const [localAttachments, setLocalAttachments] = (0,
|
|
4784
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
4785
|
-
const textareaRef = (0,
|
|
4786
|
-
const fileInputRef = (0,
|
|
4802
|
+
const [value, setValue] = (0, import_react61.useState)("");
|
|
4803
|
+
const [localAttachments, setLocalAttachments] = (0, import_react61.useState)([]);
|
|
4804
|
+
const [isDragOver, setIsDragOver] = (0, import_react61.useState)(false);
|
|
4805
|
+
const textareaRef = (0, import_react61.useRef)(null);
|
|
4806
|
+
const fileInputRef = (0, import_react61.useRef)(null);
|
|
4787
4807
|
const attachments = controlledAttachments ?? localAttachments;
|
|
4788
|
-
const setAttachments = (0,
|
|
4808
|
+
const setAttachments = (0, import_react61.useCallback)(
|
|
4789
4809
|
(newAttachments) => {
|
|
4790
4810
|
if (onAttachmentsChange) {
|
|
4791
4811
|
if (typeof newAttachments === "function") {
|
|
@@ -4799,7 +4819,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4799
4819
|
},
|
|
4800
4820
|
[attachments, onAttachmentsChange]
|
|
4801
4821
|
);
|
|
4802
|
-
const handleSubmit = (0,
|
|
4822
|
+
const handleSubmit = (0, import_react61.useCallback)(() => {
|
|
4803
4823
|
const trimmed = value.trim();
|
|
4804
4824
|
if (!trimmed || disabled || isStreaming) {
|
|
4805
4825
|
return;
|
|
@@ -4811,7 +4831,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4811
4831
|
textareaRef.current.style.height = "auto";
|
|
4812
4832
|
}
|
|
4813
4833
|
}, [value, disabled, isStreaming, onSubmit, attachments, setAttachments]);
|
|
4814
|
-
const handleKeyDown = (0,
|
|
4834
|
+
const handleKeyDown = (0, import_react61.useCallback)(
|
|
4815
4835
|
(e) => {
|
|
4816
4836
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
4817
4837
|
e.preventDefault();
|
|
@@ -4820,18 +4840,18 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4820
4840
|
},
|
|
4821
4841
|
[handleSubmit]
|
|
4822
4842
|
);
|
|
4823
|
-
const handleChange = (0,
|
|
4843
|
+
const handleChange = (0, import_react61.useCallback)((e) => {
|
|
4824
4844
|
setValue(e.target.value);
|
|
4825
4845
|
const textarea = e.target;
|
|
4826
4846
|
textarea.style.height = "auto";
|
|
4827
4847
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
4828
4848
|
}, []);
|
|
4829
|
-
(0,
|
|
4849
|
+
(0, import_react61.useEffect)(() => {
|
|
4830
4850
|
if (!disabled && !isStreaming && textareaRef.current) {
|
|
4831
4851
|
textareaRef.current.focus();
|
|
4832
4852
|
}
|
|
4833
4853
|
}, [disabled, isStreaming]);
|
|
4834
|
-
const addFiles = (0,
|
|
4854
|
+
const addFiles = (0, import_react61.useCallback)(
|
|
4835
4855
|
(files) => {
|
|
4836
4856
|
const newAttachments = Array.from(files).map((file) => ({
|
|
4837
4857
|
id: generateId(),
|
|
@@ -4843,7 +4863,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4843
4863
|
},
|
|
4844
4864
|
[setAttachments]
|
|
4845
4865
|
);
|
|
4846
|
-
const handleFileSelect = (0,
|
|
4866
|
+
const handleFileSelect = (0, import_react61.useCallback)(
|
|
4847
4867
|
(e) => {
|
|
4848
4868
|
const files = e.target.files;
|
|
4849
4869
|
if (files && files.length > 0) {
|
|
@@ -4853,7 +4873,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4853
4873
|
},
|
|
4854
4874
|
[addFiles]
|
|
4855
4875
|
);
|
|
4856
|
-
const handleRemoveAttachment = (0,
|
|
4876
|
+
const handleRemoveAttachment = (0, import_react61.useCallback)(
|
|
4857
4877
|
(id) => {
|
|
4858
4878
|
setAttachments((prev) => {
|
|
4859
4879
|
const attachment = prev.find((a) => a.id === id);
|
|
@@ -4865,23 +4885,23 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4865
4885
|
},
|
|
4866
4886
|
[setAttachments]
|
|
4867
4887
|
);
|
|
4868
|
-
const handleDragEnter = (0,
|
|
4888
|
+
const handleDragEnter = (0, import_react61.useCallback)((e) => {
|
|
4869
4889
|
e.preventDefault();
|
|
4870
4890
|
e.stopPropagation();
|
|
4871
4891
|
setIsDragOver(true);
|
|
4872
4892
|
}, []);
|
|
4873
|
-
const handleDragLeave = (0,
|
|
4893
|
+
const handleDragLeave = (0, import_react61.useCallback)((e) => {
|
|
4874
4894
|
e.preventDefault();
|
|
4875
4895
|
e.stopPropagation();
|
|
4876
4896
|
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
4877
4897
|
setIsDragOver(false);
|
|
4878
4898
|
}
|
|
4879
4899
|
}, []);
|
|
4880
|
-
const handleDragOver = (0,
|
|
4900
|
+
const handleDragOver = (0, import_react61.useCallback)((e) => {
|
|
4881
4901
|
e.preventDefault();
|
|
4882
4902
|
e.stopPropagation();
|
|
4883
4903
|
}, []);
|
|
4884
|
-
const handleDrop = (0,
|
|
4904
|
+
const handleDrop = (0, import_react61.useCallback)(
|
|
4885
4905
|
(e) => {
|
|
4886
4906
|
e.preventDefault();
|
|
4887
4907
|
e.stopPropagation();
|
|
@@ -4896,7 +4916,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4896
4916
|
const isCentered = position === "centered";
|
|
4897
4917
|
const hasAttachments = attachments.length > 0;
|
|
4898
4918
|
const canSubmit = value.trim() && !disabled && !isStreaming;
|
|
4899
|
-
return /* @__PURE__ */
|
|
4919
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
4900
4920
|
"div",
|
|
4901
4921
|
{
|
|
4902
4922
|
ref,
|
|
@@ -4908,8 +4928,8 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4908
4928
|
),
|
|
4909
4929
|
...rest
|
|
4910
4930
|
},
|
|
4911
|
-
isCentered && helperText && /* @__PURE__ */
|
|
4912
|
-
/* @__PURE__ */
|
|
4931
|
+
isCentered && helperText && /* @__PURE__ */ import_react61.default.createElement("p", { className: "text-silver text-sm mb-4 text-center" }, helperText),
|
|
4932
|
+
/* @__PURE__ */ import_react61.default.createElement(
|
|
4913
4933
|
"div",
|
|
4914
4934
|
{
|
|
4915
4935
|
className: cx(
|
|
@@ -4924,7 +4944,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4924
4944
|
onDragOver: showAttachmentButton ? handleDragOver : void 0,
|
|
4925
4945
|
onDrop: showAttachmentButton ? handleDrop : void 0
|
|
4926
4946
|
},
|
|
4927
|
-
hasAttachments && /* @__PURE__ */
|
|
4947
|
+
hasAttachments && /* @__PURE__ */ import_react61.default.createElement("div", { className: "px-3 pt-3 pb-1" }, /* @__PURE__ */ import_react61.default.createElement(
|
|
4928
4948
|
AttachmentPreview,
|
|
4929
4949
|
{
|
|
4930
4950
|
attachments,
|
|
@@ -4932,14 +4952,14 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4932
4952
|
removable: !isStreaming
|
|
4933
4953
|
}
|
|
4934
4954
|
)),
|
|
4935
|
-
isDragOver && /* @__PURE__ */
|
|
4955
|
+
isDragOver && /* @__PURE__ */ import_react61.default.createElement(
|
|
4936
4956
|
"div",
|
|
4937
4957
|
{
|
|
4938
4958
|
className: "absolute inset-0 bg-gold/10 flex items-center justify-center z-10 pointer-events-none"
|
|
4939
4959
|
},
|
|
4940
|
-
/* @__PURE__ */
|
|
4960
|
+
/* @__PURE__ */ import_react61.default.createElement("span", { className: "text-gold text-sm font-medium" }, "Drop files here")
|
|
4941
4961
|
),
|
|
4942
|
-
/* @__PURE__ */
|
|
4962
|
+
/* @__PURE__ */ import_react61.default.createElement("div", { className: "flex items-end" }, showAttachmentButton && /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, /* @__PURE__ */ import_react61.default.createElement(
|
|
4943
4963
|
"button",
|
|
4944
4964
|
{
|
|
4945
4965
|
type: "button",
|
|
@@ -4951,8 +4971,8 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4951
4971
|
),
|
|
4952
4972
|
"aria-label": "Attach file"
|
|
4953
4973
|
},
|
|
4954
|
-
/* @__PURE__ */
|
|
4955
|
-
), /* @__PURE__ */
|
|
4974
|
+
/* @__PURE__ */ import_react61.default.createElement(import_lucide_react11.Paperclip, { className: "w-5 h-5" })
|
|
4975
|
+
), /* @__PURE__ */ import_react61.default.createElement(
|
|
4956
4976
|
"input",
|
|
4957
4977
|
{
|
|
4958
4978
|
ref: fileInputRef,
|
|
@@ -4963,7 +4983,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4963
4983
|
className: "hidden",
|
|
4964
4984
|
"aria-hidden": "true"
|
|
4965
4985
|
}
|
|
4966
|
-
)), /* @__PURE__ */
|
|
4986
|
+
)), /* @__PURE__ */ import_react61.default.createElement(
|
|
4967
4987
|
"textarea",
|
|
4968
4988
|
{
|
|
4969
4989
|
ref: textareaRef,
|
|
@@ -4981,7 +5001,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4981
5001
|
),
|
|
4982
5002
|
style: { maxHeight: 200 }
|
|
4983
5003
|
}
|
|
4984
|
-
), isStreaming ? /* @__PURE__ */
|
|
5004
|
+
), isStreaming ? /* @__PURE__ */ import_react61.default.createElement(
|
|
4985
5005
|
"button",
|
|
4986
5006
|
{
|
|
4987
5007
|
type: "button",
|
|
@@ -4992,8 +5012,8 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
4992
5012
|
),
|
|
4993
5013
|
"aria-label": "Stop generation"
|
|
4994
5014
|
},
|
|
4995
|
-
/* @__PURE__ */
|
|
4996
|
-
) : /* @__PURE__ */
|
|
5015
|
+
/* @__PURE__ */ import_react61.default.createElement(import_lucide_react11.Square, { className: "w-5 h-5 fill-current" })
|
|
5016
|
+
) : /* @__PURE__ */ import_react61.default.createElement(
|
|
4997
5017
|
"button",
|
|
4998
5018
|
{
|
|
4999
5019
|
type: "button",
|
|
@@ -5006,7 +5026,7 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
5006
5026
|
),
|
|
5007
5027
|
"aria-label": "Send message"
|
|
5008
5028
|
},
|
|
5009
|
-
/* @__PURE__ */
|
|
5029
|
+
/* @__PURE__ */ import_react61.default.createElement(import_lucide_react11.Send, { className: "w-5 h-5" })
|
|
5010
5030
|
))
|
|
5011
5031
|
)
|
|
5012
5032
|
);
|
|
@@ -5014,193 +5034,6 @@ var ChatInput = import_react60.default.forwardRef(
|
|
|
5014
5034
|
);
|
|
5015
5035
|
ChatInput.displayName = "ChatInput";
|
|
5016
5036
|
|
|
5017
|
-
// src/components/chat/ConversationSidebar.tsx
|
|
5018
|
-
var import_react61 = __toESM(require("react"));
|
|
5019
|
-
function HistoryIcon2({ className }) {
|
|
5020
|
-
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5021
|
-
"svg",
|
|
5022
|
-
{
|
|
5023
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5024
|
-
viewBox: "0 0 20 20",
|
|
5025
|
-
fill: "currentColor",
|
|
5026
|
-
className
|
|
5027
|
-
},
|
|
5028
|
-
/* @__PURE__ */ import_react61.default.createElement(
|
|
5029
|
-
"path",
|
|
5030
|
-
{
|
|
5031
|
-
fillRule: "evenodd",
|
|
5032
|
-
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm.75-13a.75.75 0 00-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 000-1.5h-3.25V5z",
|
|
5033
|
-
clipRule: "evenodd"
|
|
5034
|
-
}
|
|
5035
|
-
)
|
|
5036
|
-
);
|
|
5037
|
-
}
|
|
5038
|
-
function ChevronLeftIcon3({ className }) {
|
|
5039
|
-
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5040
|
-
"svg",
|
|
5041
|
-
{
|
|
5042
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5043
|
-
viewBox: "0 0 20 20",
|
|
5044
|
-
fill: "currentColor",
|
|
5045
|
-
className
|
|
5046
|
-
},
|
|
5047
|
-
/* @__PURE__ */ import_react61.default.createElement(
|
|
5048
|
-
"path",
|
|
5049
|
-
{
|
|
5050
|
-
fillRule: "evenodd",
|
|
5051
|
-
d: "M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",
|
|
5052
|
-
clipRule: "evenodd"
|
|
5053
|
-
}
|
|
5054
|
-
)
|
|
5055
|
-
);
|
|
5056
|
-
}
|
|
5057
|
-
var ConversationSidebar = import_react61.default.forwardRef(
|
|
5058
|
-
({
|
|
5059
|
-
conversations,
|
|
5060
|
-
isCollapsed = false,
|
|
5061
|
-
onSelectConversation,
|
|
5062
|
-
onNewChat,
|
|
5063
|
-
onToggleCollapse,
|
|
5064
|
-
width,
|
|
5065
|
-
onResizeStart,
|
|
5066
|
-
className,
|
|
5067
|
-
...rest
|
|
5068
|
-
}, ref) => {
|
|
5069
|
-
if (isCollapsed) {
|
|
5070
|
-
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5071
|
-
"div",
|
|
5072
|
-
{
|
|
5073
|
-
ref,
|
|
5074
|
-
className: cx(
|
|
5075
|
-
"h-full bg-charcoal/80 border-r border-ash/40 flex flex-col items-center py-3",
|
|
5076
|
-
"w-12 flex-shrink-0",
|
|
5077
|
-
className
|
|
5078
|
-
),
|
|
5079
|
-
...rest
|
|
5080
|
-
},
|
|
5081
|
-
/* @__PURE__ */ import_react61.default.createElement(
|
|
5082
|
-
"button",
|
|
5083
|
-
{
|
|
5084
|
-
onClick: onToggleCollapse,
|
|
5085
|
-
className: cx(
|
|
5086
|
-
"p-2",
|
|
5087
|
-
"text-silver hover:text-white hover:bg-ash/20",
|
|
5088
|
-
"transition-colors duration-150"
|
|
5089
|
-
),
|
|
5090
|
-
"aria-label": "Expand sidebar"
|
|
5091
|
-
},
|
|
5092
|
-
/* @__PURE__ */ import_react61.default.createElement(HistoryIcon2, { className: "w-5 h-5" })
|
|
5093
|
-
)
|
|
5094
|
-
);
|
|
5095
|
-
}
|
|
5096
|
-
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5097
|
-
"div",
|
|
5098
|
-
{
|
|
5099
|
-
ref,
|
|
5100
|
-
"data-testid": "conversation-sidebar",
|
|
5101
|
-
className: cx(
|
|
5102
|
-
"h-full bg-charcoal/80 border-r border-ash/40 flex flex-col relative group",
|
|
5103
|
-
!width && "w-64",
|
|
5104
|
-
"flex-shrink-0",
|
|
5105
|
-
className
|
|
5106
|
-
),
|
|
5107
|
-
style: width ? { width } : void 0,
|
|
5108
|
-
...rest
|
|
5109
|
-
},
|
|
5110
|
-
/* @__PURE__ */ import_react61.default.createElement(
|
|
5111
|
-
"div",
|
|
5112
|
-
{
|
|
5113
|
-
onMouseDown: onResizeStart,
|
|
5114
|
-
"data-testid": "sidebar-resize-handle",
|
|
5115
|
-
className: cx(
|
|
5116
|
-
"absolute top-0 right-0 w-1 h-full cursor-col-resize z-50",
|
|
5117
|
-
"hover:bg-gold/50 transition-colors",
|
|
5118
|
-
"after:absolute after:inset-y-0 after:-right-1 after:w-2"
|
|
5119
|
-
// Larger hit area
|
|
5120
|
-
)
|
|
5121
|
-
}
|
|
5122
|
-
),
|
|
5123
|
-
/* @__PURE__ */ import_react61.default.createElement("div", { className: "p-3 border-b border-ash/40 flex-shrink-0 flex items-center gap-2" }, /* @__PURE__ */ import_react61.default.createElement(
|
|
5124
|
-
"button",
|
|
5125
|
-
{
|
|
5126
|
-
onClick: onToggleCollapse,
|
|
5127
|
-
className: cx(
|
|
5128
|
-
"p-1.5",
|
|
5129
|
-
"text-silver hover:text-white hover:bg-ash/20",
|
|
5130
|
-
"transition-colors duration-150"
|
|
5131
|
-
),
|
|
5132
|
-
"aria-label": "Collapse sidebar"
|
|
5133
|
-
},
|
|
5134
|
-
/* @__PURE__ */ import_react61.default.createElement(ChevronLeftIcon3, { className: "w-5 h-5" })
|
|
5135
|
-
), /* @__PURE__ */ import_react61.default.createElement(
|
|
5136
|
-
"button",
|
|
5137
|
-
{
|
|
5138
|
-
onClick: onNewChat,
|
|
5139
|
-
className: cx(
|
|
5140
|
-
"flex-1 px-3 py-2",
|
|
5141
|
-
"bg-gold/10 hover:bg-gold/20 text-gold",
|
|
5142
|
-
"border border-gold/30",
|
|
5143
|
-
"flex items-center justify-center gap-2",
|
|
5144
|
-
"transition-colors duration-200"
|
|
5145
|
-
)
|
|
5146
|
-
},
|
|
5147
|
-
/* @__PURE__ */ import_react61.default.createElement(
|
|
5148
|
-
"svg",
|
|
5149
|
-
{
|
|
5150
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5151
|
-
viewBox: "0 0 20 20",
|
|
5152
|
-
fill: "currentColor",
|
|
5153
|
-
className: "w-4 h-4"
|
|
5154
|
-
},
|
|
5155
|
-
/* @__PURE__ */ import_react61.default.createElement(
|
|
5156
|
-
"path",
|
|
5157
|
-
{
|
|
5158
|
-
d: "M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"
|
|
5159
|
-
}
|
|
5160
|
-
)
|
|
5161
|
-
),
|
|
5162
|
-
/* @__PURE__ */ import_react61.default.createElement("span", { className: "text-sm font-medium" }, "New Chat")
|
|
5163
|
-
)),
|
|
5164
|
-
/* @__PURE__ */ import_react61.default.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ import_react61.default.createElement("p", { className: "px-4 py-2 text-sm text-silver/60" }, "No conversations yet") : /* @__PURE__ */ import_react61.default.createElement("div", { className: "space-y-1 px-2" }, conversations.map((conversation) => /* @__PURE__ */ import_react61.default.createElement(
|
|
5165
|
-
"button",
|
|
5166
|
-
{
|
|
5167
|
-
key: conversation.id,
|
|
5168
|
-
onClick: () => onSelectConversation?.(conversation.id),
|
|
5169
|
-
className: cx(
|
|
5170
|
-
"w-full px-3 py-2 text-left",
|
|
5171
|
-
"transition-colors duration-150",
|
|
5172
|
-
conversation.isActive ? "bg-ash/40 text-white" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
5173
|
-
)
|
|
5174
|
-
},
|
|
5175
|
-
/* @__PURE__ */ import_react61.default.createElement("p", { className: "text-sm font-medium truncate" }, conversation.title),
|
|
5176
|
-
conversation.preview && /* @__PURE__ */ import_react61.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.preview),
|
|
5177
|
-
conversation.timestamp && /* @__PURE__ */ import_react61.default.createElement("p", { className: "text-xs text-silver/40 mt-1" }, conversation.timestamp)
|
|
5178
|
-
))))
|
|
5179
|
-
);
|
|
5180
|
-
}
|
|
5181
|
-
);
|
|
5182
|
-
ConversationSidebar.displayName = "ConversationSidebar";
|
|
5183
|
-
var CollapsedSidebarToggle = import_react61.default.forwardRef(({ onExpand, className, ...rest }, ref) => {
|
|
5184
|
-
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5185
|
-
"button",
|
|
5186
|
-
{
|
|
5187
|
-
ref,
|
|
5188
|
-
onClick: onExpand,
|
|
5189
|
-
className: cx(
|
|
5190
|
-
"p-2",
|
|
5191
|
-
"bg-charcoal/80 border border-ash/40",
|
|
5192
|
-
"text-silver hover:text-white hover:bg-ash/20",
|
|
5193
|
-
"transition-colors duration-150",
|
|
5194
|
-
className
|
|
5195
|
-
),
|
|
5196
|
-
"aria-label": "Expand sidebar",
|
|
5197
|
-
...rest
|
|
5198
|
-
},
|
|
5199
|
-
/* @__PURE__ */ import_react61.default.createElement(HistoryIcon2, { className: "w-5 h-5" })
|
|
5200
|
-
);
|
|
5201
|
-
});
|
|
5202
|
-
CollapsedSidebarToggle.displayName = "CollapsedSidebarToggle";
|
|
5203
|
-
|
|
5204
5037
|
// src/components/chat/ArtifactsPanel.tsx
|
|
5205
5038
|
var import_react72 = __toESM(require("react"));
|
|
5206
5039
|
|
|
@@ -6588,7 +6421,6 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6588
6421
|
isThinking = false,
|
|
6589
6422
|
placeholder = "Send a message...",
|
|
6590
6423
|
emptyStateHelper = "Let's talk.",
|
|
6591
|
-
initialSidebarCollapsed = false,
|
|
6592
6424
|
emptyState,
|
|
6593
6425
|
showAttachmentButton = true,
|
|
6594
6426
|
enableMessageActions = true,
|
|
@@ -6603,11 +6435,10 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6603
6435
|
className,
|
|
6604
6436
|
...rest
|
|
6605
6437
|
}, ref) => {
|
|
6606
|
-
const [sidebarCollapsed, setSidebarCollapsed] = (0, import_react77.useState)(initialSidebarCollapsed);
|
|
6607
6438
|
const prevArtifactNodesRef = (0, import_react77.useRef)([]);
|
|
6608
6439
|
const prevTasksRef = (0, import_react77.useRef)([]);
|
|
6609
6440
|
const [internalTools, setInternalTools] = (0, import_react77.useState)({
|
|
6610
|
-
"top-left":
|
|
6441
|
+
"top-left": "history",
|
|
6611
6442
|
"bottom-left": null,
|
|
6612
6443
|
"top-right": null,
|
|
6613
6444
|
"bottom-right": null
|
|
@@ -6625,15 +6456,6 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6625
6456
|
}, [isPanelControlled, isArtifactsPanelOpen, internalTools]);
|
|
6626
6457
|
const isLeftPanelOpen = activeTools["top-left"] !== null || activeTools["bottom-left"] !== null;
|
|
6627
6458
|
const isRightPanelOpen = activeTools["top-right"] !== null || activeTools["bottom-right"] !== null;
|
|
6628
|
-
const {
|
|
6629
|
-
width: sidebarWidth,
|
|
6630
|
-
startResizing: startResizingSidebar
|
|
6631
|
-
} = useResizable({
|
|
6632
|
-
initialWidthPercent: 15,
|
|
6633
|
-
minWidthPercent: 12,
|
|
6634
|
-
maxWidthPercent: 25,
|
|
6635
|
-
direction: "right"
|
|
6636
|
-
});
|
|
6637
6459
|
const {
|
|
6638
6460
|
width: rightToolsWidth,
|
|
6639
6461
|
startResizing: startResizingRightTools
|
|
@@ -6655,7 +6477,7 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6655
6477
|
const allSettled = tasks.length === 0 || areAllTasksSettled(tasks);
|
|
6656
6478
|
const allToolDefinitions = (0, import_react77.useMemo)(() => {
|
|
6657
6479
|
const builtIn = [
|
|
6658
|
-
{ id: "history", icon: /* @__PURE__ */ import_react77.default.createElement(
|
|
6480
|
+
{ id: "history", icon: /* @__PURE__ */ import_react77.default.createElement(ChatBubbleIcon, null), label: "History", group: "top-left" },
|
|
6659
6481
|
{ id: "artifacts", icon: /* @__PURE__ */ import_react77.default.createElement(MediaIcon, null), label: "Artifacts", group: "top-right" },
|
|
6660
6482
|
{
|
|
6661
6483
|
id: "todos",
|
|
@@ -6669,7 +6491,9 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6669
6491
|
}, [allSettled, externalTools]);
|
|
6670
6492
|
const toggleTool = (0, import_react77.useCallback)((toolId) => {
|
|
6671
6493
|
const toolDef = allToolDefinitions.find((t) => t.id === toolId);
|
|
6672
|
-
if (!toolDef)
|
|
6494
|
+
if (!toolDef) {
|
|
6495
|
+
return;
|
|
6496
|
+
}
|
|
6673
6497
|
const group = toolDef.group;
|
|
6674
6498
|
if (toolId === "artifacts" && isPanelControlled) {
|
|
6675
6499
|
const isCurrentlyOpen = activeTools["top-right"] === "artifacts";
|
|
@@ -6709,7 +6533,9 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6709
6533
|
}, [isTreeMode, conversationTree, messages]);
|
|
6710
6534
|
const latestUserMessageIndex = (0, import_react77.useMemo)(() => {
|
|
6711
6535
|
for (let i = effectiveMessages.length - 1; i >= 0; i--) {
|
|
6712
|
-
if (effectiveMessages[i].variant === "user")
|
|
6536
|
+
if (effectiveMessages[i].variant === "user") {
|
|
6537
|
+
return i;
|
|
6538
|
+
}
|
|
6713
6539
|
}
|
|
6714
6540
|
return -1;
|
|
6715
6541
|
}, [effectiveMessages]);
|
|
@@ -6723,9 +6549,15 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6723
6549
|
const hasNewOrUpdatedTask = (curr, prev) => {
|
|
6724
6550
|
return curr.some((c) => {
|
|
6725
6551
|
const p = prev.find((x) => x.id === c.id);
|
|
6726
|
-
if (!p)
|
|
6727
|
-
|
|
6728
|
-
|
|
6552
|
+
if (!p) {
|
|
6553
|
+
return true;
|
|
6554
|
+
}
|
|
6555
|
+
if (c.status !== p.status || c.label !== p.label) {
|
|
6556
|
+
return true;
|
|
6557
|
+
}
|
|
6558
|
+
if (c.subtasks && hasNewOrUpdatedTask(c.subtasks, p?.subtasks || [])) {
|
|
6559
|
+
return true;
|
|
6560
|
+
}
|
|
6729
6561
|
return false;
|
|
6730
6562
|
});
|
|
6731
6563
|
};
|
|
@@ -6737,7 +6569,9 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6737
6569
|
}, [artifactNodes, tasks, isPanelControlled]);
|
|
6738
6570
|
const handleBranchSwitch = (0, import_react77.useCallback)(
|
|
6739
6571
|
(nodeId, direction) => {
|
|
6740
|
-
if (!isTreeMode || !conversationTree || !onTreeChange)
|
|
6572
|
+
if (!isTreeMode || !conversationTree || !onTreeChange) {
|
|
6573
|
+
return;
|
|
6574
|
+
}
|
|
6741
6575
|
const newTree = switchBranch(conversationTree, nodeId, direction);
|
|
6742
6576
|
onTreeChange(newTree);
|
|
6743
6577
|
},
|
|
@@ -6779,25 +6613,61 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6779
6613
|
},
|
|
6780
6614
|
[onMessageSubmit]
|
|
6781
6615
|
);
|
|
6782
|
-
const toggleSidebar = (0, import_react77.useCallback)(() => {
|
|
6783
|
-
setSidebarCollapsed((prev) => !prev);
|
|
6784
|
-
}, []);
|
|
6785
6616
|
const isEmpty = effectiveMessages.length === 0;
|
|
6786
6617
|
const leftToolDefs = (0, import_react77.useMemo)(
|
|
6787
6618
|
() => allToolDefinitions.filter((t) => t.group === "top-left" || t.group === "bottom-left"),
|
|
6788
6619
|
[allToolDefinitions]
|
|
6789
6620
|
);
|
|
6790
6621
|
const rightToolDefs = (0, import_react77.useMemo)(
|
|
6791
|
-
() => allToolDefinitions.filter(
|
|
6622
|
+
() => allToolDefinitions.filter(
|
|
6623
|
+
(t) => t.group === "top-right" || t.group === "bottom-right"
|
|
6624
|
+
),
|
|
6792
6625
|
[allToolDefinitions]
|
|
6793
6626
|
);
|
|
6794
6627
|
const hasLeftTools = leftToolDefs.length > 0;
|
|
6795
6628
|
const hasRightTools = rightToolDefs.length > 0;
|
|
6796
6629
|
const renderToolContent = (toolId) => {
|
|
6797
|
-
if (!toolId)
|
|
6630
|
+
if (!toolId) {
|
|
6631
|
+
return null;
|
|
6632
|
+
}
|
|
6798
6633
|
switch (toolId) {
|
|
6799
6634
|
case "history":
|
|
6800
|
-
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react77.default.createElement(
|
|
6635
|
+
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react77.default.createElement(
|
|
6636
|
+
"div",
|
|
6637
|
+
{
|
|
6638
|
+
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
6639
|
+
},
|
|
6640
|
+
/* @__PURE__ */ import_react77.default.createElement("h3", { className: "text-xs font-medium text-white" }, "History"),
|
|
6641
|
+
onNewChat && /* @__PURE__ */ import_react77.default.createElement(
|
|
6642
|
+
"button",
|
|
6643
|
+
{
|
|
6644
|
+
onClick: onNewChat,
|
|
6645
|
+
className: cx(
|
|
6646
|
+
"flex px-3 py-1.5",
|
|
6647
|
+
"bg-gold/10 hover:bg-gold/20 text-gold",
|
|
6648
|
+
"border border-gold/30",
|
|
6649
|
+
"text-xs font-medium",
|
|
6650
|
+
"transition-colors duration-200"
|
|
6651
|
+
)
|
|
6652
|
+
},
|
|
6653
|
+
/* @__PURE__ */ import_react77.default.createElement(
|
|
6654
|
+
"svg",
|
|
6655
|
+
{
|
|
6656
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6657
|
+
viewBox: "0 0 20 20",
|
|
6658
|
+
fill: "currentColor",
|
|
6659
|
+
className: "w-4 h-4"
|
|
6660
|
+
},
|
|
6661
|
+
/* @__PURE__ */ import_react77.default.createElement(
|
|
6662
|
+
"path",
|
|
6663
|
+
{
|
|
6664
|
+
d: "M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"
|
|
6665
|
+
}
|
|
6666
|
+
)
|
|
6667
|
+
),
|
|
6668
|
+
"New Chat"
|
|
6669
|
+
)
|
|
6670
|
+
), /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ import_react77.default.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations yet") : /* @__PURE__ */ import_react77.default.createElement("div", { className: "space-y-1 px-2" }, conversations.map((conversation) => /* @__PURE__ */ import_react77.default.createElement(
|
|
6801
6671
|
"button",
|
|
6802
6672
|
{
|
|
6803
6673
|
key: conversation.id,
|
|
@@ -6835,18 +6705,6 @@ var ChatInterface = import_react77.default.forwardRef(
|
|
|
6835
6705
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
6836
6706
|
...rest
|
|
6837
6707
|
},
|
|
6838
|
-
/* @__PURE__ */ import_react77.default.createElement(
|
|
6839
|
-
ConversationSidebar,
|
|
6840
|
-
{
|
|
6841
|
-
conversations,
|
|
6842
|
-
isCollapsed: sidebarCollapsed,
|
|
6843
|
-
onSelectConversation,
|
|
6844
|
-
onNewChat,
|
|
6845
|
-
onToggleCollapse: toggleSidebar,
|
|
6846
|
-
width: sidebarWidth,
|
|
6847
|
-
onResizeStart: startResizingSidebar
|
|
6848
|
-
}
|
|
6849
|
-
),
|
|
6850
6708
|
hasLeftTools && /* @__PURE__ */ import_react77.default.createElement(
|
|
6851
6709
|
ToolSidebar,
|
|
6852
6710
|
{
|
|
@@ -7270,6 +7128,7 @@ var version = "2.0.0";
|
|
|
7270
7128
|
BreadcrumbLink,
|
|
7271
7129
|
Button,
|
|
7272
7130
|
Card,
|
|
7131
|
+
ChatBubbleIcon,
|
|
7273
7132
|
ChatInput,
|
|
7274
7133
|
ChatInterface,
|
|
7275
7134
|
ChatView,
|
|
@@ -7279,11 +7138,9 @@ var version = "2.0.0";
|
|
|
7279
7138
|
ChevronRightIcon,
|
|
7280
7139
|
CloseIcon,
|
|
7281
7140
|
Col,
|
|
7282
|
-
CollapsedSidebarToggle,
|
|
7283
7141
|
ColorSwatch,
|
|
7284
7142
|
ConfirmDialog,
|
|
7285
7143
|
Container,
|
|
7286
|
-
ConversationSidebar,
|
|
7287
7144
|
CrossSquareIcon,
|
|
7288
7145
|
Divider,
|
|
7289
7146
|
Drawer,
|