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