@hachej/boring-workspace 0.1.63 → 0.1.64

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