@hachej/boring-workspace 0.1.60 → 0.1.62

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