@hachej/boring-workspace 0.1.58 → 0.1.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app-front.js CHANGED
@@ -1,16 +1,16 @@
1
- import { jsx as d, jsxs as Ae, Fragment as fe } from "react/jsx-runtime";
2
- import { useEffect as A, useSyncExternalStore as xr, useMemo as L, useState as M, useCallback as E, useRef as $, useLayoutEffect as Mr } from "react";
3
- import { PiChatPanel as Cr, usePiSessions as Wr } from "@hachej/boring-agent/front";
4
- import { at as Fr, aG as ze, aH as _n, aI as On, aJ as Ln, aK as xn, aL as ke, aM as St, aN as vt, aO as Mn, aP as Ir, aQ as Ve, O as Gr, q as $r, aR as bn, aS as Ur, U as yn, aT as Kr, w as Hr, u as Cn, aU as Jr, aq as qr, aV as jr } from "./WorkspaceProvider-Bp1Sm40K.js";
5
- import { T as Br, C as Vr, r as Pn, w as zr, W as En } from "./WorkspaceLoadingState-BYTO4wdt.js";
6
- import { Sun as kr, Moon as Yr } from "lucide-react";
7
- import { IconButton as Qr, ErrorState as Xr } from "@hachej/boring-ui-kit";
8
- function Zr() {
9
- const { theme: e, toggleTheme: n } = Fr(), r = e === "dark";
10
- return A(() => {
1
+ import { jsx as f, jsxs as Re, Fragment as fe } from "react/jsx-runtime";
2
+ import { useEffect as E, useSyncExternalStore as Wr, useMemo as L, useState as x, useCallback as R, useRef as $, useLayoutEffect as Fr } from "react";
3
+ import { PiChatPanel as Ir, usePiSessions as Gr } from "@hachej/boring-agent/front";
4
+ import { at as $r, aG as Ye, aH as xn, aI as Mn, aJ as Cn, aK as Wn, aL as ke, aM as bt, aN as yt, aO as Fn, aP as Ur, aQ as ze, O as Kr, q as Hr, aR as En, aS as Jr, U as An, aT as qr, w as jr, u as In, aU as Br, aq as Vr, aV as zr } from "./WorkspaceProvider-Bp1Sm40K.js";
5
+ import { T as Yr, C as kr, r as Rn, w as Qr, W as Tn } from "./WorkspaceLoadingState-BYTO4wdt.js";
6
+ import { Sun as Xr, Moon as Zr } from "lucide-react";
7
+ import { IconButton as es, ErrorState as ts } from "@hachej/boring-ui-kit";
8
+ function ns() {
9
+ const { theme: e, toggleTheme: n } = $r(), r = e === "dark";
10
+ return E(() => {
11
11
  typeof document > "u" || document.documentElement.classList.toggle("dark", r);
12
- }, [r]), /* @__PURE__ */ d(
13
- Qr,
12
+ }, [r]), /* @__PURE__ */ f(
13
+ es,
14
14
  {
15
15
  type: "button",
16
16
  variant: "ghost",
@@ -18,18 +18,18 @@ function Zr() {
18
18
  onClick: n,
19
19
  "aria-label": "Toggle theme",
20
20
  title: r ? "Switch to light theme" : "Switch to dark theme",
21
- children: r ? /* @__PURE__ */ d(kr, { className: "h-4 w-4" }) : /* @__PURE__ */ d(Yr, { className: "h-4 w-4" })
21
+ children: r ? /* @__PURE__ */ f(Xr, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Zr, { className: "h-4 w-4" })
22
22
  }
23
23
  );
24
24
  }
25
- function es() {
25
+ function rs() {
26
26
  const e = `s${Date.now()}`;
27
27
  return {
28
28
  sessions: [{ id: e, title: "New session", updatedAt: Date.now() }],
29
29
  activeId: e
30
30
  };
31
31
  }
32
- function ts(e, n) {
32
+ function ss(e, n) {
33
33
  var r;
34
34
  if (typeof localStorage > "u") return n();
35
35
  try {
@@ -43,18 +43,18 @@ function ts(e, n) {
43
43
  }
44
44
  return n();
45
45
  }
46
- function ns(e, n) {
46
+ function is(e, n) {
47
47
  if (!(typeof localStorage > "u"))
48
48
  try {
49
49
  localStorage.setItem(e, JSON.stringify(n));
50
50
  } catch {
51
51
  }
52
52
  }
53
- function rs(e = {}) {
54
- const n = e.storageKey ?? "workspace:sessions", r = e.initial ?? es;
55
- let s = ts(n, r);
53
+ function os(e = {}) {
54
+ const n = e.storageKey ?? "workspace:sessions", r = e.initial ?? rs;
55
+ let s = ss(n, r);
56
56
  const i = /* @__PURE__ */ new Set(), o = (c) => {
57
- s = c, ns(n, s), i.forEach((u) => u());
57
+ s = c, is(n, s), i.forEach((d) => d());
58
58
  };
59
59
  return {
60
60
  getState: () => s,
@@ -67,25 +67,25 @@ function rs(e = {}) {
67
67
  o({ ...s, activeId: c });
68
68
  },
69
69
  create() {
70
- const c = `s${Date.now()}`, u = {
70
+ const c = `s${Date.now()}`, d = {
71
71
  id: c,
72
72
  title: "New session",
73
73
  updatedAt: Date.now()
74
74
  };
75
- o({ sessions: [u, ...s.sessions], activeId: c });
75
+ o({ sessions: [d, ...s.sessions], activeId: c });
76
76
  },
77
77
  remove(c) {
78
- var y;
79
- const u = s.sessions.filter((b) => b.id !== c), v = s.activeId === c ? ((y = u[0]) == null ? void 0 : y.id) ?? "" : s.activeId;
80
- o({ sessions: u, activeId: v });
78
+ var P;
79
+ const d = s.sessions.filter((y) => y.id !== c), b = s.activeId === c ? ((P = d[0]) == null ? void 0 : P.id) ?? "" : s.activeId;
80
+ o({ sessions: d, activeId: b });
81
81
  }
82
82
  };
83
83
  }
84
- function ss(e) {
85
- return xr(e.subscribe, e.getState, e.getState);
84
+ function as(e) {
85
+ return Wr(e.subscribe, e.getState, e.getState);
86
86
  }
87
- const is = 500, os = 1e4;
88
- function An(e) {
87
+ const ls = 500, cs = 1e4;
88
+ function wn(e) {
89
89
  return new Promise((n, r) => {
90
90
  let s;
91
91
  const i = () => {
@@ -99,12 +99,12 @@ function An(e) {
99
99
  }
100
100
  s = globalThis.setTimeout(() => {
101
101
  i(), n();
102
- }, is), e.addEventListener("abort", o, { once: !0 });
102
+ }, ls), e.addEventListener("abort", o, { once: !0 });
103
103
  });
104
104
  }
105
- async function as(e) {
105
+ async function us(e) {
106
106
  const n = e.body;
107
- if (!n) return Ve(await ke(e));
107
+ if (!n) return ze(await ke(e));
108
108
  const r = n.getReader(), s = new TextDecoder();
109
109
  let i = "";
110
110
  try {
@@ -112,18 +112,18 @@ async function as(e) {
112
112
  const { done: o, value: c } = await r.read();
113
113
  if (c) {
114
114
  i += s.decode(c, { stream: !o });
115
- const u = Ve(i);
116
- if (u) return u;
115
+ const d = ze(i);
116
+ if (d) return d;
117
117
  }
118
118
  if (o)
119
- return i += s.decode(), Ve(i);
119
+ return i += s.decode(), ze(i);
120
120
  }
121
121
  } finally {
122
122
  await r.cancel().catch(() => {
123
123
  });
124
124
  }
125
125
  }
126
- function ls(e) {
126
+ function ds(e) {
127
127
  if (!((e == null ? void 0 : e.runtimeDependenciesState) !== "preparing" && (e == null ? void 0 : e.runtimeDependenciesState) !== "ready" && (e == null ? void 0 : e.runtimeDependenciesState) !== "failed"))
128
128
  return {
129
129
  state: e.runtimeDependenciesState,
@@ -131,13 +131,13 @@ function ls(e) {
131
131
  ...e.runtimeDependenciesRequirement ? { requirement: e.runtimeDependenciesRequirement } : {}
132
132
  };
133
133
  }
134
- async function cs(e) {
134
+ async function fs(e) {
135
135
  if (!e.ok) {
136
136
  const i = await ke(e);
137
- if (St(i)) return { status: "preparing" };
138
- throw new Error(vt(i) ?? `/api/v1/ready-status failed with ${e.status}`);
137
+ if (bt(i)) return { status: "preparing" };
138
+ throw new Error(yt(i) ?? `/api/v1/ready-status failed with ${e.status}`);
139
139
  }
140
- const n = await as(e), r = ls(n), s = Ir(n);
140
+ const n = await us(e), r = ds(n), s = Ur(n);
141
141
  if ((n == null ? void 0 : n.state) === "degraded" || (n == null ? void 0 : n.state) === "failed") {
142
142
  if (s && (r == null ? void 0 : r.state) === "failed")
143
143
  return { status: "ready", runtimeDependencies: r };
@@ -145,132 +145,132 @@ async function cs(e) {
145
145
  }
146
146
  return s ? { status: "ready", ...r ? { runtimeDependencies: r } : {} } : { status: "preparing", ...r ? { runtimeDependencies: r } : {} };
147
147
  }
148
- async function us({
148
+ async function gs({
149
149
  apiBaseUrl: e,
150
150
  path: n,
151
151
  headers: r,
152
152
  signal: s,
153
153
  workspaceId: i
154
154
  }) {
155
- const o = new AbortController(), c = globalThis.setTimeout(() => o.abort(new DOMException("Warmup attempt timed out", "TimeoutError")), os), u = () => o.abort(s.reason);
156
- s.aborted && u(), s.addEventListener("abort", u, { once: !0 });
155
+ const o = new AbortController(), c = globalThis.setTimeout(() => o.abort(new DOMException("Warmup attempt timed out", "TimeoutError")), cs), d = () => o.abort(s.reason);
156
+ s.aborted && d(), s.addEventListener("abort", d, { once: !0 });
157
157
  try {
158
- const v = await fetch(Ln(e, n), { headers: r, signal: o.signal });
159
- if (xn(n)) return await cs(v);
160
- const y = await ke(v);
161
- if (!v.ok) {
162
- const b = St(y);
163
- if (b) return { status: "preparing", ...b };
164
- throw new Error(vt(y) ?? `${n} failed with ${v.status}`);
158
+ const b = await fetch(Cn(e, n), { headers: r, signal: o.signal });
159
+ if (Wn(n)) return await fs(b);
160
+ const P = await ke(b);
161
+ if (!b.ok) {
162
+ const y = bt(P);
163
+ if (y) return { status: "preparing", ...y };
164
+ throw new Error(yt(P) ?? `${n} failed with ${b.status}`);
165
165
  }
166
- return y && typeof y == "object" && Mn(e, r["x-boring-workspace-id"] ?? i, n, y), { status: "ready" };
167
- } catch (v) {
168
- if (s.aborted) throw v;
169
- if (o.signal.aborted || v instanceof TypeError) return { status: "preparing" };
170
- throw v;
166
+ return P && typeof P == "object" && Fn(e, r["x-boring-workspace-id"] ?? i, n, P), { status: "ready" };
167
+ } catch (b) {
168
+ if (s.aborted) throw b;
169
+ if (o.signal.aborted || b instanceof TypeError) return { status: "preparing" };
170
+ throw b;
171
171
  } finally {
172
- globalThis.clearTimeout(c), s.removeEventListener("abort", u);
172
+ globalThis.clearTimeout(c), s.removeEventListener("abort", d);
173
173
  }
174
174
  }
175
- function ds({
175
+ function ms({
176
176
  workspaceId: e,
177
177
  requestHeaders: n,
178
178
  apiBaseUrl: r,
179
- preloadPaths: s = _n,
179
+ preloadPaths: s = xn,
180
180
  provisionWorkspace: i = !0,
181
181
  onStatusChange: o
182
182
  }) {
183
- return A(() => {
183
+ return E(() => {
184
184
  let c = !1;
185
- const u = new AbortController(), v = ze(e, n);
186
- async function y() {
187
- var b, q;
185
+ const d = new AbortController(), b = Ye(e, n);
186
+ async function P() {
187
+ var y, B;
188
188
  o == null || o({ status: "preparing" });
189
189
  try {
190
- const F = On(s, i), z = (p) => us({
190
+ const F = Mn(s, i), k = (h) => gs({
191
191
  apiBaseUrl: r,
192
- path: p,
193
- headers: v,
194
- signal: u.signal,
192
+ path: h,
193
+ headers: b,
194
+ signal: d.signal,
195
195
  workspaceId: e
196
196
  });
197
- let T = await Promise.all(F.map(async (p) => ({ path: p, result: await z(p) })));
198
- if (c || u.signal.aborted) return;
199
- let h = (b = T.find((p) => p.result.runtimeDependencies)) == null ? void 0 : b.result.runtimeDependencies, w = T.filter((p) => p.result.status === "preparing");
200
- for (; w.length > 0; ) {
201
- let p;
202
- for (const N of w)
203
- if (N.result.status === "preparing" && N.result.requirement) {
204
- p = N.result.requirement;
197
+ let w = await Promise.all(F.map(async (h) => ({ path: h, result: await k(h) })));
198
+ if (c || d.signal.aborted) return;
199
+ let S = (y = w.find((h) => h.result.runtimeDependencies)) == null ? void 0 : y.result.runtimeDependencies, N = w.filter((h) => h.result.status === "preparing");
200
+ for (; N.length > 0; ) {
201
+ let h;
202
+ for (const D of N)
203
+ if (D.result.status === "preparing" && D.result.requirement) {
204
+ h = D.result.requirement;
205
205
  break;
206
206
  }
207
- if (o == null || o({ status: "preparing", message: "Workspace is still preparing", ...p ? { requirement: p } : {} }), await An(u.signal), c || u.signal.aborted || (T = await Promise.all(w.map(async (N) => ({ path: N.path, result: await z(N.path) }))), c || u.signal.aborted)) return;
208
- h = ((q = T.find((N) => N.result.runtimeDependencies)) == null ? void 0 : q.result.runtimeDependencies) ?? h, w = T.filter((N) => N.result.status === "preparing");
207
+ if (o == null || o({ status: "preparing", message: "Workspace is still preparing", ...h ? { requirement: h } : {} }), await wn(d.signal), c || d.signal.aborted || (w = await Promise.all(N.map(async (D) => ({ path: D.path, result: await k(D.path) }))), c || d.signal.aborted)) return;
208
+ S = ((B = w.find((D) => D.result.runtimeDependencies)) == null ? void 0 : B.result.runtimeDependencies) ?? S, N = w.filter((D) => D.result.status === "preparing");
209
209
  }
210
- for (o == null || o({ status: "ready", ...h ? { runtimeDependencies: h } : {} }); (h == null ? void 0 : h.state) === "preparing"; ) {
211
- if (await An(u.signal), c || u.signal.aborted) return;
212
- const p = await z("/api/v1/ready-status");
213
- if (c || u.signal.aborted) return;
214
- h = p.runtimeDependencies, h && (o == null || o({ status: "ready", runtimeDependencies: h }));
210
+ for (o == null || o({ status: "ready", ...S ? { runtimeDependencies: S } : {} }); (S == null ? void 0 : S.state) === "preparing"; ) {
211
+ if (await wn(d.signal), c || d.signal.aborted) return;
212
+ const h = await k("/api/v1/ready-status");
213
+ if (c || d.signal.aborted) return;
214
+ S = h.runtimeDependencies, S && (o == null || o({ status: "ready", runtimeDependencies: S }));
215
215
  }
216
216
  } catch (F) {
217
- if (c || u.signal.aborted) return;
217
+ if (c || d.signal.aborted) return;
218
218
  o == null || o({
219
219
  status: "failed",
220
220
  message: F instanceof Error ? F.message : "Workspace failed to prepare"
221
221
  });
222
222
  }
223
223
  }
224
- return y(), () => {
225
- c = !0, u.abort();
224
+ return P(), () => {
225
+ c = !0, d.abort();
226
226
  };
227
227
  }, [r, o, s, i, n, e]), null;
228
228
  }
229
- function fs(e) {
229
+ function ps(e) {
230
230
  return typeof (e == null ? void 0 : e.id) == "string" ? e.id : null;
231
231
  }
232
- function Be(e, n, r) {
232
+ function Ve(e, n, r) {
233
233
  if (e.includes(r)) return e;
234
234
  const s = n ? e.indexOf(n) : -1, i = s >= 0 ? s + 1 : e.length;
235
235
  return [...e.slice(0, i), r, ...e.slice(i)];
236
236
  }
237
- function Rn(e, n, r) {
237
+ function Nn(e, n, r) {
238
238
  if (e.includes(r)) return e;
239
239
  if (e.length === 0) return [r];
240
240
  const s = n ? e.indexOf(n) : -1, i = s >= 0 ? s : 0;
241
241
  return e.map((o, c) => c === i ? r : o);
242
242
  }
243
- function gs(e, n) {
243
+ function hs(e, n) {
244
244
  return e.endsWith(":surface") ? e.slice(0, -8) : n;
245
245
  }
246
- function mt(e, n, r) {
247
- const [s, i] = M(() => Pn(e, n, r));
248
- A(() => {
249
- i(Pn(e, n, r));
246
+ function ht(e, n, r) {
247
+ const [s, i] = x(() => Rn(e, n, r));
248
+ E(() => {
249
+ i(Rn(e, n, r));
250
250
  }, [e, n, r]);
251
- const o = E(
251
+ const o = R(
252
252
  (c) => {
253
- i(c), zr(e, c, r);
253
+ i(c), Qr(e, c, r);
254
254
  },
255
255
  [r, e]
256
256
  );
257
257
  return [s, o];
258
258
  }
259
- const pt = {}, ms = [], Tn = { status: "preparing" }, wn = {
259
+ const St = {}, Ss = [], Dn = { status: "preparing" }, _n = {
260
260
  openTabs: [],
261
261
  activeTab: null
262
262
  };
263
- function ps({ status: e }) {
263
+ function vs({ status: e }) {
264
264
  const n = e.status === "ready" ? void 0 : e.requirement, r = e.status !== "failed", s = r ? n === "workspace-fs" ? "Preparing files…" : n === "sandbox-exec" ? "Preparing secure runtime…" : n === "ui-bridge" ? "Connecting workspace…" : "Preparing workspace…" : "Workspace workbench failed", i = e.status === "failed" ? e.message : "Chat is ready while files, tools, and workspace panels finish warming up.";
265
- return /* @__PURE__ */ d("div", { className: "flex h-full min-h-0 items-center justify-center bg-background px-6 text-center", children: /* @__PURE__ */ Ae("div", { className: "max-w-sm rounded-2xl border border-border bg-card p-5 shadow-sm", children: [
266
- r ? /* @__PURE__ */ d("div", { className: "mx-auto mb-3 h-7 w-7 rounded-full border-2 border-muted-foreground/20 border-t-foreground animate-spin", "aria-hidden": "true" }) : null,
267
- /* @__PURE__ */ d("div", { className: "text-sm font-semibold text-foreground", children: s }),
268
- /* @__PURE__ */ d("p", { className: "mt-2 text-sm text-muted-foreground", children: i }),
269
- e.status === "failed" ? /* @__PURE__ */ d("p", { className: "mt-3 text-xs text-muted-foreground", children: "Reload the workspace to retry." }) : null
265
+ return /* @__PURE__ */ f("div", { className: "flex h-full min-h-0 items-center justify-center bg-background px-6 text-center", children: /* @__PURE__ */ Re("div", { className: "max-w-sm rounded-2xl border border-border bg-card p-5 shadow-sm", children: [
266
+ r ? /* @__PURE__ */ f("div", { className: "mx-auto mb-3 h-7 w-7 rounded-full border-2 border-muted-foreground/20 border-t-foreground animate-spin", "aria-hidden": "true" }) : null,
267
+ /* @__PURE__ */ f("div", { className: "text-sm font-semibold text-foreground", children: s }),
268
+ /* @__PURE__ */ f("p", { className: "mt-2 text-sm text-muted-foreground", children: i }),
269
+ e.status === "failed" ? /* @__PURE__ */ f("p", { className: "mt-3 text-xs text-muted-foreground", children: "Reload the workspace to retry." }) : null
270
270
  ] }) });
271
271
  }
272
- function hs(e) {
273
- const n = e.workspaceId ?? Ss(e.requestHeaders) ?? e.storageKey, r = Wr({
272
+ function bs(e) {
273
+ const n = e.workspaceId ?? ys(e.requestHeaders) ?? e.storageKey, r = Gr({
274
274
  apiBaseUrl: e.apiBaseUrl,
275
275
  workspaceId: n,
276
276
  storageScope: n,
@@ -281,10 +281,10 @@ function hs(e) {
281
281
  });
282
282
  return { ...r, workspaceId: r.dataStorageScope };
283
283
  }
284
- function Ss(e) {
284
+ function ys(e) {
285
285
  return (e == null ? void 0 : e["x-boring-workspace-id"]) ?? (e == null ? void 0 : e["X-Boring-Workspace-Id"]) ?? null;
286
286
  }
287
- function vs(e) {
287
+ function Ps(e) {
288
288
  const n = e.reloaded ? "Extensions reloaded." : "Extensions will reload on the next message.", r = Array.isArray(e.diagnostics) ? e.diagnostics.map((s) => s.message).filter((s) => !!s) : [];
289
289
  return r.length > 0 ? `${n}
290
290
 
@@ -292,7 +292,7 @@ Warnings:
292
292
  ${r.join(`
293
293
  `)}` : n;
294
294
  }
295
- function bs(e) {
295
+ function Es(e) {
296
296
  var n;
297
297
  try {
298
298
  return ((n = globalThis.localStorage) == null ? void 0 : n.getItem(e)) ?? null;
@@ -300,12 +300,12 @@ function bs(e) {
300
300
  return null;
301
301
  }
302
302
  }
303
- function Nn(e, n) {
303
+ function On(e, n) {
304
304
  var r;
305
305
  try {
306
306
  const s = (r = globalThis.localStorage) == null ? void 0 : r.getItem(e);
307
307
  if (!s) return null;
308
- const i = JSON.parse(s), o = Array.isArray(i.ids) ? i.ids.filter((u) => typeof u == "string" && u.length > 0) : [];
308
+ const i = JSON.parse(s), o = Array.isArray(i.ids) ? i.ids.filter((d) => typeof d == "string" && d.length > 0) : [];
309
309
  if (o.length === 0) return null;
310
310
  const c = typeof i.activeId == "string" && o.includes(i.activeId) ? i.activeId : o[0];
311
311
  return { workspaceId: n, ids: o, activeId: c };
@@ -313,7 +313,7 @@ function Nn(e, n) {
313
313
  return null;
314
314
  }
315
315
  }
316
- function ys(e, n) {
316
+ function As(e, n) {
317
317
  var r, s;
318
318
  try {
319
319
  if (n.ids.length === 0) {
@@ -327,7 +327,7 @@ function ys(e, n) {
327
327
  } catch {
328
328
  }
329
329
  }
330
- function Dn(e, n) {
330
+ function Ln(e, n) {
331
331
  var r;
332
332
  try {
333
333
  const s = (r = globalThis.localStorage) == null ? void 0 : r.getItem(e);
@@ -338,7 +338,7 @@ function Dn(e, n) {
338
338
  return null;
339
339
  }
340
340
  }
341
- function Ps(e, n) {
341
+ function Rs(e, n) {
342
342
  var r, s;
343
343
  try {
344
344
  if (n.length === 0) {
@@ -349,27 +349,27 @@ function Ps(e, n) {
349
349
  } catch {
350
350
  }
351
351
  }
352
- function Es() {
353
- return /* @__PURE__ */ d("div", { className: "flex h-full min-h-0 items-center justify-center bg-background px-6 text-center", children: /* @__PURE__ */ Ae("div", { className: "max-w-sm rounded-2xl border border-border bg-card p-5 shadow-sm", children: [
354
- /* @__PURE__ */ d("div", { className: "mx-auto mb-3 h-7 w-7 rounded-full border-2 border-muted-foreground/20 border-t-foreground animate-spin", "aria-hidden": "true" }),
355
- /* @__PURE__ */ d("div", { className: "text-sm font-semibold text-foreground", children: "Loading sessions…" }),
356
- /* @__PURE__ */ d("p", { className: "mt-2 text-sm text-muted-foreground", children: "Finding this workspace’s saved chats." })
352
+ function Ts() {
353
+ return /* @__PURE__ */ f("div", { className: "flex h-full min-h-0 items-center justify-center bg-background px-6 text-center", children: /* @__PURE__ */ Re("div", { className: "max-w-sm rounded-2xl border border-border bg-card p-5 shadow-sm", children: [
354
+ /* @__PURE__ */ f("div", { className: "mx-auto mb-3 h-7 w-7 rounded-full border-2 border-muted-foreground/20 border-t-foreground animate-spin", "aria-hidden": "true" }),
355
+ /* @__PURE__ */ f("div", { className: "text-sm font-semibold text-foreground", children: "Loading sessions…" }),
356
+ /* @__PURE__ */ f("p", { className: "mt-2 text-sm text-muted-foreground", children: "Finding this workspace’s saved chats." })
357
357
  ] }) });
358
358
  }
359
- function As(e) {
359
+ function ws(e) {
360
360
  if (!e) return "/api/v1/ui";
361
361
  const n = e.replace(/\/$/, ""), r = "/api/v1/ui";
362
362
  return n.endsWith(r) ? n : `${n}${r}`;
363
363
  }
364
- function Rs(e) {
365
- return `${As(e)}/state`;
364
+ function Ns(e) {
365
+ return `${ws(e)}/state`;
366
366
  }
367
- function Ts(e) {
367
+ function Ds(e) {
368
368
  var s;
369
369
  const n = e.openTabs.find((i) => i.id === e.activeTab), r = (s = n == null ? void 0 : n.params) == null ? void 0 : s.path;
370
370
  return typeof r == "string" ? r : null;
371
371
  }
372
- function ws({
372
+ function _s({
373
373
  bridgeEndpoint: e,
374
374
  requestHeaders: n,
375
375
  navOpen: r,
@@ -377,34 +377,34 @@ function ws({
377
377
  surfaceReady: i,
378
378
  snapshot: o
379
379
  }) {
380
- const c = Cn(), u = $(null);
381
- return A(() => {
382
- var b;
380
+ const c = In(), d = $(null);
381
+ return E(() => {
382
+ var y;
383
383
  if (e === null || s && !i) return;
384
- (b = u.current) == null || b.abort();
385
- const v = new AbortController();
386
- u.current = v;
387
- const y = {
384
+ (y = d.current) == null || y.abort();
385
+ const b = new AbortController();
386
+ d.current = b;
387
+ const P = {
388
388
  v: 1,
389
389
  drawerOpen: r,
390
390
  workbenchOpen: s,
391
391
  openTabs: o.openTabs,
392
392
  activeTab: o.activeTab,
393
- activeFile: Ts(o),
394
- availablePanels: c.list().map((q) => q.id)
393
+ activeFile: Ds(o),
394
+ availablePanels: c.list().map((B) => B.id)
395
395
  };
396
- return fetch(Rs(e), {
396
+ return fetch(Ns(e), {
397
397
  method: "PUT",
398
398
  headers: { ...n, "Content-Type": "application/json" },
399
- body: JSON.stringify({ state: y, causedBy: "user" }),
400
- signal: v.signal
399
+ body: JSON.stringify({ state: P, causedBy: "user" }),
400
+ signal: b.signal
401
401
  }).catch(() => {
402
402
  }), () => {
403
- v.abort();
403
+ b.abort();
404
404
  };
405
405
  }, [e, r, c, n, o, s, i]), null;
406
406
  }
407
- function zs({
407
+ function Qs({
408
408
  workspaceId: e,
409
409
  chatPanel: n,
410
410
  useSessions: r,
@@ -412,498 +412,527 @@ function zs({
412
412
  sessionStorageKey: i,
413
413
  providerStorageKey: o,
414
414
  surfaceStorageKey: c,
415
- beforeShell: u,
416
- afterShell: v,
417
- panels: y,
418
- commands: b,
419
- catalogs: q,
415
+ beforeShell: d,
416
+ afterShell: b,
417
+ panels: P,
418
+ commands: y,
419
+ catalogs: B,
420
420
  plugins: F,
421
- excludeDefaults: z,
422
- capabilities: T,
423
- apiBaseUrl: h,
424
- authHeaders: w,
425
- apiTimeout: p,
426
- defaultTheme: N,
427
- onThemeChange: Wn,
428
- persistenceEnabled: bt,
429
- debug: Fn,
430
- bridgeEndpoint: Ye,
431
- fullPageBasePath: In,
432
- onAuthError: Gn,
433
- sessions: yt,
434
- activeSessionId: Pt,
435
- onSwitchSession: Et,
436
- onCreateSession: Qe,
437
- onDeleteSession: At,
438
- onActiveSessionIdChange: Re,
439
- appTitle: Rt = "Boring UI",
440
- workspaceLabel: $n,
441
- defaultSessionTitle: k = "New session",
442
- navEnabled: Tt = !0,
443
- defaultNavOpen: Un = !1,
444
- defaultSurfaceOpen: Kn,
445
- defaultWorkbenchLeftTab: Te,
446
- defaultWorkbenchLeftOpen: Xe,
447
- surfaceInitialPanels: wt,
448
- topBarLeft: Hn,
449
- topBarRight: Jn,
450
- showThemeToggle: qn = !0,
451
- chatParams: O,
452
- externalPlugins: jn,
453
- hotReloadEnabled: Bn,
454
- frontPluginHotReload: Vn,
455
- extraPanels: Nt,
456
- extraCommands: Dt,
457
- provisionWorkspace: Ze,
458
- bootPreloadPaths: zn,
459
- onWorkspaceWarmupStatusChange: we,
460
- onOpenNav: et,
461
- onOpenSurface: tt,
462
- surfaceButtonBottomOffset: kn,
463
- className: Yn
421
+ excludeDefaults: k,
422
+ capabilities: w,
423
+ apiBaseUrl: S,
424
+ authHeaders: N,
425
+ apiTimeout: h,
426
+ defaultTheme: D,
427
+ onThemeChange: Gn,
428
+ persistenceEnabled: Pt,
429
+ debug: $n,
430
+ bridgeEndpoint: Qe,
431
+ fullPageBasePath: Un,
432
+ onAuthError: Kn,
433
+ sessions: Et,
434
+ activeSessionId: At,
435
+ onSwitchSession: Rt,
436
+ onCreateSession: Xe,
437
+ onDeleteSession: Tt,
438
+ onActiveSessionIdChange: Te,
439
+ appTitle: wt = "Boring UI",
440
+ workspaceLabel: Hn,
441
+ defaultSessionTitle: Q = "New session",
442
+ navEnabled: Nt = !0,
443
+ defaultNavOpen: Jn = !1,
444
+ defaultSurfaceOpen: qn,
445
+ defaultWorkbenchLeftTab: we,
446
+ defaultWorkbenchLeftOpen: Ze,
447
+ surfaceInitialPanels: Dt,
448
+ topBarLeft: jn,
449
+ topBarRight: Bn,
450
+ showThemeToggle: Vn = !0,
451
+ chatParams: T,
452
+ externalPlugins: zn,
453
+ hotReloadEnabled: Yn,
454
+ frontPluginHotReload: kn,
455
+ extraPanels: _t,
456
+ extraCommands: Ot,
457
+ provisionWorkspace: et,
458
+ bootPreloadPaths: Qn,
459
+ onWorkspaceWarmupStatusChange: Ne,
460
+ onOpenNav: tt,
461
+ onOpenSurface: nt,
462
+ surfaceButtonBottomOffset: Xn,
463
+ className: Zn
464
464
  }) {
465
- var fn, gn;
466
- const _t = jn !== !1, Qn = _t ? Vn : !1, nt = _t ? Bn : !1, rt = o ?? `boring-ui-v2:layout:${e}`, I = c ?? `${rt}:surface`, Ne = gs(
465
+ var hn, Sn;
466
+ const Lt = zn !== !1, er = Lt ? kn : !1, rt = Lt ? Yn : !1, st = o ?? `boring-ui-v2:layout:${e}`, I = c ?? `${st}:surface`, De = hs(
467
467
  I,
468
- rt
469
- ), C = bt !== !1, De = i ?? `boring-workspace:sessions:${e}`, Y = L(
470
- () => ze(e, s ?? pt),
468
+ st
469
+ ), C = Pt !== !1, _e = i ?? `boring-workspace:sessions:${e}`, X = L(
470
+ () => Ye(e, s ?? St),
471
471
  [s, e]
472
- ), Xn = L(
473
- () => ze(e, { ...s ?? pt, ...w ?? pt }),
474
- [w, s, e]
475
- ), _e = L(
476
- () => rs({ storageKey: De }),
477
- [De]
478
- ), Ot = ss(_e), [Lt, Zn] = M(() => ({
472
+ ), tr = L(
473
+ () => Ye(e, { ...s ?? St, ...N ?? St }),
474
+ [N, s, e]
475
+ ), Oe = L(
476
+ () => os({ storageKey: _e }),
477
+ [_e]
478
+ ), xt = as(Oe), [Mt, nr] = x(() => ({
479
479
  workspaceId: e,
480
- status: Tn
481
- })), [Oe, st] = M(() => ({
480
+ status: Dn
481
+ })), [Le, it] = x(() => ({
482
482
  workspaceId: e,
483
483
  expired: !1
484
- })), [xt, Le] = M(() => ({
484
+ })), [Ct, xe] = x(() => ({
485
485
  workspaceId: e,
486
486
  creating: !1
487
- })), [Mt, xe] = M(() => ({
487
+ })), [Wt, Me] = x(() => ({
488
488
  workspaceId: e,
489
489
  failed: !1
490
- })), ge = `boring-workspace:chat-panes:${e}`, [D, B] = M(
491
- () => (C ? Nn(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
492
- ), [ie, Ct] = M(null);
493
- A(() => {
490
+ })), ge = `boring-workspace:chat-panes:${e}`, [_, Y] = x(
491
+ () => (C ? On(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
492
+ ), [ie, Ft] = x(null);
493
+ E(() => {
494
494
  if (!ie) return;
495
- const t = setTimeout(() => Ct(null), 700);
495
+ const t = setTimeout(() => Ft(null), 700);
496
496
  return () => clearTimeout(t);
497
497
  }, [ie]);
498
- const me = `boring-workspace:pinned-sessions:${e}`, [Wt, Ft] = M(
499
- () => (C ? Dn(me, e) : null) ?? { workspaceId: e, ids: [] }
500
- ), er = Wt.workspaceId === e ? Wt.ids : ms;
501
- A(() => {
502
- Ft((t) => t.workspaceId === e ? t : (C ? Dn(me, e) : null) ?? { workspaceId: e, ids: [] });
498
+ const me = `boring-workspace:pinned-sessions:${e}`, [It, Gt] = x(
499
+ () => (C ? Ln(me, e) : null) ?? { workspaceId: e, ids: [] }
500
+ ), rr = It.workspaceId === e ? It.ids : Ss;
501
+ E(() => {
502
+ Gt((t) => t.workspaceId === e ? t : (C ? Ln(me, e) : null) ?? { workspaceId: e, ids: [] });
503
503
  }, [me, C, e]);
504
- const tr = E((t) => {
505
- Ft((a) => {
506
- const l = a.workspaceId === e ? a.ids : [], g = l.includes(t) ? l.filter((S) => S !== t) : [t, ...l];
507
- return C && Ps(me, g), { workspaceId: e, ids: g };
504
+ const sr = R((t) => {
505
+ Gt((l) => {
506
+ const a = l.workspaceId === e ? l.ids : [], g = a.includes(t) ? a.filter((m) => m !== t) : [t, ...a];
507
+ return C && Rs(me, g), { workspaceId: e, ids: g };
508
508
  });
509
509
  }, [me, C, e]);
510
- A(() => {
511
- C && D.workspaceId === e && ys(ge, D);
512
- }, [D, ge, C, e]), A(() => {
513
- B((t) => t.workspaceId === e ? t : (C ? Nn(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null });
510
+ E(() => {
511
+ C && _.workspaceId === e && As(ge, _);
512
+ }, [_, ge, C, e]), E(() => {
513
+ Y((t) => t.workspaceId === e ? t : (C ? On(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null });
514
514
  }, [ge, C, e]);
515
- const Me = Lt.workspaceId === e ? Lt.status : Tn, nr = n ?? Cr, rr = r ?? hs, Q = !n || !!r, Ce = Q && Ze !== !1, it = () => {
516
- }, _ = rr({
517
- requestHeaders: Y,
518
- storageKey: De,
515
+ const Ce = Mt.workspaceId === e ? Mt.status : Dn, ir = n ?? Ir, or = r ?? bs, Z = !n || !!r, We = Z && et !== !1, ot = () => {
516
+ }, O = or({
517
+ requestHeaders: X,
518
+ storageKey: _e,
519
519
  workspaceId: e,
520
- apiBaseUrl: h,
521
- enabled: Ce
522
- }), [pe, sr] = M(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), It = Ce && _.workspaceId != null && _.workspaceId !== e, V = Ce && !_.loading && !_.error && !It, W = Ce && !V;
523
- A(() => {
524
- V && sr((t) => {
525
- const a = t.workspaceId === e, l = t.activeSessionId === _.activeSessionId, g = t.sessions.length === _.sessions.length && t.sessions.every((S, R) => {
526
- var re;
527
- return S.id === ((re = _.sessions[R]) == null ? void 0 : re.id);
520
+ apiBaseUrl: S,
521
+ enabled: We
522
+ }), [pe, ar] = x(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), $t = We && O.workspaceId != null && O.workspaceId !== e, q = We && !O.loading && !O.error && !$t, W = We && !q;
523
+ E(() => {
524
+ q && ar((t) => {
525
+ const l = t.workspaceId === e, a = t.activeSessionId === O.activeSessionId, g = t.sessions.length === O.sessions.length && t.sessions.every((m, v) => {
526
+ var H;
527
+ return m.id === ((H = O.sessions[v]) == null ? void 0 : H.id);
528
528
  });
529
- return a && l && g ? t : {
529
+ return l && a && g ? t : {
530
530
  workspaceId: e,
531
- sessions: _.sessions,
532
- activeSessionId: _.activeSessionId
531
+ sessions: O.sessions,
532
+ activeSessionId: O.activeSessionId
533
533
  };
534
534
  });
535
- }, [_.activeSessionId, _.sessions, V, e]);
536
- const We = W && pe.workspaceId === e && pe.sessions.length > 0, Fe = W ? bs(De) : null, Gt = W && !It ? _.activeSessionId ?? null : null, X = V ? _.sessions : We ? pe.sessions : [], ir = V ? _.activeSessionId : We ? pe.activeSessionId : null, f = Q && (V || We) ? _ : void 0, oe = yt !== void 0 || Pt !== void 0 || Et !== void 0 || Qe !== void 0 || At !== void 0, $t = Oe.workspaceId === e && Oe.expired, he = $(!1), Se = !!(V && f && !oe && X.length === 0 && !$t), or = xt.workspaceId === e && xt.creating, ar = Mt.workspaceId === e && Mt.failed, lr = !!(V && f && !oe && X.length === 0 && $t && !he.current && !ar), Ie = !!(W && _.loading && !_.error && Q && !oe && !We && !Fe && !Gt) || Se || or || lr;
537
- A(() => {
535
+ }, [O.activeSessionId, O.sessions, q, e]);
536
+ const Fe = W && pe.workspaceId === e && pe.sessions.length > 0, Ie = W ? Es(_e) : null, Ut = W && !$t ? O.activeSessionId ?? null : null, V = q ? O.sessions : Fe ? pe.sessions : [], lr = q ? O.activeSessionId : Fe ? pe.activeSessionId : null, u = Z && (q || Fe) ? O : void 0, oe = Et !== void 0 || At !== void 0 || Rt !== void 0 || Xe !== void 0 || Tt !== void 0, Kt = Le.workspaceId === e && Le.expired, he = $(!1), Se = !!(q && u && !oe && V.length === 0 && !Kt), cr = Ct.workspaceId === e && Ct.creating, ur = Wt.workspaceId === e && Wt.failed, dr = !!(q && u && !oe && V.length === 0 && Kt && !he.current && !ur), Ge = !!(W && O.loading && !O.error && Z && !oe && !Fe && !Ie && !Ut) || Se || cr || dr;
537
+ E(() => {
538
538
  if (!Se) {
539
- Oe.workspaceId !== e && st({ workspaceId: e, expired: !1 });
539
+ Le.workspaceId !== e && it({ workspaceId: e, expired: !1 });
540
540
  return;
541
541
  }
542
- st({ workspaceId: e, expired: !1 });
542
+ it({ workspaceId: e, expired: !1 });
543
543
  const t = globalThis.setTimeout(() => {
544
- st({ workspaceId: e, expired: !0 });
544
+ it({ workspaceId: e, expired: !0 });
545
545
  }, 2e3);
546
546
  return () => globalThis.clearTimeout(t);
547
- }, [Oe.workspaceId, Se, e]);
548
- const cr = f ? X.map((t) => ({
547
+ }, [Le.workspaceId, Se, e]);
548
+ const fr = u ? V.map((t) => ({
549
549
  ...t,
550
550
  title: t.title ?? "New session"
551
- })) : void 0, ur = Fe ? [{
552
- id: Fe,
551
+ })) : void 0, gr = Ie ? [{
552
+ id: Ie,
553
553
  title: "Loading sessions…",
554
554
  createdAt: (/* @__PURE__ */ new Date(0)).toISOString(),
555
555
  updatedAt: (/* @__PURE__ */ new Date(0)).toISOString(),
556
556
  turnCount: 0
557
- }] : [], U = f ? cr ?? [] : W ? ur : oe ? yt ?? [] : Ot.sessions, dr = f ? ir ?? null : W ? Fe ?? Gt : oe ? Pt ?? null : Ot.activeId, ae = (O == null ? void 0 : O.autoSubmitInitialDraft) === !0, Ge = ae && Q && !oe, [K, ve] = M(() => Ge ? null : void 0), Ut = $(e), le = $(!1);
558
- A(() => {
559
- if (Ut.current !== e) {
560
- Ut.current = e, le.current = !1, ve(Ge ? null : void 0);
557
+ }] : [], U = u ? fr ?? [] : W ? gr : oe ? Et ?? [] : xt.sessions, mr = u ? lr ?? null : W ? Ie ?? Ut : oe ? At ?? null : xt.activeId, ae = (T == null ? void 0 : T.autoSubmitInitialDraft) === !0, $e = ae && Z && !oe, [K, ve] = x(() => $e ? null : void 0), Ht = $(e), le = $(!1);
558
+ E(() => {
559
+ if (Ht.current !== e) {
560
+ Ht.current = e, le.current = !1, ve($e ? null : void 0);
561
561
  return;
562
562
  }
563
- Ge && K === void 0 && (le.current = !1, ve(null));
564
- }, [K, Ge, e]), A(() => {
565
- !f || K !== null || le.current || (le.current = !0, Promise.resolve(f.create({ title: k })).then((t) => {
563
+ $e && K === void 0 && (le.current = !1, ve(null));
564
+ }, [K, $e, e]), E(() => {
565
+ !u || K !== null || le.current || (le.current = !0, Promise.resolve(u.create({ title: Q })).then((t) => {
566
566
  if (typeof (t == null ? void 0 : t.id) != "string")
567
567
  throw new Error("auto_submit_session_create_failed");
568
568
  ve(t.id);
569
569
  }).catch(() => {
570
570
  le.current = !1, ve(void 0);
571
571
  }));
572
- }, [K, k, f]);
573
- const G = K !== void 0 ? K ?? null : dr, J = W ? it : (f == null ? void 0 : f.switch) ?? Et ?? _e.switchTo, $e = E((t) => (G && t !== G && Gr({ sessionId: G, reason: $r.sessionSwitch }), J(t)), [G, J]), ot = W ? it : f ? () => f.create() : Qe ? () => Qe() : () => _e.create(), Kt = W ? it : (f == null ? void 0 : f.delete) ?? At ?? _e.remove, Ht = E((t) => (f && X.length <= 1 && (he.current = !0), Kt(t)), [X.length, Kt, f]), fr = ((fn = U.find((t) => t.id === G)) == null ? void 0 : fn.title) ?? void 0, [gr, Jt] = mt(
574
- `${Ne}:drawer`,
575
- Un,
572
+ }, [K, Q, u]);
573
+ const G = K !== void 0 ? K ?? null : mr, j = W ? ot : (u == null ? void 0 : u.switch) ?? Rt ?? Oe.switchTo, Ue = R((t) => (G && t !== G && Kr({ sessionId: G, reason: Hr.sessionSwitch }), j(t)), [G, j]), at = W ? ot : u ? () => u.create() : Xe ? () => Xe() : () => Oe.create(), Jt = W ? ot : (u == null ? void 0 : u.delete) ?? Tt ?? Oe.remove, qt = R((t) => (u && V.length <= 1 && (he.current = !0), Jt(t)), [V.length, Jt, u]), pr = ((hn = U.find((t) => t.id === G)) == null ? void 0 : hn.title) ?? void 0, [hr, jt] = ht(
574
+ `${De}:drawer`,
575
+ Jn,
576
576
  C
577
- ), qt = Tt && gr, [Z, j] = mt(
577
+ ), Bt = Nt && hr, [ee, z] = ht(
578
578
  // Key must NOT match resolvedSurfaceStorageKey (which stores the dockview
579
579
  // layout JSON at the same ":surface" suffix). Writing "1"/"0" to the same
580
580
  // key corrupts the JSON and drops the persisted workbench layout on reload.
581
- `${Ne}:workbenchOpen`,
582
- Kn ?? !1,
581
+ `${De}:workbenchOpen`,
582
+ qn ?? !1,
583
583
  C
584
- ), [mr, at] = M(!1), [pr, be] = mt(
585
- `${Ne}:workbenchLeftOpen`,
586
- Xe ?? !1,
584
+ ), [Sr, lt] = x(!1), [vr, be] = ht(
585
+ `${De}:workbenchLeftOpen`,
586
+ Ze ?? !1,
587
587
  C
588
- ), [hr, Ue] = M(() => Xe ?? !1), Sr = Xe === !1 ? hr : pr, ye = $(!1), ee = $(null), te = $(Z), jt = $(I), lt = $(null), ct = $([]);
589
- jt.current = I;
590
- const [Bt, Vt] = M(() => ({
588
+ ), [br, Ke] = x(() => Ze ?? !1), yr = Ze === !1 ? br : vr, ye = $(!1), te = $(null), ne = $(ee), Vt = $(I), ct = $(null), ut = $([]);
589
+ Vt.current = I;
590
+ const [zt, Yt] = x(() => ({
591
591
  key: I,
592
- snapshot: wn
593
- })), vr = Bt.key === I ? Bt.snapshot : wn;
594
- A(() => {
595
- ye.current = !1, he.current = !1, Le({ workspaceId: e, creating: !1 }), xe({ workspaceId: e, failed: !1 });
596
- }, [e]), A(() => {
597
- at(!1), ct.current = [];
598
- }, [I]), A(() => {
599
- if (!(!f || f.loading) && !Se && K === void 0) {
600
- if (X.length > 0) {
601
- ye.current = !1, he.current = !1, Le((t) => t.workspaceId === e && t.creating ? { workspaceId: e, creating: !1 } : t), xe((t) => t.workspaceId === e && t.failed ? { workspaceId: e, failed: !1 } : t);
592
+ snapshot: _n
593
+ })), Pr = zt.key === I ? zt.snapshot : _n;
594
+ E(() => {
595
+ ye.current = !1, he.current = !1, xe({ workspaceId: e, creating: !1 }), Me({ workspaceId: e, failed: !1 });
596
+ }, [e]), E(() => {
597
+ lt(!1), ut.current = [];
598
+ }, [I]), E(() => {
599
+ if (!(!u || u.loading) && !Se && K === void 0) {
600
+ if (V.length > 0) {
601
+ ye.current = !1, he.current = !1, xe((t) => t.workspaceId === e && t.creating ? { workspaceId: e, creating: !1 } : t), Me((t) => t.workspaceId === e && t.failed ? { workspaceId: e, failed: !1 } : t);
602
602
  return;
603
603
  }
604
- he.current || ye.current || (ye.current = !0, Le({ workspaceId: e, creating: !0 }), xe({ workspaceId: e, failed: !1 }), Promise.resolve(f.create({ title: k })).catch(() => {
605
- ye.current = !1, Le({ workspaceId: e, creating: !1 }), xe({ workspaceId: e, failed: !0 });
604
+ he.current || ye.current || (ye.current = !0, xe({ workspaceId: e, creating: !0 }), Me({ workspaceId: e, failed: !1 }), Promise.resolve(u.create({ title: Q })).catch(() => {
605
+ ye.current = !1, xe({ workspaceId: e, creating: !1 }), Me({ workspaceId: e, failed: !0 });
606
606
  }));
607
607
  }
608
- }, [X.length, K, k, Se, f, e]), A(() => {
609
- te.current = Z;
610
- }, [Z]);
611
- const zt = E((t) => {
612
- lt.current = { key: I, api: t }, at(!0), Vt({
608
+ }, [V.length, K, Q, Se, u, e]), E(() => {
609
+ ne.current = ee;
610
+ }, [ee]);
611
+ const kt = R((t) => {
612
+ ct.current = { key: I, api: t }, lt(!0), Yt({
613
613
  key: I,
614
614
  snapshot: t.getSnapshot()
615
615
  });
616
- const a = ct.current.splice(0);
617
- for (const l of a) l(t);
618
- }, [I]), kt = E((t) => {
619
- ct.current.push(t);
620
- }, []), Yt = E((t) => {
621
- Vt({
616
+ const l = ut.current.splice(0);
617
+ for (const a of l) a(t);
618
+ }, [I]), Qt = R((t) => {
619
+ ut.current.push(t);
620
+ }, []), Xt = R((t) => {
621
+ Yt({
622
622
  key: I,
623
623
  snapshot: t
624
624
  });
625
- }, [I]), Ke = E(() => {
626
- const t = lt.current;
627
- return (t == null ? void 0 : t.key) === jt.current ? t.api : null;
628
- }, []), Qt = E(() => te.current, []), Xt = E(() => {
629
- te.current = !0, j(!0);
630
- }, [j]), Zt = E(() => {
631
- te.current = !0, j(!0), be(!0), Ue(!0);
632
- }, [j, be]), He = E(() => {
633
- te.current = !1, lt.current = null, at(!1), j(!1);
634
- }, [j]), en = $(/* @__PURE__ */ new Set()), tn = E((t) => {
635
- const a = t.meta;
636
- if (!a || a.openOnlyWhenSessionOpen !== !0) return !0;
637
- const l = typeof a.sessionId == "string" ? a.sessionId : null;
638
- return l ? en.current.has(l) : !1;
625
+ }, [I]), He = R(() => {
626
+ const t = ct.current;
627
+ return (t == null ? void 0 : t.key) === Vt.current ? t.api : null;
628
+ }, []), Zt = R(() => ne.current, []), en = R(() => {
629
+ ne.current = !0, z(!0);
630
+ }, [z]), tn = R(() => {
631
+ ne.current = !0, z(!0), be(!0), Ke(!0);
632
+ }, [z, be]), Je = R(() => {
633
+ ne.current = !1, ct.current = null, lt(!1), z(!1);
634
+ }, [z]), nn = $(/* @__PURE__ */ new Set()), rn = R((t) => {
635
+ const l = t.meta;
636
+ if (!l || l.openOnlyWhenSessionOpen !== !0) return !0;
637
+ const a = typeof l.sessionId == "string" ? l.sessionId : null;
638
+ return a ? nn.current.has(a) : !1;
639
639
  }, []), ce = L(() => ({
640
- surface: Ke,
641
- isWorkbenchOpen: Qt,
642
- openWorkbench: Xt,
643
- openWorkbenchSources: Zt,
644
- closeWorkbench: He,
645
- enqueue: kt,
646
- shouldOpenSurface: tn
647
- }), [Ke, Qt, Xt, Zt, He, kt, tn]), br = L(() => ({
648
- openFile: async (t) => (bn({ kind: "openFile", params: { path: t } }, ce), { seq: 0, status: "ok" }),
640
+ surface: He,
641
+ isWorkbenchOpen: Zt,
642
+ openWorkbench: en,
643
+ openWorkbenchSources: tn,
644
+ closeWorkbench: Je,
645
+ enqueue: Qt,
646
+ shouldOpenSurface: rn
647
+ }), [He, Zt, en, tn, Je, Qt, rn]), Er = L(() => ({
648
+ openFile: async (t) => (En({ kind: "openFile", params: { path: t } }, ce), { seq: 0, status: "ok" }),
649
649
  getActiveFile: () => {
650
650
  var t;
651
- return ((t = Ke()) == null ? void 0 : t.getSnapshot().activeTab) ?? null;
651
+ return ((t = He()) == null ? void 0 : t.getSnapshot().activeTab) ?? null;
652
652
  },
653
653
  select: () => () => {
654
654
  }
655
- }), [Ke, ce]), ue = L(
656
- () => (F == null ? void 0 : F.map(Ur)) ?? [],
655
+ }), [He, ce]), ue = L(
656
+ () => (F == null ? void 0 : F.map(Jr)) ?? [],
657
657
  [F]
658
- ), ut = L(
658
+ ), dt = L(
659
659
  () => ue.some((t) => t.registrations.leftTabs.length > 0),
660
660
  [ue]
661
- ), nn = L(
662
- () => ue.flatMap((t) => t.registrations.panels.map((a) => a.id)),
661
+ ), sn = L(
662
+ () => ue.flatMap((t) => t.registrations.panels.map((l) => l.id)),
663
663
  [ue]
664
- ), rn = L(() => {
664
+ ), on = L(() => {
665
665
  const t = {};
666
- for (const a of ue)
667
- for (const l of a.registrations.toolRenderers)
668
- t[l.id] = l.render;
666
+ for (const l of ue)
667
+ for (const a of l.registrations.toolRenderers)
668
+ t[a.id] = a.render;
669
669
  return t;
670
- }, [ue]), sn = L(
671
- () => [...Nt ?? [], ...nn],
672
- [Nt, nn]
673
- ), m = Q && !r && pe.workspaceId !== e ? "default" : G ?? (K !== void 0 ? "default" : ((gn = U[0]) == null ? void 0 : gn.id) ?? "default"), on = !(f != null && f.hasMore) && !W;
674
- A(() => {
675
- var re, mn;
676
- if (Ie) return;
677
- const t = ee.current, a = new Set(U.map((H) => H.id)), l = t ? t.createdId ?? (a.has(m) && !t.knownIds.has(m) ? m : ((re = U.find((H) => !t.knownIds.has(H.id))) == null ? void 0 : re.id) ?? null) : null;
678
- l && a.has(l) && (ee.current = null);
679
- const g = m === "default" && K !== void 0, S = on && a.size > 0 && !g, R = l ?? (S && !a.has(m) ? ((mn = U[0]) == null ? void 0 : mn.id) ?? m : m);
680
- B((H) => {
681
- const se = H.workspaceId === e ? H : { workspaceId: e, ids: [], activeId: null };
682
- if (W && se.ids.length > 0 && !l) return se;
683
- const pn = se.ids.length > 0 ? se.ids : [R], hn = S ? pn.filter((je) => a.has(je) || je === l) : pn, de = hn.length > 0 ? hn : [R], Sn = se.activeId && de.includes(se.activeId) ? se.activeId : de[0] ?? R, Ee = l ? Be(de, t == null ? void 0 : t.afterId, l) : R === Sn || de.includes(R) ? de : Rn(de, Sn, R), vn = Ee.includes(R) ? R : Ee[0] ?? R;
684
- return H.workspaceId === e && H.activeId === vn && H.ids.length === Ee.length && H.ids.every((je, Lr) => je === Ee[Lr]) ? H : { workspaceId: e, ids: Ee, activeId: vn };
670
+ }, [ue]), an = L(
671
+ () => [..._t ?? [], ...sn],
672
+ [_t, sn]
673
+ ), p = Z && !r && pe.workspaceId !== e ? "default" : G ?? (K !== void 0 ? "default" : ((Sn = U[0]) == null ? void 0 : Sn.id) ?? "default"), ln = !(u != null && u.hasMore) && !W;
674
+ E(() => {
675
+ var H, Ee;
676
+ if (Ge) return;
677
+ const t = te.current, l = new Set(U.map((J) => J.id)), a = t ? t.createdId ?? (l.has(p) && !t.knownIds.has(p) ? p : ((H = U.find((J) => !t.knownIds.has(J.id))) == null ? void 0 : H.id) ?? null) : null;
678
+ a && l.has(a) && (te.current = null);
679
+ const g = p === "default" && K !== void 0, m = ln && l.size > 0 && !g, v = a ?? (m && !l.has(p) ? ((Ee = U[0]) == null ? void 0 : Ee.id) ?? p : p);
680
+ Y((J) => {
681
+ const se = J.workspaceId === e ? J : { workspaceId: e, ids: [], activeId: null };
682
+ if (W && se.ids.length > 0 && !a) return se;
683
+ const vn = se.ids.length > 0 ? se.ids : [v], bn = m ? vn.filter((Be) => l.has(Be) || Be === a) : vn, de = bn.length > 0 ? bn : [v], yn = se.activeId && de.includes(se.activeId) ? se.activeId : de[0] ?? v, Ae = a ? Ve(de, t == null ? void 0 : t.afterId, a) : v === yn || de.includes(v) ? de : Nn(de, yn, v), Pn = Ae.includes(v) ? v : Ae[0] ?? v;
684
+ return J.workspaceId === e && J.activeId === Pn && J.ids.length === Ae.length && J.ids.every((Be, Cr) => Be === Ae[Cr]) ? J : { workspaceId: e, ids: Ae, activeId: Pn };
685
685
  });
686
- }, [K, m, W, Ie, U, on, e]);
687
- const an = L(() => {
686
+ }, [K, p, W, Ge, U, ln, e]);
687
+ const cn = L(() => {
688
688
  const t = /* @__PURE__ */ new Map();
689
- for (const a of U) t.set(a.id, a.title);
689
+ for (const l of U) t.set(l.id, l.title);
690
+ return t;
691
+ }, [U]), [ft, un] = x(() => ({
692
+ workspaceId: e,
693
+ ids: /* @__PURE__ */ new Set()
694
+ })), dn = L(() => {
695
+ const t = /* @__PURE__ */ new Set();
696
+ if (!q) return t;
697
+ const l = ft.workspaceId === e ? ft.ids : /* @__PURE__ */ new Set();
698
+ for (const a of V)
699
+ a.turnCount === 0 && !l.has(a.id) && t.add(a.id);
690
700
  return t;
691
- }, [U]), dt = D.workspaceId === e ? D : { ids: [], activeId: null }, ne = dt.ids.length > 0 ? dt.ids : [m];
692
- A(() => {
693
- en.current = new Set(ne);
694
- }, [ne]);
695
- const Pe = dt.activeId ?? ne[0] ?? m, yr = E((t) => {
696
- const l = (D.workspaceId === e ? D : { ids: [m] }).ids.includes(t);
697
- return B((g) => {
698
- const S = g.workspaceId === e ? g : { ids: [m], activeId: m }, R = S.ids.includes(t) ? S.ids : Rn(S.ids, S.activeId, t);
699
- return { workspaceId: e, ids: R, activeId: t };
700
- }), l ? J(t) : $e(t);
701
- }, [D, m, J, $e, e]), Pr = E((t) => (B((a) => {
702
- const l = a.workspaceId === e ? a : { ids: [m], activeId: m };
701
+ }, [V, ft, q, e]);
702
+ E(() => {
703
+ un((t) => t.workspaceId === e ? t : { workspaceId: e, ids: /* @__PURE__ */ new Set() });
704
+ }, [e]);
705
+ const gt = _.workspaceId === e ? _ : { ids: [], activeId: null }, re = gt.ids.length > 0 ? gt.ids : [p];
706
+ E(() => {
707
+ nn.current = new Set(re);
708
+ }, [re]);
709
+ const Pe = gt.activeId ?? re[0] ?? p, Ar = R((t) => {
710
+ const a = (_.workspaceId === e ? _ : { ids: [p] }).ids.includes(t);
711
+ return Y((g) => {
712
+ const m = g.workspaceId === e ? g : { ids: [p], activeId: p }, v = m.ids.includes(t) ? m.ids : Nn(m.ids, m.activeId, t);
713
+ return { workspaceId: e, ids: v, activeId: t };
714
+ }), a ? j(t) : Ue(t);
715
+ }, [_, p, j, Ue, e]), Rr = R((t) => (Y((l) => {
716
+ const a = l.workspaceId === e ? l : { ids: [p], activeId: p };
703
717
  return {
704
718
  workspaceId: e,
705
- ids: l.ids.includes(t) ? l.ids : Be(l.ids, l.activeId, t),
719
+ ids: a.ids.includes(t) ? a.ids : Ve(a.ids, a.activeId, t),
706
720
  activeId: t
707
721
  };
708
- }), J(t)), [m, J, e]), ln = E((t) => ((D.workspaceId === e ? D : { ids: [m] }).ids.includes(t) && Ct({ workspaceId: e, id: t }), B((l) => {
709
- const g = l.workspaceId === e ? l : { ids: [m], activeId: m };
722
+ }), j(t)), [p, j, e]), fn = R((t) => ((_.workspaceId === e ? _ : { ids: [p] }).ids.includes(t) && Ft({ workspaceId: e, id: t }), Y((a) => {
723
+ const g = a.workspaceId === e ? a : { ids: [p], activeId: p };
710
724
  return {
711
725
  workspaceId: e,
712
- ids: Be(g.ids, g.activeId, t),
726
+ ids: Ve(g.ids, g.activeId, t),
713
727
  activeId: t
714
728
  };
715
- }), J(t)), [D, m, J, e]), Er = E((t) => {
716
- const a = D.workspaceId === e ? D : { ids: [m], activeId: m };
717
- if (a.ids.length <= 1) return;
718
- const l = a.ids.indexOf(t);
719
- if (l < 0) return;
720
- const g = a.ids.filter((R) => R !== t), S = a.activeId === t ? g[Math.max(0, l - 1)] ?? g[0] ?? null : a.activeId;
721
- B({ workspaceId: e, ids: g, activeId: S }), S && a.activeId === t && J(S);
722
- }, [D, m, J, e]), Ar = E((t) => {
723
- const a = {
729
+ }), j(t)), [_, p, j, e]), Tr = R((t) => {
730
+ const l = _.workspaceId === e ? _ : { ids: [p], activeId: p };
731
+ if (l.ids.length <= 1) return;
732
+ const a = l.ids.indexOf(t);
733
+ if (a < 0) return;
734
+ const g = l.ids.filter((v) => v !== t), m = l.activeId === t ? g[Math.max(0, a - 1)] ?? g[0] ?? null : l.activeId;
735
+ Y({ workspaceId: e, ids: g, activeId: m }), m && l.activeId === t && j(m);
736
+ }, [_, p, j, e]), wr = R((t) => {
737
+ const l = {
724
738
  afterId: t,
725
739
  knownIds: new Set(U.map((g) => g.id))
726
740
  };
727
- ee.current = a;
728
- const l = ot();
729
- return Promise.resolve(l).then((g) => {
730
- const S = fs(g);
731
- S && (ee.current === a && (ee.current = { ...a, createdId: S }), B((R) => {
732
- const re = R.workspaceId === e ? R : { ids: [m] };
741
+ te.current = l;
742
+ const a = at();
743
+ return Promise.resolve(a).then((g) => {
744
+ const m = ps(g);
745
+ m && (te.current === l && (te.current = { ...l, createdId: m }), Y((v) => {
746
+ const H = v.workspaceId === e ? v : { ids: [p] };
733
747
  return {
734
748
  workspaceId: e,
735
- ids: Be(re.ids, t, S),
736
- activeId: S
749
+ ids: Ve(H.ids, t, m),
750
+ activeId: m
737
751
  };
738
752
  }));
739
753
  }).catch(() => {
740
- ee.current === a && (ee.current = null);
741
- }), l;
742
- }, [m, ot, U, e]), Rr = E((t) => {
743
- const a = D.workspaceId === e ? D : { ids: [m], activeId: m }, l = a.ids.indexOf(t);
744
- let g = a.activeId;
745
- if (l >= 0) {
746
- const S = a.ids.filter((R) => R !== t);
747
- g = a.activeId === t ? S[Math.max(0, l - 1)] ?? S[0] ?? null : a.activeId, B({ workspaceId: e, ids: S, activeId: g }), g && a.activeId === t && $e(g);
754
+ te.current === l && (te.current = null);
755
+ }), a;
756
+ }, [p, at, U, e]), Nr = R((t) => {
757
+ const l = _.workspaceId === e ? _ : { ids: [p], activeId: p }, a = l.ids.indexOf(t);
758
+ let g = l.activeId;
759
+ if (a >= 0) {
760
+ const m = l.ids.filter((v) => v !== t);
761
+ g = l.activeId === t ? m[Math.max(0, a - 1)] ?? m[0] ?? null : l.activeId, Y({ workspaceId: e, ids: m, activeId: g }), g && l.activeId === t && Ue(g);
748
762
  }
749
- return Ht(t);
750
- }, [D, m, Ht, $e, e]), [Tr, ft] = M(ae), cn = $(e);
751
- A(() => {
752
- if (cn.current !== e) {
753
- cn.current = e, ft(ae);
763
+ return qt(t);
764
+ }, [_, p, qt, Ue, e]), [Dr, mt] = x(ae), gn = $(e);
765
+ E(() => {
766
+ if (gn.current !== e) {
767
+ gn.current = e, mt(ae);
754
768
  return;
755
769
  }
756
- ae && ft(!0);
770
+ ae && mt(!0);
757
771
  }, [ae, e]);
758
- const un = ae && Q && !G, dn = !Tr && Ze !== !1 && (Q ? !!G : !0), wr = E((t) => {
759
- Zn({ workspaceId: e, status: t }), we == null || we(t);
760
- }, [we, e]);
761
- A(() => {
762
- var a;
763
- const t = (l) => {
764
- const g = l.detail;
765
- !g || typeof g != "object" || bn(g, ce);
772
+ const mn = ae && Z && !G, pn = !Dr && et !== !1 && (Z ? !!G : !0), _r = R((t) => {
773
+ nr({ workspaceId: e, status: t }), Ne == null || Ne(t);
774
+ }, [Ne, e]);
775
+ E(() => {
776
+ var l;
777
+ const t = (a) => {
778
+ const g = a.detail;
779
+ !g || typeof g != "object" || En(g, ce);
766
780
  };
767
- return (a = globalThis.addEventListener) == null || a.call(globalThis, yn, t), () => {
768
- var l;
769
- return (l = globalThis.removeEventListener) == null ? void 0 : l.call(globalThis, yn, t);
781
+ return (l = globalThis.addEventListener) == null || l.call(globalThis, An, t), () => {
782
+ var a;
783
+ return (a = globalThis.removeEventListener) == null ? void 0 : a.call(globalThis, An, t);
770
784
  };
771
- }, [ce]), A(() => {
772
- W || Re == null || Re(G ?? null);
773
- }, [G, Re, W]);
774
- const gt = Me.status !== "ready", Nr = gt ? /* @__PURE__ */ d(ps, { status: Me }) : void 0, Je = E(async (t) => {
775
- const a = `${(h == null ? void 0 : h.replace(/\/$/, "")) ?? ""}/api/v1/agent/reload`;
785
+ }, [ce]), E(() => {
786
+ W || Te == null || Te(G ?? null);
787
+ }, [G, Te, W]);
788
+ const pt = Ce.status !== "ready", Or = pt ? /* @__PURE__ */ f(vs, { status: Ce }) : void 0, qe = R(async (t) => {
789
+ const l = `${(S == null ? void 0 : S.replace(/\/$/, "")) ?? ""}/api/v1/agent/reload`;
776
790
  try {
777
- const l = await fetch(a, {
791
+ const a = await fetch(l, {
778
792
  method: "POST",
779
- headers: { ...Y, "content-type": "application/json" },
793
+ headers: { ...X, "content-type": "application/json" },
780
794
  body: JSON.stringify({ sessionId: t })
781
795
  });
782
- if (!l.ok)
783
- return (await l.json().catch(() => ({}))).error || `reload failed (${l.status})`;
784
- const g = await l.json().catch(() => ({}));
785
- return window.dispatchEvent(new CustomEvent(Kr, { detail: g })), vs(g);
786
- } catch (l) {
787
- return l instanceof Error ? l.message : "Agent plugin reload failed.";
796
+ if (!a.ok)
797
+ return (await a.json().catch(() => ({}))).error || `reload failed (${a.status})`;
798
+ const g = await a.json().catch(() => ({}));
799
+ return window.dispatchEvent(new CustomEvent(qr, { detail: g })), Ps(g);
800
+ } catch (a) {
801
+ return a instanceof Error ? a.message : "Agent plugin reload failed.";
788
802
  }
789
- }, [h, Y]), qe = E(
790
- (t, a = {}) => {
791
- const l = a.bridgeEnabled ?? !0, g = O != null && O.toolRenderers && typeof O.toolRenderers == "object" ? O.toolRenderers : void 0;
803
+ }, [S, X]), je = R(
804
+ (t, l = {}) => {
805
+ const a = l.bridgeEnabled ?? !0, g = T != null && T.toolRenderers && typeof T.toolRenderers == "object" ? T.toolRenderers : void 0;
792
806
  return {
793
- ...O,
794
- ...un ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
807
+ ...T,
808
+ ...mn ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
795
809
  sessionId: t,
796
- apiBaseUrl: h,
810
+ apiBaseUrl: S,
797
811
  workspaceId: e,
798
812
  storageScope: e,
799
- requestHeaders: Y,
813
+ requestHeaders: X,
800
814
  showSessions: !1,
801
- onReloadAgentPlugins: (O == null ? void 0 : O.onReloadAgentPlugins) ?? (() => Je(t)),
802
- toolRenderers: { ...rn, ...g ?? {} },
803
- bridgeEndpoint: l ? Ye : null,
815
+ onReloadAgentPlugins: (T == null ? void 0 : T.onReloadAgentPlugins) ?? (() => qe(t)),
816
+ toolRenderers: { ...on, ...g ?? {} },
817
+ bridgeEndpoint: a ? Qe : null,
804
818
  surfaceDispatch: ce,
805
- extraCommands: Dt,
806
- workspaceWarmupStatus: Me,
807
- hydrateMessages: dn,
819
+ extraCommands: Ot,
820
+ workspaceWarmupStatus: Ce,
821
+ hydrateMessages: pn,
822
+ allowPromptDuringInitialHydration: dn.has(t),
823
+ onPromptSubmitStarted: ({ sessionId: m }) => {
824
+ un((v) => {
825
+ const H = v.workspaceId === e ? v.ids : /* @__PURE__ */ new Set();
826
+ if (H.has(m)) return v.workspaceId === e ? v : { workspaceId: e, ids: H };
827
+ const Ee = new Set(H);
828
+ return Ee.add(m), { workspaceId: e, ids: Ee };
829
+ });
830
+ },
831
+ onTurnComplete: () => {
832
+ var v;
833
+ (v = u == null ? void 0 : u.refresh) == null || v.call(u, { background: !0 });
834
+ const m = T == null ? void 0 : T.onTurnComplete;
835
+ typeof m == "function" && m();
836
+ },
808
837
  onAutoSubmitInitialDraftSettled: () => {
809
- le.current = !1, ft(!1), ve(void 0);
810
- const S = O == null ? void 0 : O.onAutoSubmitInitialDraftSettled;
811
- typeof S == "function" && S();
838
+ le.current = !1, mt(!1), ve(void 0);
839
+ const m = T == null ? void 0 : T.onAutoSubmitInitialDraftSettled;
840
+ typeof m == "function" && m();
812
841
  },
813
842
  // Forward the explicit prop when set. Omitting the key (when undefined)
814
843
  // lets ChatPanel apply its own default (true) and avoids overriding a
815
844
  // value passed through chatParams.
816
- ...nt !== void 0 ? { hotReloadEnabled: nt } : {}
845
+ ...rt !== void 0 ? { hotReloadEnabled: rt } : {}
817
846
  };
818
847
  },
819
- [h, O, un, Y, Ye, ce, Dt, Me, dn, nt, rn, Je, e]
820
- ), Dr = L(
821
- () => qe(m),
822
- [m, qe]
823
- ), _r = L(() => ne.map((t) => ({
848
+ [S, T, mn, X, Qe, ce, Ot, Ce, pn, dn, rt, on, qe, u, e]
849
+ ), Lr = L(
850
+ () => je(p),
851
+ [p, je]
852
+ ), xr = L(() => re.map((t) => ({
824
853
  id: t,
825
- title: an.get(t) ?? (t === "default" ? k : t),
854
+ title: cn.get(t) ?? (t === "default" ? Q : t),
826
855
  panel: "chat",
827
- params: qe(t, { bridgeEnabled: t === Pe })
828
- })), [Pe, ne, k, qe, an]), Or = L(() => ({
856
+ params: je(t, { bridgeEnabled: t === Pe })
857
+ })), [Pe, re, Q, je, cn]), Mr = L(() => ({
829
858
  storageKey: I,
830
- defaultLeftTab: Te,
831
- initialPanels: wt,
832
- extraPanels: sn,
833
- onReloadAgentPlugins: () => Je(G ?? m),
834
- onReady: zt,
835
- onChange: Yt,
836
- onClose: He
859
+ defaultLeftTab: we,
860
+ initialPanels: Dt,
861
+ extraPanels: an,
862
+ onReloadAgentPlugins: () => qe(G ?? p),
863
+ onReady: kt,
864
+ onChange: Xt,
865
+ onClose: Je
837
866
  }), [
838
- He,
839
- Te,
840
- wt,
841
867
  Je,
868
+ we,
869
+ Dt,
870
+ qe,
842
871
  G,
843
- m,
844
- Yt,
845
- zt,
872
+ p,
873
+ Xt,
874
+ kt,
846
875
  I,
847
- sn,
848
- j
876
+ an,
877
+ z
849
878
  ]);
850
- return /* @__PURE__ */ d("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ Ae(
851
- Hr,
879
+ return /* @__PURE__ */ f("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ Re(
880
+ jr,
852
881
  {
853
- chatPanel: nr,
854
- panels: y,
855
- commands: b,
856
- catalogs: q,
882
+ chatPanel: ir,
883
+ panels: P,
884
+ commands: y,
885
+ catalogs: B,
857
886
  plugins: F,
858
- excludeDefaults: z,
859
- capabilities: T,
860
- apiBaseUrl: h,
861
- authHeaders: Xn,
862
- apiTimeout: p,
887
+ excludeDefaults: k,
888
+ capabilities: w,
889
+ apiBaseUrl: S,
890
+ authHeaders: tr,
891
+ apiTimeout: h,
863
892
  activeSessionId: Pe,
864
- openSessionIds: ne,
865
- defaultTheme: N,
866
- onThemeChange: Wn,
893
+ openSessionIds: re,
894
+ defaultTheme: D,
895
+ onThemeChange: Gn,
867
896
  workspaceId: e,
868
- workspaceLabel: $n,
869
- appTitle: Rt,
870
- storageKey: rt,
871
- persistenceEnabled: bt,
872
- debug: Fn,
897
+ workspaceLabel: Hn,
898
+ appTitle: wt,
899
+ storageKey: st,
900
+ persistenceEnabled: Pt,
901
+ debug: $n,
873
902
  bridgeEndpoint: null,
874
- onAuthError: Gn,
875
- frontPluginHotReload: Qn,
876
- fullPageBasePath: In,
903
+ onAuthError: Kn,
904
+ frontPluginHotReload: er,
905
+ fullPageBasePath: Un,
877
906
  children: [
878
- u,
879
- /* @__PURE__ */ d(
880
- ds,
907
+ d,
908
+ /* @__PURE__ */ f(
909
+ ms,
881
910
  {
882
911
  workspaceId: e,
883
- requestHeaders: Y,
884
- apiBaseUrl: h,
885
- preloadPaths: zn,
886
- provisionWorkspace: Ze,
887
- onStatusChange: wr
912
+ requestHeaders: X,
913
+ apiBaseUrl: S,
914
+ preloadPaths: Qn,
915
+ provisionWorkspace: et,
916
+ onStatusChange: _r
888
917
  }
889
918
  ),
890
- /* @__PURE__ */ d(
891
- ws,
919
+ /* @__PURE__ */ f(
920
+ _s,
892
921
  {
893
- bridgeEndpoint: Ye,
894
- requestHeaders: Y,
895
- navOpen: qt,
896
- surfaceOpen: Z,
897
- surfaceReady: mr,
898
- snapshot: vr
922
+ bridgeEndpoint: Qe,
923
+ requestHeaders: X,
924
+ navOpen: Bt,
925
+ surfaceOpen: ee,
926
+ surfaceReady: Sr,
927
+ snapshot: Pr
899
928
  }
900
929
  ),
901
- /* @__PURE__ */ Ae("div", { className: "flex h-full min-h-0 flex-col", children: [
902
- /* @__PURE__ */ d(
903
- Br,
930
+ /* @__PURE__ */ Re("div", { className: "flex h-full min-h-0 flex-col", children: [
931
+ /* @__PURE__ */ f(
932
+ Yr,
904
933
  {
905
- appTitle: Rt,
906
- sessionTitle: Ie ? "Loading sessions…" : fr ?? k,
934
+ appTitle: wt,
935
+ sessionTitle: Ge ? "Loading sessions…" : pr ?? Q,
907
936
  onCommandPalette: () => {
908
937
  document.dispatchEvent(new KeyboardEvent("keydown", {
909
938
  key: "k",
@@ -913,77 +942,77 @@ function zs({
913
942
  cancelable: !0
914
943
  }));
915
944
  },
916
- topBarLeft: Hn,
917
- topBarRight: /* @__PURE__ */ Ae(fe, { children: [
918
- qn ? /* @__PURE__ */ d(Zr, {}) : null,
919
- Jn
945
+ topBarLeft: jn,
946
+ topBarRight: /* @__PURE__ */ Re(fe, { children: [
947
+ Vn ? /* @__PURE__ */ f(ns, {}) : null,
948
+ Bn
920
949
  ] })
921
950
  }
922
951
  ),
923
- Ie ? /* @__PURE__ */ d(Es, {}) : /* @__PURE__ */ d(
924
- Vr,
952
+ Ge ? /* @__PURE__ */ f(Ts, {}) : /* @__PURE__ */ f(
953
+ kr,
925
954
  {
926
- className: Yn,
927
- nav: qt ? "session-list" : null,
955
+ className: Zn,
956
+ nav: Bt ? "session-list" : null,
928
957
  navParams: {
929
958
  sessions: U,
930
959
  activeId: Pe,
931
- openIds: ne,
932
- pinnedIds: er,
933
- onTogglePin: tr,
934
- onSwitch: yr,
935
- onOpenAsTab: ln,
936
- onCreate: ot,
937
- onDelete: Rr,
938
- onLoadMore: f == null ? void 0 : f.loadMore,
939
- hasMore: f == null ? void 0 : f.hasMore,
940
- loadingMore: f == null ? void 0 : f.loadingMore,
941
- onClose: () => Jt(!1)
960
+ openIds: re,
961
+ pinnedIds: rr,
962
+ onTogglePin: sr,
963
+ onSwitch: Ar,
964
+ onOpenAsTab: fn,
965
+ onCreate: at,
966
+ onDelete: Nr,
967
+ onLoadMore: u == null ? void 0 : u.loadMore,
968
+ hasMore: u == null ? void 0 : u.hasMore,
969
+ loadingMore: u == null ? void 0 : u.loadingMore,
970
+ onClose: () => jt(!1)
942
971
  },
943
972
  center: "chat",
944
- centerParams: Dr,
945
- chatPanes: _r,
973
+ centerParams: Lr,
974
+ chatPanes: xr,
946
975
  activeChatPaneId: Pe,
947
- onActiveChatPaneChange: Pr,
948
- onCloseChatPane: Er,
949
- onCreateChatPaneAfter: Ar,
950
- onDropChatSession: ln,
976
+ onActiveChatPaneChange: Rr,
977
+ onCloseChatPane: Tr,
978
+ onCreateChatPaneAfter: wr,
979
+ onDropChatSession: fn,
951
980
  flashChatPaneId: (ie == null ? void 0 : ie.workspaceId) === e ? ie.id : null,
952
- surface: Z ? "artifact-surface" : null,
953
- surfaceParams: Or,
954
- surfaceOverlay: Nr,
955
- sidebar: Z && !gt && ut && Sr ? "workbench-left" : null,
956
- sidebarParams: Z && !gt && ut ? {
957
- ...Te ? { defaultTab: Te } : {},
958
- bridge: br,
981
+ surface: ee ? "artifact-surface" : null,
982
+ surfaceParams: Mr,
983
+ surfaceOverlay: Or,
984
+ sidebar: ee && !pt && dt && yr ? "workbench-left" : null,
985
+ sidebarParams: ee && !pt && dt ? {
986
+ ...we ? { defaultTab: we } : {},
987
+ bridge: Er,
959
988
  onClose: () => {
960
- be(!1), Ue(!1);
989
+ be(!1), Ke(!1);
961
990
  },
962
991
  onCollapse: () => {
963
- be(!1), Ue(!1);
992
+ be(!1), Ke(!1);
964
993
  }
965
994
  } : void 0,
966
- storageKey: C ? Ne : void 0,
967
- onOpenNav: Tt ? () => {
968
- Jt(!0), et == null || et();
995
+ storageKey: C ? De : void 0,
996
+ onOpenNav: Nt ? () => {
997
+ jt(!0), tt == null || tt();
969
998
  } : void 0,
970
999
  onOpenSurface: () => {
971
- te.current = !0, j(!0), tt == null || tt();
1000
+ ne.current = !0, z(!0), nt == null || nt();
972
1001
  },
973
- surfaceButtonBottomOffset: kn,
974
- onOpenSidebar: ut ? () => {
975
- te.current = !0, j(!0), be(!0), Ue(!0);
1002
+ surfaceButtonBottomOffset: Xn,
1003
+ onOpenSidebar: dt ? () => {
1004
+ ne.current = !0, z(!0), be(!0), Ke(!0);
976
1005
  } : void 0
977
1006
  }
978
1007
  )
979
1008
  ] }),
980
- v
1009
+ b
981
1010
  ]
982
1011
  }
983
1012
  ) });
984
1013
  }
985
- const Ns = 500;
986
- function Ds(e) {
1014
+ const Os = 500;
1015
+ function Ls(e) {
987
1016
  return new Promise((n, r) => {
988
1017
  let s;
989
1018
  const i = () => {
@@ -997,80 +1026,80 @@ function Ds(e) {
997
1026
  }
998
1027
  s = globalThis.setTimeout(() => {
999
1028
  i(), n();
1000
- }, Ns), e.addEventListener("abort", o, { once: !0 });
1029
+ }, Os), e.addEventListener("abort", o, { once: !0 });
1001
1030
  });
1002
1031
  }
1003
- function ks({
1032
+ function Xs({
1004
1033
  workspaceId: e,
1005
1034
  requestHeaders: n,
1006
1035
  apiBaseUrl: r,
1007
- preloadPaths: s = _n,
1036
+ preloadPaths: s = xn,
1008
1037
  provisionWorkspace: i = !0,
1009
1038
  loadingFallback: o,
1010
1039
  errorFallback: c,
1011
- children: u
1040
+ children: d
1012
1041
  }) {
1013
- const [v, y] = M({
1042
+ const [b, P] = x({
1014
1043
  status: "loading",
1015
1044
  label: "Waking workspace runtime"
1016
1045
  });
1017
- return A(() => {
1018
- const b = new AbortController(), q = ze(e, n);
1019
- async function F(T) {
1020
- const h = await fetch(Ln(r, T), {
1021
- headers: q,
1022
- signal: b.signal
1023
- }), w = await ke(h);
1024
- if (!h.ok) {
1025
- if (St(w)) return "preparing";
1026
- throw new Error(vt(w) ?? `${T} failed with ${h.status}`);
1046
+ return E(() => {
1047
+ const y = new AbortController(), B = Ye(e, n);
1048
+ async function F(w) {
1049
+ const S = await fetch(Cn(r, w), {
1050
+ headers: B,
1051
+ signal: y.signal
1052
+ }), N = await ke(S);
1053
+ if (!S.ok) {
1054
+ if (bt(N)) return "preparing";
1055
+ throw new Error(yt(N) ?? `${w} failed with ${S.status}`);
1027
1056
  }
1028
- if (xn(T)) {
1029
- const N = Ve(w);
1030
- if ((N == null ? void 0 : N.state) === "degraded") throw new Error(N.message ?? "Workspace failed to prepare");
1057
+ if (Wn(w)) {
1058
+ const D = ze(N);
1059
+ if ((D == null ? void 0 : D.state) === "degraded") throw new Error(D.message ?? "Workspace failed to prepare");
1031
1060
  }
1032
- return Jr(T) !== null && w && typeof w == "object" && Mn(r, q["x-boring-workspace-id"] ?? e, T, w), "ready";
1061
+ return Br(w) !== null && N && typeof N == "object" && Fn(r, B["x-boring-workspace-id"] ?? e, w, N), "ready";
1033
1062
  }
1034
- async function z() {
1035
- y({ status: "loading", label: "Waking workspace runtime" });
1063
+ async function k() {
1064
+ P({ status: "loading", label: "Waking workspace runtime" });
1036
1065
  try {
1037
- const T = On(s, i);
1038
- let h = await Promise.all(T.map(async (p) => ({ path: p, status: await F(p) }))), w = h.filter((p) => p.status === "preparing").map((p) => p.path);
1039
- for (; w.length > 0; ) {
1040
- if (y({ status: "loading", label: "Workspace is still preparing" }), await Ds(b.signal), b.signal.aborted) return;
1041
- h = await Promise.all(w.map(async (p) => ({ path: p, status: await F(p) }))), w = h.filter((p) => p.status === "preparing").map((p) => p.path);
1066
+ const w = Mn(s, i);
1067
+ let S = await Promise.all(w.map(async (h) => ({ path: h, status: await F(h) }))), N = S.filter((h) => h.status === "preparing").map((h) => h.path);
1068
+ for (; N.length > 0; ) {
1069
+ if (P({ status: "loading", label: "Workspace is still preparing" }), await Ls(y.signal), y.signal.aborted) return;
1070
+ S = await Promise.all(N.map(async (h) => ({ path: h, status: await F(h) }))), N = S.filter((h) => h.status === "preparing").map((h) => h.path);
1042
1071
  }
1043
- b.signal.aborted || y({ status: "ready" });
1044
- } catch (T) {
1045
- if (b.signal.aborted) return;
1046
- y({
1072
+ y.signal.aborted || P({ status: "ready" });
1073
+ } catch (w) {
1074
+ if (y.signal.aborted) return;
1075
+ P({
1047
1076
  status: "error",
1048
- message: T instanceof Error ? T.message : "Unknown workspace boot error"
1077
+ message: w instanceof Error ? w.message : "Unknown workspace boot error"
1049
1078
  });
1050
1079
  }
1051
1080
  }
1052
- return z(), () => b.abort();
1053
- }, [r, s, i, n, e]), v.status === "ready" ? /* @__PURE__ */ d(fe, { children: u }) : v.status === "error" ? typeof c == "function" ? /* @__PURE__ */ d(fe, { children: c(v.message) }) : c ? /* @__PURE__ */ d(fe, { children: c }) : /* @__PURE__ */ d(
1054
- En,
1081
+ return k(), () => y.abort();
1082
+ }, [r, s, i, n, e]), b.status === "ready" ? /* @__PURE__ */ f(fe, { children: d }) : b.status === "error" ? typeof c == "function" ? /* @__PURE__ */ f(fe, { children: c(b.message) }) : c ? /* @__PURE__ */ f(fe, { children: c }) : /* @__PURE__ */ f(
1083
+ Tn,
1055
1084
  {
1056
1085
  title: "Workspace failed to open",
1057
- description: v.message,
1086
+ description: b.message,
1058
1087
  status: "Retry by reloading the page"
1059
1088
  }
1060
- ) : typeof o == "function" ? /* @__PURE__ */ d(fe, { children: o(v.label) }) : o ? /* @__PURE__ */ d(fe, { children: o }) : /* @__PURE__ */ d(
1061
- En,
1089
+ ) : typeof o == "function" ? /* @__PURE__ */ f(fe, { children: o(b.label) }) : o ? /* @__PURE__ */ f(fe, { children: o }) : /* @__PURE__ */ f(
1090
+ Tn,
1062
1091
  {
1063
1092
  title: "Opening workspace",
1064
1093
  description: "Preparing secure runtime, files, sessions, and layout.",
1065
- status: v.label
1094
+ status: b.label
1066
1095
  }
1067
1096
  );
1068
1097
  }
1069
- const _s = "FULL_PAGE_PANEL_MISSING_COMPONENT", Os = "FULL_PAGE_PANEL_INVALID_PARAMS_JSON", Ls = "FULL_PAGE_PANEL_PARAMS_NOT_OBJECT", xs = "FULL_PAGE_PANEL_UNKNOWN_COMPONENT", Ms = "FULL_PAGE_PANEL_NOT_SUPPORTED", Cs = "FULL_PAGE_PANEL_RENDER_FAILED";
1070
- function x() {
1098
+ const xs = "FULL_PAGE_PANEL_MISSING_COMPONENT", Ms = "FULL_PAGE_PANEL_INVALID_PARAMS_JSON", Cs = "FULL_PAGE_PANEL_PARAMS_NOT_OBJECT", Ws = "FULL_PAGE_PANEL_UNKNOWN_COMPONENT", Fs = "FULL_PAGE_PANEL_NOT_SUPPORTED", Is = "FULL_PAGE_PANEL_RENDER_FAILED";
1099
+ function M() {
1071
1100
  }
1072
- const Ws = { dispose: x }, P = () => Ws;
1073
- function Fs(e) {
1101
+ const Gs = { dispose: M }, A = () => Gs;
1102
+ function $s(e) {
1074
1103
  return {
1075
1104
  id: `full-page:${e}`,
1076
1105
  title: e,
@@ -1080,31 +1109,31 @@ function Fs(e) {
1080
1109
  width: 0,
1081
1110
  height: 0,
1082
1111
  location: { type: "grid", referenceGroup: void 0 },
1083
- setActive: x,
1112
+ setActive: M,
1084
1113
  setTitle: (n) => {
1085
1114
  document.title = n;
1086
1115
  },
1087
- setSize: x,
1116
+ setSize: M,
1088
1117
  close: () => {
1089
1118
  window.close();
1090
1119
  },
1091
- moveTo: x,
1092
- maximize: x,
1093
- exitMaximized: x,
1120
+ moveTo: M,
1121
+ maximize: M,
1122
+ exitMaximized: M,
1094
1123
  isMaximized: () => !1,
1095
- minimize: x,
1096
- onDidActiveChange: P,
1097
- onDidVisibilityChange: P,
1098
- onDidDimensionsChange: P,
1099
- onDidFocusChange: P,
1100
- onDidLocationChange: P,
1101
- onDidParametersChange: P,
1102
- onDidTitleChange: P,
1103
- onDidRenamed: P,
1104
- onWillFocus: P
1124
+ minimize: M,
1125
+ onDidActiveChange: A,
1126
+ onDidVisibilityChange: A,
1127
+ onDidDimensionsChange: A,
1128
+ onDidFocusChange: A,
1129
+ onDidLocationChange: A,
1130
+ onDidParametersChange: A,
1131
+ onDidTitleChange: A,
1132
+ onDidRenamed: A,
1133
+ onWillFocus: A
1105
1134
  };
1106
1135
  }
1107
- function Is() {
1136
+ function Us() {
1108
1137
  return {
1109
1138
  width: window.innerWidth,
1110
1139
  height: window.innerHeight,
@@ -1116,91 +1145,91 @@ function Is() {
1116
1145
  panels: [],
1117
1146
  groups: [],
1118
1147
  activeGroup: void 0,
1119
- addPanel: x,
1120
- addGroup: x,
1121
- removePanel: x,
1122
- removeGroup: x,
1148
+ addPanel: M,
1149
+ addGroup: M,
1150
+ removePanel: M,
1151
+ removeGroup: M,
1123
1152
  getPanel: () => {
1124
1153
  },
1125
1154
  getGroup: () => {
1126
1155
  },
1127
- moveGroupOrPanel: x,
1128
- fromJSON: x,
1156
+ moveGroupOrPanel: M,
1157
+ fromJSON: M,
1129
1158
  toJSON: () => ({}),
1130
- clear: x,
1131
- focus: x,
1132
- layout: x,
1133
- onDidLayoutChange: P,
1134
- onDidLayoutFromJSON: P,
1135
- onDidAddPanel: P,
1136
- onDidRemovePanel: P,
1137
- onDidActivePanelChange: P,
1138
- onDidAddGroup: P,
1139
- onDidRemoveGroup: P,
1140
- onDidActiveGroupChange: P,
1141
- onUnhandledDragOverEvent: P,
1142
- onDidDrop: P,
1143
- onWillDrop: P,
1144
- onWillDragGroup: P,
1145
- onWillDragPanel: P,
1146
- onDidActivePanelChange_: P
1159
+ clear: M,
1160
+ focus: M,
1161
+ layout: M,
1162
+ onDidLayoutChange: A,
1163
+ onDidLayoutFromJSON: A,
1164
+ onDidAddPanel: A,
1165
+ onDidRemovePanel: A,
1166
+ onDidActivePanelChange: A,
1167
+ onDidAddGroup: A,
1168
+ onDidRemoveGroup: A,
1169
+ onDidActiveGroupChange: A,
1170
+ onUnhandledDragOverEvent: A,
1171
+ onDidDrop: A,
1172
+ onWillDrop: A,
1173
+ onWillDragGroup: A,
1174
+ onWillDragPanel: A,
1175
+ onDidActivePanelChange_: A
1147
1176
  };
1148
1177
  }
1149
- function ht({ code: e, title: n, description: r }) {
1150
- return /* @__PURE__ */ d(
1178
+ function vt({ code: e, title: n, description: r }) {
1179
+ return /* @__PURE__ */ f(
1151
1180
  "div",
1152
1181
  {
1153
1182
  className: "flex min-h-screen items-center justify-center bg-background p-6 text-foreground",
1154
1183
  "data-testid": "full-page-error-state",
1155
1184
  "data-full-page-error-code": e,
1156
- children: /* @__PURE__ */ d(Xr, { className: "w-full max-w-lg", title: n, description: r })
1185
+ children: /* @__PURE__ */ f(ts, { className: "w-full max-w-lg", title: n, description: r })
1157
1186
  }
1158
1187
  );
1159
1188
  }
1160
- function Ys({ componentId: e, params: n = {} }) {
1161
- const r = Cn(), { errors: s } = qr(), i = r.get(e), o = r.getComponents()[e];
1162
- Mr(() => {
1189
+ function Zs({ componentId: e, params: n = {} }) {
1190
+ const r = In(), { errors: s } = Vr(), i = r.get(e), o = r.getComponents()[e];
1191
+ Fr(() => {
1163
1192
  document.title = (i == null ? void 0 : i.title) ?? e;
1164
1193
  }, [e, i == null ? void 0 : i.title]);
1165
1194
  const c = L(() => ({
1166
1195
  params: n,
1167
- api: Fs(e),
1168
- containerApi: Is(),
1196
+ api: $s(e),
1197
+ containerApi: Us(),
1169
1198
  className: "h-full"
1170
- }), [e, n]), u = L(() => {
1199
+ }), [e, n]), d = L(() => {
1171
1200
  if (!i) return null;
1172
- const v = i.pluginId ?? i.id;
1173
- for (let y = s.length - 1; y >= 0; y -= 1) {
1174
- const b = s[y];
1175
- if (b.contributionKind === "panel" && b.contributionId === e && b.pluginId === v)
1176
- return b;
1201
+ const b = i.pluginId ?? i.id;
1202
+ for (let P = s.length - 1; P >= 0; P -= 1) {
1203
+ const y = s[P];
1204
+ if (y.contributionKind === "panel" && y.contributionId === e && y.pluginId === b)
1205
+ return y;
1177
1206
  }
1178
1207
  return null;
1179
1208
  }, [e, s, i]);
1180
- return i ? !i.supportsFullPage || !o ? /* @__PURE__ */ d(
1181
- ht,
1209
+ return i ? !i.supportsFullPage || !o ? /* @__PURE__ */ f(
1210
+ vt,
1182
1211
  {
1183
- code: Ms,
1212
+ code: Fs,
1184
1213
  title: "Panel does not support full-page mode",
1185
1214
  description: `Panel "${e}" can render in the workspace, but it has not opted into the dedicated full-page pane route.`
1186
1215
  }
1187
- ) : u ? /* @__PURE__ */ d(
1188
- ht,
1216
+ ) : d ? /* @__PURE__ */ f(
1217
+ vt,
1189
1218
  {
1190
- code: Cs,
1219
+ code: Is,
1191
1220
  title: "Panel failed to render",
1192
- description: `Panel "${e}" crashed while rendering in full-page mode: ${u.error.message}`
1221
+ description: `Panel "${e}" crashed while rendering in full-page mode: ${d.error.message}`
1193
1222
  }
1194
- ) : /* @__PURE__ */ d("div", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ d(jr, { mode: "full-page", children: /* @__PURE__ */ d(o, { ...c }) }) }) : /* @__PURE__ */ d(
1195
- ht,
1223
+ ) : /* @__PURE__ */ f("div", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ f(zr, { mode: "full-page", children: /* @__PURE__ */ f(o, { ...c }) }) }) : /* @__PURE__ */ f(
1224
+ vt,
1196
1225
  {
1197
- code: xs,
1226
+ code: Ws,
1198
1227
  title: "Unknown panel",
1199
1228
  description: `No full-page panel component is registered as "${e}".`
1200
1229
  }
1201
1230
  );
1202
1231
  }
1203
- function Qs(e) {
1232
+ function ei(e) {
1204
1233
  var o;
1205
1234
  const n = new URLSearchParams(e), r = ((o = n.get("component")) == null ? void 0 : o.trim()) ?? "";
1206
1235
  if (!r)
@@ -1208,7 +1237,7 @@ function Qs(e) {
1208
1237
  componentId: null,
1209
1238
  params: {},
1210
1239
  error: {
1211
- code: _s,
1240
+ code: xs,
1212
1241
  message: "Missing full-page panel component id."
1213
1242
  }
1214
1243
  };
@@ -1223,7 +1252,7 @@ function Qs(e) {
1223
1252
  componentId: null,
1224
1253
  params: {},
1225
1254
  error: {
1226
- code: Os,
1255
+ code: Ms,
1227
1256
  message: "Invalid full-page panel params JSON."
1228
1257
  }
1229
1258
  };
@@ -1232,23 +1261,23 @@ function Qs(e) {
1232
1261
  componentId: null,
1233
1262
  params: {},
1234
1263
  error: {
1235
- code: Ls,
1264
+ code: Cs,
1236
1265
  message: "Full-page panel params must be a JSON object."
1237
1266
  }
1238
1267
  } : { componentId: r, params: i };
1239
1268
  }
1240
1269
  export {
1241
- Os as FULL_PAGE_PANEL_INVALID_PARAMS_JSON,
1242
- _s as FULL_PAGE_PANEL_MISSING_COMPONENT,
1243
- Ms as FULL_PAGE_PANEL_NOT_SUPPORTED,
1244
- Ls as FULL_PAGE_PANEL_PARAMS_NOT_OBJECT,
1245
- Cs as FULL_PAGE_PANEL_RENDER_FAILED,
1246
- xs as FULL_PAGE_PANEL_UNKNOWN_COMPONENT,
1247
- zs as WorkspaceAgentFront,
1248
- ds as WorkspaceBackgroundBoot,
1249
- ks as WorkspaceBootGate,
1250
- Ys as WorkspaceFullPagePanel,
1251
- rs as createLocalStorageSessions,
1252
- Qs as parseFullPagePanelLocation,
1253
- ss as useLocalStorageSessions
1270
+ Ms as FULL_PAGE_PANEL_INVALID_PARAMS_JSON,
1271
+ xs as FULL_PAGE_PANEL_MISSING_COMPONENT,
1272
+ Fs as FULL_PAGE_PANEL_NOT_SUPPORTED,
1273
+ Cs as FULL_PAGE_PANEL_PARAMS_NOT_OBJECT,
1274
+ Is as FULL_PAGE_PANEL_RENDER_FAILED,
1275
+ Ws as FULL_PAGE_PANEL_UNKNOWN_COMPONENT,
1276
+ Qs as WorkspaceAgentFront,
1277
+ ms as WorkspaceBackgroundBoot,
1278
+ Xs as WorkspaceBootGate,
1279
+ Zs as WorkspaceFullPagePanel,
1280
+ os as createLocalStorageSessions,
1281
+ ei as parseFullPagePanelLocation,
1282
+ as as useLocalStorageSessions
1254
1283
  };