@hachej/boring-workspace 0.1.33 → 0.1.35

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