@hachej/boring-workspace 0.1.63 → 0.1.64
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-CUvn5K86.js → FileTree-DjhAzlg3.js} +1 -1
- package/dist/MarkdownEditor-CeN7n6mw.js +610 -0
- package/dist/{WorkspaceLoadingState-y087Q6ek.js → WorkspaceLoadingState-D4SB2awA.js} +11 -10
- package/dist/{WorkspaceProvider-U4izhS84.js → WorkspaceProvider-CEZUOy1M.js} +3534 -3469
- package/dist/app-front.d.ts +28 -3
- package/dist/app-front.js +1194 -1154
- package/dist/testing.js +1 -1
- package/dist/workspace.css +23 -0
- package/dist/workspace.d.ts +32 -6
- package/dist/workspace.js +5 -5
- package/package.json +4 -4
- package/dist/MarkdownEditor-5f4lhBqc.js +0 -598
package/dist/app-front.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as _, useState as L, useCallback as A, useMemo as T, useRef as H, useSyncExternalStore as
|
|
3
|
-
import { Sun as
|
|
4
|
-
import { searchPiSessions as
|
|
5
|
-
import { ax as
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { c as
|
|
8
|
-
import { C as
|
|
9
|
-
function
|
|
10
|
-
const { theme: e, toggleTheme:
|
|
1
|
+
import { jsx as r, jsxs as b, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as _, useState as L, useCallback as A, useMemo as T, useRef as H, useSyncExternalStore as gn, useLayoutEffect as Bi } from "react";
|
|
3
|
+
import { Sun as Ji, Moon as qi, FileText as Vi, RefreshCw as Mr, X as hn, Sparkles as Ir, Plug as Fr, Clock3 as Yi, Pin as $r, MessageSquarePlus as Ur, ChevronRight as Xi, Plus as mn, MoreHorizontal as ji, PinOff as Qi, Settings as Zi, ExternalLink as es, Search as ts, PanelLeftOpen as ns, PanelLeftClose as rs } from "lucide-react";
|
|
4
|
+
import { searchPiSessions as is, PiChatPanel as ss, usePiSessions as os } from "@hachej/boring-agent/front";
|
|
5
|
+
import { ax as as, aF as zr, p as ls, aN as pn, aO as cs, aP as ds, aQ as Wt, aR as Gr, aS as Kr, aT as Hr, aU as Br, aV as Ot, aW as bn, aX as vn, aY as Jr, aZ as us, a_ as Lt, u as qr, aw as fs, a$ as gs, az as ms, Y as ps, q as hs, b0 as Pr, b1 as bs, U as Er, x as vs, b2 as xs, au as ys, b3 as Ss } from "./WorkspaceProvider-CEZUOy1M.js";
|
|
6
|
+
import { IconButton as at, DropdownMenu as Ns, DropdownMenuTrigger as ws, DropdownMenuContent as Ps, DropdownMenuItem as Tt, DropdownMenuSeparator as Es, ErrorState as ks } from "@hachej/boring-ui-kit";
|
|
7
|
+
import { c as V } from "./utils-B6yFEsav.js";
|
|
8
|
+
import { C as As, r as kr, w as Rs, a as Ar, c as Cs, T as Ts, W as Rr } from "./WorkspaceLoadingState-D4SB2awA.js";
|
|
9
|
+
function _s() {
|
|
10
|
+
const { theme: e, toggleTheme: n } = as(), i = e === "dark";
|
|
11
11
|
return _(() => {
|
|
12
|
-
typeof document > "u" || document.documentElement.classList.toggle("dark",
|
|
13
|
-
}, [
|
|
14
|
-
|
|
12
|
+
typeof document > "u" || document.documentElement.classList.toggle("dark", i);
|
|
13
|
+
}, [i]), /* @__PURE__ */ r(
|
|
14
|
+
at,
|
|
15
15
|
{
|
|
16
16
|
type: "button",
|
|
17
17
|
variant: "ghost",
|
|
18
18
|
size: "icon-sm",
|
|
19
|
-
onClick:
|
|
19
|
+
onClick: n,
|
|
20
20
|
"aria-label": "Toggle theme",
|
|
21
|
-
title:
|
|
22
|
-
children:
|
|
21
|
+
title: i ? "Switch to light theme" : "Switch to dark theme",
|
|
22
|
+
children: i ? /* @__PURE__ */ r(Ji, { className: "h-4 w-4" }) : /* @__PURE__ */ r(qi, { className: "h-4 w-4" })
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Vr({
|
|
27
27
|
part: e,
|
|
28
|
-
icon:
|
|
29
|
-
title:
|
|
28
|
+
icon: n,
|
|
29
|
+
title: i,
|
|
30
30
|
description: s,
|
|
31
31
|
actions: o,
|
|
32
32
|
headerInsetStart: a = !1,
|
|
33
|
-
headerInsetEnd:
|
|
33
|
+
headerInsetEnd: c = !1,
|
|
34
34
|
children: f
|
|
35
35
|
}) {
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ b("div", { "data-boring-workspace-part": e, className: "flex h-full min-h-0 flex-col bg-background", children: [
|
|
37
|
+
/* @__PURE__ */ b("header", { className: V(
|
|
38
38
|
"flex h-12 shrink-0 items-center justify-between border-b border-border/60",
|
|
39
39
|
a ? "pl-12" : "pl-4",
|
|
40
|
-
|
|
40
|
+
c ? "pr-16" : "pr-4"
|
|
41
41
|
), children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ b("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
43
|
+
n,
|
|
44
|
+
/* @__PURE__ */ b("div", { className: "min-w-0", children: [
|
|
45
|
+
/* @__PURE__ */ r("h2", { className: "truncate text-sm font-semibold tracking-tight text-foreground", children: i }),
|
|
46
|
+
/* @__PURE__ */ r("p", { className: "truncate text-xs text-muted-foreground", children: s })
|
|
47
47
|
] })
|
|
48
48
|
] }),
|
|
49
|
-
o ? /* @__PURE__ */
|
|
49
|
+
o ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-0.5", children: o }) : null
|
|
50
50
|
] }),
|
|
51
51
|
f
|
|
52
52
|
] });
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const s =
|
|
56
|
-
d.filePath &&
|
|
54
|
+
function Ds({ onClose: e, headerInsetStart: n = !1, headerInsetEnd: i = !1 }) {
|
|
55
|
+
const s = zr(), [o, a] = L({ status: "loading", skills: [] }), c = A((d) => {
|
|
56
|
+
d.filePath && ls({ kind: "openFile", params: { path: d.filePath, mode: "view" } });
|
|
57
57
|
}, []), f = A(async (d = !1) => {
|
|
58
58
|
a((m) => ({ status: "loading", skills: m.skills }));
|
|
59
59
|
try {
|
|
@@ -76,18 +76,18 @@ function _s({ onClose: e, headerInsetStart: t = !1, headerInsetEnd: r = !1 }) {
|
|
|
76
76
|
() => [...o.skills].sort((d, m) => d.name.localeCompare(m.name)),
|
|
77
77
|
[o.skills]
|
|
78
78
|
);
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
79
|
+
return /* @__PURE__ */ r(
|
|
80
|
+
Vr,
|
|
81
81
|
{
|
|
82
82
|
part: "skills-page",
|
|
83
83
|
title: "Skills",
|
|
84
84
|
description: "Workspace skills available to slash commands",
|
|
85
|
-
headerInsetStart:
|
|
86
|
-
headerInsetEnd:
|
|
87
|
-
icon: /* @__PURE__ */
|
|
88
|
-
actions: /* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
85
|
+
headerInsetStart: n,
|
|
86
|
+
headerInsetEnd: i,
|
|
87
|
+
icon: /* @__PURE__ */ r("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__ */ r(Ir, { className: "h-4 w-4", strokeWidth: 1.75, "aria-hidden": "true" }) }),
|
|
88
|
+
actions: /* @__PURE__ */ b(ue, { children: [
|
|
89
|
+
/* @__PURE__ */ r(
|
|
90
|
+
at,
|
|
91
91
|
{
|
|
92
92
|
type: "button",
|
|
93
93
|
variant: "ghost",
|
|
@@ -97,11 +97,11 @@ function _s({ onClose: e, headerInsetStart: t = !1, headerInsetEnd: r = !1 }) {
|
|
|
97
97
|
"aria-label": "Refresh skills",
|
|
98
98
|
title: "Refresh skills",
|
|
99
99
|
className: "text-muted-foreground hover:text-foreground",
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ r(Mr, { className: V("size-3", o.status === "loading" && "animate-spin"), strokeWidth: 1.75 })
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
e ? /* @__PURE__ */
|
|
104
|
-
|
|
103
|
+
e ? /* @__PURE__ */ r(
|
|
104
|
+
at,
|
|
105
105
|
{
|
|
106
106
|
type: "button",
|
|
107
107
|
variant: "ghost",
|
|
@@ -110,36 +110,36 @@ function _s({ onClose: e, headerInsetStart: t = !1, headerInsetEnd: r = !1 }) {
|
|
|
110
110
|
"aria-label": "Close skills",
|
|
111
111
|
title: "Close",
|
|
112
112
|
className: "text-muted-foreground hover:text-foreground",
|
|
113
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ r(hn, { className: "size-3", strokeWidth: 1.75 })
|
|
114
114
|
}
|
|
115
115
|
) : null
|
|
116
116
|
] }),
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
-
o.status === "error" ? /* @__PURE__ */
|
|
119
|
-
o.status === "loading" && g.length === 0 ? /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
] }) }) : /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ b("div", { className: "boring-scrollbar-discreet min-h-0 flex-1 overflow-y-auto p-4", "aria-live": "polite", children: [
|
|
118
|
+
o.status === "error" ? /* @__PURE__ */ r("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive", children: o.error }) : null,
|
|
119
|
+
o.status === "loading" && g.length === 0 ? /* @__PURE__ */ r("div", { className: "flex h-full min-h-[180px] items-center justify-center text-sm text-muted-foreground", children: "Loading skills…" }) : g.length === 0 ? /* @__PURE__ */ r("div", { className: "flex h-full min-h-[180px] items-center justify-center text-center text-sm text-muted-foreground", children: /* @__PURE__ */ b("div", { children: [
|
|
120
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-foreground/80", children: "No skills found" }),
|
|
121
|
+
/* @__PURE__ */ r("p", { className: "mt-1 max-w-xs", children: "Reload plugins or add workspace skills to make them available in chat." })
|
|
122
|
+
] }) }) : /* @__PURE__ */ r("ul", { role: "list", className: "grid gap-2", children: g.map((d) => /* @__PURE__ */ r(
|
|
123
123
|
"li",
|
|
124
124
|
{
|
|
125
125
|
className: "rounded-xl border border-border/60 bg-card/70 px-3 py-2.5 cursor-pointer transition-colors hover:border-border hover:bg-muted/60",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ r(
|
|
127
127
|
"button",
|
|
128
128
|
{
|
|
129
129
|
type: "button",
|
|
130
|
-
onClick: () =>
|
|
130
|
+
onClick: () => c(d),
|
|
131
131
|
title: "Open skill",
|
|
132
132
|
"aria-label": `Open skill ${d.name} in workspace`,
|
|
133
133
|
className: "block w-full text-left",
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ b("div", { className: "flex items-start justify-between gap-3", children: [
|
|
135
|
+
/* @__PURE__ */ b("div", { className: "min-w-0", children: [
|
|
136
|
+
/* @__PURE__ */ b("div", { className: "truncate text-sm font-medium text-foreground", children: [
|
|
137
137
|
"/",
|
|
138
138
|
d.name
|
|
139
139
|
] }),
|
|
140
|
-
d.description ? /* @__PURE__ */
|
|
140
|
+
d.description ? /* @__PURE__ */ r("p", { className: "mt-1 line-clamp-2 text-xs leading-5 text-muted-foreground", children: d.description }) : null
|
|
141
141
|
] }),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ r(Vi, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground", strokeWidth: 1.75, "aria-hidden": "true" })
|
|
143
143
|
] })
|
|
144
144
|
}
|
|
145
145
|
)
|
|
@@ -150,50 +150,50 @@ function _s({ onClose: e, headerInsetStart: t = !1, headerInsetEnd: r = !1 }) {
|
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return ((
|
|
153
|
+
function Te(e) {
|
|
154
|
+
var n, i;
|
|
155
|
+
return ((n = e.boring) == null ? void 0 : n.label) || ((i = e.boring) == null ? void 0 : i.id) || e.id;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const
|
|
159
|
-
return
|
|
157
|
+
function Ls(e, n) {
|
|
158
|
+
const i = e.filter((s) => s.id !== n.id);
|
|
159
|
+
return i.push(n), i.sort((s, o) => Te(s).localeCompare(Te(o)));
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
const o =
|
|
163
|
-
|
|
161
|
+
function Ws({ onClose: e, onReloadExternalPlugins: n, headerInsetStart: i = !1, headerInsetEnd: s = !1 }) {
|
|
162
|
+
const o = zr(), [a, c] = L({ status: "loading", plugins: [] }), [f, g] = L(() => /* @__PURE__ */ new Set()), [d, m] = L(!1), [k, R] = L(null), W = A(async () => {
|
|
163
|
+
c((h) => ({ status: "loading", plugins: h.plugins }));
|
|
164
164
|
try {
|
|
165
165
|
const h = await o.getJson("/api/v1/agent-plugins?external=1", {
|
|
166
166
|
missingMessage: "Failed to load external plugins."
|
|
167
|
-
}),
|
|
168
|
-
|
|
167
|
+
}), v = Array.isArray(h) ? [...h].sort((y, D) => Te(y).localeCompare(Te(D))) : [];
|
|
168
|
+
c({ status: "ready", plugins: v });
|
|
169
169
|
} catch (h) {
|
|
170
|
-
const
|
|
171
|
-
if (/\(404\)/.test(
|
|
172
|
-
|
|
170
|
+
const v = h instanceof Error ? h.message : "Failed to load external plugins.";
|
|
171
|
+
if (/\(404\)/.test(v)) {
|
|
172
|
+
c({ status: "ready", plugins: [] });
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
c((y) => ({
|
|
176
176
|
status: "error",
|
|
177
177
|
plugins: y.plugins,
|
|
178
|
-
error:
|
|
178
|
+
error: v
|
|
179
179
|
}));
|
|
180
180
|
}
|
|
181
181
|
}, [o]);
|
|
182
182
|
_(() => {
|
|
183
|
-
|
|
184
|
-
}, [
|
|
185
|
-
const h = (
|
|
186
|
-
const y =
|
|
183
|
+
W();
|
|
184
|
+
}, [W]), _(() => {
|
|
185
|
+
const h = (v) => {
|
|
186
|
+
const y = v.detail;
|
|
187
187
|
if (!(!y || typeof y != "object"))
|
|
188
188
|
switch (y.type) {
|
|
189
189
|
case "boring.plugin.load":
|
|
190
|
-
|
|
190
|
+
c((D) => ({ ...D, plugins: Ls(D.plugins, y) })), g((D) => {
|
|
191
191
|
const F = new Set(D);
|
|
192
192
|
return F.delete(y.id), F;
|
|
193
193
|
});
|
|
194
194
|
break;
|
|
195
195
|
case "boring.plugin.unload":
|
|
196
|
-
|
|
196
|
+
c((D) => ({ ...D, plugins: D.plugins.filter((F) => F.id !== y.id) })), g((D) => {
|
|
197
197
|
const F = new Set(D);
|
|
198
198
|
return F.delete(y.id), F;
|
|
199
199
|
});
|
|
@@ -215,35 +215,35 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
215
215
|
});
|
|
216
216
|
break;
|
|
217
217
|
case "boring.plugin.replay-complete":
|
|
218
|
-
|
|
218
|
+
W();
|
|
219
219
|
break;
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
|
-
return window.addEventListener(
|
|
223
|
-
}, [
|
|
224
|
-
const E = T(() => [...a.plugins].sort((h,
|
|
222
|
+
return window.addEventListener(pn, h), () => window.removeEventListener(pn, h);
|
|
223
|
+
}, [W]);
|
|
224
|
+
const E = T(() => [...a.plugins].sort((h, v) => Te(h).localeCompare(Te(v))), [a.plugins]), x = A(async () => {
|
|
225
225
|
m(!0), R(null);
|
|
226
226
|
try {
|
|
227
|
-
const h =
|
|
228
|
-
R(h || "External plugins reloaded."), await
|
|
227
|
+
const h = n ? await n() : void 0;
|
|
228
|
+
R(h || "External plugins reloaded."), await W();
|
|
229
229
|
} catch (h) {
|
|
230
230
|
R(h instanceof Error ? h.message : "External plugin reload failed.");
|
|
231
231
|
} finally {
|
|
232
232
|
m(!1);
|
|
233
233
|
}
|
|
234
|
-
}, [
|
|
235
|
-
return /* @__PURE__ */
|
|
236
|
-
|
|
234
|
+
}, [W, n]);
|
|
235
|
+
return /* @__PURE__ */ r(
|
|
236
|
+
Vr,
|
|
237
237
|
{
|
|
238
238
|
part: "plugins-overlay",
|
|
239
239
|
title: "Plugins",
|
|
240
240
|
description: "External plugins loaded for this workspace",
|
|
241
|
-
headerInsetStart:
|
|
241
|
+
headerInsetStart: i,
|
|
242
242
|
headerInsetEnd: s,
|
|
243
|
-
icon: /* @__PURE__ */
|
|
244
|
-
actions: /* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
|
|
243
|
+
icon: /* @__PURE__ */ r("span", { className: "grid size-7 place-items-center rounded-lg bg-foreground/[0.06] text-muted-foreground", children: /* @__PURE__ */ r(Fr, { className: "h-4 w-4", strokeWidth: 1.75, "aria-hidden": "true" }) }),
|
|
244
|
+
actions: /* @__PURE__ */ b(ue, { children: [
|
|
245
|
+
/* @__PURE__ */ r(
|
|
246
|
+
at,
|
|
247
247
|
{
|
|
248
248
|
type: "button",
|
|
249
249
|
variant: "ghost",
|
|
@@ -253,11 +253,11 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
253
253
|
"aria-label": "Reload plugins",
|
|
254
254
|
title: "Reload plugins",
|
|
255
255
|
className: "text-muted-foreground hover:text-foreground",
|
|
256
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ r(Mr, { className: V("size-3", (d || a.status === "loading") && "animate-spin"), strokeWidth: 1.75 })
|
|
257
257
|
}
|
|
258
258
|
),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
|
|
259
|
+
/* @__PURE__ */ r(
|
|
260
|
+
at,
|
|
261
261
|
{
|
|
262
262
|
type: "button",
|
|
263
263
|
variant: "ghost",
|
|
@@ -266,38 +266,38 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
266
266
|
"aria-label": "Close plugins",
|
|
267
267
|
title: "Close",
|
|
268
268
|
className: "text-muted-foreground hover:text-foreground",
|
|
269
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ r(hn, { className: "size-3", strokeWidth: 1.75 })
|
|
270
270
|
}
|
|
271
271
|
)
|
|
272
272
|
] }),
|
|
273
|
-
children: /* @__PURE__ */
|
|
274
|
-
a.status === "error" ? /* @__PURE__ */
|
|
275
|
-
k ? /* @__PURE__ */
|
|
276
|
-
a.status === "loading" && E.length === 0 ? /* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
] }) }) : /* @__PURE__ */
|
|
280
|
-
const
|
|
281
|
-
return /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */ b("div", { className: "boring-scrollbar-discreet min-h-0 flex-1 overflow-y-auto p-4", "aria-live": "polite", children: [
|
|
274
|
+
a.status === "error" ? /* @__PURE__ */ r("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/8 px-3 py-2 text-sm text-destructive", children: a.error }) : null,
|
|
275
|
+
k ? /* @__PURE__ */ r("div", { className: "mb-4 rounded-lg border border-border/70 bg-muted/40 px-3 py-2 text-xs text-muted-foreground", children: k }) : null,
|
|
276
|
+
a.status === "loading" && E.length === 0 ? /* @__PURE__ */ r("div", { className: "flex h-full min-h-[180px] items-center justify-center text-sm text-muted-foreground", children: "Loading external plugins…" }) : E.length === 0 ? /* @__PURE__ */ r("div", { className: "flex h-full min-h-[180px] items-center justify-center text-center text-sm text-muted-foreground", children: /* @__PURE__ */ b("div", { children: [
|
|
277
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-foreground/80", children: "No external plugins loaded" }),
|
|
278
|
+
/* @__PURE__ */ r("p", { className: "mt-1 max-w-xs", children: "Create or install an external plugin, then reload external plugins." })
|
|
279
|
+
] }) }) : /* @__PURE__ */ r("ul", { role: "list", className: "grid gap-2", children: E.map((h) => {
|
|
280
|
+
const v = f.has(h.id);
|
|
281
|
+
return /* @__PURE__ */ b(
|
|
282
282
|
"li",
|
|
283
283
|
{
|
|
284
284
|
className: "rounded-xl border border-border/60 bg-card/70 px-3 py-2.5",
|
|
285
285
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ b("div", { className: "flex items-start justify-between gap-3", children: [
|
|
287
|
+
/* @__PURE__ */ b("div", { className: "min-w-0", children: [
|
|
288
|
+
/* @__PURE__ */ r("div", { className: "truncate text-sm font-medium text-foreground", children: Te(h) }),
|
|
289
|
+
/* @__PURE__ */ r("div", { className: "mt-0.5 truncate text-[11px] text-muted-foreground/80", children: h.id })
|
|
290
290
|
] }),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
293
|
-
h.frontTarget ? /* @__PURE__ */
|
|
294
|
-
typeof h.revision == "number" ? /* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ b("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
292
|
+
v ? /* @__PURE__ */ r("span", { className: "rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "loading" }) : null,
|
|
293
|
+
h.frontTarget ? /* @__PURE__ */ r("span", { className: "rounded bg-foreground/[0.06] px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "front" }) : null,
|
|
294
|
+
typeof h.revision == "number" ? /* @__PURE__ */ b("span", { className: "rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: [
|
|
295
295
|
"r",
|
|
296
296
|
h.revision
|
|
297
297
|
] }) : null
|
|
298
298
|
] })
|
|
299
299
|
] }),
|
|
300
|
-
h.version ? /* @__PURE__ */
|
|
300
|
+
h.version ? /* @__PURE__ */ b("div", { className: "mt-2 text-xs text-muted-foreground", children: [
|
|
301
301
|
"Version ",
|
|
302
302
|
h.version
|
|
303
303
|
] }) : null
|
|
@@ -310,16 +310,16 @@ function Ds({ onClose: e, onReloadExternalPlugins: t, headerInsetStart: r = !1,
|
|
|
310
310
|
}
|
|
311
311
|
);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Os({
|
|
314
314
|
appTitle: e,
|
|
315
|
-
workspaceLabel:
|
|
316
|
-
topSlot:
|
|
315
|
+
workspaceLabel: n,
|
|
316
|
+
topSlot: i,
|
|
317
317
|
showBrand: s = !0
|
|
318
318
|
}) {
|
|
319
319
|
const o = e || "Boring UI";
|
|
320
|
-
return /* @__PURE__ */
|
|
321
|
-
s ? /* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ b("div", { className: "shrink-0 px-2 pb-2 pt-2", children: [
|
|
321
|
+
s ? /* @__PURE__ */ b("div", { className: "flex h-8 min-w-0 items-center gap-2 pr-1", style: { paddingLeft: "2.5rem" }, children: [
|
|
322
|
+
/* @__PURE__ */ r(
|
|
323
323
|
"span",
|
|
324
324
|
{
|
|
325
325
|
"aria-hidden": "true",
|
|
@@ -327,146 +327,146 @@ function Ls({
|
|
|
327
327
|
children: (o[0] ?? "B").toUpperCase()
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ r("span", { className: "truncate text-[15px] font-semibold tracking-tight text-foreground", "data-boring-workspace-part": "app-left-pane-brand", children: o })
|
|
331
331
|
] }) : null,
|
|
332
|
-
|
|
332
|
+
i ? /* @__PURE__ */ r(
|
|
333
333
|
"div",
|
|
334
334
|
{
|
|
335
335
|
className: s ? "mt-1 min-w-0" : "min-w-0 pr-1",
|
|
336
336
|
style: s ? void 0 : { paddingLeft: "2.5rem" },
|
|
337
337
|
"data-boring-workspace-part": "app-left-pane-workspace",
|
|
338
|
-
children:
|
|
338
|
+
children: i
|
|
339
339
|
}
|
|
340
|
-
) :
|
|
340
|
+
) : n ? /* @__PURE__ */ r(
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
className: "mt-0.5 flex min-h-8 items-center gap-2 rounded-md px-2 text-[13px] text-foreground/72",
|
|
344
344
|
"data-boring-workspace-part": "app-left-pane-workspace",
|
|
345
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ r("span", { className: "truncate", children: n })
|
|
346
346
|
}
|
|
347
347
|
) : null
|
|
348
348
|
] });
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function ln({
|
|
351
351
|
icon: e,
|
|
352
|
-
label:
|
|
353
|
-
onClick:
|
|
352
|
+
label: n,
|
|
353
|
+
onClick: i,
|
|
354
354
|
emphasis: s = !1,
|
|
355
355
|
trailing: o
|
|
356
356
|
}) {
|
|
357
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ b(
|
|
358
358
|
"button",
|
|
359
359
|
{
|
|
360
360
|
type: "button",
|
|
361
|
-
onClick:
|
|
362
|
-
className:
|
|
361
|
+
onClick: i,
|
|
362
|
+
className: V(
|
|
363
363
|
"flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
364
364
|
s ? "bg-foreground/[0.06] text-foreground hover:bg-foreground/[0.1]" : "text-foreground/82 hover:bg-foreground/[0.055] hover:text-foreground"
|
|
365
365
|
),
|
|
366
366
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
o ? /* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ r("span", { className: V("grid size-5 shrink-0 place-items-center", s ? "text-foreground/90" : "text-muted-foreground"), "aria-hidden": "true", children: e }),
|
|
368
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", children: n }),
|
|
369
|
+
o ? /* @__PURE__ */ r("span", { className: "shrink-0", children: o }) : null
|
|
370
370
|
]
|
|
371
371
|
}
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
return /* @__PURE__ */
|
|
374
|
+
function Ms({ keys: e }) {
|
|
375
|
+
return /* @__PURE__ */ r("kbd", { "aria-hidden": "true", className: "rounded border border-border/60 bg-foreground/[0.08] px-1.5 py-px text-[10px] font-medium leading-[1.4] tracking-wide text-muted-foreground", children: e });
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Yr({
|
|
378
378
|
session: e,
|
|
379
|
-
state:
|
|
380
|
-
pinned:
|
|
379
|
+
state: n,
|
|
380
|
+
pinned: i,
|
|
381
381
|
canSplit: s = !0,
|
|
382
382
|
canPin: o = !0,
|
|
383
383
|
onSwitch: a,
|
|
384
|
-
onOpenAsPane:
|
|
384
|
+
onOpenAsPane: c,
|
|
385
385
|
onTogglePinned: f,
|
|
386
386
|
onDelete: g
|
|
387
387
|
}) {
|
|
388
388
|
const d = e.title || "Untitled", m = () => {
|
|
389
|
-
|
|
389
|
+
n !== "active" && a(e.id);
|
|
390
390
|
};
|
|
391
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ b(
|
|
392
392
|
"div",
|
|
393
393
|
{
|
|
394
394
|
"data-boring-workspace-part": "app-session-row",
|
|
395
|
-
"data-boring-session-state":
|
|
395
|
+
"data-boring-session-state": n,
|
|
396
396
|
draggable: s,
|
|
397
397
|
onDragStart: s ? (k) => {
|
|
398
|
-
k.dataTransfer.setData(
|
|
398
|
+
k.dataTransfer.setData(cs, e.id), k.dataTransfer.setData("text/plain", d), k.dataTransfer.effectAllowed = "copyMove";
|
|
399
399
|
} : void 0,
|
|
400
|
-
className:
|
|
400
|
+
className: V(
|
|
401
401
|
"group flex min-h-8 w-full items-center gap-2 rounded-md border px-2.5 py-1 text-left transition-colors",
|
|
402
|
-
|
|
402
|
+
n === "active" ? "border-transparent bg-[color:oklch(from_var(--accent)_l_c_h/0.14)] text-foreground" : n === "open" ? "border-transparent bg-foreground/[0.05] text-foreground/90 hover:bg-foreground/[0.07]" : "border-transparent text-foreground/78 hover:bg-foreground/[0.055] hover:text-foreground"
|
|
403
403
|
),
|
|
404
404
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
|
|
405
|
+
/* @__PURE__ */ r(
|
|
406
|
+
Yi,
|
|
407
407
|
{
|
|
408
|
-
className:
|
|
408
|
+
className: V(
|
|
409
409
|
"h-3.5 w-3.5 shrink-0",
|
|
410
|
-
|
|
410
|
+
n === "active" ? "text-[color:var(--accent)]" : "text-muted-foreground/65"
|
|
411
411
|
),
|
|
412
412
|
strokeWidth: 1.75,
|
|
413
413
|
"aria-hidden": "true"
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ r(
|
|
417
417
|
"button",
|
|
418
418
|
{
|
|
419
419
|
type: "button",
|
|
420
420
|
onClick: m,
|
|
421
|
-
disabled:
|
|
421
|
+
disabled: n === "active",
|
|
422
422
|
className: "min-w-0 flex-1 truncate rounded text-left text-[13px] font-medium leading-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-default",
|
|
423
423
|
title: d,
|
|
424
424
|
children: d
|
|
425
425
|
}
|
|
426
426
|
),
|
|
427
|
-
o ? /* @__PURE__ */
|
|
427
|
+
o ? /* @__PURE__ */ r(
|
|
428
428
|
"span",
|
|
429
429
|
{
|
|
430
430
|
"data-boring-workspace-part": "app-session-pin-action",
|
|
431
|
-
className:
|
|
431
|
+
className: V(
|
|
432
432
|
"flex w-0 shrink-0 items-center overflow-hidden opacity-0 transition-[width,opacity,margin] group-hover:ml-1 group-hover:w-auto group-hover:opacity-100 group-focus-within:ml-1 group-focus-within:w-auto group-focus-within:opacity-100",
|
|
433
|
-
|
|
433
|
+
i && "ml-1 w-auto opacity-100"
|
|
434
434
|
),
|
|
435
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ r(
|
|
436
436
|
"button",
|
|
437
437
|
{
|
|
438
438
|
type: "button",
|
|
439
|
-
"aria-label":
|
|
440
|
-
title:
|
|
441
|
-
"aria-pressed":
|
|
439
|
+
"aria-label": i ? `Unpin ${d}` : `Pin ${d}`,
|
|
440
|
+
title: i ? "Unpin" : "Pin",
|
|
441
|
+
"aria-pressed": i,
|
|
442
442
|
onClick: () => f(e.id),
|
|
443
|
-
className:
|
|
443
|
+
className: V(
|
|
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
|
+
i && "text-[color:var(--accent)]"
|
|
446
446
|
),
|
|
447
|
-
children: /* @__PURE__ */
|
|
447
|
+
children: /* @__PURE__ */ r($r, { className: V("h-3.5 w-3.5", i && "fill-current"), strokeWidth: 1.75 })
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
}
|
|
451
451
|
) : null,
|
|
452
|
-
|
|
452
|
+
n === "normal" && s || g ? /* @__PURE__ */ b(
|
|
453
453
|
"span",
|
|
454
454
|
{
|
|
455
455
|
"data-boring-workspace-part": "app-session-actions",
|
|
456
456
|
className: "flex w-0 shrink-0 items-center gap-0.5 overflow-hidden opacity-0 transition-[width,opacity,margin] group-hover:ml-1 group-hover:w-auto group-hover:opacity-100 group-focus-within:ml-1 group-focus-within:w-auto group-focus-within:opacity-100",
|
|
457
457
|
children: [
|
|
458
|
-
|
|
458
|
+
n === "normal" && s ? /* @__PURE__ */ r(
|
|
459
459
|
"button",
|
|
460
460
|
{
|
|
461
461
|
type: "button",
|
|
462
462
|
"aria-label": `Open ${d} in new chat pane`,
|
|
463
463
|
title: "Open in new chat pane",
|
|
464
|
-
onClick: () =>
|
|
464
|
+
onClick: () => c(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__ */
|
|
466
|
+
children: /* @__PURE__ */ r(Ur, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
467
467
|
}
|
|
468
468
|
) : null,
|
|
469
|
-
g ? /* @__PURE__ */
|
|
469
|
+
g ? /* @__PURE__ */ r(
|
|
470
470
|
"button",
|
|
471
471
|
{
|
|
472
472
|
type: "button",
|
|
@@ -474,7 +474,7 @@ function Vr({
|
|
|
474
474
|
title: "Delete",
|
|
475
475
|
onClick: () => g(e.id),
|
|
476
476
|
className: "grid size-6 place-items-center rounded-md text-muted-foreground hover:bg-background hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
477
|
-
children: /* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ r(hn, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
478
478
|
}
|
|
479
479
|
) : null
|
|
480
480
|
]
|
|
@@ -484,40 +484,40 @@ function Vr({
|
|
|
484
484
|
}
|
|
485
485
|
);
|
|
486
486
|
}
|
|
487
|
-
const
|
|
488
|
-
function
|
|
487
|
+
const Xr = "boring-workspace:pinned-projects";
|
|
488
|
+
function Is() {
|
|
489
489
|
var e;
|
|
490
490
|
try {
|
|
491
|
-
const
|
|
492
|
-
if (!
|
|
493
|
-
const
|
|
494
|
-
return Array.isArray(
|
|
491
|
+
const n = (e = globalThis.localStorage) == null ? void 0 : e.getItem(Xr);
|
|
492
|
+
if (!n) return [];
|
|
493
|
+
const i = JSON.parse(n);
|
|
494
|
+
return Array.isArray(i == null ? void 0 : i.ids) ? i.ids.filter((s) => typeof s == "string") : [];
|
|
495
495
|
} catch {
|
|
496
496
|
return [];
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
var
|
|
499
|
+
function Fs(e) {
|
|
500
|
+
var n;
|
|
501
501
|
try {
|
|
502
|
-
(
|
|
502
|
+
(n = globalThis.localStorage) == null || n.setItem(Xr, JSON.stringify({ ids: e }));
|
|
503
503
|
} catch {
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
const [e,
|
|
508
|
-
return [e, (s) =>
|
|
509
|
-
const a = o.includes(s) ? o.filter((
|
|
510
|
-
return
|
|
506
|
+
function $s() {
|
|
507
|
+
const [e, n] = L(() => Is());
|
|
508
|
+
return [e, (s) => n((o) => {
|
|
509
|
+
const a = o.includes(s) ? o.filter((c) => c !== s) : [...o, s];
|
|
510
|
+
return Fs(a), a;
|
|
511
511
|
})];
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Us({
|
|
514
514
|
projects: e,
|
|
515
|
-
activeProjectId:
|
|
516
|
-
fallbackName:
|
|
515
|
+
activeProjectId: n,
|
|
516
|
+
fallbackName: i,
|
|
517
517
|
expandedIds: s,
|
|
518
518
|
onToggleExpanded: o,
|
|
519
519
|
pinnedProjectIds: a,
|
|
520
|
-
onTogglePinnedProject:
|
|
520
|
+
onTogglePinnedProject: c,
|
|
521
521
|
onOpenProjectSession: f,
|
|
522
522
|
onShowMoreProjectSessions: g,
|
|
523
523
|
onCreateProjectSession: d,
|
|
@@ -526,16 +526,16 @@ function Fs({
|
|
|
526
526
|
renderProjectSession: R
|
|
527
527
|
}) {
|
|
528
528
|
var E;
|
|
529
|
-
const
|
|
530
|
-
return /* @__PURE__ */
|
|
531
|
-
|
|
529
|
+
const W = n ?? ((E = e[0]) == null ? void 0 : E.id) ?? null;
|
|
530
|
+
return /* @__PURE__ */ r("div", { className: "space-y-0.5", children: e.map((x) => /* @__PURE__ */ r(
|
|
531
|
+
zs,
|
|
532
532
|
{
|
|
533
533
|
project: x,
|
|
534
|
-
fallbackName:
|
|
535
|
-
active: x.id ===
|
|
534
|
+
fallbackName: i,
|
|
535
|
+
active: x.id === W,
|
|
536
536
|
expanded: s.has(x.id),
|
|
537
537
|
pinned: a.has(x.id),
|
|
538
|
-
onTogglePinned: () =>
|
|
538
|
+
onTogglePinned: () => c(x.id),
|
|
539
539
|
onToggleExpanded: () => o(x.id),
|
|
540
540
|
onActivate: () => o(x.id),
|
|
541
541
|
onOpenSession: f,
|
|
@@ -548,48 +548,48 @@ function Fs({
|
|
|
548
548
|
x.id
|
|
549
549
|
)) });
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function zs({
|
|
552
552
|
project: e,
|
|
553
|
-
fallbackName:
|
|
554
|
-
active:
|
|
553
|
+
fallbackName: n,
|
|
554
|
+
active: i,
|
|
555
555
|
expanded: s,
|
|
556
556
|
pinned: o,
|
|
557
557
|
onTogglePinned: a,
|
|
558
|
-
onToggleExpanded:
|
|
558
|
+
onToggleExpanded: c,
|
|
559
559
|
onActivate: f,
|
|
560
560
|
onOpenSession: g,
|
|
561
561
|
onShowMore: d,
|
|
562
562
|
onCreateSession: m,
|
|
563
563
|
onOpenSettings: k,
|
|
564
564
|
onOpenInNewTab: R,
|
|
565
|
-
renderProjectSession:
|
|
565
|
+
renderProjectSession: W
|
|
566
566
|
}) {
|
|
567
|
-
const [E, x] = L(!1), h = e.sessions ?? [],
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
567
|
+
const [E, x] = L(!1), h = e.sessions ?? [], v = e.blockedCount ?? 0, y = e.available === !1, D = e.name || n, xe = !!(m || !0);
|
|
568
|
+
return /* @__PURE__ */ b("div", { className: "space-y-0.5", children: [
|
|
569
|
+
/* @__PURE__ */ b(
|
|
570
570
|
"div",
|
|
571
571
|
{
|
|
572
|
-
className:
|
|
572
|
+
className: V(
|
|
573
573
|
"group relative flex min-h-8 w-full items-center gap-2 rounded-md py-1 pl-2 pr-2 transition-colors",
|
|
574
|
-
|
|
574
|
+
i ? "bg-foreground/[0.07] text-foreground" : y ? "text-muted-foreground/45" : "text-foreground/82 hover:bg-foreground/[0.05] hover:text-foreground"
|
|
575
575
|
),
|
|
576
576
|
children: [
|
|
577
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ r(
|
|
578
578
|
"button",
|
|
579
579
|
{
|
|
580
580
|
type: "button",
|
|
581
581
|
"aria-label": s ? `Collapse ${D}` : `Expand ${D}`,
|
|
582
582
|
"aria-expanded": s,
|
|
583
|
-
onClick:
|
|
583
|
+
onClick: c,
|
|
584
584
|
className: "grid size-5 shrink-0 place-items-center rounded text-muted-foreground/55 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
585
|
-
children: /* @__PURE__ */
|
|
585
|
+
children: /* @__PURE__ */ r(Xi, { className: V("h-3.5 w-3.5 transition-transform duration-150", s && "rotate-90"), strokeWidth: 2, "aria-hidden": "true" })
|
|
586
586
|
}
|
|
587
587
|
),
|
|
588
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ r(
|
|
589
589
|
"button",
|
|
590
590
|
{
|
|
591
591
|
type: "button",
|
|
592
|
-
"aria-current":
|
|
592
|
+
"aria-current": i ? "page" : void 0,
|
|
593
593
|
disabled: y,
|
|
594
594
|
onClick: () => {
|
|
595
595
|
y || f();
|
|
@@ -598,24 +598,24 @@ function $s({
|
|
|
598
598
|
children: D
|
|
599
599
|
}
|
|
600
600
|
),
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
|
|
601
|
+
/* @__PURE__ */ b("span", { className: "relative flex h-6 w-[3.25rem] shrink-0 items-center justify-end", children: [
|
|
602
|
+
v > 0 ? /* @__PURE__ */ r("span", { className: V(
|
|
603
603
|
"pointer-events-none absolute inset-0 flex items-center justify-end transition-opacity",
|
|
604
|
-
|
|
604
|
+
xe && "group-hover:opacity-0 group-focus-within:opacity-0",
|
|
605
605
|
E && "opacity-0"
|
|
606
|
-
), children: /* @__PURE__ */
|
|
606
|
+
), children: /* @__PURE__ */ r(
|
|
607
607
|
"span",
|
|
608
608
|
{
|
|
609
|
-
title: `${
|
|
609
|
+
title: `${v} session${v === 1 ? "" : "s"} waiting`,
|
|
610
610
|
className: "grid min-w-5 place-items-center rounded-full bg-[color:oklch(from_var(--accent)_l_c_h/0.18)] px-1.5 py-0.5 text-[11px] font-semibold text-[color:var(--accent)]",
|
|
611
|
-
children:
|
|
611
|
+
children: v > 99 ? "99+" : v
|
|
612
612
|
}
|
|
613
613
|
) }) : null,
|
|
614
|
-
|
|
614
|
+
xe ? /* @__PURE__ */ b("span", { className: V(
|
|
615
615
|
"flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
616
616
|
E && "opacity-100"
|
|
617
617
|
), children: [
|
|
618
|
-
m ? /* @__PURE__ */
|
|
618
|
+
m ? /* @__PURE__ */ r(
|
|
619
619
|
"button",
|
|
620
620
|
{
|
|
621
621
|
type: "button",
|
|
@@ -625,11 +625,11 @@ function $s({
|
|
|
625
625
|
J.stopPropagation(), m(e.id);
|
|
626
626
|
},
|
|
627
627
|
className: "grid size-6 place-items-center rounded-md text-muted-foreground hover:bg-foreground/[0.08] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
628
|
-
children: /* @__PURE__ */
|
|
628
|
+
children: /* @__PURE__ */ r(mn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
629
629
|
}
|
|
630
630
|
) : null,
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ b(Ns, { open: E, onOpenChange: x, children: [
|
|
632
|
+
/* @__PURE__ */ r(ws, { asChild: !0, children: /* @__PURE__ */ r(
|
|
633
633
|
"button",
|
|
634
634
|
{
|
|
635
635
|
type: "button",
|
|
@@ -637,26 +637,26 @@ function $s({
|
|
|
637
637
|
title: "More",
|
|
638
638
|
onClick: (J) => J.stopPropagation(),
|
|
639
639
|
className: "grid size-6 place-items-center rounded-md text-muted-foreground hover:bg-foreground/[0.08] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
640
|
-
children: /* @__PURE__ */
|
|
640
|
+
children: /* @__PURE__ */ r(ji, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
641
641
|
}
|
|
642
642
|
) }),
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
o ? /* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ b(Ps, { align: "end", sideOffset: 6, className: "w-48 border-border/50 shadow-[0_12px_28px_-6px_rgba(0,0,0,0.55)]", children: [
|
|
644
|
+
/* @__PURE__ */ b(Tt, { onSelect: a, className: "gap-2 text-[13px]", children: [
|
|
645
|
+
o ? /* @__PURE__ */ r(Qi, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) : /* @__PURE__ */ r($r, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
646
646
|
o ? "Unpin project" : "Pin project"
|
|
647
647
|
] }),
|
|
648
|
-
m ? /* @__PURE__ */
|
|
649
|
-
/* @__PURE__ */
|
|
648
|
+
m ? /* @__PURE__ */ b(Tt, { onSelect: () => m(e.id), className: "gap-2 text-[13px]", children: [
|
|
649
|
+
/* @__PURE__ */ r(Ur, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
650
650
|
"New chat"
|
|
651
651
|
] }) : null,
|
|
652
|
-
k ? /* @__PURE__ */
|
|
653
|
-
/* @__PURE__ */
|
|
652
|
+
k ? /* @__PURE__ */ b(Tt, { onSelect: () => k(e.id), className: "gap-2 text-[13px]", children: [
|
|
653
|
+
/* @__PURE__ */ r(Zi, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
654
654
|
"Workspace settings"
|
|
655
655
|
] }) : null,
|
|
656
|
-
R ? /* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
656
|
+
R ? /* @__PURE__ */ b(ue, { children: [
|
|
657
|
+
/* @__PURE__ */ r(Es, {}),
|
|
658
|
+
/* @__PURE__ */ b(Tt, { onSelect: () => R(e.id), className: "gap-2 text-[13px]", children: [
|
|
659
|
+
/* @__PURE__ */ r(es, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
660
660
|
"Open in new tab"
|
|
661
661
|
] })
|
|
662
662
|
] }) : null
|
|
@@ -667,9 +667,9 @@ function $s({
|
|
|
667
667
|
]
|
|
668
668
|
}
|
|
669
669
|
),
|
|
670
|
-
s ? /* @__PURE__ */
|
|
671
|
-
e.loadingSessions && h.length === 0 ? /* @__PURE__ */
|
|
672
|
-
|
|
670
|
+
s ? /* @__PURE__ */ b("div", { className: "space-y-0.5 pl-6", children: [
|
|
671
|
+
e.loadingSessions && h.length === 0 ? /* @__PURE__ */ r("div", { className: "px-1 py-1.5 text-xs text-muted-foreground", children: "Loading chats…" }) : h.length === 0 ? /* @__PURE__ */ r("div", { className: "px-1 py-1.5 text-xs text-muted-foreground", children: "No chats yet." }) : h.map((J) => /* @__PURE__ */ r("div", { children: W ? W(e, J) : /* @__PURE__ */ r(
|
|
672
|
+
Yr,
|
|
673
673
|
{
|
|
674
674
|
session: J,
|
|
675
675
|
state: "normal",
|
|
@@ -680,7 +680,7 @@ function $s({
|
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
) }, J.id)),
|
|
683
|
-
e.hasMoreSessions ? /* @__PURE__ */
|
|
683
|
+
e.hasMoreSessions ? /* @__PURE__ */ r(
|
|
684
684
|
"button",
|
|
685
685
|
{
|
|
686
686
|
type: "button",
|
|
@@ -692,114 +692,114 @@ function $s({
|
|
|
692
692
|
] }) : null
|
|
693
693
|
] });
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
const s = Array.isArray(
|
|
697
|
-
return !s && !
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
/* @__PURE__ */
|
|
695
|
+
function cn({ title: e, empty: n, children: i }) {
|
|
696
|
+
const s = Array.isArray(i) ? i.length > 0 : !!i;
|
|
697
|
+
return !s && !n ? null : /* @__PURE__ */ b("div", { className: "space-y-1", children: [
|
|
698
|
+
/* @__PURE__ */ r("div", { className: "px-2 pb-0.5 text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/65", children: e }),
|
|
699
|
+
/* @__PURE__ */ r("div", { className: "space-y-0.5", children: s ? i : /* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs text-muted-foreground/60", children: n }) })
|
|
700
700
|
] });
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Gs({
|
|
703
703
|
width: e = 268,
|
|
704
|
-
appTitle:
|
|
705
|
-
workspaceLabel:
|
|
704
|
+
appTitle: n,
|
|
705
|
+
workspaceLabel: i,
|
|
706
706
|
workspaceSectionTitle: s = "Workspaces",
|
|
707
707
|
projects: o,
|
|
708
708
|
activeProjectId: a,
|
|
709
|
-
onOpenProjectSession:
|
|
709
|
+
onOpenProjectSession: c,
|
|
710
710
|
onShowMoreProjectSessions: f,
|
|
711
711
|
onCreateProject: g,
|
|
712
712
|
onCreateProjectSession: d,
|
|
713
713
|
onOpenProjectSettings: m,
|
|
714
714
|
onOpenProjectInNewTab: k,
|
|
715
715
|
topSlot: R,
|
|
716
|
-
bottomSlot:
|
|
716
|
+
bottomSlot: W,
|
|
717
717
|
headerMode: E = "full",
|
|
718
718
|
sessions: x,
|
|
719
719
|
activeSessionId: h,
|
|
720
|
-
openSessionIds:
|
|
720
|
+
openSessionIds: v,
|
|
721
721
|
pinnedSessionIds: y,
|
|
722
722
|
onCreateSession: D,
|
|
723
723
|
onOpenCommandPalette: F,
|
|
724
|
-
onSwitchSession:
|
|
724
|
+
onSwitchSession: xe,
|
|
725
725
|
onOpenSessionAsPane: J,
|
|
726
|
-
onToggleSessionPinned:
|
|
727
|
-
onDeleteSession:
|
|
728
|
-
actions:
|
|
729
|
-
layoutMode:
|
|
726
|
+
onToggleSessionPinned: Mt,
|
|
727
|
+
onDeleteSession: It,
|
|
728
|
+
actions: lt = [],
|
|
729
|
+
layoutMode: pe = "single-project"
|
|
730
730
|
}) {
|
|
731
|
-
const
|
|
731
|
+
const ct = T(() => new Set(v), [v]), ye = T(() => new Set(y), [y]), he = T(
|
|
732
732
|
() => y.map((p) => x.find((M) => M.id === p)).filter((p) => !!p),
|
|
733
733
|
[y, x]
|
|
734
|
-
),
|
|
735
|
-
() => x.filter((p) => !
|
|
736
|
-
[
|
|
737
|
-
),
|
|
734
|
+
), fe = T(
|
|
735
|
+
() => x.filter((p) => !ye.has(p.id)),
|
|
736
|
+
[ye, x]
|
|
737
|
+
), be = T(() => {
|
|
738
738
|
const p = o ?? [];
|
|
739
|
-
return
|
|
739
|
+
return pe !== "multi-project" ? p : p.map((M) => M.id !== a ? M : {
|
|
740
740
|
...M,
|
|
741
|
-
sessions: M.sessions ??
|
|
742
|
-
id:
|
|
743
|
-
title:
|
|
744
|
-
updatedAt:
|
|
741
|
+
sessions: M.sessions ?? fe.map((O) => ({
|
|
742
|
+
id: O.id,
|
|
743
|
+
title: O.title,
|
|
744
|
+
updatedAt: O.updatedAt
|
|
745
745
|
})),
|
|
746
|
-
sessionCount: M.sessionCount ??
|
|
746
|
+
sessionCount: M.sessionCount ?? fe.length
|
|
747
747
|
});
|
|
748
|
-
}, [a,
|
|
748
|
+
}, [a, pe, o, fe]), [dt, Ft] = 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
|
-
}),
|
|
753
|
-
const
|
|
754
|
-
return
|
|
755
|
-
}), [
|
|
756
|
-
() =>
|
|
757
|
-
[
|
|
758
|
-
),
|
|
759
|
-
() =>
|
|
760
|
-
[
|
|
761
|
-
), Gt = E !== "hidden" && (
|
|
762
|
-
const
|
|
763
|
-
return /* @__PURE__ */
|
|
764
|
-
|
|
752
|
+
}), $t = (p) => Ft((M) => {
|
|
753
|
+
const O = new Set(M);
|
|
754
|
+
return O.has(p) ? O.delete(p) : O.add(p), O;
|
|
755
|
+
}), [_e, Ut] = $s(), De = T(() => new Set(_e), [_e]), Se = T(
|
|
756
|
+
() => _e.map((p) => be.find((M) => M.id === p)).filter((p) => !!p),
|
|
757
|
+
[_e, be]
|
|
758
|
+
), zt = T(
|
|
759
|
+
() => be.filter((p) => !De.has(p.id)),
|
|
760
|
+
[be, De]
|
|
761
|
+
), Gt = E !== "hidden" && (pe !== "multi-project" || E === "workspace"), Kt = E === "full" && pe !== "multi-project", Le = (p, M, O = a ?? void 0) => {
|
|
762
|
+
const ge = !O || O === a, Ht = ge && p.id === h ? "active" : ge && ct.has(p.id) ? "open" : "normal";
|
|
763
|
+
return /* @__PURE__ */ r(
|
|
764
|
+
Yr,
|
|
765
765
|
{
|
|
766
766
|
session: p,
|
|
767
|
-
state:
|
|
767
|
+
state: Ht,
|
|
768
768
|
pinned: M,
|
|
769
|
-
canSplit:
|
|
770
|
-
canPin:
|
|
771
|
-
onSwitch:
|
|
772
|
-
onOpenAsPane:
|
|
773
|
-
onTogglePinned:
|
|
774
|
-
onDelete:
|
|
769
|
+
canSplit: ge,
|
|
770
|
+
canPin: ge,
|
|
771
|
+
onSwitch: ge ? xe : () => c == null ? void 0 : c(O, p.id),
|
|
772
|
+
onOpenAsPane: ge ? J : () => c == null ? void 0 : c(O, p.id),
|
|
773
|
+
onTogglePinned: Mt,
|
|
774
|
+
onDelete: ge ? It : void 0
|
|
775
775
|
},
|
|
776
776
|
p.id
|
|
777
777
|
);
|
|
778
|
-
},
|
|
779
|
-
|
|
778
|
+
}, ut = (p) => /* @__PURE__ */ r(
|
|
779
|
+
Us,
|
|
780
780
|
{
|
|
781
781
|
projects: p,
|
|
782
782
|
activeProjectId: a,
|
|
783
|
-
fallbackName:
|
|
784
|
-
expandedIds:
|
|
785
|
-
onToggleExpanded:
|
|
786
|
-
pinnedProjectIds:
|
|
787
|
-
onTogglePinnedProject:
|
|
788
|
-
onOpenProjectSession: (M,
|
|
789
|
-
M === a ?
|
|
783
|
+
fallbackName: i || n || "Boring UI",
|
|
784
|
+
expandedIds: dt,
|
|
785
|
+
onToggleExpanded: $t,
|
|
786
|
+
pinnedProjectIds: De,
|
|
787
|
+
onTogglePinnedProject: Ut,
|
|
788
|
+
onOpenProjectSession: (M, O) => {
|
|
789
|
+
M === a ? xe(O) : c == null || c(M, O);
|
|
790
790
|
},
|
|
791
791
|
onShowMoreProjectSessions: f,
|
|
792
792
|
onCreateProjectSession: d,
|
|
793
793
|
onOpenProjectSettings: m,
|
|
794
794
|
onOpenProjectInNewTab: k,
|
|
795
|
-
renderProjectSession: (M,
|
|
796
|
-
id:
|
|
797
|
-
title:
|
|
798
|
-
updatedAt:
|
|
799
|
-
},
|
|
795
|
+
renderProjectSession: (M, O) => Le({
|
|
796
|
+
id: O.id,
|
|
797
|
+
title: O.title,
|
|
798
|
+
updatedAt: O.updatedAt
|
|
799
|
+
}, ye.has(O.id), M.id)
|
|
800
800
|
}
|
|
801
801
|
);
|
|
802
|
-
return /* @__PURE__ */
|
|
802
|
+
return /* @__PURE__ */ b(
|
|
803
803
|
"aside",
|
|
804
804
|
{
|
|
805
805
|
"data-boring-workspace-part": "app-left-pane",
|
|
@@ -807,20 +807,20 @@ function Us({
|
|
|
807
807
|
style: { width: e, minWidth: e, maxWidth: e },
|
|
808
808
|
"aria-label": "App navigation",
|
|
809
809
|
children: [
|
|
810
|
-
Gt ? /* @__PURE__ */
|
|
811
|
-
|
|
810
|
+
Gt ? /* @__PURE__ */ r(
|
|
811
|
+
Os,
|
|
812
812
|
{
|
|
813
|
-
appTitle:
|
|
814
|
-
workspaceLabel:
|
|
813
|
+
appTitle: n,
|
|
814
|
+
workspaceLabel: i,
|
|
815
815
|
topSlot: R,
|
|
816
|
-
showBrand:
|
|
816
|
+
showBrand: Kt
|
|
817
817
|
}
|
|
818
|
-
) : /* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
|
|
823
|
-
|
|
818
|
+
) : /* @__PURE__ */ r("div", { className: "h-12 shrink-0", "aria-hidden": "true" }),
|
|
819
|
+
/* @__PURE__ */ b("nav", { className: "shrink-0 space-y-0.5 px-2 pb-1 pt-1", "aria-label": "Primary workspace actions", children: [
|
|
820
|
+
/* @__PURE__ */ r(ln, { icon: /* @__PURE__ */ r(mn, { className: "h-4 w-4", strokeWidth: 2 }), label: "New chat", onClick: D, emphasis: !0 }),
|
|
821
|
+
/* @__PURE__ */ r(ln, { icon: /* @__PURE__ */ r(ts, { className: "h-4 w-4", strokeWidth: 1.75 }), label: "Search", onClick: F, trailing: /* @__PURE__ */ r(Ms, { keys: "⌘K" }) }),
|
|
822
|
+
lt.map((p) => /* @__PURE__ */ r(
|
|
823
|
+
ln,
|
|
824
824
|
{
|
|
825
825
|
icon: p.icon,
|
|
826
826
|
label: p.label,
|
|
@@ -831,15 +831,15 @@ function Us({
|
|
|
831
831
|
p.id
|
|
832
832
|
))
|
|
833
833
|
] }),
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
834
|
+
/* @__PURE__ */ r("div", { className: "boring-scrollbar-discreet min-h-0 flex-1 overflow-y-auto px-2 py-2", children: pe === "multi-project" ? /* @__PURE__ */ b("div", { className: "space-y-3 py-1", children: [
|
|
835
|
+
he.length > 0 || Se.length > 0 ? /* @__PURE__ */ b(cn, { title: "Pinned", children: [
|
|
836
|
+
he.map((p) => Le(p, !0)),
|
|
837
|
+
Se.length > 0 ? ut(Se) : null
|
|
838
838
|
] }) : null,
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
g ? /* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ b("section", { "data-boring-workspace-part": "app-left-pane-section", className: "space-y-1", children: [
|
|
840
|
+
/* @__PURE__ */ b("div", { className: "flex items-center justify-between gap-1 px-2 pb-0.5", children: [
|
|
841
|
+
/* @__PURE__ */ r("span", { className: "text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/65", children: s }),
|
|
842
|
+
g ? /* @__PURE__ */ r(
|
|
843
843
|
"button",
|
|
844
844
|
{
|
|
845
845
|
type: "button",
|
|
@@ -847,93 +847,93 @@ function Us({
|
|
|
847
847
|
title: "New project",
|
|
848
848
|
onClick: g,
|
|
849
849
|
className: "grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-foreground/[0.055] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
850
|
-
children: /* @__PURE__ */
|
|
850
|
+
children: /* @__PURE__ */ r(mn, { className: "h-3.5 w-3.5", strokeWidth: 2, "aria-hidden": "true" })
|
|
851
851
|
}
|
|
852
852
|
) : null
|
|
853
853
|
] }),
|
|
854
|
-
|
|
854
|
+
ut(zt)
|
|
855
855
|
] })
|
|
856
856
|
] }) : (
|
|
857
857
|
/* Single-project: no "Chats" wrapper — the session list is the whole
|
|
858
858
|
point of the body, so show Pinned + Sessions directly. */
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
|
|
861
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ b("div", { className: "space-y-4 py-1", children: [
|
|
860
|
+
he.length > 0 ? /* @__PURE__ */ r(cn, { title: "Pinned", children: he.map((p) => Le(p, !0)) }) : null,
|
|
861
|
+
/* @__PURE__ */ r(cn, { title: "Chats", empty: "No chats yet.", children: fe.map((p) => Le(p, !1)) })
|
|
862
862
|
] })
|
|
863
863
|
) }),
|
|
864
|
-
|
|
864
|
+
W ? /* @__PURE__ */ r("footer", { className: "shrink-0 border-t border-border/40 p-2", children: W }) : null
|
|
865
865
|
]
|
|
866
866
|
}
|
|
867
867
|
);
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function Ks({
|
|
870
870
|
width: e,
|
|
871
|
-
minWidth:
|
|
872
|
-
maxWidth:
|
|
871
|
+
minWidth: n,
|
|
872
|
+
maxWidth: i,
|
|
873
873
|
onResize: s
|
|
874
874
|
}) {
|
|
875
875
|
const o = H(null), a = A((d) => {
|
|
876
876
|
if (o.current == null) return;
|
|
877
877
|
const m = d.clientX - o.current;
|
|
878
878
|
o.current = d.clientX, m !== 0 && s(m);
|
|
879
|
-
}, [s]),
|
|
880
|
-
o.current = null, document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("pointermove", a), window.removeEventListener("pointerup",
|
|
879
|
+
}, [s]), c = A(() => {
|
|
880
|
+
o.current = null, document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", c);
|
|
881
881
|
}, [a]), f = A((d) => {
|
|
882
882
|
var m, k;
|
|
883
|
-
d.preventDefault(), (k = (m = d.currentTarget).setPointerCapture) == null || k.call(m, d.pointerId), o.current = d.clientX, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", window.addEventListener("pointermove", a), window.addEventListener("pointerup",
|
|
884
|
-
}, [a,
|
|
885
|
-
d.key === "ArrowLeft" ? (d.preventDefault(), s(d.shiftKey ? -48 : -16)) : d.key === "ArrowRight" ? (d.preventDefault(), s(d.shiftKey ? 48 : 16)) : d.key === "Home" ? (d.preventDefault(), s(
|
|
886
|
-
}, [
|
|
887
|
-
return /* @__PURE__ */
|
|
883
|
+
d.preventDefault(), (k = (m = d.currentTarget).setPointerCapture) == null || k.call(m, d.pointerId), o.current = d.clientX, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", window.addEventListener("pointermove", a), window.addEventListener("pointerup", c);
|
|
884
|
+
}, [a, c]), g = A((d) => {
|
|
885
|
+
d.key === "ArrowLeft" ? (d.preventDefault(), s(d.shiftKey ? -48 : -16)) : d.key === "ArrowRight" ? (d.preventDefault(), s(d.shiftKey ? 48 : 16)) : d.key === "Home" ? (d.preventDefault(), s(n - e)) : d.key === "End" && (d.preventDefault(), s(i - e));
|
|
886
|
+
}, [i, n, s, e]);
|
|
887
|
+
return /* @__PURE__ */ r(
|
|
888
888
|
"div",
|
|
889
889
|
{
|
|
890
890
|
role: "separator",
|
|
891
891
|
"aria-label": "Resize app navigation",
|
|
892
892
|
"aria-orientation": "vertical",
|
|
893
|
-
"aria-valuemin":
|
|
894
|
-
"aria-valuemax":
|
|
893
|
+
"aria-valuemin": n,
|
|
894
|
+
"aria-valuemax": i,
|
|
895
895
|
"aria-valuenow": e,
|
|
896
896
|
tabIndex: 0,
|
|
897
897
|
onKeyDown: g,
|
|
898
898
|
onPointerDown: f,
|
|
899
899
|
className: "group relative z-20 -ml-px w-1 shrink-0 cursor-col-resize touch-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
900
|
-
children: /* @__PURE__ */
|
|
900
|
+
children: /* @__PURE__ */ r("span", { className: "absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors group-hover:bg-foreground/30 group-active:bg-foreground/45" })
|
|
901
901
|
}
|
|
902
902
|
);
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function Hs({
|
|
905
905
|
collapsed: e,
|
|
906
|
-
leftPane:
|
|
907
|
-
children:
|
|
906
|
+
leftPane: n,
|
|
907
|
+
children: i,
|
|
908
908
|
onExpand: s,
|
|
909
909
|
onCollapse: o,
|
|
910
910
|
onResizeLeftPane: a,
|
|
911
|
-
leftPaneWidth:
|
|
911
|
+
leftPaneWidth: c,
|
|
912
912
|
minLeftPaneWidth: f = 220,
|
|
913
913
|
maxLeftPaneWidth: g = 420,
|
|
914
914
|
className: d
|
|
915
915
|
}) {
|
|
916
916
|
const [m, k] = L(!1);
|
|
917
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ b(
|
|
918
918
|
"div",
|
|
919
919
|
{
|
|
920
920
|
"data-boring-workspace-part": "plugin-tabs-shell",
|
|
921
921
|
"data-boring-state": e ? "collapsed" : "expanded",
|
|
922
|
-
className:
|
|
922
|
+
className: V("relative flex h-full min-h-0 w-full overflow-hidden bg-background", d),
|
|
923
923
|
children: [
|
|
924
|
-
e ? null :
|
|
925
|
-
!e && a &&
|
|
926
|
-
|
|
924
|
+
e ? null : n,
|
|
925
|
+
!e && a && c != null ? /* @__PURE__ */ r(
|
|
926
|
+
Ks,
|
|
927
927
|
{
|
|
928
|
-
width:
|
|
928
|
+
width: c,
|
|
929
929
|
minWidth: f,
|
|
930
930
|
maxWidth: g,
|
|
931
931
|
onResize: a
|
|
932
932
|
}
|
|
933
933
|
) : null,
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
e ? /* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ r("div", { className: "relative min-w-0 flex-1", children: i }),
|
|
935
|
+
e ? /* @__PURE__ */ b(ue, { children: [
|
|
936
|
+
/* @__PURE__ */ r(
|
|
937
937
|
"div",
|
|
938
938
|
{
|
|
939
939
|
"data-boring-workspace-part": "app-left-peek-trigger",
|
|
@@ -942,132 +942,132 @@ function zs({
|
|
|
942
942
|
"aria-hidden": "true"
|
|
943
943
|
}
|
|
944
944
|
),
|
|
945
|
-
m ? /* @__PURE__ */
|
|
945
|
+
m ? /* @__PURE__ */ r(
|
|
946
946
|
"div",
|
|
947
947
|
{
|
|
948
948
|
"data-boring-workspace-part": "app-left-peek",
|
|
949
949
|
"data-boring-state": "open",
|
|
950
950
|
onMouseLeave: () => k(!1),
|
|
951
951
|
className: "absolute inset-y-0 left-0 z-[65] flex shadow-2xl",
|
|
952
|
-
children:
|
|
952
|
+
children: n
|
|
953
953
|
}
|
|
954
954
|
) : null
|
|
955
955
|
] }) : null,
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
|
|
956
|
+
/* @__PURE__ */ r("div", { className: "pointer-events-none absolute left-1.5 top-2 z-[70]", children: /* @__PURE__ */ r(
|
|
957
|
+
ds,
|
|
958
958
|
{
|
|
959
959
|
label: e ? "Open app navigation" : "Hide app navigation",
|
|
960
960
|
side: "right",
|
|
961
961
|
onClick: e ? s : o,
|
|
962
|
-
children: e ? /* @__PURE__ */
|
|
962
|
+
children: e ? /* @__PURE__ */ r(ns, { className: "h-4 w-4", strokeWidth: 1.75 }) : /* @__PURE__ */ r(rs, { className: "h-4 w-4", strokeWidth: 1.75 })
|
|
963
963
|
}
|
|
964
964
|
) })
|
|
965
965
|
]
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function Bs() {
|
|
970
970
|
const e = `s${Date.now()}`;
|
|
971
971
|
return {
|
|
972
972
|
sessions: [{ id: e, title: "New session", updatedAt: Date.now() }],
|
|
973
973
|
activeId: e
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
|
-
function
|
|
977
|
-
var
|
|
978
|
-
if (typeof localStorage > "u") return
|
|
976
|
+
function Js(e, n) {
|
|
977
|
+
var i;
|
|
978
|
+
if (typeof localStorage > "u") return n();
|
|
979
979
|
try {
|
|
980
980
|
const s = localStorage.getItem(e);
|
|
981
981
|
if (s) {
|
|
982
982
|
const o = JSON.parse(s), a = Array.isArray(o.sessions) ? o.sessions : Array.isArray(o.items) ? o.items : null;
|
|
983
983
|
if (a)
|
|
984
|
-
return { sessions: a, activeId: o.activeId ?? ((
|
|
984
|
+
return { sessions: a, activeId: o.activeId ?? ((i = a[0]) == null ? void 0 : i.id) ?? "" };
|
|
985
985
|
}
|
|
986
986
|
} catch {
|
|
987
987
|
}
|
|
988
|
-
return
|
|
988
|
+
return n();
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function qs(e, n) {
|
|
991
991
|
if (!(typeof localStorage > "u"))
|
|
992
992
|
try {
|
|
993
|
-
localStorage.setItem(e, JSON.stringify(
|
|
993
|
+
localStorage.setItem(e, JSON.stringify(n));
|
|
994
994
|
} catch {
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
|
-
function
|
|
998
|
-
const
|
|
999
|
-
let s =
|
|
1000
|
-
const o = /* @__PURE__ */ new Set(), a = (
|
|
1001
|
-
s =
|
|
997
|
+
function Vs(e = {}) {
|
|
998
|
+
const n = e.storageKey ?? "workspace:sessions", i = e.initial ?? Bs;
|
|
999
|
+
let s = Js(n, i);
|
|
1000
|
+
const o = /* @__PURE__ */ new Set(), a = (c) => {
|
|
1001
|
+
s = c, qs(n, s), o.forEach((f) => f());
|
|
1002
1002
|
};
|
|
1003
1003
|
return {
|
|
1004
1004
|
getState: () => s,
|
|
1005
|
-
subscribe(
|
|
1006
|
-
return o.add(
|
|
1007
|
-
o.delete(
|
|
1005
|
+
subscribe(c) {
|
|
1006
|
+
return o.add(c), () => {
|
|
1007
|
+
o.delete(c);
|
|
1008
1008
|
};
|
|
1009
1009
|
},
|
|
1010
|
-
switchTo(
|
|
1011
|
-
a({ ...s, activeId:
|
|
1010
|
+
switchTo(c) {
|
|
1011
|
+
a({ ...s, activeId: c });
|
|
1012
1012
|
},
|
|
1013
1013
|
create() {
|
|
1014
|
-
const
|
|
1015
|
-
id:
|
|
1014
|
+
const c = `s${Date.now()}`, f = {
|
|
1015
|
+
id: c,
|
|
1016
1016
|
title: "New session",
|
|
1017
1017
|
updatedAt: Date.now()
|
|
1018
1018
|
};
|
|
1019
|
-
a({ sessions: [f, ...s.sessions], activeId:
|
|
1019
|
+
a({ sessions: [f, ...s.sessions], activeId: c });
|
|
1020
1020
|
},
|
|
1021
|
-
remove(
|
|
1021
|
+
remove(c) {
|
|
1022
1022
|
var d;
|
|
1023
|
-
const f = s.sessions.filter((m) => m.id !==
|
|
1023
|
+
const f = s.sessions.filter((m) => m.id !== c), g = s.activeId === c ? ((d = f[0]) == null ? void 0 : d.id) ?? "" : s.activeId;
|
|
1024
1024
|
a({ sessions: f, activeId: g });
|
|
1025
1025
|
}
|
|
1026
1026
|
};
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return
|
|
1028
|
+
function Ys(e) {
|
|
1029
|
+
return gn(e.subscribe, e.getState, e.getState);
|
|
1030
1030
|
}
|
|
1031
|
-
const
|
|
1032
|
-
function
|
|
1033
|
-
return new Promise((
|
|
1031
|
+
const Xs = 500, js = 1e4;
|
|
1032
|
+
function Cr(e) {
|
|
1033
|
+
return new Promise((n, i) => {
|
|
1034
1034
|
let s;
|
|
1035
1035
|
const o = () => {
|
|
1036
1036
|
s && globalThis.clearTimeout(s), e.removeEventListener("abort", a);
|
|
1037
1037
|
}, a = () => {
|
|
1038
|
-
o(),
|
|
1038
|
+
o(), i(new DOMException("Warmup aborted", "AbortError"));
|
|
1039
1039
|
};
|
|
1040
1040
|
if (e.aborted) {
|
|
1041
1041
|
a();
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
s = globalThis.setTimeout(() => {
|
|
1045
|
-
o(),
|
|
1046
|
-
},
|
|
1045
|
+
o(), n();
|
|
1046
|
+
}, Xs), e.addEventListener("abort", a, { once: !0 });
|
|
1047
1047
|
});
|
|
1048
1048
|
}
|
|
1049
|
-
async function
|
|
1050
|
-
const
|
|
1051
|
-
if (!
|
|
1052
|
-
const
|
|
1049
|
+
async function Qs(e) {
|
|
1050
|
+
const n = e.body;
|
|
1051
|
+
if (!n) return Lt(await Ot(e));
|
|
1052
|
+
const i = n.getReader(), s = new TextDecoder();
|
|
1053
1053
|
let o = "";
|
|
1054
1054
|
try {
|
|
1055
1055
|
for (; ; ) {
|
|
1056
|
-
const { done: a, value:
|
|
1057
|
-
if (
|
|
1058
|
-
o += s.decode(
|
|
1059
|
-
const f =
|
|
1056
|
+
const { done: a, value: c } = await i.read();
|
|
1057
|
+
if (c) {
|
|
1058
|
+
o += s.decode(c, { stream: !a });
|
|
1059
|
+
const f = Lt(o);
|
|
1060
1060
|
if (f) return f;
|
|
1061
1061
|
}
|
|
1062
1062
|
if (a)
|
|
1063
|
-
return o += s.decode(),
|
|
1063
|
+
return o += s.decode(), Lt(o);
|
|
1064
1064
|
}
|
|
1065
1065
|
} finally {
|
|
1066
|
-
await
|
|
1066
|
+
await i.cancel().catch(() => {
|
|
1067
1067
|
});
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Zs(e) {
|
|
1071
1071
|
if (!((e == null ? void 0 : e.runtimeDependenciesState) !== "preparing" && (e == null ? void 0 : e.runtimeDependenciesState) !== "ready" && (e == null ? void 0 : e.runtimeDependenciesState) !== "failed"))
|
|
1072
1072
|
return {
|
|
1073
1073
|
state: e.runtimeDependenciesState,
|
|
@@ -1075,90 +1075,90 @@ function js(e) {
|
|
|
1075
1075
|
...e.runtimeDependenciesRequirement ? { requirement: e.runtimeDependenciesRequirement } : {}
|
|
1076
1076
|
};
|
|
1077
1077
|
}
|
|
1078
|
-
async function
|
|
1078
|
+
async function eo(e) {
|
|
1079
1079
|
if (!e.ok) {
|
|
1080
1080
|
const o = await Ot(e);
|
|
1081
|
-
if (
|
|
1082
|
-
throw new Error(
|
|
1081
|
+
if (bn(o)) return { status: "preparing" };
|
|
1082
|
+
throw new Error(vn(o) ?? `/api/v1/ready-status failed with ${e.status}`);
|
|
1083
1083
|
}
|
|
1084
|
-
const
|
|
1085
|
-
if ((
|
|
1086
|
-
if (s && (
|
|
1087
|
-
return { status: "ready", runtimeDependencies:
|
|
1088
|
-
throw new Error(
|
|
1084
|
+
const n = await Qs(e), i = Zs(n), s = us(n);
|
|
1085
|
+
if ((n == null ? void 0 : n.state) === "degraded" || (n == null ? void 0 : n.state) === "failed") {
|
|
1086
|
+
if (s && (i == null ? void 0 : i.state) === "failed")
|
|
1087
|
+
return { status: "ready", runtimeDependencies: i };
|
|
1088
|
+
throw new Error(n.message ?? "Workspace failed to prepare");
|
|
1089
1089
|
}
|
|
1090
|
-
return s ? { status: "ready", ...
|
|
1090
|
+
return s ? { status: "ready", ...i ? { runtimeDependencies: i } : {} } : { status: "preparing", ...i ? { runtimeDependencies: i } : {} };
|
|
1091
1091
|
}
|
|
1092
|
-
async function
|
|
1092
|
+
async function to({
|
|
1093
1093
|
apiBaseUrl: e,
|
|
1094
|
-
path:
|
|
1095
|
-
headers:
|
|
1094
|
+
path: n,
|
|
1095
|
+
headers: i,
|
|
1096
1096
|
signal: s,
|
|
1097
1097
|
workspaceId: o
|
|
1098
1098
|
}) {
|
|
1099
|
-
const a = new AbortController(),
|
|
1099
|
+
const a = new AbortController(), c = globalThis.setTimeout(() => a.abort(new DOMException("Warmup attempt timed out", "TimeoutError")), js), f = () => a.abort(s.reason);
|
|
1100
1100
|
s.aborted && f(), s.addEventListener("abort", f, { once: !0 });
|
|
1101
1101
|
try {
|
|
1102
|
-
const g = await fetch(
|
|
1103
|
-
if (
|
|
1102
|
+
const g = await fetch(Hr(e, n), { headers: i, signal: a.signal });
|
|
1103
|
+
if (Br(n)) return await eo(g);
|
|
1104
1104
|
const d = await Ot(g);
|
|
1105
1105
|
if (!g.ok) {
|
|
1106
|
-
const m =
|
|
1106
|
+
const m = bn(d);
|
|
1107
1107
|
if (m) return { status: "preparing", ...m };
|
|
1108
|
-
throw new Error(
|
|
1108
|
+
throw new Error(vn(d) ?? `${n} failed with ${g.status}`);
|
|
1109
1109
|
}
|
|
1110
|
-
return d && typeof d == "object" &&
|
|
1110
|
+
return d && typeof d == "object" && Jr(e, i["x-boring-workspace-id"] ?? o, n, d), { status: "ready" };
|
|
1111
1111
|
} catch (g) {
|
|
1112
1112
|
if (s.aborted) throw g;
|
|
1113
1113
|
if (a.signal.aborted || g instanceof TypeError) return { status: "preparing" };
|
|
1114
1114
|
throw g;
|
|
1115
1115
|
} finally {
|
|
1116
|
-
globalThis.clearTimeout(
|
|
1116
|
+
globalThis.clearTimeout(c), s.removeEventListener("abort", f);
|
|
1117
1117
|
}
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function no({
|
|
1120
1120
|
workspaceId: e,
|
|
1121
|
-
requestHeaders:
|
|
1122
|
-
apiBaseUrl:
|
|
1121
|
+
requestHeaders: n,
|
|
1122
|
+
apiBaseUrl: i,
|
|
1123
1123
|
preloadPaths: s = Gr,
|
|
1124
1124
|
provisionWorkspace: o = !0,
|
|
1125
1125
|
onStatusChange: a
|
|
1126
1126
|
}) {
|
|
1127
1127
|
return _(() => {
|
|
1128
|
-
let
|
|
1129
|
-
const f = new AbortController(), g =
|
|
1128
|
+
let c = !1;
|
|
1129
|
+
const f = new AbortController(), g = Wt(e, n);
|
|
1130
1130
|
async function d() {
|
|
1131
1131
|
var m, k;
|
|
1132
1132
|
a == null || a({ status: "preparing" });
|
|
1133
1133
|
try {
|
|
1134
|
-
const R =
|
|
1135
|
-
apiBaseUrl:
|
|
1136
|
-
path:
|
|
1134
|
+
const R = Kr(s, o), W = (v) => to({
|
|
1135
|
+
apiBaseUrl: i,
|
|
1136
|
+
path: v,
|
|
1137
1137
|
headers: g,
|
|
1138
1138
|
signal: f.signal,
|
|
1139
1139
|
workspaceId: e
|
|
1140
1140
|
});
|
|
1141
|
-
let E = await Promise.all(R.map(async (
|
|
1142
|
-
if (
|
|
1143
|
-
let x = (m = E.find((
|
|
1141
|
+
let E = await Promise.all(R.map(async (v) => ({ path: v, result: await W(v) })));
|
|
1142
|
+
if (c || f.signal.aborted) return;
|
|
1143
|
+
let x = (m = E.find((v) => v.result.runtimeDependencies)) == null ? void 0 : m.result.runtimeDependencies, h = E.filter((v) => v.result.status === "preparing");
|
|
1144
1144
|
for (; h.length > 0; ) {
|
|
1145
|
-
let
|
|
1145
|
+
let v;
|
|
1146
1146
|
for (const y of h)
|
|
1147
1147
|
if (y.result.status === "preparing" && y.result.requirement) {
|
|
1148
|
-
|
|
1148
|
+
v = y.result.requirement;
|
|
1149
1149
|
break;
|
|
1150
1150
|
}
|
|
1151
|
-
if (a == null || a({ status: "preparing", message: "Workspace is still preparing", ...
|
|
1151
|
+
if (a == null || a({ status: "preparing", message: "Workspace is still preparing", ...v ? { requirement: v } : {} }), await Cr(f.signal), c || f.signal.aborted || (E = await Promise.all(h.map(async (y) => ({ path: y.path, result: await W(y.path) }))), c || f.signal.aborted)) return;
|
|
1152
1152
|
x = ((k = E.find((y) => y.result.runtimeDependencies)) == null ? void 0 : k.result.runtimeDependencies) ?? x, h = E.filter((y) => y.result.status === "preparing");
|
|
1153
1153
|
}
|
|
1154
1154
|
for (a == null || a({ status: "ready", ...x ? { runtimeDependencies: x } : {} }); (x == null ? void 0 : x.state) === "preparing"; ) {
|
|
1155
|
-
if (await
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
x =
|
|
1155
|
+
if (await Cr(f.signal), c || f.signal.aborted) return;
|
|
1156
|
+
const v = await W("/api/v1/ready-status");
|
|
1157
|
+
if (c || f.signal.aborted) return;
|
|
1158
|
+
x = v.runtimeDependencies, x && (a == null || a({ status: "ready", runtimeDependencies: x }));
|
|
1159
1159
|
}
|
|
1160
1160
|
} catch (R) {
|
|
1161
|
-
if (
|
|
1161
|
+
if (c || f.signal.aborted) return;
|
|
1162
1162
|
a == null || a({
|
|
1163
1163
|
status: "failed",
|
|
1164
1164
|
message: R instanceof Error ? R.message : "Workspace failed to prepare"
|
|
@@ -1166,775 +1166,777 @@ function eo({
|
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
return d(), () => {
|
|
1169
|
-
|
|
1169
|
+
c = !0, f.abort();
|
|
1170
1170
|
};
|
|
1171
|
-
}, [
|
|
1171
|
+
}, [i, a, s, o, n, e]), null;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
const
|
|
1175
|
-
return /* @__PURE__ */
|
|
1176
|
-
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
e.status === "failed" ? /* @__PURE__ */
|
|
1173
|
+
function ro({ status: e }) {
|
|
1174
|
+
const n = e.status === "ready" ? void 0 : e.requirement, i = e.status !== "failed", s = i ? n === "workspace-fs" ? "Preparing files…" : n === "sandbox-exec" ? "Preparing secure runtime…" : n === "ui-bridge" ? "Connecting workspace…" : "Preparing workspace…" : "Workspace workbench failed", o = e.status === "failed" ? e.message : "Chat is ready while files, tools, and workspace panels finish warming up.";
|
|
1175
|
+
return /* @__PURE__ */ r("div", { className: "flex h-full min-h-0 items-center justify-center bg-background px-6 text-center", children: /* @__PURE__ */ b("div", { className: "max-w-sm rounded-2xl border border-border bg-card p-5 shadow-sm", children: [
|
|
1176
|
+
i ? /* @__PURE__ */ r("div", { className: "mx-auto mb-3 h-7 w-7 rounded-full border-2 border-muted-foreground/20 border-t-foreground animate-spin", "aria-hidden": "true" }) : null,
|
|
1177
|
+
/* @__PURE__ */ r("div", { className: "text-sm font-semibold text-foreground", children: s }),
|
|
1178
|
+
/* @__PURE__ */ r("p", { className: "mt-2 text-sm text-muted-foreground", children: o }),
|
|
1179
|
+
e.status === "failed" ? /* @__PURE__ */ r("p", { className: "mt-3 text-xs text-muted-foreground", children: "Reload the workspace to retry." }) : null
|
|
1180
1180
|
] }) });
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return /* @__PURE__ */
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
1182
|
+
function io() {
|
|
1183
|
+
return /* @__PURE__ */ r("div", { className: "flex h-full min-h-0 items-center justify-center bg-background px-6 text-center", children: /* @__PURE__ */ b("div", { className: "max-w-sm rounded-2xl border border-border bg-card p-5 shadow-sm", children: [
|
|
1184
|
+
/* @__PURE__ */ r("div", { className: "mx-auto mb-3 h-7 w-7 rounded-full border-2 border-muted-foreground/20 border-t-foreground animate-spin", "aria-hidden": "true" }),
|
|
1185
|
+
/* @__PURE__ */ r("div", { className: "text-sm font-semibold text-foreground", children: "Loading sessions…" }),
|
|
1186
|
+
/* @__PURE__ */ r("p", { className: "mt-2 text-sm text-muted-foreground", children: "Finding this workspace’s saved chats." })
|
|
1187
1187
|
] }) });
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function so(e) {
|
|
1190
1190
|
if (!e) return "/api/v1/ui";
|
|
1191
|
-
const
|
|
1192
|
-
return
|
|
1191
|
+
const n = e.replace(/\/$/, ""), i = "/api/v1/ui";
|
|
1192
|
+
return n.endsWith(i) ? n : `${n}${i}`;
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1195
|
-
return `${
|
|
1194
|
+
function oo(e) {
|
|
1195
|
+
return `${so(e)}/state`;
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function ao(e) {
|
|
1198
1198
|
var s;
|
|
1199
|
-
const
|
|
1200
|
-
return typeof
|
|
1199
|
+
const n = e.openTabs.find((o) => o.id === e.activeTab), i = (s = n == null ? void 0 : n.params) == null ? void 0 : s.path;
|
|
1200
|
+
return typeof i == "string" ? i : null;
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function lo({
|
|
1203
1203
|
bridgeEndpoint: e,
|
|
1204
|
-
requestHeaders:
|
|
1205
|
-
navOpen:
|
|
1204
|
+
requestHeaders: n,
|
|
1205
|
+
navOpen: i,
|
|
1206
1206
|
surfaceOpen: s,
|
|
1207
1207
|
surfaceReady: o,
|
|
1208
1208
|
snapshot: a
|
|
1209
1209
|
}) {
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
), d =
|
|
1210
|
+
const c = qr(), f = fs(), g = gn(
|
|
1211
|
+
c.subscribe,
|
|
1212
|
+
c.getSnapshot,
|
|
1213
|
+
c.getSnapshot
|
|
1214
|
+
), d = gn(
|
|
1215
1215
|
f.subscribe,
|
|
1216
1216
|
f.getSnapshot,
|
|
1217
1217
|
f.getSnapshot
|
|
1218
1218
|
), m = H(null);
|
|
1219
1219
|
return _(() => {
|
|
1220
|
-
var
|
|
1220
|
+
var W;
|
|
1221
1221
|
if (e === null || s && !o) return;
|
|
1222
|
-
(
|
|
1222
|
+
(W = m.current) == null || W.abort();
|
|
1223
1223
|
const k = new AbortController();
|
|
1224
1224
|
m.current = k;
|
|
1225
1225
|
const R = {
|
|
1226
1226
|
v: 1,
|
|
1227
|
-
drawerOpen:
|
|
1227
|
+
drawerOpen: i,
|
|
1228
1228
|
workbenchOpen: s,
|
|
1229
1229
|
openTabs: a.openTabs,
|
|
1230
1230
|
activeTab: a.activeTab,
|
|
1231
|
-
activeFile:
|
|
1231
|
+
activeFile: ao(a),
|
|
1232
1232
|
availablePanels: g.map((E) => E.id),
|
|
1233
1233
|
availableSurfaces: d.flatMap((E) => {
|
|
1234
|
-
const x =
|
|
1234
|
+
const x = gs(E);
|
|
1235
1235
|
return x ? [x] : [];
|
|
1236
1236
|
})
|
|
1237
1237
|
};
|
|
1238
|
-
return fetch(
|
|
1238
|
+
return fetch(oo(e), {
|
|
1239
1239
|
method: "PUT",
|
|
1240
|
-
headers: { ...
|
|
1240
|
+
headers: { ...n, "Content-Type": "application/json" },
|
|
1241
1241
|
body: JSON.stringify({ state: R, causedBy: "user" }),
|
|
1242
1242
|
signal: k.signal
|
|
1243
1243
|
}).catch(() => {
|
|
1244
1244
|
}), () => {
|
|
1245
1245
|
k.abort();
|
|
1246
1246
|
};
|
|
1247
|
-
}, [e,
|
|
1247
|
+
}, [e, i, g, n, a, s, o, d]), null;
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const { blockers:
|
|
1249
|
+
function co({ onQuestionOpen: e }) {
|
|
1250
|
+
const { blockers: n } = ms(), i = n.some((o) => o.reason === "waiting_for_user_input"), s = H(!1);
|
|
1251
1251
|
return _(() => {
|
|
1252
|
-
|
|
1253
|
-
}, [
|
|
1252
|
+
i && !s.current && e(), s.current = i;
|
|
1253
|
+
}, [i, e]), null;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function Tr(e) {
|
|
1256
1256
|
return typeof (e == null ? void 0 : e.id) == "string" ? e.id : null;
|
|
1257
1257
|
}
|
|
1258
|
-
function _t(e,
|
|
1259
|
-
if (e.includes(
|
|
1260
|
-
const s =
|
|
1261
|
-
return [...e.slice(0, o),
|
|
1258
|
+
function _t(e, n, i) {
|
|
1259
|
+
if (e.includes(i)) return e;
|
|
1260
|
+
const s = n ? e.indexOf(n) : -1, o = s >= 0 ? s + 1 : e.length;
|
|
1261
|
+
return [...e.slice(0, o), i, ...e.slice(o)];
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1264
|
-
if (e.includes(
|
|
1265
|
-
if (e.length === 0) return [
|
|
1266
|
-
const s =
|
|
1267
|
-
return e.map((a,
|
|
1263
|
+
function dn(e, n, i) {
|
|
1264
|
+
if (e.includes(i)) return e;
|
|
1265
|
+
if (e.length === 0) return [i];
|
|
1266
|
+
const s = n ? e.indexOf(n) : -1, o = s >= 0 ? s : 0;
|
|
1267
|
+
return e.map((a, c) => c === o ? i : a);
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return e.endsWith(":surface") ? e.slice(0, -8) :
|
|
1269
|
+
function uo(e, n) {
|
|
1270
|
+
return e.endsWith(":surface") ? e.slice(0, -8) : n;
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1273
|
-
const [s, o] = L(() =>
|
|
1272
|
+
function fo(e, n, i) {
|
|
1273
|
+
const [s, o] = L(() => Ar(e, n, i));
|
|
1274
1274
|
_(() => {
|
|
1275
|
-
o(
|
|
1276
|
-
}, [e,
|
|
1275
|
+
o(Ar(e, n, i));
|
|
1276
|
+
}, [e, n, i]);
|
|
1277
1277
|
const a = A(
|
|
1278
|
-
(
|
|
1278
|
+
(c) => {
|
|
1279
1279
|
o((f) => {
|
|
1280
|
-
const g = typeof
|
|
1281
|
-
return
|
|
1280
|
+
const g = typeof c == "function" ? c(f) : c;
|
|
1281
|
+
return Cs(e, g, i), g;
|
|
1282
1282
|
});
|
|
1283
1283
|
},
|
|
1284
|
-
[
|
|
1284
|
+
[i, e]
|
|
1285
1285
|
);
|
|
1286
1286
|
return [s, a];
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1289
|
-
const [s, o] = L(() =>
|
|
1288
|
+
function Dt(e, n, i) {
|
|
1289
|
+
const [s, o] = L(() => kr(e, n, i));
|
|
1290
1290
|
_(() => {
|
|
1291
|
-
o(
|
|
1292
|
-
}, [e,
|
|
1291
|
+
o(kr(e, n, i));
|
|
1292
|
+
}, [e, n, i]);
|
|
1293
1293
|
const a = A(
|
|
1294
|
-
(
|
|
1295
|
-
o(
|
|
1294
|
+
(c) => {
|
|
1295
|
+
o(c), Rs(e, c, i);
|
|
1296
1296
|
},
|
|
1297
|
-
[
|
|
1297
|
+
[i, e]
|
|
1298
1298
|
);
|
|
1299
1299
|
return [s, a];
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1302
|
-
function
|
|
1303
|
-
return Math.min(
|
|
1301
|
+
const un = {}, go = [], _r = { status: "preparing" };
|
|
1302
|
+
function Dr(e, n, i) {
|
|
1303
|
+
return Math.min(i, Math.max(n, e));
|
|
1304
1304
|
}
|
|
1305
|
-
const
|
|
1305
|
+
const Lr = {
|
|
1306
1306
|
openTabs: [],
|
|
1307
1307
|
activeTab: null
|
|
1308
1308
|
};
|
|
1309
|
-
function
|
|
1310
|
-
const
|
|
1309
|
+
function mo(e) {
|
|
1310
|
+
const n = e.workspaceId ?? po(e.requestHeaders) ?? e.storageKey, i = os({
|
|
1311
1311
|
apiBaseUrl: e.apiBaseUrl,
|
|
1312
|
-
workspaceId:
|
|
1313
|
-
storageScope:
|
|
1312
|
+
workspaceId: n,
|
|
1313
|
+
storageScope: n,
|
|
1314
1314
|
requestHeaders: e.requestHeaders,
|
|
1315
1315
|
enabled: e.enabled,
|
|
1316
1316
|
connectActiveSession: !1,
|
|
1317
1317
|
refreshKey: e.refreshKey
|
|
1318
1318
|
});
|
|
1319
|
-
return { ...
|
|
1319
|
+
return { ...i, workspaceId: i.dataStorageScope };
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1321
|
+
function po(e) {
|
|
1322
1322
|
return (e == null ? void 0 : e["x-boring-workspace-id"]) ?? (e == null ? void 0 : e["X-Boring-Workspace-Id"]) ?? null;
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1325
|
-
const
|
|
1326
|
-
return
|
|
1324
|
+
function ho(e) {
|
|
1325
|
+
const n = e.reloaded ? "Extensions reloaded." : "Extensions will reload on the next message.", i = Array.isArray(e.diagnostics) ? e.diagnostics.map((s) => s.message).filter((s) => !!s) : [];
|
|
1326
|
+
return i.length > 0 ? `${n}
|
|
1327
1327
|
|
|
1328
1328
|
Warnings:
|
|
1329
|
-
${
|
|
1330
|
-
`)}` :
|
|
1329
|
+
${i.join(`
|
|
1330
|
+
`)}` : n;
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1333
|
-
var
|
|
1332
|
+
function bo(e) {
|
|
1333
|
+
var n;
|
|
1334
1334
|
try {
|
|
1335
|
-
return ((
|
|
1335
|
+
return ((n = globalThis.localStorage) == null ? void 0 : n.getItem(e)) ?? null;
|
|
1336
1336
|
} catch {
|
|
1337
1337
|
return null;
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1341
|
-
var
|
|
1340
|
+
function Wr(e, n) {
|
|
1341
|
+
var i;
|
|
1342
1342
|
try {
|
|
1343
|
-
const s = (
|
|
1343
|
+
const s = (i = globalThis.localStorage) == null ? void 0 : i.getItem(e);
|
|
1344
1344
|
if (!s) return null;
|
|
1345
1345
|
const o = JSON.parse(s), a = Array.isArray(o.ids) ? o.ids.filter((f) => typeof f == "string" && f.length > 0) : [];
|
|
1346
1346
|
if (a.length === 0) return null;
|
|
1347
|
-
const
|
|
1348
|
-
return { workspaceId:
|
|
1347
|
+
const c = typeof o.activeId == "string" && a.includes(o.activeId) ? o.activeId : a[0];
|
|
1348
|
+
return { workspaceId: n, ids: a, activeId: c };
|
|
1349
1349
|
} catch {
|
|
1350
1350
|
return null;
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1354
|
-
var
|
|
1353
|
+
function vo(e, n) {
|
|
1354
|
+
var i, s;
|
|
1355
1355
|
try {
|
|
1356
|
-
if (
|
|
1357
|
-
(
|
|
1356
|
+
if (n.ids.length === 0) {
|
|
1357
|
+
(i = globalThis.localStorage) == null || i.removeItem(e);
|
|
1358
1358
|
return;
|
|
1359
1359
|
}
|
|
1360
1360
|
(s = globalThis.localStorage) == null || s.setItem(
|
|
1361
1361
|
e,
|
|
1362
|
-
JSON.stringify({ ids:
|
|
1362
|
+
JSON.stringify({ ids: n.ids, activeId: n.activeId })
|
|
1363
1363
|
);
|
|
1364
1364
|
} catch {
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
|
-
function Or(e,
|
|
1368
|
-
var
|
|
1367
|
+
function Or(e, n) {
|
|
1368
|
+
var i;
|
|
1369
1369
|
try {
|
|
1370
|
-
const s = (
|
|
1370
|
+
const s = (i = globalThis.localStorage) == null ? void 0 : i.getItem(e);
|
|
1371
1371
|
if (!s) return null;
|
|
1372
|
-
const o = JSON.parse(s), a = Array.isArray(o.ids) ? o.ids.filter((
|
|
1373
|
-
return { workspaceId:
|
|
1372
|
+
const o = JSON.parse(s), a = Array.isArray(o.ids) ? o.ids.filter((c) => typeof c == "string" && c.length > 0) : [];
|
|
1373
|
+
return { workspaceId: n, ids: a };
|
|
1374
1374
|
} catch {
|
|
1375
1375
|
return null;
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1379
|
-
var
|
|
1378
|
+
function xo(e, n) {
|
|
1379
|
+
var i, s;
|
|
1380
1380
|
try {
|
|
1381
|
-
if (
|
|
1382
|
-
(
|
|
1381
|
+
if (n.length === 0) {
|
|
1382
|
+
(i = globalThis.localStorage) == null || i.removeItem(e);
|
|
1383
1383
|
return;
|
|
1384
1384
|
}
|
|
1385
|
-
(s = globalThis.localStorage) == null || s.setItem(e, JSON.stringify({ ids:
|
|
1385
|
+
(s = globalThis.localStorage) == null || s.setItem(e, JSON.stringify({ ids: n }));
|
|
1386
1386
|
} catch {
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
|
-
function
|
|
1389
|
+
function Ko({
|
|
1390
1390
|
workspaceId: e,
|
|
1391
|
-
chatPanel:
|
|
1392
|
-
useSessions:
|
|
1391
|
+
chatPanel: n,
|
|
1392
|
+
useSessions: i,
|
|
1393
1393
|
requestHeaders: s,
|
|
1394
1394
|
sessionStorageKey: o,
|
|
1395
1395
|
providerStorageKey: a,
|
|
1396
|
-
surfaceStorageKey:
|
|
1396
|
+
surfaceStorageKey: c,
|
|
1397
1397
|
beforeShell: f,
|
|
1398
1398
|
afterShell: g,
|
|
1399
1399
|
panels: d,
|
|
1400
1400
|
commands: m,
|
|
1401
1401
|
catalogs: k,
|
|
1402
1402
|
plugins: R,
|
|
1403
|
-
excludeDefaults:
|
|
1403
|
+
excludeDefaults: W,
|
|
1404
1404
|
capabilities: E,
|
|
1405
1405
|
apiBaseUrl: x,
|
|
1406
1406
|
authHeaders: h,
|
|
1407
|
-
apiTimeout:
|
|
1407
|
+
apiTimeout: v,
|
|
1408
1408
|
defaultTheme: y,
|
|
1409
1409
|
onThemeChange: D,
|
|
1410
1410
|
persistenceEnabled: F,
|
|
1411
|
-
debug:
|
|
1411
|
+
debug: xe,
|
|
1412
1412
|
bridgeEndpoint: J,
|
|
1413
|
-
fullPageBasePath:
|
|
1414
|
-
onAuthError:
|
|
1415
|
-
sessions:
|
|
1416
|
-
activeSessionId:
|
|
1417
|
-
onSwitchSession:
|
|
1418
|
-
onCreateSession:
|
|
1419
|
-
onDeleteSession:
|
|
1420
|
-
onActiveSessionIdChange:
|
|
1421
|
-
appTitle:
|
|
1422
|
-
workspaceLabel:
|
|
1423
|
-
workspaceSectionTitle:
|
|
1424
|
-
appLeftLayoutMode:
|
|
1425
|
-
appLeftHeaderMode:
|
|
1426
|
-
appLeftProjects:
|
|
1427
|
-
appLeftActiveProjectId:
|
|
1428
|
-
onSwitchAppLeftProject:
|
|
1429
|
-
onOpenAppLeftProjectSession:
|
|
1413
|
+
fullPageBasePath: Mt,
|
|
1414
|
+
onAuthError: It,
|
|
1415
|
+
sessions: lt,
|
|
1416
|
+
activeSessionId: pe,
|
|
1417
|
+
onSwitchSession: ct,
|
|
1418
|
+
onCreateSession: ye,
|
|
1419
|
+
onDeleteSession: he,
|
|
1420
|
+
onActiveSessionIdChange: fe,
|
|
1421
|
+
appTitle: be = "Boring UI",
|
|
1422
|
+
workspaceLabel: dt,
|
|
1423
|
+
workspaceSectionTitle: Ft = "Workspaces",
|
|
1424
|
+
appLeftLayoutMode: $t = "single-project",
|
|
1425
|
+
appLeftHeaderMode: _e = "full",
|
|
1426
|
+
appLeftProjects: Ut,
|
|
1427
|
+
appLeftActiveProjectId: De,
|
|
1428
|
+
onSwitchAppLeftProject: Se,
|
|
1429
|
+
onOpenAppLeftProjectSession: zt,
|
|
1430
1430
|
onShowMoreAppLeftProjectSessions: Gt,
|
|
1431
|
-
onCreateAppLeftProject:
|
|
1432
|
-
onOpenAppLeftProjectSettings:
|
|
1433
|
-
onOpenAppLeftProjectInNewTab:
|
|
1431
|
+
onCreateAppLeftProject: Kt,
|
|
1432
|
+
onOpenAppLeftProjectSettings: Le,
|
|
1433
|
+
onOpenAppLeftProjectInNewTab: ut,
|
|
1434
1434
|
defaultSessionTitle: p = "New session",
|
|
1435
1435
|
workspaceLayout: M = "classic",
|
|
1436
|
-
navEnabled:
|
|
1437
|
-
defaultNavOpen:
|
|
1438
|
-
defaultSurfaceOpen:
|
|
1439
|
-
defaultWorkbenchLeftTab:
|
|
1440
|
-
defaultWorkbenchLeftOpen:
|
|
1441
|
-
surfaceInitialPanels:
|
|
1442
|
-
topBarLeft:
|
|
1443
|
-
topBarRight:
|
|
1444
|
-
showThemeToggle:
|
|
1445
|
-
showSkills:
|
|
1446
|
-
showPlugins:
|
|
1436
|
+
navEnabled: O = !0,
|
|
1437
|
+
defaultNavOpen: ge = !1,
|
|
1438
|
+
defaultSurfaceOpen: Ht,
|
|
1439
|
+
defaultWorkbenchLeftTab: ft,
|
|
1440
|
+
defaultWorkbenchLeftOpen: Bt,
|
|
1441
|
+
surfaceInitialPanels: xn,
|
|
1442
|
+
topBarLeft: yn,
|
|
1443
|
+
topBarRight: Sn,
|
|
1444
|
+
showThemeToggle: Nn = !0,
|
|
1445
|
+
showSkills: jr = !0,
|
|
1446
|
+
showPlugins: Qr = !0,
|
|
1447
1447
|
appLeftActions: wn,
|
|
1448
|
+
appLeftOverlayActions: q,
|
|
1448
1449
|
chatParams: $,
|
|
1449
|
-
externalPlugins:
|
|
1450
|
-
hotReloadEnabled:
|
|
1451
|
-
frontPluginHotReload:
|
|
1452
|
-
extraPanels:
|
|
1453
|
-
extraCommands:
|
|
1454
|
-
provisionWorkspace:
|
|
1455
|
-
bootPreloadPaths:
|
|
1456
|
-
onWorkspaceWarmupStatusChange:
|
|
1457
|
-
onOpenNav:
|
|
1458
|
-
onOpenSurface:
|
|
1459
|
-
surfaceButtonBottomOffset:
|
|
1460
|
-
className:
|
|
1450
|
+
externalPlugins: Zr,
|
|
1451
|
+
hotReloadEnabled: ei,
|
|
1452
|
+
frontPluginHotReload: ti,
|
|
1453
|
+
extraPanels: Pn,
|
|
1454
|
+
extraCommands: En,
|
|
1455
|
+
provisionWorkspace: Jt,
|
|
1456
|
+
bootPreloadPaths: ni,
|
|
1457
|
+
onWorkspaceWarmupStatusChange: gt,
|
|
1458
|
+
onOpenNav: qt,
|
|
1459
|
+
onOpenSurface: Ne,
|
|
1460
|
+
surfaceButtonBottomOffset: ri,
|
|
1461
|
+
className: ii
|
|
1461
1462
|
}) {
|
|
1462
|
-
var
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
), K = F !== !1,
|
|
1467
|
-
() =>
|
|
1463
|
+
var vr, xr;
|
|
1464
|
+
const kn = Zr !== !1, si = kn ? ti : !1, Vt = kn ? ei : !1, Yt = a ?? `boring-ui-v2:layout:${e}`, Q = c ?? `${Yt}:surface`, We = uo(
|
|
1465
|
+
Q,
|
|
1466
|
+
Yt
|
|
1467
|
+
), K = F !== !1, te = M === "plugin-tabs", qe = jr !== !1, Ve = Qr !== !1, oi = d, mt = o ?? `boring-workspace:sessions:${e}`, we = T(
|
|
1468
|
+
() => Wt(e, s ?? un),
|
|
1468
1469
|
[s, e]
|
|
1469
|
-
),
|
|
1470
|
-
() =>
|
|
1470
|
+
), ai = T(
|
|
1471
|
+
() => Wt(e, { ...s ?? un, ...h ?? un }),
|
|
1471
1472
|
[h, s, e]
|
|
1472
|
-
),
|
|
1473
|
-
() =>
|
|
1474
|
-
[
|
|
1475
|
-
),
|
|
1473
|
+
), pt = T(
|
|
1474
|
+
() => Vs({ storageKey: mt }),
|
|
1475
|
+
[mt]
|
|
1476
|
+
), An = Ys(pt), [Rn, li] = L(() => ({
|
|
1476
1477
|
workspaceId: e,
|
|
1477
1478
|
status: _r
|
|
1478
|
-
})), [
|
|
1479
|
+
})), [ht, Xt] = L(() => ({
|
|
1479
1480
|
workspaceId: e,
|
|
1480
1481
|
expired: !1
|
|
1481
|
-
})), [
|
|
1482
|
+
})), [Cn, bt] = L(() => ({
|
|
1482
1483
|
workspaceId: e,
|
|
1483
1484
|
creating: !1
|
|
1484
|
-
})), [
|
|
1485
|
+
})), [Tn, Oe] = L(() => ({
|
|
1485
1486
|
workspaceId: e,
|
|
1486
1487
|
failed: !1
|
|
1487
|
-
})),
|
|
1488
|
-
() => (K ?
|
|
1489
|
-
), [
|
|
1488
|
+
})), Ye = `boring-workspace:chat-panes:${e}`, [U, me] = L(
|
|
1489
|
+
() => (K ? Wr(Ye, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
|
|
1490
|
+
), [Me, _n] = L(null);
|
|
1490
1491
|
_(() => {
|
|
1491
|
-
if (!
|
|
1492
|
-
const
|
|
1493
|
-
return () => clearTimeout(
|
|
1494
|
-
}, [
|
|
1495
|
-
const
|
|
1496
|
-
() => (K ? Or(
|
|
1497
|
-
),
|
|
1492
|
+
if (!Me) return;
|
|
1493
|
+
const t = setTimeout(() => _n(null), 700);
|
|
1494
|
+
return () => clearTimeout(t);
|
|
1495
|
+
}, [Me]);
|
|
1496
|
+
const Xe = `boring-workspace:pinned-sessions:${e}`, [Dn, Ln] = L(
|
|
1497
|
+
() => (K ? Or(Xe, e) : null) ?? { workspaceId: e, ids: [] }
|
|
1498
|
+
), Wn = Dn.workspaceId === e ? Dn.ids : go;
|
|
1498
1499
|
_(() => {
|
|
1499
|
-
|
|
1500
|
-
}, [
|
|
1501
|
-
const On = A((
|
|
1502
|
-
|
|
1503
|
-
const u =
|
|
1504
|
-
return K &&
|
|
1500
|
+
Ln((t) => t.workspaceId === e ? t : (K ? Or(Xe, e) : null) ?? { workspaceId: e, ids: [] });
|
|
1501
|
+
}, [Xe, K, e]);
|
|
1502
|
+
const On = A((t) => {
|
|
1503
|
+
Ln((l) => {
|
|
1504
|
+
const u = l.workspaceId === e ? l.ids : [], w = u.includes(t) ? u.filter((N) => N !== t) : [t, ...u];
|
|
1505
|
+
return K && xo(Xe, w), { workspaceId: e, ids: w };
|
|
1505
1506
|
});
|
|
1506
|
-
}, [
|
|
1507
|
+
}, [Xe, K, e]);
|
|
1507
1508
|
_(() => {
|
|
1508
|
-
K && U.workspaceId === e &&
|
|
1509
|
-
}, [U,
|
|
1510
|
-
|
|
1511
|
-
}, [
|
|
1512
|
-
const
|
|
1513
|
-
},
|
|
1514
|
-
requestHeaders:
|
|
1515
|
-
storageKey:
|
|
1509
|
+
K && U.workspaceId === e && vo(Ye, U);
|
|
1510
|
+
}, [U, Ye, K, e]), _(() => {
|
|
1511
|
+
me((t) => t.workspaceId === e ? t : (K ? Wr(Ye, e) : null) ?? { workspaceId: e, ids: [], activeId: null });
|
|
1512
|
+
}, [Ye, K, e]);
|
|
1513
|
+
const vt = Rn.workspaceId === e ? Rn.status : _r, ci = n ?? ss, di = i ?? mo, Pe = !n || !!i, xt = Pe && Jt !== !1, jt = () => {
|
|
1514
|
+
}, z = di({
|
|
1515
|
+
requestHeaders: we,
|
|
1516
|
+
storageKey: mt,
|
|
1516
1517
|
workspaceId: e,
|
|
1517
1518
|
apiBaseUrl: x,
|
|
1518
|
-
enabled:
|
|
1519
|
-
}), [
|
|
1519
|
+
enabled: xt
|
|
1520
|
+
}), [je, ui] = L(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), Mn = xt && z.workspaceId != null && z.workspaceId !== e, le = xt && !z.loading && !z.error && !Mn, G = xt && !le;
|
|
1520
1521
|
_(() => {
|
|
1521
|
-
|
|
1522
|
-
const
|
|
1523
|
-
var
|
|
1524
|
-
return
|
|
1522
|
+
le && ui((t) => {
|
|
1523
|
+
const l = t.workspaceId === e, u = t.activeSessionId === z.activeSessionId, w = t.sessions.length === z.sessions.length && t.sessions.every((N, C) => {
|
|
1524
|
+
var ee;
|
|
1525
|
+
return N.id === ((ee = z.sessions[C]) == null ? void 0 : ee.id);
|
|
1525
1526
|
});
|
|
1526
|
-
return
|
|
1527
|
+
return l && u && w ? t : {
|
|
1527
1528
|
workspaceId: e,
|
|
1528
|
-
sessions:
|
|
1529
|
-
activeSessionId:
|
|
1529
|
+
sessions: z.sessions,
|
|
1530
|
+
activeSessionId: z.activeSessionId
|
|
1530
1531
|
};
|
|
1531
1532
|
});
|
|
1532
|
-
}, [
|
|
1533
|
-
const
|
|
1533
|
+
}, [z.activeSessionId, z.sessions, le, e]);
|
|
1534
|
+
const yt = G && je.workspaceId === e && je.sessions.length > 0, St = G ? bo(mt) : null, In = G && !Mn ? z.activeSessionId ?? null : null, ce = le ? z.sessions : yt ? je.sessions : [], fi = le ? z.activeSessionId : yt ? je.activeSessionId : null, S = Pe && (le || yt) ? z : void 0, Ee = lt !== void 0 || pe !== void 0 || ct !== void 0 || ye !== void 0 || he !== void 0, Fn = ht.workspaceId === e && ht.expired, Ie = H(!1), Qe = !!(le && S && !Ee && ce.length === 0 && !Fn), gi = Cn.workspaceId === e && Cn.creating, mi = Tn.workspaceId === e && Tn.failed, pi = !!(le && S && !Ee && ce.length === 0 && Fn && !Ie.current && !mi), Ze = !!(G && z.loading && !z.error && Pe && !Ee && !yt && !St && !In) || Qe || gi || pi;
|
|
1534
1535
|
_(() => {
|
|
1535
|
-
if (!
|
|
1536
|
-
|
|
1536
|
+
if (!Qe) {
|
|
1537
|
+
ht.workspaceId !== e && Xt({ workspaceId: e, expired: !1 });
|
|
1537
1538
|
return;
|
|
1538
1539
|
}
|
|
1539
|
-
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1540
|
+
Xt({ workspaceId: e, expired: !1 });
|
|
1541
|
+
const t = globalThis.setTimeout(() => {
|
|
1542
|
+
Xt({ workspaceId: e, expired: !0 });
|
|
1542
1543
|
}, 2e3);
|
|
1543
|
-
return () => globalThis.clearTimeout(
|
|
1544
|
-
}, [
|
|
1545
|
-
const
|
|
1546
|
-
...
|
|
1547
|
-
title:
|
|
1548
|
-
})) : void 0,
|
|
1549
|
-
id:
|
|
1544
|
+
return () => globalThis.clearTimeout(t);
|
|
1545
|
+
}, [ht.workspaceId, Qe, e]);
|
|
1546
|
+
const hi = S ? ce.map((t) => ({
|
|
1547
|
+
...t,
|
|
1548
|
+
title: t.title ?? "New session"
|
|
1549
|
+
})) : void 0, bi = St ? [{
|
|
1550
|
+
id: St,
|
|
1550
1551
|
title: "Loading sessions…",
|
|
1551
1552
|
createdAt: (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
1552
1553
|
updatedAt: (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
1553
1554
|
turnCount: 0
|
|
1554
|
-
}] : [],
|
|
1555
|
+
}] : [], Y = S ? hi ?? [] : G ? bi : Ee ? lt ?? [] : An.sessions, vi = S ? fi ?? null : G ? St ?? In : Ee ? pe ?? null : An.activeId, Fe = ($ == null ? void 0 : $.autoSubmitInitialDraft) === !0, Nt = Fe && Pe && !Ee, [ie, et] = L(() => Nt ? null : void 0), $n = H(e), $e = H(!1);
|
|
1555
1556
|
_(() => {
|
|
1556
|
-
if (
|
|
1557
|
-
|
|
1557
|
+
if ($n.current !== e) {
|
|
1558
|
+
$n.current = e, $e.current = !1, et(Nt ? null : void 0);
|
|
1558
1559
|
return;
|
|
1559
1560
|
}
|
|
1560
|
-
|
|
1561
|
-
}, [
|
|
1562
|
-
!S ||
|
|
1563
|
-
if (typeof (
|
|
1561
|
+
Nt && ie === void 0 && ($e.current = !1, et(null));
|
|
1562
|
+
}, [ie, Nt, e]), _(() => {
|
|
1563
|
+
!S || ie !== null || $e.current || ($e.current = !0, Promise.resolve(S.create({ title: p })).then((t) => {
|
|
1564
|
+
if (typeof (t == null ? void 0 : t.id) != "string")
|
|
1564
1565
|
throw new Error("auto_submit_session_create_failed");
|
|
1565
|
-
|
|
1566
|
+
et(t.id);
|
|
1566
1567
|
}).catch(() => {
|
|
1567
|
-
|
|
1568
|
+
$e.current = !1, et(void 0);
|
|
1568
1569
|
}));
|
|
1569
|
-
}, [
|
|
1570
|
-
const
|
|
1571
|
-
if (S &&
|
|
1572
|
-
return
|
|
1573
|
-
if (S && !
|
|
1570
|
+
}, [ie, p, S]);
|
|
1571
|
+
const Z = ie !== void 0 ? ie ?? null : vi, ne = G ? jt : (S == null ? void 0 : S.switch) ?? ct ?? pt.switchTo, wt = A((t) => (Z && t !== Z && ps({ sessionId: Z, reason: hs.sessionSwitch }), ne(t)), [Z, ne]), tt = G ? jt : S ? () => S.create() : ye ? () => ye() : () => pt.create(), Ue = G ? jt : (S == null ? void 0 : S.delete) ?? he ?? pt.remove, Un = A((t) => {
|
|
1572
|
+
if (S && G && ce.length <= 1)
|
|
1573
|
+
return Ie.current = !0, Ue(t);
|
|
1574
|
+
if (S && !G && ce.length <= 1) {
|
|
1574
1575
|
if (S.hasMore)
|
|
1575
|
-
return
|
|
1576
|
-
if (
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1576
|
+
return Ie.current = !0, Ue(t);
|
|
1577
|
+
if (Pt.current.has(t)) return Promise.resolve();
|
|
1578
|
+
Pt.current.add(t), Ae.current = !0, Oe({ workspaceId: e, failed: !1 });
|
|
1579
|
+
const l = S.create({ title: p });
|
|
1579
1580
|
return Promise.resolve(
|
|
1580
|
-
|
|
1581
|
+
l && typeof l.then == "function" ? Promise.resolve(l).then(() => Ue(t)) : Ue(t)
|
|
1581
1582
|
).catch((u) => {
|
|
1582
|
-
throw
|
|
1583
|
+
throw Ae.current = !1, Oe({ workspaceId: e, failed: !0 }), u;
|
|
1583
1584
|
}).finally(() => {
|
|
1584
|
-
|
|
1585
|
+
Pt.current.delete(t);
|
|
1585
1586
|
});
|
|
1586
1587
|
}
|
|
1587
|
-
return
|
|
1588
|
-
}, [
|
|
1589
|
-
`${
|
|
1590
|
-
|
|
1588
|
+
return Ue(t);
|
|
1589
|
+
}, [ce.length, p, Ue, G, S, e]), zn = ((vr = Y.find((t) => t.id === Z)) == null ? void 0 : vr.title) ?? void 0, [xi, Gn] = Dt(
|
|
1590
|
+
`${We}:drawer`,
|
|
1591
|
+
ge,
|
|
1591
1592
|
K
|
|
1592
|
-
), [
|
|
1593
|
-
`${
|
|
1593
|
+
), [ze, Kn] = Dt(
|
|
1594
|
+
`${We}:appLeftPaneCollapsed`,
|
|
1594
1595
|
!1,
|
|
1595
1596
|
K
|
|
1596
|
-
), [
|
|
1597
|
-
`${
|
|
1597
|
+
), [yi, Si] = fo(
|
|
1598
|
+
`${We}:appLeftPaneWidth`,
|
|
1598
1599
|
268,
|
|
1599
1600
|
K
|
|
1600
|
-
),
|
|
1601
|
+
), Hn = Dr(yi, 220, 420), [X, j] = L(null);
|
|
1601
1602
|
_(() => {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1603
|
+
const t = !!(X && (q != null && q.some((l) => l.id === X)));
|
|
1604
|
+
(X === "skills" && !qe || X === "plugins" && !Ve || X && X !== "skills" && X !== "plugins" && !t) && j(null);
|
|
1605
|
+
}, [q, X, Ve, qe]);
|
|
1606
|
+
const Bn = O && xi, [se, oe] = Dt(
|
|
1605
1607
|
// Key must NOT match resolvedSurfaceStorageKey (which stores the dockview
|
|
1606
1608
|
// layout JSON at the same ":surface" suffix). Writing "1"/"0" to the same
|
|
1607
1609
|
// key corrupts the JSON and drops the persisted workbench layout on reload.
|
|
1608
|
-
`${
|
|
1609
|
-
Kt ?? !1,
|
|
1610
|
-
K
|
|
1611
|
-
), [Si, jt] = L(!1), [wi, Pe] = Tt(
|
|
1612
|
-
`${De}:workbenchLeftOpen`,
|
|
1610
|
+
`${We}:workbenchOpen`,
|
|
1613
1611
|
Ht ?? !1,
|
|
1614
1612
|
K
|
|
1615
|
-
), [Ni,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1613
|
+
), [Ni, Qt] = L(!1), [wi, ke] = Dt(
|
|
1614
|
+
`${We}:workbenchLeftOpen`,
|
|
1615
|
+
Bt ?? !1,
|
|
1616
|
+
K
|
|
1617
|
+
), [Pi, nt] = L(() => Bt ?? !1), Ei = Bt === !1 ? Pi : wi, ki = A(() => {
|
|
1618
|
+
ke(!1), nt(!1), j(null);
|
|
1619
|
+
}, [ke]), Ae = H(!1), Pt = H(/* @__PURE__ */ new Set()), Re = H(null), ve = H(se), Jn = H(Q), Zt = H(null), en = H([]);
|
|
1620
|
+
Jn.current = Q;
|
|
1621
|
+
const [qn, Vn] = L(() => ({
|
|
1622
|
+
key: Q,
|
|
1623
|
+
snapshot: Lr
|
|
1624
|
+
})), Ai = qn.key === Q ? qn.snapshot : Lr;
|
|
1623
1625
|
_(() => {
|
|
1624
|
-
|
|
1626
|
+
Ae.current = !1, Pt.current.clear(), Ie.current = !1, bt({ workspaceId: e, creating: !1 }), Oe({ workspaceId: e, failed: !1 });
|
|
1625
1627
|
}, [e]), _(() => {
|
|
1626
|
-
|
|
1627
|
-
}, [
|
|
1628
|
-
if (!(!S || S.loading) && !
|
|
1629
|
-
if (
|
|
1630
|
-
|
|
1628
|
+
Qt(!1), en.current = [];
|
|
1629
|
+
}, [Q]), _(() => {
|
|
1630
|
+
if (!(!S || S.loading) && !Qe && ie === void 0) {
|
|
1631
|
+
if (ce.length > 0) {
|
|
1632
|
+
Ae.current = !1, Ie.current = !1, bt((t) => t.workspaceId === e && t.creating ? { workspaceId: e, creating: !1 } : t), Oe((t) => t.workspaceId === e && t.failed ? { workspaceId: e, failed: !1 } : t);
|
|
1631
1633
|
return;
|
|
1632
1634
|
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
+
Ie.current || Ae.current || (Ae.current = !0, bt({ workspaceId: e, creating: !0 }), Oe({ workspaceId: e, failed: !1 }), Promise.resolve(S.create({ title: p })).catch(() => {
|
|
1636
|
+
Ae.current = !1, bt({ workspaceId: e, creating: !1 }), Oe({ workspaceId: e, failed: !0 });
|
|
1635
1637
|
}));
|
|
1636
1638
|
}
|
|
1637
|
-
}, [
|
|
1638
|
-
|
|
1639
|
-
}, [
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
key:
|
|
1643
|
-
snapshot:
|
|
1639
|
+
}, [ce.length, ie, p, Qe, S, e]), _(() => {
|
|
1640
|
+
ve.current = se;
|
|
1641
|
+
}, [se]);
|
|
1642
|
+
const Yn = A((t) => {
|
|
1643
|
+
Zt.current = { key: Q, api: t }, Qt(!0), Vn({
|
|
1644
|
+
key: Q,
|
|
1645
|
+
snapshot: t.getSnapshot()
|
|
1644
1646
|
});
|
|
1645
|
-
const
|
|
1646
|
-
for (const u of
|
|
1647
|
-
}, [
|
|
1648
|
-
|
|
1649
|
-
}, []),
|
|
1650
|
-
|
|
1651
|
-
key:
|
|
1652
|
-
snapshot:
|
|
1647
|
+
const l = en.current.splice(0);
|
|
1648
|
+
for (const u of l) u(t);
|
|
1649
|
+
}, [Q]), Et = A((t) => {
|
|
1650
|
+
en.current.push(t);
|
|
1651
|
+
}, []), Xn = A((t) => {
|
|
1652
|
+
Vn({
|
|
1653
|
+
key: Q,
|
|
1654
|
+
snapshot: t
|
|
1653
1655
|
});
|
|
1654
|
-
}, [
|
|
1655
|
-
const
|
|
1656
|
-
return (
|
|
1657
|
-
}, []),
|
|
1658
|
-
|
|
1659
|
-
}, [
|
|
1660
|
-
|
|
1661
|
-
}, [
|
|
1662
|
-
|
|
1663
|
-
}, [
|
|
1664
|
-
const
|
|
1665
|
-
if (!
|
|
1666
|
-
const u = typeof
|
|
1667
|
-
return u ?
|
|
1668
|
-
}, []),
|
|
1669
|
-
surface:
|
|
1670
|
-
isWorkbenchOpen:
|
|
1671
|
-
openWorkbench:
|
|
1672
|
-
openWorkbenchSources:
|
|
1673
|
-
closeWorkbench:
|
|
1674
|
-
enqueue:
|
|
1675
|
-
shouldOpenSurface:
|
|
1676
|
-
}), [
|
|
1677
|
-
A((
|
|
1678
|
-
if (
|
|
1679
|
-
const
|
|
1680
|
-
u ?
|
|
1681
|
-
}, [
|
|
1682
|
-
const
|
|
1683
|
-
openFile: async (
|
|
1656
|
+
}, [Q]), Ge = A(() => {
|
|
1657
|
+
const t = Zt.current;
|
|
1658
|
+
return (t == null ? void 0 : t.key) === Jn.current ? t.api : null;
|
|
1659
|
+
}, []), jn = A(() => ve.current, []), Qn = A(() => {
|
|
1660
|
+
ve.current = !0, oe(!0);
|
|
1661
|
+
}, [oe]), Zn = A(() => {
|
|
1662
|
+
ve.current = !0, oe(!0), ke(!0), nt(!0);
|
|
1663
|
+
}, [oe, ke]), kt = A(() => {
|
|
1664
|
+
ve.current = !1, Zt.current = null, Qt(!1), oe(!1);
|
|
1665
|
+
}, [oe]), er = H(/* @__PURE__ */ new Set()), tr = A((t) => {
|
|
1666
|
+
const l = t.meta;
|
|
1667
|
+
if (!l || l.openOnlyWhenSessionOpen !== !0) return !0;
|
|
1668
|
+
const u = typeof l.sessionId == "string" ? l.sessionId : null;
|
|
1669
|
+
return u ? er.current.has(u) : !1;
|
|
1670
|
+
}, []), Ke = T(() => ({
|
|
1671
|
+
surface: Ge,
|
|
1672
|
+
isWorkbenchOpen: jn,
|
|
1673
|
+
openWorkbench: Qn,
|
|
1674
|
+
openWorkbenchSources: Zn,
|
|
1675
|
+
closeWorkbench: kt,
|
|
1676
|
+
enqueue: Et,
|
|
1677
|
+
shouldOpenSurface: tr
|
|
1678
|
+
}), [Ge, jn, Qn, Zn, kt, Et, tr]);
|
|
1679
|
+
A((t) => {
|
|
1680
|
+
if (ve.current = !0, oe(!0), Ne == null || Ne(), !t) return;
|
|
1681
|
+
const l = (w) => w.openPanel(t), u = Ge();
|
|
1682
|
+
u ? l(u) : Et(l);
|
|
1683
|
+
}, [Et, Ge, Ne, oe]);
|
|
1684
|
+
const Ri = T(() => ({
|
|
1685
|
+
openFile: async (t, l) => (Pr({ kind: "openFile", params: { path: t, ...l != null && l.filesystem ? { filesystem: l.filesystem } : {} } }, Ke), { seq: 0, status: "ok" }),
|
|
1684
1686
|
getActiveFile: () => {
|
|
1685
|
-
var
|
|
1686
|
-
return ((
|
|
1687
|
+
var t;
|
|
1688
|
+
return ((t = Ge()) == null ? void 0 : t.getSnapshot().activeTab) ?? null;
|
|
1687
1689
|
},
|
|
1688
1690
|
select: () => () => {
|
|
1689
1691
|
}
|
|
1690
|
-
}), [
|
|
1691
|
-
() => (R == null ? void 0 : R.map(
|
|
1692
|
+
}), [Ge, Ke]), He = T(
|
|
1693
|
+
() => (R == null ? void 0 : R.map(bs)) ?? [],
|
|
1692
1694
|
[R]
|
|
1693
|
-
),
|
|
1694
|
-
() => !
|
|
1695
|
-
[
|
|
1696
|
-
),
|
|
1697
|
-
() =>
|
|
1698
|
-
[
|
|
1699
|
-
),
|
|
1700
|
-
const
|
|
1701
|
-
for (const
|
|
1702
|
-
for (const u of
|
|
1703
|
-
|
|
1704
|
-
return
|
|
1705
|
-
}, [
|
|
1706
|
-
() => [...
|
|
1707
|
-
[
|
|
1708
|
-
), P =
|
|
1695
|
+
), tn = T(
|
|
1696
|
+
() => !te && He.some((t) => t.registrations.workspaceSources.length > 0),
|
|
1697
|
+
[He, te]
|
|
1698
|
+
), nr = T(
|
|
1699
|
+
() => He.flatMap((t) => t.registrations.panels.map((l) => l.id)),
|
|
1700
|
+
[He]
|
|
1701
|
+
), rr = T(() => {
|
|
1702
|
+
const t = {};
|
|
1703
|
+
for (const l of He)
|
|
1704
|
+
for (const u of l.registrations.toolRenderers)
|
|
1705
|
+
t[u.id] = u.render;
|
|
1706
|
+
return t;
|
|
1707
|
+
}, [He]), ir = T(
|
|
1708
|
+
() => [...Pn ?? [], ...nr],
|
|
1709
|
+
[Pn, nr]
|
|
1710
|
+
), P = Pe && !i && je.workspaceId !== e ? "default" : Z ?? (ie !== void 0 ? "default" : ((xr = Y[0]) == null ? void 0 : xr.id) ?? "default"), sr = !(S != null && S.hasMore) && !G;
|
|
1709
1711
|
_(() => {
|
|
1710
|
-
var
|
|
1711
|
-
if (
|
|
1712
|
-
const
|
|
1713
|
-
u &&
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1718
|
-
const
|
|
1719
|
-
return
|
|
1712
|
+
var ee, st;
|
|
1713
|
+
if (Ze) return;
|
|
1714
|
+
const t = Re.current, l = new Set(Y.map((ae) => ae.id)), u = t ? t.createdId ?? (l.has(P) && !t.knownIds.has(P) ? P : ((ee = Y.find((ae) => !t.knownIds.has(ae.id))) == null ? void 0 : ee.id) ?? null) : null;
|
|
1715
|
+
u && l.has(u) && (Re.current = null);
|
|
1716
|
+
const w = P === "default" && ie !== void 0, N = sr && l.size > 0 && !w, C = u ?? (N && !l.has(P) ? ((st = Y[0]) == null ? void 0 : st.id) ?? P : P);
|
|
1717
|
+
me((ae) => {
|
|
1718
|
+
const Ce = ae.workspaceId === e ? ae : { workspaceId: e, ids: [], activeId: null };
|
|
1719
|
+
if (G && Ce.ids.length > 0 && !u) return Ce;
|
|
1720
|
+
const yr = Ce.ids.length > 0 ? Ce.ids : [C], Sr = N ? yr.filter((Ct) => l.has(Ct) || Ct === u) : yr, Je = Sr.length > 0 ? Sr : [C], Nr = Ce.activeId && Je.includes(Ce.activeId) ? Ce.activeId : Je[0] ?? C, ot = u ? _t(Je, t == null ? void 0 : t.afterId, u) : C === Nr || Je.includes(C) ? Je : dn(Je, Nr, C), wr = ot.includes(C) ? C : ot[0] ?? C;
|
|
1721
|
+
return ae.workspaceId === e && ae.activeId === wr && ae.ids.length === ot.length && ae.ids.every((Ct, Hi) => Ct === ot[Hi]) ? ae : { workspaceId: e, ids: ot, activeId: wr };
|
|
1720
1722
|
});
|
|
1721
|
-
}, [
|
|
1722
|
-
const
|
|
1723
|
-
const
|
|
1724
|
-
for (const
|
|
1725
|
-
return
|
|
1726
|
-
}, [
|
|
1723
|
+
}, [ie, P, G, Ze, Y, sr, e]);
|
|
1724
|
+
const or = T(() => {
|
|
1725
|
+
const t = /* @__PURE__ */ new Map();
|
|
1726
|
+
for (const l of Y) t.set(l.id, l.title);
|
|
1727
|
+
return t;
|
|
1728
|
+
}, [Y]), [nn, ar] = L(() => ({
|
|
1727
1729
|
workspaceId: e,
|
|
1728
1730
|
ids: /* @__PURE__ */ new Set()
|
|
1729
|
-
})),
|
|
1730
|
-
const
|
|
1731
|
-
if (!
|
|
1732
|
-
const
|
|
1733
|
-
for (const u of
|
|
1734
|
-
u.turnCount === 0 && !
|
|
1735
|
-
return
|
|
1736
|
-
}, [
|
|
1731
|
+
})), lr = T(() => {
|
|
1732
|
+
const t = /* @__PURE__ */ new Set();
|
|
1733
|
+
if (!le) return t;
|
|
1734
|
+
const l = nn.workspaceId === e ? nn.ids : /* @__PURE__ */ new Set();
|
|
1735
|
+
for (const u of ce)
|
|
1736
|
+
u.turnCount === 0 && !l.has(u.id) && t.add(u.id);
|
|
1737
|
+
return t;
|
|
1738
|
+
}, [ce, nn, le, e]);
|
|
1737
1739
|
_(() => {
|
|
1738
|
-
|
|
1740
|
+
ar((t) => t.workspaceId === e ? t : { workspaceId: e, ids: /* @__PURE__ */ new Set() });
|
|
1739
1741
|
}, [e]);
|
|
1740
|
-
const
|
|
1742
|
+
const rn = U.workspaceId === e ? U : { ids: [], activeId: null }, re = rn.ids.length > 0 ? rn.ids : [P];
|
|
1741
1743
|
_(() => {
|
|
1742
|
-
|
|
1743
|
-
}, [
|
|
1744
|
-
const
|
|
1745
|
-
|
|
1746
|
-
const u = (U.workspaceId === e ? U : { ids: [P] }).ids.includes(
|
|
1747
|
-
return
|
|
1748
|
-
const
|
|
1749
|
-
return { workspaceId: e, ids: C, activeId:
|
|
1750
|
-
}), u ?
|
|
1751
|
-
}, [U, P,
|
|
1752
|
-
const u =
|
|
1744
|
+
er.current = new Set(re);
|
|
1745
|
+
}, [re]);
|
|
1746
|
+
const de = rn.activeId ?? re[0] ?? P, At = A((t) => {
|
|
1747
|
+
j(null);
|
|
1748
|
+
const u = (U.workspaceId === e ? U : { ids: [P] }).ids.includes(t);
|
|
1749
|
+
return me((w) => {
|
|
1750
|
+
const N = w.workspaceId === e ? w : { ids: [P], activeId: P }, C = N.ids.includes(t) ? N.ids : dn(N.ids, N.activeId, t);
|
|
1751
|
+
return { workspaceId: e, ids: C, activeId: t };
|
|
1752
|
+
}), u ? ne(t) : wt(t);
|
|
1753
|
+
}, [U, P, ne, wt, e]), Ci = A((t) => (me((l) => {
|
|
1754
|
+
const u = l.workspaceId === e ? l : { ids: [P], activeId: P };
|
|
1753
1755
|
return {
|
|
1754
1756
|
workspaceId: e,
|
|
1755
|
-
ids: u.ids.includes(
|
|
1756
|
-
activeId:
|
|
1757
|
+
ids: u.ids.includes(t) ? u.ids : _t(u.ids, u.activeId, t),
|
|
1758
|
+
activeId: t
|
|
1757
1759
|
};
|
|
1758
|
-
}),
|
|
1759
|
-
const
|
|
1760
|
+
}), ne(t)), [P, ne, e]), rt = A((t) => (j(null), (U.workspaceId === e ? U : { ids: [P] }).ids.includes(t) && _n({ workspaceId: e, id: t }), me((u) => {
|
|
1761
|
+
const w = u.workspaceId === e ? u : { ids: [P], activeId: P };
|
|
1760
1762
|
return {
|
|
1761
1763
|
workspaceId: e,
|
|
1762
|
-
ids: _t(
|
|
1763
|
-
activeId:
|
|
1764
|
+
ids: _t(w.ids, w.activeId, t),
|
|
1765
|
+
activeId: t
|
|
1764
1766
|
};
|
|
1765
|
-
}),
|
|
1766
|
-
const
|
|
1767
|
-
if (
|
|
1768
|
-
const u =
|
|
1767
|
+
}), ne(t)), [U, P, ne, e]), Ti = A((t) => {
|
|
1768
|
+
const l = U.workspaceId === e ? U : { ids: [P], activeId: P };
|
|
1769
|
+
if (l.ids.length <= 1) return;
|
|
1770
|
+
const u = l.ids.indexOf(t);
|
|
1769
1771
|
if (u < 0) return;
|
|
1770
|
-
const
|
|
1771
|
-
|
|
1772
|
-
}, [U, P,
|
|
1773
|
-
const
|
|
1774
|
-
return Promise.resolve(
|
|
1775
|
-
const u =
|
|
1776
|
-
u && (
|
|
1777
|
-
const
|
|
1772
|
+
const w = l.ids.filter((C) => C !== t), N = l.activeId === t ? w[Math.max(0, u - 1)] ?? w[0] ?? null : l.activeId;
|
|
1773
|
+
me({ workspaceId: e, ids: w, activeId: N }), N && l.activeId === t && ne(N);
|
|
1774
|
+
}, [U, P, ne, e]), cr = A(() => {
|
|
1775
|
+
const t = tt();
|
|
1776
|
+
return Promise.resolve(t).then((l) => {
|
|
1777
|
+
const u = Tr(l);
|
|
1778
|
+
u && (me((w) => {
|
|
1779
|
+
const N = w.workspaceId === e ? w : { ids: [P], activeId: P }, C = N.ids.length > 0 ? N.ids : [P], ee = N.activeId ?? C[0] ?? P;
|
|
1778
1780
|
return {
|
|
1779
1781
|
workspaceId: e,
|
|
1780
|
-
ids:
|
|
1782
|
+
ids: dn(C, ee, u),
|
|
1781
1783
|
activeId: u
|
|
1782
1784
|
};
|
|
1783
|
-
}),
|
|
1785
|
+
}), ne(u));
|
|
1784
1786
|
}).catch(() => {
|
|
1785
|
-
}),
|
|
1786
|
-
}, [P,
|
|
1787
|
-
const
|
|
1788
|
-
afterId:
|
|
1789
|
-
knownIds: new Set(
|
|
1787
|
+
}), t;
|
|
1788
|
+
}, [P, ne, tt, e]), sn = A((t) => {
|
|
1789
|
+
const l = {
|
|
1790
|
+
afterId: t,
|
|
1791
|
+
knownIds: new Set(Y.map((w) => w.id))
|
|
1790
1792
|
};
|
|
1791
|
-
|
|
1792
|
-
const u =
|
|
1793
|
-
return Promise.resolve(u).then((
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
const
|
|
1793
|
+
Re.current = l;
|
|
1794
|
+
const u = tt();
|
|
1795
|
+
return Promise.resolve(u).then((w) => {
|
|
1796
|
+
const N = Tr(w);
|
|
1797
|
+
N && (Re.current === l && (Re.current = { ...l, createdId: N }), me((C) => {
|
|
1798
|
+
const ee = C.workspaceId === e ? C : { ids: [P] };
|
|
1797
1799
|
return {
|
|
1798
1800
|
workspaceId: e,
|
|
1799
|
-
ids: _t(
|
|
1800
|
-
activeId:
|
|
1801
|
+
ids: _t(ee.ids, t, N),
|
|
1802
|
+
activeId: N
|
|
1801
1803
|
};
|
|
1802
1804
|
}));
|
|
1803
1805
|
}).catch(() => {
|
|
1804
|
-
|
|
1806
|
+
Re.current === l && (Re.current = null);
|
|
1805
1807
|
}), u;
|
|
1806
|
-
}, [P,
|
|
1807
|
-
const
|
|
1808
|
-
let
|
|
1808
|
+
}, [P, tt, Y, e]), dr = A((t) => {
|
|
1809
|
+
const l = U.workspaceId === e ? U : { ids: [P], activeId: P }, u = l.ids.indexOf(t);
|
|
1810
|
+
let w = l.activeId;
|
|
1809
1811
|
if (u >= 0) {
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
+
const N = l.ids.filter((C) => C !== t);
|
|
1813
|
+
w = l.activeId === t ? N[Math.max(0, u - 1)] ?? N[0] ?? null : l.activeId, me({ workspaceId: e, ids: N, activeId: w }), w && l.activeId === t && wt(w);
|
|
1812
1814
|
}
|
|
1813
|
-
return
|
|
1814
|
-
}, [U, P,
|
|
1815
|
+
return Un(t);
|
|
1816
|
+
}, [U, P, Un, wt, e]), ur = A(() => re.length >= 2 ? sn(de) : cr(), [de, re.length, sn, cr]), [_i, on] = L(Fe), fr = H(e);
|
|
1815
1817
|
_(() => {
|
|
1816
|
-
if (
|
|
1817
|
-
|
|
1818
|
+
if (fr.current !== e) {
|
|
1819
|
+
fr.current = e, on(Fe);
|
|
1818
1820
|
return;
|
|
1819
1821
|
}
|
|
1820
|
-
|
|
1821
|
-
}, [
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
}, [
|
|
1822
|
+
Fe && on(!0);
|
|
1823
|
+
}, [Fe, e]);
|
|
1824
|
+
const gr = Fe && Pe && !Z, mr = !_i && Jt !== !1 && (Pe ? !!Z : !0), Di = A((t) => {
|
|
1825
|
+
li({ workspaceId: e, status: t }), gt == null || gt(t);
|
|
1826
|
+
}, [gt, e]);
|
|
1825
1827
|
_(() => {
|
|
1826
|
-
var
|
|
1827
|
-
const
|
|
1828
|
-
const
|
|
1829
|
-
!
|
|
1828
|
+
var l;
|
|
1829
|
+
const t = (u) => {
|
|
1830
|
+
const w = u.detail;
|
|
1831
|
+
!w || typeof w != "object" || Pr(w, Ke);
|
|
1830
1832
|
};
|
|
1831
|
-
return (
|
|
1833
|
+
return (l = globalThis.addEventListener) == null || l.call(globalThis, Er, t), () => {
|
|
1832
1834
|
var u;
|
|
1833
|
-
return (u = globalThis.removeEventListener) == null ? void 0 : u.call(globalThis,
|
|
1835
|
+
return (u = globalThis.removeEventListener) == null ? void 0 : u.call(globalThis, Er, t);
|
|
1834
1836
|
};
|
|
1835
|
-
}, [
|
|
1836
|
-
|
|
1837
|
-
}, [
|
|
1838
|
-
const
|
|
1839
|
-
const
|
|
1837
|
+
}, [Ke]), _(() => {
|
|
1838
|
+
G || fe == null || fe(Z ?? null);
|
|
1839
|
+
}, [Z, fe, G]);
|
|
1840
|
+
const an = vt.status !== "ready", Li = an ? /* @__PURE__ */ r(ro, { status: vt }) : void 0, it = A(async (t) => {
|
|
1841
|
+
const l = `${(x == null ? void 0 : x.replace(/\/$/, "")) ?? ""}/api/v1/agent/reload`;
|
|
1840
1842
|
try {
|
|
1841
|
-
const u = await fetch(
|
|
1843
|
+
const u = await fetch(l, {
|
|
1842
1844
|
method: "POST",
|
|
1843
|
-
headers: { ...
|
|
1844
|
-
body: JSON.stringify({ sessionId:
|
|
1845
|
+
headers: { ...we, "content-type": "application/json" },
|
|
1846
|
+
body: JSON.stringify({ sessionId: t })
|
|
1845
1847
|
});
|
|
1846
1848
|
if (!u.ok)
|
|
1847
1849
|
return (await u.json().catch(() => ({}))).error || `reload failed (${u.status})`;
|
|
1848
|
-
const
|
|
1849
|
-
return window.dispatchEvent(new CustomEvent(
|
|
1850
|
+
const w = await u.json().catch(() => ({}));
|
|
1851
|
+
return window.dispatchEvent(new CustomEvent(pn, { detail: w })), ho(w);
|
|
1850
1852
|
} catch (u) {
|
|
1851
1853
|
return u instanceof Error ? u.message : "Agent plugin reload failed.";
|
|
1852
1854
|
}
|
|
1853
|
-
}, [x,
|
|
1854
|
-
(
|
|
1855
|
-
const u =
|
|
1855
|
+
}, [x, we]), Be = A(
|
|
1856
|
+
(t, l = {}) => {
|
|
1857
|
+
const u = l.bridgeEnabled ?? !0, w = $ != null && $.toolRenderers && typeof $.toolRenderers == "object" ? $.toolRenderers : void 0;
|
|
1856
1858
|
return {
|
|
1857
1859
|
...$,
|
|
1858
|
-
...
|
|
1859
|
-
sessionId:
|
|
1860
|
+
...gr ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
|
|
1861
|
+
sessionId: t,
|
|
1860
1862
|
apiBaseUrl: x,
|
|
1861
1863
|
workspaceId: e,
|
|
1862
1864
|
storageScope: e,
|
|
1863
|
-
requestHeaders:
|
|
1865
|
+
requestHeaders: we,
|
|
1864
1866
|
showSessions: !1,
|
|
1865
|
-
onReloadAgentPlugins: ($ == null ? void 0 : $.onReloadAgentPlugins) ?? (() =>
|
|
1866
|
-
toolRenderers: { ...
|
|
1867
|
+
onReloadAgentPlugins: ($ == null ? void 0 : $.onReloadAgentPlugins) ?? (() => it(t)),
|
|
1868
|
+
toolRenderers: { ...rr, ...w ?? {} },
|
|
1867
1869
|
bridgeEndpoint: u ? J : null,
|
|
1868
|
-
surfaceDispatch:
|
|
1869
|
-
extraCommands:
|
|
1870
|
-
workspaceWarmupStatus:
|
|
1871
|
-
hydrateMessages:
|
|
1872
|
-
allowPromptDuringInitialHydration:
|
|
1873
|
-
onPromptSubmitStarted: ({ sessionId:
|
|
1874
|
-
|
|
1875
|
-
const
|
|
1876
|
-
if (
|
|
1877
|
-
const
|
|
1878
|
-
return
|
|
1870
|
+
surfaceDispatch: Ke,
|
|
1871
|
+
extraCommands: En,
|
|
1872
|
+
workspaceWarmupStatus: vt,
|
|
1873
|
+
hydrateMessages: mr,
|
|
1874
|
+
allowPromptDuringInitialHydration: lr.has(t),
|
|
1875
|
+
onPromptSubmitStarted: ({ sessionId: N }) => {
|
|
1876
|
+
ar((C) => {
|
|
1877
|
+
const ee = C.workspaceId === e ? C.ids : /* @__PURE__ */ new Set();
|
|
1878
|
+
if (ee.has(N)) return C.workspaceId === e ? C : { workspaceId: e, ids: ee };
|
|
1879
|
+
const st = new Set(ee);
|
|
1880
|
+
return st.add(N), { workspaceId: e, ids: st };
|
|
1879
1881
|
});
|
|
1880
1882
|
},
|
|
1881
1883
|
onTurnComplete: () => {
|
|
1882
1884
|
var C;
|
|
1883
1885
|
(C = S == null ? void 0 : S.refresh) == null || C.call(S, { background: !0 });
|
|
1884
|
-
const
|
|
1885
|
-
typeof
|
|
1886
|
+
const N = $ == null ? void 0 : $.onTurnComplete;
|
|
1887
|
+
typeof N == "function" && N();
|
|
1886
1888
|
},
|
|
1887
1889
|
onAutoSubmitInitialDraftSettled: () => {
|
|
1888
|
-
|
|
1889
|
-
const
|
|
1890
|
-
typeof
|
|
1890
|
+
$e.current = !1, on(!1), et(void 0);
|
|
1891
|
+
const N = $ == null ? void 0 : $.onAutoSubmitInitialDraftSettled;
|
|
1892
|
+
typeof N == "function" && N();
|
|
1891
1893
|
},
|
|
1892
1894
|
// Forward the explicit prop when set. Omitting the key (when undefined)
|
|
1893
1895
|
// lets ChatPanel apply its own default (true) and avoids overriding a
|
|
1894
1896
|
// value passed through chatParams.
|
|
1895
|
-
...
|
|
1897
|
+
...Vt !== void 0 ? { hotReloadEnabled: Vt } : {}
|
|
1896
1898
|
};
|
|
1897
1899
|
},
|
|
1898
|
-
[x, $,
|
|
1899
|
-
),
|
|
1900
|
-
() =>
|
|
1901
|
-
[P,
|
|
1902
|
-
),
|
|
1903
|
-
(!
|
|
1904
|
-
const { cache:
|
|
1905
|
-
return
|
|
1906
|
-
const u =
|
|
1907
|
-
let
|
|
1908
|
-
return
|
|
1909
|
-
id:
|
|
1910
|
-
title:
|
|
1900
|
+
[x, $, gr, we, J, Ke, En, vt, mr, lr, Vt, rr, it, S, e]
|
|
1901
|
+
), Wi = T(
|
|
1902
|
+
() => Be(P),
|
|
1903
|
+
[P, Be]
|
|
1904
|
+
), Rt = H(null), Oi = T(() => {
|
|
1905
|
+
(!Rt.current || Rt.current.make !== Be) && (Rt.current = { make: Be, cache: /* @__PURE__ */ new Map() });
|
|
1906
|
+
const { cache: t } = Rt.current;
|
|
1907
|
+
return re.map((l) => {
|
|
1908
|
+
const u = l === de, w = `${l}:${u}`;
|
|
1909
|
+
let N = t.get(w);
|
|
1910
|
+
return N || (N = Be(l, { bridgeEnabled: u }), t.set(w, N)), {
|
|
1911
|
+
id: l,
|
|
1912
|
+
title: or.get(l) ?? (l === "default" ? p : l),
|
|
1911
1913
|
panel: "chat",
|
|
1912
|
-
params:
|
|
1914
|
+
params: N
|
|
1913
1915
|
};
|
|
1914
1916
|
});
|
|
1915
|
-
}, [
|
|
1916
|
-
storageKey:
|
|
1917
|
-
defaultLeftTab:
|
|
1918
|
-
initialPanels:
|
|
1919
|
-
extraPanels:
|
|
1920
|
-
onReloadAgentPlugins: () =>
|
|
1921
|
-
onReady:
|
|
1922
|
-
onChange:
|
|
1923
|
-
onClose:
|
|
1917
|
+
}, [de, re, p, Be, or]), Mi = T(() => ({
|
|
1918
|
+
storageKey: Q,
|
|
1919
|
+
defaultLeftTab: ft,
|
|
1920
|
+
initialPanels: xn,
|
|
1921
|
+
extraPanels: ir,
|
|
1922
|
+
onReloadAgentPlugins: () => it(Z ?? P),
|
|
1923
|
+
onReady: Yn,
|
|
1924
|
+
onChange: Xn,
|
|
1925
|
+
onClose: kt,
|
|
1924
1926
|
showCloseAction: !1
|
|
1925
1927
|
}), [
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1928
|
+
kt,
|
|
1929
|
+
ft,
|
|
1930
|
+
xn,
|
|
1931
|
+
it,
|
|
1932
|
+
Z,
|
|
1931
1933
|
P,
|
|
1934
|
+
Xn,
|
|
1932
1935
|
Yn,
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
]), mr = () => {
|
|
1936
|
+
Q,
|
|
1937
|
+
ir,
|
|
1938
|
+
oe
|
|
1939
|
+
]), pr = () => {
|
|
1938
1940
|
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
1939
1941
|
key: "k",
|
|
1940
1942
|
metaKey: !0,
|
|
@@ -1942,248 +1944,286 @@ function Uo({
|
|
|
1942
1944
|
bubbles: !0,
|
|
1943
1945
|
cancelable: !0
|
|
1944
1946
|
}));
|
|
1945
|
-
},
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
] }),
|
|
1949
|
-
sessions:
|
|
1950
|
-
activeId:
|
|
1951
|
-
openIds:
|
|
1952
|
-
pinnedIds:
|
|
1947
|
+
}, hr = /* @__PURE__ */ b(ue, { children: [
|
|
1948
|
+
Nn ? /* @__PURE__ */ r(_s, {}) : null,
|
|
1949
|
+
Sn
|
|
1950
|
+
] }), Ii = {
|
|
1951
|
+
sessions: Y,
|
|
1952
|
+
activeId: de,
|
|
1953
|
+
openIds: re,
|
|
1954
|
+
pinnedIds: Wn,
|
|
1953
1955
|
onTogglePin: On,
|
|
1954
|
-
onSwitch:
|
|
1955
|
-
onOpenAsTab:
|
|
1956
|
-
onCreate:
|
|
1957
|
-
onDelete:
|
|
1956
|
+
onSwitch: At,
|
|
1957
|
+
onOpenAsTab: rt,
|
|
1958
|
+
onCreate: tt,
|
|
1959
|
+
onDelete: dr,
|
|
1958
1960
|
onLoadMore: S == null ? void 0 : S.loadMore,
|
|
1959
1961
|
hasMore: S == null ? void 0 : S.hasMore,
|
|
1960
1962
|
loadingMore: S == null ? void 0 : S.loadingMore,
|
|
1961
1963
|
onClose: () => Gn(!1)
|
|
1962
|
-
},
|
|
1963
|
-
sessions:
|
|
1964
|
-
activeId:
|
|
1965
|
-
openIds:
|
|
1966
|
-
search: (
|
|
1967
|
-
onSwitch:
|
|
1968
|
-
onOpenAsTab:
|
|
1969
|
-
} : void 0, [
|
|
1970
|
-
|
|
1971
|
-
|
|
1964
|
+
}, Fi = !!(S || he || !Ee), $i = T(() => te ? {
|
|
1965
|
+
sessions: Y,
|
|
1966
|
+
activeId: de,
|
|
1967
|
+
openIds: re,
|
|
1968
|
+
search: (t, l) => is(t, l, { limit: 8 }),
|
|
1969
|
+
onSwitch: At,
|
|
1970
|
+
onOpenAsTab: rt
|
|
1971
|
+
} : void 0, [de, re, te, rt, Y, At]), Ui = T(() => !te || !(q != null && q.length) ? null : /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: q.map((t) => /* @__PURE__ */ b(
|
|
1972
|
+
"button",
|
|
1973
|
+
{
|
|
1974
|
+
type: "button",
|
|
1975
|
+
"data-boring-workspace-part": "chat-pane-control",
|
|
1976
|
+
className: "inline-flex h-5 items-center gap-1 rounded-md px-1.5 text-[11px] font-medium text-muted-foreground/80 transition-colors hover:bg-muted/70 hover:text-foreground aria-pressed:bg-muted aria-pressed:text-foreground",
|
|
1977
|
+
"aria-label": t.label,
|
|
1978
|
+
"aria-pressed": X === t.id,
|
|
1979
|
+
title: t.label,
|
|
1980
|
+
onPointerDownCapture: (l) => l.nativeEvent.stopPropagation(),
|
|
1981
|
+
onMouseDownCapture: (l) => l.nativeEvent.stopPropagation(),
|
|
1982
|
+
onClick: (l) => {
|
|
1983
|
+
l.preventDefault(), l.stopPropagation(), j((u) => u === t.id ? null : t.id);
|
|
1984
|
+
},
|
|
1985
|
+
children: [
|
|
1986
|
+
t.icon ? /* @__PURE__ */ r("span", { className: "grid size-3.5 place-items-center", children: t.icon }) : null,
|
|
1987
|
+
/* @__PURE__ */ r("span", { children: t.label })
|
|
1988
|
+
]
|
|
1989
|
+
},
|
|
1990
|
+
t.id
|
|
1991
|
+
)) }), [q, te, X]), zi = T(() => {
|
|
1992
|
+
const t = [...wn ?? []];
|
|
1993
|
+
for (const l of q ?? [])
|
|
1994
|
+
t.push({
|
|
1995
|
+
id: l.id,
|
|
1996
|
+
label: l.label,
|
|
1997
|
+
icon: l.icon,
|
|
1998
|
+
trailing: l.trailing,
|
|
1999
|
+
emphasis: l.emphasis,
|
|
2000
|
+
onClick: () => j((u) => u === l.id ? null : l.id)
|
|
2001
|
+
});
|
|
2002
|
+
return Ve && t.push({
|
|
1972
2003
|
id: "plugins",
|
|
1973
2004
|
label: "Plugins",
|
|
1974
|
-
icon: /* @__PURE__ */
|
|
1975
|
-
onClick: () =>
|
|
1976
|
-
}),
|
|
2005
|
+
icon: /* @__PURE__ */ r(Fr, { className: "h-4 w-4", strokeWidth: 1.75 }),
|
|
2006
|
+
onClick: () => j((l) => l === "plugins" ? null : "plugins")
|
|
2007
|
+
}), qe && t.push({
|
|
1977
2008
|
id: "skills",
|
|
1978
2009
|
label: "Skills",
|
|
1979
|
-
icon: /* @__PURE__ */
|
|
1980
|
-
onClick: () =>
|
|
1981
|
-
}),
|
|
1982
|
-
}, [wn,
|
|
1983
|
-
|
|
2010
|
+
icon: /* @__PURE__ */ r(Ir, { className: "h-4 w-4", strokeWidth: 1.75 }),
|
|
2011
|
+
onClick: () => j((l) => l === "skills" ? null : "skills")
|
|
2012
|
+
}), t;
|
|
2013
|
+
}, [wn, q, Ve, qe]), Gi = T(() => {
|
|
2014
|
+
const t = q == null ? void 0 : q.find((l) => l.id === X);
|
|
2015
|
+
return t ? t.render({
|
|
2016
|
+
onClose: () => j(null),
|
|
2017
|
+
headerInsetStart: ze,
|
|
2018
|
+
headerInsetEnd: !se,
|
|
2019
|
+
workspaceId: e
|
|
2020
|
+
}) : null;
|
|
2021
|
+
}, [q, ze, X, se, e]) ?? (X === "skills" && qe ? /* @__PURE__ */ r(
|
|
2022
|
+
Ds,
|
|
1984
2023
|
{
|
|
1985
|
-
onClose: () =>
|
|
1986
|
-
headerInsetStart:
|
|
1987
|
-
headerInsetEnd: !
|
|
2024
|
+
onClose: () => j(null),
|
|
2025
|
+
headerInsetStart: ze,
|
|
2026
|
+
headerInsetEnd: !se
|
|
1988
2027
|
}
|
|
1989
|
-
) :
|
|
1990
|
-
|
|
2028
|
+
) : X === "plugins" && Ve ? /* @__PURE__ */ r(
|
|
2029
|
+
Ws,
|
|
1991
2030
|
{
|
|
1992
|
-
onClose: () =>
|
|
1993
|
-
onReloadExternalPlugins: () =>
|
|
1994
|
-
headerInsetStart:
|
|
1995
|
-
headerInsetEnd: !
|
|
2031
|
+
onClose: () => j(null),
|
|
2032
|
+
onReloadExternalPlugins: () => it(Z ?? P),
|
|
2033
|
+
headerInsetStart: ze,
|
|
2034
|
+
headerInsetEnd: !se
|
|
1996
2035
|
}
|
|
1997
|
-
) : null,
|
|
1998
|
-
|
|
2036
|
+
) : null), br = Ze ? /* @__PURE__ */ r(io, {}) : /* @__PURE__ */ r(
|
|
2037
|
+
As,
|
|
1999
2038
|
{
|
|
2000
|
-
className:
|
|
2001
|
-
nav:
|
|
2002
|
-
navParams:
|
|
2039
|
+
className: ii,
|
|
2040
|
+
nav: te ? null : Bn ? "session-list" : null,
|
|
2041
|
+
navParams: Ii,
|
|
2003
2042
|
center: "chat",
|
|
2004
|
-
centerParams:
|
|
2043
|
+
centerParams: Wi,
|
|
2005
2044
|
chatPanes: Oi,
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2045
|
+
chatTopActions: Ui,
|
|
2046
|
+
activeChatPaneId: de,
|
|
2047
|
+
onActiveChatPaneChange: Ci,
|
|
2048
|
+
onCloseChatPane: Ti,
|
|
2049
|
+
onCreateChatPaneAfter: te ? void 0 : sn,
|
|
2050
|
+
onDropChatSession: rt,
|
|
2051
|
+
flashChatPaneId: (Me == null ? void 0 : Me.workspaceId) === e ? Me.id : null,
|
|
2052
|
+
surface: se ? "artifact-surface" : null,
|
|
2053
|
+
surfaceParams: Mi,
|
|
2054
|
+
chatOverlay: te ? Gi : null,
|
|
2055
|
+
onCloseChatOverlay: () => j(null),
|
|
2056
|
+
surfaceOverlay: Li,
|
|
2057
|
+
sidebar: se && !an && tn && Ei ? "workbench-left" : null,
|
|
2058
|
+
sidebarParams: se && !an && tn ? {
|
|
2059
|
+
...ft ? { defaultTab: ft } : {},
|
|
2060
|
+
bridge: Ri,
|
|
2021
2061
|
onClose: () => {
|
|
2022
|
-
|
|
2062
|
+
ke(!1), nt(!1);
|
|
2023
2063
|
},
|
|
2024
2064
|
onCollapse: () => {
|
|
2025
|
-
|
|
2065
|
+
ke(!1), nt(!1);
|
|
2026
2066
|
}
|
|
2027
2067
|
} : void 0,
|
|
2028
|
-
storageKey: K ?
|
|
2029
|
-
onOpenNav: !
|
|
2030
|
-
Gn(!0),
|
|
2068
|
+
storageKey: K ? We : void 0,
|
|
2069
|
+
onOpenNav: !te && O ? () => {
|
|
2070
|
+
Gn(!0), qt == null || qt();
|
|
2031
2071
|
} : void 0,
|
|
2032
2072
|
onOpenSurface: () => {
|
|
2033
|
-
|
|
2073
|
+
ve.current = !0, oe(!0), Ne == null || Ne();
|
|
2034
2074
|
},
|
|
2035
|
-
surfaceButtonBottomOffset:
|
|
2036
|
-
onOpenSidebar:
|
|
2037
|
-
|
|
2075
|
+
surfaceButtonBottomOffset: ri,
|
|
2076
|
+
onOpenSidebar: tn ? () => {
|
|
2077
|
+
ve.current = !0, oe(!0), ke(!0), nt(!0);
|
|
2038
2078
|
} : void 0
|
|
2039
2079
|
}
|
|
2040
|
-
),
|
|
2041
|
-
|
|
2080
|
+
), Ki = te ? /* @__PURE__ */ r(
|
|
2081
|
+
Hs,
|
|
2042
2082
|
{
|
|
2043
|
-
collapsed:
|
|
2044
|
-
onExpand: () =>
|
|
2045
|
-
onCollapse: () =>
|
|
2046
|
-
onResizeLeftPane: (
|
|
2047
|
-
leftPaneWidth:
|
|
2083
|
+
collapsed: ze,
|
|
2084
|
+
onExpand: () => Kn(!1),
|
|
2085
|
+
onCollapse: () => Kn(!0),
|
|
2086
|
+
onResizeLeftPane: (t) => Si((l) => Dr(l + t, 220, 420)),
|
|
2087
|
+
leftPaneWidth: Hn,
|
|
2048
2088
|
minLeftPaneWidth: 220,
|
|
2049
2089
|
maxLeftPaneWidth: 420,
|
|
2050
|
-
leftPane: /* @__PURE__ */
|
|
2051
|
-
|
|
2090
|
+
leftPane: /* @__PURE__ */ r(
|
|
2091
|
+
Gs,
|
|
2052
2092
|
{
|
|
2053
|
-
width:
|
|
2054
|
-
appTitle:
|
|
2055
|
-
workspaceLabel:
|
|
2056
|
-
workspaceSectionTitle:
|
|
2057
|
-
layoutMode:
|
|
2058
|
-
headerMode:
|
|
2059
|
-
projects:
|
|
2060
|
-
activeProjectId:
|
|
2061
|
-
onOpenProjectSession:
|
|
2093
|
+
width: Hn,
|
|
2094
|
+
appTitle: be,
|
|
2095
|
+
workspaceLabel: dt,
|
|
2096
|
+
workspaceSectionTitle: Ft,
|
|
2097
|
+
layoutMode: $t,
|
|
2098
|
+
headerMode: _e,
|
|
2099
|
+
projects: Ut,
|
|
2100
|
+
activeProjectId: De ?? e,
|
|
2101
|
+
onOpenProjectSession: zt,
|
|
2062
2102
|
onShowMoreProjectSessions: Gt,
|
|
2063
|
-
onCreateProject:
|
|
2064
|
-
onCreateProjectSession: (
|
|
2065
|
-
|
|
2103
|
+
onCreateProject: Kt,
|
|
2104
|
+
onCreateProjectSession: (t) => {
|
|
2105
|
+
t === (De ?? e) ? (j(null), ur()) : Se == null || Se(t);
|
|
2066
2106
|
},
|
|
2067
|
-
onOpenProjectSettings:
|
|
2068
|
-
onOpenProjectInNewTab:
|
|
2069
|
-
sessionTitle:
|
|
2070
|
-
topSlot:
|
|
2071
|
-
bottomSlot:
|
|
2072
|
-
sessions:
|
|
2073
|
-
activeSessionId:
|
|
2074
|
-
openSessionIds:
|
|
2075
|
-
pinnedSessionIds:
|
|
2107
|
+
onOpenProjectSettings: Le,
|
|
2108
|
+
onOpenProjectInNewTab: ut,
|
|
2109
|
+
sessionTitle: Ze ? "Loading sessions…" : zn ?? p,
|
|
2110
|
+
topSlot: yn,
|
|
2111
|
+
bottomSlot: Nn || Sn != null ? /* @__PURE__ */ r("div", { className: "flex w-full min-w-0 items-center gap-2", children: hr }) : void 0,
|
|
2112
|
+
sessions: Y,
|
|
2113
|
+
activeSessionId: de,
|
|
2114
|
+
openSessionIds: re,
|
|
2115
|
+
pinnedSessionIds: Wn,
|
|
2076
2116
|
onCreateSession: () => {
|
|
2077
|
-
|
|
2117
|
+
j(null), ur();
|
|
2078
2118
|
},
|
|
2079
|
-
onOpenCommandPalette:
|
|
2080
|
-
onSwitchSession:
|
|
2081
|
-
onOpenSessionAsPane:
|
|
2119
|
+
onOpenCommandPalette: pr,
|
|
2120
|
+
onSwitchSession: At,
|
|
2121
|
+
onOpenSessionAsPane: rt,
|
|
2082
2122
|
onToggleSessionPinned: On,
|
|
2083
|
-
onDeleteSession:
|
|
2084
|
-
actions:
|
|
2123
|
+
onDeleteSession: Fi ? dr : void 0,
|
|
2124
|
+
actions: zi
|
|
2085
2125
|
}
|
|
2086
2126
|
),
|
|
2087
|
-
children:
|
|
2127
|
+
children: br
|
|
2088
2128
|
}
|
|
2089
|
-
) : /* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
|
|
2129
|
+
) : /* @__PURE__ */ b("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
2130
|
+
/* @__PURE__ */ r(
|
|
2131
|
+
Ts,
|
|
2092
2132
|
{
|
|
2093
|
-
appTitle:
|
|
2094
|
-
sessionTitle:
|
|
2095
|
-
onCommandPalette:
|
|
2096
|
-
topBarLeft:
|
|
2097
|
-
topBarRight:
|
|
2133
|
+
appTitle: be,
|
|
2134
|
+
sessionTitle: Ze ? "Loading sessions…" : zn ?? p,
|
|
2135
|
+
onCommandPalette: pr,
|
|
2136
|
+
topBarLeft: yn,
|
|
2137
|
+
topBarRight: hr
|
|
2098
2138
|
}
|
|
2099
2139
|
),
|
|
2100
|
-
|
|
2140
|
+
br
|
|
2101
2141
|
] });
|
|
2102
|
-
return /* @__PURE__ */
|
|
2103
|
-
|
|
2142
|
+
return /* @__PURE__ */ r("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ b(
|
|
2143
|
+
vs,
|
|
2104
2144
|
{
|
|
2105
|
-
chatPanel:
|
|
2106
|
-
panels:
|
|
2145
|
+
chatPanel: ci,
|
|
2146
|
+
panels: oi,
|
|
2107
2147
|
commands: m,
|
|
2108
2148
|
catalogs: k,
|
|
2109
2149
|
plugins: R,
|
|
2110
|
-
excludeDefaults:
|
|
2150
|
+
excludeDefaults: W,
|
|
2111
2151
|
capabilities: E,
|
|
2112
2152
|
apiBaseUrl: x,
|
|
2113
|
-
authHeaders:
|
|
2114
|
-
apiTimeout:
|
|
2115
|
-
activeSessionId:
|
|
2116
|
-
openSessionIds:
|
|
2153
|
+
authHeaders: ai,
|
|
2154
|
+
apiTimeout: v,
|
|
2155
|
+
activeSessionId: de,
|
|
2156
|
+
openSessionIds: re,
|
|
2117
2157
|
defaultTheme: y,
|
|
2118
2158
|
onThemeChange: D,
|
|
2119
2159
|
workspaceId: e,
|
|
2120
|
-
workspaceLabel:
|
|
2121
|
-
appTitle:
|
|
2122
|
-
storageKey:
|
|
2160
|
+
workspaceLabel: dt,
|
|
2161
|
+
appTitle: be,
|
|
2162
|
+
storageKey: Yt,
|
|
2123
2163
|
persistenceEnabled: F,
|
|
2124
|
-
debug:
|
|
2164
|
+
debug: xe,
|
|
2125
2165
|
bridgeEndpoint: null,
|
|
2126
|
-
onAuthError:
|
|
2127
|
-
frontPluginHotReload:
|
|
2128
|
-
fullPageBasePath:
|
|
2129
|
-
commandPaletteSessionSearch:
|
|
2166
|
+
onAuthError: It,
|
|
2167
|
+
frontPluginHotReload: si,
|
|
2168
|
+
fullPageBasePath: Mt,
|
|
2169
|
+
commandPaletteSessionSearch: $i,
|
|
2130
2170
|
children: [
|
|
2131
2171
|
f,
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
|
|
2172
|
+
/* @__PURE__ */ r(
|
|
2173
|
+
no,
|
|
2134
2174
|
{
|
|
2135
2175
|
workspaceId: e,
|
|
2136
|
-
requestHeaders:
|
|
2176
|
+
requestHeaders: we,
|
|
2137
2177
|
apiBaseUrl: x,
|
|
2138
|
-
preloadPaths:
|
|
2139
|
-
provisionWorkspace:
|
|
2140
|
-
onStatusChange:
|
|
2178
|
+
preloadPaths: ni,
|
|
2179
|
+
provisionWorkspace: Jt,
|
|
2180
|
+
onStatusChange: Di
|
|
2141
2181
|
}
|
|
2142
2182
|
),
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
|
|
2183
|
+
/* @__PURE__ */ r(
|
|
2184
|
+
lo,
|
|
2145
2185
|
{
|
|
2146
2186
|
bridgeEndpoint: J,
|
|
2147
|
-
requestHeaders:
|
|
2148
|
-
navOpen:
|
|
2149
|
-
surfaceOpen:
|
|
2150
|
-
surfaceReady:
|
|
2151
|
-
snapshot:
|
|
2187
|
+
requestHeaders: we,
|
|
2188
|
+
navOpen: te ? !ze : Bn,
|
|
2189
|
+
surfaceOpen: se,
|
|
2190
|
+
surfaceReady: Ni,
|
|
2191
|
+
snapshot: Ai
|
|
2152
2192
|
}
|
|
2153
2193
|
),
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
|
|
2194
|
+
/* @__PURE__ */ r(co, { onQuestionOpen: ki }),
|
|
2195
|
+
Ki,
|
|
2156
2196
|
g
|
|
2157
2197
|
]
|
|
2158
2198
|
}
|
|
2159
2199
|
) });
|
|
2160
2200
|
}
|
|
2161
|
-
const
|
|
2162
|
-
function
|
|
2163
|
-
return new Promise((
|
|
2201
|
+
const yo = 500;
|
|
2202
|
+
function So(e) {
|
|
2203
|
+
return new Promise((n, i) => {
|
|
2164
2204
|
let s;
|
|
2165
2205
|
const o = () => {
|
|
2166
2206
|
s && globalThis.clearTimeout(s), e.removeEventListener("abort", a);
|
|
2167
2207
|
}, a = () => {
|
|
2168
|
-
o(),
|
|
2208
|
+
o(), i(new DOMException("Workspace boot aborted", "AbortError"));
|
|
2169
2209
|
};
|
|
2170
2210
|
if (e.aborted) {
|
|
2171
2211
|
a();
|
|
2172
2212
|
return;
|
|
2173
2213
|
}
|
|
2174
2214
|
s = globalThis.setTimeout(() => {
|
|
2175
|
-
o(),
|
|
2176
|
-
},
|
|
2215
|
+
o(), n();
|
|
2216
|
+
}, yo), e.addEventListener("abort", a, { once: !0 });
|
|
2177
2217
|
});
|
|
2178
2218
|
}
|
|
2179
|
-
function
|
|
2219
|
+
function Ho({
|
|
2180
2220
|
workspaceId: e,
|
|
2181
|
-
requestHeaders:
|
|
2182
|
-
apiBaseUrl:
|
|
2221
|
+
requestHeaders: n,
|
|
2222
|
+
apiBaseUrl: i,
|
|
2183
2223
|
preloadPaths: s = Gr,
|
|
2184
2224
|
provisionWorkspace: o = !0,
|
|
2185
2225
|
loadingFallback: a,
|
|
2186
|
-
errorFallback:
|
|
2226
|
+
errorFallback: c,
|
|
2187
2227
|
children: f
|
|
2188
2228
|
}) {
|
|
2189
2229
|
const [g, d] = L({
|
|
@@ -2191,30 +2231,30 @@ function Go({
|
|
|
2191
2231
|
label: "Waking workspace runtime"
|
|
2192
2232
|
});
|
|
2193
2233
|
return _(() => {
|
|
2194
|
-
const m = new AbortController(), k =
|
|
2234
|
+
const m = new AbortController(), k = Wt(e, n);
|
|
2195
2235
|
async function R(E) {
|
|
2196
|
-
const x = await fetch(
|
|
2236
|
+
const x = await fetch(Hr(i, E), {
|
|
2197
2237
|
headers: k,
|
|
2198
2238
|
signal: m.signal
|
|
2199
2239
|
}), h = await Ot(x);
|
|
2200
2240
|
if (!x.ok) {
|
|
2201
|
-
if (
|
|
2202
|
-
throw new Error(
|
|
2241
|
+
if (bn(h)) return "preparing";
|
|
2242
|
+
throw new Error(vn(h) ?? `${E} failed with ${x.status}`);
|
|
2203
2243
|
}
|
|
2204
|
-
if (
|
|
2205
|
-
const y =
|
|
2244
|
+
if (Br(E)) {
|
|
2245
|
+
const y = Lt(h);
|
|
2206
2246
|
if ((y == null ? void 0 : y.state) === "degraded") throw new Error(y.message ?? "Workspace failed to prepare");
|
|
2207
2247
|
}
|
|
2208
|
-
return
|
|
2248
|
+
return xs(E) !== null && h && typeof h == "object" && Jr(i, k["x-boring-workspace-id"] ?? e, E, h), "ready";
|
|
2209
2249
|
}
|
|
2210
|
-
async function
|
|
2250
|
+
async function W() {
|
|
2211
2251
|
d({ status: "loading", label: "Waking workspace runtime" });
|
|
2212
2252
|
try {
|
|
2213
|
-
const E =
|
|
2214
|
-
let x = await Promise.all(E.map(async (
|
|
2253
|
+
const E = Kr(s, o);
|
|
2254
|
+
let x = await Promise.all(E.map(async (v) => ({ path: v, status: await R(v) }))), h = x.filter((v) => v.status === "preparing").map((v) => v.path);
|
|
2215
2255
|
for (; h.length > 0; ) {
|
|
2216
|
-
if (d({ status: "loading", label: "Workspace is still preparing" }), await
|
|
2217
|
-
x = await Promise.all(h.map(async (
|
|
2256
|
+
if (d({ status: "loading", label: "Workspace is still preparing" }), await So(m.signal), m.signal.aborted) return;
|
|
2257
|
+
x = await Promise.all(h.map(async (v) => ({ path: v, status: await R(v) }))), h = x.filter((v) => v.status === "preparing").map((v) => v.path);
|
|
2218
2258
|
}
|
|
2219
2259
|
m.signal.aborted || d({ status: "ready" });
|
|
2220
2260
|
} catch (E) {
|
|
@@ -2225,16 +2265,16 @@ function Go({
|
|
|
2225
2265
|
});
|
|
2226
2266
|
}
|
|
2227
2267
|
}
|
|
2228
|
-
return
|
|
2229
|
-
}, [
|
|
2230
|
-
|
|
2268
|
+
return W(), () => m.abort();
|
|
2269
|
+
}, [i, s, o, n, e]), g.status === "ready" ? /* @__PURE__ */ r(ue, { children: f }) : g.status === "error" ? typeof c == "function" ? /* @__PURE__ */ r(ue, { children: c(g.message) }) : c ? /* @__PURE__ */ r(ue, { children: c }) : /* @__PURE__ */ r(
|
|
2270
|
+
Rr,
|
|
2231
2271
|
{
|
|
2232
2272
|
title: "Workspace failed to open",
|
|
2233
2273
|
description: g.message,
|
|
2234
2274
|
status: "Retry by reloading the page"
|
|
2235
2275
|
}
|
|
2236
|
-
) : typeof a == "function" ? /* @__PURE__ */
|
|
2237
|
-
|
|
2276
|
+
) : typeof a == "function" ? /* @__PURE__ */ r(ue, { children: a(g.label) }) : a ? /* @__PURE__ */ r(ue, { children: a }) : /* @__PURE__ */ r(
|
|
2277
|
+
Rr,
|
|
2238
2278
|
{
|
|
2239
2279
|
title: "Opening workspace",
|
|
2240
2280
|
description: "Preparing secure runtime, files, sessions, and layout.",
|
|
@@ -2242,11 +2282,11 @@ function Go({
|
|
|
2242
2282
|
}
|
|
2243
2283
|
);
|
|
2244
2284
|
}
|
|
2245
|
-
const
|
|
2285
|
+
const No = "FULL_PAGE_PANEL_MISSING_COMPONENT", wo = "FULL_PAGE_PANEL_INVALID_PARAMS_JSON", Po = "FULL_PAGE_PANEL_PARAMS_NOT_OBJECT", Eo = "FULL_PAGE_PANEL_UNKNOWN_COMPONENT", ko = "FULL_PAGE_PANEL_NOT_SUPPORTED", Ao = "FULL_PAGE_PANEL_RENDER_FAILED";
|
|
2246
2286
|
function B() {
|
|
2247
2287
|
}
|
|
2248
|
-
const
|
|
2249
|
-
function
|
|
2288
|
+
const Ro = { dispose: B }, I = () => Ro;
|
|
2289
|
+
function Co(e) {
|
|
2250
2290
|
return {
|
|
2251
2291
|
id: `full-page:${e}`,
|
|
2252
2292
|
title: e,
|
|
@@ -2257,8 +2297,8 @@ function Ao(e) {
|
|
|
2257
2297
|
height: 0,
|
|
2258
2298
|
location: { type: "grid", referenceGroup: void 0 },
|
|
2259
2299
|
setActive: B,
|
|
2260
|
-
setTitle: (
|
|
2261
|
-
document.title =
|
|
2300
|
+
setTitle: (n) => {
|
|
2301
|
+
document.title = n;
|
|
2262
2302
|
},
|
|
2263
2303
|
setSize: B,
|
|
2264
2304
|
close: () => {
|
|
@@ -2280,7 +2320,7 @@ function Ao(e) {
|
|
|
2280
2320
|
onWillFocus: I
|
|
2281
2321
|
};
|
|
2282
2322
|
}
|
|
2283
|
-
function
|
|
2323
|
+
function To() {
|
|
2284
2324
|
return {
|
|
2285
2325
|
width: window.innerWidth,
|
|
2286
2326
|
height: window.innerHeight,
|
|
@@ -2322,28 +2362,28 @@ function Ro() {
|
|
|
2322
2362
|
onDidActivePanelChange_: I
|
|
2323
2363
|
};
|
|
2324
2364
|
}
|
|
2325
|
-
function
|
|
2326
|
-
return /* @__PURE__ */
|
|
2365
|
+
function fn({ code: e, title: n, description: i }) {
|
|
2366
|
+
return /* @__PURE__ */ r(
|
|
2327
2367
|
"div",
|
|
2328
2368
|
{
|
|
2329
2369
|
className: "flex min-h-screen items-center justify-center bg-background p-6 text-foreground",
|
|
2330
2370
|
"data-testid": "full-page-error-state",
|
|
2331
2371
|
"data-full-page-error-code": e,
|
|
2332
|
-
children: /* @__PURE__ */
|
|
2372
|
+
children: /* @__PURE__ */ r(ks, { className: "w-full max-w-lg", title: n, description: i })
|
|
2333
2373
|
}
|
|
2334
2374
|
);
|
|
2335
2375
|
}
|
|
2336
|
-
function
|
|
2337
|
-
const
|
|
2338
|
-
|
|
2376
|
+
function Bo({ componentId: e, params: n = {} }) {
|
|
2377
|
+
const i = qr(), { errors: s } = ys(), o = i.get(e), a = i.getComponents()[e];
|
|
2378
|
+
Bi(() => {
|
|
2339
2379
|
document.title = (o == null ? void 0 : o.title) ?? e;
|
|
2340
2380
|
}, [e, o == null ? void 0 : o.title]);
|
|
2341
|
-
const
|
|
2342
|
-
params:
|
|
2343
|
-
api:
|
|
2344
|
-
containerApi:
|
|
2381
|
+
const c = T(() => ({
|
|
2382
|
+
params: n,
|
|
2383
|
+
api: Co(e),
|
|
2384
|
+
containerApi: To(),
|
|
2345
2385
|
className: "h-full"
|
|
2346
|
-
}), [e,
|
|
2386
|
+
}), [e, n]), f = T(() => {
|
|
2347
2387
|
if (!o) return null;
|
|
2348
2388
|
const g = o.pluginId ?? o.id;
|
|
2349
2389
|
for (let d = s.length - 1; d >= 0; d -= 1) {
|
|
@@ -2353,44 +2393,44 @@ function zo({ componentId: e, params: t = {} }) {
|
|
|
2353
2393
|
}
|
|
2354
2394
|
return null;
|
|
2355
2395
|
}, [e, s, o]);
|
|
2356
|
-
return o ? !o.supportsFullPage || !a ? /* @__PURE__ */
|
|
2357
|
-
|
|
2396
|
+
return o ? !o.supportsFullPage || !a ? /* @__PURE__ */ r(
|
|
2397
|
+
fn,
|
|
2358
2398
|
{
|
|
2359
|
-
code:
|
|
2399
|
+
code: ko,
|
|
2360
2400
|
title: "Panel does not support full-page mode",
|
|
2361
2401
|
description: `Panel "${e}" can render in the workspace, but it has not opted into the dedicated full-page pane route.`
|
|
2362
2402
|
}
|
|
2363
|
-
) : f ? /* @__PURE__ */
|
|
2364
|
-
|
|
2403
|
+
) : f ? /* @__PURE__ */ r(
|
|
2404
|
+
fn,
|
|
2365
2405
|
{
|
|
2366
|
-
code:
|
|
2406
|
+
code: Ao,
|
|
2367
2407
|
title: "Panel failed to render",
|
|
2368
2408
|
description: `Panel "${e}" crashed while rendering in full-page mode: ${f.error.message}`
|
|
2369
2409
|
}
|
|
2370
|
-
) : /* @__PURE__ */
|
|
2371
|
-
|
|
2410
|
+
) : /* @__PURE__ */ r("div", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ r(Ss, { mode: "full-page", children: /* @__PURE__ */ r(a, { ...c }) }) }) : /* @__PURE__ */ r(
|
|
2411
|
+
fn,
|
|
2372
2412
|
{
|
|
2373
|
-
code:
|
|
2413
|
+
code: Eo,
|
|
2374
2414
|
title: "Unknown panel",
|
|
2375
2415
|
description: `No full-page panel component is registered as "${e}".`
|
|
2376
2416
|
}
|
|
2377
2417
|
);
|
|
2378
2418
|
}
|
|
2379
|
-
function
|
|
2419
|
+
function Jo(e) {
|
|
2380
2420
|
var a;
|
|
2381
|
-
const
|
|
2382
|
-
if (!
|
|
2421
|
+
const n = new URLSearchParams(e), i = ((a = n.get("component")) == null ? void 0 : a.trim()) ?? "";
|
|
2422
|
+
if (!i)
|
|
2383
2423
|
return {
|
|
2384
2424
|
componentId: null,
|
|
2385
2425
|
params: {},
|
|
2386
2426
|
error: {
|
|
2387
|
-
code:
|
|
2427
|
+
code: No,
|
|
2388
2428
|
message: "Missing full-page panel component id."
|
|
2389
2429
|
}
|
|
2390
2430
|
};
|
|
2391
|
-
const s =
|
|
2431
|
+
const s = n.get("params");
|
|
2392
2432
|
if (!s)
|
|
2393
|
-
return { componentId:
|
|
2433
|
+
return { componentId: i, params: {} };
|
|
2394
2434
|
let o;
|
|
2395
2435
|
try {
|
|
2396
2436
|
o = JSON.parse(s);
|
|
@@ -2399,7 +2439,7 @@ function Ko(e) {
|
|
|
2399
2439
|
componentId: null,
|
|
2400
2440
|
params: {},
|
|
2401
2441
|
error: {
|
|
2402
|
-
code:
|
|
2442
|
+
code: wo,
|
|
2403
2443
|
message: "Invalid full-page panel params JSON."
|
|
2404
2444
|
}
|
|
2405
2445
|
};
|
|
@@ -2408,23 +2448,23 @@ function Ko(e) {
|
|
|
2408
2448
|
componentId: null,
|
|
2409
2449
|
params: {},
|
|
2410
2450
|
error: {
|
|
2411
|
-
code:
|
|
2451
|
+
code: Po,
|
|
2412
2452
|
message: "Full-page panel params must be a JSON object."
|
|
2413
2453
|
}
|
|
2414
|
-
} : { componentId:
|
|
2454
|
+
} : { componentId: i, params: o };
|
|
2415
2455
|
}
|
|
2416
2456
|
export {
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2457
|
+
wo as FULL_PAGE_PANEL_INVALID_PARAMS_JSON,
|
|
2458
|
+
No as FULL_PAGE_PANEL_MISSING_COMPONENT,
|
|
2459
|
+
ko as FULL_PAGE_PANEL_NOT_SUPPORTED,
|
|
2460
|
+
Po as FULL_PAGE_PANEL_PARAMS_NOT_OBJECT,
|
|
2461
|
+
Ao as FULL_PAGE_PANEL_RENDER_FAILED,
|
|
2462
|
+
Eo as FULL_PAGE_PANEL_UNKNOWN_COMPONENT,
|
|
2463
|
+
Ko as WorkspaceAgentFront,
|
|
2464
|
+
no as WorkspaceBackgroundBoot,
|
|
2465
|
+
Ho as WorkspaceBootGate,
|
|
2466
|
+
Bo as WorkspaceFullPagePanel,
|
|
2467
|
+
Vs as createLocalStorageSessions,
|
|
2468
|
+
Jo as parseFullPagePanelLocation,
|
|
2469
|
+
Ys as useLocalStorageSessions
|
|
2430
2470
|
};
|