@hachej/boring-workspace 0.1.62 → 0.1.63
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/{FileTree-zGmxifl_.js → FileTree-CUvn5K86.js} +1 -1
- package/dist/{MarkdownEditor-BykEKKxv.js → MarkdownEditor-5f4lhBqc.js} +11 -11
- package/dist/{WorkspaceLoadingState-Dfnk7JjR.js → WorkspaceLoadingState-y087Q6ek.js} +40 -40
- package/dist/{WorkspaceProvider-kf-pjz6V.js → WorkspaceProvider-U4izhS84.js} +3568 -3438
- package/dist/app-front.d.ts +10 -4
- package/dist/app-front.js +149 -148
- package/dist/app-server.d.ts +4 -3
- package/dist/app-server.js +42 -22
- package/dist/events.d.ts +9 -0
- package/dist/filesystem-vhLA0ERd.d.ts +17 -0
- package/dist/plugin.d.ts +4 -3
- package/dist/{runtimeEnv-B8XJz-k4.d.ts → runtimeEnv-HolIkcoB.d.ts} +1 -1
- package/dist/server.d.ts +5 -4
- package/dist/server.js +42 -22
- package/dist/shared.d.ts +3 -2
- package/dist/shared.js +35 -1
- package/dist/{surface-CDklwi48.d.ts → surface-aLQ_Hryw.d.ts} +2 -0
- package/dist/testing.d.ts +4 -0
- package/dist/testing.js +1 -1
- package/dist/{ui-bridge-BbuUZ5iC.d.ts → ui-bridge-D2eO3epD.d.ts} +4 -0
- package/dist/workspace.css +2 -0
- package/dist/workspace.d.ts +77 -17
- package/dist/workspace.js +74 -73
- package/docs/README.md +29 -0
- package/package.json +4 -4
package/dist/app-front.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as i, jsxs as v, Fragment as
|
|
1
|
+
import { jsx as i, jsxs as v, Fragment as le } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as _, useState as L, useCallback as A, useMemo as T, useRef as H, useSyncExternalStore as fn, useLayoutEffect as Ki } from "react";
|
|
3
|
-
import { Sun as Hi, Moon as Bi, FileText as Ji, RefreshCw as Wr, X as pn, Sparkles as Mr, Plug as Ir, Clock3 as qi, Pin as
|
|
3
|
+
import { Sun as Hi, Moon as Bi, FileText as Ji, RefreshCw as Wr, X as pn, Sparkles as Mr, Plug as Ir, Clock3 as qi, Pin as Fr, MessageSquarePlus as $r, ChevronRight as Vi, Plus as gn, MoreHorizontal as Yi, PinOff as Xi, Settings as ji, ExternalLink as Qi, Search as Zi, PanelLeftOpen as es, PanelLeftClose as ts } from "lucide-react";
|
|
4
4
|
import { searchPiSessions as ns, PiChatPanel as rs, usePiSessions as is } from "@hachej/boring-agent/front";
|
|
5
|
-
import { ax as ss,
|
|
5
|
+
import { ax as ss, aF as Ur, p as os, aN as mn, aO as as, aP as ls, aQ as Lt, aR as Gr, aS as zr, aT as Kr, aU as Hr, aV as Ot, aW as hn, aX as bn, aY as Br, aZ as cs, a_ as Dt, u as Jr, aw as ds, a$ as us, az as fs, Y as gs, q as ms, b0 as Nr, b1 as ps, U as Pr, x as hs, b2 as bs, au as vs, b3 as xs } from "./WorkspaceProvider-U4izhS84.js";
|
|
6
6
|
import { IconButton as st, DropdownMenu as ys, DropdownMenuTrigger as Ss, DropdownMenuContent as ws, DropdownMenuItem as Ct, DropdownMenuSeparator as Ns, ErrorState as Ps } from "@hachej/boring-ui-kit";
|
|
7
7
|
import { c as q } from "./utils-B6yFEsav.js";
|
|
8
|
-
import { C as Es, r as Er, w as ks, a as kr, c as As, T as Rs, W as Ar } from "./WorkspaceLoadingState-
|
|
8
|
+
import { C as Es, r as Er, w as ks, a as kr, c as As, T as Rs, W as Ar } from "./WorkspaceLoadingState-y087Q6ek.js";
|
|
9
9
|
function Cs() {
|
|
10
10
|
const { theme: e, toggleTheme: t } = ss(), r = e === "dark";
|
|
11
11
|
return _(() => {
|
|
@@ -85,7 +85,7 @@ function _s({ onClose: e, headerInsetStart: t = !1, headerInsetEnd: r = !1 }) {
|
|
|
85
85
|
headerInsetStart: t,
|
|
86
86
|
headerInsetEnd: r,
|
|
87
87
|
icon: /* @__PURE__ */ i("span", { className: "grid size-7 place-items-center rounded-lg bg-[color:oklch(from_var(--accent)_l_c_h/0.12)] text-[color:var(--accent)]", children: /* @__PURE__ */ i(Mr, { className: "h-4 w-4", strokeWidth: 1.75, "aria-hidden": "true" }) }),
|
|
88
|
-
actions: /* @__PURE__ */ v(
|
|
88
|
+
actions: /* @__PURE__ */ v(le, { children: [
|
|
89
89
|
/* @__PURE__ */ i(
|
|
90
90
|
st,
|
|
91
91
|
{
|
|
@@ -188,14 +188,14 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
188
188
|
switch (y.type) {
|
|
189
189
|
case "boring.plugin.load":
|
|
190
190
|
l((D) => ({ ...D, plugins: Ts(D.plugins, y) })), g((D) => {
|
|
191
|
-
const
|
|
192
|
-
return
|
|
191
|
+
const F = new Set(D);
|
|
192
|
+
return F.delete(y.id), F;
|
|
193
193
|
});
|
|
194
194
|
break;
|
|
195
195
|
case "boring.plugin.unload":
|
|
196
|
-
l((D) => ({ ...D, plugins: D.plugins.filter((
|
|
197
|
-
const
|
|
198
|
-
return
|
|
196
|
+
l((D) => ({ ...D, plugins: D.plugins.filter((F) => F.id !== y.id) })), g((D) => {
|
|
197
|
+
const F = new Set(D);
|
|
198
|
+
return F.delete(y.id), F;
|
|
199
199
|
});
|
|
200
200
|
break;
|
|
201
201
|
case "boring.plugin.front-pending":
|
|
@@ -203,15 +203,15 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
203
203
|
break;
|
|
204
204
|
case "boring.plugin.front-settled":
|
|
205
205
|
g((D) => {
|
|
206
|
-
const
|
|
207
|
-
return
|
|
206
|
+
const F = new Set(D);
|
|
207
|
+
return F.delete(y.id), F;
|
|
208
208
|
});
|
|
209
209
|
break;
|
|
210
210
|
case "boring.plugin.error":
|
|
211
211
|
case "boring.plugin.front-error":
|
|
212
212
|
R(y.message ? `${y.id}: ${y.message}` : `${y.id} failed to reload`), g((D) => {
|
|
213
|
-
const
|
|
214
|
-
return
|
|
213
|
+
const F = new Set(D);
|
|
214
|
+
return F.delete(y.id), F;
|
|
215
215
|
});
|
|
216
216
|
break;
|
|
217
217
|
case "boring.plugin.replay-complete":
|
|
@@ -241,7 +241,7 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
241
241
|
headerInsetStart: r,
|
|
242
242
|
headerInsetEnd: s,
|
|
243
243
|
icon: /* @__PURE__ */ i("span", { className: "grid size-7 place-items-center rounded-lg bg-foreground/[0.06] text-muted-foreground", children: /* @__PURE__ */ i(Ir, { className: "h-4 w-4", strokeWidth: 1.75, "aria-hidden": "true" }) }),
|
|
244
|
-
actions: /* @__PURE__ */ v(
|
|
244
|
+
actions: /* @__PURE__ */ v(le, { children: [
|
|
245
245
|
/* @__PURE__ */ i(
|
|
246
246
|
st,
|
|
247
247
|
{
|
|
@@ -444,7 +444,7 @@ function Vr({
|
|
|
444
444
|
"grid size-6 place-items-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
445
445
|
r && "text-[color:var(--accent)]"
|
|
446
446
|
),
|
|
447
|
-
children: /* @__PURE__ */ i(
|
|
447
|
+
children: /* @__PURE__ */ i(Fr, { className: q("h-3.5 w-3.5", r && "fill-current"), strokeWidth: 1.75 })
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
}
|
|
@@ -463,7 +463,7 @@ function Vr({
|
|
|
463
463
|
title: "Open in new chat pane",
|
|
464
464
|
onClick: () => l(e.id),
|
|
465
465
|
className: "grid size-6 place-items-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
466
|
-
children: /* @__PURE__ */ i(
|
|
466
|
+
children: /* @__PURE__ */ i($r, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
467
467
|
}
|
|
468
468
|
) : null,
|
|
469
469
|
g ? /* @__PURE__ */ i(
|
|
@@ -510,7 +510,7 @@ function Is() {
|
|
|
510
510
|
return Ms(a), a;
|
|
511
511
|
})];
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Fs({
|
|
514
514
|
projects: e,
|
|
515
515
|
activeProjectId: t,
|
|
516
516
|
fallbackName: r,
|
|
@@ -528,7 +528,7 @@ function $s({
|
|
|
528
528
|
var E;
|
|
529
529
|
const O = t ?? ((E = e[0]) == null ? void 0 : E.id) ?? null;
|
|
530
530
|
return /* @__PURE__ */ i("div", { className: "space-y-0.5", children: e.map((x) => /* @__PURE__ */ i(
|
|
531
|
-
|
|
531
|
+
$s,
|
|
532
532
|
{
|
|
533
533
|
project: x,
|
|
534
534
|
fallbackName: r,
|
|
@@ -548,7 +548,7 @@ function $s({
|
|
|
548
548
|
x.id
|
|
549
549
|
)) });
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function $s({
|
|
552
552
|
project: e,
|
|
553
553
|
fallbackName: t,
|
|
554
554
|
active: r,
|
|
@@ -642,18 +642,18 @@ function Fs({
|
|
|
642
642
|
) }),
|
|
643
643
|
/* @__PURE__ */ v(ws, { align: "end", sideOffset: 6, className: "w-48 border-border/50 shadow-[0_12px_28px_-6px_rgba(0,0,0,0.55)]", children: [
|
|
644
644
|
/* @__PURE__ */ v(Ct, { onSelect: a, className: "gap-2 text-[13px]", children: [
|
|
645
|
-
o ? /* @__PURE__ */ i(Xi, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ i(
|
|
645
|
+
o ? /* @__PURE__ */ i(Xi, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ i(Fr, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
646
646
|
o ? "Unpin project" : "Pin project"
|
|
647
647
|
] }),
|
|
648
648
|
m ? /* @__PURE__ */ v(Ct, { onSelect: () => m(e.id), className: "gap-2 text-[13px]", children: [
|
|
649
|
-
/* @__PURE__ */ i(
|
|
649
|
+
/* @__PURE__ */ i($r, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
650
650
|
"New chat"
|
|
651
651
|
] }) : null,
|
|
652
652
|
k ? /* @__PURE__ */ v(Ct, { onSelect: () => k(e.id), className: "gap-2 text-[13px]", children: [
|
|
653
653
|
/* @__PURE__ */ i(ji, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
654
654
|
"Workspace settings"
|
|
655
655
|
] }) : null,
|
|
656
|
-
R ? /* @__PURE__ */ v(
|
|
656
|
+
R ? /* @__PURE__ */ v(le, { children: [
|
|
657
657
|
/* @__PURE__ */ i(Ns, {}),
|
|
658
658
|
/* @__PURE__ */ v(Ct, { onSelect: () => R(e.id), className: "gap-2 text-[13px]", children: [
|
|
659
659
|
/* @__PURE__ */ i(Qi, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
@@ -720,7 +720,7 @@ function Us({
|
|
|
720
720
|
openSessionIds: b,
|
|
721
721
|
pinnedSessionIds: y,
|
|
722
722
|
onCreateSession: D,
|
|
723
|
-
onOpenCommandPalette:
|
|
723
|
+
onOpenCommandPalette: F,
|
|
724
724
|
onSwitchSession: be,
|
|
725
725
|
onOpenSessionAsPane: J,
|
|
726
726
|
onToggleSessionPinned: Wt,
|
|
@@ -731,60 +731,60 @@ function Us({
|
|
|
731
731
|
const at = T(() => new Set(b), [b]), ve = T(() => new Set(y), [y]), me = T(
|
|
732
732
|
() => y.map((p) => x.find((M) => M.id === p)).filter((p) => !!p),
|
|
733
733
|
[y, x]
|
|
734
|
-
),
|
|
734
|
+
), ce = T(
|
|
735
735
|
() => x.filter((p) => !ve.has(p.id)),
|
|
736
736
|
[ve, x]
|
|
737
737
|
), pe = T(() => {
|
|
738
738
|
const p = o ?? [];
|
|
739
739
|
return ge !== "multi-project" ? p : p.map((M) => M.id !== a ? M : {
|
|
740
740
|
...M,
|
|
741
|
-
sessions: M.sessions ??
|
|
741
|
+
sessions: M.sessions ?? ce.map((W) => ({
|
|
742
742
|
id: W.id,
|
|
743
743
|
title: W.title,
|
|
744
744
|
updatedAt: W.updatedAt
|
|
745
745
|
})),
|
|
746
|
-
sessionCount: M.sessionCount ??
|
|
746
|
+
sessionCount: M.sessionCount ?? ce.length
|
|
747
747
|
});
|
|
748
|
-
}, [a, ge, o,
|
|
748
|
+
}, [a, ge, o, ce]), [lt, It] = L(() => {
|
|
749
749
|
var M;
|
|
750
750
|
const p = a ?? ((M = o == null ? void 0 : o[0]) == null ? void 0 : M.id);
|
|
751
751
|
return new Set(p ? [p] : []);
|
|
752
|
-
}),
|
|
752
|
+
}), Ft = (p) => It((M) => {
|
|
753
753
|
const W = new Set(M);
|
|
754
754
|
return W.has(p) ? W.delete(p) : W.add(p), W;
|
|
755
|
-
}), [Ce,
|
|
755
|
+
}), [Ce, $t] = Is(), _e = T(() => new Set(Ce), [Ce]), xe = T(
|
|
756
756
|
() => Ce.map((p) => pe.find((M) => M.id === p)).filter((p) => !!p),
|
|
757
757
|
[Ce, pe]
|
|
758
758
|
), Ut = T(
|
|
759
759
|
() => pe.filter((p) => !_e.has(p.id)),
|
|
760
760
|
[pe, _e]
|
|
761
761
|
), Gt = E !== "hidden" && (ge !== "multi-project" || E === "workspace"), zt = E === "full" && ge !== "multi-project", Te = (p, M, W = a ?? void 0) => {
|
|
762
|
-
const
|
|
762
|
+
const de = !W || W === a, Kt = de && p.id === h ? "active" : de && at.has(p.id) ? "open" : "normal";
|
|
763
763
|
return /* @__PURE__ */ i(
|
|
764
764
|
Vr,
|
|
765
765
|
{
|
|
766
766
|
session: p,
|
|
767
767
|
state: Kt,
|
|
768
768
|
pinned: M,
|
|
769
|
-
canSplit:
|
|
770
|
-
canPin:
|
|
771
|
-
onSwitch:
|
|
772
|
-
onOpenAsPane:
|
|
769
|
+
canSplit: de,
|
|
770
|
+
canPin: de,
|
|
771
|
+
onSwitch: de ? be : () => l == null ? void 0 : l(W, p.id),
|
|
772
|
+
onOpenAsPane: de ? J : () => l == null ? void 0 : l(W, p.id),
|
|
773
773
|
onTogglePinned: Wt,
|
|
774
|
-
onDelete:
|
|
774
|
+
onDelete: de ? Mt : void 0
|
|
775
775
|
},
|
|
776
776
|
p.id
|
|
777
777
|
);
|
|
778
778
|
}, ct = (p) => /* @__PURE__ */ i(
|
|
779
|
-
|
|
779
|
+
Fs,
|
|
780
780
|
{
|
|
781
781
|
projects: p,
|
|
782
782
|
activeProjectId: a,
|
|
783
783
|
fallbackName: r || t || "Boring UI",
|
|
784
784
|
expandedIds: lt,
|
|
785
|
-
onToggleExpanded:
|
|
785
|
+
onToggleExpanded: Ft,
|
|
786
786
|
pinnedProjectIds: _e,
|
|
787
|
-
onTogglePinnedProject:
|
|
787
|
+
onTogglePinnedProject: $t,
|
|
788
788
|
onOpenProjectSession: (M, W) => {
|
|
789
789
|
M === a ? be(W) : l == null || l(M, W);
|
|
790
790
|
},
|
|
@@ -818,7 +818,7 @@ function Us({
|
|
|
818
818
|
) : /* @__PURE__ */ i("div", { className: "h-12 shrink-0", "aria-hidden": "true" }),
|
|
819
819
|
/* @__PURE__ */ v("nav", { className: "shrink-0 space-y-0.5 px-2 pb-1 pt-1", "aria-label": "Primary workspace actions", children: [
|
|
820
820
|
/* @__PURE__ */ i(an, { icon: /* @__PURE__ */ i(gn, { className: "h-4 w-4", strokeWidth: 2 }), label: "New chat", onClick: D, emphasis: !0 }),
|
|
821
|
-
/* @__PURE__ */ i(an, { icon: /* @__PURE__ */ i(Zi, { className: "h-4 w-4", strokeWidth: 1.75 }), label: "Search", onClick:
|
|
821
|
+
/* @__PURE__ */ i(an, { icon: /* @__PURE__ */ i(Zi, { className: "h-4 w-4", strokeWidth: 1.75 }), label: "Search", onClick: F, trailing: /* @__PURE__ */ i(Os, { keys: "⌘K" }) }),
|
|
822
822
|
ot.map((p) => /* @__PURE__ */ i(
|
|
823
823
|
an,
|
|
824
824
|
{
|
|
@@ -858,7 +858,7 @@ function Us({
|
|
|
858
858
|
point of the body, so show Pinned + Sessions directly. */
|
|
859
859
|
/* @__PURE__ */ v("div", { className: "space-y-4 py-1", children: [
|
|
860
860
|
me.length > 0 ? /* @__PURE__ */ i(ln, { title: "Pinned", children: me.map((p) => Te(p, !0)) }) : null,
|
|
861
|
-
/* @__PURE__ */ i(ln, { title: "Chats", empty: "No chats yet.", children:
|
|
861
|
+
/* @__PURE__ */ i(ln, { title: "Chats", empty: "No chats yet.", children: ce.map((p) => Te(p, !1)) })
|
|
862
862
|
] })
|
|
863
863
|
) }),
|
|
864
864
|
O ? /* @__PURE__ */ i("footer", { className: "shrink-0 border-t border-border/40 p-2", children: O }) : null
|
|
@@ -932,7 +932,7 @@ function zs({
|
|
|
932
932
|
}
|
|
933
933
|
) : null,
|
|
934
934
|
/* @__PURE__ */ i("div", { className: "relative min-w-0 flex-1", children: r }),
|
|
935
|
-
e ? /* @__PURE__ */ v(
|
|
935
|
+
e ? /* @__PURE__ */ v(le, { children: [
|
|
936
936
|
/* @__PURE__ */ i(
|
|
937
937
|
"div",
|
|
938
938
|
{
|
|
@@ -1407,7 +1407,7 @@ function Uo({
|
|
|
1407
1407
|
apiTimeout: b,
|
|
1408
1408
|
defaultTheme: y,
|
|
1409
1409
|
onThemeChange: D,
|
|
1410
|
-
persistenceEnabled:
|
|
1410
|
+
persistenceEnabled: F,
|
|
1411
1411
|
debug: be,
|
|
1412
1412
|
bridgeEndpoint: J,
|
|
1413
1413
|
fullPageBasePath: Wt,
|
|
@@ -1417,13 +1417,13 @@ function Uo({
|
|
|
1417
1417
|
onSwitchSession: at,
|
|
1418
1418
|
onCreateSession: ve,
|
|
1419
1419
|
onDeleteSession: me,
|
|
1420
|
-
onActiveSessionIdChange:
|
|
1420
|
+
onActiveSessionIdChange: ce,
|
|
1421
1421
|
appTitle: pe = "Boring UI",
|
|
1422
1422
|
workspaceLabel: lt,
|
|
1423
1423
|
workspaceSectionTitle: It = "Workspaces",
|
|
1424
|
-
appLeftLayoutMode:
|
|
1424
|
+
appLeftLayoutMode: Ft = "single-project",
|
|
1425
1425
|
appLeftHeaderMode: Ce = "full",
|
|
1426
|
-
appLeftProjects:
|
|
1426
|
+
appLeftProjects: $t,
|
|
1427
1427
|
appLeftActiveProjectId: _e,
|
|
1428
1428
|
onSwitchAppLeftProject: xe,
|
|
1429
1429
|
onOpenAppLeftProjectSession: Ut,
|
|
@@ -1434,7 +1434,7 @@ function Uo({
|
|
|
1434
1434
|
defaultSessionTitle: p = "New session",
|
|
1435
1435
|
workspaceLayout: M = "classic",
|
|
1436
1436
|
navEnabled: W = !0,
|
|
1437
|
-
defaultNavOpen:
|
|
1437
|
+
defaultNavOpen: de = !1,
|
|
1438
1438
|
defaultSurfaceOpen: Kt,
|
|
1439
1439
|
defaultWorkbenchLeftTab: dt,
|
|
1440
1440
|
defaultWorkbenchLeftOpen: Ht,
|
|
@@ -1445,7 +1445,7 @@ function Uo({
|
|
|
1445
1445
|
showSkills: Xr = !0,
|
|
1446
1446
|
showPlugins: jr = !0,
|
|
1447
1447
|
appLeftActions: wn,
|
|
1448
|
-
chatParams:
|
|
1448
|
+
chatParams: $,
|
|
1449
1449
|
externalPlugins: Qr,
|
|
1450
1450
|
hotReloadEnabled: Zr,
|
|
1451
1451
|
frontPluginHotReload: ei,
|
|
@@ -1463,7 +1463,7 @@ function Uo({
|
|
|
1463
1463
|
const En = Qr !== !1, ii = En ? ei : !1, qt = En ? Zr : !1, Vt = a ?? `boring-ui-v2:layout:${e}`, Y = l ?? `${Vt}:surface`, De = lo(
|
|
1464
1464
|
Y,
|
|
1465
1465
|
Vt
|
|
1466
|
-
), K =
|
|
1466
|
+
), K = F !== !1, ie = M === "plugin-tabs", He = Xr !== !1, Be = jr !== !1, si = d, ft = o ?? `boring-workspace:sessions:${e}`, Se = T(
|
|
1467
1467
|
() => Lt(e, s ?? dn),
|
|
1468
1468
|
[s, e]
|
|
1469
1469
|
), oi = T(
|
|
@@ -1484,7 +1484,7 @@ function Uo({
|
|
|
1484
1484
|
})), [Cn, Le] = L(() => ({
|
|
1485
1485
|
workspaceId: e,
|
|
1486
1486
|
failed: !1
|
|
1487
|
-
})), Je = `boring-workspace:chat-panes:${e}`, [U,
|
|
1487
|
+
})), Je = `boring-workspace:chat-panes:${e}`, [U, ue] = L(
|
|
1488
1488
|
() => (K ? Lr(Je, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
|
|
1489
1489
|
), [Oe, _n] = L(null);
|
|
1490
1490
|
_(() => {
|
|
@@ -1507,7 +1507,7 @@ function Uo({
|
|
|
1507
1507
|
_(() => {
|
|
1508
1508
|
K && U.workspaceId === e && ho(Je, U);
|
|
1509
1509
|
}, [U, Je, K, e]), _(() => {
|
|
1510
|
-
|
|
1510
|
+
ue((n) => n.workspaceId === e ? n : (K ? Lr(Je, e) : null) ?? { workspaceId: e, ids: [], activeId: null });
|
|
1511
1511
|
}, [Je, K, e]);
|
|
1512
1512
|
const ht = An.workspaceId === e ? An.status : _r, li = t ?? rs, ci = r ?? fo, we = !t || !!r, bt = we && Bt !== !1, Xt = () => {
|
|
1513
1513
|
}, G = ci({
|
|
@@ -1516,9 +1516,9 @@ function Uo({
|
|
|
1516
1516
|
workspaceId: e,
|
|
1517
1517
|
apiBaseUrl: x,
|
|
1518
1518
|
enabled: bt
|
|
1519
|
-
}), [Ve, di] = L(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), Wn = bt && G.workspaceId != null && G.workspaceId !== e,
|
|
1519
|
+
}), [Ve, di] = L(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), Wn = bt && G.workspaceId != null && G.workspaceId !== e, se = bt && !G.loading && !G.error && !Wn, z = bt && !se;
|
|
1520
1520
|
_(() => {
|
|
1521
|
-
|
|
1521
|
+
se && di((n) => {
|
|
1522
1522
|
const c = n.workspaceId === e, u = n.activeSessionId === G.activeSessionId, N = n.sessions.length === G.sessions.length && n.sessions.every((w, C) => {
|
|
1523
1523
|
var j;
|
|
1524
1524
|
return w.id === ((j = G.sessions[C]) == null ? void 0 : j.id);
|
|
@@ -1529,8 +1529,8 @@ function Uo({
|
|
|
1529
1529
|
activeSessionId: G.activeSessionId
|
|
1530
1530
|
};
|
|
1531
1531
|
});
|
|
1532
|
-
}, [G.activeSessionId, G.sessions,
|
|
1533
|
-
const vt = z && Ve.workspaceId === e && Ve.sessions.length > 0, xt = z ? po(ft) : null, Mn = z && !Wn ? G.activeSessionId ?? null : null,
|
|
1532
|
+
}, [G.activeSessionId, G.sessions, se, e]);
|
|
1533
|
+
const vt = z && Ve.workspaceId === e && Ve.sessions.length > 0, xt = z ? po(ft) : null, Mn = z && !Wn ? G.activeSessionId ?? null : null, oe = se ? G.sessions : vt ? Ve.sessions : [], ui = se ? G.activeSessionId : vt ? Ve.activeSessionId : null, S = we && (se || vt) ? G : void 0, Ne = ot !== void 0 || ge !== void 0 || at !== void 0 || ve !== void 0 || me !== void 0, In = mt.workspaceId === e && mt.expired, We = H(!1), Ye = !!(se && S && !Ne && oe.length === 0 && !In), fi = Rn.workspaceId === e && Rn.creating, gi = Cn.workspaceId === e && Cn.failed, mi = !!(se && S && !Ne && oe.length === 0 && In && !We.current && !gi), Xe = !!(z && G.loading && !G.error && we && !Ne && !vt && !xt && !Mn) || Ye || fi || mi;
|
|
1534
1534
|
_(() => {
|
|
1535
1535
|
if (!Ye) {
|
|
1536
1536
|
mt.workspaceId !== e && Yt({ workspaceId: e, expired: !1 });
|
|
@@ -1542,7 +1542,7 @@ function Uo({
|
|
|
1542
1542
|
}, 2e3);
|
|
1543
1543
|
return () => globalThis.clearTimeout(n);
|
|
1544
1544
|
}, [mt.workspaceId, Ye, e]);
|
|
1545
|
-
const pi = S ?
|
|
1545
|
+
const pi = S ? oe.map((n) => ({
|
|
1546
1546
|
...n,
|
|
1547
1547
|
title: n.title ?? "New session"
|
|
1548
1548
|
})) : void 0, hi = xt ? [{
|
|
@@ -1551,10 +1551,10 @@ function Uo({
|
|
|
1551
1551
|
createdAt: (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
1552
1552
|
updatedAt: (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
1553
1553
|
turnCount: 0
|
|
1554
|
-
}] : [], V = S ? pi ?? [] : z ? hi : Ne ? ot ?? [] : kn.sessions, bi = S ? ui ?? null : z ? xt ?? Mn : Ne ? ge ?? null : kn.activeId, Me = (
|
|
1554
|
+
}] : [], V = S ? pi ?? [] : z ? hi : Ne ? ot ?? [] : kn.sessions, bi = S ? ui ?? null : z ? xt ?? Mn : Ne ? ge ?? null : kn.activeId, Me = ($ == null ? void 0 : $.autoSubmitInitialDraft) === !0, yt = Me && we && !Ne, [ee, je] = L(() => yt ? null : void 0), Fn = H(e), Ie = H(!1);
|
|
1555
1555
|
_(() => {
|
|
1556
|
-
if (
|
|
1557
|
-
|
|
1556
|
+
if (Fn.current !== e) {
|
|
1557
|
+
Fn.current = e, Ie.current = !1, je(yt ? null : void 0);
|
|
1558
1558
|
return;
|
|
1559
1559
|
}
|
|
1560
1560
|
yt && ee === void 0 && (Ie.current = !1, je(null));
|
|
@@ -1567,27 +1567,27 @@ function Uo({
|
|
|
1567
1567
|
Ie.current = !1, je(void 0);
|
|
1568
1568
|
}));
|
|
1569
1569
|
}, [ee, p, S]);
|
|
1570
|
-
const X = ee !== void 0 ? ee ?? null : bi, Q = z ? Xt : (S == null ? void 0 : S.switch) ?? at ?? gt.switchTo, St = A((n) => (X && n !== X && gs({ sessionId: X, reason: ms.sessionSwitch }), Q(n)), [X, Q]), Qe = z ? Xt : S ? () => S.create() : ve ? () => ve() : () => gt.create(),
|
|
1571
|
-
if (S && z &&
|
|
1572
|
-
return We.current = !0,
|
|
1573
|
-
if (S && !z &&
|
|
1570
|
+
const X = ee !== void 0 ? ee ?? null : bi, Q = z ? Xt : (S == null ? void 0 : S.switch) ?? at ?? gt.switchTo, St = A((n) => (X && n !== X && gs({ sessionId: X, reason: ms.sessionSwitch }), Q(n)), [X, Q]), Qe = z ? Xt : S ? () => S.create() : ve ? () => ve() : () => gt.create(), Fe = z ? Xt : (S == null ? void 0 : S.delete) ?? me ?? gt.remove, $n = A((n) => {
|
|
1571
|
+
if (S && z && oe.length <= 1)
|
|
1572
|
+
return We.current = !0, Fe(n);
|
|
1573
|
+
if (S && !z && oe.length <= 1) {
|
|
1574
1574
|
if (S.hasMore)
|
|
1575
|
-
return We.current = !0,
|
|
1575
|
+
return We.current = !0, Fe(n);
|
|
1576
1576
|
if (Nt.current.has(n)) return Promise.resolve();
|
|
1577
1577
|
Nt.current.add(n), Ee.current = !0, Le({ workspaceId: e, failed: !1 });
|
|
1578
1578
|
const c = S.create({ title: p });
|
|
1579
1579
|
return Promise.resolve(
|
|
1580
|
-
c && typeof c.then == "function" ? Promise.resolve(c).then(() =>
|
|
1580
|
+
c && typeof c.then == "function" ? Promise.resolve(c).then(() => Fe(n)) : Fe(n)
|
|
1581
1581
|
).catch((u) => {
|
|
1582
1582
|
throw Ee.current = !1, Le({ workspaceId: e, failed: !0 }), u;
|
|
1583
1583
|
}).finally(() => {
|
|
1584
1584
|
Nt.current.delete(n);
|
|
1585
1585
|
});
|
|
1586
1586
|
}
|
|
1587
|
-
return
|
|
1588
|
-
}, [
|
|
1587
|
+
return Fe(n);
|
|
1588
|
+
}, [oe.length, p, Fe, z, S, e]), Un = ((br = V.find((n) => n.id === X)) == null ? void 0 : br.title) ?? void 0, [vi, Gn] = Tt(
|
|
1589
1589
|
`${De}:drawer`,
|
|
1590
|
-
|
|
1590
|
+
de,
|
|
1591
1591
|
K
|
|
1592
1592
|
), [wt, zn] = Tt(
|
|
1593
1593
|
`${De}:appLeftPaneCollapsed`,
|
|
@@ -1597,11 +1597,11 @@ function Uo({
|
|
|
1597
1597
|
`${De}:appLeftPaneWidth`,
|
|
1598
1598
|
268,
|
|
1599
1599
|
K
|
|
1600
|
-
), Kn = Tr(xi, 220, 420), [Ze,
|
|
1600
|
+
), Kn = Tr(xi, 220, 420), [Ze, te] = L(null);
|
|
1601
1601
|
_(() => {
|
|
1602
|
-
(Ze === "skills" && !He || Ze === "plugins" && !Be) &&
|
|
1602
|
+
(Ze === "skills" && !He || Ze === "plugins" && !Be) && te(null);
|
|
1603
1603
|
}, [Ze, Be, He]);
|
|
1604
|
-
const Hn = W && vi, [fe,
|
|
1604
|
+
const Hn = W && vi, [fe, ne] = Tt(
|
|
1605
1605
|
// Key must NOT match resolvedSurfaceStorageKey (which stores the dockview
|
|
1606
1606
|
// layout JSON at the same ":surface" suffix). Writing "1"/"0" to the same
|
|
1607
1607
|
// key corrupts the JSON and drops the persisted workbench layout on reload.
|
|
@@ -1613,7 +1613,7 @@ function Uo({
|
|
|
1613
1613
|
Ht ?? !1,
|
|
1614
1614
|
K
|
|
1615
1615
|
), [Ni, et] = L(() => Ht ?? !1), Pi = Ht === !1 ? Ni : wi, Ei = A(() => {
|
|
1616
|
-
Pe(!1), et(!1),
|
|
1616
|
+
Pe(!1), et(!1), te(null);
|
|
1617
1617
|
}, [Pe]), Ee = H(!1), Nt = H(/* @__PURE__ */ new Set()), ke = H(null), he = H(fe), Bn = H(Y), Qt = H(null), Zt = H([]);
|
|
1618
1618
|
Bn.current = Y;
|
|
1619
1619
|
const [Jn, qn] = L(() => ({
|
|
@@ -1626,7 +1626,7 @@ function Uo({
|
|
|
1626
1626
|
jt(!1), Zt.current = [];
|
|
1627
1627
|
}, [Y]), _(() => {
|
|
1628
1628
|
if (!(!S || S.loading) && !Ye && ee === void 0) {
|
|
1629
|
-
if (
|
|
1629
|
+
if (oe.length > 0) {
|
|
1630
1630
|
Ee.current = !1, We.current = !1, pt((n) => n.workspaceId === e && n.creating ? { workspaceId: e, creating: !1 } : n), Le((n) => n.workspaceId === e && n.failed ? { workspaceId: e, failed: !1 } : n);
|
|
1631
1631
|
return;
|
|
1632
1632
|
}
|
|
@@ -1634,7 +1634,7 @@ function Uo({
|
|
|
1634
1634
|
Ee.current = !1, pt({ workspaceId: e, creating: !1 }), Le({ workspaceId: e, failed: !0 });
|
|
1635
1635
|
}));
|
|
1636
1636
|
}
|
|
1637
|
-
}, [
|
|
1637
|
+
}, [oe.length, ee, p, Ye, S, e]), _(() => {
|
|
1638
1638
|
he.current = fe;
|
|
1639
1639
|
}, [fe]);
|
|
1640
1640
|
const Vn = A((n) => {
|
|
@@ -1651,48 +1651,48 @@ function Uo({
|
|
|
1651
1651
|
key: Y,
|
|
1652
1652
|
snapshot: n
|
|
1653
1653
|
});
|
|
1654
|
-
}, [Y]),
|
|
1654
|
+
}, [Y]), $e = A(() => {
|
|
1655
1655
|
const n = Qt.current;
|
|
1656
1656
|
return (n == null ? void 0 : n.key) === Bn.current ? n.api : null;
|
|
1657
1657
|
}, []), Xn = A(() => he.current, []), jn = A(() => {
|
|
1658
|
-
he.current = !0,
|
|
1659
|
-
}, [
|
|
1660
|
-
he.current = !0,
|
|
1661
|
-
}, [
|
|
1662
|
-
he.current = !1, Qt.current = null, jt(!1),
|
|
1663
|
-
}, [
|
|
1658
|
+
he.current = !0, ne(!0);
|
|
1659
|
+
}, [ne]), Qn = A(() => {
|
|
1660
|
+
he.current = !0, ne(!0), Pe(!0), et(!0);
|
|
1661
|
+
}, [ne, Pe]), Et = A(() => {
|
|
1662
|
+
he.current = !1, Qt.current = null, jt(!1), ne(!1);
|
|
1663
|
+
}, [ne]), Zn = H(/* @__PURE__ */ new Set()), er = A((n) => {
|
|
1664
1664
|
const c = n.meta;
|
|
1665
1665
|
if (!c || c.openOnlyWhenSessionOpen !== !0) return !0;
|
|
1666
1666
|
const u = typeof c.sessionId == "string" ? c.sessionId : null;
|
|
1667
1667
|
return u ? Zn.current.has(u) : !1;
|
|
1668
1668
|
}, []), Ue = T(() => ({
|
|
1669
|
-
surface:
|
|
1669
|
+
surface: $e,
|
|
1670
1670
|
isWorkbenchOpen: Xn,
|
|
1671
1671
|
openWorkbench: jn,
|
|
1672
1672
|
openWorkbenchSources: Qn,
|
|
1673
1673
|
closeWorkbench: Et,
|
|
1674
1674
|
enqueue: Pt,
|
|
1675
1675
|
shouldOpenSurface: er
|
|
1676
|
-
}), [
|
|
1676
|
+
}), [$e, Xn, jn, Qn, Et, Pt, er]);
|
|
1677
1677
|
A((n) => {
|
|
1678
|
-
if (he.current = !0,
|
|
1679
|
-
const c = (N) => N.openPanel(n), u =
|
|
1678
|
+
if (he.current = !0, ne(!0), ye == null || ye(), !n) return;
|
|
1679
|
+
const c = (N) => N.openPanel(n), u = $e();
|
|
1680
1680
|
u ? c(u) : Pt(c);
|
|
1681
|
-
}, [Pt,
|
|
1681
|
+
}, [Pt, $e, ye, ne]);
|
|
1682
1682
|
const Ai = T(() => ({
|
|
1683
1683
|
openFile: async (n) => (Nr({ kind: "openFile", params: { path: n } }, Ue), { seq: 0, status: "ok" }),
|
|
1684
1684
|
getActiveFile: () => {
|
|
1685
1685
|
var n;
|
|
1686
|
-
return ((n =
|
|
1686
|
+
return ((n = $e()) == null ? void 0 : n.getSnapshot().activeTab) ?? null;
|
|
1687
1687
|
},
|
|
1688
1688
|
select: () => () => {
|
|
1689
1689
|
}
|
|
1690
|
-
}), [
|
|
1690
|
+
}), [$e, Ue]), Ge = T(
|
|
1691
1691
|
() => (R == null ? void 0 : R.map(ps)) ?? [],
|
|
1692
1692
|
[R]
|
|
1693
1693
|
), en = T(
|
|
1694
|
-
() => !
|
|
1695
|
-
[Ge,
|
|
1694
|
+
() => !ie && Ge.some((n) => n.registrations.workspaceSources.length > 0),
|
|
1695
|
+
[Ge, ie]
|
|
1696
1696
|
), tr = T(
|
|
1697
1697
|
() => Ge.flatMap((n) => n.registrations.panels.map((c) => c.id)),
|
|
1698
1698
|
[Ge]
|
|
@@ -1709,14 +1709,14 @@ function Uo({
|
|
|
1709
1709
|
_(() => {
|
|
1710
1710
|
var j, rt;
|
|
1711
1711
|
if (Xe) return;
|
|
1712
|
-
const n = ke.current, c = new Set(V.map((
|
|
1712
|
+
const n = ke.current, c = new Set(V.map((re) => re.id)), u = n ? n.createdId ?? (c.has(P) && !n.knownIds.has(P) ? P : ((j = V.find((re) => !n.knownIds.has(re.id))) == null ? void 0 : j.id) ?? null) : null;
|
|
1713
1713
|
u && c.has(u) && (ke.current = null);
|
|
1714
1714
|
const N = P === "default" && ee !== void 0, w = ir && c.size > 0 && !N, C = u ?? (w && !c.has(P) ? ((rt = V[0]) == null ? void 0 : rt.id) ?? P : P);
|
|
1715
|
-
|
|
1716
|
-
const Ae =
|
|
1715
|
+
ue((re) => {
|
|
1716
|
+
const Ae = re.workspaceId === e ? re : { workspaceId: e, ids: [], activeId: null };
|
|
1717
1717
|
if (z && Ae.ids.length > 0 && !u) return Ae;
|
|
1718
1718
|
const xr = Ae.ids.length > 0 ? Ae.ids : [C], yr = w ? xr.filter((Rt) => c.has(Rt) || Rt === u) : xr, Ke = yr.length > 0 ? yr : [C], Sr = Ae.activeId && Ke.includes(Ae.activeId) ? Ae.activeId : Ke[0] ?? C, it = u ? _t(Ke, n == null ? void 0 : n.afterId, u) : C === Sr || Ke.includes(C) ? Ke : cn(Ke, Sr, C), wr = it.includes(C) ? C : it[0] ?? C;
|
|
1719
|
-
return
|
|
1719
|
+
return re.workspaceId === e && re.activeId === wr && re.ids.length === it.length && re.ids.every((Rt, zi) => Rt === it[zi]) ? re : { workspaceId: e, ids: it, activeId: wr };
|
|
1720
1720
|
});
|
|
1721
1721
|
}, [ee, P, z, Xe, V, ir, e]);
|
|
1722
1722
|
const sr = T(() => {
|
|
@@ -1728,12 +1728,12 @@ function Uo({
|
|
|
1728
1728
|
ids: /* @__PURE__ */ new Set()
|
|
1729
1729
|
})), ar = T(() => {
|
|
1730
1730
|
const n = /* @__PURE__ */ new Set();
|
|
1731
|
-
if (!
|
|
1731
|
+
if (!se) return n;
|
|
1732
1732
|
const c = tn.workspaceId === e ? tn.ids : /* @__PURE__ */ new Set();
|
|
1733
|
-
for (const u of
|
|
1733
|
+
for (const u of oe)
|
|
1734
1734
|
u.turnCount === 0 && !c.has(u.id) && n.add(u.id);
|
|
1735
1735
|
return n;
|
|
1736
|
-
}, [
|
|
1736
|
+
}, [oe, tn, se, e]);
|
|
1737
1737
|
_(() => {
|
|
1738
1738
|
or((n) => n.workspaceId === e ? n : { workspaceId: e, ids: /* @__PURE__ */ new Set() });
|
|
1739
1739
|
}, [e]);
|
|
@@ -1741,20 +1741,21 @@ function Uo({
|
|
|
1741
1741
|
_(() => {
|
|
1742
1742
|
Zn.current = new Set(Z);
|
|
1743
1743
|
}, [Z]);
|
|
1744
|
-
const
|
|
1744
|
+
const ae = nn.activeId ?? Z[0] ?? P, kt = A((n) => {
|
|
1745
|
+
te(null);
|
|
1745
1746
|
const u = (U.workspaceId === e ? U : { ids: [P] }).ids.includes(n);
|
|
1746
|
-
return
|
|
1747
|
+
return ue((N) => {
|
|
1747
1748
|
const w = N.workspaceId === e ? N : { ids: [P], activeId: P }, C = w.ids.includes(n) ? w.ids : cn(w.ids, w.activeId, n);
|
|
1748
1749
|
return { workspaceId: e, ids: C, activeId: n };
|
|
1749
1750
|
}), u ? Q(n) : St(n);
|
|
1750
|
-
}, [U, P, Q, St, e]), Ri = A((n) => (
|
|
1751
|
+
}, [U, P, Q, St, e]), Ri = A((n) => (ue((c) => {
|
|
1751
1752
|
const u = c.workspaceId === e ? c : { ids: [P], activeId: P };
|
|
1752
1753
|
return {
|
|
1753
1754
|
workspaceId: e,
|
|
1754
1755
|
ids: u.ids.includes(n) ? u.ids : _t(u.ids, u.activeId, n),
|
|
1755
1756
|
activeId: n
|
|
1756
1757
|
};
|
|
1757
|
-
}), Q(n)), [P, Q, e]), tt = A((n) => ((U.workspaceId === e ? U : { ids: [P] }).ids.includes(n) && _n({ workspaceId: e, id: n }),
|
|
1758
|
+
}), Q(n)), [P, Q, e]), tt = A((n) => (te(null), (U.workspaceId === e ? U : { ids: [P] }).ids.includes(n) && _n({ workspaceId: e, id: n }), ue((u) => {
|
|
1758
1759
|
const N = u.workspaceId === e ? u : { ids: [P], activeId: P };
|
|
1759
1760
|
return {
|
|
1760
1761
|
workspaceId: e,
|
|
@@ -1767,12 +1768,12 @@ function Uo({
|
|
|
1767
1768
|
const u = c.ids.indexOf(n);
|
|
1768
1769
|
if (u < 0) return;
|
|
1769
1770
|
const N = c.ids.filter((C) => C !== n), w = c.activeId === n ? N[Math.max(0, u - 1)] ?? N[0] ?? null : c.activeId;
|
|
1770
|
-
|
|
1771
|
+
ue({ workspaceId: e, ids: N, activeId: w }), w && c.activeId === n && Q(w);
|
|
1771
1772
|
}, [U, P, Q, e]), lr = A(() => {
|
|
1772
1773
|
const n = Qe();
|
|
1773
1774
|
return Promise.resolve(n).then((c) => {
|
|
1774
1775
|
const u = Cr(c);
|
|
1775
|
-
u && (
|
|
1776
|
+
u && (ue((N) => {
|
|
1776
1777
|
const w = N.workspaceId === e ? N : { ids: [P], activeId: P }, C = w.ids.length > 0 ? w.ids : [P], j = w.activeId ?? C[0] ?? P;
|
|
1777
1778
|
return {
|
|
1778
1779
|
workspaceId: e,
|
|
@@ -1791,7 +1792,7 @@ function Uo({
|
|
|
1791
1792
|
const u = Qe();
|
|
1792
1793
|
return Promise.resolve(u).then((N) => {
|
|
1793
1794
|
const w = Cr(N);
|
|
1794
|
-
w && (ke.current === c && (ke.current = { ...c, createdId: w }),
|
|
1795
|
+
w && (ke.current === c && (ke.current = { ...c, createdId: w }), ue((C) => {
|
|
1795
1796
|
const j = C.workspaceId === e ? C : { ids: [P] };
|
|
1796
1797
|
return {
|
|
1797
1798
|
workspaceId: e,
|
|
@@ -1807,10 +1808,10 @@ function Uo({
|
|
|
1807
1808
|
let N = c.activeId;
|
|
1808
1809
|
if (u >= 0) {
|
|
1809
1810
|
const w = c.ids.filter((C) => C !== n);
|
|
1810
|
-
N = c.activeId === n ? w[Math.max(0, u - 1)] ?? w[0] ?? null : c.activeId,
|
|
1811
|
+
N = c.activeId === n ? w[Math.max(0, u - 1)] ?? w[0] ?? null : c.activeId, ue({ workspaceId: e, ids: w, activeId: N }), N && c.activeId === n && St(N);
|
|
1811
1812
|
}
|
|
1812
|
-
return
|
|
1813
|
-
}, [U, P,
|
|
1813
|
+
return $n(n);
|
|
1814
|
+
}, [U, P, $n, St, e]), dr = A(() => Z.length >= 2 ? rn(ae) : lr(), [ae, Z.length, rn, lr]), [_i, sn] = L(Me), ur = H(e);
|
|
1814
1815
|
_(() => {
|
|
1815
1816
|
if (ur.current !== e) {
|
|
1816
1817
|
ur.current = e, sn(Me);
|
|
@@ -1832,8 +1833,8 @@ function Uo({
|
|
|
1832
1833
|
return (u = globalThis.removeEventListener) == null ? void 0 : u.call(globalThis, Pr, n);
|
|
1833
1834
|
};
|
|
1834
1835
|
}, [Ue]), _(() => {
|
|
1835
|
-
z ||
|
|
1836
|
-
}, [X,
|
|
1836
|
+
z || ce == null || ce(X ?? null);
|
|
1837
|
+
}, [X, ce, z]);
|
|
1837
1838
|
const on = ht.status !== "ready", Di = on ? /* @__PURE__ */ i(to, { status: ht }) : void 0, nt = A(async (n) => {
|
|
1838
1839
|
const c = `${(x == null ? void 0 : x.replace(/\/$/, "")) ?? ""}/api/v1/agent/reload`;
|
|
1839
1840
|
try {
|
|
@@ -1851,9 +1852,9 @@ function Uo({
|
|
|
1851
1852
|
}
|
|
1852
1853
|
}, [x, Se]), ze = A(
|
|
1853
1854
|
(n, c = {}) => {
|
|
1854
|
-
const u = c.bridgeEnabled ?? !0, N =
|
|
1855
|
+
const u = c.bridgeEnabled ?? !0, N = $ != null && $.toolRenderers && typeof $.toolRenderers == "object" ? $.toolRenderers : void 0;
|
|
1855
1856
|
return {
|
|
1856
|
-
|
|
1857
|
+
...$,
|
|
1857
1858
|
...fr ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
|
|
1858
1859
|
sessionId: n,
|
|
1859
1860
|
apiBaseUrl: x,
|
|
@@ -1861,7 +1862,7 @@ function Uo({
|
|
|
1861
1862
|
storageScope: e,
|
|
1862
1863
|
requestHeaders: Se,
|
|
1863
1864
|
showSessions: !1,
|
|
1864
|
-
onReloadAgentPlugins: (
|
|
1865
|
+
onReloadAgentPlugins: ($ == null ? void 0 : $.onReloadAgentPlugins) ?? (() => nt(n)),
|
|
1865
1866
|
toolRenderers: { ...nr, ...N ?? {} },
|
|
1866
1867
|
bridgeEndpoint: u ? J : null,
|
|
1867
1868
|
surfaceDispatch: Ue,
|
|
@@ -1880,12 +1881,12 @@ function Uo({
|
|
|
1880
1881
|
onTurnComplete: () => {
|
|
1881
1882
|
var C;
|
|
1882
1883
|
(C = S == null ? void 0 : S.refresh) == null || C.call(S, { background: !0 });
|
|
1883
|
-
const w =
|
|
1884
|
+
const w = $ == null ? void 0 : $.onTurnComplete;
|
|
1884
1885
|
typeof w == "function" && w();
|
|
1885
1886
|
},
|
|
1886
1887
|
onAutoSubmitInitialDraftSettled: () => {
|
|
1887
1888
|
Ie.current = !1, sn(!1), je(void 0);
|
|
1888
|
-
const w =
|
|
1889
|
+
const w = $ == null ? void 0 : $.onAutoSubmitInitialDraftSettled;
|
|
1889
1890
|
typeof w == "function" && w();
|
|
1890
1891
|
},
|
|
1891
1892
|
// Forward the explicit prop when set. Omitting the key (when undefined)
|
|
@@ -1894,7 +1895,7 @@ function Uo({
|
|
|
1894
1895
|
...qt !== void 0 ? { hotReloadEnabled: qt } : {}
|
|
1895
1896
|
};
|
|
1896
1897
|
},
|
|
1897
|
-
[x,
|
|
1898
|
+
[x, $, fr, Se, J, Ue, Pn, ht, gr, ar, qt, nr, nt, S, e]
|
|
1898
1899
|
), Li = T(
|
|
1899
1900
|
() => ze(P),
|
|
1900
1901
|
[P, ze]
|
|
@@ -1902,7 +1903,7 @@ function Uo({
|
|
|
1902
1903
|
(!At.current || At.current.make !== ze) && (At.current = { make: ze, cache: /* @__PURE__ */ new Map() });
|
|
1903
1904
|
const { cache: n } = At.current;
|
|
1904
1905
|
return Z.map((c) => {
|
|
1905
|
-
const u = c ===
|
|
1906
|
+
const u = c === ae, N = `${c}:${u}`;
|
|
1906
1907
|
let w = n.get(N);
|
|
1907
1908
|
return w || (w = ze(c, { bridgeEnabled: u }), n.set(N, w)), {
|
|
1908
1909
|
id: c,
|
|
@@ -1911,7 +1912,7 @@ function Uo({
|
|
|
1911
1912
|
params: w
|
|
1912
1913
|
};
|
|
1913
1914
|
});
|
|
1914
|
-
}, [
|
|
1915
|
+
}, [ae, Z, p, ze, sr]), Wi = T(() => ({
|
|
1915
1916
|
storageKey: Y,
|
|
1916
1917
|
defaultLeftTab: dt,
|
|
1917
1918
|
initialPanels: vn,
|
|
@@ -1932,7 +1933,7 @@ function Uo({
|
|
|
1932
1933
|
Vn,
|
|
1933
1934
|
Y,
|
|
1934
1935
|
rr,
|
|
1935
|
-
|
|
1936
|
+
ne
|
|
1936
1937
|
]), mr = () => {
|
|
1937
1938
|
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
1938
1939
|
key: "k",
|
|
@@ -1941,12 +1942,12 @@ function Uo({
|
|
|
1941
1942
|
bubbles: !0,
|
|
1942
1943
|
cancelable: !0
|
|
1943
1944
|
}));
|
|
1944
|
-
}, pr = /* @__PURE__ */ v(
|
|
1945
|
+
}, pr = /* @__PURE__ */ v(le, { children: [
|
|
1945
1946
|
Sn ? /* @__PURE__ */ i(Cs, {}) : null,
|
|
1946
1947
|
yn
|
|
1947
1948
|
] }), Mi = {
|
|
1948
1949
|
sessions: V,
|
|
1949
|
-
activeId:
|
|
1950
|
+
activeId: ae,
|
|
1950
1951
|
openIds: Z,
|
|
1951
1952
|
pinnedIds: Ln,
|
|
1952
1953
|
onTogglePin: On,
|
|
@@ -1958,37 +1959,37 @@ function Uo({
|
|
|
1958
1959
|
hasMore: S == null ? void 0 : S.hasMore,
|
|
1959
1960
|
loadingMore: S == null ? void 0 : S.loadingMore,
|
|
1960
1961
|
onClose: () => Gn(!1)
|
|
1961
|
-
}, Ii = !!(S || me || !Ne),
|
|
1962
|
+
}, Ii = !!(S || me || !Ne), Fi = T(() => ie ? {
|
|
1962
1963
|
sessions: V,
|
|
1963
|
-
activeId:
|
|
1964
|
+
activeId: ae,
|
|
1964
1965
|
openIds: Z,
|
|
1965
1966
|
search: (n, c) => ns(n, c, { limit: 8 }),
|
|
1966
1967
|
onSwitch: kt,
|
|
1967
1968
|
onOpenAsTab: tt
|
|
1968
|
-
} : void 0, [
|
|
1969
|
+
} : void 0, [ae, Z, ie, tt, V, kt]), $i = T(() => {
|
|
1969
1970
|
const n = [...wn ?? []];
|
|
1970
1971
|
return Be && n.push({
|
|
1971
1972
|
id: "plugins",
|
|
1972
1973
|
label: "Plugins",
|
|
1973
1974
|
icon: /* @__PURE__ */ i(Ir, { className: "h-4 w-4", strokeWidth: 1.75 }),
|
|
1974
|
-
onClick: () =>
|
|
1975
|
+
onClick: () => te((c) => c === "plugins" ? null : "plugins")
|
|
1975
1976
|
}), He && n.push({
|
|
1976
1977
|
id: "skills",
|
|
1977
1978
|
label: "Skills",
|
|
1978
1979
|
icon: /* @__PURE__ */ i(Mr, { className: "h-4 w-4", strokeWidth: 1.75 }),
|
|
1979
|
-
onClick: () =>
|
|
1980
|
+
onClick: () => te((c) => c === "skills" ? null : "skills")
|
|
1980
1981
|
}), n;
|
|
1981
1982
|
}, [wn, Be, He]), Ui = Ze === "skills" && He ? /* @__PURE__ */ i(
|
|
1982
1983
|
_s,
|
|
1983
1984
|
{
|
|
1984
|
-
onClose: () =>
|
|
1985
|
+
onClose: () => te(null),
|
|
1985
1986
|
headerInsetStart: wt,
|
|
1986
1987
|
headerInsetEnd: !fe
|
|
1987
1988
|
}
|
|
1988
1989
|
) : Ze === "plugins" && Be ? /* @__PURE__ */ i(
|
|
1989
1990
|
Ds,
|
|
1990
1991
|
{
|
|
1991
|
-
onClose: () =>
|
|
1992
|
+
onClose: () => te(null),
|
|
1992
1993
|
onReloadExternalPlugins: () => nt(X ?? P),
|
|
1993
1994
|
headerInsetStart: wt,
|
|
1994
1995
|
headerInsetEnd: !fe
|
|
@@ -1997,21 +1998,21 @@ function Uo({
|
|
|
1997
1998
|
Es,
|
|
1998
1999
|
{
|
|
1999
2000
|
className: ri,
|
|
2000
|
-
nav:
|
|
2001
|
+
nav: ie ? null : Hn ? "session-list" : null,
|
|
2001
2002
|
navParams: Mi,
|
|
2002
2003
|
center: "chat",
|
|
2003
2004
|
centerParams: Li,
|
|
2004
2005
|
chatPanes: Oi,
|
|
2005
|
-
activeChatPaneId:
|
|
2006
|
+
activeChatPaneId: ae,
|
|
2006
2007
|
onActiveChatPaneChange: Ri,
|
|
2007
2008
|
onCloseChatPane: Ci,
|
|
2008
|
-
onCreateChatPaneAfter:
|
|
2009
|
+
onCreateChatPaneAfter: ie ? void 0 : rn,
|
|
2009
2010
|
onDropChatSession: tt,
|
|
2010
2011
|
flashChatPaneId: (Oe == null ? void 0 : Oe.workspaceId) === e ? Oe.id : null,
|
|
2011
2012
|
surface: fe ? "artifact-surface" : null,
|
|
2012
2013
|
surfaceParams: Wi,
|
|
2013
|
-
chatOverlay:
|
|
2014
|
-
onCloseChatOverlay: () =>
|
|
2014
|
+
chatOverlay: ie ? Ui : null,
|
|
2015
|
+
onCloseChatOverlay: () => te(null),
|
|
2015
2016
|
surfaceOverlay: Di,
|
|
2016
2017
|
sidebar: fe && !on && en && Pi ? "workbench-left" : null,
|
|
2017
2018
|
sidebarParams: fe && !on && en ? {
|
|
@@ -2025,18 +2026,18 @@ function Uo({
|
|
|
2025
2026
|
}
|
|
2026
2027
|
} : void 0,
|
|
2027
2028
|
storageKey: K ? De : void 0,
|
|
2028
|
-
onOpenNav: !
|
|
2029
|
+
onOpenNav: !ie && W ? () => {
|
|
2029
2030
|
Gn(!0), Jt == null || Jt();
|
|
2030
2031
|
} : void 0,
|
|
2031
2032
|
onOpenSurface: () => {
|
|
2032
|
-
he.current = !0,
|
|
2033
|
+
he.current = !0, ne(!0), ye == null || ye();
|
|
2033
2034
|
},
|
|
2034
2035
|
surfaceButtonBottomOffset: ni,
|
|
2035
2036
|
onOpenSidebar: en ? () => {
|
|
2036
|
-
he.current = !0,
|
|
2037
|
+
he.current = !0, ne(!0), Pe(!0), et(!0);
|
|
2037
2038
|
} : void 0
|
|
2038
2039
|
}
|
|
2039
|
-
), Gi =
|
|
2040
|
+
), Gi = ie ? /* @__PURE__ */ i(
|
|
2040
2041
|
zs,
|
|
2041
2042
|
{
|
|
2042
2043
|
collapsed: wt,
|
|
@@ -2053,15 +2054,15 @@ function Uo({
|
|
|
2053
2054
|
appTitle: pe,
|
|
2054
2055
|
workspaceLabel: lt,
|
|
2055
2056
|
workspaceSectionTitle: It,
|
|
2056
|
-
layoutMode:
|
|
2057
|
+
layoutMode: Ft,
|
|
2057
2058
|
headerMode: Ce,
|
|
2058
|
-
projects:
|
|
2059
|
+
projects: $t,
|
|
2059
2060
|
activeProjectId: _e ?? e,
|
|
2060
2061
|
onOpenProjectSession: Ut,
|
|
2061
2062
|
onShowMoreProjectSessions: Gt,
|
|
2062
2063
|
onCreateProject: zt,
|
|
2063
2064
|
onCreateProjectSession: (n) => {
|
|
2064
|
-
n === (_e ?? e) ? (
|
|
2065
|
+
n === (_e ?? e) ? (te(null), dr()) : xe == null || xe(n);
|
|
2065
2066
|
},
|
|
2066
2067
|
onOpenProjectSettings: Te,
|
|
2067
2068
|
onOpenProjectInNewTab: ct,
|
|
@@ -2069,18 +2070,18 @@ function Uo({
|
|
|
2069
2070
|
topSlot: xn,
|
|
2070
2071
|
bottomSlot: Sn || yn != null ? /* @__PURE__ */ i("div", { className: "flex w-full min-w-0 items-center gap-2", children: pr }) : void 0,
|
|
2071
2072
|
sessions: V,
|
|
2072
|
-
activeSessionId:
|
|
2073
|
+
activeSessionId: ae,
|
|
2073
2074
|
openSessionIds: Z,
|
|
2074
2075
|
pinnedSessionIds: Ln,
|
|
2075
2076
|
onCreateSession: () => {
|
|
2076
|
-
|
|
2077
|
+
te(null), dr();
|
|
2077
2078
|
},
|
|
2078
2079
|
onOpenCommandPalette: mr,
|
|
2079
2080
|
onSwitchSession: kt,
|
|
2080
2081
|
onOpenSessionAsPane: tt,
|
|
2081
2082
|
onToggleSessionPinned: On,
|
|
2082
2083
|
onDeleteSession: Ii ? cr : void 0,
|
|
2083
|
-
actions:
|
|
2084
|
+
actions: $i
|
|
2084
2085
|
}
|
|
2085
2086
|
),
|
|
2086
2087
|
children: hr
|
|
@@ -2111,7 +2112,7 @@ function Uo({
|
|
|
2111
2112
|
apiBaseUrl: x,
|
|
2112
2113
|
authHeaders: oi,
|
|
2113
2114
|
apiTimeout: b,
|
|
2114
|
-
activeSessionId:
|
|
2115
|
+
activeSessionId: ae,
|
|
2115
2116
|
openSessionIds: Z,
|
|
2116
2117
|
defaultTheme: y,
|
|
2117
2118
|
onThemeChange: D,
|
|
@@ -2119,13 +2120,13 @@ function Uo({
|
|
|
2119
2120
|
workspaceLabel: lt,
|
|
2120
2121
|
appTitle: pe,
|
|
2121
2122
|
storageKey: Vt,
|
|
2122
|
-
persistenceEnabled:
|
|
2123
|
+
persistenceEnabled: F,
|
|
2123
2124
|
debug: be,
|
|
2124
2125
|
bridgeEndpoint: null,
|
|
2125
2126
|
onAuthError: Mt,
|
|
2126
2127
|
frontPluginHotReload: ii,
|
|
2127
2128
|
fullPageBasePath: Wt,
|
|
2128
|
-
commandPaletteSessionSearch:
|
|
2129
|
+
commandPaletteSessionSearch: Fi,
|
|
2129
2130
|
children: [
|
|
2130
2131
|
f,
|
|
2131
2132
|
/* @__PURE__ */ i(
|
|
@@ -2144,7 +2145,7 @@ function Uo({
|
|
|
2144
2145
|
{
|
|
2145
2146
|
bridgeEndpoint: J,
|
|
2146
2147
|
requestHeaders: Se,
|
|
2147
|
-
navOpen:
|
|
2148
|
+
navOpen: ie ? !wt : Hn,
|
|
2148
2149
|
surfaceOpen: fe,
|
|
2149
2150
|
surfaceReady: Si,
|
|
2150
2151
|
snapshot: ki
|
|
@@ -2225,14 +2226,14 @@ function Go({
|
|
|
2225
2226
|
}
|
|
2226
2227
|
}
|
|
2227
2228
|
return O(), () => m.abort();
|
|
2228
|
-
}, [r, s, o, t, e]), g.status === "ready" ? /* @__PURE__ */ i(
|
|
2229
|
+
}, [r, s, o, t, e]), g.status === "ready" ? /* @__PURE__ */ i(le, { children: f }) : g.status === "error" ? typeof l == "function" ? /* @__PURE__ */ i(le, { children: l(g.message) }) : l ? /* @__PURE__ */ i(le, { children: l }) : /* @__PURE__ */ i(
|
|
2229
2230
|
Ar,
|
|
2230
2231
|
{
|
|
2231
2232
|
title: "Workspace failed to open",
|
|
2232
2233
|
description: g.message,
|
|
2233
2234
|
status: "Retry by reloading the page"
|
|
2234
2235
|
}
|
|
2235
|
-
) : typeof a == "function" ? /* @__PURE__ */ i(
|
|
2236
|
+
) : typeof a == "function" ? /* @__PURE__ */ i(le, { children: a(g.label) }) : a ? /* @__PURE__ */ i(le, { children: a }) : /* @__PURE__ */ i(
|
|
2236
2237
|
Ar,
|
|
2237
2238
|
{
|
|
2238
2239
|
title: "Opening workspace",
|