@hachej/boring-workspace 0.1.34 → 0.1.36

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