@omg-dev/app 0.6.9 → 0.6.10
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-lib/{ChangelogPage-kwazjQ_I.js → ChangelogPage-BgROJRnJ.js} +12 -1
- package/dist-lib/{SessionFilesPanel-B4YhOD6k.js → SessionFilesPanel-DaGWvWCT.js} +1 -1
- package/dist-lib/{TermView-ujCdqe_w.js → TermView-iuJBJjm8.js} +2 -2
- package/dist-lib/{chat-engine-BpexbmRA.js → chat-engine-CLT7DRwn.js} +1 -1
- package/dist-lib/{coding-agents-page-DN72IK-F.js → coding-agents-page-BFtFTtgt.js} +1 -1
- package/dist-lib/{computer-page-nUNnrJpN.js → computer-page-YeB-dujC.js} +2 -2
- package/dist-lib/{embedded-DzGChUt5.js → embedded-CR69psr5.js} +783 -776
- package/dist-lib/index.js +1 -1
- package/dist-lib/{keyboard-C-THb0rI.js → keyboard-tBMCWlLY.js} +1 -1
- package/dist-lib/{resume-session-sheet-BwmBNqEi.js → resume-session-sheet-BgiPF1kI.js} +1 -1
- package/dist-lib/{session-token-usage-Cf8oHrBd.js → session-token-usage-D5OcrL42.js} +1 -1
- package/dist-lib/{shipped-page-W9qAgb9s.js → shipped-page-w9zP7mE6.js} +1 -1
- package/dist-lib/{streamdown-response-BuDlyhpf.js → streamdown-response-C271qGoB.js} +1 -1
- package/dist-lib/styles.css +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as s, jsxs as m, Fragment as He } from "react/jsx-runtime";
|
|
2
2
|
import * as rt from "react";
|
|
3
|
-
import
|
|
3
|
+
import De, { createContext as Jt, useContext as gt, forwardRef as ha, createElement as Xl, useSyncExternalStore as pa, useId as $c, useState as N, useEffect as K, useRef as U, useMemo as je, useCallback as te, lazy as ga, cloneElement as cx, memo as lr, Suspense as mn, useReducer as dx, useImperativeHandle as ux, useLayoutEffect as Bt, Component as fx } from "react";
|
|
4
4
|
import { useSearch as mx, useNavigate as hx, useRouterState as xu, createRootRoute as px, createRoute as Xs, redirect as Fm, createRouter as gx, createMemoryHistory as Om, RouterProvider as Rm } from "@tanstack/react-router";
|
|
5
5
|
import xx, { createPortal as cr, flushSync as bx } from "react-dom";
|
|
6
6
|
import { Button as yx } from "@base-ui/react/button";
|
|
@@ -2312,7 +2312,7 @@ function Vc(e) {
|
|
|
2312
2312
|
return !t || t.toLowerCase() === "unknown" ? null : t;
|
|
2313
2313
|
}
|
|
2314
2314
|
function Jy() {
|
|
2315
|
-
return Vc("0.6.
|
|
2315
|
+
return Vc("0.6.10");
|
|
2316
2316
|
}
|
|
2317
2317
|
const Au = Jy();
|
|
2318
2318
|
function Qy(e) {
|
|
@@ -3564,58 +3564,58 @@ const jw = (e) => {
|
|
|
3564
3564
|
default:
|
|
3565
3565
|
return null;
|
|
3566
3566
|
}
|
|
3567
|
-
}, Uw = Array(12).fill(0), Ww = ({ visible: e, className: t }) => /* @__PURE__ */
|
|
3567
|
+
}, Uw = Array(12).fill(0), Ww = ({ visible: e, className: t }) => /* @__PURE__ */ De.createElement("div", {
|
|
3568
3568
|
className: [
|
|
3569
3569
|
"sonner-loading-wrapper",
|
|
3570
3570
|
t
|
|
3571
3571
|
].filter(Boolean).join(" "),
|
|
3572
3572
|
"data-visible": e
|
|
3573
|
-
}, /* @__PURE__ */
|
|
3573
|
+
}, /* @__PURE__ */ De.createElement("div", {
|
|
3574
3574
|
className: "sonner-spinner"
|
|
3575
|
-
}, Uw.map((n, r) => /* @__PURE__ */
|
|
3575
|
+
}, Uw.map((n, r) => /* @__PURE__ */ De.createElement("div", {
|
|
3576
3576
|
className: "sonner-loading-bar",
|
|
3577
3577
|
key: `spinner-bar-${r}`
|
|
3578
|
-
})))), Hw = /* @__PURE__ */
|
|
3578
|
+
})))), Hw = /* @__PURE__ */ De.createElement("svg", {
|
|
3579
3579
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3580
3580
|
viewBox: "0 0 20 20",
|
|
3581
3581
|
fill: "currentColor",
|
|
3582
3582
|
height: "20",
|
|
3583
3583
|
width: "20"
|
|
3584
|
-
}, /* @__PURE__ */
|
|
3584
|
+
}, /* @__PURE__ */ De.createElement("path", {
|
|
3585
3585
|
fillRule: "evenodd",
|
|
3586
3586
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
3587
3587
|
clipRule: "evenodd"
|
|
3588
|
-
})), qw = /* @__PURE__ */
|
|
3588
|
+
})), qw = /* @__PURE__ */ De.createElement("svg", {
|
|
3589
3589
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3590
3590
|
viewBox: "0 0 24 24",
|
|
3591
3591
|
fill: "currentColor",
|
|
3592
3592
|
height: "20",
|
|
3593
3593
|
width: "20"
|
|
3594
|
-
}, /* @__PURE__ */
|
|
3594
|
+
}, /* @__PURE__ */ De.createElement("path", {
|
|
3595
3595
|
fillRule: "evenodd",
|
|
3596
3596
|
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
3597
3597
|
clipRule: "evenodd"
|
|
3598
|
-
})), Vw = /* @__PURE__ */
|
|
3598
|
+
})), Vw = /* @__PURE__ */ De.createElement("svg", {
|
|
3599
3599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3600
3600
|
viewBox: "0 0 20 20",
|
|
3601
3601
|
fill: "currentColor",
|
|
3602
3602
|
height: "20",
|
|
3603
3603
|
width: "20"
|
|
3604
|
-
}, /* @__PURE__ */
|
|
3604
|
+
}, /* @__PURE__ */ De.createElement("path", {
|
|
3605
3605
|
fillRule: "evenodd",
|
|
3606
3606
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
3607
3607
|
clipRule: "evenodd"
|
|
3608
|
-
})), Kw = /* @__PURE__ */
|
|
3608
|
+
})), Kw = /* @__PURE__ */ De.createElement("svg", {
|
|
3609
3609
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3610
3610
|
viewBox: "0 0 20 20",
|
|
3611
3611
|
fill: "currentColor",
|
|
3612
3612
|
height: "20",
|
|
3613
3613
|
width: "20"
|
|
3614
|
-
}, /* @__PURE__ */
|
|
3614
|
+
}, /* @__PURE__ */ De.createElement("path", {
|
|
3615
3615
|
fillRule: "evenodd",
|
|
3616
3616
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
3617
3617
|
clipRule: "evenodd"
|
|
3618
|
-
})), Gw = /* @__PURE__ */
|
|
3618
|
+
})), Gw = /* @__PURE__ */ De.createElement("svg", {
|
|
3619
3619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3620
3620
|
width: "12",
|
|
3621
3621
|
height: "12",
|
|
@@ -3625,19 +3625,19 @@ const jw = (e) => {
|
|
|
3625
3625
|
strokeWidth: "1.5",
|
|
3626
3626
|
strokeLinecap: "round",
|
|
3627
3627
|
strokeLinejoin: "round"
|
|
3628
|
-
}, /* @__PURE__ */
|
|
3628
|
+
}, /* @__PURE__ */ De.createElement("line", {
|
|
3629
3629
|
x1: "18",
|
|
3630
3630
|
y1: "6",
|
|
3631
3631
|
x2: "6",
|
|
3632
3632
|
y2: "18"
|
|
3633
|
-
}), /* @__PURE__ */
|
|
3633
|
+
}), /* @__PURE__ */ De.createElement("line", {
|
|
3634
3634
|
x1: "6",
|
|
3635
3635
|
y1: "6",
|
|
3636
3636
|
x2: "18",
|
|
3637
3637
|
y2: "18"
|
|
3638
3638
|
})), Xw = () => {
|
|
3639
|
-
const [e, t] =
|
|
3640
|
-
return
|
|
3639
|
+
const [e, t] = De.useState(document.hidden);
|
|
3640
|
+
return De.useEffect(() => {
|
|
3641
3641
|
const n = () => {
|
|
3642
3642
|
t(document.hidden);
|
|
3643
3643
|
};
|
|
@@ -3725,7 +3725,7 @@ class Yw {
|
|
|
3725
3725
|
if (a = [
|
|
3726
3726
|
"resolve",
|
|
3727
3727
|
u
|
|
3728
|
-
],
|
|
3728
|
+
], De.isValidElement(u))
|
|
3729
3729
|
i = !1, this.create({
|
|
3730
3730
|
id: r,
|
|
3731
3731
|
type: "default",
|
|
@@ -3733,7 +3733,7 @@ class Yw {
|
|
|
3733
3733
|
});
|
|
3734
3734
|
else if (Qw(u) && !u.ok) {
|
|
3735
3735
|
i = !1;
|
|
3736
|
-
const f = typeof n.error == "function" ? await n.error(`HTTP error! status: ${u.status}`) : n.error, h = typeof n.description == "function" ? await n.description(`HTTP error! status: ${u.status}`) : n.description, g = typeof f == "object" && !
|
|
3736
|
+
const f = typeof n.error == "function" ? await n.error(`HTTP error! status: ${u.status}`) : n.error, h = typeof n.description == "function" ? await n.description(`HTTP error! status: ${u.status}`) : n.description, g = typeof f == "object" && !De.isValidElement(f) ? f : {
|
|
3737
3737
|
message: f
|
|
3738
3738
|
};
|
|
3739
3739
|
this.create({
|
|
@@ -3744,7 +3744,7 @@ class Yw {
|
|
|
3744
3744
|
});
|
|
3745
3745
|
} else if (u instanceof Error) {
|
|
3746
3746
|
i = !1;
|
|
3747
|
-
const f = typeof n.error == "function" ? await n.error(u) : n.error, h = typeof n.description == "function" ? await n.description(u) : n.description, g = typeof f == "object" && !
|
|
3747
|
+
const f = typeof n.error == "function" ? await n.error(u) : n.error, h = typeof n.description == "function" ? await n.description(u) : n.description, g = typeof f == "object" && !De.isValidElement(f) ? f : {
|
|
3748
3748
|
message: f
|
|
3749
3749
|
};
|
|
3750
3750
|
this.create({
|
|
@@ -3755,7 +3755,7 @@ class Yw {
|
|
|
3755
3755
|
});
|
|
3756
3756
|
} else if (n.success !== void 0) {
|
|
3757
3757
|
i = !1;
|
|
3758
|
-
const f = typeof n.success == "function" ? await n.success(u) : n.success, h = typeof n.description == "function" ? await n.description(u) : n.description, g = typeof f == "object" && !
|
|
3758
|
+
const f = typeof n.success == "function" ? await n.success(u) : n.success, h = typeof n.description == "function" ? await n.description(u) : n.description, g = typeof f == "object" && !De.isValidElement(f) ? f : {
|
|
3759
3759
|
message: f
|
|
3760
3760
|
};
|
|
3761
3761
|
this.create({
|
|
@@ -3771,7 +3771,7 @@ class Yw {
|
|
|
3771
3771
|
u
|
|
3772
3772
|
], n.error !== void 0) {
|
|
3773
3773
|
i = !1;
|
|
3774
|
-
const d = typeof n.error == "function" ? await n.error(u) : n.error, f = typeof n.description == "function" ? await n.description(u) : n.description, p = typeof d == "object" && !
|
|
3774
|
+
const d = typeof n.error == "function" ? await n.error(u) : n.error, f = typeof n.description == "function" ? await n.description(u) : n.description, p = typeof d == "object" && !De.isValidElement(d) ? d : {
|
|
3775
3775
|
message: d
|
|
3776
3776
|
};
|
|
3777
3777
|
this.create({
|
|
@@ -3834,32 +3834,32 @@ function cN(e) {
|
|
|
3834
3834
|
}
|
|
3835
3835
|
const dN = (e) => {
|
|
3836
3836
|
var t, n, r, o, i, a, l, c, u;
|
|
3837
|
-
const { invert: d, toast: f, unstyled: h, interacting: p, setHeights: g, visibleToasts: v, heights: y, index: x, toasts: w, expanded: A, removeToast: k, defaultRichColors: T, closeButton: E, style: O, cancelButtonStyle: B, actionButtonStyle: q, className: j = "", descriptionClassName: M = "", duration: L, position: G, gap: J, expandByDefault: D, classNames: X, icons: H, closeButtonAriaLabel: _ = "Close toast" } = e, [z, I] =
|
|
3837
|
+
const { invert: d, toast: f, unstyled: h, interacting: p, setHeights: g, visibleToasts: v, heights: y, index: x, toasts: w, expanded: A, removeToast: k, defaultRichColors: T, closeButton: E, style: O, cancelButtonStyle: B, actionButtonStyle: q, className: j = "", descriptionClassName: M = "", duration: L, position: G, gap: J, expandByDefault: D, classNames: X, icons: H, closeButtonAriaLabel: _ = "Close toast" } = e, [z, I] = De.useState(null), [S, C] = De.useState(null), [R, Y] = De.useState(!1), [se, ie] = De.useState(!1), [ue, oe] = De.useState(!1), [Ce, ze] = De.useState(!1), [Be, Te] = De.useState(!1), [Ze, Ue] = De.useState(0), [Ye, Qe] = De.useState(0), ge = De.useRef(f.duration || L || Pu), Ie = De.useRef(null), ee = De.useRef(null), me = x === 0, be = x + 1 <= v, _e = f.type, Fe = f.dismissible !== !1, W = f.className || "", Ne = f.descriptionClassName || "", re = De.useMemo(() => y.findIndex((Ke) => Ke.toastId === f.id) || 0, [
|
|
3838
3838
|
y,
|
|
3839
3839
|
f.id
|
|
3840
|
-
]), ye =
|
|
3840
|
+
]), ye = De.useMemo(() => {
|
|
3841
3841
|
var Ke;
|
|
3842
3842
|
return (Ke = f.closeButton) != null ? Ke : E;
|
|
3843
3843
|
}, [
|
|
3844
3844
|
f.closeButton,
|
|
3845
3845
|
E
|
|
3846
|
-
]), V =
|
|
3846
|
+
]), V = De.useMemo(() => f.duration || L || Pu, [
|
|
3847
3847
|
f.duration,
|
|
3848
3848
|
L
|
|
3849
|
-
]), ne =
|
|
3849
|
+
]), ne = De.useRef(0), pe = De.useRef(0), xe = De.useRef(0), Oe = De.useRef(null), [Le, Re] = G.split("-"), Xe = De.useMemo(() => y.reduce((Ke, pt, ht) => ht >= re ? Ke : Ke + pt.height, 0), [
|
|
3850
3850
|
y,
|
|
3851
3851
|
re
|
|
3852
|
-
]),
|
|
3853
|
-
|
|
3852
|
+
]), $e = Xw(), we = f.invert || d, he = _e === "loading";
|
|
3853
|
+
pe.current = De.useMemo(() => re * J + Xe, [
|
|
3854
3854
|
re,
|
|
3855
3855
|
Xe
|
|
3856
|
-
]),
|
|
3857
|
-
|
|
3856
|
+
]), De.useEffect(() => {
|
|
3857
|
+
ge.current = V;
|
|
3858
3858
|
}, [
|
|
3859
3859
|
V
|
|
3860
|
-
]),
|
|
3860
|
+
]), De.useEffect(() => {
|
|
3861
3861
|
Y(!0);
|
|
3862
|
-
}, []),
|
|
3862
|
+
}, []), De.useEffect(() => {
|
|
3863
3863
|
const Ke = ee.current;
|
|
3864
3864
|
if (Ke) {
|
|
3865
3865
|
const pt = Ke.getBoundingClientRect().height;
|
|
@@ -3875,7 +3875,7 @@ const dN = (e) => {
|
|
|
3875
3875
|
}, [
|
|
3876
3876
|
g,
|
|
3877
3877
|
f.id
|
|
3878
|
-
]),
|
|
3878
|
+
]), De.useLayoutEffect(() => {
|
|
3879
3879
|
if (!R) return;
|
|
3880
3880
|
const Ke = ee.current, pt = Ke.style.height;
|
|
3881
3881
|
Ke.style.height = "auto";
|
|
@@ -3901,38 +3901,38 @@ const dN = (e) => {
|
|
|
3901
3901
|
f.action,
|
|
3902
3902
|
f.cancel
|
|
3903
3903
|
]);
|
|
3904
|
-
const Me =
|
|
3905
|
-
ie(!0), Ue(
|
|
3904
|
+
const Me = De.useCallback(() => {
|
|
3905
|
+
ie(!0), Ue(pe.current), g((Ke) => Ke.filter((pt) => pt.toastId !== f.id)), setTimeout(() => {
|
|
3906
3906
|
k(f);
|
|
3907
3907
|
}, lN);
|
|
3908
3908
|
}, [
|
|
3909
3909
|
f,
|
|
3910
3910
|
k,
|
|
3911
3911
|
g,
|
|
3912
|
-
|
|
3912
|
+
pe
|
|
3913
3913
|
]);
|
|
3914
|
-
|
|
3915
|
-
if (f.promise &&
|
|
3914
|
+
De.useEffect(() => {
|
|
3915
|
+
if (f.promise && _e === "loading" || f.duration === 1 / 0 || f.type === "loading") return;
|
|
3916
3916
|
let Ke;
|
|
3917
|
-
return A || p ||
|
|
3917
|
+
return A || p || $e ? (() => {
|
|
3918
3918
|
if (xe.current < ne.current) {
|
|
3919
3919
|
const Et = (/* @__PURE__ */ new Date()).getTime() - ne.current;
|
|
3920
|
-
|
|
3920
|
+
ge.current = ge.current - Et;
|
|
3921
3921
|
}
|
|
3922
3922
|
xe.current = (/* @__PURE__ */ new Date()).getTime();
|
|
3923
3923
|
})() : (() => {
|
|
3924
|
-
|
|
3924
|
+
ge.current !== 1 / 0 && (ne.current = (/* @__PURE__ */ new Date()).getTime(), Ke = setTimeout(() => {
|
|
3925
3925
|
f.onAutoClose == null || f.onAutoClose.call(f, f), Me();
|
|
3926
|
-
},
|
|
3926
|
+
}, ge.current));
|
|
3927
3927
|
})(), () => clearTimeout(Ke);
|
|
3928
3928
|
}, [
|
|
3929
3929
|
A,
|
|
3930
3930
|
p,
|
|
3931
3931
|
f,
|
|
3932
|
-
|
|
3933
|
-
|
|
3932
|
+
_e,
|
|
3933
|
+
$e,
|
|
3934
3934
|
Me
|
|
3935
|
-
]),
|
|
3935
|
+
]), De.useEffect(() => {
|
|
3936
3936
|
f.delete && (Me(), f.onDismiss == null || f.onDismiss.call(f, f));
|
|
3937
3937
|
}, [
|
|
3938
3938
|
Me,
|
|
@@ -3942,37 +3942,37 @@ const dN = (e) => {
|
|
|
3942
3942
|
var Ke;
|
|
3943
3943
|
if (H?.loading) {
|
|
3944
3944
|
var pt;
|
|
3945
|
-
return /* @__PURE__ */
|
|
3945
|
+
return /* @__PURE__ */ De.createElement("div", {
|
|
3946
3946
|
className: Pn(X?.loader, f == null || (pt = f.classNames) == null ? void 0 : pt.loader, "sonner-loader"),
|
|
3947
|
-
"data-visible":
|
|
3947
|
+
"data-visible": _e === "loading"
|
|
3948
3948
|
}, H.loading);
|
|
3949
3949
|
}
|
|
3950
|
-
return /* @__PURE__ */
|
|
3950
|
+
return /* @__PURE__ */ De.createElement(Ww, {
|
|
3951
3951
|
className: Pn(X?.loader, f == null || (Ke = f.classNames) == null ? void 0 : Ke.loader),
|
|
3952
|
-
visible:
|
|
3952
|
+
visible: _e === "loading"
|
|
3953
3953
|
});
|
|
3954
3954
|
}
|
|
3955
|
-
const Ot = f.icon || H?.[
|
|
3955
|
+
const Ot = f.icon || H?.[_e] || jw(_e);
|
|
3956
3956
|
var At, Tt;
|
|
3957
|
-
return /* @__PURE__ */
|
|
3957
|
+
return /* @__PURE__ */ De.createElement("li", {
|
|
3958
3958
|
tabIndex: 0,
|
|
3959
3959
|
ref: ee,
|
|
3960
|
-
className: Pn(j, W, X?.toast, f == null || (t = f.classNames) == null ? void 0 : t.toast, X?.default, X?.[
|
|
3960
|
+
className: Pn(j, W, X?.toast, f == null || (t = f.classNames) == null ? void 0 : t.toast, X?.default, X?.[_e], f == null || (n = f.classNames) == null ? void 0 : n[_e]),
|
|
3961
3961
|
"data-sonner-toast": "",
|
|
3962
3962
|
"data-rich-colors": (At = f.richColors) != null ? At : T,
|
|
3963
3963
|
"data-styled": !(f.jsx || f.unstyled || h),
|
|
3964
3964
|
"data-mounted": R,
|
|
3965
3965
|
"data-promise": !!f.promise,
|
|
3966
|
-
"data-swiped":
|
|
3966
|
+
"data-swiped": Be,
|
|
3967
3967
|
"data-removed": se,
|
|
3968
3968
|
"data-visible": be,
|
|
3969
|
-
"data-y-position":
|
|
3970
|
-
"data-x-position":
|
|
3969
|
+
"data-y-position": Le,
|
|
3970
|
+
"data-x-position": Re,
|
|
3971
3971
|
"data-index": x,
|
|
3972
3972
|
"data-front": me,
|
|
3973
3973
|
"data-swiping": ue,
|
|
3974
|
-
"data-dismissible":
|
|
3975
|
-
"data-type":
|
|
3974
|
+
"data-dismissible": Fe,
|
|
3975
|
+
"data-type": _e,
|
|
3976
3976
|
"data-invert": we,
|
|
3977
3977
|
"data-swipe-out": Ce,
|
|
3978
3978
|
"data-swipe-direction": S,
|
|
@@ -3982,38 +3982,38 @@ const dN = (e) => {
|
|
|
3982
3982
|
"--index": x,
|
|
3983
3983
|
"--toasts-before": x,
|
|
3984
3984
|
"--z-index": w.length - x,
|
|
3985
|
-
"--offset": `${se ? Ze :
|
|
3985
|
+
"--offset": `${se ? Ze : pe.current}px`,
|
|
3986
3986
|
"--initial-height": D ? "auto" : `${Ye}px`,
|
|
3987
3987
|
...O,
|
|
3988
3988
|
...f.style
|
|
3989
3989
|
},
|
|
3990
3990
|
onDragEnd: () => {
|
|
3991
|
-
oe(!1), I(null),
|
|
3991
|
+
oe(!1), I(null), Oe.current = null;
|
|
3992
3992
|
},
|
|
3993
3993
|
onPointerDown: (Ke) => {
|
|
3994
|
-
Ke.button !== 2 && (he || !
|
|
3994
|
+
Ke.button !== 2 && (he || !Fe || (Ie.current = /* @__PURE__ */ new Date(), Ue(pe.current), Ke.target.setPointerCapture(Ke.pointerId), Ke.target.tagName !== "BUTTON" && (oe(!0), Oe.current = {
|
|
3995
3995
|
x: Ke.clientX,
|
|
3996
3996
|
y: Ke.clientY
|
|
3997
3997
|
})));
|
|
3998
3998
|
},
|
|
3999
3999
|
onPointerUp: () => {
|
|
4000
4000
|
var Ke, pt, ht;
|
|
4001
|
-
if (Ce || !
|
|
4002
|
-
|
|
4003
|
-
const Et = Number(((Ke = ee.current) == null ? void 0 : Ke.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Ht = Number(((pt = ee.current) == null ? void 0 : pt.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), xt = (/* @__PURE__ */ new Date()).getTime() - ((ht =
|
|
4001
|
+
if (Ce || !Fe) return;
|
|
4002
|
+
Oe.current = null;
|
|
4003
|
+
const Et = Number(((Ke = ee.current) == null ? void 0 : Ke.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Ht = Number(((pt = ee.current) == null ? void 0 : pt.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), xt = (/* @__PURE__ */ new Date()).getTime() - ((ht = Ie.current) == null ? void 0 : ht.getTime()), at = z === "x" ? Et : Ht, It = Math.abs(at) / xt;
|
|
4004
4004
|
if (Math.abs(at) >= aN || It > 0.11) {
|
|
4005
|
-
Ue(
|
|
4005
|
+
Ue(pe.current), f.onDismiss == null || f.onDismiss.call(f, f), C(z === "x" ? Et > 0 ? "right" : "left" : Ht > 0 ? "down" : "up"), Me(), ze(!0);
|
|
4006
4006
|
return;
|
|
4007
4007
|
} else {
|
|
4008
4008
|
var Nt, fe;
|
|
4009
4009
|
(Nt = ee.current) == null || Nt.style.setProperty("--swipe-amount-x", "0px"), (fe = ee.current) == null || fe.style.setProperty("--swipe-amount-y", "0px");
|
|
4010
4010
|
}
|
|
4011
|
-
|
|
4011
|
+
Te(!1), oe(!1), I(null);
|
|
4012
4012
|
},
|
|
4013
4013
|
onPointerMove: (Ke) => {
|
|
4014
4014
|
var pt, ht, Et;
|
|
4015
|
-
if (!
|
|
4016
|
-
const xt = Ke.clientY -
|
|
4015
|
+
if (!Oe.current || !Fe || ((pt = window.getSelection()) == null ? void 0 : pt.toString().length) > 0) return;
|
|
4016
|
+
const xt = Ke.clientY - Oe.current.y, at = Ke.clientX - Oe.current.x;
|
|
4017
4017
|
var It;
|
|
4018
4018
|
const Nt = (It = e.swipeDirections) != null ? It : cN(G);
|
|
4019
4019
|
!z && (Math.abs(at) > 1 || Math.abs(xt) > 1) && I(Math.abs(at) > Math.abs(xt) ? "x" : "y");
|
|
@@ -4037,38 +4037,38 @@ const dN = (e) => {
|
|
|
4037
4037
|
const Rt = at * on(at);
|
|
4038
4038
|
fe.x = Math.abs(Rt) < Math.abs(at) ? Rt : at;
|
|
4039
4039
|
}
|
|
4040
|
-
(Math.abs(fe.x) > 0 || Math.abs(fe.y) > 0) &&
|
|
4040
|
+
(Math.abs(fe.x) > 0 || Math.abs(fe.y) > 0) && Te(!0), (ht = ee.current) == null || ht.style.setProperty("--swipe-amount-x", `${fe.x}px`), (Et = ee.current) == null || Et.style.setProperty("--swipe-amount-y", `${fe.y}px`);
|
|
4041
4041
|
}
|
|
4042
|
-
}, ye && !f.jsx &&
|
|
4042
|
+
}, ye && !f.jsx && _e !== "loading" ? /* @__PURE__ */ De.createElement("button", {
|
|
4043
4043
|
"aria-label": _,
|
|
4044
4044
|
"data-disabled": he,
|
|
4045
4045
|
"data-close-button": !0,
|
|
4046
|
-
onClick: he || !
|
|
4046
|
+
onClick: he || !Fe ? () => {
|
|
4047
4047
|
} : () => {
|
|
4048
4048
|
Me(), f.onDismiss == null || f.onDismiss.call(f, f);
|
|
4049
4049
|
},
|
|
4050
4050
|
className: Pn(X?.closeButton, f == null || (r = f.classNames) == null ? void 0 : r.closeButton)
|
|
4051
|
-
}, (Tt = H?.close) != null ? Tt : Gw) : null, (
|
|
4051
|
+
}, (Tt = H?.close) != null ? Tt : Gw) : null, (_e || f.icon || f.promise) && f.icon !== null && (H?.[_e] !== null || f.icon) ? /* @__PURE__ */ De.createElement("div", {
|
|
4052
4052
|
"data-icon": "",
|
|
4053
4053
|
className: Pn(X?.icon, f == null || (o = f.classNames) == null ? void 0 : o.icon)
|
|
4054
|
-
}, f.promise || f.type === "loading" && !f.icon ? f.icon || tt() : null, f.type !== "loading" ? Ot : null) : null, /* @__PURE__ */
|
|
4054
|
+
}, f.promise || f.type === "loading" && !f.icon ? f.icon || tt() : null, f.type !== "loading" ? Ot : null) : null, /* @__PURE__ */ De.createElement("div", {
|
|
4055
4055
|
"data-content": "",
|
|
4056
4056
|
className: Pn(X?.content, f == null || (i = f.classNames) == null ? void 0 : i.content)
|
|
4057
|
-
}, /* @__PURE__ */
|
|
4057
|
+
}, /* @__PURE__ */ De.createElement("div", {
|
|
4058
4058
|
"data-title": "",
|
|
4059
4059
|
className: Pn(X?.title, f == null || (a = f.classNames) == null ? void 0 : a.title)
|
|
4060
|
-
}, f.jsx ? f.jsx : typeof f.title == "function" ? f.title() : f.title), f.description ? /* @__PURE__ */
|
|
4060
|
+
}, f.jsx ? f.jsx : typeof f.title == "function" ? f.title() : f.title), f.description ? /* @__PURE__ */ De.createElement("div", {
|
|
4061
4061
|
"data-description": "",
|
|
4062
4062
|
className: Pn(M, Ne, X?.description, f == null || (l = f.classNames) == null ? void 0 : l.description)
|
|
4063
|
-
}, typeof f.description == "function" ? f.description() : f.description) : null), /* @__PURE__ */
|
|
4063
|
+
}, typeof f.description == "function" ? f.description() : f.description) : null), /* @__PURE__ */ De.isValidElement(f.cancel) ? f.cancel : f.cancel && fi(f.cancel) ? /* @__PURE__ */ De.createElement("button", {
|
|
4064
4064
|
"data-button": !0,
|
|
4065
4065
|
"data-cancel": !0,
|
|
4066
4066
|
style: f.cancelButtonStyle || B,
|
|
4067
4067
|
onClick: (Ke) => {
|
|
4068
|
-
fi(f.cancel) &&
|
|
4068
|
+
fi(f.cancel) && Fe && (f.cancel.onClick == null || f.cancel.onClick.call(f.cancel, Ke), Me());
|
|
4069
4069
|
},
|
|
4070
4070
|
className: Pn(X?.cancelButton, f == null || (c = f.classNames) == null ? void 0 : c.cancelButton)
|
|
4071
|
-
}, f.cancel.label) : null, /* @__PURE__ */
|
|
4071
|
+
}, f.cancel.label) : null, /* @__PURE__ */ De.isValidElement(f.action) ? f.action : f.action && fi(f.action) ? /* @__PURE__ */ De.createElement("button", {
|
|
4072
4072
|
"data-button": !0,
|
|
4073
4073
|
"data-action": !0,
|
|
4074
4074
|
style: f.actionButtonStyle || q,
|
|
@@ -4110,25 +4110,25 @@ function uN(e, t) {
|
|
|
4110
4110
|
}) : c(l);
|
|
4111
4111
|
}), n;
|
|
4112
4112
|
}
|
|
4113
|
-
const fN = /* @__PURE__ */
|
|
4113
|
+
const fN = /* @__PURE__ */ De.forwardRef(function(t, n) {
|
|
4114
4114
|
const { id: r, invert: o, position: i = "bottom-right", hotkey: a = [
|
|
4115
4115
|
"altKey",
|
|
4116
4116
|
"KeyT"
|
|
4117
|
-
], expand: l, closeButton: c, className: u, offset: d, mobileOffset: f, theme: h = "light", richColors: p, duration: g, style: v, visibleToasts: y = nN, toastOptions: x, dir: w = ju(), gap: A = iN, icons: k, containerAriaLabel: T = "Notifications" } = t, [E, O] =
|
|
4117
|
+
], expand: l, closeButton: c, className: u, offset: d, mobileOffset: f, theme: h = "light", richColors: p, duration: g, style: v, visibleToasts: y = nN, toastOptions: x, dir: w = ju(), gap: A = iN, icons: k, containerAriaLabel: T = "Notifications" } = t, [E, O] = De.useState([]), B = De.useMemo(() => r ? E.filter((R) => R.toasterId === r) : E.filter((R) => !R.toasterId), [
|
|
4118
4118
|
E,
|
|
4119
4119
|
r
|
|
4120
|
-
]), q =
|
|
4120
|
+
]), q = De.useMemo(() => Array.from(new Set([
|
|
4121
4121
|
i
|
|
4122
4122
|
].concat(B.filter((R) => R.position).map((R) => R.position)))), [
|
|
4123
4123
|
B,
|
|
4124
4124
|
i
|
|
4125
|
-
]), [j, M] =
|
|
4125
|
+
]), [j, M] = De.useState([]), [L, G] = De.useState(!1), [J, D] = De.useState(!1), [X, H] = De.useState(h !== "system" ? h : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), _ = De.useRef(null), z = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), I = De.useRef(null), S = De.useRef(!1), C = De.useCallback((R) => {
|
|
4126
4126
|
O((Y) => {
|
|
4127
4127
|
var se;
|
|
4128
4128
|
return (se = Y.find((ie) => ie.id === R.id)) != null && se.delete || un.dismiss(R.id), Y.filter(({ id: ie }) => ie !== R.id);
|
|
4129
4129
|
});
|
|
4130
4130
|
}, []);
|
|
4131
|
-
return
|
|
4131
|
+
return De.useEffect(() => un.subscribe((R) => {
|
|
4132
4132
|
if (R.dismiss) {
|
|
4133
4133
|
requestAnimationFrame(() => {
|
|
4134
4134
|
O((Y) => Y.map((se) => se.id === R.id ? {
|
|
@@ -4158,7 +4158,7 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4158
4158
|
});
|
|
4159
4159
|
}), [
|
|
4160
4160
|
E
|
|
4161
|
-
]),
|
|
4161
|
+
]), De.useEffect(() => {
|
|
4162
4162
|
if (h !== "system") {
|
|
4163
4163
|
H(h);
|
|
4164
4164
|
return;
|
|
@@ -4180,11 +4180,11 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4180
4180
|
}
|
|
4181
4181
|
}, [
|
|
4182
4182
|
h
|
|
4183
|
-
]),
|
|
4183
|
+
]), De.useEffect(() => {
|
|
4184
4184
|
E.length <= 1 && G(!1);
|
|
4185
4185
|
}, [
|
|
4186
4186
|
E
|
|
4187
|
-
]),
|
|
4187
|
+
]), De.useEffect(() => {
|
|
4188
4188
|
const R = (Y) => {
|
|
4189
4189
|
var se;
|
|
4190
4190
|
if (a.every((oe) => Y[oe] || Y.code === oe)) {
|
|
@@ -4196,7 +4196,7 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4196
4196
|
return document.addEventListener("keydown", R), () => document.removeEventListener("keydown", R);
|
|
4197
4197
|
}, [
|
|
4198
4198
|
a
|
|
4199
|
-
]),
|
|
4199
|
+
]), De.useEffect(() => {
|
|
4200
4200
|
if (_.current)
|
|
4201
4201
|
return () => {
|
|
4202
4202
|
I.current && (I.current.focus({
|
|
@@ -4206,7 +4206,7 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4206
4206
|
}, [
|
|
4207
4207
|
_.current
|
|
4208
4208
|
]), // Remove item from normal navigation flow, only available via hotkey
|
|
4209
|
-
/* @__PURE__ */
|
|
4209
|
+
/* @__PURE__ */ De.createElement("section", {
|
|
4210
4210
|
ref: n,
|
|
4211
4211
|
"aria-label": `${T} ${z}`,
|
|
4212
4212
|
tabIndex: -1,
|
|
@@ -4217,7 +4217,7 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4217
4217
|
}, q.map((R, Y) => {
|
|
4218
4218
|
var se;
|
|
4219
4219
|
const [ie, ue] = R.split("-");
|
|
4220
|
-
return B.length ? /* @__PURE__ */
|
|
4220
|
+
return B.length ? /* @__PURE__ */ De.createElement("ol", {
|
|
4221
4221
|
key: R,
|
|
4222
4222
|
dir: w === "auto" ? ju() : w,
|
|
4223
4223
|
tabIndex: -1,
|
|
@@ -4253,19 +4253,19 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4253
4253
|
},
|
|
4254
4254
|
onPointerUp: () => D(!1)
|
|
4255
4255
|
}, B.filter((oe) => !oe.position && Y === 0 || oe.position === R).map((oe, Ce) => {
|
|
4256
|
-
var
|
|
4257
|
-
return /* @__PURE__ */
|
|
4256
|
+
var ze, Be;
|
|
4257
|
+
return /* @__PURE__ */ De.createElement(dN, {
|
|
4258
4258
|
key: oe.id,
|
|
4259
4259
|
icons: k,
|
|
4260
4260
|
index: Ce,
|
|
4261
4261
|
toast: oe,
|
|
4262
4262
|
defaultRichColors: p,
|
|
4263
|
-
duration: (
|
|
4263
|
+
duration: (ze = x?.duration) != null ? ze : g,
|
|
4264
4264
|
className: x?.className,
|
|
4265
4265
|
descriptionClassName: x?.descriptionClassName,
|
|
4266
4266
|
invert: o,
|
|
4267
4267
|
visibleToasts: y,
|
|
4268
|
-
closeButton: (
|
|
4268
|
+
closeButton: (Be = x?.closeButton) != null ? Be : c,
|
|
4269
4269
|
interacting: J,
|
|
4270
4270
|
position: R,
|
|
4271
4271
|
style: x?.style,
|
|
@@ -4275,8 +4275,8 @@ const fN = /* @__PURE__ */ Be.forwardRef(function(t, n) {
|
|
|
4275
4275
|
actionButtonStyle: x?.actionButtonStyle,
|
|
4276
4276
|
closeButtonAriaLabel: x?.closeButtonAriaLabel,
|
|
4277
4277
|
removeToast: C,
|
|
4278
|
-
toasts: B.filter((
|
|
4279
|
-
heights: j.filter((
|
|
4278
|
+
toasts: B.filter((Te) => Te.position == oe.position),
|
|
4279
|
+
heights: j.filter((Te) => Te.position == oe.position),
|
|
4280
4280
|
setHeights: M,
|
|
4281
4281
|
expandByDefault: l,
|
|
4282
4282
|
gap: A,
|
|
@@ -6197,7 +6197,7 @@ function V2(e) {
|
|
|
6197
6197
|
};
|
|
6198
6198
|
}
|
|
6199
6199
|
function dp(e) {
|
|
6200
|
-
return e.role === "assistant" && e.kind === "text" && typeof e.id == "string" && e.id.startsWith("draft-");
|
|
6200
|
+
return e.role === "assistant" && (e.kind === "text" || e.kind === "thinking") && typeof e.id == "string" && e.id.startsWith("draft-");
|
|
6201
6201
|
}
|
|
6202
6202
|
function So(e) {
|
|
6203
6203
|
const t = [];
|
|
@@ -6289,15 +6289,15 @@ function Y2(e, t, n = {}) {
|
|
|
6289
6289
|
}, [e]), c = je(() => {
|
|
6290
6290
|
const V = {};
|
|
6291
6291
|
for (const ne of e) {
|
|
6292
|
-
const
|
|
6293
|
-
ne.sessionId &&
|
|
6292
|
+
const pe = V2(ne);
|
|
6293
|
+
ne.sessionId && pe && (V[ne.sessionId] = pe);
|
|
6294
6294
|
}
|
|
6295
6295
|
return V;
|
|
6296
6296
|
}, [e]), [u, d] = N({}), [f, h] = N({}), [p, g] = N({}), [v, y] = N({}), [x, w] = N({}), A = U(null), k = U(!1), T = U(/* @__PURE__ */ new Set()), E = U(/* @__PURE__ */ new Set()), O = U(/* @__PURE__ */ new Map()), B = U(/* @__PURE__ */ new Set()), q = U(/* @__PURE__ */ new Set()), j = U({}), M = U({}), L = U({}), G = U({}), J = U({}), D = U(u), X = U(x), H = U({}), _ = U(/* @__PURE__ */ new Set()), z = U(/* @__PURE__ */ new Set()), I = U(0), S = U(0), C = U(!1), R = U(bi), Y = U(null), se = U(!1), ie = U(0), ue = U(null), oe = U(null), Ce = U(() => {
|
|
6297
|
-
}), [
|
|
6298
|
-
const
|
|
6299
|
-
if (
|
|
6300
|
-
for (const xe of
|
|
6297
|
+
}), [ze, Be] = N(X2), Te = te((V, ne) => {
|
|
6298
|
+
const pe = L.current[V];
|
|
6299
|
+
if (pe?.size)
|
|
6300
|
+
for (const xe of pe) xe(ne);
|
|
6301
6301
|
}, []);
|
|
6302
6302
|
K(() => {
|
|
6303
6303
|
D.current = u;
|
|
@@ -6314,46 +6314,46 @@ function Y2(e, t, n = {}) {
|
|
|
6314
6314
|
if (!V.length) return !1;
|
|
6315
6315
|
for (const ne of V) delete j.current[Nn(ne)];
|
|
6316
6316
|
return Ze({ t: "unsubscribe", channels: V });
|
|
6317
|
-
}, [Ze]),
|
|
6317
|
+
}, [Ze]), ge = te((V, ne, pe = !1, xe) => {
|
|
6318
6318
|
_.current.has(V) || (_.current.add(V), fn("ws_client_first_msg", {
|
|
6319
6319
|
sid: V,
|
|
6320
6320
|
kind: ne.kind,
|
|
6321
6321
|
role: ne.role,
|
|
6322
|
-
batch:
|
|
6322
|
+
batch: pe,
|
|
6323
6323
|
count: xe,
|
|
6324
6324
|
elapsedMs: Math.round((performance.now() - I.current) * 1e3) / 1e3
|
|
6325
6325
|
}));
|
|
6326
|
-
}, []),
|
|
6326
|
+
}, []), Ie = te((V) => {
|
|
6327
6327
|
if (V.t === "ping") {
|
|
6328
6328
|
Ze({ t: "pong", ...V.id ? { id: V.id } : {} });
|
|
6329
6329
|
return;
|
|
6330
6330
|
}
|
|
6331
6331
|
if (V.t === "pong") {
|
|
6332
|
-
const
|
|
6333
|
-
V.id &&
|
|
6332
|
+
const pe = oe.current;
|
|
6333
|
+
V.id && pe?.id === V.id && (clearTimeout(pe.timer), oe.current = null);
|
|
6334
6334
|
const xe = ue.current;
|
|
6335
6335
|
if (!V.id || !xe || V.id !== xe.id) return;
|
|
6336
6336
|
ue.current = null;
|
|
6337
|
-
const
|
|
6338
|
-
|
|
6337
|
+
const Oe = Math.max(1, Math.round(performance.now() - xe.startedAt));
|
|
6338
|
+
Be((Le) => ({ ...Le, latencyMs: Oe }));
|
|
6339
6339
|
return;
|
|
6340
6340
|
}
|
|
6341
6341
|
if ("kind" in V && V.kind && "key" in V && typeof V.key == "string") {
|
|
6342
|
-
const
|
|
6342
|
+
const pe = Nn({ kind: V.kind, key: V.key });
|
|
6343
6343
|
if (typeof V.seq == "number" && Number.isFinite(V.seq)) {
|
|
6344
|
-
const xe = j.current[
|
|
6344
|
+
const xe = j.current[pe] ?? 0;
|
|
6345
6345
|
if (!(V.t === "snapshot" || V.t === "gap" || V.t === "resumed") && V.seq <= xe) return;
|
|
6346
|
-
j.current[
|
|
6346
|
+
j.current[pe] = V.seq;
|
|
6347
6347
|
}
|
|
6348
6348
|
if (V.t === "error") {
|
|
6349
6349
|
const xe = V.message || V.code || "live socket error";
|
|
6350
|
-
V.kind === "transcript" &&
|
|
6350
|
+
V.kind === "transcript" && Te(V.key, { type: "error", error: xe }), V.kind === "agent_run" && M.current[V.key]?.onError?.(xe);
|
|
6351
6351
|
return;
|
|
6352
6352
|
}
|
|
6353
6353
|
if (V.t === "gap" || V.t === "resumed") return;
|
|
6354
6354
|
if (V.t === "snapshot") {
|
|
6355
6355
|
if (V.kind === "transcript") {
|
|
6356
|
-
|
|
6356
|
+
Ie({
|
|
6357
6357
|
t: "batch",
|
|
6358
6358
|
sid: V.sid ?? V.key,
|
|
6359
6359
|
messages: V.messages,
|
|
@@ -6370,7 +6370,7 @@ function Y2(e, t, n = {}) {
|
|
|
6370
6370
|
const xe = V.delta;
|
|
6371
6371
|
if (!xe) return;
|
|
6372
6372
|
if (V.kind === "transcript" && xe.t) {
|
|
6373
|
-
|
|
6373
|
+
Ie({ ...xe, t: xe.t, sid: xe.sid ?? V.key });
|
|
6374
6374
|
return;
|
|
6375
6375
|
}
|
|
6376
6376
|
if (V.kind === "agent_run" && xe.event) {
|
|
@@ -6387,57 +6387,64 @@ function Y2(e, t, n = {}) {
|
|
|
6387
6387
|
const ne = "sid" in V ? V.sid : void 0;
|
|
6388
6388
|
if (!(!ne || !T.current.has(ne))) {
|
|
6389
6389
|
if (V.t === "batch") {
|
|
6390
|
-
const
|
|
6391
|
-
|
|
6390
|
+
const pe = So(Ri(Array.isArray(V.messages) ? V.messages : []));
|
|
6391
|
+
pe.length && ge(ne, pe[0], !0, pe.length), y((Oe) => ({ ...Oe, [ne]: !1 }));
|
|
6392
6392
|
const xe = J.current[ne] || (J.current[ne] = /* @__PURE__ */ new Set());
|
|
6393
|
-
for (const
|
|
6394
|
-
const
|
|
6395
|
-
|
|
6393
|
+
for (const Oe of pe) {
|
|
6394
|
+
const Le = _n(Oe);
|
|
6395
|
+
Le && Oe.kind !== "thinking" && xe.add(Le);
|
|
6396
6396
|
}
|
|
6397
|
-
xe.size > 800 && (J.current[ne] = new Set(Array.from(xe).slice(-400))), w((
|
|
6398
|
-
const
|
|
6399
|
-
return { ...
|
|
6397
|
+
xe.size > 800 && (J.current[ne] = new Set(Array.from(xe).slice(-400))), w((Oe) => ({ ...Oe, [ne]: V.nextBefore ?? null })), d((Oe) => {
|
|
6398
|
+
const Le = Oe[ne] ?? [];
|
|
6399
|
+
return { ...Oe, [ne]: ef(Le, pe) };
|
|
6400
6400
|
});
|
|
6401
6401
|
return;
|
|
6402
6402
|
}
|
|
6403
6403
|
if (V.t === "msg") {
|
|
6404
|
-
const
|
|
6405
|
-
if (!
|
|
6406
|
-
const xe = Aa(
|
|
6407
|
-
|
|
6408
|
-
const
|
|
6409
|
-
if (
|
|
6410
|
-
const
|
|
6411
|
-
|
|
6404
|
+
const pe = V.message ?? V.m;
|
|
6405
|
+
if (!pe) return;
|
|
6406
|
+
const xe = Aa(pe);
|
|
6407
|
+
Te(ne, { type: "message", message: xe }), ge(ne, xe), y((Re) => ({ ...Re, [ne]: !1 }));
|
|
6408
|
+
const Oe = _n(xe);
|
|
6409
|
+
if (Oe && xe.kind !== "thinking") {
|
|
6410
|
+
const Re = J.current[ne] || (J.current[ne] = /* @__PURE__ */ new Set());
|
|
6411
|
+
Re.add(Oe), Re.size > 800 && (J.current[ne] = new Set(Array.from(Re).slice(-400)));
|
|
6412
6412
|
}
|
|
6413
|
-
d((
|
|
6414
|
-
const Xe =
|
|
6415
|
-
return { ...
|
|
6413
|
+
d((Re) => {
|
|
6414
|
+
const Xe = Re[ne] ?? [], $e = G2(Xe, xe);
|
|
6415
|
+
return { ...Re, [ne]: vr($e) };
|
|
6416
6416
|
});
|
|
6417
|
-
const
|
|
6418
|
-
|
|
6419
|
-
delete
|
|
6420
|
-
const Xe =
|
|
6421
|
-
return Xe?.some((
|
|
6417
|
+
const Le = H.current;
|
|
6418
|
+
Le[ne] && clearTimeout(Le[ne]), xe.kind === "thinking" ? Le[ne] = setTimeout(() => {
|
|
6419
|
+
delete Le[ne], d((Re) => {
|
|
6420
|
+
const Xe = Re[ne];
|
|
6421
|
+
return Xe?.some(($e) => $e.kind === "thinking") ? { ...Re, [ne]: Xe.filter(($e) => $e.kind !== "thinking") } : Re;
|
|
6422
6422
|
});
|
|
6423
|
-
}, 2500) : delete
|
|
6423
|
+
}, 2500) : delete Le[ne];
|
|
6424
6424
|
return;
|
|
6425
6425
|
}
|
|
6426
6426
|
if (V.t === "ai_part") {
|
|
6427
|
-
const
|
|
6428
|
-
if (
|
|
6429
|
-
y((
|
|
6427
|
+
const pe = V.part;
|
|
6428
|
+
if (pe && Te(ne, { type: "ai_part", part: pe }), pe?.type !== "text-delta" || !pe.id) return;
|
|
6429
|
+
y((Le) => ({ ...Le, [ne]: !1 }));
|
|
6430
6430
|
const xe = H.current;
|
|
6431
6431
|
xe[ne] && (clearTimeout(xe[ne]), delete xe[ne]);
|
|
6432
|
-
const
|
|
6433
|
-
z.current.add(ne), d((
|
|
6434
|
-
const
|
|
6435
|
-
if (
|
|
6436
|
-
const we = Xe?.catchUp ?? (
|
|
6432
|
+
const Oe = !z.current.has(ne);
|
|
6433
|
+
z.current.add(ne), d((Le) => {
|
|
6434
|
+
const Re = Le[ne] ?? [], Xe = Re.find((Me) => dp(Me) && Me.id === pe.id), $e = pe.reset ? pe.text ?? pe.delta ?? "" : `${Xe?.text ?? ""}${pe.delta ?? ""}`;
|
|
6435
|
+
if (!$e) return Le;
|
|
6436
|
+
const we = Xe?.catchUp ?? (Oe && !!pe.reset && $e.length > W2), he = {
|
|
6437
|
+
id: pe.id,
|
|
6438
|
+
role: "assistant",
|
|
6439
|
+
kind: pe.kind ?? "text",
|
|
6440
|
+
text: $e,
|
|
6441
|
+
ts: pe.ts ?? Date.now(),
|
|
6442
|
+
catchUp: we
|
|
6443
|
+
};
|
|
6437
6444
|
return {
|
|
6438
|
-
...
|
|
6445
|
+
...Le,
|
|
6439
6446
|
[ne]: vr([
|
|
6440
|
-
...
|
|
6447
|
+
...Re.filter((Me) => Me.kind !== "thinking" && Me.id !== pe.id),
|
|
6441
6448
|
he
|
|
6442
6449
|
])
|
|
6443
6450
|
};
|
|
@@ -6445,45 +6452,45 @@ function Y2(e, t, n = {}) {
|
|
|
6445
6452
|
return;
|
|
6446
6453
|
}
|
|
6447
6454
|
if (V.t === "busy") {
|
|
6448
|
-
const
|
|
6449
|
-
if (
|
|
6455
|
+
const pe = !!V.busy;
|
|
6456
|
+
if (Te(ne, { type: "busy", busy: pe }), h((xe) => ({ ...xe, [ne]: pe })), !pe) {
|
|
6450
6457
|
const xe = H.current[ne];
|
|
6451
|
-
xe && (clearTimeout(xe), delete H.current[ne]), d((
|
|
6452
|
-
const
|
|
6453
|
-
return
|
|
6458
|
+
xe && (clearTimeout(xe), delete H.current[ne]), d((Oe) => {
|
|
6459
|
+
const Le = Oe[ne];
|
|
6460
|
+
return Le?.some((Re) => Re.kind === "thinking") ? { ...Oe, [ne]: Le.filter((Re) => Re.kind !== "thinking") } : Oe;
|
|
6454
6461
|
});
|
|
6455
6462
|
}
|
|
6456
6463
|
return;
|
|
6457
6464
|
}
|
|
6458
|
-
if (V.t === "prompt" && g((
|
|
6459
|
-
const
|
|
6460
|
-
G.current[ne] =
|
|
6465
|
+
if (V.t === "prompt" && g((pe) => ({ ...pe, [ne]: V.prompt ?? null })), V.t === "queue") {
|
|
6466
|
+
const pe = Array.isArray(V.queue) ? V.queue : [];
|
|
6467
|
+
G.current[ne] = pe, Te(ne, { type: "queue", queue: pe }), d((xe) => ({
|
|
6461
6468
|
...xe,
|
|
6462
|
-
[ne]: rp(xe[ne] ?? [],
|
|
6469
|
+
[ne]: rp(xe[ne] ?? [], pe, q2)
|
|
6463
6470
|
}));
|
|
6464
6471
|
}
|
|
6465
6472
|
}
|
|
6466
|
-
}, [
|
|
6473
|
+
}, [Te, ge, Ze]);
|
|
6467
6474
|
K(() => {
|
|
6468
6475
|
if (!r) return;
|
|
6469
6476
|
C.current = !1, se.current = !1;
|
|
6470
6477
|
const V = () => {
|
|
6471
6478
|
const Xe = A.current;
|
|
6472
6479
|
if (!Xe || Xe.readyState !== WebSocket.OPEN) return;
|
|
6473
|
-
const
|
|
6474
|
-
ue.current = { id:
|
|
6475
|
-
}, ne = window.setInterval(V, 5e3),
|
|
6480
|
+
const $e = crypto.randomUUID?.() ?? `ping-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
6481
|
+
ue.current = { id: $e, startedAt: performance.now() }, Xe.send(JSON.stringify({ t: "ping", id: $e }));
|
|
6482
|
+
}, ne = window.setInterval(V, 5e3), pe = () => {
|
|
6476
6483
|
const Xe = Date.now();
|
|
6477
|
-
Xe - ie.current < 2e3 || (ie.current = Xe,
|
|
6484
|
+
Xe - ie.current < 2e3 || (ie.current = Xe, Be(($e) => ({ ...$e, lastMessageAt: Xe })));
|
|
6478
6485
|
}, xe = () => {
|
|
6479
6486
|
if (C.current || k.current) return;
|
|
6480
6487
|
const Xe = A.current;
|
|
6481
|
-
Xe && (Xe.readyState === WebSocket.OPEN || Xe.readyState === WebSocket.CONNECTING) || (Y.current != null && (clearTimeout(Y.current), Y.current = null), se.current = !1,
|
|
6482
|
-
|
|
6483
|
-
status:
|
|
6484
|
-
})), k.current = !0, Gy().then((
|
|
6488
|
+
Xe && (Xe.readyState === WebSocket.OPEN || Xe.readyState === WebSocket.CONNECTING) || (Y.current != null && (clearTimeout(Y.current), Y.current = null), se.current = !1, Be(($e) => ({
|
|
6489
|
+
...$e,
|
|
6490
|
+
status: $e.status === "offline" ? "offline" : $e.attempt > 0 ? "reconnecting" : "connecting"
|
|
6491
|
+
})), k.current = !0, Gy().then(($e) => {
|
|
6485
6492
|
k.current = !1;
|
|
6486
|
-
const we =
|
|
6493
|
+
const we = $e;
|
|
6487
6494
|
if (C.current) {
|
|
6488
6495
|
we.close();
|
|
6489
6496
|
return;
|
|
@@ -6494,20 +6501,20 @@ function Y2(e, t, n = {}) {
|
|
|
6494
6501
|
return;
|
|
6495
6502
|
}
|
|
6496
6503
|
A.current = we, I.current = performance.now(), _.current = /* @__PURE__ */ new Set(), z.current = /* @__PURE__ */ new Set(), we.onopen = () => {
|
|
6497
|
-
R.current = bi, fn("ws_client_open", { reconnects: S.current }), S.current = 0,
|
|
6504
|
+
R.current = bi, fn("ws_client_open", { reconnects: S.current }), S.current = 0, Be((tt) => ({ ...tt, status: "live", attempt: 0 })), V();
|
|
6498
6505
|
const Me = [...O.current.values()];
|
|
6499
6506
|
Me.length && (we.send(JSON.stringify({ t: "subscribe", channels: Me.map(Ue), deferToolArgs: !0 })), B.current = new Set(Me.map(Nn)), E.current = new Set(Me.filter((tt) => tt.kind === "transcript").map((tt) => tt.key)));
|
|
6500
6507
|
}, we.onmessage = (Me) => {
|
|
6501
6508
|
if (typeof Me.data != "string") return;
|
|
6502
6509
|
const tt = H2(Me.data);
|
|
6503
|
-
tt && (
|
|
6510
|
+
tt && (pe(), Ie(tt));
|
|
6504
6511
|
}, we.onclose = (Me) => {
|
|
6505
6512
|
const tt = oe.current;
|
|
6506
6513
|
if (tt?.ws === we && (clearTimeout(tt.timer), oe.current = null), A.current !== we || (A.current = null, E.current = /* @__PURE__ */ new Set(), B.current = /* @__PURE__ */ new Set(), C.current)) return;
|
|
6507
6514
|
const Ot = S.current += 1, At = Me.code, Tt = Me.reason || null;
|
|
6508
6515
|
fn("ws_client_reconnect", { attempt: Ot, backoffMs: R.current, code: At, reason: Tt });
|
|
6509
6516
|
const Ke = typeof navigator < "u" && navigator.onLine === !1;
|
|
6510
|
-
if (
|
|
6517
|
+
if (Be((ht) => ({
|
|
6511
6518
|
...ht,
|
|
6512
6519
|
status: Ke || Ot >= rf ? "offline" : "reconnecting",
|
|
6513
6520
|
attempt: Ot,
|
|
@@ -6526,14 +6533,14 @@ function Y2(e, t, n = {}) {
|
|
|
6526
6533
|
} catch {
|
|
6527
6534
|
}
|
|
6528
6535
|
};
|
|
6529
|
-
}).catch((
|
|
6536
|
+
}).catch(($e) => {
|
|
6530
6537
|
if (k.current = !1, C.current) return;
|
|
6531
|
-
const we = S.current += 1, he =
|
|
6538
|
+
const we = S.current += 1, he = $e instanceof Error ? $e.message : "socket open failed";
|
|
6532
6539
|
fn("ws_client_reconnect", {
|
|
6533
6540
|
attempt: we,
|
|
6534
6541
|
backoffMs: R.current,
|
|
6535
6542
|
reason: he
|
|
6536
|
-
}),
|
|
6543
|
+
}), Be((tt) => ({
|
|
6537
6544
|
...tt,
|
|
6538
6545
|
status: we >= rf ? "offline" : "reconnecting",
|
|
6539
6546
|
attempt: we,
|
|
@@ -6546,19 +6553,19 @@ function Y2(e, t, n = {}) {
|
|
|
6546
6553
|
}));
|
|
6547
6554
|
};
|
|
6548
6555
|
Ce.current = xe;
|
|
6549
|
-
const
|
|
6556
|
+
const Oe = () => {
|
|
6550
6557
|
R.current = bi, S.current = 0;
|
|
6551
|
-
},
|
|
6558
|
+
}, Le = () => {
|
|
6552
6559
|
if (typeof document > "u" || document.visibilityState !== "visible") return;
|
|
6553
|
-
const Xe = A.current,
|
|
6560
|
+
const Xe = A.current, $e = R2(
|
|
6554
6561
|
Xe?.readyState ?? null,
|
|
6555
6562
|
se.current
|
|
6556
6563
|
);
|
|
6557
|
-
if (
|
|
6558
|
-
se.current = !1,
|
|
6564
|
+
if ($e === "connect") {
|
|
6565
|
+
se.current = !1, Oe(), xe();
|
|
6559
6566
|
return;
|
|
6560
6567
|
}
|
|
6561
|
-
if (
|
|
6568
|
+
if ($e !== "probe" || !Xe) return;
|
|
6562
6569
|
const we = oe.current;
|
|
6563
6570
|
we && clearTimeout(we.timer);
|
|
6564
6571
|
const he = crypto.randomUUID?.() ?? `visible-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
@@ -6577,11 +6584,11 @@ function Y2(e, t, n = {}) {
|
|
|
6577
6584
|
}
|
|
6578
6585
|
}, nf);
|
|
6579
6586
|
oe.current = { id: he, ws: Xe, timer: Me };
|
|
6580
|
-
},
|
|
6581
|
-
se.current = !1, k.current = !1,
|
|
6587
|
+
}, Re = () => {
|
|
6588
|
+
se.current = !1, k.current = !1, Oe(), xe();
|
|
6582
6589
|
};
|
|
6583
|
-
return document.addEventListener("visibilitychange",
|
|
6584
|
-
C.current = !0, document.removeEventListener("visibilitychange",
|
|
6590
|
+
return document.addEventListener("visibilitychange", Le), window.addEventListener("online", Re), xe(), () => {
|
|
6591
|
+
C.current = !0, document.removeEventListener("visibilitychange", Le), window.removeEventListener("online", Re), window.clearInterval(ne), ue.current = null;
|
|
6585
6592
|
const Xe = oe.current;
|
|
6586
6593
|
Xe && (clearTimeout(Xe.timer), oe.current = null), Y.current != null && (clearTimeout(Y.current), Y.current = null), se.current = !1;
|
|
6587
6594
|
try {
|
|
@@ -6589,64 +6596,64 @@ function Y2(e, t, n = {}) {
|
|
|
6589
6596
|
} catch {
|
|
6590
6597
|
}
|
|
6591
6598
|
A.current = null, E.current = /* @__PURE__ */ new Set(), B.current = /* @__PURE__ */ new Set();
|
|
6592
|
-
for (const
|
|
6593
|
-
clearTimeout(H.current[
|
|
6599
|
+
for (const $e of Object.keys(H.current))
|
|
6600
|
+
clearTimeout(H.current[$e]), delete H.current[$e];
|
|
6594
6601
|
};
|
|
6595
|
-
}, [r,
|
|
6602
|
+
}, [r, Ie]);
|
|
6596
6603
|
const ee = te(() => {
|
|
6597
6604
|
se.current = !1, Y.current != null && (clearTimeout(Y.current), Y.current = null), R.current = bi, Ce.current();
|
|
6598
6605
|
}, []);
|
|
6599
6606
|
K(() => {
|
|
6600
6607
|
const V = new Set(i);
|
|
6601
6608
|
q.current = V;
|
|
6602
|
-
const ne = /* @__PURE__ */ new Set([...V, ...Object.keys(L.current)]),
|
|
6609
|
+
const ne = /* @__PURE__ */ new Set([...V, ...Object.keys(L.current)]), pe = new Set(Object.keys(l));
|
|
6603
6610
|
G.current = Object.fromEntries(
|
|
6604
|
-
Object.entries(G.current).filter(([we]) =>
|
|
6611
|
+
Object.entries(G.current).filter(([we]) => pe.has(we))
|
|
6605
6612
|
);
|
|
6606
6613
|
const xe = T.current;
|
|
6607
|
-
T.current = ne, J.current = Object.fromEntries(Object.entries(J.current).filter(([we]) =>
|
|
6614
|
+
T.current = ne, J.current = Object.fromEntries(Object.entries(J.current).filter(([we]) => pe.has(we))), d((we) => {
|
|
6608
6615
|
const he = {};
|
|
6609
|
-
for (const Me of /* @__PURE__ */ new Set([...
|
|
6616
|
+
for (const Me of /* @__PURE__ */ new Set([...pe, ...ne])) {
|
|
6610
6617
|
const tt = we[Me];
|
|
6611
6618
|
he[Me] = tt?.length ? tt : c[Me] ? [c[Me]] : [];
|
|
6612
6619
|
}
|
|
6613
6620
|
return he;
|
|
6614
|
-
}), h((we) => Object.fromEntries(Object.entries(we).filter(([he]) => ne.has(he)))), g((we) => Object.fromEntries(Object.entries(we).filter(([he]) => ne.has(he)))), w((we) => Object.fromEntries(Object.entries(we).filter(([he]) =>
|
|
6615
|
-
const he = Object.fromEntries(Object.entries(we).filter(([Me]) =>
|
|
6621
|
+
}), h((we) => Object.fromEntries(Object.entries(we).filter(([he]) => ne.has(he)))), g((we) => Object.fromEntries(Object.entries(we).filter(([he]) => ne.has(he)))), w((we) => Object.fromEntries(Object.entries(we).filter(([he]) => pe.has(he) || ne.has(he)))), y((we) => {
|
|
6622
|
+
const he = Object.fromEntries(Object.entries(we).filter(([Me]) => pe.has(Me)));
|
|
6616
6623
|
for (const Me of V)
|
|
6617
6624
|
!xe.has(Me) && !D.current[Me]?.some((tt) => !tt.seed) && (he[Me] = !0);
|
|
6618
6625
|
return he;
|
|
6619
6626
|
});
|
|
6620
|
-
const
|
|
6621
|
-
for (const [we, he] of
|
|
6622
|
-
he.kind === "transcript" &&
|
|
6627
|
+
const Oe = new Map(O.current);
|
|
6628
|
+
for (const [we, he] of Oe)
|
|
6629
|
+
he.kind === "transcript" && Oe.delete(we);
|
|
6623
6630
|
for (const we of ne) {
|
|
6624
6631
|
const he = xi(we);
|
|
6625
|
-
|
|
6632
|
+
Oe.set(Nn(he), he);
|
|
6626
6633
|
}
|
|
6627
|
-
if (O.current =
|
|
6628
|
-
const
|
|
6629
|
-
if (
|
|
6630
|
-
for (const we of
|
|
6631
|
-
|
|
6634
|
+
if (O.current = Oe, !r) return;
|
|
6635
|
+
const Le = B.current, Re = new Set([...ne].map((we) => Nn(xi(we)))), Xe = [...ne].map(xi).filter((we) => !Le.has(Nn(we))), $e = [...Le].map((we) => O.current.get(we) ?? (we.startsWith("transcript:") ? { kind: "transcript", key: we.slice(11) } : null)).filter((we) => !!we && we.kind === "transcript" && !Re.has(Nn(we)));
|
|
6636
|
+
if ($e.length && Qe($e))
|
|
6637
|
+
for (const we of $e)
|
|
6638
|
+
Le.delete(Nn(we)), E.current.delete(we.key);
|
|
6632
6639
|
if (Xe.length && Ye(Xe))
|
|
6633
6640
|
for (const we of Xe)
|
|
6634
|
-
|
|
6641
|
+
Le.add(Nn(we)), E.current.add(we.key);
|
|
6635
6642
|
}, [a, l, c, r, Ye, Qe]), K(() => {
|
|
6636
6643
|
if (!i.length) return;
|
|
6637
6644
|
const V = new Set(i), ne = window.setTimeout(() => {
|
|
6638
|
-
fn("ws_client_loading_fallback", { ids: i }), y((
|
|
6645
|
+
fn("ws_client_loading_fallback", { ids: i }), y((pe) => {
|
|
6639
6646
|
let xe = !1;
|
|
6640
|
-
const
|
|
6641
|
-
for (const
|
|
6642
|
-
|
|
6643
|
-
return xe ?
|
|
6647
|
+
const Oe = { ...pe };
|
|
6648
|
+
for (const Le of V)
|
|
6649
|
+
Oe[Le] && !D.current[Le]?.some((Re) => !Re.seed) && (Oe[Le] = !1, xe = !0);
|
|
6650
|
+
return xe ? Oe : pe;
|
|
6644
6651
|
});
|
|
6645
6652
|
}, 8e3);
|
|
6646
6653
|
return () => window.clearTimeout(ne);
|
|
6647
6654
|
}, [a, i]);
|
|
6648
6655
|
const me = te((V, ne) => {
|
|
6649
|
-
const
|
|
6656
|
+
const pe = {
|
|
6650
6657
|
id: `optimistic-${Date.now()}`,
|
|
6651
6658
|
role: "user",
|
|
6652
6659
|
kind: "text",
|
|
@@ -6658,87 +6665,87 @@ function Y2(e, t, n = {}) {
|
|
|
6658
6665
|
d((xe) => ({
|
|
6659
6666
|
...xe,
|
|
6660
6667
|
[V]: vr([
|
|
6661
|
-
...(xe[V] ?? []).filter((
|
|
6662
|
-
|
|
6668
|
+
...(xe[V] ?? []).filter((Oe) => Oe.kind !== "thinking"),
|
|
6669
|
+
pe
|
|
6663
6670
|
])
|
|
6664
6671
|
})), h((xe) => ({ ...xe, [V]: !0 }));
|
|
6665
6672
|
}, []), be = te((V, ne) => {
|
|
6666
|
-
d((
|
|
6667
|
-
const xe =
|
|
6668
|
-
let
|
|
6669
|
-
const
|
|
6670
|
-
return
|
|
6673
|
+
d((pe) => {
|
|
6674
|
+
const xe = pe[V] ?? [];
|
|
6675
|
+
let Oe = !1;
|
|
6676
|
+
const Le = xe.filter((Re) => Oe || !Re.pending || !Fs(Re.text, ne) ? !0 : (Oe = !0, !1));
|
|
6677
|
+
return Le.length === xe.length ? pe : { ...pe, [V]: Le };
|
|
6671
6678
|
});
|
|
6672
|
-
}, []),
|
|
6673
|
-
const xe = await ve(Ma(V)),
|
|
6674
|
-
for (const
|
|
6675
|
-
const Xe = _n(
|
|
6676
|
-
Xe &&
|
|
6677
|
-
}
|
|
6678
|
-
return
|
|
6679
|
-
const Xe =
|
|
6680
|
-
return !
|
|
6681
|
-
...
|
|
6682
|
-
[V]:
|
|
6679
|
+
}, []), _e = te(async (V, ne, pe = {}) => {
|
|
6680
|
+
const xe = await ve(Ma(V)), Oe = So(Ri(Array.isArray(xe.messages) ? xe.messages : [])), Le = J.current[V] || (J.current[V] = /* @__PURE__ */ new Set());
|
|
6681
|
+
for (const Re of Oe) {
|
|
6682
|
+
const Xe = _n(Re);
|
|
6683
|
+
Xe && Re.kind !== "thinking" && Le.add(Xe);
|
|
6684
|
+
}
|
|
6685
|
+
return Le.size > 800 && (J.current[V] = new Set(Array.from(Le).slice(-400))), y((Re) => ({ ...Re, [V]: !1 })), d((Re) => {
|
|
6686
|
+
const Xe = Re[V] ?? [], $e = ef(Xe, Oe);
|
|
6687
|
+
return !pe.dropOptimistic || !ne ? { ...Re, [V]: $e } : {
|
|
6688
|
+
...Re,
|
|
6689
|
+
[V]: $e.filter((we) => !we.pending || !Fs(we.text, ne))
|
|
6683
6690
|
};
|
|
6684
|
-
}),
|
|
6685
|
-
}, []),
|
|
6691
|
+
}), Oe;
|
|
6692
|
+
}, []), Fe = te((V, ne, pe) => {
|
|
6686
6693
|
(async () => {
|
|
6687
|
-
const xe =
|
|
6688
|
-
for (let
|
|
6689
|
-
|
|
6694
|
+
const xe = pe?.id;
|
|
6695
|
+
for (let Oe = 0; Oe < 45; Oe++) {
|
|
6696
|
+
Oe > 0 && await new Promise((Le) => window.setTimeout(Le, Oe < 8 ? 500 : 1200));
|
|
6690
6697
|
try {
|
|
6691
|
-
if ((
|
|
6698
|
+
if ((Oe === 0 || Oe % 3 === 0 ? await _e(V, ne) : null)?.some((we) => we.role === "user" && we.kind === "text" && Fs(we.text, ne))) {
|
|
6692
6699
|
be(V, ne);
|
|
6693
6700
|
return;
|
|
6694
6701
|
}
|
|
6695
|
-
const
|
|
6696
|
-
if (
|
|
6697
|
-
await
|
|
6702
|
+
const Re = await ve(`/api/sessions/${encodeURIComponent(V)}/queue`), Xe = Array.isArray(Re.queue) ? Re.queue : [], $e = (xe ? Xe.find((we) => we.id === xe) : null) ?? Xe.find((we) => Fs(we.text, ne));
|
|
6703
|
+
if (!$e) {
|
|
6704
|
+
await _e(V, ne, { dropOptimistic: !0 }).catch(() => null), be(V, ne);
|
|
6698
6705
|
return;
|
|
6699
6706
|
}
|
|
6700
|
-
if (
|
|
6701
|
-
await
|
|
6707
|
+
if ($e.status === "delivered") {
|
|
6708
|
+
await _e(V, ne, { dropOptimistic: !0 }).catch(() => null), be(V, ne);
|
|
6702
6709
|
return;
|
|
6703
6710
|
}
|
|
6704
|
-
if (
|
|
6711
|
+
if ($e.status === "failed") return;
|
|
6705
6712
|
} catch {
|
|
6706
6713
|
}
|
|
6707
6714
|
}
|
|
6708
6715
|
})();
|
|
6709
|
-
}, [
|
|
6716
|
+
}, [_e, be]), W = te(async (V) => {
|
|
6710
6717
|
if (!(V in X.current)) return !0;
|
|
6711
6718
|
const ne = X.current[V];
|
|
6712
6719
|
if (ne == null) return !1;
|
|
6713
|
-
const
|
|
6720
|
+
const pe = await ve(
|
|
6714
6721
|
sd(V, ne)
|
|
6715
|
-
), xe = So(Ri(Array.isArray(
|
|
6716
|
-
if (w((
|
|
6717
|
-
const
|
|
6718
|
-
for (const
|
|
6719
|
-
const
|
|
6720
|
-
|
|
6721
|
-
}
|
|
6722
|
-
return d((
|
|
6723
|
-
const
|
|
6722
|
+
), xe = So(Ri(Array.isArray(pe.messages) ? pe.messages : []));
|
|
6723
|
+
if (w((Le) => ({ ...Le, [V]: pe.nextBefore ?? null })), !xe.length) return (pe.nextBefore ?? null) !== null;
|
|
6724
|
+
const Oe = J.current[V] || (J.current[V] = /* @__PURE__ */ new Set());
|
|
6725
|
+
for (const Le of xe) {
|
|
6726
|
+
const Re = _n(Le);
|
|
6727
|
+
Re && Le.kind !== "thinking" && Oe.add(Re);
|
|
6728
|
+
}
|
|
6729
|
+
return d((Le) => {
|
|
6730
|
+
const Re = Le[V] ?? [], Xe = new Set(Re.map(_n).filter(Boolean)), $e = xe.filter((we) => {
|
|
6724
6731
|
const he = _n(we);
|
|
6725
6732
|
return !he || !Xe.has(he);
|
|
6726
6733
|
});
|
|
6727
|
-
return
|
|
6728
|
-
}), (
|
|
6734
|
+
return $e.length ? { ...Le, [V]: [...$e, ...Re.filter((we) => !we.seed)] } : Le;
|
|
6735
|
+
}), (pe.nextBefore ?? null) !== null;
|
|
6729
6736
|
}, []), Ne = te((V, ne) => {
|
|
6730
|
-
const
|
|
6731
|
-
return M.current[V] = ne, O.current.set(xe,
|
|
6732
|
-
delete M.current[V], O.current.delete(xe), r && Qe([
|
|
6737
|
+
const pe = { kind: "agent_run", key: V }, xe = Nn(pe);
|
|
6738
|
+
return M.current[V] = ne, O.current.set(xe, pe), r && Ye([pe]) && B.current.add(xe), () => {
|
|
6739
|
+
delete M.current[V], O.current.delete(xe), r && Qe([pe]) && B.current.delete(xe);
|
|
6733
6740
|
};
|
|
6734
6741
|
}, [r, Ye, Qe]), re = te((V, ne) => {
|
|
6735
6742
|
(L.current[V] || (L.current[V] = /* @__PURE__ */ new Set())).add(ne);
|
|
6736
6743
|
const xe = G.current[V];
|
|
6737
6744
|
xe && ne({ type: "queue", queue: xe });
|
|
6738
|
-
const
|
|
6739
|
-
return T.current.add(V), O.current.set(
|
|
6740
|
-
const
|
|
6741
|
-
|
|
6745
|
+
const Oe = xi(V), Le = Nn(Oe);
|
|
6746
|
+
return T.current.add(V), O.current.set(Le, Oe), r && !B.current.has(Le) && Ye([Oe]) && (B.current.add(Le), E.current.add(V)), () => {
|
|
6747
|
+
const Re = L.current[V];
|
|
6748
|
+
Re && (Re.delete(ne), !Re.size && (delete L.current[V], !q.current.has(V) && (T.current.delete(V), O.current.delete(Le), r && B.current.has(Le) && Qe([Oe]) && (B.current.delete(Le), E.current.delete(V)))));
|
|
6742
6749
|
};
|
|
6743
6750
|
}, [r, Ye, Qe]), ye = je(() => ({ ...l, ...f }), [l, f]);
|
|
6744
6751
|
return {
|
|
@@ -6748,9 +6755,9 @@ function Y2(e, t, n = {}) {
|
|
|
6748
6755
|
loadingBySid: v,
|
|
6749
6756
|
addOptimisticMessage: me,
|
|
6750
6757
|
removeOptimisticMessage: be,
|
|
6751
|
-
trackSendStatus:
|
|
6758
|
+
trackSendStatus: Fe,
|
|
6752
6759
|
loadOlderMessages: W,
|
|
6753
|
-
connection:
|
|
6760
|
+
connection: ze,
|
|
6754
6761
|
reconnectNow: ee,
|
|
6755
6762
|
watchAgentRun: Ne,
|
|
6756
6763
|
subscribeTranscript: re
|
|
@@ -6959,7 +6966,7 @@ function sk(e, t, n = {}) {
|
|
|
6959
6966
|
return i;
|
|
6960
6967
|
}
|
|
6961
6968
|
function ok(e, t) {
|
|
6962
|
-
if (!t.id) return e;
|
|
6969
|
+
if (!t.id || t.kind === "thinking") return e;
|
|
6963
6970
|
const n = e.findIndex(
|
|
6964
6971
|
(o) => o.role === "assistant" && o.parts.some((i) => i.type === "text" && o.id === t.id)
|
|
6965
6972
|
);
|
|
@@ -7104,7 +7111,7 @@ class uk {
|
|
|
7104
7111
|
this.closed || (this.enqueue({ type: "abort", reason: t }), this.close());
|
|
7105
7112
|
}
|
|
7106
7113
|
handlePart(t) {
|
|
7107
|
-
if (!t.id) return;
|
|
7114
|
+
if (!t.id || t.kind === "thinking") return;
|
|
7108
7115
|
if (t.type === "text-end") {
|
|
7109
7116
|
this.endText(t.id), this.finishSoon();
|
|
7110
7117
|
return;
|
|
@@ -7750,7 +7757,7 @@ function Jk({
|
|
|
7750
7757
|
}
|
|
7751
7758
|
const Tl = {
|
|
7752
7759
|
damping: 0.7,
|
|
7753
|
-
stiffness: 0.
|
|
7760
|
+
stiffness: 0.06,
|
|
7754
7761
|
mass: 1.25
|
|
7755
7762
|
}, Qk = 1e3 / 60;
|
|
7756
7763
|
function uf() {
|
|
@@ -13430,7 +13437,7 @@ const RE = lr(function({
|
|
|
13430
13437
|
] }) : null;
|
|
13431
13438
|
}), LE = Fr(
|
|
13432
13439
|
"session-files-panel",
|
|
13433
|
-
() => import("./SessionFilesPanel-
|
|
13440
|
+
() => import("./SessionFilesPanel-DaGWvWCT.js")
|
|
13434
13441
|
);
|
|
13435
13442
|
function Nd({ className: e, ...t }) {
|
|
13436
13443
|
return /* @__PURE__ */ s(
|
|
@@ -14146,7 +14153,7 @@ async function uI() {
|
|
|
14146
14153
|
}
|
|
14147
14154
|
}
|
|
14148
14155
|
const rM = ga(
|
|
14149
|
-
() => import("./streamdown-response-
|
|
14156
|
+
() => import("./streamdown-response-C271qGoB.js").then((e) => ({ default: e.StreamdownResponse }))
|
|
14150
14157
|
);
|
|
14151
14158
|
function Cs({ className: e, from: t, ...n }) {
|
|
14152
14159
|
return /* @__PURE__ */ s(
|
|
@@ -16426,26 +16433,26 @@ function bA({ className: e, isStreaming: t, children: n, ...r }) {
|
|
|
16426
16433
|
function yA({ className: e, children: t, ...n }) {
|
|
16427
16434
|
return /* @__PURE__ */ s(Da, { className: $("mt-2 text-sm", e), ...n, children: /* @__PURE__ */ s(Go, { className: "ai-live-text max-w-full opacity-90", children: t }) });
|
|
16428
16435
|
}
|
|
16429
|
-
const vA = ga(() => import("./chat-engine-
|
|
16436
|
+
const vA = ga(() => import("./chat-engine-CLT7DRwn.js"));
|
|
16430
16437
|
function wA() {
|
|
16431
|
-
const e = () => void import("./chat-engine-
|
|
16438
|
+
const e = () => void import("./chat-engine-CLT7DRwn.js"), t = globalThis.requestIdleCallback;
|
|
16432
16439
|
typeof t == "function" ? t(e, { timeout: 3e3 }) : setTimeout(e, 1500);
|
|
16433
16440
|
}
|
|
16434
16441
|
const Mg = Fr(
|
|
16435
16442
|
"TermView",
|
|
16436
|
-
() => import("./TermView-
|
|
16437
|
-
), um = Fr("ShippedPage", () => import("./shipped-page-
|
|
16443
|
+
() => import("./TermView-iuJBJjm8.js").then((e) => ({ default: e.TermView }))
|
|
16444
|
+
), um = Fr("ShippedPage", () => import("./shipped-page-w9zP7mE6.js")), NA = Fr(
|
|
16438
16445
|
"SessionTokenUsageDialog",
|
|
16439
|
-
() => import("./session-token-usage-
|
|
16446
|
+
() => import("./session-token-usage-D5OcrL42.js")
|
|
16440
16447
|
), kA = Fr(
|
|
16441
16448
|
"CodingAgentsPage",
|
|
16442
|
-
() => import("./coding-agents-page-
|
|
16443
|
-
), SA = Fr("ComputerPage", () => import("./computer-page-
|
|
16449
|
+
() => import("./coding-agents-page-BFtFTtgt.js")
|
|
16450
|
+
), SA = Fr("ComputerPage", () => import("./computer-page-YeB-dujC.js")), fm = Fr(
|
|
16444
16451
|
"ResumeSessionSheet",
|
|
16445
|
-
() => import("./resume-session-sheet-
|
|
16452
|
+
() => import("./resume-session-sheet-BgiPF1kI.js")
|
|
16446
16453
|
), CA = Fr(
|
|
16447
16454
|
"ChangelogPage",
|
|
16448
|
-
() => import("./ChangelogPage-
|
|
16455
|
+
() => import("./ChangelogPage-BgROJRnJ.js")
|
|
16449
16456
|
), Yo = Jt("configured"), EA = {
|
|
16450
16457
|
claude: "Claude",
|
|
16451
16458
|
codex: "Codex",
|
|
@@ -17423,7 +17430,7 @@ function $d(e) {
|
|
|
17423
17430
|
return "";
|
|
17424
17431
|
}
|
|
17425
17432
|
function zo(e) {
|
|
17426
|
-
return e.role === "assistant" && e.kind === "text" && typeof e.id == "string" && e.id.startsWith("draft-");
|
|
17433
|
+
return e.role === "assistant" && (e.kind === "text" || e.kind === "thinking") && typeof e.id == "string" && e.id.startsWith("draft-");
|
|
17427
17434
|
}
|
|
17428
17435
|
function Eo(e) {
|
|
17429
17436
|
const t = [];
|
|
@@ -17688,13 +17695,13 @@ function x4(e) {
|
|
|
17688
17695
|
}
|
|
17689
17696
|
if (oe === Ei || oe === xo) {
|
|
17690
17697
|
const Ce = oe === Ei;
|
|
17691
|
-
ie.then((
|
|
17692
|
-
const
|
|
17693
|
-
if (Ce ||
|
|
17694
|
-
|
|
17698
|
+
ie.then((ze) => {
|
|
17699
|
+
const Be = p.current !== H;
|
|
17700
|
+
if (Ce || Be || v.current || c.current) {
|
|
17701
|
+
ze.getTracks().forEach((Te) => Te.stop());
|
|
17695
17702
|
return;
|
|
17696
17703
|
}
|
|
17697
|
-
v.current =
|
|
17704
|
+
v.current = ze, w();
|
|
17698
17705
|
}).catch(() => {
|
|
17699
17706
|
}), Y(
|
|
17700
17707
|
oe === xo ? "Microphone didn't respond — check for a blocked permission prompt" : void 0
|
|
@@ -17733,32 +17740,32 @@ function x4(e) {
|
|
|
17733
17740
|
} catch {
|
|
17734
17741
|
ue = new ie();
|
|
17735
17742
|
}
|
|
17736
|
-
const oe = ue.createMediaStreamSource(se), Ce = ue.createScriptProcessor(4096, 1, 1),
|
|
17737
|
-
let
|
|
17743
|
+
const oe = ue.createMediaStreamSource(se), Ce = ue.createScriptProcessor(4096, 1, 1), ze = [], Be = location.protocol === "https:" ? "wss:" : "ws:";
|
|
17744
|
+
let Te = null;
|
|
17738
17745
|
const Ze = d.current;
|
|
17739
17746
|
try {
|
|
17740
17747
|
if (Ze) {
|
|
17741
17748
|
const ee = await Ze.getToken();
|
|
17742
|
-
ee && (
|
|
17749
|
+
ee && (Te = new WebSocket(Ze.url, [`vibes-bearer.${ee}`]));
|
|
17743
17750
|
}
|
|
17744
|
-
|
|
17751
|
+
Te || (Te = new WebSocket(`${Be}//${location.host}/api/voice/stt-stream`)), Te.binaryType = "arraybuffer";
|
|
17745
17752
|
} catch {
|
|
17746
|
-
|
|
17753
|
+
Te = null;
|
|
17747
17754
|
}
|
|
17748
|
-
|
|
17755
|
+
Te && (Te.onopen = () => {
|
|
17749
17756
|
const ee = c.current;
|
|
17750
|
-
if (!(!ee || ee.ws !==
|
|
17757
|
+
if (!(!ee || ee.ws !== Te)) {
|
|
17751
17758
|
for (const me of ee.pending)
|
|
17752
17759
|
try {
|
|
17753
|
-
|
|
17760
|
+
Te.send(me);
|
|
17754
17761
|
} catch {
|
|
17755
17762
|
ee.broken = !0;
|
|
17756
17763
|
}
|
|
17757
17764
|
ee.pending = [];
|
|
17758
17765
|
}
|
|
17759
|
-
},
|
|
17766
|
+
}, Te.onmessage = (ee) => {
|
|
17760
17767
|
const me = c.current;
|
|
17761
|
-
if (!me || me.ws !==
|
|
17768
|
+
if (!me || me.ws !== Te) return;
|
|
17762
17769
|
let be;
|
|
17763
17770
|
try {
|
|
17764
17771
|
be = JSON.parse(typeof ee.data == "string" ? ee.data : "");
|
|
@@ -17769,18 +17776,18 @@ function x4(e) {
|
|
|
17769
17776
|
me.partial = (be.text || "").trim();
|
|
17770
17777
|
else if (be.type === "final") {
|
|
17771
17778
|
me.committed = ql(me.committed, be.text || ""), me.partial = "";
|
|
17772
|
-
const
|
|
17779
|
+
const _e = me.finalWaiters;
|
|
17773
17780
|
me.finalWaiters = [];
|
|
17774
|
-
for (const
|
|
17781
|
+
for (const Fe of _e) Fe();
|
|
17775
17782
|
} else
|
|
17776
17783
|
return;
|
|
17777
17784
|
T.current?.(ql(me.committed, me.partial), B.current);
|
|
17778
|
-
},
|
|
17785
|
+
}, Te.onerror = () => {
|
|
17779
17786
|
const ee = c.current;
|
|
17780
|
-
ee && ee.ws ===
|
|
17781
|
-
},
|
|
17787
|
+
ee && ee.ws === Te && (ee.broken = !0);
|
|
17788
|
+
}, Te.onclose = () => {
|
|
17782
17789
|
const ee = c.current;
|
|
17783
|
-
if (!ee || ee.ws !==
|
|
17790
|
+
if (!ee || ee.ws !== Te) return;
|
|
17784
17791
|
!ee.committed && !ee.partial && (ee.broken = !0);
|
|
17785
17792
|
const me = ee.finalWaiters;
|
|
17786
17793
|
ee.finalWaiters = [];
|
|
@@ -17789,23 +17796,23 @@ function x4(e) {
|
|
|
17789
17796
|
let Ue = !1, Ye = Date.now();
|
|
17790
17797
|
Ce.onaudioprocess = (ee) => {
|
|
17791
17798
|
const me = ee.inputBuffer.getChannelData(0);
|
|
17792
|
-
|
|
17799
|
+
ze.push(new Float32Array(me));
|
|
17793
17800
|
let be = 0;
|
|
17794
17801
|
for (let W = 0; W < me.length; W++) be += me[W] * me[W];
|
|
17795
|
-
const
|
|
17796
|
-
i.current =
|
|
17797
|
-
const
|
|
17798
|
-
if (
|
|
17799
|
-
const W = l4(me,
|
|
17800
|
-
if (
|
|
17802
|
+
const _e = Math.sqrt(be / me.length);
|
|
17803
|
+
i.current = _e;
|
|
17804
|
+
const Fe = c.current;
|
|
17805
|
+
if (Fe && Fe.ws && !Fe.broken) {
|
|
17806
|
+
const W = l4(me, Fe.rate);
|
|
17807
|
+
if (Fe.ws.readyState === WebSocket.OPEN)
|
|
17801
17808
|
try {
|
|
17802
|
-
|
|
17809
|
+
Fe.ws.send(W);
|
|
17803
17810
|
} catch {
|
|
17804
|
-
|
|
17811
|
+
Fe.broken = !0;
|
|
17805
17812
|
}
|
|
17806
|
-
else
|
|
17813
|
+
else Fe.ws.readyState === WebSocket.CONNECTING && Fe.pending.push(W);
|
|
17807
17814
|
}
|
|
17808
|
-
k.current &&
|
|
17815
|
+
k.current && _e > c4 && (Ue = !0, Ye = Date.now());
|
|
17809
17816
|
};
|
|
17810
17817
|
const Qe = X && k.current ? setInterval(() => {
|
|
17811
17818
|
!c.current || !Ue || Date.now() - Ye >= q && M(!0);
|
|
@@ -17815,10 +17822,10 @@ function x4(e) {
|
|
|
17815
17822
|
stream: se,
|
|
17816
17823
|
proc: Ce,
|
|
17817
17824
|
src: oe,
|
|
17818
|
-
chunks:
|
|
17825
|
+
chunks: ze,
|
|
17819
17826
|
rate: ue.sampleRate,
|
|
17820
17827
|
vad: Qe,
|
|
17821
|
-
ws:
|
|
17828
|
+
ws: Te,
|
|
17822
17829
|
pending: [],
|
|
17823
17830
|
committed: "",
|
|
17824
17831
|
partial: "",
|
|
@@ -17826,17 +17833,17 @@ function x4(e) {
|
|
|
17826
17833
|
stopping: !1,
|
|
17827
17834
|
finalWaiters: []
|
|
17828
17835
|
}, oe.connect(Ce), Ce.connect(ue.destination), a.current = 0;
|
|
17829
|
-
const
|
|
17836
|
+
const ge = () => {
|
|
17830
17837
|
if (!c.current) {
|
|
17831
17838
|
l.current = null;
|
|
17832
17839
|
return;
|
|
17833
17840
|
}
|
|
17834
|
-
const ee = Math.min(1, i.current / d4), me = a.current, be = ee > me ? u4 : f4,
|
|
17835
|
-
a.current =
|
|
17841
|
+
const ee = Math.min(1, i.current / d4), me = a.current, be = ee > me ? u4 : f4, _e = me + (ee - me) * be;
|
|
17842
|
+
a.current = _e, o(Math.round(_e * 1e3) / 1e3), l.current = requestAnimationFrame(ge);
|
|
17836
17843
|
};
|
|
17837
|
-
l.current = requestAnimationFrame(
|
|
17838
|
-
const
|
|
17839
|
-
|
|
17844
|
+
l.current = requestAnimationFrame(ge), R(), n("recording"), f.current = !1;
|
|
17845
|
+
const Ie = h.current;
|
|
17846
|
+
Ie && (h.current = null, M(Ie.auto, Ie.discard));
|
|
17840
17847
|
} catch (ie) {
|
|
17841
17848
|
w(), Y(bm(ie));
|
|
17842
17849
|
}
|
|
@@ -18329,22 +18336,22 @@ function _4(e, t) {
|
|
|
18329
18336
|
const Y = !X.has(S);
|
|
18330
18337
|
X.add(S), l((se) => {
|
|
18331
18338
|
const ie = se[S] ?? [], ue = ie.find(
|
|
18332
|
-
(
|
|
18339
|
+
(Te) => zo(Te) && Te.id === C.id
|
|
18333
18340
|
), oe = C.reset ? C.text ?? C.delta ?? "" : `${ue?.text ?? ""}${C.delta ?? ""}`;
|
|
18334
18341
|
if (!oe) return se;
|
|
18335
|
-
const Ce = ue?.catchUp ?? (Y && !!C.reset && oe.length > AA),
|
|
18342
|
+
const Ce = C.kind ?? "text", ze = ue?.catchUp ?? (Y && !!C.reset && oe.length > AA), Be = {
|
|
18336
18343
|
id: C.id,
|
|
18337
18344
|
role: "assistant",
|
|
18338
|
-
kind:
|
|
18345
|
+
kind: Ce,
|
|
18339
18346
|
text: oe,
|
|
18340
18347
|
ts: C.ts ?? Date.now(),
|
|
18341
|
-
catchUp:
|
|
18348
|
+
catchUp: ze
|
|
18342
18349
|
};
|
|
18343
18350
|
return {
|
|
18344
18351
|
...se,
|
|
18345
18352
|
[S]: vr([
|
|
18346
|
-
...ie.filter((
|
|
18347
|
-
|
|
18353
|
+
...ie.filter((Te) => Te.kind !== "thinking" && Te.id !== C.id),
|
|
18354
|
+
Be
|
|
18348
18355
|
])
|
|
18349
18356
|
};
|
|
18350
18357
|
});
|
|
@@ -18718,13 +18725,13 @@ function z4() {
|
|
|
18718
18725
|
b.removeEventListener("scroll", Ve), window.removeEventListener("resize", Ve), Je.disconnect(), mt.disconnect(), ce && cancelAnimationFrame(ce), F.style.removeProperty("--lfg-mobile-header-fade-opacity"), Z.style.removeProperty("--lfg-mobile-composer-fade-opacity");
|
|
18719
18726
|
};
|
|
18720
18727
|
}, [B, j]);
|
|
18721
|
-
const [L, G] = N(!1), [J, D] = N([]), [X, H] = N(null), [_, z] = N(null), [I, S] = N(null), [C, R] = N(null), [Y, se] = N(null), [ie, ue] = N(!1), oe = U(!1), [Ce,
|
|
18728
|
+
const [L, G] = N(!1), [J, D] = N([]), [X, H] = N(null), [_, z] = N(null), [I, S] = N(null), [C, R] = N(null), [Y, se] = N(null), [ie, ue] = N(!1), oe = U(!1), [Ce, ze] = N(), [Be, Te] = N(
|
|
18722
18729
|
() => Es()
|
|
18723
|
-
), [Ze, Ue] = N([]), [Ye, Qe] = N([]),
|
|
18730
|
+
), [Ze, Ue] = N([]), [Ye, Qe] = N([]), ge = U(
|
|
18724
18731
|
/* @__PURE__ */ new Map()
|
|
18725
|
-
),
|
|
18726
|
-
|
|
18727
|
-
const [
|
|
18732
|
+
), Ie = U(0), ee = U(/* @__PURE__ */ new Map()), me = U(0), be = U(0), _e = U(/* @__PURE__ */ new Map()), [Fe, W] = N([]), [Ne, re] = N(null), [ye, V] = N(null), [ne, pe] = N(!1), [xe, Oe] = N(null), Le = U(xe);
|
|
18733
|
+
Le.current = xe;
|
|
18734
|
+
const [Re, Xe] = N([]), [$e, we] = N(!0), [he, Me] = N(null), [tt, Ot] = N(!1), [At, Tt] = N(!1), [Ke, pt] = N(null), [ht, Et] = N(0), [Ht, xt] = N(!1), at = hx(), It = xu({ select: (b) => b.location.pathname }), Nt = xu({ select: (b) => b.location.search }), fe = wx(It), on = fe === "bots" ? It.split("/").filter(Boolean) : [], Rt = on[1] ?? null, an = Rt === "new" ? "new" : on[2] === "edit" ? Rt : null, qt = Rt && Rt !== "new" ? Rt : null, Yn = Nx(It), Mn = te(
|
|
18728
18735
|
(b) => ({
|
|
18729
18736
|
...b.embed ? { embed: b.embed } : {},
|
|
18730
18737
|
...b.embedOrigin ? { embedOrigin: b.embedOrigin } : {}
|
|
@@ -18793,7 +18800,7 @@ function z4() {
|
|
|
18793
18800
|
K(() => {
|
|
18794
18801
|
fe === "live" && Dr(!0), fe === "notifications" && ms(!0), fe === "artifacts" && Br(!0);
|
|
18795
18802
|
}, [fe]), K(() => {
|
|
18796
|
-
if (
|
|
18803
|
+
if ($e) return;
|
|
18797
18804
|
const b = globalThis.requestIdleCallback, F = () => {
|
|
18798
18805
|
Li(Ji) || Ta(), Li(sf) || ve(
|
|
18799
18806
|
`/api/artifacts?limit=${bN}&kind=html`,
|
|
@@ -18816,7 +18823,7 @@ function z4() {
|
|
|
18816
18823
|
}
|
|
18817
18824
|
const Z = window.setTimeout(F, 800);
|
|
18818
18825
|
return () => window.clearTimeout(Z);
|
|
18819
|
-
}, [
|
|
18826
|
+
}, [$e]);
|
|
18820
18827
|
const [Vt, Q] = N([]), [ae, P] = N([]), [qe, Ge] = N(null), [et, kt] = N([]), lt = je(
|
|
18821
18828
|
() => new Map(ae.map((b) => [b.id, b])),
|
|
18822
18829
|
[ae]
|
|
@@ -18839,12 +18846,12 @@ function z4() {
|
|
|
18839
18846
|
return b || localStorage.getItem("lfg_user") || "__all";
|
|
18840
18847
|
}), [_t, ur] = N(iv), Jd = U(!1), [Zn, Qd] = N(
|
|
18841
18848
|
() => localStorage.getItem("lfg_user")
|
|
18842
|
-
), Pr = Zn ?? (ft !== "__all" && ft !== "__unassigned" ? ft :
|
|
18849
|
+
), Pr = Zn ?? (ft !== "__all" && ft !== "__unassigned" ? ft : Fe.length === 1 ? Fe[0].email : ""), [C0, E0] = N(!0);
|
|
18843
18850
|
K(() => {
|
|
18844
|
-
if (
|
|
18851
|
+
if ($e) return;
|
|
18845
18852
|
const b = window.setTimeout(() => E0(!1), 2e3);
|
|
18846
18853
|
return () => window.clearTimeout(b);
|
|
18847
|
-
}, [
|
|
18854
|
+
}, [$e]), K(() => {
|
|
18848
18855
|
const b = window.visualViewport, F = () => {
|
|
18849
18856
|
const vt = r.current;
|
|
18850
18857
|
vt && (vt.style.height = "", vt.style.transform = ""), document.documentElement.style.removeProperty("--lfg-app-height"), document.documentElement.classList.remove("lfg-keyboard-open"), document.documentElement.style.removeProperty("--lfg-keyboard-height"), document.documentElement.style.removeProperty("--lfg-visual-offset-top"), document.documentElement.style.removeProperty("--lfg-visual-height"), G(!1);
|
|
@@ -18896,7 +18903,7 @@ function z4() {
|
|
|
18896
18903
|
for (const vt of Je) window.clearTimeout(vt);
|
|
18897
18904
|
Je.clear(), b.removeEventListener("resize", yt), b.removeEventListener("scroll", yt), window.removeEventListener("pageshow", Qt), window.removeEventListener("focus", Qt), window.removeEventListener("resize", Qt), window.removeEventListener("orientationchange", Qt), window.removeEventListener("pointerdown", yt, { capture: !0 }), document.removeEventListener("visibilitychange", Ct), F();
|
|
18898
18905
|
};
|
|
18899
|
-
}, [w, B,
|
|
18906
|
+
}, [w, B, $e, fe, de]);
|
|
18900
18907
|
const er = te(async () => {
|
|
18901
18908
|
const b = await ve(
|
|
18902
18909
|
`/api/bots?user=${encodeURIComponent(Pr)}`,
|
|
@@ -18911,11 +18918,11 @@ function z4() {
|
|
|
18911
18918
|
{ cache: "no-store" }
|
|
18912
18919
|
)
|
|
18913
18920
|
]);
|
|
18914
|
-
|
|
18921
|
+
Oe({
|
|
18915
18922
|
version: typeof b.version == "string" ? b.version : null,
|
|
18916
18923
|
generation: gh(),
|
|
18917
18924
|
bootId: typeof b.bootId == "string" ? b.bootId : null
|
|
18918
|
-
}), V(b.onboarding ?? null), !x && b.onboarding && !b.onboarding.completedAt && !b.users?.length && !b.sessions?.length &&
|
|
18925
|
+
}), V(b.onboarding ?? null), !x && b.onboarding && !b.onboarding.completedAt && !b.users?.length && !b.sessions?.length && pe(!0), Mt(!!b.computer), D(b.codingAgents ?? []), Te(Es(b.models)), $t(b.settings ?? {
|
|
18919
18926
|
timeZone: b.auto?.tz ?? Yr,
|
|
18920
18927
|
maxLiveAgents: 16,
|
|
18921
18928
|
maxBotSchedules: 5,
|
|
@@ -18993,14 +19000,14 @@ function z4() {
|
|
|
18993
19000
|
);
|
|
18994
19001
|
}
|
|
18995
19002
|
}, [tu, ti]), xn = te(async (b) => {
|
|
18996
|
-
const F =
|
|
19003
|
+
const F = _e.current, Z = b?.seed;
|
|
18997
19004
|
Z?.sessionId && (F.set(Z.sessionId, { session: Z, at: Date.now() }), Qe(
|
|
18998
19005
|
(Ct) => Ct.some((vt) => vt.sessionId === Z.sessionId) ? Ct : [...Ct, Z]
|
|
18999
19006
|
));
|
|
19000
19007
|
const ce = ++me.current, Ve = await ve("/api/sessions");
|
|
19001
19008
|
if (ce < be.current) return;
|
|
19002
19009
|
be.current = ce;
|
|
19003
|
-
const Je =
|
|
19010
|
+
const Je = ge.current, mt = (Ve.sessions ?? []).map((Ct) => {
|
|
19004
19011
|
const vt = Ct.sessionId, Kt = vt ? Je.get(vt) : void 0;
|
|
19005
19012
|
return !vt || !Kt ? Ct : Kt.persistedAfterFetch !== null && ce > Kt.persistedAfterFetch && (Kt.confirmedAt ??= Date.now(), Date.now() - Kt.confirmedAt >= 1e4) ? (Je.delete(vt), Ct) : { ...Ct, title: Kt.title };
|
|
19006
19013
|
}), yt = new Set(mt.map((Ct) => Ct.sessionId)), Qt = Date.now();
|
|
@@ -19018,8 +19025,8 @@ function z4() {
|
|
|
19018
19025
|
});
|
|
19019
19026
|
}, []), A0 = te(
|
|
19020
19027
|
async (b, F) => {
|
|
19021
|
-
const Z = F.trim().slice(0, 200), ce = ++
|
|
19022
|
-
|
|
19028
|
+
const Z = F.trim().slice(0, 200), ce = ++Ie.current;
|
|
19029
|
+
ge.current.set(b, {
|
|
19023
19030
|
revision: ce,
|
|
19024
19031
|
title: Z,
|
|
19025
19032
|
persistedAfterFetch: null,
|
|
@@ -19032,15 +19039,15 @@ function z4() {
|
|
|
19032
19039
|
const Je = (ee.current.get(b) ?? Promise.resolve()).catch(() => {
|
|
19033
19040
|
}).then(async () => {
|
|
19034
19041
|
await XA(b, Z);
|
|
19035
|
-
const mt =
|
|
19042
|
+
const mt = ge.current.get(b);
|
|
19036
19043
|
mt?.revision === ce && (mt.persistedAfterFetch = me.current, await xn());
|
|
19037
19044
|
});
|
|
19038
19045
|
ee.current.set(b, Je);
|
|
19039
19046
|
try {
|
|
19040
19047
|
await Je;
|
|
19041
19048
|
} catch (mt) {
|
|
19042
|
-
if (
|
|
19043
|
-
throw
|
|
19049
|
+
if (ge.current.get(b)?.revision !== ce) return;
|
|
19050
|
+
throw ge.current.delete(b), await xn().catch(() => {
|
|
19044
19051
|
}), mt;
|
|
19045
19052
|
} finally {
|
|
19046
19053
|
ee.current.get(b) === Je && ee.current.delete(b);
|
|
@@ -19058,7 +19065,7 @@ function z4() {
|
|
|
19058
19065
|
b = !0;
|
|
19059
19066
|
};
|
|
19060
19067
|
}, [fr]), K(() => {
|
|
19061
|
-
if (
|
|
19068
|
+
if ($e || fe !== "coding-agents") return;
|
|
19062
19069
|
let b = !1, F = null;
|
|
19063
19070
|
const Z = requestAnimationFrame(() => {
|
|
19064
19071
|
F = window.setTimeout(() => {
|
|
@@ -19072,7 +19079,7 @@ function z4() {
|
|
|
19072
19079
|
return () => {
|
|
19073
19080
|
b = !0, cancelAnimationFrame(Z), F !== null && window.clearTimeout(F);
|
|
19074
19081
|
};
|
|
19075
|
-
}, [
|
|
19082
|
+
}, [$e, fe]), K(() => {
|
|
19076
19083
|
let b = null;
|
|
19077
19084
|
const F = () => {
|
|
19078
19085
|
xn().catch(() => {
|
|
@@ -19104,18 +19111,18 @@ function z4() {
|
|
|
19104
19111
|
ft !== "__all" && gs("__all");
|
|
19105
19112
|
return;
|
|
19106
19113
|
}
|
|
19107
|
-
if (Jd.current || !
|
|
19108
|
-
const b =
|
|
19114
|
+
if (Jd.current || !Fe.length || (Jd.current = !0, x || y.current || O)) return;
|
|
19115
|
+
const b = Fe.some((ce) => ce.email === ft);
|
|
19109
19116
|
if (ft === "__unassigned" || b) return;
|
|
19110
|
-
const F = localStorage.getItem("lfg_user"), Z = F &&
|
|
19117
|
+
const F = localStorage.getItem("lfg_user"), Z = F && Fe.some((ce) => ce.email === F) ? F : Fe[0]?.email;
|
|
19111
19118
|
Z && gs(Z);
|
|
19112
|
-
}, [
|
|
19113
|
-
if (!
|
|
19119
|
+
}, [Fe, ft, x, O]), K(() => {
|
|
19120
|
+
if (!Fe.length) {
|
|
19114
19121
|
ft !== "__all" && ft !== "__unassigned" && gs("__all");
|
|
19115
19122
|
return;
|
|
19116
19123
|
}
|
|
19117
|
-
ft === "__all" || ft === "__unassigned" ||
|
|
19118
|
-
}, [ft,
|
|
19124
|
+
ft === "__all" || ft === "__unassigned" || Fe.some((F) => F.email === ft) || gs(Fe[0]?.email ?? "__all");
|
|
19125
|
+
}, [ft, Fe]), K(() => {
|
|
19119
19126
|
x || Bl() || localStorage.setItem("lfg_v2_user_filter", ft);
|
|
19120
19127
|
}, [ft, x]), K(() => {
|
|
19121
19128
|
av(_t);
|
|
@@ -19138,24 +19145,24 @@ function z4() {
|
|
|
19138
19145
|
), mr = je(
|
|
19139
19146
|
() => Array.from(
|
|
19140
19147
|
/* @__PURE__ */ new Set([
|
|
19141
|
-
...
|
|
19142
|
-
...Vt.map((b) => Hl(b,
|
|
19148
|
+
...Re.map((b) => sr(b)),
|
|
19149
|
+
...Vt.map((b) => Hl(b, Re)),
|
|
19143
19150
|
...to.map((b) => b.project).filter((b) => !!b)
|
|
19144
19151
|
])
|
|
19145
19152
|
).sort((b, F) => Nr(b).localeCompare(Nr(F))),
|
|
19146
|
-
[Vt,
|
|
19153
|
+
[Vt, Re, to]
|
|
19147
19154
|
), Ya = je(
|
|
19148
19155
|
() => mr,
|
|
19149
19156
|
[mr]
|
|
19150
19157
|
);
|
|
19151
19158
|
K(() => {
|
|
19152
|
-
|
|
19153
|
-
}, [B,
|
|
19154
|
-
const xs = je(() => _t === "__all" ? to : to.filter((b) => b.project === _t), [to, _t]), ni = !x && !Zn &&
|
|
19159
|
+
$e || _t !== "__all" && !mr.includes(_t) && ur("__all");
|
|
19160
|
+
}, [B, $e, _t, mr]);
|
|
19161
|
+
const xs = je(() => _t === "__all" ? to : to.filter((b) => b.project === _t), [to, _t]), ni = !x && !Zn && Fe.length > 0;
|
|
19155
19162
|
K(() => {
|
|
19156
19163
|
O && (Dr(!0), fe !== "live" && Se("live"));
|
|
19157
19164
|
}, [O, fe, Se]);
|
|
19158
|
-
const Ja = je(() => _t === "__all" ? Vt : Vt.filter((b) => Hl(b,
|
|
19165
|
+
const Ja = je(() => _t === "__all" ? Vt : Vt.filter((b) => Hl(b, Re) === _t), [Vt, _t, Re]), nu = je(() => {
|
|
19159
19166
|
if (_t === "__all") return Xa;
|
|
19160
19167
|
const b = new Set(Ja.map((F) => F.id));
|
|
19161
19168
|
return Xa.filter((F) => b.has(F.agentId));
|
|
@@ -19188,13 +19195,13 @@ function z4() {
|
|
|
19188
19195
|
);
|
|
19189
19196
|
K(() => {
|
|
19190
19197
|
const b = y.current;
|
|
19191
|
-
if (!b ||
|
|
19198
|
+
if (!b || $e || ni) return;
|
|
19192
19199
|
const F = zn.find(
|
|
19193
19200
|
(Z) => Z.sessionId === b || Z.nativeSessionId === b
|
|
19194
19201
|
);
|
|
19195
19202
|
F && (y.current = null, _u(F, ft) || gs("__all"), _t !== "__all" && F.project !== _t && ur("__all"), Se("live"), h({ sid: F.sessionId ?? b, n: Date.now() }));
|
|
19196
|
-
}, [zn,
|
|
19197
|
-
if (!y.current ||
|
|
19203
|
+
}, [zn, $e, ft, _t, ni, Se]), K(() => {
|
|
19204
|
+
if (!y.current || $e || ni) return;
|
|
19198
19205
|
const b = window.setTimeout(() => {
|
|
19199
19206
|
const F = y.current;
|
|
19200
19207
|
if (!F) return;
|
|
@@ -19214,7 +19221,7 @@ function z4() {
|
|
|
19214
19221
|
});
|
|
19215
19222
|
}, 1e4);
|
|
19216
19223
|
return () => window.clearTimeout(b);
|
|
19217
|
-
}, [
|
|
19224
|
+
}, [$e, ni, Ur]);
|
|
19218
19225
|
const T0 = te(
|
|
19219
19226
|
(b) => Ur({
|
|
19220
19227
|
sessionId: b.sessionId,
|
|
@@ -19256,7 +19263,7 @@ function z4() {
|
|
|
19256
19263
|
const Ve = Z.map((Je) => {
|
|
19257
19264
|
const mt = Je.sessionId, yt = mt ? F.get(mt) : void 0;
|
|
19258
19265
|
if (!yt) return Je;
|
|
19259
|
-
const Ct = (mt ?
|
|
19266
|
+
const Ct = (mt ? ge.current.get(mt) : void 0)?.title, vt = {
|
|
19260
19267
|
...Je,
|
|
19261
19268
|
...yt,
|
|
19262
19269
|
...Ct !== void 0 ? { title: Ct } : {}
|
|
@@ -19312,7 +19319,7 @@ function z4() {
|
|
|
19312
19319
|
let F = !1;
|
|
19313
19320
|
return ve("/api/install?ready=1", { cache: "no-store" }).then((Z) => {
|
|
19314
19321
|
if (F) return;
|
|
19315
|
-
const ce =
|
|
19322
|
+
const ce = Le.current?.bootId ?? null, Ve = typeof Z.bootId == "string" ? Z.bootId : null;
|
|
19316
19323
|
!ce || !Ve || ce === Ve || fr().catch(() => {
|
|
19317
19324
|
});
|
|
19318
19325
|
}).catch(() => {
|
|
@@ -19383,9 +19390,9 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19383
19390
|
|
|
19384
19391
|
` : "") + (b.suggest ? `Suggested fix: ${b.suggest}
|
|
19385
19392
|
|
|
19386
|
-
` : "") + `Now do this: ${F}`, Ve = b.title.trim().slice(0, 200), Je = Vt.find((Gt) => Gt.id === b.agentId), mt = Z.agent ?? Je?.agent ?? "aisdk", yt = Z.thinkingLevel ?? Je?.thinkingLevel, Ct = Je?.cwd || localStorage.getItem("lfg_v2_repo") ||
|
|
19393
|
+
` : "") + `Now do this: ${F}`, Ve = b.title.trim().slice(0, 200), Je = Vt.find((Gt) => Gt.id === b.agentId), mt = Z.agent ?? Je?.agent ?? "aisdk", yt = Z.thinkingLevel ?? Je?.thinkingLevel, Ct = Je?.cwd || localStorage.getItem("lfg_v2_repo") || Re[0]?.cwd || "", vt = Xr(
|
|
19387
19394
|
ft !== "__all" && ft !== "__unassigned" ? ft : localStorage.getItem("lfg_user"),
|
|
19388
|
-
|
|
19395
|
+
Fe
|
|
19389
19396
|
);
|
|
19390
19397
|
Ln(null);
|
|
19391
19398
|
const Kt = async (Gt) => {
|
|
@@ -19493,7 +19500,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19493
19500
|
try {
|
|
19494
19501
|
const F = b.id ? `/api/bots/${encodeURIComponent(b.id)}` : "/api/bots", { id: Z, ...ce } = b, Ve = Xr(
|
|
19495
19502
|
ft !== "__all" && ft !== "__unassigned" ? ft : localStorage.getItem("lfg_user"),
|
|
19496
|
-
|
|
19503
|
+
Fe
|
|
19497
19504
|
), Je = await ve(F, {
|
|
19498
19505
|
method: Z ? "PATCH" : "POST",
|
|
19499
19506
|
headers: { "Content-Type": "application/json" },
|
|
@@ -19561,19 +19568,19 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19561
19568
|
const yt = Vt.find((Qt) => Qt.id === mt.agentId);
|
|
19562
19569
|
return {
|
|
19563
19570
|
cwd: yt?.cwd,
|
|
19564
|
-
project: yt ? Hl(yt,
|
|
19571
|
+
project: yt ? Hl(yt, Re) : void 0
|
|
19565
19572
|
};
|
|
19566
19573
|
}), Z = Ak({
|
|
19567
19574
|
sources: F,
|
|
19568
19575
|
projectFilter: _t,
|
|
19569
|
-
repos:
|
|
19576
|
+
repos: Re.map((mt) => ({ cwd: mt.cwd, project: sr(mt) })),
|
|
19570
19577
|
fallbackCwd: localStorage.getItem("lfg_v2_repo")
|
|
19571
19578
|
}), ce = Cg(
|
|
19572
19579
|
localStorage.getItem("lfg_v2_agent"),
|
|
19573
19580
|
k
|
|
19574
|
-
), Ve = localStorage.getItem(`lfg_model_${ce}`) || localStorage.getItem("lfg_model") ||
|
|
19581
|
+
), Ve = localStorage.getItem(`lfg_model_${ce}`) || localStorage.getItem("lfg_model") || Be.defaults[ce] || us[ce], Je = ft === "__unassigned" ? "" : Xr(
|
|
19575
19582
|
ft !== "__all" ? ft : localStorage.getItem("lfg_user"),
|
|
19576
|
-
|
|
19583
|
+
Fe
|
|
19577
19584
|
);
|
|
19578
19585
|
try {
|
|
19579
19586
|
const mt = await ve("/api/sessions/new", {
|
|
@@ -19618,7 +19625,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19618
19625
|
completed: !1
|
|
19619
19626
|
})
|
|
19620
19627
|
});
|
|
19621
|
-
V(b.state),
|
|
19628
|
+
V(b.state), pe(!0);
|
|
19622
19629
|
} catch (b) {
|
|
19623
19630
|
ke.error(b instanceof Error ? b.message : "Couldn't restart onboarding");
|
|
19624
19631
|
}
|
|
@@ -19676,11 +19683,11 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19676
19683
|
} catch {
|
|
19677
19684
|
return;
|
|
19678
19685
|
}
|
|
19679
|
-
D(Z.agents ?? []),
|
|
19686
|
+
D(Z.agents ?? []), Te(Es(Z.models)), Ue(ce.checks ?? []);
|
|
19680
19687
|
}, []), ri = te(async () => {
|
|
19681
19688
|
try {
|
|
19682
19689
|
const b = await ve("/api/connections");
|
|
19683
|
-
|
|
19690
|
+
ze(b.connections ?? []);
|
|
19684
19691
|
} catch {
|
|
19685
19692
|
}
|
|
19686
19693
|
}, []);
|
|
@@ -19711,7 +19718,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19711
19718
|
headers: { "Content-Type": "application/json" },
|
|
19712
19719
|
body: JSON.stringify({ visible: F })
|
|
19713
19720
|
});
|
|
19714
|
-
D(ce.agents ?? []),
|
|
19721
|
+
D(ce.agents ?? []), Te(Es(ce.models));
|
|
19715
19722
|
} catch (ce) {
|
|
19716
19723
|
D(Z), ke.error(ce instanceof Error ? ce.message : String(ce));
|
|
19717
19724
|
}
|
|
@@ -19725,7 +19732,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19725
19732
|
ve(`/api/coding-agents/${b}/setup`, {
|
|
19726
19733
|
method: "POST"
|
|
19727
19734
|
}).then((F) => {
|
|
19728
|
-
D(F.agents ?? []),
|
|
19735
|
+
D(F.agents ?? []), Te(Es(F.models)), window.setTimeout(() => void wn(), 3e3);
|
|
19729
19736
|
}),
|
|
19730
19737
|
{
|
|
19731
19738
|
loading: "Starting setup…",
|
|
@@ -19961,22 +19968,22 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19961
19968
|
onboarding: ye,
|
|
19962
19969
|
version: Vc(xe?.version),
|
|
19963
19970
|
codingAgents: J,
|
|
19964
|
-
repos:
|
|
19971
|
+
repos: Re,
|
|
19965
19972
|
identity: Zn,
|
|
19966
19973
|
onProfileCreated: (b, F) => {
|
|
19967
19974
|
F.length && W(F), Qd(b), eo(b);
|
|
19968
19975
|
},
|
|
19969
19976
|
onRefreshAgents: () => void wn(),
|
|
19970
19977
|
onDone: (b) => {
|
|
19971
|
-
|
|
19978
|
+
pe(!1), b && (Bi(b), Se("live")), fr();
|
|
19972
19979
|
}
|
|
19973
19980
|
}
|
|
19974
19981
|
);
|
|
19975
|
-
if (!x && !Zn &&
|
|
19982
|
+
if (!x && !Zn && Fe.length)
|
|
19976
19983
|
return /* @__PURE__ */ s(
|
|
19977
19984
|
H4,
|
|
19978
19985
|
{
|
|
19979
|
-
users:
|
|
19986
|
+
users: Fe,
|
|
19980
19987
|
onPick: (b) => {
|
|
19981
19988
|
Qd(b), localStorage.setItem("lfg_user", b), eo(y.current ? "__all" : b);
|
|
19982
19989
|
}
|
|
@@ -19991,20 +19998,20 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
19991
19998
|
Yo.Provider,
|
|
19992
19999
|
{
|
|
19993
20000
|
value: x ? "connected-or-opencode" : "configured",
|
|
19994
|
-
children: /* @__PURE__ */ s(Ea.Provider, { value: J, children: /* @__PURE__ */ s(Ag.Provider, { value: rx, children: /* @__PURE__ */ s(Og.Provider, { value:
|
|
20001
|
+
children: /* @__PURE__ */ s(Ea.Provider, { value: J, children: /* @__PURE__ */ s(Ag.Provider, { value: rx, children: /* @__PURE__ */ s(Og.Provider, { value: Be, children: /* @__PURE__ */ s(oM, { children: /* @__PURE__ */ s(mM, { settings: dt, onSettingsChange: bs, children: /* @__PURE__ */ s(ja.Provider, { value: q0, children: /* @__PURE__ */ s(Uh.Provider, { value: u, children: /* @__PURE__ */ s(Od.Provider, { value: c, children: /* @__PURE__ */ s(Rg.Provider, { value: Se, children: /* @__PURE__ */ s(Xn.Provider, { value: lt, children: /* @__PURE__ */ s(Tg.Provider, { value: Ne, children: /* @__PURE__ */ s(Ba.Provider, { value: { conversations: et, any: Sv(et), selectedConversationId: le, markRead: (b) => void so(b).catch(() => {
|
|
19995
20002
|
}) }, children: /* @__PURE__ */ s(Pa.Provider, { value: ot, children: /* @__PURE__ */ m(Ig.Provider, { value: jt, children: [
|
|
19996
20003
|
/* @__PURE__ */ m(
|
|
19997
20004
|
"div",
|
|
19998
20005
|
{
|
|
19999
20006
|
ref: r,
|
|
20000
|
-
inert:
|
|
20001
|
-
"aria-busy":
|
|
20002
|
-
"aria-disabled":
|
|
20003
|
-
"aria-describedby":
|
|
20004
|
-
"data-startup-state":
|
|
20007
|
+
inert: $e,
|
|
20008
|
+
"aria-busy": $e,
|
|
20009
|
+
"aria-disabled": $e || void 0,
|
|
20010
|
+
"aria-describedby": $e ? "lfg-startup-status" : void 0,
|
|
20011
|
+
"data-startup-state": $e ? "connecting" : "ready",
|
|
20005
20012
|
className: $(
|
|
20006
20013
|
w ? N4 : w4,
|
|
20007
|
-
|
|
20014
|
+
$e && "[&_button]:cursor-wait [&_button]:opacity-60 [&_input]:cursor-wait [&_input]:opacity-60 [&_select]:cursor-wait [&_select]:opacity-60 [&_textarea]:cursor-wait [&_textarea]:opacity-60",
|
|
20008
20015
|
// Embed: leave a blank band of our own background under the host
|
|
20009
20016
|
// compact pill so list/inline composer sit above it. Full-bleed
|
|
20010
20017
|
// portals (session sheet) use --lfg-safe-bottom on their own chrome.
|
|
@@ -20050,7 +20057,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20050
20057
|
intro: C0,
|
|
20051
20058
|
hosted: x,
|
|
20052
20059
|
viewerName: T?.name,
|
|
20053
|
-
user:
|
|
20060
|
+
user: Fe.find((b) => b.email === Zn),
|
|
20054
20061
|
identity: Zn,
|
|
20055
20062
|
busyCount: xs.filter(
|
|
20056
20063
|
(b) => !!no.busyBySid[b.sessionId ?? ""]
|
|
@@ -20090,7 +20097,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20090
20097
|
Ic,
|
|
20091
20098
|
{
|
|
20092
20099
|
value: ft,
|
|
20093
|
-
users:
|
|
20100
|
+
users: Fe,
|
|
20094
20101
|
onChange: eo
|
|
20095
20102
|
}
|
|
20096
20103
|
),
|
|
@@ -20203,7 +20210,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20203
20210
|
Ic,
|
|
20204
20211
|
{
|
|
20205
20212
|
value: ft,
|
|
20206
|
-
users:
|
|
20213
|
+
users: Fe,
|
|
20207
20214
|
onChange: eo
|
|
20208
20215
|
}
|
|
20209
20216
|
)
|
|
@@ -20272,7 +20279,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20272
20279
|
dl ? "overflow-hidden pb-3" : `overflow-y-auto ${ox}`
|
|
20273
20280
|
]
|
|
20274
20281
|
),
|
|
20275
|
-
children: w &&
|
|
20282
|
+
children: w && $e ? /* @__PURE__ */ s(S4, {}) : /* @__PURE__ */ m(He, { children: [
|
|
20276
20283
|
vn || ii ? /* @__PURE__ */ s(
|
|
20277
20284
|
"div",
|
|
20278
20285
|
{
|
|
@@ -20292,7 +20299,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20292
20299
|
sessions: xs,
|
|
20293
20300
|
shippedReview: p,
|
|
20294
20301
|
liveSessionIds: ru,
|
|
20295
|
-
users:
|
|
20302
|
+
users: Fe,
|
|
20296
20303
|
userFilter: ft,
|
|
20297
20304
|
projectFilter: _t,
|
|
20298
20305
|
projectOptions: mr,
|
|
@@ -20319,7 +20326,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20319
20326
|
showSettings: !x
|
|
20320
20327
|
}
|
|
20321
20328
|
),
|
|
20322
|
-
repos:
|
|
20329
|
+
repos: Re,
|
|
20323
20330
|
onReposChanged: fr,
|
|
20324
20331
|
messagesBySid: no.messagesBySid,
|
|
20325
20332
|
busyBySid: no.busyBySid,
|
|
@@ -20380,7 +20387,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20380
20387
|
kT,
|
|
20381
20388
|
{
|
|
20382
20389
|
bot: hr,
|
|
20383
|
-
repos:
|
|
20390
|
+
repos: Re,
|
|
20384
20391
|
codingAgents: J,
|
|
20385
20392
|
autoAgents: Vt,
|
|
20386
20393
|
maxBotSchedules: dt.maxBotSchedules,
|
|
@@ -20530,8 +20537,8 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20530
20537
|
onExpandedChange: Tt,
|
|
20531
20538
|
focusNonce: ht,
|
|
20532
20539
|
agentRequest: Ke,
|
|
20533
|
-
users:
|
|
20534
|
-
repos:
|
|
20540
|
+
users: Fe,
|
|
20541
|
+
repos: Re,
|
|
20535
20542
|
scopedProject: _t,
|
|
20536
20543
|
projectOptions: Ya,
|
|
20537
20544
|
onProjectChange: ur,
|
|
@@ -20567,7 +20574,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20567
20574
|
hs === "new" ? /* @__PURE__ */ s(
|
|
20568
20575
|
U3,
|
|
20569
20576
|
{
|
|
20570
|
-
repos:
|
|
20577
|
+
repos: Re,
|
|
20571
20578
|
scopedProject: _t,
|
|
20572
20579
|
codingAgents: J,
|
|
20573
20580
|
onClose: () => ps(null),
|
|
@@ -20577,7 +20584,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20577
20584
|
H3,
|
|
20578
20585
|
{
|
|
20579
20586
|
agent: hs,
|
|
20580
|
-
repos:
|
|
20587
|
+
repos: Re,
|
|
20581
20588
|
tz: Xt,
|
|
20582
20589
|
codingAgents: J,
|
|
20583
20590
|
running: !!Vt.find((b) => b.id === hs.id)?.running,
|
|
@@ -20592,8 +20599,8 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20592
20599
|
{
|
|
20593
20600
|
open: tt,
|
|
20594
20601
|
agentRequest: Ke,
|
|
20595
|
-
users:
|
|
20596
|
-
repos:
|
|
20602
|
+
users: Fe,
|
|
20603
|
+
repos: Re,
|
|
20597
20604
|
scopedProject: _t,
|
|
20598
20605
|
onReposChanged: fr,
|
|
20599
20606
|
codingAgents: J,
|
|
@@ -20656,7 +20663,7 @@ ${b.reasoning.map((Gt) => `- ${Gt}`).join(`
|
|
|
20656
20663
|
]
|
|
20657
20664
|
}
|
|
20658
20665
|
),
|
|
20659
|
-
|
|
20666
|
+
$e ? /* @__PURE__ */ s(k4, {}) : null,
|
|
20660
20667
|
l ? /* @__PURE__ */ s(
|
|
20661
20668
|
qA,
|
|
20662
20669
|
{
|
|
@@ -21224,7 +21231,7 @@ function W4({
|
|
|
21224
21231
|
const W = A.current;
|
|
21225
21232
|
W && (W.scrollTop = W.scrollHeight);
|
|
21226
21233
|
}, [x.lines]);
|
|
21227
|
-
const [oe, Ce] = N(""),
|
|
21234
|
+
const [oe, Ce] = N(""), ze = R, Be = oe || (ze.some((W) => W.key === "claude") ? "claude" : ze[0]?.key || "claude"), Te = (W) => ve("/api/onboarding", {
|
|
21228
21235
|
method: "POST",
|
|
21229
21236
|
headers: { "Content-Type": "application/json" },
|
|
21230
21237
|
body: JSON.stringify(W)
|
|
@@ -21252,7 +21259,7 @@ function W4({
|
|
|
21252
21259
|
}
|
|
21253
21260
|
}
|
|
21254
21261
|
function Ue() {
|
|
21255
|
-
|
|
21262
|
+
Te({ steps: { agents: !0 } }), d("repo");
|
|
21256
21263
|
}
|
|
21257
21264
|
async function Ye() {
|
|
21258
21265
|
h(!0), g(null);
|
|
@@ -21270,15 +21277,15 @@ function W4({
|
|
|
21270
21277
|
}
|
|
21271
21278
|
}
|
|
21272
21279
|
function Qe() {
|
|
21273
|
-
|
|
21280
|
+
Te({ steps: { repo: !0 } }), d("session");
|
|
21274
21281
|
}
|
|
21275
|
-
function
|
|
21282
|
+
function ge(W) {
|
|
21276
21283
|
y((Ne) => {
|
|
21277
21284
|
const re = new Set(Ne);
|
|
21278
21285
|
return re.has(W) ? re.delete(W) : re.add(W), re;
|
|
21279
21286
|
});
|
|
21280
21287
|
}
|
|
21281
|
-
function
|
|
21288
|
+
function Ie() {
|
|
21282
21289
|
y(
|
|
21283
21290
|
ie ? /* @__PURE__ */ new Set() : new Set(Y.map((W) => W.key))
|
|
21284
21291
|
);
|
|
@@ -21301,7 +21308,7 @@ function W4({
|
|
|
21301
21308
|
}
|
|
21302
21309
|
}
|
|
21303
21310
|
async function me() {
|
|
21304
|
-
if (!
|
|
21311
|
+
if (!ze.some((W) => W.key === Be)) {
|
|
21305
21312
|
g("Set up and sign in to a coding agent before starting a session.");
|
|
21306
21313
|
return;
|
|
21307
21314
|
}
|
|
@@ -21314,23 +21321,23 @@ function W4({
|
|
|
21314
21321
|
cwd: C || void 0,
|
|
21315
21322
|
prompt: I.trim() || "Give me a quick tour of this repo.",
|
|
21316
21323
|
user: o || void 0,
|
|
21317
|
-
agent:
|
|
21324
|
+
agent: Be
|
|
21318
21325
|
})
|
|
21319
21326
|
});
|
|
21320
|
-
await
|
|
21327
|
+
await Te({ steps: { firstSession: !0 }, completed: !0 }), l(W?.sessionId);
|
|
21321
21328
|
} catch (W) {
|
|
21322
21329
|
g(W instanceof Error ? W.message : "Couldn't start the session"), h(!1);
|
|
21323
21330
|
}
|
|
21324
21331
|
}
|
|
21325
21332
|
function be() {
|
|
21326
|
-
|
|
21333
|
+
Te({ completed: !0 }), l();
|
|
21327
21334
|
}
|
|
21328
|
-
const
|
|
21335
|
+
const _e = [
|
|
21329
21336
|
["profile", "Profile"],
|
|
21330
21337
|
["agents", "Agents"],
|
|
21331
21338
|
["repo", "Repo"],
|
|
21332
21339
|
["session", "Session"]
|
|
21333
|
-
],
|
|
21340
|
+
], Fe = _e.findIndex(([W]) => W === u);
|
|
21334
21341
|
return /* @__PURE__ */ s(
|
|
21335
21342
|
"div",
|
|
21336
21343
|
{
|
|
@@ -21345,9 +21352,9 @@ function W4({
|
|
|
21345
21352
|
t
|
|
21346
21353
|
] }) : null
|
|
21347
21354
|
] }),
|
|
21348
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children:
|
|
21355
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: _e.map(([W, Ne], re) => /* @__PURE__ */ m("span", { className: "flex items-center gap-1.5", children: [
|
|
21349
21356
|
re > 0 && /* @__PURE__ */ s("span", { className: "opacity-40", children: "›" }),
|
|
21350
|
-
/* @__PURE__ */ s("span", { className: re ===
|
|
21357
|
+
/* @__PURE__ */ s("span", { className: re === Fe ? "font-medium text-foreground" : "", children: Ne })
|
|
21351
21358
|
] }, W)) })
|
|
21352
21359
|
] }),
|
|
21353
21360
|
u === "profile" && /* @__PURE__ */ m(He, { children: [
|
|
@@ -21424,7 +21431,7 @@ function W4({
|
|
|
21424
21431
|
type: "checkbox",
|
|
21425
21432
|
checked: ie,
|
|
21426
21433
|
disabled: f || se,
|
|
21427
|
-
onChange:
|
|
21434
|
+
onChange: Ie,
|
|
21428
21435
|
className: "size-4 rounded border-border accent-foreground"
|
|
21429
21436
|
}
|
|
21430
21437
|
),
|
|
@@ -21444,7 +21451,7 @@ function W4({
|
|
|
21444
21451
|
type: "checkbox",
|
|
21445
21452
|
checked: v.has(W.key),
|
|
21446
21453
|
disabled: f || se,
|
|
21447
|
-
onChange: () =>
|
|
21454
|
+
onChange: () => ge(W.key),
|
|
21448
21455
|
className: "size-4 shrink-0 rounded border-border accent-foreground"
|
|
21449
21456
|
}
|
|
21450
21457
|
) : null,
|
|
@@ -21601,17 +21608,17 @@ function W4({
|
|
|
21601
21608
|
/* @__PURE__ */ s("h1", { className: "text-xl font-semibold", children: "Start your first session" }),
|
|
21602
21609
|
/* @__PURE__ */ s("p", { className: "mb-5 mt-1 text-sm text-muted-foreground", children: "Pick a repo and an agent, and tell it what to do." }),
|
|
21603
21610
|
/* @__PURE__ */ m("div", { className: "flex flex-col gap-2", children: [
|
|
21604
|
-
|
|
21611
|
+
ze.length > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap gap-1.5", children: ze.map((W) => /* @__PURE__ */ s(
|
|
21605
21612
|
"button",
|
|
21606
21613
|
{
|
|
21607
21614
|
type: "button",
|
|
21608
21615
|
onClick: () => Ce(W.key),
|
|
21609
|
-
className: "rounded-full border px-3 py-1.5 text-xs font-medium transition-colors " + (
|
|
21616
|
+
className: "rounded-full border px-3 py-1.5 text-xs font-medium transition-colors " + (Be === W.key ? "border-foreground bg-foreground text-background" : "border-border bg-muted/40 hover:bg-muted"),
|
|
21610
21617
|
children: W.label
|
|
21611
21618
|
},
|
|
21612
21619
|
W.key
|
|
21613
21620
|
)) }),
|
|
21614
|
-
|
|
21621
|
+
ze.length ? null : /* @__PURE__ */ s("p", { className: "rounded-xl border border-border bg-muted/40 px-3 py-2.5 text-sm text-muted-foreground", children: "Set up and sign in to a coding agent before starting a session." }),
|
|
21615
21622
|
L.length > 0 && /* @__PURE__ */ s(
|
|
21616
21623
|
"select",
|
|
21617
21624
|
{
|
|
@@ -21636,7 +21643,7 @@ function W4({
|
|
|
21636
21643
|
"button",
|
|
21637
21644
|
{
|
|
21638
21645
|
type: "button",
|
|
21639
|
-
disabled: f || !
|
|
21646
|
+
disabled: f || !ze.length,
|
|
21640
21647
|
onClick: () => void me(),
|
|
21641
21648
|
className: "mt-2 flex items-center justify-center gap-2 rounded-xl bg-foreground px-3 py-2.5 text-sm font-medium text-background transition-opacity disabled:opacity-50",
|
|
21642
21649
|
children: [
|
|
@@ -21899,19 +21906,19 @@ function Q4({
|
|
|
21899
21906
|
}) {
|
|
21900
21907
|
const oe = Wg();
|
|
21901
21908
|
$r();
|
|
21902
|
-
const [Ce,
|
|
21903
|
-
Ze.current =
|
|
21909
|
+
const [Ce, ze] = N(null), [Be, Te] = N(ym), Ze = U(Be);
|
|
21910
|
+
Ze.current = Be, K(() => {
|
|
21904
21911
|
const he = (Me) => {
|
|
21905
|
-
(Me.key === Oc || Me.key === Hg) &&
|
|
21912
|
+
(Me.key === Oc || Me.key === Hg) && Te(ym());
|
|
21906
21913
|
};
|
|
21907
21914
|
return window.addEventListener("storage", he), () => window.removeEventListener("storage", he);
|
|
21908
21915
|
}, []), K(() => {
|
|
21909
21916
|
try {
|
|
21910
|
-
localStorage.setItem(Oc, JSON.stringify(
|
|
21917
|
+
localStorage.setItem(Oc, JSON.stringify(Be));
|
|
21911
21918
|
} catch {
|
|
21912
21919
|
}
|
|
21913
|
-
}, [
|
|
21914
|
-
|
|
21920
|
+
}, [Be]), K(() => {
|
|
21921
|
+
Te((he) => {
|
|
21915
21922
|
const Me = zk(he, i);
|
|
21916
21923
|
return Me.length === he.length ? he : (Ze.current = Me, Me);
|
|
21917
21924
|
}), Ue.current && e && !i.includes(e) && o?.sessionId !== e && n?.();
|
|
@@ -21920,17 +21927,17 @@ function Q4({
|
|
|
21920
21927
|
i.length && (Ue.current = !0);
|
|
21921
21928
|
const Ye = te((he) => {
|
|
21922
21929
|
const Me = Ze.current, tt = Me.includes(he), Ot = tt ? Me.filter((At) => At !== he) : [...Me, he];
|
|
21923
|
-
Ze.current = Ot,
|
|
21930
|
+
Ze.current = Ot, Te(Ot), wt("selection"), ke.success(tt ? "Session unpinned" : "Session pinned to top");
|
|
21924
21931
|
}, []);
|
|
21925
21932
|
K(() => {
|
|
21926
|
-
!ue || oe || (
|
|
21933
|
+
!ue || oe || (ze(new DOMRect(window.innerWidth / 2 - 120, 120, 240, 44)), t?.(ue.sid));
|
|
21927
21934
|
}, [ue, oe, t]);
|
|
21928
|
-
const Qe = (he) => !!d[he.sessionId ?? ""] || ua.has(he.sessionId ?? ""),
|
|
21935
|
+
const Qe = (he) => !!d[he.sessionId ?? ""] || ua.has(he.sessionId ?? ""), ge = je(
|
|
21929
21936
|
() => qg(r, Qe),
|
|
21930
21937
|
// busyBySid changes frequently; include it so a parent follows a working child.
|
|
21931
21938
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21932
21939
|
[r, d]
|
|
21933
|
-
),
|
|
21940
|
+
), Ie = new Set(Be), ee = (he) => Ie.has(es(he.session)) || he.children.some(ee), me = (he) => Sh(he.session), be = te(
|
|
21934
21941
|
async (he) => {
|
|
21935
21942
|
if (he) {
|
|
21936
21943
|
wt("selection"), v(he);
|
|
@@ -21944,31 +21951,31 @@ function Q4({
|
|
|
21944
21951
|
}
|
|
21945
21952
|
},
|
|
21946
21953
|
[v, p]
|
|
21947
|
-
),
|
|
21954
|
+
), _e = te(
|
|
21948
21955
|
(he) => {
|
|
21949
21956
|
if (!he) return;
|
|
21950
21957
|
const Me = document.querySelector(`[data-rail-sid="${he}"]`);
|
|
21951
|
-
Me &&
|
|
21958
|
+
Me && ze(Me.getBoundingClientRect()), t?.(he);
|
|
21952
21959
|
},
|
|
21953
21960
|
[t]
|
|
21954
|
-
),
|
|
21961
|
+
), Fe = je(
|
|
21955
21962
|
() => vh(
|
|
21956
|
-
|
|
21957
|
-
(he) =>
|
|
21963
|
+
ge.roots.filter((he) => !ee(he) && !me(he)),
|
|
21964
|
+
(he) => ge.flatten([he]).length,
|
|
21958
21965
|
Nr
|
|
21959
21966
|
),
|
|
21960
21967
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21961
|
-
[
|
|
21962
|
-
), W =
|
|
21968
|
+
[ge, Be]
|
|
21969
|
+
), W = ge.roots.filter(
|
|
21963
21970
|
(he) => ee(he) && !me(he)
|
|
21964
|
-
), Ne = [], re =
|
|
21965
|
-
(he) => !ee(he) && !me(he) &&
|
|
21966
|
-
), ye =
|
|
21967
|
-
(he) => !ee(he) && !me(he) && !
|
|
21968
|
-
), V =
|
|
21971
|
+
), Ne = [], re = ge.roots.filter(
|
|
21972
|
+
(he) => !ee(he) && !me(he) && ge.effectiveBusy(he)
|
|
21973
|
+
), ye = ge.roots.filter(
|
|
21974
|
+
(he) => !ee(he) && !me(he) && !ge.effectiveBusy(he)
|
|
21975
|
+
), V = ge.flatten(W), ne = ge.flatten(Ne), pe = ge.flatten(re), xe = ge.flatten(ye), Oe = [...V, ...ne, ...pe, ...xe].map((he) => he.sessionId).filter((he) => !!he), Le = Oe.slice(0, 8).join(",");
|
|
21969
21976
|
if (K(() => {
|
|
21970
|
-
|
|
21971
|
-
}, [
|
|
21977
|
+
Le && pp(Le.split(","), Qg);
|
|
21978
|
+
}, [Le]), !oe && !V.length && !ne.length && !pe.length && !xe.length && !x.length && !o)
|
|
21972
21979
|
return /* @__PURE__ */ m("div", { className: "flex flex-col gap-5", children: [
|
|
21973
21980
|
ie,
|
|
21974
21981
|
/* @__PURE__ */ m("div", { className: "flex min-h-[50dvh] flex-col items-center justify-center gap-3 text-center", children: [
|
|
@@ -21976,7 +21983,7 @@ function Q4({
|
|
|
21976
21983
|
/* @__PURE__ */ s("span", { className: "text-sm font-medium text-muted-foreground", children: "No running sessions" })
|
|
21977
21984
|
] })
|
|
21978
21985
|
] });
|
|
21979
|
-
const
|
|
21986
|
+
const Re = (he) => w.find((Me) => Me.id === he)?.name ?? he;
|
|
21980
21987
|
if (oe)
|
|
21981
21988
|
return /* @__PURE__ */ s(
|
|
21982
21989
|
Z4,
|
|
@@ -21993,7 +22000,7 @@ function Q4({
|
|
|
21993
22000
|
onRenameSession: g,
|
|
21994
22001
|
onRemove: v,
|
|
21995
22002
|
findings: x,
|
|
21996
|
-
nameFor:
|
|
22003
|
+
nameFor: Re,
|
|
21997
22004
|
onOpenFinding: A,
|
|
21998
22005
|
onTriageFindings: T,
|
|
21999
22006
|
autoTriageBusy: E,
|
|
@@ -22020,7 +22027,7 @@ function Q4({
|
|
|
22020
22027
|
hosted: se,
|
|
22021
22028
|
coach: ie,
|
|
22022
22029
|
focus: ue,
|
|
22023
|
-
topPinned:
|
|
22030
|
+
topPinned: Be,
|
|
22024
22031
|
onToggleTopPin: Ye
|
|
22025
22032
|
}
|
|
22026
22033
|
);
|
|
@@ -22034,12 +22041,12 @@ function Q4({
|
|
|
22034
22041
|
users: a,
|
|
22035
22042
|
onRefresh: p,
|
|
22036
22043
|
onRemove: v,
|
|
22037
|
-
topPinned:
|
|
22044
|
+
topPinned: Ie.has(Me),
|
|
22038
22045
|
onToggleTopPin: Ye,
|
|
22039
22046
|
stagePinned: !1,
|
|
22040
22047
|
onToggleStagePin: () => {
|
|
22041
22048
|
},
|
|
22042
|
-
onOpen: () =>
|
|
22049
|
+
onOpen: () => _e(Me),
|
|
22043
22050
|
children: /* @__PURE__ */ s(
|
|
22044
22051
|
Gg,
|
|
22045
22052
|
{
|
|
@@ -22049,9 +22056,9 @@ function Q4({
|
|
|
22049
22056
|
active: !1,
|
|
22050
22057
|
cursored: !1,
|
|
22051
22058
|
pinned: !1,
|
|
22052
|
-
topPinned:
|
|
22059
|
+
topPinned: Ie.has(Me),
|
|
22053
22060
|
collapsed: !1,
|
|
22054
|
-
onActivate: () =>
|
|
22061
|
+
onActivate: () => _e(Me),
|
|
22055
22062
|
onTogglePin: () => Ye(Me),
|
|
22056
22063
|
onArchive: () => void be(Me)
|
|
22057
22064
|
}
|
|
@@ -22059,14 +22066,14 @@ function Q4({
|
|
|
22059
22066
|
},
|
|
22060
22067
|
Me
|
|
22061
22068
|
);
|
|
22062
|
-
},
|
|
22069
|
+
}, $e = o?.sessionId && !Oe.includes(o.sessionId) ? [...Oe, o.sessionId] : Oe, we = e ? r.find((he) => he.sessionId === e) ?? (o?.sessionId === e ? o : null) : null;
|
|
22063
22070
|
return /* @__PURE__ */ m(He, { children: [
|
|
22064
22071
|
/* @__PURE__ */ m("div", { className: "flex flex-col gap-2 pb-[calc(var(--lfg-composer-clear)+3.5rem)]", children: [
|
|
22065
22072
|
ie,
|
|
22066
22073
|
/* @__PURE__ */ s(
|
|
22067
22074
|
Vg,
|
|
22068
22075
|
{
|
|
22069
|
-
groups:
|
|
22076
|
+
groups: Fe,
|
|
22070
22077
|
pinnedNodes: W,
|
|
22071
22078
|
pinnedCount: V.length,
|
|
22072
22079
|
projectFilter: c,
|
|
@@ -22096,7 +22103,7 @@ function Q4({
|
|
|
22096
22103
|
children: [
|
|
22097
22104
|
/* @__PURE__ */ s("span", { className: $("size-1.5 shrink-0 rounded-full", Ud[he.severity]) }),
|
|
22098
22105
|
/* @__PURE__ */ m("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
22099
|
-
/* @__PURE__ */ s("span", { className: "truncate text-sm font-medium leading-tight", children:
|
|
22106
|
+
/* @__PURE__ */ s("span", { className: "truncate text-sm font-medium leading-tight", children: Re(he.agentId) }),
|
|
22100
22107
|
/* @__PURE__ */ s("span", { className: "truncate text-xs leading-tight text-muted-foreground", children: he.title })
|
|
22101
22108
|
] })
|
|
22102
22109
|
]
|
|
@@ -22114,7 +22121,7 @@ function Q4({
|
|
|
22114
22121
|
sid: e,
|
|
22115
22122
|
session: we,
|
|
22116
22123
|
users: a,
|
|
22117
|
-
order:
|
|
22124
|
+
order: $e,
|
|
22118
22125
|
origin: Ce ?? new DOMRect(window.innerWidth / 2 - 120, 120, 240, 44),
|
|
22119
22126
|
busyBySid: d,
|
|
22120
22127
|
promptsBySid: f,
|
|
@@ -22123,7 +22130,7 @@ function Q4({
|
|
|
22123
22130
|
onRefresh: p,
|
|
22124
22131
|
onRenameSession: g,
|
|
22125
22132
|
onRemove: v,
|
|
22126
|
-
pinned:
|
|
22133
|
+
pinned: Ie.has(e),
|
|
22127
22134
|
onTogglePin: we.shippedReview ? void 0 : Ye,
|
|
22128
22135
|
onClose: () => n?.()
|
|
22129
22136
|
}
|
|
@@ -22174,29 +22181,29 @@ function Z4({
|
|
|
22174
22181
|
topPinned: R,
|
|
22175
22182
|
onToggleTopPin: Y
|
|
22176
22183
|
}) {
|
|
22177
|
-
const se = vd(), { conversations: ie, selectedConversationId: ue, markRead: oe } = gt(Ba), Ce = 4,
|
|
22184
|
+
const se = vd(), { conversations: ie, selectedConversationId: ue, markRead: oe } = gt(Ba), Ce = 4, ze = r || "__all", Be = encodeURIComponent(ze), Te = `lfg_stage_pinned:${Be}`, Ze = `lfg_rail_collapsed:${Be}`, Ue = te(() => {
|
|
22178
22185
|
try {
|
|
22179
|
-
const Q = localStorage.getItem(
|
|
22186
|
+
const Q = localStorage.getItem(Te) ?? (ze === "__all" ? localStorage.getItem("lfg_stage_pinned") : null);
|
|
22180
22187
|
if (!Q) return [];
|
|
22181
22188
|
const ae = JSON.parse(Q);
|
|
22182
22189
|
return Array.isArray(ae) ? ae.filter((P) => typeof P == "string") : [];
|
|
22183
22190
|
} catch {
|
|
22184
22191
|
return [];
|
|
22185
22192
|
}
|
|
22186
|
-
}, [
|
|
22193
|
+
}, [ze, Te]), Ye = te(() => {
|
|
22187
22194
|
try {
|
|
22188
|
-
return (localStorage.getItem(Ze) ?? (
|
|
22195
|
+
return (localStorage.getItem(Ze) ?? (ze === "__all" ? localStorage.getItem("lfg_rail_collapsed") : null)) === "1";
|
|
22189
22196
|
} catch {
|
|
22190
22197
|
return !1;
|
|
22191
22198
|
}
|
|
22192
|
-
}, [
|
|
22199
|
+
}, [ze, Ze]), [Qe, ge] = N(Ue), [Ie, ee] = N(null), [me, be] = N(Ye), [_e, Fe] = N(null), [W, Ne] = N(!1), [re, ye] = N(!1), [V, ne] = N(!1), pe = _.length > 0 && !!A, xe = _.find((Q) => sr(Q) === r), Oe = (Q) => {
|
|
22193
22200
|
Ne(!1), ne(Q), window.setTimeout(() => ye(!0), 180);
|
|
22194
|
-
}, [
|
|
22201
|
+
}, [Le, Re] = N(!1), [Xe, $e] = N(null), we = U(null), he = U(null), Me = je(() => {
|
|
22195
22202
|
const Q = /* @__PURE__ */ new Map();
|
|
22196
22203
|
for (const ae of e) ae.sessionId && Q.set(ae.sessionId, ae);
|
|
22197
22204
|
return t?.sessionId && Q.set(t.sessionId, t), Q;
|
|
22198
22205
|
}, [e, t]), tt = te((Q) => {
|
|
22199
|
-
Q && (
|
|
22206
|
+
Q && ($e((ae) => ({ sid: Q, n: (ae?.n ?? 0) + 1 })), requestAnimationFrame(() => {
|
|
22200
22207
|
document.querySelector(`[data-stage-sid="${Q}"]`)?.scrollIntoView({ block: "nearest", inline: "nearest", behavior: "smooth" });
|
|
22201
22208
|
}));
|
|
22202
22209
|
}, []);
|
|
@@ -22204,24 +22211,24 @@ function Z4({
|
|
|
22204
22211
|
const Q = $k(C, he.current, Me);
|
|
22205
22212
|
if (!Q) return;
|
|
22206
22213
|
const { sid: ae, token: P } = Q;
|
|
22207
|
-
he.current = P, ee(ae),
|
|
22214
|
+
he.current = P, ee(ae), Fe(ae), tt(ae), requestAnimationFrame(() => {
|
|
22208
22215
|
document.querySelector(`[data-rail-sid="${ae}"]`)?.scrollIntoView({ block: "center" });
|
|
22209
22216
|
});
|
|
22210
22217
|
}, [C, Me, tt]), K(() => {
|
|
22211
|
-
|
|
22218
|
+
ge((Q) => {
|
|
22212
22219
|
const ae = Q.filter((P) => Me.has(P));
|
|
22213
22220
|
return ae.length === Q.length ? Q : ae;
|
|
22214
22221
|
});
|
|
22215
22222
|
}, [Me]), K(() => {
|
|
22216
22223
|
ee((Q) => Q && !Me.has(Q) ? null : Q);
|
|
22217
22224
|
}, [Me]), Bt(() => {
|
|
22218
|
-
|
|
22225
|
+
ge(Ue()), ee(null), be(Ye()), we.current = null;
|
|
22219
22226
|
}, [Ue, Ye]), K(() => {
|
|
22220
22227
|
try {
|
|
22221
|
-
localStorage.setItem(
|
|
22228
|
+
localStorage.setItem(Te, JSON.stringify(Qe));
|
|
22222
22229
|
} catch {
|
|
22223
22230
|
}
|
|
22224
|
-
}, [Qe,
|
|
22231
|
+
}, [Qe, Te]), K(() => {
|
|
22225
22232
|
try {
|
|
22226
22233
|
localStorage.setItem(Ze, me ? "1" : "0");
|
|
22227
22234
|
} catch {
|
|
@@ -22287,8 +22294,8 @@ function Z4({
|
|
|
22287
22294
|
}, []);
|
|
22288
22295
|
const Tt = je(() => Qe.filter((Q) => Me.has(Q)), [Qe, Me]), Ke = je(() => {
|
|
22289
22296
|
const Q = [...Tt];
|
|
22290
|
-
return
|
|
22291
|
-
}, [Tt,
|
|
22297
|
+
return Ie && Me.has(Ie) && !Q.includes(Ie) && Q.length < Ce && Q.push(Ie), Q.slice(0, Ce);
|
|
22298
|
+
}, [Tt, Ie, Me]);
|
|
22292
22299
|
K(() => {
|
|
22293
22300
|
if (Ke.length) {
|
|
22294
22301
|
try {
|
|
@@ -22311,19 +22318,19 @@ function Z4({
|
|
|
22311
22318
|
(Q) => {
|
|
22312
22319
|
if (t?.sessionId !== Q) {
|
|
22313
22320
|
if (Tt.includes(Q)) {
|
|
22314
|
-
|
|
22321
|
+
ge((ae) => ae.filter((P) => P !== Q));
|
|
22315
22322
|
return;
|
|
22316
22323
|
}
|
|
22317
22324
|
if (Tt.length >= Ce) {
|
|
22318
22325
|
ke.error(`${Ce} columns max — unpin one first`);
|
|
22319
22326
|
return;
|
|
22320
22327
|
}
|
|
22321
|
-
|
|
22328
|
+
ge([...Tt, Q]), ee((ae) => ae === Q ? null : ae);
|
|
22322
22329
|
}
|
|
22323
22330
|
},
|
|
22324
22331
|
[Tt, t?.sessionId]
|
|
22325
22332
|
), Et = te((Q) => {
|
|
22326
|
-
|
|
22333
|
+
ge((ae) => ae.filter((P) => P !== Q)), ee((ae) => ae === Q ? null : ae);
|
|
22327
22334
|
}, []), Ht = je(() => {
|
|
22328
22335
|
const Q = /* @__PURE__ */ new Map();
|
|
22329
22336
|
for (const ae of rc(M, e, ie))
|
|
@@ -22342,7 +22349,7 @@ function Z4({
|
|
|
22342
22349
|
(Q) => Q.botId === L && (Q.conversationId === ue || Q.sessionId === ue)
|
|
22343
22350
|
)?.sessionId ?? xt(L) : null;
|
|
22344
22351
|
K(() => {
|
|
22345
|
-
j !== "chat" || !It || (ee((Q) => Q === It ? Q : It),
|
|
22352
|
+
j !== "chat" || !It || (ee((Q) => Q === It ? Q : It), Fe(It));
|
|
22346
22353
|
}, [j, It]);
|
|
22347
22354
|
const Nt = je(
|
|
22348
22355
|
() => qg(e, (Q) => !!i[Q.sessionId ?? ""]),
|
|
@@ -22368,24 +22375,24 @@ function Z4({
|
|
|
22368
22375
|
[le]
|
|
22369
22376
|
);
|
|
22370
22377
|
K(() => {
|
|
22371
|
-
|
|
22378
|
+
Fe((Q) => Q && de.includes(Q) ? Q : de[0] ?? null);
|
|
22372
22379
|
}, [de]);
|
|
22373
22380
|
const Pe = de.slice(0, 8).join(",");
|
|
22374
22381
|
K(() => {
|
|
22375
22382
|
Pe && pp(Pe.split(","), Qg);
|
|
22376
22383
|
}, [Pe]), K(() => {
|
|
22377
|
-
|
|
22378
|
-
}, [
|
|
22384
|
+
_e && document.querySelector(`[data-rail-sid="${_e}"]`)?.scrollIntoView({ block: "nearest" });
|
|
22385
|
+
}, [_e]);
|
|
22379
22386
|
const Se = te(
|
|
22380
22387
|
(Q) => {
|
|
22381
22388
|
const ae = we.current ? de.indexOf(we.current) : -1, P = de.indexOf(Q);
|
|
22382
22389
|
if (ae < 0 || P < 0) {
|
|
22383
|
-
we.current = Q,
|
|
22390
|
+
we.current = Q, Fe(Q), ee(Q);
|
|
22384
22391
|
return;
|
|
22385
22392
|
}
|
|
22386
22393
|
const [qe, Ge] = ae < P ? [ae, P] : [P, ae];
|
|
22387
22394
|
let et = de.slice(qe, Ge + 1);
|
|
22388
|
-
et.length > Ce && (ke.error(`${Ce} panes max — selection trimmed`), et = P >= ae ? et.slice(et.length - Ce) : et.slice(0, Ce)),
|
|
22395
|
+
et.length > Ce && (ke.error(`${Ce} panes max — selection trimmed`), et = P >= ae ? et.slice(et.length - Ce) : et.slice(0, Ce)), ge(et), ee(null), Fe(Q);
|
|
22389
22396
|
},
|
|
22390
22397
|
[de]
|
|
22391
22398
|
), ot = te(
|
|
@@ -22394,7 +22401,7 @@ function Z4({
|
|
|
22394
22401
|
Se(Q), tt(Q);
|
|
22395
22402
|
return;
|
|
22396
22403
|
}
|
|
22397
|
-
we.current = Q,
|
|
22404
|
+
we.current = Q, Fe(Q), pt(Q), tt(Q);
|
|
22398
22405
|
},
|
|
22399
22406
|
[Se, pt, tt]
|
|
22400
22407
|
), bt = te(
|
|
@@ -22432,8 +22439,8 @@ function Z4({
|
|
|
22432
22439
|
), zt = gt(Od), gn = U({
|
|
22433
22440
|
openTerminal: zt,
|
|
22434
22441
|
orderedSids: de,
|
|
22435
|
-
cursor:
|
|
22436
|
-
preview:
|
|
22442
|
+
cursor: _e,
|
|
22443
|
+
preview: Ie,
|
|
22437
22444
|
columnIds: Ke,
|
|
22438
22445
|
activate: ot,
|
|
22439
22446
|
pulseStage: tt,
|
|
@@ -22441,11 +22448,11 @@ function Z4({
|
|
|
22441
22448
|
togglePin: ht,
|
|
22442
22449
|
closeColumn: Et,
|
|
22443
22450
|
closeSession: jt,
|
|
22444
|
-
setCursor:
|
|
22451
|
+
setCursor: Fe,
|
|
22445
22452
|
setPreview: ee,
|
|
22446
22453
|
setRailCollapsed: be,
|
|
22447
|
-
setShowHelp:
|
|
22448
|
-
showHelp:
|
|
22454
|
+
setShowHelp: Re,
|
|
22455
|
+
showHelp: Le,
|
|
22449
22456
|
busyBySid: i,
|
|
22450
22457
|
interruptSid: bt,
|
|
22451
22458
|
onNew: y,
|
|
@@ -22454,8 +22461,8 @@ function Z4({
|
|
|
22454
22461
|
gn.current = {
|
|
22455
22462
|
openTerminal: zt,
|
|
22456
22463
|
orderedSids: de,
|
|
22457
|
-
cursor:
|
|
22458
|
-
preview:
|
|
22464
|
+
cursor: _e,
|
|
22465
|
+
preview: Ie,
|
|
22459
22466
|
columnIds: Ke,
|
|
22460
22467
|
activate: ot,
|
|
22461
22468
|
pulseStage: tt,
|
|
@@ -22463,11 +22470,11 @@ function Z4({
|
|
|
22463
22470
|
togglePin: ht,
|
|
22464
22471
|
closeColumn: Et,
|
|
22465
22472
|
closeSession: jt,
|
|
22466
|
-
setCursor:
|
|
22473
|
+
setCursor: Fe,
|
|
22467
22474
|
setPreview: ee,
|
|
22468
22475
|
setRailCollapsed: be,
|
|
22469
|
-
setShowHelp:
|
|
22470
|
-
showHelp:
|
|
22476
|
+
setShowHelp: Re,
|
|
22477
|
+
showHelp: Le,
|
|
22471
22478
|
busyBySid: i,
|
|
22472
22479
|
interruptSid: bt,
|
|
22473
22480
|
onNew: y,
|
|
@@ -22585,7 +22592,7 @@ function Z4({
|
|
|
22585
22592
|
busy: !!i[ae],
|
|
22586
22593
|
latest: $d(o[ae] ?? _c),
|
|
22587
22594
|
active: Ke.includes(ae),
|
|
22588
|
-
cursored:
|
|
22595
|
+
cursored: _e === ae,
|
|
22589
22596
|
pinned: Tt.includes(ae),
|
|
22590
22597
|
topPinned: fe.has(ae),
|
|
22591
22598
|
collapsed: me,
|
|
@@ -22609,8 +22616,8 @@ function Z4({
|
|
|
22609
22616
|
"div",
|
|
22610
22617
|
{
|
|
22611
22618
|
className: "h-full min-h-0 min-w-0",
|
|
22612
|
-
onClickCapture: () =>
|
|
22613
|
-
onFocusCapture: () =>
|
|
22619
|
+
onClickCapture: () => Fe(P),
|
|
22620
|
+
onFocusCapture: () => Fe(P),
|
|
22614
22621
|
children: /* @__PURE__ */ s(
|
|
22615
22622
|
Bd,
|
|
22616
22623
|
{
|
|
@@ -22770,7 +22777,7 @@ function Z4({
|
|
|
22770
22777
|
] }) : /* @__PURE__ */ m("div", { className: "flex shrink-0 flex-col gap-2 border-b border-border px-2 py-2", children: [
|
|
22771
22778
|
/* @__PURE__ */ m("div", { className: "flex items-center gap-1.5", children: [
|
|
22772
22779
|
/* @__PURE__ */ s(jd, { hosted: I }),
|
|
22773
|
-
|
|
22780
|
+
pe ? /* @__PURE__ */ s(
|
|
22774
22781
|
"button",
|
|
22775
22782
|
{
|
|
22776
22783
|
type: "button",
|
|
@@ -22891,8 +22898,8 @@ function Z4({
|
|
|
22891
22898
|
] })
|
|
22892
22899
|
}
|
|
22893
22900
|
),
|
|
22894
|
-
|
|
22895
|
-
|
|
22901
|
+
Le ? /* @__PURE__ */ s(e3, { onClose: () => Re(!1) }) : null,
|
|
22902
|
+
pe ? /* @__PURE__ */ m(He, { children: [
|
|
22896
22903
|
/* @__PURE__ */ s(
|
|
22897
22904
|
c0,
|
|
22898
22905
|
{
|
|
@@ -22902,8 +22909,8 @@ function Z4({
|
|
|
22902
22909
|
selected: "",
|
|
22903
22910
|
onOpenChange: Ne,
|
|
22904
22911
|
onSelect: () => Ne(!1),
|
|
22905
|
-
onBrowse: () =>
|
|
22906
|
-
onCreate: () =>
|
|
22912
|
+
onBrowse: () => Oe(!1),
|
|
22913
|
+
onCreate: () => Oe(!0),
|
|
22907
22914
|
onReposChanged: z
|
|
22908
22915
|
}
|
|
22909
22916
|
),
|
|
@@ -23816,7 +23823,7 @@ function a3({
|
|
|
23816
23823
|
const d = e.sessionId, f = !!e.shippedReview, h = Cd([e.sessionId, e.nativeSessionId]), { answerInSession: p } = Xo(), g = d ? `session:${d}` : "session:missing", [v, y] = N(
|
|
23817
23824
|
() => lc(g)?.text ?? ""
|
|
23818
23825
|
), [x, w] = N(!1), [A, k] = N(!1), [T, E] = N(null), [O, B] = N(!1), q = U(null), [j, M] = N(0), [L, G] = N(!1), J = zd({
|
|
23819
|
-
endpoint: (
|
|
23826
|
+
endpoint: (ge) => d ? f ? `/api/uploads?filename=${encodeURIComponent(ge.name)}` : `/api/sessions/${d}/upload?filename=${encodeURIComponent(ge.name)}` : null,
|
|
23820
23827
|
disabled: x
|
|
23821
23828
|
}), {
|
|
23822
23829
|
attachments: D,
|
|
@@ -23825,23 +23832,23 @@ function a3({
|
|
|
23825
23832
|
removeAttachment: _,
|
|
23826
23833
|
resolveUpload: z,
|
|
23827
23834
|
forgetAllUploads: I
|
|
23828
|
-
} = J, [S] = N(() => new J2()), C = S2(), { messages: R, setMessages: Y, sendMessage: se, status: ie } = C, ue = je(() => ek(R), [R]), [oe, Ce] = N(!1),
|
|
23829
|
-
(
|
|
23830
|
-
y(
|
|
23835
|
+
} = J, [S] = N(() => new J2()), C = S2(), { messages: R, setMessages: Y, sendMessage: se, status: ie } = C, ue = je(() => ek(R), [R]), [oe, Ce] = N(!1), ze = n || oe || ie === "submitted" || ie === "streaming", Be = te(
|
|
23836
|
+
(ge) => {
|
|
23837
|
+
y(ge), d && bp({
|
|
23831
23838
|
contextKey: g,
|
|
23832
23839
|
source: "session",
|
|
23833
|
-
text:
|
|
23840
|
+
text: ge,
|
|
23834
23841
|
sessionId: d,
|
|
23835
23842
|
sessionTitle: e.title || e.project || "Session",
|
|
23836
23843
|
project: e.project
|
|
23837
23844
|
});
|
|
23838
23845
|
},
|
|
23839
23846
|
[e.project, e.title, d, g]
|
|
23840
|
-
),
|
|
23841
|
-
(
|
|
23842
|
-
|
|
23847
|
+
), Te = te(
|
|
23848
|
+
(ge, Ie) => {
|
|
23849
|
+
Be(Ie.trim() ? `${Ie.trimEnd()} ${ge}` : ge), M((ee) => ee + 1);
|
|
23843
23850
|
},
|
|
23844
|
-
[
|
|
23851
|
+
[Be]
|
|
23845
23852
|
);
|
|
23846
23853
|
K(() => {
|
|
23847
23854
|
y(lc(g)?.text ?? "");
|
|
@@ -23850,66 +23857,66 @@ function a3({
|
|
|
23850
23857
|
Y([]), E(null), k(!1);
|
|
23851
23858
|
return;
|
|
23852
23859
|
}
|
|
23853
|
-
let
|
|
23854
|
-
const
|
|
23855
|
-
return
|
|
23860
|
+
let ge = !1;
|
|
23861
|
+
const Ie = gk(d);
|
|
23862
|
+
return Ie ? (Y(Ie.messages), E(Ie.nextBefore), k(!1)) : (k(!0), E(null), Y([])), ve(
|
|
23856
23863
|
Ma(d),
|
|
23857
23864
|
{ cache: "no-store" }
|
|
23858
23865
|
).then((ee) => {
|
|
23859
|
-
if (
|
|
23860
|
-
const me = Ro(Array.isArray(ee.messages) ? ee.messages : []), be = new Set(me.map((Ne) => Ne.id)),
|
|
23866
|
+
if (ge) return;
|
|
23867
|
+
const me = Ro(Array.isArray(ee.messages) ? ee.messages : []), be = new Set(me.map((Ne) => Ne.id)), _e = Ie ? Ie.messages.slice(
|
|
23861
23868
|
0,
|
|
23862
|
-
Math.max(0,
|
|
23869
|
+
Math.max(0, Ie.messages.findIndex((Ne) => be.has(Ne.id)))
|
|
23863
23870
|
) : [];
|
|
23864
|
-
let
|
|
23871
|
+
let Fe = me;
|
|
23865
23872
|
Y((Ne) => {
|
|
23866
|
-
const re = new Set(
|
|
23867
|
-
return
|
|
23873
|
+
const re = new Set(Ie?.messages.map((ye) => ye.id) ?? []);
|
|
23874
|
+
return Fe = nk(Ne, me, _e, re);
|
|
23868
23875
|
});
|
|
23869
|
-
const W =
|
|
23870
|
-
E(W), ac(d,
|
|
23876
|
+
const W = _e.length ? Ie?.nextBefore ?? null : ee.nextBefore ?? null;
|
|
23877
|
+
E(W), ac(d, Fe, W);
|
|
23871
23878
|
}).catch((ee) => {
|
|
23872
|
-
|
|
23879
|
+
ge || i(ee instanceof Error ? ee.message : String(ee));
|
|
23873
23880
|
}).finally(() => {
|
|
23874
|
-
|
|
23881
|
+
ge || k(!1);
|
|
23875
23882
|
}), () => {
|
|
23876
|
-
|
|
23883
|
+
ge = !0;
|
|
23877
23884
|
};
|
|
23878
23885
|
}, [i, Y, d]), K(() => {
|
|
23879
23886
|
if (!(!d || !a))
|
|
23880
|
-
return Ce(!1), a(d, (
|
|
23881
|
-
if (
|
|
23882
|
-
i(
|
|
23887
|
+
return Ce(!1), a(d, (ge) => {
|
|
23888
|
+
if (ge.type === "error") {
|
|
23889
|
+
i(ge.error);
|
|
23883
23890
|
return;
|
|
23884
23891
|
}
|
|
23885
|
-
|
|
23886
|
-
const ee = lk(
|
|
23892
|
+
ge.type === "busy" && Ce(ge.busy), Y((Ie) => {
|
|
23893
|
+
const ee = lk(Ie, ge, {
|
|
23887
23894
|
streamActive: S.owns(d)
|
|
23888
23895
|
});
|
|
23889
|
-
return ee !==
|
|
23896
|
+
return ee !== Ie && xk(d, ee), ee;
|
|
23890
23897
|
});
|
|
23891
23898
|
});
|
|
23892
23899
|
}, [i, a, S, Y, d]);
|
|
23893
23900
|
const Ze = te(async () => {
|
|
23894
23901
|
if (!d || T == null) return !1;
|
|
23895
|
-
const
|
|
23902
|
+
const Ie = await ve(
|
|
23896
23903
|
sd(d, T),
|
|
23897
23904
|
{ cache: "no-store" }
|
|
23898
|
-
), ee = Ro(Array.isArray(
|
|
23899
|
-
if (E(
|
|
23905
|
+
), ee = Ro(Array.isArray(Ie.messages) ? Ie.messages : []);
|
|
23906
|
+
if (E(Ie.nextBefore ?? null), !ee.length) return (Ie.nextBefore ?? null) !== null;
|
|
23900
23907
|
let me = ee;
|
|
23901
23908
|
return Y((be) => {
|
|
23902
|
-
const
|
|
23903
|
-
return me =
|
|
23904
|
-
}), ac(d, me,
|
|
23909
|
+
const _e = new Set(be.map((W) => W.id)), Fe = ee.filter((W) => !_e.has(W.id));
|
|
23910
|
+
return me = Fe.length ? [...Fe, ...be] : be;
|
|
23911
|
+
}), ac(d, me, Ie.nextBefore ?? null), (Ie.nextBefore ?? null) !== null;
|
|
23905
23912
|
}, [T, Y, d]);
|
|
23906
|
-
async function Ue(
|
|
23907
|
-
|
|
23908
|
-
const me = (
|
|
23913
|
+
async function Ue(ge, Ie, ee = "steer") {
|
|
23914
|
+
ge?.preventDefault();
|
|
23915
|
+
const me = (Ie ?? v).trim(), be = D;
|
|
23909
23916
|
if (!d || !me && !be.length) return;
|
|
23910
|
-
const
|
|
23911
|
-
q.current?.blur();
|
|
23912
|
-
const
|
|
23917
|
+
const _e = ee === "queue" && ze;
|
|
23918
|
+
document.documentElement.classList.contains("lfg-keyboard-open") && q.current?.blur();
|
|
23919
|
+
const Fe = cc({
|
|
23913
23920
|
contextKey: g,
|
|
23914
23921
|
source: "session",
|
|
23915
23922
|
text: me,
|
|
@@ -23929,7 +23936,7 @@ function a3({
|
|
|
23929
23936
|
prompt: Ne,
|
|
23930
23937
|
user: e.assignedUser || void 0
|
|
23931
23938
|
})
|
|
23932
|
-
}), nr(
|
|
23939
|
+
}), nr(Fe?.id, "sent");
|
|
23933
23940
|
for (const re of be)
|
|
23934
23941
|
re.previewUrl && URL.revokeObjectURL(re.previewUrl);
|
|
23935
23942
|
X([]), I(), ke.success("Session resumed"), await l();
|
|
@@ -23948,14 +23955,14 @@ function a3({
|
|
|
23948
23955
|
html: Gs(Ne).replace(/\n/g, "<br>"),
|
|
23949
23956
|
ts: Date.now(),
|
|
23950
23957
|
pending: !0,
|
|
23951
|
-
queued:
|
|
23958
|
+
queued: _e
|
|
23952
23959
|
}
|
|
23953
23960
|
}
|
|
23954
23961
|
},
|
|
23955
23962
|
{ body: { mode: ee } }
|
|
23956
23963
|
)
|
|
23957
|
-
).then(() => nr(
|
|
23958
|
-
nr(
|
|
23964
|
+
).then(() => nr(Fe?.id, "sent")).catch((re) => {
|
|
23965
|
+
nr(Fe?.id, "draft"), y((ye) => ye || me), i(re instanceof Error ? re.message : String(re));
|
|
23959
23966
|
});
|
|
23960
23967
|
for (const re of h) p(re, me);
|
|
23961
23968
|
for (const re of be)
|
|
@@ -23964,7 +23971,7 @@ function a3({
|
|
|
23964
23971
|
i(re instanceof Error ? re.message : String(re));
|
|
23965
23972
|
});
|
|
23966
23973
|
} catch (W) {
|
|
23967
|
-
nr(
|
|
23974
|
+
nr(Fe?.id, "draft"), i(W instanceof Error ? W.message : String(W)), y((Ne) => Ne || me);
|
|
23968
23975
|
} finally {
|
|
23969
23976
|
w(!1);
|
|
23970
23977
|
}
|
|
@@ -23973,14 +23980,14 @@ function a3({
|
|
|
23973
23980
|
if (d)
|
|
23974
23981
|
try {
|
|
23975
23982
|
await ve(`/api/sessions/${d}/interrupt`, { method: "POST" }), await l();
|
|
23976
|
-
} catch (
|
|
23977
|
-
i(
|
|
23983
|
+
} catch (ge) {
|
|
23984
|
+
i(ge instanceof Error ? ge.message : String(ge));
|
|
23978
23985
|
}
|
|
23979
23986
|
}
|
|
23980
23987
|
const Qe = te(
|
|
23981
|
-
(
|
|
23982
|
-
!d || !
|
|
23983
|
-
(
|
|
23988
|
+
(ge) => {
|
|
23989
|
+
!d || !ge.queueId || z2(d, ge.queueId).catch(
|
|
23990
|
+
(Ie) => i(Ie instanceof Error ? Ie.message : String(Ie))
|
|
23984
23991
|
);
|
|
23985
23992
|
},
|
|
23986
23993
|
[d, i]
|
|
@@ -24000,7 +24007,7 @@ function a3({
|
|
|
24000
24007
|
{
|
|
24001
24008
|
sid: d,
|
|
24002
24009
|
messages: ue,
|
|
24003
|
-
busy:
|
|
24010
|
+
busy: ze,
|
|
24004
24011
|
loading: A,
|
|
24005
24012
|
onLoadOlderMessages: Ze,
|
|
24006
24013
|
onRetryQueued: Qe,
|
|
@@ -24041,7 +24048,7 @@ function a3({
|
|
|
24041
24048
|
Ld,
|
|
24042
24049
|
{
|
|
24043
24050
|
className: "mb-2",
|
|
24044
|
-
items: D.map((
|
|
24051
|
+
items: D.map((ge) => ({ att: ge })),
|
|
24045
24052
|
disabled: x,
|
|
24046
24053
|
onAnnotate: J.setAnnotatingId,
|
|
24047
24054
|
onRemove: _,
|
|
@@ -24082,17 +24089,17 @@ function a3({
|
|
|
24082
24089
|
textareaRef: q,
|
|
24083
24090
|
"data-composer-sid": d,
|
|
24084
24091
|
value: v,
|
|
24085
|
-
onValueChange:
|
|
24092
|
+
onValueChange: Be,
|
|
24086
24093
|
onMultilineChange: G,
|
|
24087
24094
|
scrollToEndNonce: j,
|
|
24088
24095
|
onPaste: J.onPasteFiles,
|
|
24089
|
-
onKeyDown: (
|
|
24090
|
-
if (!(
|
|
24091
|
-
if (
|
|
24096
|
+
onKeyDown: (ge) => {
|
|
24097
|
+
if (!(ge.key !== "Enter" || ge.shiftKey)) {
|
|
24098
|
+
if (ge.preventDefault(), ge.metaKey || ge.ctrlKey) {
|
|
24092
24099
|
Ue(void 0, void 0, "queue");
|
|
24093
24100
|
return;
|
|
24094
24101
|
}
|
|
24095
|
-
|
|
24102
|
+
ge.currentTarget.form?.requestSubmit();
|
|
24096
24103
|
}
|
|
24097
24104
|
},
|
|
24098
24105
|
placeholder: D.length ? "Add a note" : t ? `Message ${t.name}…` : f ? "Message to resume" : (
|
|
@@ -24127,16 +24134,16 @@ function a3({
|
|
|
24127
24134
|
className: "size-10 shrink-0 rounded-full bg-foreground/[0.06] text-foreground/70 hover:bg-foreground/[0.12] hover:text-foreground md:size-8",
|
|
24128
24135
|
baseText: v,
|
|
24129
24136
|
onRecordingChange: c,
|
|
24130
|
-
onText:
|
|
24131
|
-
onInterim:
|
|
24132
|
-
onAutoSubmit: (
|
|
24133
|
-
const ee =
|
|
24137
|
+
onText: Te,
|
|
24138
|
+
onInterim: Te,
|
|
24139
|
+
onAutoSubmit: (ge, Ie) => {
|
|
24140
|
+
const ee = Ie.trim() ? `${Ie.trimEnd()} ${ge}` : ge;
|
|
24134
24141
|
Ue(void 0, ee);
|
|
24135
24142
|
},
|
|
24136
|
-
onCancel: (
|
|
24143
|
+
onCancel: (ge) => Be(ge)
|
|
24137
24144
|
}
|
|
24138
24145
|
),
|
|
24139
|
-
|
|
24146
|
+
ze && Er(e) ? /* @__PURE__ */ s(
|
|
24140
24147
|
Ee,
|
|
24141
24148
|
{
|
|
24142
24149
|
size: "icon",
|
|
@@ -24796,28 +24803,28 @@ function u3({
|
|
|
24796
24803
|
if (Ug(oe.target)) return;
|
|
24797
24804
|
} else if (K4(oe.target))
|
|
24798
24805
|
return;
|
|
24799
|
-
const
|
|
24800
|
-
C.active = !0, C.decided = !1, C.horizontal = !1, C.x0 =
|
|
24806
|
+
const Be = oe.touches[0];
|
|
24807
|
+
C.active = !0, C.decided = !1, C.horizontal = !1, C.x0 = Be.clientX, C.y0 = Be.clientY, C.dx = 0;
|
|
24801
24808
|
}, ie = (oe) => {
|
|
24802
24809
|
if (!C.active) return;
|
|
24803
|
-
const Ce = oe.touches[0],
|
|
24810
|
+
const Ce = oe.touches[0], ze = Ce.clientX - C.x0, Be = Ce.clientY - C.y0;
|
|
24804
24811
|
if (!C.decided) {
|
|
24805
|
-
if (Math.abs(
|
|
24806
|
-
if (C.decided = !0, C.horizontal = Math.abs(
|
|
24812
|
+
if (Math.abs(ze) < 8 && Math.abs(Be) < 8) return;
|
|
24813
|
+
if (C.decided = !0, C.horizontal = Math.abs(ze) > Math.abs(Be), !C.horizontal) {
|
|
24807
24814
|
C.active = !1;
|
|
24808
24815
|
return;
|
|
24809
24816
|
}
|
|
24810
24817
|
}
|
|
24811
24818
|
if (!C.horizontal) return;
|
|
24812
|
-
oe.preventDefault(), C.dx =
|
|
24813
|
-
const
|
|
24814
|
-
R(
|
|
24819
|
+
oe.preventDefault(), C.dx = ze;
|
|
24820
|
+
const Te = ze > 0 ? !M : !L;
|
|
24821
|
+
R(ze * (Te ? 0.18 : 0.5));
|
|
24815
24822
|
}, ue = () => {
|
|
24816
24823
|
if (!C.active) return;
|
|
24817
24824
|
const { horizontal: oe, dx: Ce } = C;
|
|
24818
24825
|
if (C.active = !1, !oe) return;
|
|
24819
|
-
const
|
|
24820
|
-
|
|
24826
|
+
const ze = Ce > S ? M : Ce < -S ? L : null;
|
|
24827
|
+
ze ? G(ze) : Y();
|
|
24821
24828
|
};
|
|
24822
24829
|
return I.addEventListener("touchstart", se, { passive: !0 }), I.addEventListener("touchmove", ie, { passive: !1 }), I.addEventListener("touchend", ue, { passive: !0 }), I.addEventListener("touchcancel", ue, { passive: !0 }), () => {
|
|
24823
24830
|
I.removeEventListener("touchstart", se), I.removeEventListener("touchmove", ie), I.removeEventListener("touchend", ue), I.removeEventListener("touchcancel", ue);
|
|
@@ -24889,34 +24896,34 @@ function u3({
|
|
|
24889
24896
|
E.current = !0, wt("selection");
|
|
24890
24897
|
const ue = k.current, oe = T.current;
|
|
24891
24898
|
let Ce = !1;
|
|
24892
|
-
const
|
|
24899
|
+
const ze = () => {
|
|
24893
24900
|
Ce || (Ce = !0, g());
|
|
24894
24901
|
};
|
|
24895
|
-
I.getAnimations().forEach((
|
|
24896
|
-
const
|
|
24897
|
-
|
|
24902
|
+
I.getAnimations().forEach((Te) => Te.cancel()), I.style.transition = "transform 300ms cubic-bezier(0.32,0.72,0,1), opacity 220ms ease-out", I.style.transform = "translate3d(0, -105%, 0)", I.style.opacity = "0.92";
|
|
24903
|
+
const Be = (Te) => {
|
|
24904
|
+
Te.propertyName === "transform" && (I.removeEventListener("transitionend", Be), ze());
|
|
24898
24905
|
};
|
|
24899
|
-
I.addEventListener("transitionend",
|
|
24906
|
+
I.addEventListener("transitionend", Be), window.setTimeout(ze, 340), ue && (ue.style.transition = "opacity 240ms ease-out", ue.style.opacity = "0"), oe && (oe.style.transition = "transform 260ms cubic-bezier(0.32,0.72,0,1), opacity 180ms ease-out", oe.style.transform = "translate3d(0, -18px, 0)", oe.style.opacity = "0");
|
|
24900
24907
|
}, Y = (ue) => {
|
|
24901
24908
|
if (E.current || ue.touches.length !== 1 || !ue.target?.closest("form")) return;
|
|
24902
24909
|
const Ce = ue.touches[0];
|
|
24903
|
-
S.active = !0, S.decided = !1, S.dismissing = !1, S.x0 = Ce.clientX, S.y0 = Ce.clientY, S.y = 0, S.t0 = performance.now(), I.getAnimations().forEach((
|
|
24904
|
-
|
|
24910
|
+
S.active = !0, S.decided = !1, S.dismissing = !1, S.x0 = Ce.clientX, S.y0 = Ce.clientY, S.y = 0, S.t0 = performance.now(), I.getAnimations().forEach((ze) => {
|
|
24911
|
+
ze.playState !== "finished" && ze.cancel();
|
|
24905
24912
|
}), C(0);
|
|
24906
24913
|
}, se = (ue) => {
|
|
24907
24914
|
if (!S.active) return;
|
|
24908
|
-
const oe = ue.touches[0], Ce = oe.clientX - S.x0,
|
|
24915
|
+
const oe = ue.touches[0], Ce = oe.clientX - S.x0, ze = oe.clientY - S.y0;
|
|
24909
24916
|
if (!S.decided) {
|
|
24910
|
-
if (Math.abs(Ce) < 8 && Math.abs(
|
|
24911
|
-
if (S.decided = !0, S.dismissing =
|
|
24917
|
+
if (Math.abs(Ce) < 8 && Math.abs(ze) < 8) return;
|
|
24918
|
+
if (S.decided = !0, S.dismissing = ze < 0 && Math.abs(ze) > Math.abs(Ce) * 1.2, !S.dismissing) {
|
|
24912
24919
|
S.active = !1;
|
|
24913
24920
|
return;
|
|
24914
24921
|
}
|
|
24915
24922
|
}
|
|
24916
24923
|
if (!S.dismissing) return;
|
|
24917
|
-
ue.preventDefault(), S.y = -Math.min(Math.abs(
|
|
24918
|
-
const
|
|
24919
|
-
|
|
24924
|
+
ue.preventDefault(), S.y = -Math.min(Math.abs(ze), window.innerHeight * 0.6), C(S.y);
|
|
24925
|
+
const Be = k.current;
|
|
24926
|
+
Be && (Be.style.opacity = `${1 - Math.min(0.35, Math.abs(S.y) / 520)}`);
|
|
24920
24927
|
}, ie = () => {
|
|
24921
24928
|
if (!S.active) return;
|
|
24922
24929
|
S.active = !1;
|
|
@@ -25375,7 +25382,7 @@ const h3 = lr(function({
|
|
|
25375
25382
|
const Ne = window.setTimeout(() => W.classList.remove("lfg-card-focus-glow"), 2e3);
|
|
25376
25383
|
return () => window.clearTimeout(Ne);
|
|
25377
25384
|
}, [g]);
|
|
25378
|
-
const [S, C] = N(!1), R = U(null), [Y, se] = N(44), [ie, ue] = N(!1), [oe, Ce] = N(null), [
|
|
25385
|
+
const [S, C] = N(!1), R = U(null), [Y, se] = N(44), [ie, ue] = N(!1), [oe, Ce] = N(null), [ze, Be] = N(!1), Te = U({
|
|
25379
25386
|
startX: 0,
|
|
25380
25387
|
startY: 0,
|
|
25381
25388
|
x: 0,
|
|
@@ -25411,10 +25418,10 @@ const h3 = lr(function({
|
|
|
25411
25418
|
}
|
|
25412
25419
|
}
|
|
25413
25420
|
}
|
|
25414
|
-
async function
|
|
25421
|
+
async function ge() {
|
|
25415
25422
|
const W = I.current;
|
|
25416
25423
|
if (!G) {
|
|
25417
|
-
|
|
25424
|
+
Ie();
|
|
25418
25425
|
return;
|
|
25419
25426
|
}
|
|
25420
25427
|
if (!await w.confirm({
|
|
@@ -25423,12 +25430,12 @@ const h3 = lr(function({
|
|
|
25423
25430
|
confirmLabel: "Archive session",
|
|
25424
25431
|
destructive: !0
|
|
25425
25432
|
})) {
|
|
25426
|
-
|
|
25433
|
+
Ie();
|
|
25427
25434
|
return;
|
|
25428
25435
|
}
|
|
25429
25436
|
wt("warning"), ue(!1), Ze.current = "none", W && (W.style.transition = "transform 0.26s var(--ease-ios), opacity 0.26s", W.style.transform = `translateX(-${W.offsetWidth}px)`, W.style.opacity = "0"), window.setTimeout(() => void Qe(), 280);
|
|
25430
25437
|
}
|
|
25431
|
-
function
|
|
25438
|
+
function Ie() {
|
|
25432
25439
|
const W = I.current;
|
|
25433
25440
|
W && (W.style.transition = ""), ue(!1), Ce(null), Ze.current = "none", Ye(0);
|
|
25434
25441
|
}
|
|
@@ -25436,16 +25443,16 @@ const h3 = lr(function({
|
|
|
25436
25443
|
if (!k || W.touches.length !== 1 || W.target.closest("form")) return;
|
|
25437
25444
|
const Ne = I.current;
|
|
25438
25445
|
if (!Ne) return;
|
|
25439
|
-
const re = W.touches[0], ye =
|
|
25446
|
+
const re = W.touches[0], ye = Te.current;
|
|
25440
25447
|
ye.startX = re.clientX, ye.startY = re.clientY, ye.w = Ne.offsetWidth, ye.dragging = !0, ye.decided = !1, ye.horizontal = !1, ye.justSwiped = !1, Ne.style.transition = "none";
|
|
25441
25448
|
}, me = (W) => {
|
|
25442
|
-
const Ne =
|
|
25449
|
+
const Ne = Te.current;
|
|
25443
25450
|
if (!Ne.dragging) return;
|
|
25444
25451
|
const re = W.touches[0], ye = re.clientX - Ne.startX, V = re.clientY - Ne.startY;
|
|
25445
25452
|
if (!Ne.decided) {
|
|
25446
25453
|
if (Math.abs(ye) < 8 && Math.abs(V) < 8) return;
|
|
25447
25454
|
if (Ne.decided = !0, Ne.horizontal = Math.abs(ye) > Math.abs(V), Ne.horizontal)
|
|
25448
|
-
|
|
25455
|
+
Be(!0);
|
|
25449
25456
|
else {
|
|
25450
25457
|
Ne.dragging = !1;
|
|
25451
25458
|
return;
|
|
@@ -25457,36 +25464,36 @@ const h3 = lr(function({
|
|
|
25457
25464
|
return;
|
|
25458
25465
|
}
|
|
25459
25466
|
}, be = () => {
|
|
25460
|
-
const W =
|
|
25467
|
+
const W = Te.current;
|
|
25461
25468
|
if (!W.dragging) return;
|
|
25462
25469
|
W.dragging = !1, Ce(null);
|
|
25463
25470
|
const Ne = I.current;
|
|
25464
25471
|
if (Ne && (Ne.style.transition = ""), !W.decided) {
|
|
25465
|
-
|
|
25472
|
+
Be(!1);
|
|
25466
25473
|
return;
|
|
25467
25474
|
}
|
|
25468
25475
|
if (W.horizontal) {
|
|
25469
|
-
if (
|
|
25470
|
-
|
|
25476
|
+
if (Be(!1), W.justSwiped = Math.abs(W.x) > 6, W.x <= -W.w * Ue) {
|
|
25477
|
+
ge();
|
|
25471
25478
|
return;
|
|
25472
25479
|
}
|
|
25473
25480
|
const re = W.x <= -116 * 0.5 ? "archive" : "none";
|
|
25474
25481
|
re !== "none" && Ze.current === "none" && wt("selection"), Ze.current = re, ue(re === "archive"), Ye(re === "archive" ? -116 : 0);
|
|
25475
25482
|
return;
|
|
25476
25483
|
}
|
|
25477
|
-
},
|
|
25484
|
+
}, _e = (W) => {
|
|
25478
25485
|
if (k) {
|
|
25479
|
-
if (
|
|
25480
|
-
|
|
25486
|
+
if (Te.current.justSwiped) {
|
|
25487
|
+
Te.current.justSwiped = !1;
|
|
25481
25488
|
return;
|
|
25482
25489
|
}
|
|
25483
25490
|
if (Ze.current !== "none") {
|
|
25484
|
-
|
|
25491
|
+
Ie();
|
|
25485
25492
|
return;
|
|
25486
25493
|
}
|
|
25487
25494
|
!d || !G || (wt("selection"), d(G, W.currentTarget.getBoundingClientRect()));
|
|
25488
25495
|
}
|
|
25489
|
-
},
|
|
25496
|
+
}, Fe = k;
|
|
25490
25497
|
return /* @__PURE__ */ m("div", { className: $("relative min-w-0 md:static", f === "stage" && "md:h-full"), children: [
|
|
25491
25498
|
/* @__PURE__ */ m(
|
|
25492
25499
|
"button",
|
|
@@ -25494,7 +25501,7 @@ const h3 = lr(function({
|
|
|
25494
25501
|
type: "button",
|
|
25495
25502
|
"aria-label": "Archive session",
|
|
25496
25503
|
tabIndex: ie ? 0 : -1,
|
|
25497
|
-
onClick: () => void
|
|
25504
|
+
onClick: () => void ge(),
|
|
25498
25505
|
className: $(
|
|
25499
25506
|
"absolute inset-0 flex items-center justify-end gap-2 rounded-xl bg-destructive pr-6 text-sm font-semibold text-white md:hidden",
|
|
25500
25507
|
ie || oe === "archive" ? "" : "hidden",
|
|
@@ -25544,7 +25551,7 @@ const h3 = lr(function({
|
|
|
25544
25551
|
"button",
|
|
25545
25552
|
{
|
|
25546
25553
|
type: "button",
|
|
25547
|
-
onClick:
|
|
25554
|
+
onClick: _e,
|
|
25548
25555
|
onDoubleClick: (W) => {
|
|
25549
25556
|
k || t.shippedReview || (W.preventDefault(), W.stopPropagation(), X());
|
|
25550
25557
|
},
|
|
@@ -25583,7 +25590,7 @@ const h3 = lr(function({
|
|
|
25583
25590
|
children: /* @__PURE__ */ s(xr, { className: "size-3.5", fill: "currentColor" })
|
|
25584
25591
|
}
|
|
25585
25592
|
) : null,
|
|
25586
|
-
!
|
|
25593
|
+
!Fe && M && L ? /* @__PURE__ */ s(
|
|
25587
25594
|
zc,
|
|
25588
25595
|
{
|
|
25589
25596
|
bot: M,
|
|
@@ -25593,8 +25600,8 @@ const h3 = lr(function({
|
|
|
25593
25600
|
onRefresh: l
|
|
25594
25601
|
}
|
|
25595
25602
|
) : null,
|
|
25596
|
-
!
|
|
25597
|
-
!
|
|
25603
|
+
!Fe && !M && t.botId && t.botName ? /* @__PURE__ */ s(yT, { session: t }) : null,
|
|
25604
|
+
!Fe && !M && ((t.agent === "claude" || t.agent === "opencode") && (t.tmuxTarget || t.agent === "opencode") && G ? /* @__PURE__ */ m(Rr, { children: [
|
|
25598
25605
|
/* @__PURE__ */ s(
|
|
25599
25606
|
Lr,
|
|
25600
25607
|
{
|
|
@@ -25643,7 +25650,7 @@ const h3 = lr(function({
|
|
|
25643
25650
|
}
|
|
25644
25651
|
)
|
|
25645
25652
|
),
|
|
25646
|
-
!
|
|
25653
|
+
!Fe && !M && /* @__PURE__ */ s(
|
|
25647
25654
|
t0,
|
|
25648
25655
|
{
|
|
25649
25656
|
session: t,
|
|
@@ -25670,7 +25677,7 @@ const h3 = lr(function({
|
|
|
25670
25677
|
]
|
|
25671
25678
|
}
|
|
25672
25679
|
),
|
|
25673
|
-
!
|
|
25680
|
+
!Fe && /* @__PURE__ */ s(
|
|
25674
25681
|
Hd,
|
|
25675
25682
|
{
|
|
25676
25683
|
session: t,
|
|
@@ -25785,10 +25792,10 @@ const h3 = lr(function({
|
|
|
25785
25792
|
for (const de of le.querySelectorAll("[data-index]"))
|
|
25786
25793
|
ie.measureElement(de);
|
|
25787
25794
|
}, [S.version, R, ie]);
|
|
25788
|
-
const oe = ie.getVirtualItems(), Ce = ie.getTotalSize(),
|
|
25795
|
+
const oe = ie.getVirtualItems(), Ce = ie.getTotalSize(), ze = je(() => {
|
|
25789
25796
|
const le = /* @__PURE__ */ new Map();
|
|
25790
25797
|
return L.forEach((de, Pe) => le.set(de.key, Pe)), le;
|
|
25791
|
-
}, [L]),
|
|
25798
|
+
}, [L]), Be = je(() => jv(L), [L]), Te = te(
|
|
25792
25799
|
(le) => {
|
|
25793
25800
|
const de = ie.getVirtualItemForOffset(le.scrollTop);
|
|
25794
25801
|
de && (E.current = { key: String(de.key), offset: le.scrollTop - de.start });
|
|
@@ -25806,54 +25813,54 @@ const h3 = lr(function({
|
|
|
25806
25813
|
for (const de of M)
|
|
25807
25814
|
!de.id || !pm(de) || Ze.current.has(de.id) || (Ze.current.add(de.id), r && Ue.current.set(de.id, le + 500));
|
|
25808
25815
|
}
|
|
25809
|
-
const Qe = U(!1),
|
|
25810
|
-
|
|
25816
|
+
const Qe = U(!1), ge = U(null), Ie = U(uf()), ee = U(null), me = U(f), be = U(!0), _e = te(() => {
|
|
25817
|
+
ge.current != null && (cancelAnimationFrame(ge.current), ge.current = null), Ie.current = uf(), Qe.current = !1;
|
|
25811
25818
|
}, []);
|
|
25812
|
-
K(() =>
|
|
25813
|
-
const
|
|
25814
|
-
B.current = !0,
|
|
25815
|
-
}, [
|
|
25819
|
+
K(() => _e, [_e]);
|
|
25820
|
+
const Fe = te(() => {
|
|
25821
|
+
B.current = !0, _e();
|
|
25822
|
+
}, [_e]), W = te(
|
|
25816
25823
|
(le) => {
|
|
25817
|
-
|
|
25824
|
+
_e(), Qe.current = !0;
|
|
25818
25825
|
const de = (Pe) => {
|
|
25819
25826
|
const Se = le.scrollHeight - le.clientHeight, ot = Se - le.scrollTop;
|
|
25820
25827
|
if (Math.abs(ot) < 1) {
|
|
25821
|
-
le.scrollTop = Se, O.current = le.scrollTop, B.current = !1,
|
|
25828
|
+
le.scrollTop = Se, O.current = le.scrollTop, B.current = !1, _e();
|
|
25822
25829
|
return;
|
|
25823
25830
|
}
|
|
25824
|
-
const bt = Zk(
|
|
25825
|
-
|
|
25831
|
+
const bt = Zk(Ie.current, ot, Pe);
|
|
25832
|
+
Ie.current = bt.state;
|
|
25826
25833
|
const jt = le.scrollTop;
|
|
25827
|
-
le.scrollTop += bt.offsetPx,
|
|
25828
|
-
|
|
25834
|
+
le.scrollTop += bt.offsetPx, Ie.current = eS(
|
|
25835
|
+
Ie.current,
|
|
25829
25836
|
le.scrollTop !== jt
|
|
25830
|
-
), O.current = le.scrollTop, B.current = !1,
|
|
25837
|
+
), O.current = le.scrollTop, B.current = !1, ge.current = requestAnimationFrame(de);
|
|
25831
25838
|
};
|
|
25832
|
-
|
|
25839
|
+
ge.current = requestAnimationFrame(de);
|
|
25833
25840
|
},
|
|
25834
|
-
[
|
|
25835
|
-
), [Ne, re] = N(!1), [ye, V] = N(""), [ne,
|
|
25841
|
+
[_e]
|
|
25842
|
+
), [Ne, re] = N(!1), [ye, V] = N(""), [ne, pe] = N([]), [xe, Oe] = N([]), [Le, Re] = N(0), [Xe, $e] = N(!1), [we, he] = N(0), [Me, tt] = N(null), [Ot, At] = N(null), [Tt, Ke] = N(null), [pt, ht] = N(null), Et = U(null), Ht = U(null), xt = U(!1), at = U(0), It = te(
|
|
25836
25843
|
(le, de) => {
|
|
25837
25844
|
const Pe = u.current, Se = ie.measurementsCache[le];
|
|
25838
25845
|
if (!Pe || !Se) return;
|
|
25839
|
-
|
|
25846
|
+
_e(), h(!1);
|
|
25840
25847
|
const ot = Se.start - Math.round(Pe.clientHeight * y3), bt = Math.max(0, Math.min(ot, Pe.scrollHeight - Pe.clientHeight));
|
|
25841
25848
|
Pe.scrollTop = bt, O.current = Pe.scrollTop, B.current = !1, E.current = { key: L[le]?.key ?? "", offset: bt - Se.start }, Ke(de);
|
|
25842
25849
|
},
|
|
25843
|
-
[L,
|
|
25850
|
+
[L, _e, ie]
|
|
25844
25851
|
), Nt = te(
|
|
25845
25852
|
(le) => {
|
|
25846
25853
|
const de = ne[le];
|
|
25847
25854
|
if (!de) return;
|
|
25848
25855
|
at.current += 1, xt.current = !1, he(le), At(null);
|
|
25849
|
-
const Pe =
|
|
25856
|
+
const Pe = Be.get(de.messageId);
|
|
25850
25857
|
if (Pe != null) {
|
|
25851
25858
|
ht(null), It(Pe, de.messageId);
|
|
25852
25859
|
return;
|
|
25853
25860
|
}
|
|
25854
25861
|
Ke(null), ht({ messageId: de.messageId, pages: 0 });
|
|
25855
25862
|
},
|
|
25856
|
-
[ne,
|
|
25863
|
+
[ne, Be, It]
|
|
25857
25864
|
), fe = te(
|
|
25858
25865
|
(le) => {
|
|
25859
25866
|
if (!ne.length) return;
|
|
@@ -25864,7 +25871,7 @@ const h3 = lr(function({
|
|
|
25864
25871
|
);
|
|
25865
25872
|
K(() => {
|
|
25866
25873
|
if (!pt) return;
|
|
25867
|
-
const le =
|
|
25874
|
+
const le = Be.get(pt.messageId);
|
|
25868
25875
|
if (le != null) {
|
|
25869
25876
|
ht(null), tt(null), It(le, pt.messageId);
|
|
25870
25877
|
return;
|
|
@@ -25889,7 +25896,7 @@ const h3 = lr(function({
|
|
|
25889
25896
|
});
|
|
25890
25897
|
}, [
|
|
25891
25898
|
pt,
|
|
25892
|
-
|
|
25899
|
+
Be,
|
|
25893
25900
|
x,
|
|
25894
25901
|
It,
|
|
25895
25902
|
v,
|
|
@@ -25899,7 +25906,7 @@ const h3 = lr(function({
|
|
|
25899
25906
|
if (!Ne || !t) return;
|
|
25900
25907
|
const le = ye.trim();
|
|
25901
25908
|
if (!le) {
|
|
25902
|
-
|
|
25909
|
+
pe([]), Oe([]), Re(0), $e(!1), he(0), Ke(null), ht(null), At(null), tt(null);
|
|
25903
25910
|
return;
|
|
25904
25911
|
}
|
|
25905
25912
|
let de = !1;
|
|
@@ -25915,7 +25922,7 @@ const h3 = lr(function({
|
|
|
25915
25922
|
).then((Se) => {
|
|
25916
25923
|
if (de) return;
|
|
25917
25924
|
const ot = Array.isArray(Se.results) ? Se.results : [];
|
|
25918
|
-
|
|
25925
|
+
pe(ot), Oe(Wv(le)), Re(Se.matchTotal ?? ot.length), $e(!!Se.truncated), he(Math.max(0, ot.length - 1)), Ke(null), ht(null), tt(null), At(ot.length ? null : "No matches.");
|
|
25919
25926
|
}).catch((Se) => {
|
|
25920
25927
|
de || (tt(null), At(
|
|
25921
25928
|
Se instanceof Error ? Se.message : String(Se)
|
|
@@ -25928,23 +25935,23 @@ const h3 = lr(function({
|
|
|
25928
25935
|
}, [Ne, ye, t]);
|
|
25929
25936
|
const on = te(() => {
|
|
25930
25937
|
const le = u.current;
|
|
25931
|
-
le && (
|
|
25938
|
+
le && (Te(le), Ht.current = {
|
|
25932
25939
|
anchor: E.current ? { ...E.current } : null,
|
|
25933
25940
|
top: le.scrollTop,
|
|
25934
25941
|
stick: f
|
|
25935
25942
|
}), re(!0), requestAnimationFrame(() => Et.current?.focus());
|
|
25936
|
-
}, [
|
|
25937
|
-
at.current += 1, re(!1), ht(null), Ke(null), tt(null), At(null),
|
|
25943
|
+
}, [Te, f]), Rt = te(() => {
|
|
25944
|
+
at.current += 1, re(!1), ht(null), Ke(null), tt(null), At(null), Oe([]), ci();
|
|
25938
25945
|
const le = u.current, de = Ht.current;
|
|
25939
25946
|
if (Ht.current = null, !le || !de) return;
|
|
25940
|
-
if (
|
|
25947
|
+
if (_e(), de.stick) {
|
|
25941
25948
|
h(!0);
|
|
25942
25949
|
return;
|
|
25943
25950
|
}
|
|
25944
25951
|
h(!1);
|
|
25945
|
-
const Pe = de.anchor ?
|
|
25952
|
+
const Pe = de.anchor ? ze.get(de.anchor.key) : void 0, Se = Pe == null ? void 0 : ie.measurementsCache[Pe]?.start, ot = Se != null && de.anchor ? Se + de.anchor.offset : de.top;
|
|
25946
25953
|
le.scrollTop = Math.max(0, Math.min(ot, le.scrollHeight - le.clientHeight)), O.current = le.scrollTop, B.current = !1, E.current = de.anchor ? { ...de.anchor } : null;
|
|
25947
|
-
}, [
|
|
25954
|
+
}, [ze, _e, ie]), an = te(
|
|
25948
25955
|
(le) => {
|
|
25949
25956
|
if (le.key === "Escape") {
|
|
25950
25957
|
le.preventDefault(), Rt();
|
|
@@ -25955,9 +25962,9 @@ const h3 = lr(function({
|
|
|
25955
25962
|
[Rt, fe]
|
|
25956
25963
|
);
|
|
25957
25964
|
K(() => {
|
|
25958
|
-
at.current += 1, xt.current = !1, Ht.current = null, re(!1), V(""),
|
|
25965
|
+
at.current += 1, xt.current = !1, Ht.current = null, re(!1), V(""), pe([]), Oe([]), Re(0), $e(!1), he(0), Ke(null), ht(null), tt(null), At(null), ci();
|
|
25959
25966
|
}, [t]);
|
|
25960
|
-
const qt = Tt ?
|
|
25967
|
+
const qt = Tt ? Be.get(Tt) ?? null : null, Yn = oe.length ? `${oe[0].index}:${oe.length}` : "";
|
|
25961
25968
|
K(() => {
|
|
25962
25969
|
if (!Ne || qt == null || !xe.length) {
|
|
25963
25970
|
ci();
|
|
@@ -25968,18 +25975,18 @@ const h3 = lr(function({
|
|
|
25968
25975
|
xe
|
|
25969
25976
|
);
|
|
25970
25977
|
}, [Ne, qt, xe, Yn]), K(() => ci, []), Bt(() => {
|
|
25971
|
-
h(!0), me.current = !0, w(!0), T.current = null, E.current = null, B.current = !1, q.current = Number.NEGATIVE_INFINITY, C.current.clear(), ee.current = null, be.current = !0,
|
|
25972
|
-
}, [t,
|
|
25978
|
+
h(!0), me.current = !0, w(!0), T.current = null, E.current = null, B.current = !1, q.current = Number.NEGATIVE_INFINITY, C.current.clear(), ee.current = null, be.current = !0, _e(), O.current = 0;
|
|
25979
|
+
}, [t, _e]), Bt(() => {
|
|
25973
25980
|
if (o || p === t) return;
|
|
25974
25981
|
const le = requestAnimationFrame(() => {
|
|
25975
25982
|
const de = u.current;
|
|
25976
25983
|
if (!de) return;
|
|
25977
|
-
|
|
25984
|
+
_e();
|
|
25978
25985
|
const Pe = Math.max(0, de.scrollHeight - de.clientHeight);
|
|
25979
25986
|
de.scrollTop = Pe, O.current = de.scrollTop, B.current = !1, g(t);
|
|
25980
25987
|
});
|
|
25981
25988
|
return () => cancelAnimationFrame(le);
|
|
25982
|
-
}, [o, p, t,
|
|
25989
|
+
}, [o, p, t, _e]);
|
|
25983
25990
|
const Mn = te(() => {
|
|
25984
25991
|
h(!0);
|
|
25985
25992
|
}, []);
|
|
@@ -25993,21 +26000,21 @@ const h3 = lr(function({
|
|
|
25993
26000
|
ee.current = de, me.current = f;
|
|
25994
26001
|
const gn = le.scrollHeight - le.clientHeight;
|
|
25995
26002
|
if (ot) {
|
|
25996
|
-
|
|
26003
|
+
_e(), Math.abs(le.scrollTop - gn) > 0.5 && (le.scrollTop = gn), O.current = le.scrollTop, B.current = !1;
|
|
25997
26004
|
return;
|
|
25998
26005
|
}
|
|
25999
26006
|
if (be.current = !1, Math.abs(le.scrollTop - gn) <= 0.5) {
|
|
26000
|
-
|
|
26007
|
+
_e();
|
|
26001
26008
|
return;
|
|
26002
26009
|
}
|
|
26003
26010
|
const Rn = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1, vn = Jk({
|
|
26004
26011
|
discrete: zt,
|
|
26005
26012
|
reengaged: bt,
|
|
26006
26013
|
reducedMotion: Rn,
|
|
26007
|
-
running:
|
|
26014
|
+
running: ge.current != null
|
|
26008
26015
|
});
|
|
26009
|
-
vn === "start" ? W(le) : vn === "snap" && (
|
|
26010
|
-
}, [M, r, f, L.length, H, Ce, p, t, W,
|
|
26016
|
+
vn === "start" ? W(le) : vn === "snap" && (_e(), le.scrollTop = gn, O.current = le.scrollTop, B.current = !1);
|
|
26017
|
+
}, [M, r, f, L.length, H, Ce, p, t, W, _e]), Bt(() => {
|
|
26011
26018
|
const le = _.current, de = le ? le.offsetTop : 0;
|
|
26012
26019
|
I((Pe) => Pe === de ? Pe : de);
|
|
26013
26020
|
}, [v, L.length > 0, r]), Bt(() => {
|
|
@@ -26027,15 +26034,15 @@ const h3 = lr(function({
|
|
|
26027
26034
|
msSinceUserScroll: performance.now() - q.current
|
|
26028
26035
|
}))
|
|
26029
26036
|
return;
|
|
26030
|
-
const ot =
|
|
26037
|
+
const ot = ze.get(Se.anchorKey), bt = ot == null ? void 0 : ie.measurementsCache[ot]?.start, jt = bt == null ? de ? le.scrollHeight - Se.height + Se.top : null : bt + Se.anchorOffset;
|
|
26031
26038
|
if (jt == null) return;
|
|
26032
26039
|
const zt = Math.max(0, Math.min(jt, le.scrollHeight - le.clientHeight));
|
|
26033
26040
|
Math.abs(zt - le.scrollTop) > 0.5 && (le.scrollTop = zt), O.current = le.scrollTop, B.current = !1, E.current = { key: Se.anchorKey, offset: Se.anchorOffset };
|
|
26034
|
-
}, [M, Ce, f,
|
|
26041
|
+
}, [M, Ce, f, ze, ie]);
|
|
26035
26042
|
const An = te(async (le) => {
|
|
26036
26043
|
const de = u.current;
|
|
26037
26044
|
if (!(!t || !de || v || !x)) {
|
|
26038
|
-
le !== "backfill" && (
|
|
26045
|
+
le !== "backfill" && (Te(de), T.current = {
|
|
26039
26046
|
anchorKey: E.current?.key ?? "",
|
|
26040
26047
|
anchorOffset: E.current?.offset ?? 0,
|
|
26041
26048
|
top: de.scrollTop,
|
|
@@ -26050,7 +26057,7 @@ const h3 = lr(function({
|
|
|
26050
26057
|
y(!1);
|
|
26051
26058
|
}
|
|
26052
26059
|
}
|
|
26053
|
-
}, [t, v, x, i,
|
|
26060
|
+
}, [t, v, x, i, Te]), Jn = U(-1);
|
|
26054
26061
|
return K(() => {
|
|
26055
26062
|
Jn.current = -1;
|
|
26056
26063
|
}, [t]), K(() => {
|
|
@@ -26063,11 +26070,11 @@ const h3 = lr(function({
|
|
|
26063
26070
|
{
|
|
26064
26071
|
ref: u,
|
|
26065
26072
|
"data-session-ready": p === t ? "true" : "false",
|
|
26066
|
-
onWheel:
|
|
26067
|
-
onTouchStart:
|
|
26068
|
-
onPointerDown:
|
|
26073
|
+
onWheel: Fe,
|
|
26074
|
+
onTouchStart: Fe,
|
|
26075
|
+
onPointerDown: Fe,
|
|
26069
26076
|
onKeyDown: (le) => {
|
|
26070
|
-
v3.has(le.key) &&
|
|
26077
|
+
v3.has(le.key) && Fe();
|
|
26071
26078
|
},
|
|
26072
26079
|
onScroll: (le) => {
|
|
26073
26080
|
const de = le.currentTarget, Pe = O.current;
|
|
@@ -26079,7 +26086,7 @@ const h3 = lr(function({
|
|
|
26079
26086
|
previousScrollTop: Pe,
|
|
26080
26087
|
userDriven: B.current
|
|
26081
26088
|
}) === "pinned"
|
|
26082
|
-
),
|
|
26089
|
+
), Te(de));
|
|
26083
26090
|
const Se = Ju(de);
|
|
26084
26091
|
Se !== "none" && An(Se);
|
|
26085
26092
|
},
|
|
@@ -26192,7 +26199,7 @@ const h3 = lr(function({
|
|
|
26192
26199
|
{
|
|
26193
26200
|
"aria-live": "polite",
|
|
26194
26201
|
className: "shrink-0 whitespace-nowrap text-[11px] tabular-nums text-muted-foreground",
|
|
26195
|
-
children: ne.length ? `${we + 1}/${ne.length}${Xe ? ` of ${
|
|
26202
|
+
children: ne.length ? `${we + 1}/${ne.length}${Xe ? ` of ${Le}` : ""}` : ""
|
|
26196
26203
|
}
|
|
26197
26204
|
),
|
|
26198
26205
|
/* @__PURE__ */ s(
|
|
@@ -27642,23 +27649,23 @@ function Sm({
|
|
|
27642
27649
|
() => lc("new-session")?.text ?? ""
|
|
27643
27650
|
), z = U(H);
|
|
27644
27651
|
z.current = H;
|
|
27645
|
-
const [I, S] = N(0), [C, R] = N(!1), [Y, se] = N([]), [ie, ue] = N(0), [oe, Ce] = N(null),
|
|
27652
|
+
const [I, S] = N(0), [C, R] = N(!1), [Y, se] = N([]), [ie, ue] = N(0), [oe, Ce] = N(null), ze = zd({
|
|
27646
27653
|
endpoint: (P) => `/api/uploads?filename=${encodeURIComponent(P.name)}`,
|
|
27647
27654
|
onPatchExtra: (P, qe) => se(
|
|
27648
27655
|
(Ge) => Ge.map((et) => et.id === P ? { ...et, ...qe } : et)
|
|
27649
27656
|
)
|
|
27650
27657
|
}), {
|
|
27651
|
-
attachments:
|
|
27652
|
-
setAttachments:
|
|
27658
|
+
attachments: Be,
|
|
27659
|
+
setAttachments: Te,
|
|
27653
27660
|
draggingFiles: Ze,
|
|
27654
27661
|
removeAttachment: Ue,
|
|
27655
27662
|
setAnnotatingId: Ye,
|
|
27656
27663
|
previewUrls: Qe,
|
|
27657
|
-
resolveUpload:
|
|
27658
|
-
forgetUpload:
|
|
27659
|
-
} =
|
|
27660
|
-
}), [Xe,
|
|
27661
|
-
|
|
27664
|
+
resolveUpload: ge,
|
|
27665
|
+
forgetUpload: Ie
|
|
27666
|
+
} = ze, [ee, me] = N(!1), [be, _e] = N(null), [Fe, W] = N(!1), [Ne, re] = N(!1), [ye, V] = N(!1), [ne, pe] = N(!1), [xe, Oe] = N(!1), Le = U(null), Re = U(() => {
|
|
27667
|
+
}), [Xe, $e] = N(1), [we, he] = N(0), Me = te((P) => {
|
|
27668
|
+
Oe(P);
|
|
27662
27669
|
}, []), tt = te(
|
|
27663
27670
|
(P) => {
|
|
27664
27671
|
!P && xe || W(P);
|
|
@@ -27666,7 +27673,7 @@ function Sm({
|
|
|
27666
27673
|
[xe]
|
|
27667
27674
|
);
|
|
27668
27675
|
K(() => {
|
|
27669
|
-
const P =
|
|
27676
|
+
const P = Le.current;
|
|
27670
27677
|
if (!P) return;
|
|
27671
27678
|
const qe = 22, Ge = 40;
|
|
27672
27679
|
let et = null;
|
|
@@ -27679,7 +27686,7 @@ function Sm({
|
|
|
27679
27686
|
const it = We.clientY - et.y, ut = We.clientX - et.x;
|
|
27680
27687
|
if (!et.dragged && Math.abs(it) >= qe && Math.abs(it) > Math.abs(ut) && (et.dragged = !0), et.dragged) {
|
|
27681
27688
|
const nt = We.clientY - et.lastStepY;
|
|
27682
|
-
Math.abs(nt) >= qe && (et.lastStepY = We.clientY,
|
|
27689
|
+
Math.abs(nt) >= qe && (et.lastStepY = We.clientY, Re.current(nt < 0 ? 1 : -1));
|
|
27683
27690
|
}
|
|
27684
27691
|
}, Mt = (We) => {
|
|
27685
27692
|
if (et && We.pointerId !== et.pointerId) return;
|
|
@@ -27701,7 +27708,7 @@ function Sm({
|
|
|
27701
27708
|
const it = We.timeStamp;
|
|
27702
27709
|
if (it - Xt > 250 && ($t = 0), Xt = it, $t += We.deltaY, Math.abs($t) >= Ge) {
|
|
27703
27710
|
const ut = $t < 0 ? 1 : -1;
|
|
27704
|
-
$t = 0,
|
|
27711
|
+
$t = 0, Re.current(ut);
|
|
27705
27712
|
}
|
|
27706
27713
|
};
|
|
27707
27714
|
return P.addEventListener("mousedown", kt), P.addEventListener("click", lt), P.addEventListener("pointerdown", dt), P.addEventListener("wheel", st, { passive: !1 }), () => {
|
|
@@ -27709,7 +27716,7 @@ function Sm({
|
|
|
27709
27716
|
};
|
|
27710
27717
|
}, [e, f]);
|
|
27711
27718
|
const Ot = te(() => {
|
|
27712
|
-
me(!1),
|
|
27719
|
+
me(!1), _e(null);
|
|
27713
27720
|
}, []), At = U(null), Tt = U(null), Ke = U(null);
|
|
27714
27721
|
K(() => {
|
|
27715
27722
|
f !== "inline" || !g || At.current?.querySelector("textarea")?.focus();
|
|
@@ -27783,7 +27790,7 @@ function Sm({
|
|
|
27783
27790
|
P.removeEventListener("touchstart", Xt), P.removeEventListener("touchmove", st), P.removeEventListener("touchend", We), P.removeEventListener("touchcancel", We), pt.current || (P.style.transition = "", P.style.transform = "", P.style.opacity = "");
|
|
27784
27791
|
};
|
|
27785
27792
|
}, [f, !d]), K(() => {
|
|
27786
|
-
!ee || be || ve("/api/sessions/resumable?limit=20").then((P) =>
|
|
27793
|
+
!ee || be || ve("/api/sessions/resumable?limit=20").then((P) => _e(Array.isArray(P.sessions) ? P.sessions : [])).catch(() => _e([]));
|
|
27787
27794
|
}, [ee, be]);
|
|
27788
27795
|
function Et(P) {
|
|
27789
27796
|
const qe = H.trim(), Ge = cc({
|
|
@@ -27859,7 +27866,7 @@ function Sm({
|
|
|
27859
27866
|
W(!1), V(!0);
|
|
27860
27867
|
}
|
|
27861
27868
|
function Mn(P) {
|
|
27862
|
-
V(!1),
|
|
27869
|
+
V(!1), pe(P), window.setTimeout(() => re(!0), 180);
|
|
27863
27870
|
}
|
|
27864
27871
|
function An(P) {
|
|
27865
27872
|
j(P.cwd), localStorage.setItem("lfg_v2_repo", P.cwd), a && a(sr(P)), V(!1);
|
|
@@ -27895,7 +27902,7 @@ function Sm({
|
|
|
27895
27902
|
}, [y]), !e && !ee) return null;
|
|
27896
27903
|
function zt(P, qe, Ge) {
|
|
27897
27904
|
if (P?.preventDefault(), Rt) return;
|
|
27898
|
-
const et = (qe ?? H).trim(), kt =
|
|
27905
|
+
const et = (qe ?? H).trim(), kt = Be;
|
|
27899
27906
|
if (!et && !kt.length) return;
|
|
27900
27907
|
if (!de.some((We) => We.key === T)) {
|
|
27901
27908
|
const We = "Set up and sign in to a coding agent before starting a session.";
|
|
@@ -27908,7 +27915,7 @@ function Sm({
|
|
|
27908
27915
|
text: et,
|
|
27909
27916
|
project: an
|
|
27910
27917
|
}), st = new Set(kt.map((We) => We.id));
|
|
27911
|
-
Ce(null), ke.dismiss(Lg("create")), _(""),
|
|
27918
|
+
Ce(null), ke.dismiss(Lg("create")), _(""), Te([]), se((We) => [
|
|
27912
27919
|
...We,
|
|
27913
27920
|
...kt.map(
|
|
27914
27921
|
(it) => it.status === "ready" ? { ...it, status: "uploading", progress: 0, error: void 0 } : it
|
|
@@ -27935,7 +27942,7 @@ function Sm({
|
|
|
27935
27942
|
), nr(Xt?.id, "sent"), await c({ launchId: nt, sessionId: nt, session: ut?.session ?? null });
|
|
27936
27943
|
};
|
|
27937
27944
|
try {
|
|
27938
|
-
const ut = kt.length ? await Promise.all(kt.map(
|
|
27945
|
+
const ut = kt.length ? await Promise.all(kt.map(ge)) : [], nt = ca(et, ut);
|
|
27939
27946
|
let Ft;
|
|
27940
27947
|
try {
|
|
27941
27948
|
Ft = await We(nt, !1);
|
|
@@ -27966,12 +27973,12 @@ function Sm({
|
|
|
27966
27973
|
kt.map((nt) => nt.previewUrl).filter((nt) => !!nt)
|
|
27967
27974
|
);
|
|
27968
27975
|
Qe.current = Qe.current.filter((nt) => !ut.has(nt)), se((nt) => nt.filter((Ft) => !st.has(Ft.id)));
|
|
27969
|
-
for (const nt of st)
|
|
27976
|
+
for (const nt of st) Ie(nt);
|
|
27970
27977
|
ue((nt) => Math.max(0, nt - 1));
|
|
27971
27978
|
}
|
|
27972
27979
|
})();
|
|
27973
27980
|
}
|
|
27974
|
-
const gn = f === "inline" && !h, Rn = !!fe && de.some((P) => P.key === T) && (!!H.trim() ||
|
|
27981
|
+
const gn = f === "inline" && !h, Rn = !!fe && de.some((P) => P.key === T) && (!!H.trim() || Be.length > 0), vn = uA(
|
|
27975
27982
|
Gn,
|
|
27976
27983
|
de,
|
|
27977
27984
|
T,
|
|
@@ -27980,9 +27987,9 @@ function Sm({
|
|
|
27980
27987
|
const qe = de;
|
|
27981
27988
|
if (qe.length < 2) return;
|
|
27982
27989
|
const Ge = qe.findIndex((St) => (St.selectorId ?? St.key) === bt), et = ((Ge < 0 ? 0 : Ge) + P + qe.length) % qe.length, kt = qe[et], lt = kt.key;
|
|
27983
|
-
(kt.selectorId ?? lt) !== bt && (
|
|
27990
|
+
(kt.selectorId ?? lt) !== bt && ($e(P), he((St) => St + 1), E(lt), lt === "aisdk" && B(kt.accountId ?? ""), L(localStorage.getItem(`lfg_model_${lt}`) || k(lt)), Sn.swipe());
|
|
27984
27991
|
};
|
|
27985
|
-
|
|
27992
|
+
Re.current = Zs;
|
|
27986
27993
|
const ms = /* @__PURE__ */ s(
|
|
27987
27994
|
Rd,
|
|
27988
27995
|
{
|
|
@@ -28052,14 +28059,14 @@ function Sm({
|
|
|
28052
28059
|
className: "flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-sm transition hover:text-foreground",
|
|
28053
28060
|
children: /* @__PURE__ */ s(Do, { className: "size-4" })
|
|
28054
28061
|
}
|
|
28055
|
-
), Q = /* @__PURE__ */ m(Rr, { open:
|
|
28062
|
+
), Q = /* @__PURE__ */ m(Rr, { open: Fe, onOpenChange: tt, children: [
|
|
28056
28063
|
/* @__PURE__ */ s(
|
|
28057
28064
|
Lr,
|
|
28058
28065
|
{
|
|
28059
28066
|
render: /* @__PURE__ */ m(
|
|
28060
28067
|
"button",
|
|
28061
28068
|
{
|
|
28062
|
-
ref:
|
|
28069
|
+
ref: Le,
|
|
28063
28070
|
type: "button",
|
|
28064
28071
|
title: `${vn.label} — swipe to switch agent`,
|
|
28065
28072
|
"aria-label": `Agent: ${vn.label}. Swipe up or down to switch.`,
|
|
@@ -28100,7 +28107,7 @@ function Sm({
|
|
|
28100
28107
|
"form",
|
|
28101
28108
|
{
|
|
28102
28109
|
onSubmit: zt,
|
|
28103
|
-
...
|
|
28110
|
+
...ze.dropZoneProps,
|
|
28104
28111
|
"aria-busy": Rt,
|
|
28105
28112
|
className: $(
|
|
28106
28113
|
// Inline home: original device home-indicator pad when standalone.
|
|
@@ -28112,7 +28119,7 @@ function Sm({
|
|
|
28112
28119
|
Ze && "bg-primary/8"
|
|
28113
28120
|
),
|
|
28114
28121
|
children: [
|
|
28115
|
-
|
|
28122
|
+
ze.fileInput,
|
|
28116
28123
|
/* @__PURE__ */ m(
|
|
28117
28124
|
"div",
|
|
28118
28125
|
{
|
|
@@ -28144,11 +28151,11 @@ function Sm({
|
|
|
28144
28151
|
onValueChange: qt,
|
|
28145
28152
|
onMultilineChange: f === "inline" ? R : void 0,
|
|
28146
28153
|
scrollToEndNonce: I,
|
|
28147
|
-
onPaste:
|
|
28154
|
+
onPaste: ze.onPasteFiles,
|
|
28148
28155
|
onKeyDown: (P) => {
|
|
28149
28156
|
(P.metaKey || P.ctrlKey) && P.key === "Enter" && (P.preventDefault(), P.currentTarget.form?.requestSubmit());
|
|
28150
28157
|
},
|
|
28151
|
-
placeholder:
|
|
28158
|
+
placeholder: Be.length ? "Add a note for the files…" : "What should we work on?",
|
|
28152
28159
|
className: $(
|
|
28153
28160
|
"border-0 bg-transparent text-base leading-relaxed shadow-none focus-visible:border-0 focus-visible:ring-0",
|
|
28154
28161
|
f === "inline" ? "min-h-9 flex-1 px-1 py-1.5" : "min-h-40 max-h-[42dvh] px-1 py-1 pr-10"
|
|
@@ -28187,11 +28194,11 @@ function Sm({
|
|
|
28187
28194
|
// longer be edited or removed; live composer attachments always can,
|
|
28188
28195
|
// even while their upload is still running.
|
|
28189
28196
|
...Y.map((P) => ({ att: P, locked: !0 })),
|
|
28190
|
-
...
|
|
28197
|
+
...Be.map((P) => ({ att: P, locked: !1 }))
|
|
28191
28198
|
],
|
|
28192
28199
|
onAnnotate: Ye,
|
|
28193
28200
|
onRemove: Ue,
|
|
28194
|
-
onToggleHd:
|
|
28201
|
+
onToggleHd: ze.setAttachmentHd
|
|
28195
28202
|
}
|
|
28196
28203
|
),
|
|
28197
28204
|
f !== "inline" ? /* @__PURE__ */ s("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: Br }) : null,
|
|
@@ -28247,7 +28254,7 @@ function Sm({
|
|
|
28247
28254
|
type: "button",
|
|
28248
28255
|
variant: Ze ? "brand-soft" : "outline",
|
|
28249
28256
|
className: "size-8 rounded-full shadow-sm",
|
|
28250
|
-
onClick:
|
|
28257
|
+
onClick: ze.openFilePicker,
|
|
28251
28258
|
"aria-label": "Attach files",
|
|
28252
28259
|
title: "Attach files",
|
|
28253
28260
|
children: /* @__PURE__ */ s(rn, { className: "size-4" })
|
|
@@ -28318,7 +28325,7 @@ function Sm({
|
|
|
28318
28325
|
]
|
|
28319
28326
|
}
|
|
28320
28327
|
),
|
|
28321
|
-
|
|
28328
|
+
ze.annotator
|
|
28322
28329
|
] });
|
|
28323
28330
|
return f === "inline" ? /* @__PURE__ */ s(
|
|
28324
28331
|
"div",
|
|
@@ -28491,50 +28498,50 @@ function f0({
|
|
|
28491
28498
|
const Xe = Math.max(
|
|
28492
28499
|
12,
|
|
28493
28500
|
Math.min(window.innerWidth - 168 - 12, V + z3 - 168)
|
|
28494
|
-
),
|
|
28501
|
+
), $e = R + 70, we = Math.max(12, ye.top - $e - 12);
|
|
28495
28502
|
D("above"), G({ left: Xe, top: we, width: 168, transformOrigin: `${V - Xe}px 100%` });
|
|
28496
28503
|
return;
|
|
28497
28504
|
}
|
|
28498
|
-
const ne = Math.min(360, Math.max(248, window.innerWidth - 24)),
|
|
28499
|
-
D(
|
|
28500
|
-
left:
|
|
28501
|
-
top:
|
|
28505
|
+
const ne = Math.min(360, Math.max(248, window.innerWidth - 24)), pe = Math.max(12, Math.min(window.innerWidth - ne - 12, V - ne / 2)), xe = 124, Oe = ye.top - xe - 12 >= 12, Le = Oe ? ye.top - xe - 12 : Math.min(window.innerHeight - xe - 12, ye.bottom + 12);
|
|
28506
|
+
D(Oe ? "above" : "below"), G({
|
|
28507
|
+
left: pe,
|
|
28508
|
+
top: Le,
|
|
28502
28509
|
width: ne,
|
|
28503
|
-
transformOrigin: `${V -
|
|
28510
|
+
transformOrigin: `${V - pe}px ${Oe ? "100%" : "0%"}`
|
|
28504
28511
|
});
|
|
28505
28512
|
}, Ce = (re) => {
|
|
28506
28513
|
if (h.current) return;
|
|
28507
28514
|
const ye = Math.max(0, t.indexOf(e));
|
|
28508
28515
|
document.getSelection()?.removeAllRanges(), f.current = ye, u.current = null, y.current = !1, h.current = !0, p.current = !0, M(ye), oe(re), w(!0), wt("heavy");
|
|
28509
|
-
},
|
|
28516
|
+
}, ze = (re) => {
|
|
28510
28517
|
if (Y(), !!h.current && (h.current = !1, w(!1), re)) {
|
|
28511
28518
|
const ye = t[f.current];
|
|
28512
28519
|
Sn.success(), ye && n(ye);
|
|
28513
28520
|
}
|
|
28514
|
-
},
|
|
28521
|
+
}, Be = () => {
|
|
28515
28522
|
T.current && (T.current = !1, E.current = !1, k(!1), f.current = X, M(X));
|
|
28516
|
-
},
|
|
28523
|
+
}, Te = (re) => {
|
|
28517
28524
|
if (!H || h.current) return;
|
|
28518
28525
|
q.current = re;
|
|
28519
28526
|
const ye = Math.max(0, t.indexOf(e));
|
|
28520
28527
|
f.current = ye, M(ye), oe(re), T.current = !0, k(!0), wt("light");
|
|
28521
28528
|
}, Ze = (re) => {
|
|
28522
|
-
T.current ?
|
|
28529
|
+
T.current ? Be() : Te(re);
|
|
28523
28530
|
}, Ue = (re) => {
|
|
28524
|
-
|
|
28531
|
+
Be(), Sn.success(), n(re);
|
|
28525
28532
|
};
|
|
28526
28533
|
K(() => {
|
|
28527
28534
|
if (!x && !A) return;
|
|
28528
28535
|
const re = (ye) => {
|
|
28529
|
-
ye.key === "Escape" && (ye.preventDefault(), ye.stopPropagation(),
|
|
28536
|
+
ye.key === "Escape" && (ye.preventDefault(), ye.stopPropagation(), ze(!1), Be());
|
|
28530
28537
|
};
|
|
28531
28538
|
return window.addEventListener("keydown", re, !0), () => window.removeEventListener("keydown", re, !0);
|
|
28532
28539
|
}, [x, A]), K(() => {
|
|
28533
28540
|
if (!A) return;
|
|
28534
28541
|
const re = (V) => {
|
|
28535
28542
|
const ne = V.target;
|
|
28536
|
-
ne && B.current?.contains(ne) || (ne && q.current?.contains(ne) && (g.current = !0, O.current = !0),
|
|
28537
|
-
}, ye = () =>
|
|
28543
|
+
ne && B.current?.contains(ne) || (ne && q.current?.contains(ne) && (g.current = !0, O.current = !0), Be());
|
|
28544
|
+
}, ye = () => Be();
|
|
28538
28545
|
return document.addEventListener("pointerdown", re, !0), window.addEventListener("resize", ye), window.addEventListener("scroll", ye, !0), () => {
|
|
28539
28546
|
document.removeEventListener("pointerdown", re, !0), window.removeEventListener("resize", ye), window.removeEventListener("scroll", ye, !0);
|
|
28540
28547
|
};
|
|
@@ -28549,41 +28556,41 @@ function f0({
|
|
|
28549
28556
|
if (Math.abs(V) < Cm && Math.abs(ne) < Cm) return;
|
|
28550
28557
|
u.current = Math.abs(V) >= Math.abs(ne) ? "x" : "y";
|
|
28551
28558
|
}
|
|
28552
|
-
|
|
28559
|
+
ge(u.current === "x" ? V : -ne);
|
|
28553
28560
|
}, Qe = (re) => {
|
|
28554
28561
|
const ye = v.current;
|
|
28555
28562
|
if (!ye) return;
|
|
28556
28563
|
const V = ye.getBoundingClientRect();
|
|
28557
28564
|
if (V.height <= 0) return;
|
|
28558
|
-
const ne = Math.max(0, V.height - R),
|
|
28565
|
+
const ne = Math.max(0, V.height - R), pe = V.bottom - ne / 2, xe = V.top + ne / 2;
|
|
28559
28566
|
if (!y.current) {
|
|
28560
|
-
if (re >
|
|
28567
|
+
if (re > pe) return;
|
|
28561
28568
|
y.current = !0;
|
|
28562
28569
|
}
|
|
28563
|
-
const
|
|
28564
|
-
|
|
28565
|
-
},
|
|
28566
|
-
|
|
28570
|
+
const Oe = Math.max(1, pe - xe), Le = Math.max(0, Math.min(1, (pe - re) / Oe));
|
|
28571
|
+
Ie(Math.round(Le * (t.length - 1)));
|
|
28572
|
+
}, ge = (re) => {
|
|
28573
|
+
Ie(
|
|
28567
28574
|
Math.round(d.current + re / Em(t.length))
|
|
28568
28575
|
);
|
|
28569
|
-
},
|
|
28576
|
+
}, Ie = (re) => {
|
|
28570
28577
|
const ye = Math.max(0, Math.min(t.length - 1, re));
|
|
28571
28578
|
ye !== f.current && (f.current = ye, M(ye), wt("medium"));
|
|
28572
28579
|
}, ee = (re, ye) => {
|
|
28573
28580
|
const V = v.current;
|
|
28574
28581
|
if (!V) return null;
|
|
28575
|
-
const ne = V.getBoundingClientRect(),
|
|
28582
|
+
const ne = V.getBoundingClientRect(), pe = (Le) => Math.max(0, Math.min(1, Le));
|
|
28576
28583
|
if (C) {
|
|
28577
28584
|
if (ne.height <= 0) return null;
|
|
28578
|
-
const
|
|
28579
|
-
return Math.round(
|
|
28585
|
+
const Le = Math.max(0, ne.height - R), Re = ne.bottom - Le / 2, Xe = ne.top + Le / 2, $e = Math.max(1, Re - Xe);
|
|
28586
|
+
return Math.round(pe((Re - ye) / $e) * (t.length - 1));
|
|
28580
28587
|
}
|
|
28581
28588
|
if (ne.width <= 0) return null;
|
|
28582
|
-
const xe = Math.min(ne.width / 2, $3 / 2),
|
|
28583
|
-
return Math.round(
|
|
28589
|
+
const xe = Math.min(ne.width / 2, $3 / 2), Oe = Math.max(1, ne.width - xe * 2);
|
|
28590
|
+
return Math.round(pe((re - ne.left - xe) / Oe) * (t.length - 1));
|
|
28584
28591
|
}, me = (re) => {
|
|
28585
28592
|
const ye = ee(re.clientX, re.clientY);
|
|
28586
|
-
ye != null &&
|
|
28593
|
+
ye != null && Ie(ye);
|
|
28587
28594
|
}, be = {
|
|
28588
28595
|
onPointerDown: (re) => {
|
|
28589
28596
|
re.button === 0 && (re.preventDefault(), E.current = !0, re.currentTarget.setPointerCapture(re.pointerId), me(re));
|
|
@@ -28600,7 +28607,7 @@ function f0({
|
|
|
28600
28607
|
onPointerCancel: () => {
|
|
28601
28608
|
E.current = !1;
|
|
28602
28609
|
}
|
|
28603
|
-
},
|
|
28610
|
+
}, _e = {
|
|
28604
28611
|
onPointerDown: (re) => {
|
|
28605
28612
|
if (!H || re.button !== 0) return;
|
|
28606
28613
|
Y(), c.current = { x: re.clientX, y: re.clientY }, u.current = null, p.current = !1, g.current = O.current, O.current = !1, d.current = X, ie(), re.currentTarget.setPointerCapture(re.pointerId), wt("light");
|
|
@@ -28616,16 +28623,16 @@ function f0({
|
|
|
28616
28623
|
re.preventDefault(), Ye(re.clientX, re.clientY);
|
|
28617
28624
|
},
|
|
28618
28625
|
onPointerUp: (re) => {
|
|
28619
|
-
Y(), ue(), p.current && (re.preventDefault(), g.current = !0,
|
|
28626
|
+
Y(), ue(), p.current && (re.preventDefault(), g.current = !0, ze(!0));
|
|
28620
28627
|
},
|
|
28621
28628
|
// A cancelled pointer (scroll takeover, palm rejection) fires no click.
|
|
28622
28629
|
onPointerCancel: () => {
|
|
28623
|
-
Y(), ue(),
|
|
28630
|
+
Y(), ue(), ze(!1);
|
|
28624
28631
|
},
|
|
28625
28632
|
onContextMenu: (re) => {
|
|
28626
28633
|
H && re.preventDefault();
|
|
28627
28634
|
}
|
|
28628
|
-
},
|
|
28635
|
+
}, Fe = () => g.current ? (g.current = !1, !0) : !1, W = (re) => {
|
|
28629
28636
|
if (!H) return;
|
|
28630
28637
|
const ye = t[Math.max(0, Math.min(t.length - 1, X + re))];
|
|
28631
28638
|
!ye || ye === e || (Sn.select(), n(ye));
|
|
@@ -28701,7 +28708,7 @@ function f0({
|
|
|
28701
28708
|
type: "button",
|
|
28702
28709
|
"data-active": ye === _ ? "" : void 0,
|
|
28703
28710
|
style: V,
|
|
28704
|
-
onPointerEnter: () =>
|
|
28711
|
+
onPointerEnter: () => Ie(ye),
|
|
28705
28712
|
onClick: () => Ue(re),
|
|
28706
28713
|
children: Ts(re)
|
|
28707
28714
|
},
|
|
@@ -28723,7 +28730,7 @@ function f0({
|
|
|
28723
28730
|
type: "button",
|
|
28724
28731
|
"data-active": ye === _ ? "" : void 0,
|
|
28725
28732
|
style: ye === _ ? { color: S } : void 0,
|
|
28726
|
-
onPointerEnter: () =>
|
|
28733
|
+
onPointerEnter: () => Ie(ye),
|
|
28727
28734
|
onClick: () => Ue(re),
|
|
28728
28735
|
children: Ts(re)
|
|
28729
28736
|
},
|
|
@@ -28749,8 +28756,8 @@ function f0({
|
|
|
28749
28756
|
sticky: A,
|
|
28750
28757
|
previewLevel: z,
|
|
28751
28758
|
previewAccent: S,
|
|
28752
|
-
pointerProps:
|
|
28753
|
-
consumeSuppressedClick:
|
|
28759
|
+
pointerProps: _e,
|
|
28760
|
+
consumeSuppressedClick: Fe,
|
|
28754
28761
|
toggleSticky: Ze,
|
|
28755
28762
|
nudge: W,
|
|
28756
28763
|
panel: Ne
|
|
@@ -29159,18 +29166,18 @@ function j3({
|
|
|
29159
29166
|
}, 60);
|
|
29160
29167
|
});
|
|
29161
29168
|
}
|
|
29162
|
-
async function
|
|
29163
|
-
const
|
|
29164
|
-
if (!(!
|
|
29169
|
+
async function ze(be) {
|
|
29170
|
+
const _e = (be ?? u).trim();
|
|
29171
|
+
if (!(!_e || f)) {
|
|
29165
29172
|
h(!0), go(e.id, "reply", !0);
|
|
29166
29173
|
try {
|
|
29167
|
-
await i(e,
|
|
29174
|
+
await i(e, _e, R());
|
|
29168
29175
|
} finally {
|
|
29169
29176
|
h(!1);
|
|
29170
29177
|
}
|
|
29171
29178
|
}
|
|
29172
29179
|
}
|
|
29173
|
-
async function
|
|
29180
|
+
async function Be() {
|
|
29174
29181
|
if (!f) {
|
|
29175
29182
|
h(!0), go(e.id, "execute", !!u.trim());
|
|
29176
29183
|
try {
|
|
@@ -29184,7 +29191,7 @@ function j3({
|
|
|
29184
29191
|
}
|
|
29185
29192
|
}
|
|
29186
29193
|
}
|
|
29187
|
-
async function
|
|
29194
|
+
async function Te() {
|
|
29188
29195
|
try {
|
|
29189
29196
|
await Va(wp(e, t)), go(e.id, "copy", !!u.trim()), ke.success("Finding reference copied");
|
|
29190
29197
|
} catch (be) {
|
|
@@ -29195,7 +29202,7 @@ function j3({
|
|
|
29195
29202
|
const be = A.trim();
|
|
29196
29203
|
!be || f || !l || (go(e.id, "feedback", !!u.trim()), l(e, be));
|
|
29197
29204
|
}
|
|
29198
|
-
const Ue = 3, Ye = e.reasoning, Qe = v || Ye.length <= Ue + 1 ? Ye : Ye.slice(0, Ue),
|
|
29205
|
+
const Ue = 3, Ye = e.reasoning, Qe = v || Ye.length <= Ue + 1 ? Ye : Ye.slice(0, Ue), ge = Ye.length - Qe.length, Ie = [G, I ? `${D} thinking` : null].filter(Boolean).join(" · "), ee = /* @__PURE__ */ m("div", { className: "px-1 pb-2", children: [
|
|
29199
29206
|
/* @__PURE__ */ m(
|
|
29200
29207
|
"button",
|
|
29201
29208
|
{
|
|
@@ -29204,7 +29211,7 @@ function j3({
|
|
|
29204
29211
|
"aria-expanded": p,
|
|
29205
29212
|
className: "flex max-w-full items-center gap-1 text-[11.5px] text-muted-foreground/80 hover:text-muted-foreground",
|
|
29206
29213
|
children: [
|
|
29207
|
-
/* @__PURE__ */ s("span", { className: "truncate", children:
|
|
29214
|
+
/* @__PURE__ */ s("span", { className: "truncate", children: Ie }),
|
|
29208
29215
|
/* @__PURE__ */ s(
|
|
29209
29216
|
pn,
|
|
29210
29217
|
{
|
|
@@ -29305,7 +29312,7 @@ function j3({
|
|
|
29305
29312
|
value: u,
|
|
29306
29313
|
onValueChange: d,
|
|
29307
29314
|
onKeyDown: (be) => {
|
|
29308
|
-
be.key === "Enter" && (be.metaKey || be.ctrlKey) && (be.preventDefault(),
|
|
29315
|
+
be.key === "Enter" && (be.metaKey || be.ctrlKey) && (be.preventDefault(), ze());
|
|
29309
29316
|
},
|
|
29310
29317
|
rows: 1,
|
|
29311
29318
|
placeholder: "Type to start a session…",
|
|
@@ -29319,11 +29326,11 @@ function j3({
|
|
|
29319
29326
|
className: "size-9 shrink-0",
|
|
29320
29327
|
silenceMs: 2500,
|
|
29321
29328
|
baseText: u,
|
|
29322
|
-
onText: (be,
|
|
29323
|
-
onInterim: (be,
|
|
29324
|
-
onAutoSubmit: (be,
|
|
29325
|
-
const
|
|
29326
|
-
d(
|
|
29329
|
+
onText: (be, _e) => d(_e.trim() ? `${_e.trimEnd()} ${be}` : be),
|
|
29330
|
+
onInterim: (be, _e) => d(_e.trim() ? `${_e.trimEnd()} ${be}` : be),
|
|
29331
|
+
onAutoSubmit: (be, _e) => {
|
|
29332
|
+
const Fe = _e.trim() ? `${_e.trimEnd()} ${be}` : be;
|
|
29333
|
+
d(Fe), ze(Fe);
|
|
29327
29334
|
},
|
|
29328
29335
|
onCancel: (be) => d(be)
|
|
29329
29336
|
}
|
|
@@ -29334,7 +29341,7 @@ function j3({
|
|
|
29334
29341
|
size: "icon-sm",
|
|
29335
29342
|
variant: "brand",
|
|
29336
29343
|
disabled: f || !u.trim(),
|
|
29337
|
-
onClick: () => void
|
|
29344
|
+
onClick: () => void ze(),
|
|
29338
29345
|
children: f ? /* @__PURE__ */ s(ct, { className: "size-4 animate-spin" }) : /* @__PURE__ */ s(xa, { className: "size-4" })
|
|
29339
29346
|
}
|
|
29340
29347
|
)
|
|
@@ -29347,7 +29354,7 @@ function j3({
|
|
|
29347
29354
|
{
|
|
29348
29355
|
variant: "brand",
|
|
29349
29356
|
disabled: f,
|
|
29350
|
-
onClick: () => void
|
|
29357
|
+
onClick: () => void Be(),
|
|
29351
29358
|
className: "flex-1",
|
|
29352
29359
|
children: [
|
|
29353
29360
|
f ? /* @__PURE__ */ s(ct, { className: "size-4 animate-spin" }) : /* @__PURE__ */ s(Pt, { className: "size-4" }),
|
|
@@ -29375,7 +29382,7 @@ function j3({
|
|
|
29375
29382
|
variant: "ghost",
|
|
29376
29383
|
size: "sm",
|
|
29377
29384
|
disabled: f,
|
|
29378
|
-
onClick: () => void
|
|
29385
|
+
onClick: () => void Te(),
|
|
29379
29386
|
className: "flex-1 text-[12.5px] font-medium text-muted-foreground",
|
|
29380
29387
|
children: [
|
|
29381
29388
|
/* @__PURE__ */ s(Cr, { className: "size-3.5" }),
|
|
@@ -29436,16 +29443,16 @@ function j3({
|
|
|
29436
29443
|
},
|
|
29437
29444
|
be
|
|
29438
29445
|
)) }) : null,
|
|
29439
|
-
|
|
29446
|
+
ge > 0 ? /* @__PURE__ */ m(
|
|
29440
29447
|
"button",
|
|
29441
29448
|
{
|
|
29442
29449
|
type: "button",
|
|
29443
29450
|
onClick: () => y(!0),
|
|
29444
29451
|
className: "mt-2 text-xs font-medium text-muted-foreground/80 underline-offset-4 hover:underline",
|
|
29445
29452
|
children: [
|
|
29446
|
-
|
|
29453
|
+
ge,
|
|
29447
29454
|
" more ",
|
|
29448
|
-
|
|
29455
|
+
ge === 1 ? "detail" : "details"
|
|
29449
29456
|
]
|
|
29450
29457
|
}
|
|
29451
29458
|
) : null,
|
|
@@ -29579,8 +29586,8 @@ function H3({
|
|
|
29579
29586
|
const Ye = d.prompt ?? "";
|
|
29580
29587
|
return ve(`/api/auto/agents/${encodeURIComponent(d.id)}`).then((Qe) => {
|
|
29581
29588
|
if (Ue) return;
|
|
29582
|
-
const
|
|
29583
|
-
typeof
|
|
29589
|
+
const ge = Qe.agent?.prompt;
|
|
29590
|
+
typeof ge == "string" && g((Ie) => Ie === Ye ? ge : Ie), w(!0);
|
|
29584
29591
|
}).catch(() => {
|
|
29585
29592
|
Ue || w(!1);
|
|
29586
29593
|
}), () => {
|
|
@@ -29598,11 +29605,11 @@ function H3({
|
|
|
29598
29605
|
d?.model ?? H
|
|
29599
29606
|
), [I, S] = N(
|
|
29600
29607
|
d?.thinkingLevel ?? Tr()
|
|
29601
|
-
), [C, R] = N(!1), [Y, se] = N(!1), [ie, ue] = N(null), oe = je(() => Jh(v, n), [v, n]), Ce = Jo(G),
|
|
29608
|
+
), [C, R] = N(!1), [Y, se] = N(!1), [ie, ue] = N(null), oe = je(() => Jh(v, n), [v, n]), Ce = Jo(G), ze = Ir(G), Be = En(G);
|
|
29602
29609
|
K(() => {
|
|
29603
|
-
Ce.includes(_) || z(
|
|
29604
|
-
}, [
|
|
29605
|
-
async function
|
|
29610
|
+
Ce.includes(_) || z(ze);
|
|
29611
|
+
}, [ze, Ce, _]);
|
|
29612
|
+
async function Te() {
|
|
29606
29613
|
if (!(Y || !p.trim())) {
|
|
29607
29614
|
se(!0), ue(null);
|
|
29608
29615
|
try {
|
|
@@ -29635,7 +29642,7 @@ function H3({
|
|
|
29635
29642
|
cwd: M || void 0,
|
|
29636
29643
|
agent: G,
|
|
29637
29644
|
model: _.trim() || void 0,
|
|
29638
|
-
thinkingLevel:
|
|
29645
|
+
thinkingLevel: Be ? I : void 0,
|
|
29639
29646
|
// null, not undefined: JSON.stringify drops undefined, and an absent
|
|
29640
29647
|
// field means "keep the stored pin" — so clearing one has to be said
|
|
29641
29648
|
// out loud or the save is a silent no-op.
|
|
@@ -29687,7 +29694,7 @@ function H3({
|
|
|
29687
29694
|
weekday: "long",
|
|
29688
29695
|
timeZone: "UTC"
|
|
29689
29696
|
})
|
|
29690
|
-
})), Qe = oe,
|
|
29697
|
+
})), Qe = oe, ge = "appearance-none rounded-lg bg-muted px-2 py-1 text-right text-[13px] font-medium outline-none", Ie = "w-14 rounded-lg bg-muted px-2 py-1 text-right text-[13px] outline-none", ee = [
|
|
29691
29698
|
{ v: "minutes", label: "Every N minutes" },
|
|
29692
29699
|
{ v: "hourly", label: "Every hour" },
|
|
29693
29700
|
{ v: "daily", label: "Every day" },
|
|
@@ -29725,7 +29732,7 @@ function H3({
|
|
|
29725
29732
|
value: k.freq,
|
|
29726
29733
|
onChange: (me) => B({ freq: me.target.value }),
|
|
29727
29734
|
"aria-label": "Frequency",
|
|
29728
|
-
className:
|
|
29735
|
+
className: ge,
|
|
29729
29736
|
children: ee.map((me) => /* @__PURE__ */ s("option", { value: me.v, children: me.label }, me.v))
|
|
29730
29737
|
}
|
|
29731
29738
|
),
|
|
@@ -29738,7 +29745,7 @@ function H3({
|
|
|
29738
29745
|
value: k.every,
|
|
29739
29746
|
onChange: (me) => B({ every: parseInt(me.target.value, 10) || 1 }),
|
|
29740
29747
|
"aria-label": "Every N minutes",
|
|
29741
|
-
className:
|
|
29748
|
+
className: Ie
|
|
29742
29749
|
}
|
|
29743
29750
|
) : null,
|
|
29744
29751
|
k.freq === "hourly" ? /* @__PURE__ */ s(
|
|
@@ -29752,7 +29759,7 @@ function H3({
|
|
|
29752
29759
|
minute: Math.max(0, Math.min(59, parseInt(me.target.value, 10) || 0))
|
|
29753
29760
|
}),
|
|
29754
29761
|
"aria-label": "Minute of the hour",
|
|
29755
|
-
className:
|
|
29762
|
+
className: Ie
|
|
29756
29763
|
}
|
|
29757
29764
|
) : null,
|
|
29758
29765
|
k.freq === "weekly" ? /* @__PURE__ */ s(
|
|
@@ -29761,7 +29768,7 @@ function H3({
|
|
|
29761
29768
|
value: k.dow,
|
|
29762
29769
|
onChange: (me) => B({ dow: parseInt(me.target.value, 10) }),
|
|
29763
29770
|
"aria-label": "Day of week",
|
|
29764
|
-
className:
|
|
29771
|
+
className: ge,
|
|
29765
29772
|
children: Ye.map((me) => /* @__PURE__ */ s("option", { value: me.v, children: me.label }, me.v))
|
|
29766
29773
|
}
|
|
29767
29774
|
) : null,
|
|
@@ -29776,7 +29783,7 @@ function H3({
|
|
|
29776
29783
|
dom: Math.max(1, Math.min(31, parseInt(me.target.value, 10) || 1))
|
|
29777
29784
|
}),
|
|
29778
29785
|
"aria-label": "Day of month",
|
|
29779
|
-
className:
|
|
29786
|
+
className: Ie
|
|
29780
29787
|
}
|
|
29781
29788
|
) : null,
|
|
29782
29789
|
k.freq === "daily" || k.freq === "weekday" || k.freq === "weekly" || k.freq === "monthly" ? /* @__PURE__ */ s(
|
|
@@ -29886,7 +29893,7 @@ function H3({
|
|
|
29886
29893
|
{
|
|
29887
29894
|
type: "button",
|
|
29888
29895
|
disabled: Y || !p.trim(),
|
|
29889
|
-
onClick: () => void
|
|
29896
|
+
onClick: () => void Te(),
|
|
29890
29897
|
className: "flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-primary disabled:text-muted-foreground",
|
|
29891
29898
|
title: "Rewrite into a sharper watch prompt",
|
|
29892
29899
|
children: [
|
|
@@ -32172,10 +32179,10 @@ function kT({
|
|
|
32172
32179
|
p ? e.colorway ?? "warm" : yl[Math.floor(Math.random() * yl.length)]
|
|
32173
32180
|
), [G, J] = N(v), [D, X] = N(p ? e.model ?? y : y), [H, _] = N(p ? e.thinkingLevel ?? Tr() : Tr()), [z, I] = N(!1), S = !p && i ? Av(i) : null, [C, R] = N(!1), [Y, se] = N(!1), [ie, ue] = N(p ? e.configRevision ?? 1 : 1), [oe, Ce] = N(
|
|
32174
32181
|
p ? e.configStatus ?? "current" : "current"
|
|
32175
|
-
), [
|
|
32182
|
+
), [ze, Be] = N(p ? e.rotationError : void 0), Te = Jo(G), Ze = Ir(G);
|
|
32176
32183
|
K(() => {
|
|
32177
|
-
|
|
32178
|
-
}, [Ze, D,
|
|
32184
|
+
Te.includes(D) || X(Ze);
|
|
32185
|
+
}, [Ze, D, Te]), K(() => {
|
|
32179
32186
|
if (!h) return;
|
|
32180
32187
|
const ee = document.body.style.overflow;
|
|
32181
32188
|
return document.body.style.overflow = "hidden", () => {
|
|
@@ -32197,13 +32204,13 @@ function kT({
|
|
|
32197
32204
|
cwd: O || void 0,
|
|
32198
32205
|
enabled: T
|
|
32199
32206
|
});
|
|
32200
|
-
R(!1), ee && (ue(ee.configRevision ?? ie), Ce(ee.configStatus ?? "current"),
|
|
32207
|
+
R(!1), ee && (ue(ee.configRevision ?? ie), Ce(ee.configStatus ?? "current"), Be(ee.rotationError));
|
|
32201
32208
|
}, Qe = async () => {
|
|
32202
32209
|
if (!p || Y) return;
|
|
32203
32210
|
se(!0), Ce("refreshing");
|
|
32204
32211
|
const ee = await u({ ...e, configRevision: ie });
|
|
32205
|
-
se(!1), ee && (Ce(ee.configStatus),
|
|
32206
|
-
},
|
|
32212
|
+
se(!1), ee && (Ce(ee.configStatus), Be(ee.rotationError));
|
|
32213
|
+
}, ge = /* @__PURE__ */ m(He, { children: [
|
|
32207
32214
|
/* @__PURE__ */ s(
|
|
32208
32215
|
Ee,
|
|
32209
32216
|
{
|
|
@@ -32220,7 +32227,7 @@ function kT({
|
|
|
32220
32227
|
C ? /* @__PURE__ */ s(ct, { className: "mr-1 size-3.5 animate-spin" }) : null,
|
|
32221
32228
|
p ? "Save" : "Create"
|
|
32222
32229
|
] })
|
|
32223
|
-
] }),
|
|
32230
|
+
] }), Ie = /* @__PURE__ */ m(He, { children: [
|
|
32224
32231
|
!p && S ? /* @__PURE__ */ m(
|
|
32225
32232
|
"div",
|
|
32226
32233
|
{
|
|
@@ -32324,7 +32331,7 @@ function kT({
|
|
|
32324
32331
|
children: /* @__PURE__ */ m("div", { className: "flex items-center gap-3", children: [
|
|
32325
32332
|
/* @__PURE__ */ m("span", { className: "min-w-0 flex-1", children: [
|
|
32326
32333
|
/* @__PURE__ */ s("span", { className: "block text-sm font-medium", children: oe === "current" ? "Current" : oe === "update-available" ? "Update available" : oe === "queued" ? "Refresh queued" : oe === "refreshing" ? "Refreshing" : "Refresh failed" }),
|
|
32327
|
-
/* @__PURE__ */ s("span", { className: "block text-xs text-muted-foreground", children: oe === "current" ? "The active bot uses these instructions." : oe === "queued" ? "The bot will refresh after its current work and child tasks finish." : oe === "refreshing" ? "A fresh runtime is starting with the latest instructions." : oe === "failed" ?
|
|
32334
|
+
/* @__PURE__ */ s("span", { className: "block text-xs text-muted-foreground", children: oe === "current" ? "The active bot uses these instructions." : oe === "queued" ? "The bot will refresh after its current work and child tasks finish." : oe === "refreshing" ? "A fresh runtime is starting with the latest instructions." : oe === "failed" ? ze || "The old runtime is still active. Try again." : "Apply the saved instructions to a fresh runtime." })
|
|
32328
32335
|
] }),
|
|
32329
32336
|
oe === "update-available" || oe === "failed" ? /* @__PURE__ */ m(Ee, { size: "sm", variant: "outline", disabled: Y, onClick: () => void Qe(), children: [
|
|
32330
32337
|
Y ? /* @__PURE__ */ s(ct, { className: "mr-1 size-3.5 animate-spin" }) : null,
|
|
@@ -32439,17 +32446,17 @@ function kT({
|
|
|
32439
32446
|
{
|
|
32440
32447
|
className: "flex items-center gap-2 border-b border-border px-3 pb-3",
|
|
32441
32448
|
style: { paddingTop: "calc(env(safe-area-inset-top, 0px) + 0.75rem)" },
|
|
32442
|
-
children:
|
|
32449
|
+
children: ge
|
|
32443
32450
|
}
|
|
32444
32451
|
),
|
|
32445
|
-
/* @__PURE__ */ s("div", { className: "min-h-0 flex-1 overflow-y-auto px-4 pb-[calc(1.5rem+var(--lfg-safe-bottom))] pt-4", children:
|
|
32452
|
+
/* @__PURE__ */ s("div", { className: "min-h-0 flex-1 overflow-y-auto px-4 pb-[calc(1.5rem+var(--lfg-safe-bottom))] pt-4", children: Ie })
|
|
32446
32453
|
] })
|
|
32447
32454
|
}
|
|
32448
32455
|
),
|
|
32449
32456
|
document.body
|
|
32450
32457
|
) : /* @__PURE__ */ m("section", { className: "mx-auto flex w-full max-w-3xl flex-col", "data-lfg-page-column": !0, children: [
|
|
32451
|
-
/* @__PURE__ */ s("header", { className: "flex items-center gap-2 border-b border-border pb-3 pt-1", children:
|
|
32452
|
-
/* @__PURE__ */ s("div", { className: "pt-4", children:
|
|
32458
|
+
/* @__PURE__ */ s("header", { className: "flex items-center gap-2 border-b border-border pb-3 pt-1", children: ge }),
|
|
32459
|
+
/* @__PURE__ */ s("div", { className: "pt-4", children: Ie })
|
|
32453
32460
|
] });
|
|
32454
32461
|
}
|
|
32455
32462
|
function ST({
|