@hachej/boring-workspace 0.1.59 → 0.1.60

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