@hachej/boring-workspace 0.1.57 → 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 Mr, useMemo as L, useState as x, useCallback as E, useRef as $, useLayoutEffect as Cr } from "react";
3
- import { PiChatPanel as Fr, usePiSessions as Wr } from "@hachej/boring-agent/front";
4
- import { at as Ir, aG as ze, aH as On, aI as Ln, aJ as xn, aK as Mn, aL as ke, aM as St, aN as vt, aO as Cn, aP as Gr, aQ as Ve, O as $r, q as Ur, aR as yn, aS as Kr, U as Pn, aT as Hr, w as Jr, u as Fn, aU as qr, aq as jr, aV as Br } from "./WorkspaceProvider-Bp1Sm40K.js";
5
- import { T as Vr, C as zr, r as En, w as kr, W as An } from "./WorkspaceLoadingState-BYTO4wdt.js";
6
- import { Sun as Yr, Moon as Qr } from "lucide-react";
7
- import { IconButton as Xr, ErrorState as Zr } from "@hachej/boring-ui-kit";
8
- function es() {
9
- const { theme: e, toggleTheme: n } = Ir(), 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
- Xr,
12
+ }, [r]), /* @__PURE__ */ f(
13
+ es,
14
14
  {
15
15
  type: "button",
16
16
  variant: "ghost",
@@ -18,18 +18,18 @@ function es() {
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(Yr, { className: "h-4 w-4" }) : /* @__PURE__ */ d(Qr, { 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 ts() {
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 ns(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 ns(e, n) {
43
43
  }
44
44
  return n();
45
45
  }
46
- function rs(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 ss(e = {}) {
54
- const n = e.storageKey ?? "workspace:sessions", r = e.initial ?? ts;
55
- let s = ns(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, rs(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 ss(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 is(e) {
85
- return Mr(e.subscribe, e.getState, e.getState);
84
+ function as(e) {
85
+ return Wr(e.subscribe, e.getState, e.getState);
86
86
  }
87
- const os = 500, as = 1e4;
88
- function Rn(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 Rn(e) {
99
99
  }
100
100
  s = globalThis.setTimeout(() => {
101
101
  i(), n();
102
- }, os), e.addEventListener("abort", o, { once: !0 });
102
+ }, ls), e.addEventListener("abort", o, { once: !0 });
103
103
  });
104
104
  }
105
- async function ls(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 ls(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 cs(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 cs(e) {
131
131
  ...e.runtimeDependenciesRequirement ? { requirement: e.runtimeDependenciesRequirement } : {}
132
132
  };
133
133
  }
134
- async function us(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 ls(e), r = cs(n), s = Gr(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 us(e) {
145
145
  }
146
146
  return s ? { status: "ready", ...r ? { runtimeDependencies: r } : {} } : { status: "preparing", ...r ? { runtimeDependencies: r } : {} };
147
147
  }
148
- async function ds({
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")), as), 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(xn(e, n), { headers: r, signal: o.signal });
159
- if (Mn(n)) return await us(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" && Cn(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 fs({
175
+ function ms({
176
176
  workspaceId: e,
177
177
  requestHeaders: n,
178
178
  apiBaseUrl: r,
179
- preloadPaths: s = On,
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 W = Ln(s, i), z = (p) => ds({
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(W.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 Rn(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 Rn(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
- } catch (W) {
217
- if (c || u.signal.aborted) return;
216
+ } catch (F) {
217
+ if (c || d.signal.aborted) return;
218
218
  o == null || o({
219
219
  status: "failed",
220
- message: W instanceof Error ? W.message : "Workspace failed to prepare"
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 gs(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 Tn(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 ms(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] = x(() => En(e, n, r));
248
- A(() => {
249
- i(En(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), kr(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 = {}, ps = [], wn = { status: "preparing" }, Nn = {
259
+ const St = {}, Ss = [], Dn = { status: "preparing" }, _n = {
260
260
  openTabs: [],
261
261
  activeTab: null
262
262
  };
263
- function hs({ 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 Ss(e) {
273
- const n = e.workspaceId ?? vs(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 Ss(e) {
281
281
  });
282
282
  return { ...r, workspaceId: r.dataStorageScope };
283
283
  }
284
- function vs(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 bs(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 ys(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 ys(e) {
300
300
  return null;
301
301
  }
302
302
  }
303
- function Dn(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 Dn(e, n) {
313
313
  return null;
314
314
  }
315
315
  }
316
- function Ps(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 Ps(e, n) {
327
327
  } catch {
328
328
  }
329
329
  }
330
- function _n(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 _n(e, n) {
338
338
  return null;
339
339
  }
340
340
  }
341
- function Es(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 Es(e, n) {
349
349
  } catch {
350
350
  }
351
351
  }
352
- function As() {
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 Rs(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 Ts(e) {
365
- return `${Rs(e)}/state`;
364
+ function Ns(e) {
365
+ return `${ws(e)}/state`;
366
366
  }
367
- function ws(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 Ns({
372
+ function _s({
373
373
  bridgeEndpoint: e,
374
374
  requestHeaders: n,
375
375
  navOpen: r,
@@ -377,34 +377,34 @@ function Ns({
377
377
  surfaceReady: i,
378
378
  snapshot: o
379
379
  }) {
380
- const c = Fn(), 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: ws(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(Ts(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 Ys({
407
+ function Qs({
408
408
  workspaceId: e,
409
409
  chatPanel: n,
410
410
  useSessions: r,
@@ -412,501 +412,527 @@ function Ys({
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,
420
- plugins: W,
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: In,
430
- bridgeEndpoint: Ye,
431
- fullPageBasePath: Gn,
432
- onAuthError: $n,
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: Un,
441
- defaultSessionTitle: k = "New session",
442
- navEnabled: Tt = !0,
443
- defaultNavOpen: Kn = !1,
444
- defaultSurfaceOpen: Hn,
445
- defaultWorkbenchLeftTab: Te,
446
- defaultWorkbenchLeftOpen: Xe,
447
- surfaceInitialPanels: wt,
448
- topBarLeft: Jn,
449
- topBarRight: qn,
450
- showThemeToggle: jn = !0,
451
- chatParams: O,
452
- externalPlugins: Bn,
453
- hotReloadEnabled: Vn,
454
- frontPluginHotReload: zn,
455
- extraPanels: Nt,
456
- extraCommands: Dt,
457
- provisionWorkspace: Ze,
458
- bootPreloadPaths: kn,
459
- onWorkspaceWarmupStatusChange: we,
460
- onOpenNav: et,
461
- onOpenSurface: tt,
462
- surfaceButtonBottomOffset: Yn,
463
- className: Qn
415
+ beforeShell: d,
416
+ afterShell: b,
417
+ panels: P,
418
+ commands: y,
419
+ catalogs: B,
420
+ plugins: F,
421
+ excludeDefaults: k,
422
+ capabilities: w,
423
+ apiBaseUrl: S,
424
+ authHeaders: N,
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 gn, mn;
466
- const _t = Bn !== !1, Xn = _t ? zn : !1, nt = _t ? Vn : !1, rt = o ?? `boring-ui-v2:layout:${e}`, I = c ?? `${rt}:surface`, Ne = ms(
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
- ), Zn = L(
473
- () => ze(e, { ...s ?? pt, ...w ?? pt }),
474
- [w, s, e]
475
- ), _e = L(
476
- () => ss({ storageKey: De }),
477
- [De]
478
- ), Ot = is(_e), [Lt, er] = x(() => ({
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: wn
481
- })), [Oe, st] = x(() => ({
480
+ status: Dn
481
+ })), [Le, it] = x(() => ({
482
482
  workspaceId: e,
483
483
  expired: !1
484
- })), [xt, Le] = x(() => ({
484
+ })), [Ct, xe] = x(() => ({
485
485
  workspaceId: e,
486
486
  creating: !1
487
- })), [Mt, xe] = x(() => ({
487
+ })), [Wt, Me] = x(() => ({
488
488
  workspaceId: e,
489
489
  failed: !1
490
- })), [$s, Ct] = x(null), ge = `boring-workspace:chat-panes:${e}`, [D, B] = x(
491
- () => (C ? Dn(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
490
+ })), ge = `boring-workspace:chat-panes:${e}`, [_, Y] = x(
491
+ () => (C ? On(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
492
492
  ), [ie, Ft] = x(null);
493
- A(() => {
493
+ E(() => {
494
494
  if (!ie) return;
495
495
  const t = setTimeout(() => Ft(null), 700);
496
496
  return () => clearTimeout(t);
497
497
  }, [ie]);
498
- const me = `boring-workspace:pinned-sessions:${e}`, [Wt, It] = x(
499
- () => (C ? _n(me, e) : null) ?? { workspaceId: e, ids: [] }
500
- ), tr = Wt.workspaceId === e ? Wt.ids : ps;
501
- A(() => {
502
- It((t) => t.workspaceId === e ? t : (C ? _n(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 nr = E((t) => {
505
- It((a) => {
506
- const l = a.workspaceId === e ? a.ids : [], g = l.includes(t) ? l.filter((S) => S !== t) : [t, ...l];
507
- return C && Es(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 && Ps(ge, D);
512
- }, [D, ge, C, e]), A(() => {
513
- B((t) => t.workspaceId === e ? t : (C ? Dn(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 : wn, rr = n ?? Fr, sr = r ?? Ss, Q = !n || !!r, Ce = Q && Ze !== !1, it = () => {
516
- }, _ = sr({
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, ir] = x(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), Gt = Ce && _.workspaceId != null && _.workspaceId !== e, V = Ce && !_.loading && !_.error && !Gt, F = Ce && !V;
523
- A(() => {
524
- V && ir((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 Fe = F && pe.workspaceId === e && pe.sessions.length > 0, We = F ? ys(De) : null, $t = F && !Gt ? _.activeSessionId ?? null : null, X = V ? _.sessions : Fe ? pe.sessions : [], or = V ? _.activeSessionId : Fe ? pe.activeSessionId : null, f = Q && (V || Fe) ? _ : void 0, oe = yt !== void 0 || Pt !== void 0 || Et !== void 0 || Qe !== void 0 || At !== void 0, Ut = Oe.workspaceId === e && Oe.expired, he = $(!1), Se = !!(V && f && !oe && X.length === 0 && !Ut), ar = xt.workspaceId === e && xt.creating, lr = Mt.workspaceId === e && Mt.failed, cr = !!(V && f && !oe && X.length === 0 && Ut && !he.current && !lr), Ie = !!(F && _.loading && !_.error && Q && !oe && !Fe && !We && !$t) || Se || ar || cr;
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 ur = 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, dr = We ? [{
552
- id: We,
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 ? ur ?? [] : F ? dr : oe ? yt ?? [] : Ot.sessions, fr = f ? or ?? null : F ? We ?? $t : oe ? Pt ?? null : Ot.activeId, ae = (O == null ? void 0 : O.autoSubmitInitialDraft) === !0, Ge = ae && Q && !oe, [K, ve] = x(() => Ge ? null : void 0), Kt = $(e), le = $(!1);
558
- A(() => {
559
- if (Kt.current !== e) {
560
- Kt.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 : fr, J = F ? it : (f == null ? void 0 : f.switch) ?? Et ?? _e.switchTo, $e = E((t) => (G && t !== G && $r({ sessionId: G, reason: Ur.sessionSwitch }), J(t)), [G, J]), ot = F ? it : f ? () => f.create() : Qe ? () => Qe() : () => _e.create(), Ht = F ? it : (f == null ? void 0 : f.delete) ?? At ?? _e.remove, Jt = E((t) => (f && X.length <= 1 && (he.current = !0), Ht(t)), [X.length, Ht, f]), gr = ((gn = U.find((t) => t.id === G)) == null ? void 0 : gn.title) ?? void 0, [mr, qt] = mt(
574
- `${Ne}:drawer`,
575
- Kn,
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
- ), jt = Tt && mr, [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
- Hn ?? !1,
581
+ `${De}:workbenchOpen`,
582
+ qn ?? !1,
583
583
  C
584
- ), [pr, at] = x(!1), [hr, 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
- ), [Sr, Ue] = x(() => Xe ?? !1), vr = Xe === !1 ? Sr : hr, ye = $(!1), ee = $(null), te = $(Z), Bt = $(I), lt = $(null), ct = $([]);
589
- Bt.current = I;
590
- const [Vt, zt] = x(() => ({
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: Nn
593
- })), br = Vt.key === I ? Vt.snapshot : Nn;
594
- A(() => {
595
- ye.current = !1, he.current = !1, Le({ workspaceId: e, creating: !1 }), xe({ workspaceId: e, failed: !1 }), Ct(null);
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 })).then((t) => {
605
- const a = t == null ? void 0 : t.id;
606
- typeof a == "string" && Ct({ workspaceId: e, id: a });
607
- }).catch(() => {
608
- 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 });
609
606
  }));
610
607
  }
611
- }, [X.length, K, k, Se, f, e]), A(() => {
612
- te.current = Z;
613
- }, [Z]);
614
- const kt = E((t) => {
615
- lt.current = { key: I, api: t }, at(!0), zt({
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({
616
613
  key: I,
617
614
  snapshot: t.getSnapshot()
618
615
  });
619
- const a = ct.current.splice(0);
620
- for (const l of a) l(t);
621
- }, [I]), Yt = E((t) => {
622
- ct.current.push(t);
623
- }, []), Qt = E((t) => {
624
- zt({
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({
625
622
  key: I,
626
623
  snapshot: t
627
624
  });
628
- }, [I]), Ke = E(() => {
629
- const t = lt.current;
630
- return (t == null ? void 0 : t.key) === Bt.current ? t.api : null;
631
- }, []), Xt = E(() => te.current, []), Zt = E(() => {
632
- te.current = !0, j(!0);
633
- }, [j]), en = E(() => {
634
- te.current = !0, j(!0), be(!0), Ue(!0);
635
- }, [j, be]), He = E(() => {
636
- te.current = !1, lt.current = null, at(!1), j(!1);
637
- }, [j]), tn = $(/* @__PURE__ */ new Set()), nn = E((t) => {
638
- const a = t.meta;
639
- if (!a || a.openOnlyWhenSessionOpen !== !0) return !0;
640
- const l = typeof a.sessionId == "string" ? a.sessionId : null;
641
- return l ? tn.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;
642
639
  }, []), ce = L(() => ({
643
- surface: Ke,
644
- isWorkbenchOpen: Xt,
645
- openWorkbench: Zt,
646
- openWorkbenchSources: en,
647
- closeWorkbench: He,
648
- enqueue: Yt,
649
- shouldOpenSurface: nn
650
- }), [Ke, Xt, Zt, en, He, Yt, nn]), yr = L(() => ({
651
- openFile: async (t) => (yn({ 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" }),
652
649
  getActiveFile: () => {
653
650
  var t;
654
- return ((t = Ke()) == null ? void 0 : t.getSnapshot().activeTab) ?? null;
651
+ return ((t = He()) == null ? void 0 : t.getSnapshot().activeTab) ?? null;
655
652
  },
656
653
  select: () => () => {
657
654
  }
658
- }), [Ke, ce]), ue = L(
659
- () => (W == null ? void 0 : W.map(Kr)) ?? [],
660
- [W]
661
- ), ut = L(
655
+ }), [He, ce]), ue = L(
656
+ () => (F == null ? void 0 : F.map(Jr)) ?? [],
657
+ [F]
658
+ ), dt = L(
662
659
  () => ue.some((t) => t.registrations.leftTabs.length > 0),
663
660
  [ue]
664
- ), rn = L(
665
- () => ue.flatMap((t) => t.registrations.panels.map((a) => a.id)),
661
+ ), sn = L(
662
+ () => ue.flatMap((t) => t.registrations.panels.map((l) => l.id)),
666
663
  [ue]
667
- ), sn = L(() => {
664
+ ), on = L(() => {
668
665
  const t = {};
669
- for (const a of ue)
670
- for (const l of a.registrations.toolRenderers)
671
- 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;
672
669
  return t;
673
- }, [ue]), on = L(
674
- () => [...Nt ?? [], ...rn],
675
- [Nt, rn]
676
- ), m = Q && !r && pe.workspaceId !== e ? "default" : G ?? (K !== void 0 ? "default" : ((mn = U[0]) == null ? void 0 : mn.id) ?? "default"), an = !(f != null && f.hasMore) && !F;
677
- A(() => {
678
- var re, pn;
679
- if (Ie) return;
680
- 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;
681
- l && a.has(l) && (ee.current = null);
682
- const g = m === "default" && K !== void 0, S = an && a.size > 0 && !g, R = l ?? (S && !a.has(m) ? ((pn = U[0]) == null ? void 0 : pn.id) ?? m : m);
683
- B((H) => {
684
- const se = H.workspaceId === e ? H : { workspaceId: e, ids: [], activeId: null };
685
- if (F && se.ids.length > 0 && !l) return se;
686
- const hn = se.ids.length > 0 ? se.ids : [R], Sn = S ? hn.filter((je) => a.has(je) || je === l) : hn, de = Sn.length > 0 ? Sn : [R], vn = se.activeId && de.includes(se.activeId) ? se.activeId : de[0] ?? R, Ee = l ? Be(de, t == null ? void 0 : t.afterId, l) : R === vn || de.includes(R) ? de : Tn(de, vn, R), bn = Ee.includes(R) ? R : Ee[0] ?? R;
687
- return H.workspaceId === e && H.activeId === bn && H.ids.length === Ee.length && H.ids.every((je, xr) => je === Ee[xr]) ? H : { workspaceId: e, ids: Ee, activeId: bn };
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 };
688
685
  });
689
- }, [K, m, F, Ie, U, an, e]);
690
- const ln = L(() => {
686
+ }, [K, p, W, Ge, U, ln, e]);
687
+ const cn = L(() => {
691
688
  const t = /* @__PURE__ */ new Map();
692
- for (const a of U) t.set(a.id, a.title);
689
+ for (const l of U) t.set(l.id, l.title);
693
690
  return t;
694
- }, [U]), dt = D.workspaceId === e ? D : { ids: [], activeId: null }, ne = dt.ids.length > 0 ? dt.ids : [m];
695
- A(() => {
696
- tn.current = new Set(ne);
697
- }, [ne]);
698
- const Pe = dt.activeId ?? ne[0] ?? m, Pr = E((t) => {
699
- const l = (D.workspaceId === e ? D : { ids: [m] }).ids.includes(t);
700
- return B((g) => {
701
- const S = g.workspaceId === e ? g : { ids: [m], activeId: m }, R = S.ids.includes(t) ? S.ids : Tn(S.ids, S.activeId, t);
702
- return { workspaceId: e, ids: R, activeId: t };
703
- }), l ? J(t) : $e(t);
704
- }, [D, m, J, $e, e]), Er = E((t) => (B((a) => {
705
- const l = a.workspaceId === e ? a : { ids: [m], activeId: m };
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);
700
+ return t;
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 };
706
717
  return {
707
718
  workspaceId: e,
708
- 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),
709
720
  activeId: t
710
721
  };
711
- }), J(t)), [m, J, e]), cn = E((t) => ((D.workspaceId === e ? D : { ids: [m] }).ids.includes(t) && Ft({ workspaceId: e, id: t }), B((l) => {
712
- 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 };
713
724
  return {
714
725
  workspaceId: e,
715
- ids: Be(g.ids, g.activeId, t),
726
+ ids: Ve(g.ids, g.activeId, t),
716
727
  activeId: t
717
728
  };
718
- }), J(t)), [D, m, J, e]), Ar = E((t) => {
719
- const a = D.workspaceId === e ? D : { ids: [m], activeId: m };
720
- if (a.ids.length <= 1) return;
721
- const l = a.ids.indexOf(t);
722
- if (l < 0) return;
723
- const g = a.ids.filter((R) => R !== t), S = a.activeId === t ? g[Math.max(0, l - 1)] ?? g[0] ?? null : a.activeId;
724
- B({ workspaceId: e, ids: g, activeId: S }), S && a.activeId === t && J(S);
725
- }, [D, m, J, e]), Rr = E((t) => {
726
- 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 = {
727
738
  afterId: t,
728
739
  knownIds: new Set(U.map((g) => g.id))
729
740
  };
730
- ee.current = a;
731
- const l = ot();
732
- return Promise.resolve(l).then((g) => {
733
- const S = gs(g);
734
- S && (ee.current === a && (ee.current = { ...a, createdId: S }), B((R) => {
735
- 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] };
736
747
  return {
737
748
  workspaceId: e,
738
- ids: Be(re.ids, t, S),
739
- activeId: S
749
+ ids: Ve(H.ids, t, m),
750
+ activeId: m
740
751
  };
741
752
  }));
742
753
  }).catch(() => {
743
- ee.current === a && (ee.current = null);
744
- }), l;
745
- }, [m, ot, U, e]), Tr = E((t) => {
746
- const a = D.workspaceId === e ? D : { ids: [m], activeId: m }, l = a.ids.indexOf(t);
747
- let g = a.activeId;
748
- if (l >= 0) {
749
- const S = a.ids.filter((R) => R !== t);
750
- 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);
751
762
  }
752
- return Jt(t);
753
- }, [D, m, Jt, $e, e]), [wr, ft] = x(ae), un = $(e);
754
- A(() => {
755
- if (un.current !== e) {
756
- un.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);
757
768
  return;
758
769
  }
759
- ae && ft(!0);
770
+ ae && mt(!0);
760
771
  }, [ae, e]);
761
- const dn = ae && Q && !G, fn = !wr && Ze !== !1 && (Q ? !!G : !0), Nr = E((t) => {
762
- er({ workspaceId: e, status: t }), we == null || we(t);
763
- }, [we, e]);
764
- A(() => {
765
- var a;
766
- const t = (l) => {
767
- const g = l.detail;
768
- !g || typeof g != "object" || yn(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);
769
780
  };
770
- return (a = globalThis.addEventListener) == null || a.call(globalThis, Pn, t), () => {
771
- var l;
772
- return (l = globalThis.removeEventListener) == null ? void 0 : l.call(globalThis, Pn, 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);
773
784
  };
774
- }, [ce]), A(() => {
775
- F || Re == null || Re(G ?? null);
776
- }, [G, Re, F]);
777
- const gt = Me.status !== "ready", Dr = gt ? /* @__PURE__ */ d(hs, { status: Me }) : void 0, Je = E(async (t) => {
778
- 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`;
779
790
  try {
780
- const l = await fetch(a, {
791
+ const a = await fetch(l, {
781
792
  method: "POST",
782
- headers: { ...Y, "content-type": "application/json" },
793
+ headers: { ...X, "content-type": "application/json" },
783
794
  body: JSON.stringify({ sessionId: t })
784
795
  });
785
- if (!l.ok)
786
- return (await l.json().catch(() => ({}))).error || `reload failed (${l.status})`;
787
- const g = await l.json().catch(() => ({}));
788
- return window.dispatchEvent(new CustomEvent(Hr, { detail: g })), bs(g);
789
- } catch (l) {
790
- 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.";
791
802
  }
792
- }, [h, Y]), qe = E(
793
- (t, a = {}) => {
794
- 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;
795
806
  return {
796
- ...O,
797
- ...dn ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
807
+ ...T,
808
+ ...mn ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
798
809
  sessionId: t,
799
- apiBaseUrl: h,
810
+ apiBaseUrl: S,
800
811
  workspaceId: e,
801
812
  storageScope: e,
802
- requestHeaders: Y,
813
+ requestHeaders: X,
803
814
  showSessions: !1,
804
- onReloadAgentPlugins: (O == null ? void 0 : O.onReloadAgentPlugins) ?? (() => Je(t)),
805
- toolRenderers: { ...sn, ...g ?? {} },
806
- bridgeEndpoint: l ? Ye : null,
815
+ onReloadAgentPlugins: (T == null ? void 0 : T.onReloadAgentPlugins) ?? (() => qe(t)),
816
+ toolRenderers: { ...on, ...g ?? {} },
817
+ bridgeEndpoint: a ? Qe : null,
807
818
  surfaceDispatch: ce,
808
- extraCommands: Dt,
809
- workspaceWarmupStatus: Me,
810
- hydrateMessages: fn,
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
+ },
811
837
  onAutoSubmitInitialDraftSettled: () => {
812
- le.current = !1, ft(!1), ve(void 0);
813
- const S = O == null ? void 0 : O.onAutoSubmitInitialDraftSettled;
814
- 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();
815
841
  },
816
842
  // Forward the explicit prop when set. Omitting the key (when undefined)
817
843
  // lets ChatPanel apply its own default (true) and avoids overriding a
818
844
  // value passed through chatParams.
819
- ...nt !== void 0 ? { hotReloadEnabled: nt } : {}
845
+ ...rt !== void 0 ? { hotReloadEnabled: rt } : {}
820
846
  };
821
847
  },
822
- [h, O, dn, Y, Ye, ce, Dt, Me, fn, nt, sn, Je, e]
823
- ), _r = L(
824
- () => qe(m),
825
- [m, qe]
826
- ), Or = 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) => ({
827
853
  id: t,
828
- title: ln.get(t) ?? (t === "default" ? k : t),
854
+ title: cn.get(t) ?? (t === "default" ? Q : t),
829
855
  panel: "chat",
830
- params: qe(t, { bridgeEnabled: t === Pe })
831
- })), [Pe, ne, k, qe, ln]), Lr = L(() => ({
856
+ params: je(t, { bridgeEnabled: t === Pe })
857
+ })), [Pe, re, Q, je, cn]), Mr = L(() => ({
832
858
  storageKey: I,
833
- defaultLeftTab: Te,
834
- initialPanels: wt,
835
- extraPanels: on,
836
- onReloadAgentPlugins: () => Je(G ?? m),
859
+ defaultLeftTab: we,
860
+ initialPanels: Dt,
861
+ extraPanels: an,
862
+ onReloadAgentPlugins: () => qe(G ?? p),
837
863
  onReady: kt,
838
- onChange: Qt,
839
- onClose: He
864
+ onChange: Xt,
865
+ onClose: Je
840
866
  }), [
841
- He,
842
- Te,
843
- wt,
844
867
  Je,
868
+ we,
869
+ Dt,
870
+ qe,
845
871
  G,
846
- m,
847
- Qt,
872
+ p,
873
+ Xt,
848
874
  kt,
849
875
  I,
850
- on,
851
- j
876
+ an,
877
+ z
852
878
  ]);
853
- return /* @__PURE__ */ d("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ Ae(
854
- Jr,
879
+ return /* @__PURE__ */ f("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ Re(
880
+ jr,
855
881
  {
856
- chatPanel: rr,
857
- panels: y,
858
- commands: b,
859
- catalogs: q,
860
- plugins: W,
861
- excludeDefaults: z,
862
- capabilities: T,
863
- apiBaseUrl: h,
864
- authHeaders: Zn,
865
- apiTimeout: p,
882
+ chatPanel: ir,
883
+ panels: P,
884
+ commands: y,
885
+ catalogs: B,
886
+ plugins: F,
887
+ excludeDefaults: k,
888
+ capabilities: w,
889
+ apiBaseUrl: S,
890
+ authHeaders: tr,
891
+ apiTimeout: h,
866
892
  activeSessionId: Pe,
867
- openSessionIds: ne,
868
- defaultTheme: N,
869
- onThemeChange: Wn,
893
+ openSessionIds: re,
894
+ defaultTheme: D,
895
+ onThemeChange: Gn,
870
896
  workspaceId: e,
871
- workspaceLabel: Un,
872
- appTitle: Rt,
873
- storageKey: rt,
874
- persistenceEnabled: bt,
875
- debug: In,
897
+ workspaceLabel: Hn,
898
+ appTitle: wt,
899
+ storageKey: st,
900
+ persistenceEnabled: Pt,
901
+ debug: $n,
876
902
  bridgeEndpoint: null,
877
- onAuthError: $n,
878
- frontPluginHotReload: Xn,
879
- fullPageBasePath: Gn,
903
+ onAuthError: Kn,
904
+ frontPluginHotReload: er,
905
+ fullPageBasePath: Un,
880
906
  children: [
881
- u,
882
- /* @__PURE__ */ d(
883
- fs,
907
+ d,
908
+ /* @__PURE__ */ f(
909
+ ms,
884
910
  {
885
911
  workspaceId: e,
886
- requestHeaders: Y,
887
- apiBaseUrl: h,
888
- preloadPaths: kn,
889
- provisionWorkspace: Ze,
890
- onStatusChange: Nr
912
+ requestHeaders: X,
913
+ apiBaseUrl: S,
914
+ preloadPaths: Qn,
915
+ provisionWorkspace: et,
916
+ onStatusChange: _r
891
917
  }
892
918
  ),
893
- /* @__PURE__ */ d(
894
- Ns,
919
+ /* @__PURE__ */ f(
920
+ _s,
895
921
  {
896
- bridgeEndpoint: Ye,
897
- requestHeaders: Y,
898
- navOpen: jt,
899
- surfaceOpen: Z,
900
- surfaceReady: pr,
901
- snapshot: br
922
+ bridgeEndpoint: Qe,
923
+ requestHeaders: X,
924
+ navOpen: Bt,
925
+ surfaceOpen: ee,
926
+ surfaceReady: Sr,
927
+ snapshot: Pr
902
928
  }
903
929
  ),
904
- /* @__PURE__ */ Ae("div", { className: "flex h-full min-h-0 flex-col", children: [
905
- /* @__PURE__ */ d(
906
- Vr,
930
+ /* @__PURE__ */ Re("div", { className: "flex h-full min-h-0 flex-col", children: [
931
+ /* @__PURE__ */ f(
932
+ Yr,
907
933
  {
908
- appTitle: Rt,
909
- sessionTitle: Ie ? "Loading sessions…" : gr ?? k,
934
+ appTitle: wt,
935
+ sessionTitle: Ge ? "Loading sessions…" : pr ?? Q,
910
936
  onCommandPalette: () => {
911
937
  document.dispatchEvent(new KeyboardEvent("keydown", {
912
938
  key: "k",
@@ -916,77 +942,77 @@ function Ys({
916
942
  cancelable: !0
917
943
  }));
918
944
  },
919
- topBarLeft: Jn,
920
- topBarRight: /* @__PURE__ */ Ae(fe, { children: [
921
- jn ? /* @__PURE__ */ d(es, {}) : null,
922
- qn
945
+ topBarLeft: jn,
946
+ topBarRight: /* @__PURE__ */ Re(fe, { children: [
947
+ Vn ? /* @__PURE__ */ f(ns, {}) : null,
948
+ Bn
923
949
  ] })
924
950
  }
925
951
  ),
926
- Ie ? /* @__PURE__ */ d(As, {}) : /* @__PURE__ */ d(
927
- zr,
952
+ Ge ? /* @__PURE__ */ f(Ts, {}) : /* @__PURE__ */ f(
953
+ kr,
928
954
  {
929
- className: Qn,
930
- nav: jt ? "session-list" : null,
955
+ className: Zn,
956
+ nav: Bt ? "session-list" : null,
931
957
  navParams: {
932
958
  sessions: U,
933
959
  activeId: Pe,
934
- openIds: ne,
935
- pinnedIds: tr,
936
- onTogglePin: nr,
937
- onSwitch: Pr,
938
- onOpenAsTab: cn,
939
- onCreate: ot,
940
- onDelete: Tr,
941
- onLoadMore: f == null ? void 0 : f.loadMore,
942
- hasMore: f == null ? void 0 : f.hasMore,
943
- loadingMore: f == null ? void 0 : f.loadingMore,
944
- onClose: () => qt(!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)
945
971
  },
946
972
  center: "chat",
947
- centerParams: _r,
948
- chatPanes: Or,
973
+ centerParams: Lr,
974
+ chatPanes: xr,
949
975
  activeChatPaneId: Pe,
950
- onActiveChatPaneChange: Er,
951
- onCloseChatPane: Ar,
952
- onCreateChatPaneAfter: Rr,
953
- onDropChatSession: cn,
976
+ onActiveChatPaneChange: Rr,
977
+ onCloseChatPane: Tr,
978
+ onCreateChatPaneAfter: wr,
979
+ onDropChatSession: fn,
954
980
  flashChatPaneId: (ie == null ? void 0 : ie.workspaceId) === e ? ie.id : null,
955
- surface: Z ? "artifact-surface" : null,
956
- surfaceParams: Lr,
957
- surfaceOverlay: Dr,
958
- sidebar: Z && !gt && ut && vr ? "workbench-left" : null,
959
- sidebarParams: Z && !gt && ut ? {
960
- ...Te ? { defaultTab: Te } : {},
961
- bridge: yr,
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,
962
988
  onClose: () => {
963
- be(!1), Ue(!1);
989
+ be(!1), Ke(!1);
964
990
  },
965
991
  onCollapse: () => {
966
- be(!1), Ue(!1);
992
+ be(!1), Ke(!1);
967
993
  }
968
994
  } : void 0,
969
- storageKey: C ? Ne : void 0,
970
- onOpenNav: Tt ? () => {
971
- qt(!0), et == null || et();
995
+ storageKey: C ? De : void 0,
996
+ onOpenNav: Nt ? () => {
997
+ jt(!0), tt == null || tt();
972
998
  } : void 0,
973
999
  onOpenSurface: () => {
974
- te.current = !0, j(!0), tt == null || tt();
1000
+ ne.current = !0, z(!0), nt == null || nt();
975
1001
  },
976
- surfaceButtonBottomOffset: Yn,
977
- onOpenSidebar: ut ? () => {
978
- 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);
979
1005
  } : void 0
980
1006
  }
981
1007
  )
982
1008
  ] }),
983
- v
1009
+ b
984
1010
  ]
985
1011
  }
986
1012
  ) });
987
1013
  }
988
- const Ds = 500;
989
- function _s(e) {
1014
+ const Os = 500;
1015
+ function Ls(e) {
990
1016
  return new Promise((n, r) => {
991
1017
  let s;
992
1018
  const i = () => {
@@ -1000,80 +1026,80 @@ function _s(e) {
1000
1026
  }
1001
1027
  s = globalThis.setTimeout(() => {
1002
1028
  i(), n();
1003
- }, Ds), e.addEventListener("abort", o, { once: !0 });
1029
+ }, Os), e.addEventListener("abort", o, { once: !0 });
1004
1030
  });
1005
1031
  }
1006
- function Qs({
1032
+ function Xs({
1007
1033
  workspaceId: e,
1008
1034
  requestHeaders: n,
1009
1035
  apiBaseUrl: r,
1010
- preloadPaths: s = On,
1036
+ preloadPaths: s = xn,
1011
1037
  provisionWorkspace: i = !0,
1012
1038
  loadingFallback: o,
1013
1039
  errorFallback: c,
1014
- children: u
1040
+ children: d
1015
1041
  }) {
1016
- const [v, y] = x({
1042
+ const [b, P] = x({
1017
1043
  status: "loading",
1018
1044
  label: "Waking workspace runtime"
1019
1045
  });
1020
- return A(() => {
1021
- const b = new AbortController(), q = ze(e, n);
1022
- async function W(T) {
1023
- const h = await fetch(xn(r, T), {
1024
- headers: q,
1025
- signal: b.signal
1026
- }), w = await ke(h);
1027
- if (!h.ok) {
1028
- if (St(w)) return "preparing";
1029
- 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}`);
1030
1056
  }
1031
- if (Mn(T)) {
1032
- const N = Ve(w);
1033
- 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");
1034
1060
  }
1035
- return qr(T) !== null && w && typeof w == "object" && Cn(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";
1036
1062
  }
1037
- async function z() {
1038
- y({ status: "loading", label: "Waking workspace runtime" });
1063
+ async function k() {
1064
+ P({ status: "loading", label: "Waking workspace runtime" });
1039
1065
  try {
1040
- const T = Ln(s, i);
1041
- let h = await Promise.all(T.map(async (p) => ({ path: p, status: await W(p) }))), w = h.filter((p) => p.status === "preparing").map((p) => p.path);
1042
- for (; w.length > 0; ) {
1043
- if (y({ status: "loading", label: "Workspace is still preparing" }), await _s(b.signal), b.signal.aborted) return;
1044
- h = await Promise.all(w.map(async (p) => ({ path: p, status: await W(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);
1045
1071
  }
1046
- b.signal.aborted || y({ status: "ready" });
1047
- } catch (T) {
1048
- if (b.signal.aborted) return;
1049
- y({
1072
+ y.signal.aborted || P({ status: "ready" });
1073
+ } catch (w) {
1074
+ if (y.signal.aborted) return;
1075
+ P({
1050
1076
  status: "error",
1051
- message: T instanceof Error ? T.message : "Unknown workspace boot error"
1077
+ message: w instanceof Error ? w.message : "Unknown workspace boot error"
1052
1078
  });
1053
1079
  }
1054
1080
  }
1055
- return z(), () => b.abort();
1056
- }, [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(
1057
- An,
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,
1058
1084
  {
1059
1085
  title: "Workspace failed to open",
1060
- description: v.message,
1086
+ description: b.message,
1061
1087
  status: "Retry by reloading the page"
1062
1088
  }
1063
- ) : typeof o == "function" ? /* @__PURE__ */ d(fe, { children: o(v.label) }) : o ? /* @__PURE__ */ d(fe, { children: o }) : /* @__PURE__ */ d(
1064
- An,
1089
+ ) : typeof o == "function" ? /* @__PURE__ */ f(fe, { children: o(b.label) }) : o ? /* @__PURE__ */ f(fe, { children: o }) : /* @__PURE__ */ f(
1090
+ Tn,
1065
1091
  {
1066
1092
  title: "Opening workspace",
1067
1093
  description: "Preparing secure runtime, files, sessions, and layout.",
1068
- status: v.label
1094
+ status: b.label
1069
1095
  }
1070
1096
  );
1071
1097
  }
1072
- const Os = "FULL_PAGE_PANEL_MISSING_COMPONENT", Ls = "FULL_PAGE_PANEL_INVALID_PARAMS_JSON", xs = "FULL_PAGE_PANEL_PARAMS_NOT_OBJECT", Ms = "FULL_PAGE_PANEL_UNKNOWN_COMPONENT", Cs = "FULL_PAGE_PANEL_NOT_SUPPORTED", Fs = "FULL_PAGE_PANEL_RENDER_FAILED";
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";
1073
1099
  function M() {
1074
1100
  }
1075
- const Ws = { dispose: M }, P = () => Ws;
1076
- function Is(e) {
1101
+ const Gs = { dispose: M }, A = () => Gs;
1102
+ function $s(e) {
1077
1103
  return {
1078
1104
  id: `full-page:${e}`,
1079
1105
  title: e,
@@ -1096,18 +1122,18 @@ function Is(e) {
1096
1122
  exitMaximized: M,
1097
1123
  isMaximized: () => !1,
1098
1124
  minimize: M,
1099
- onDidActiveChange: P,
1100
- onDidVisibilityChange: P,
1101
- onDidDimensionsChange: P,
1102
- onDidFocusChange: P,
1103
- onDidLocationChange: P,
1104
- onDidParametersChange: P,
1105
- onDidTitleChange: P,
1106
- onDidRenamed: P,
1107
- onWillFocus: P
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
1108
1134
  };
1109
1135
  }
1110
- function Gs() {
1136
+ function Us() {
1111
1137
  return {
1112
1138
  width: window.innerWidth,
1113
1139
  height: window.innerHeight,
@@ -1133,77 +1159,77 @@ function Gs() {
1133
1159
  clear: M,
1134
1160
  focus: M,
1135
1161
  layout: M,
1136
- onDidLayoutChange: P,
1137
- onDidLayoutFromJSON: P,
1138
- onDidAddPanel: P,
1139
- onDidRemovePanel: P,
1140
- onDidActivePanelChange: P,
1141
- onDidAddGroup: P,
1142
- onDidRemoveGroup: P,
1143
- onDidActiveGroupChange: P,
1144
- onUnhandledDragOverEvent: P,
1145
- onDidDrop: P,
1146
- onWillDrop: P,
1147
- onWillDragGroup: P,
1148
- onWillDragPanel: P,
1149
- onDidActivePanelChange_: P
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
1150
1176
  };
1151
1177
  }
1152
- function ht({ code: e, title: n, description: r }) {
1153
- return /* @__PURE__ */ d(
1178
+ function vt({ code: e, title: n, description: r }) {
1179
+ return /* @__PURE__ */ f(
1154
1180
  "div",
1155
1181
  {
1156
1182
  className: "flex min-h-screen items-center justify-center bg-background p-6 text-foreground",
1157
1183
  "data-testid": "full-page-error-state",
1158
1184
  "data-full-page-error-code": e,
1159
- children: /* @__PURE__ */ d(Zr, { 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 })
1160
1186
  }
1161
1187
  );
1162
1188
  }
1163
- function Xs({ componentId: e, params: n = {} }) {
1164
- const r = Fn(), { errors: s } = jr(), i = r.get(e), o = r.getComponents()[e];
1165
- Cr(() => {
1189
+ function Zs({ componentId: e, params: n = {} }) {
1190
+ const r = In(), { errors: s } = Vr(), i = r.get(e), o = r.getComponents()[e];
1191
+ Fr(() => {
1166
1192
  document.title = (i == null ? void 0 : i.title) ?? e;
1167
1193
  }, [e, i == null ? void 0 : i.title]);
1168
1194
  const c = L(() => ({
1169
1195
  params: n,
1170
- api: Is(e),
1171
- containerApi: Gs(),
1196
+ api: $s(e),
1197
+ containerApi: Us(),
1172
1198
  className: "h-full"
1173
- }), [e, n]), u = L(() => {
1199
+ }), [e, n]), d = L(() => {
1174
1200
  if (!i) return null;
1175
- const v = i.pluginId ?? i.id;
1176
- for (let y = s.length - 1; y >= 0; y -= 1) {
1177
- const b = s[y];
1178
- if (b.contributionKind === "panel" && b.contributionId === e && b.pluginId === v)
1179
- 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;
1180
1206
  }
1181
1207
  return null;
1182
1208
  }, [e, s, i]);
1183
- return i ? !i.supportsFullPage || !o ? /* @__PURE__ */ d(
1184
- ht,
1209
+ return i ? !i.supportsFullPage || !o ? /* @__PURE__ */ f(
1210
+ vt,
1185
1211
  {
1186
- code: Cs,
1212
+ code: Fs,
1187
1213
  title: "Panel does not support full-page mode",
1188
1214
  description: `Panel "${e}" can render in the workspace, but it has not opted into the dedicated full-page pane route.`
1189
1215
  }
1190
- ) : u ? /* @__PURE__ */ d(
1191
- ht,
1216
+ ) : d ? /* @__PURE__ */ f(
1217
+ vt,
1192
1218
  {
1193
- code: Fs,
1219
+ code: Is,
1194
1220
  title: "Panel failed to render",
1195
- 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}`
1196
1222
  }
1197
- ) : /* @__PURE__ */ d("div", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ d(Br, { mode: "full-page", children: /* @__PURE__ */ d(o, { ...c }) }) }) : /* @__PURE__ */ d(
1198
- 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,
1199
1225
  {
1200
- code: Ms,
1226
+ code: Ws,
1201
1227
  title: "Unknown panel",
1202
1228
  description: `No full-page panel component is registered as "${e}".`
1203
1229
  }
1204
1230
  );
1205
1231
  }
1206
- function Zs(e) {
1232
+ function ei(e) {
1207
1233
  var o;
1208
1234
  const n = new URLSearchParams(e), r = ((o = n.get("component")) == null ? void 0 : o.trim()) ?? "";
1209
1235
  if (!r)
@@ -1211,7 +1237,7 @@ function Zs(e) {
1211
1237
  componentId: null,
1212
1238
  params: {},
1213
1239
  error: {
1214
- code: Os,
1240
+ code: xs,
1215
1241
  message: "Missing full-page panel component id."
1216
1242
  }
1217
1243
  };
@@ -1226,7 +1252,7 @@ function Zs(e) {
1226
1252
  componentId: null,
1227
1253
  params: {},
1228
1254
  error: {
1229
- code: Ls,
1255
+ code: Ms,
1230
1256
  message: "Invalid full-page panel params JSON."
1231
1257
  }
1232
1258
  };
@@ -1235,23 +1261,23 @@ function Zs(e) {
1235
1261
  componentId: null,
1236
1262
  params: {},
1237
1263
  error: {
1238
- code: xs,
1264
+ code: Cs,
1239
1265
  message: "Full-page panel params must be a JSON object."
1240
1266
  }
1241
1267
  } : { componentId: r, params: i };
1242
1268
  }
1243
1269
  export {
1244
- Ls as FULL_PAGE_PANEL_INVALID_PARAMS_JSON,
1245
- Os as FULL_PAGE_PANEL_MISSING_COMPONENT,
1246
- Cs as FULL_PAGE_PANEL_NOT_SUPPORTED,
1247
- xs as FULL_PAGE_PANEL_PARAMS_NOT_OBJECT,
1248
- Fs as FULL_PAGE_PANEL_RENDER_FAILED,
1249
- Ms as FULL_PAGE_PANEL_UNKNOWN_COMPONENT,
1250
- Ys as WorkspaceAgentFront,
1251
- fs as WorkspaceBackgroundBoot,
1252
- Qs as WorkspaceBootGate,
1253
- Xs as WorkspaceFullPagePanel,
1254
- ss as createLocalStorageSessions,
1255
- Zs as parseFullPagePanelLocation,
1256
- is 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
1257
1283
  };