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