@hachej/boring-workspace 0.1.58 → 0.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-front.d.ts +3 -0
- package/dist/app-front.js +685 -656
- 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 Zr() {
|
|
|
18
18
|
onClick: n,
|
|
19
19
|
"aria-label": "Toggle theme",
|
|
20
20
|
title: r ? "Switch to light theme" : "Switch to dark theme",
|
|
21
|
-
children: r ? /* @__PURE__ */
|
|
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 ts(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 rs(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 An(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 as(e) {
|
|
|
112
112
|
const { done: o, value: c } = await r.read();
|
|
113
113
|
if (c) {
|
|
114
114
|
i += s.decode(c, { stream: !o });
|
|
115
|
-
const
|
|
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 ls(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 cs(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 F =
|
|
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
216
|
} catch (F) {
|
|
217
|
-
if (c ||
|
|
217
|
+
if (c || d.signal.aborted) return;
|
|
218
218
|
o == null || o({
|
|
219
219
|
status: "failed",
|
|
220
220
|
message: F instanceof Error ? F.message : "Workspace failed to prepare"
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
return
|
|
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] =
|
|
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 hs(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 bs(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 Nn(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 ys(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 Dn(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 Ps(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 ws({
|
|
|
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,498 +412,527 @@ function zs({
|
|
|
412
412
|
sessionStorageKey: i,
|
|
413
413
|
providerStorageKey: o,
|
|
414
414
|
surfaceStorageKey: c,
|
|
415
|
-
beforeShell:
|
|
416
|
-
afterShell:
|
|
417
|
-
panels:
|
|
418
|
-
commands:
|
|
419
|
-
catalogs:
|
|
415
|
+
beforeShell: d,
|
|
416
|
+
afterShell: b,
|
|
417
|
+
panels: P,
|
|
418
|
+
commands: y,
|
|
419
|
+
catalogs: B,
|
|
420
420
|
plugins: F,
|
|
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:
|
|
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
|
-
})), ge = `boring-workspace:chat-panes:${e}`, [
|
|
491
|
-
() => (C ?
|
|
492
|
-
), [ie,
|
|
493
|
-
|
|
490
|
+
})), ge = `boring-workspace:chat-panes:${e}`, [_, Y] = x(
|
|
491
|
+
() => (C ? On(ge, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
|
|
492
|
+
), [ie, Ft] = x(null);
|
|
493
|
+
E(() => {
|
|
494
494
|
if (!ie) return;
|
|
495
|
-
const t = setTimeout(() =>
|
|
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
|
|
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
|
-
ye.current = !1,
|
|
604
|
+
he.current || ye.current || (ye.current = !0, xe({ workspaceId: e, creating: !0 }), Me({ workspaceId: e, failed: !1 }), Promise.resolve(u.create({ title: Q })).catch(() => {
|
|
605
|
+
ye.current = !1, xe({ workspaceId: e, creating: !1 }), Me({ workspaceId: e, failed: !0 });
|
|
606
606
|
}));
|
|
607
607
|
}
|
|
608
|
-
}, [
|
|
609
|
-
|
|
610
|
-
}, [
|
|
611
|
-
const
|
|
612
|
-
|
|
608
|
+
}, [V.length, K, Q, Se, u, e]), E(() => {
|
|
609
|
+
ne.current = ee;
|
|
610
|
+
}, [ee]);
|
|
611
|
+
const kt = R((t) => {
|
|
612
|
+
ct.current = { key: I, api: t }, lt(!0), Yt({
|
|
613
613
|
key: I,
|
|
614
614
|
snapshot: t.getSnapshot()
|
|
615
615
|
});
|
|
616
|
-
const
|
|
617
|
-
for (const
|
|
618
|
-
}, [I]),
|
|
619
|
-
|
|
620
|
-
}, []),
|
|
621
|
-
|
|
616
|
+
const l = ut.current.splice(0);
|
|
617
|
+
for (const a of l) a(t);
|
|
618
|
+
}, [I]), Qt = R((t) => {
|
|
619
|
+
ut.current.push(t);
|
|
620
|
+
}, []), Xt = R((t) => {
|
|
621
|
+
Yt({
|
|
622
622
|
key: I,
|
|
623
623
|
snapshot: t
|
|
624
624
|
});
|
|
625
|
-
}, [I]),
|
|
626
|
-
const t =
|
|
627
|
-
return (t == null ? void 0 : t.key) ===
|
|
628
|
-
}, []),
|
|
629
|
-
|
|
630
|
-
}, [
|
|
631
|
-
|
|
632
|
-
}, [
|
|
633
|
-
|
|
634
|
-
}, [
|
|
635
|
-
const
|
|
636
|
-
if (!
|
|
637
|
-
const
|
|
638
|
-
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;
|
|
639
639
|
}, []), ce = L(() => ({
|
|
640
|
-
surface:
|
|
641
|
-
isWorkbenchOpen:
|
|
642
|
-
openWorkbench:
|
|
643
|
-
openWorkbenchSources:
|
|
644
|
-
closeWorkbench:
|
|
645
|
-
enqueue:
|
|
646
|
-
shouldOpenSurface:
|
|
647
|
-
}), [
|
|
648
|
-
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" }),
|
|
649
649
|
getActiveFile: () => {
|
|
650
650
|
var t;
|
|
651
|
-
return ((t =
|
|
651
|
+
return ((t = He()) == null ? void 0 : t.getSnapshot().activeTab) ?? null;
|
|
652
652
|
},
|
|
653
653
|
select: () => () => {
|
|
654
654
|
}
|
|
655
|
-
}), [
|
|
656
|
-
() => (F == null ? void 0 : F.map(
|
|
655
|
+
}), [He, ce]), ue = L(
|
|
656
|
+
() => (F == null ? void 0 : F.map(Jr)) ?? [],
|
|
657
657
|
[F]
|
|
658
|
-
),
|
|
658
|
+
), dt = L(
|
|
659
659
|
() => ue.some((t) => t.registrations.leftTabs.length > 0),
|
|
660
660
|
[ue]
|
|
661
|
-
),
|
|
662
|
-
() => ue.flatMap((t) => t.registrations.panels.map((
|
|
661
|
+
), sn = L(
|
|
662
|
+
() => ue.flatMap((t) => t.registrations.panels.map((l) => l.id)),
|
|
663
663
|
[ue]
|
|
664
|
-
),
|
|
664
|
+
), on = L(() => {
|
|
665
665
|
const t = {};
|
|
666
|
-
for (const
|
|
667
|
-
for (const
|
|
668
|
-
t[
|
|
666
|
+
for (const l of ue)
|
|
667
|
+
for (const a of l.registrations.toolRenderers)
|
|
668
|
+
t[a.id] = a.render;
|
|
669
669
|
return t;
|
|
670
|
-
}, [ue]),
|
|
671
|
-
() => [...
|
|
672
|
-
[
|
|
673
|
-
),
|
|
674
|
-
|
|
675
|
-
var
|
|
676
|
-
if (
|
|
677
|
-
const t =
|
|
678
|
-
|
|
679
|
-
const g =
|
|
680
|
-
|
|
681
|
-
const se =
|
|
682
|
-
if (W && se.ids.length > 0 && !
|
|
683
|
-
const
|
|
684
|
-
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 };
|
|
685
685
|
});
|
|
686
|
-
}, [K,
|
|
687
|
-
const
|
|
686
|
+
}, [K, p, W, Ge, U, ln, e]);
|
|
687
|
+
const cn = L(() => {
|
|
688
688
|
const t = /* @__PURE__ */ new Map();
|
|
689
|
-
for (const
|
|
689
|
+
for (const l of U) t.set(l.id, l.title);
|
|
690
|
+
return t;
|
|
691
|
+
}, [U]), [ft, un] = x(() => ({
|
|
692
|
+
workspaceId: e,
|
|
693
|
+
ids: /* @__PURE__ */ new Set()
|
|
694
|
+
})), dn = L(() => {
|
|
695
|
+
const t = /* @__PURE__ */ new Set();
|
|
696
|
+
if (!q) return t;
|
|
697
|
+
const l = ft.workspaceId === e ? ft.ids : /* @__PURE__ */ new Set();
|
|
698
|
+
for (const a of V)
|
|
699
|
+
a.turnCount === 0 && !l.has(a.id) && t.add(a.id);
|
|
690
700
|
return t;
|
|
691
|
-
}, [
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}, [
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
701
|
+
}, [V, ft, q, e]);
|
|
702
|
+
E(() => {
|
|
703
|
+
un((t) => t.workspaceId === e ? t : { workspaceId: e, ids: /* @__PURE__ */ new Set() });
|
|
704
|
+
}, [e]);
|
|
705
|
+
const gt = _.workspaceId === e ? _ : { ids: [], activeId: null }, re = gt.ids.length > 0 ? gt.ids : [p];
|
|
706
|
+
E(() => {
|
|
707
|
+
nn.current = new Set(re);
|
|
708
|
+
}, [re]);
|
|
709
|
+
const Pe = gt.activeId ?? re[0] ?? p, Ar = R((t) => {
|
|
710
|
+
const a = (_.workspaceId === e ? _ : { ids: [p] }).ids.includes(t);
|
|
711
|
+
return Y((g) => {
|
|
712
|
+
const m = g.workspaceId === e ? g : { ids: [p], activeId: p }, v = m.ids.includes(t) ? m.ids : Nn(m.ids, m.activeId, t);
|
|
713
|
+
return { workspaceId: e, ids: v, activeId: t };
|
|
714
|
+
}), a ? j(t) : Ue(t);
|
|
715
|
+
}, [_, p, j, Ue, e]), Rr = R((t) => (Y((l) => {
|
|
716
|
+
const a = l.workspaceId === e ? l : { ids: [p], activeId: p };
|
|
703
717
|
return {
|
|
704
718
|
workspaceId: e,
|
|
705
|
-
ids:
|
|
719
|
+
ids: a.ids.includes(t) ? a.ids : Ve(a.ids, a.activeId, t),
|
|
706
720
|
activeId: t
|
|
707
721
|
};
|
|
708
|
-
}),
|
|
709
|
-
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 };
|
|
710
724
|
return {
|
|
711
725
|
workspaceId: e,
|
|
712
|
-
ids:
|
|
726
|
+
ids: Ve(g.ids, g.activeId, t),
|
|
713
727
|
activeId: t
|
|
714
728
|
};
|
|
715
|
-
}),
|
|
716
|
-
const
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
if (
|
|
720
|
-
const g =
|
|
721
|
-
|
|
722
|
-
}, [
|
|
723
|
-
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 = {
|
|
724
738
|
afterId: t,
|
|
725
739
|
knownIds: new Set(U.map((g) => g.id))
|
|
726
740
|
};
|
|
727
|
-
|
|
728
|
-
const
|
|
729
|
-
return Promise.resolve(
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
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] };
|
|
733
747
|
return {
|
|
734
748
|
workspaceId: e,
|
|
735
|
-
ids:
|
|
736
|
-
activeId:
|
|
749
|
+
ids: Ve(H.ids, t, m),
|
|
750
|
+
activeId: m
|
|
737
751
|
};
|
|
738
752
|
}));
|
|
739
753
|
}).catch(() => {
|
|
740
|
-
|
|
741
|
-
}),
|
|
742
|
-
}, [
|
|
743
|
-
const
|
|
744
|
-
let g =
|
|
745
|
-
if (
|
|
746
|
-
const
|
|
747
|
-
g =
|
|
754
|
+
te.current === l && (te.current = null);
|
|
755
|
+
}), a;
|
|
756
|
+
}, [p, at, U, e]), Nr = R((t) => {
|
|
757
|
+
const l = _.workspaceId === e ? _ : { ids: [p], activeId: p }, a = l.ids.indexOf(t);
|
|
758
|
+
let g = l.activeId;
|
|
759
|
+
if (a >= 0) {
|
|
760
|
+
const m = l.ids.filter((v) => v !== t);
|
|
761
|
+
g = l.activeId === t ? m[Math.max(0, a - 1)] ?? m[0] ?? null : l.activeId, Y({ workspaceId: e, ids: m, activeId: g }), g && l.activeId === t && Ue(g);
|
|
748
762
|
}
|
|
749
|
-
return
|
|
750
|
-
}, [
|
|
751
|
-
|
|
752
|
-
if (
|
|
753
|
-
|
|
763
|
+
return qt(t);
|
|
764
|
+
}, [_, p, qt, Ue, e]), [Dr, mt] = x(ae), gn = $(e);
|
|
765
|
+
E(() => {
|
|
766
|
+
if (gn.current !== e) {
|
|
767
|
+
gn.current = e, mt(ae);
|
|
754
768
|
return;
|
|
755
769
|
}
|
|
756
|
-
ae &&
|
|
770
|
+
ae && mt(!0);
|
|
757
771
|
}, [ae, e]);
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
}, [
|
|
761
|
-
|
|
762
|
-
var
|
|
763
|
-
const t = (
|
|
764
|
-
const g =
|
|
765
|
-
!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);
|
|
766
780
|
};
|
|
767
|
-
return (
|
|
768
|
-
var
|
|
769
|
-
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);
|
|
770
784
|
};
|
|
771
|
-
}, [ce]),
|
|
772
|
-
W ||
|
|
773
|
-
}, [G,
|
|
774
|
-
const
|
|
775
|
-
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`;
|
|
776
790
|
try {
|
|
777
|
-
const
|
|
791
|
+
const a = await fetch(l, {
|
|
778
792
|
method: "POST",
|
|
779
|
-
headers: { ...
|
|
793
|
+
headers: { ...X, "content-type": "application/json" },
|
|
780
794
|
body: JSON.stringify({ sessionId: t })
|
|
781
795
|
});
|
|
782
|
-
if (!
|
|
783
|
-
return (await
|
|
784
|
-
const g = await
|
|
785
|
-
return window.dispatchEvent(new CustomEvent(
|
|
786
|
-
} catch (
|
|
787
|
-
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.";
|
|
788
802
|
}
|
|
789
|
-
}, [
|
|
790
|
-
(t,
|
|
791
|
-
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;
|
|
792
806
|
return {
|
|
793
|
-
...
|
|
794
|
-
...
|
|
807
|
+
...T,
|
|
808
|
+
...mn ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
|
|
795
809
|
sessionId: t,
|
|
796
|
-
apiBaseUrl:
|
|
810
|
+
apiBaseUrl: S,
|
|
797
811
|
workspaceId: e,
|
|
798
812
|
storageScope: e,
|
|
799
|
-
requestHeaders:
|
|
813
|
+
requestHeaders: X,
|
|
800
814
|
showSessions: !1,
|
|
801
|
-
onReloadAgentPlugins: (
|
|
802
|
-
toolRenderers: { ...
|
|
803
|
-
bridgeEndpoint:
|
|
815
|
+
onReloadAgentPlugins: (T == null ? void 0 : T.onReloadAgentPlugins) ?? (() => qe(t)),
|
|
816
|
+
toolRenderers: { ...on, ...g ?? {} },
|
|
817
|
+
bridgeEndpoint: a ? Qe : null,
|
|
804
818
|
surfaceDispatch: ce,
|
|
805
|
-
extraCommands:
|
|
806
|
-
workspaceWarmupStatus:
|
|
807
|
-
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
|
+
},
|
|
808
837
|
onAutoSubmitInitialDraftSettled: () => {
|
|
809
|
-
le.current = !1,
|
|
810
|
-
const
|
|
811
|
-
typeof
|
|
838
|
+
le.current = !1, mt(!1), ve(void 0);
|
|
839
|
+
const m = T == null ? void 0 : T.onAutoSubmitInitialDraftSettled;
|
|
840
|
+
typeof m == "function" && m();
|
|
812
841
|
},
|
|
813
842
|
// Forward the explicit prop when set. Omitting the key (when undefined)
|
|
814
843
|
// lets ChatPanel apply its own default (true) and avoids overriding a
|
|
815
844
|
// value passed through chatParams.
|
|
816
|
-
...
|
|
845
|
+
...rt !== void 0 ? { hotReloadEnabled: rt } : {}
|
|
817
846
|
};
|
|
818
847
|
},
|
|
819
|
-
[
|
|
820
|
-
),
|
|
821
|
-
() =>
|
|
822
|
-
[
|
|
823
|
-
),
|
|
848
|
+
[S, T, mn, X, Qe, ce, Ot, Ce, pn, dn, rt, on, qe, u, e]
|
|
849
|
+
), Lr = L(
|
|
850
|
+
() => je(p),
|
|
851
|
+
[p, je]
|
|
852
|
+
), xr = L(() => re.map((t) => ({
|
|
824
853
|
id: t,
|
|
825
|
-
title:
|
|
854
|
+
title: cn.get(t) ?? (t === "default" ? Q : t),
|
|
826
855
|
panel: "chat",
|
|
827
|
-
params:
|
|
828
|
-
})), [Pe,
|
|
856
|
+
params: je(t, { bridgeEnabled: t === Pe })
|
|
857
|
+
})), [Pe, re, Q, je, cn]), Mr = L(() => ({
|
|
829
858
|
storageKey: I,
|
|
830
|
-
defaultLeftTab:
|
|
831
|
-
initialPanels:
|
|
832
|
-
extraPanels:
|
|
833
|
-
onReloadAgentPlugins: () =>
|
|
834
|
-
onReady:
|
|
835
|
-
onChange:
|
|
836
|
-
onClose:
|
|
859
|
+
defaultLeftTab: we,
|
|
860
|
+
initialPanels: Dt,
|
|
861
|
+
extraPanels: an,
|
|
862
|
+
onReloadAgentPlugins: () => qe(G ?? p),
|
|
863
|
+
onReady: kt,
|
|
864
|
+
onChange: Xt,
|
|
865
|
+
onClose: Je
|
|
837
866
|
}), [
|
|
838
|
-
He,
|
|
839
|
-
Te,
|
|
840
|
-
wt,
|
|
841
867
|
Je,
|
|
868
|
+
we,
|
|
869
|
+
Dt,
|
|
870
|
+
qe,
|
|
842
871
|
G,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
872
|
+
p,
|
|
873
|
+
Xt,
|
|
874
|
+
kt,
|
|
846
875
|
I,
|
|
847
|
-
|
|
848
|
-
|
|
876
|
+
an,
|
|
877
|
+
z
|
|
849
878
|
]);
|
|
850
|
-
return /* @__PURE__ */
|
|
851
|
-
|
|
879
|
+
return /* @__PURE__ */ f("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ Re(
|
|
880
|
+
jr,
|
|
852
881
|
{
|
|
853
|
-
chatPanel:
|
|
854
|
-
panels:
|
|
855
|
-
commands:
|
|
856
|
-
catalogs:
|
|
882
|
+
chatPanel: ir,
|
|
883
|
+
panels: P,
|
|
884
|
+
commands: y,
|
|
885
|
+
catalogs: B,
|
|
857
886
|
plugins: F,
|
|
858
|
-
excludeDefaults:
|
|
859
|
-
capabilities:
|
|
860
|
-
apiBaseUrl:
|
|
861
|
-
authHeaders:
|
|
862
|
-
apiTimeout:
|
|
887
|
+
excludeDefaults: k,
|
|
888
|
+
capabilities: w,
|
|
889
|
+
apiBaseUrl: S,
|
|
890
|
+
authHeaders: tr,
|
|
891
|
+
apiTimeout: h,
|
|
863
892
|
activeSessionId: Pe,
|
|
864
|
-
openSessionIds:
|
|
865
|
-
defaultTheme:
|
|
866
|
-
onThemeChange:
|
|
893
|
+
openSessionIds: re,
|
|
894
|
+
defaultTheme: D,
|
|
895
|
+
onThemeChange: Gn,
|
|
867
896
|
workspaceId: e,
|
|
868
|
-
workspaceLabel:
|
|
869
|
-
appTitle:
|
|
870
|
-
storageKey:
|
|
871
|
-
persistenceEnabled:
|
|
872
|
-
debug:
|
|
897
|
+
workspaceLabel: Hn,
|
|
898
|
+
appTitle: wt,
|
|
899
|
+
storageKey: st,
|
|
900
|
+
persistenceEnabled: Pt,
|
|
901
|
+
debug: $n,
|
|
873
902
|
bridgeEndpoint: null,
|
|
874
|
-
onAuthError:
|
|
875
|
-
frontPluginHotReload:
|
|
876
|
-
fullPageBasePath:
|
|
903
|
+
onAuthError: Kn,
|
|
904
|
+
frontPluginHotReload: er,
|
|
905
|
+
fullPageBasePath: Un,
|
|
877
906
|
children: [
|
|
878
|
-
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
|
|
907
|
+
d,
|
|
908
|
+
/* @__PURE__ */ f(
|
|
909
|
+
ms,
|
|
881
910
|
{
|
|
882
911
|
workspaceId: e,
|
|
883
|
-
requestHeaders:
|
|
884
|
-
apiBaseUrl:
|
|
885
|
-
preloadPaths:
|
|
886
|
-
provisionWorkspace:
|
|
887
|
-
onStatusChange:
|
|
912
|
+
requestHeaders: X,
|
|
913
|
+
apiBaseUrl: S,
|
|
914
|
+
preloadPaths: Qn,
|
|
915
|
+
provisionWorkspace: et,
|
|
916
|
+
onStatusChange: _r
|
|
888
917
|
}
|
|
889
918
|
),
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
|
|
919
|
+
/* @__PURE__ */ f(
|
|
920
|
+
_s,
|
|
892
921
|
{
|
|
893
|
-
bridgeEndpoint:
|
|
894
|
-
requestHeaders:
|
|
895
|
-
navOpen:
|
|
896
|
-
surfaceOpen:
|
|
897
|
-
surfaceReady:
|
|
898
|
-
snapshot:
|
|
922
|
+
bridgeEndpoint: Qe,
|
|
923
|
+
requestHeaders: X,
|
|
924
|
+
navOpen: Bt,
|
|
925
|
+
surfaceOpen: ee,
|
|
926
|
+
surfaceReady: Sr,
|
|
927
|
+
snapshot: Pr
|
|
899
928
|
}
|
|
900
929
|
),
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
|
|
930
|
+
/* @__PURE__ */ Re("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
931
|
+
/* @__PURE__ */ f(
|
|
932
|
+
Yr,
|
|
904
933
|
{
|
|
905
|
-
appTitle:
|
|
906
|
-
sessionTitle:
|
|
934
|
+
appTitle: wt,
|
|
935
|
+
sessionTitle: Ge ? "Loading sessions…" : pr ?? Q,
|
|
907
936
|
onCommandPalette: () => {
|
|
908
937
|
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
909
938
|
key: "k",
|
|
@@ -913,77 +942,77 @@ function zs({
|
|
|
913
942
|
cancelable: !0
|
|
914
943
|
}));
|
|
915
944
|
},
|
|
916
|
-
topBarLeft:
|
|
917
|
-
topBarRight: /* @__PURE__ */
|
|
918
|
-
|
|
919
|
-
|
|
945
|
+
topBarLeft: jn,
|
|
946
|
+
topBarRight: /* @__PURE__ */ Re(fe, { children: [
|
|
947
|
+
Vn ? /* @__PURE__ */ f(ns, {}) : null,
|
|
948
|
+
Bn
|
|
920
949
|
] })
|
|
921
950
|
}
|
|
922
951
|
),
|
|
923
|
-
|
|
924
|
-
|
|
952
|
+
Ge ? /* @__PURE__ */ f(Ts, {}) : /* @__PURE__ */ f(
|
|
953
|
+
kr,
|
|
925
954
|
{
|
|
926
|
-
className:
|
|
927
|
-
nav:
|
|
955
|
+
className: Zn,
|
|
956
|
+
nav: Bt ? "session-list" : null,
|
|
928
957
|
navParams: {
|
|
929
958
|
sessions: U,
|
|
930
959
|
activeId: Pe,
|
|
931
|
-
openIds:
|
|
932
|
-
pinnedIds:
|
|
933
|
-
onTogglePin:
|
|
934
|
-
onSwitch:
|
|
935
|
-
onOpenAsTab:
|
|
936
|
-
onCreate:
|
|
937
|
-
onDelete:
|
|
938
|
-
onLoadMore:
|
|
939
|
-
hasMore:
|
|
940
|
-
loadingMore:
|
|
941
|
-
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)
|
|
942
971
|
},
|
|
943
972
|
center: "chat",
|
|
944
|
-
centerParams:
|
|
945
|
-
chatPanes:
|
|
973
|
+
centerParams: Lr,
|
|
974
|
+
chatPanes: xr,
|
|
946
975
|
activeChatPaneId: Pe,
|
|
947
|
-
onActiveChatPaneChange:
|
|
948
|
-
onCloseChatPane:
|
|
949
|
-
onCreateChatPaneAfter:
|
|
950
|
-
onDropChatSession:
|
|
976
|
+
onActiveChatPaneChange: Rr,
|
|
977
|
+
onCloseChatPane: Tr,
|
|
978
|
+
onCreateChatPaneAfter: wr,
|
|
979
|
+
onDropChatSession: fn,
|
|
951
980
|
flashChatPaneId: (ie == null ? void 0 : ie.workspaceId) === e ? ie.id : null,
|
|
952
|
-
surface:
|
|
953
|
-
surfaceParams:
|
|
954
|
-
surfaceOverlay:
|
|
955
|
-
sidebar:
|
|
956
|
-
sidebarParams:
|
|
957
|
-
...
|
|
958
|
-
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,
|
|
959
988
|
onClose: () => {
|
|
960
|
-
be(!1),
|
|
989
|
+
be(!1), Ke(!1);
|
|
961
990
|
},
|
|
962
991
|
onCollapse: () => {
|
|
963
|
-
be(!1),
|
|
992
|
+
be(!1), Ke(!1);
|
|
964
993
|
}
|
|
965
994
|
} : void 0,
|
|
966
|
-
storageKey: C ?
|
|
967
|
-
onOpenNav:
|
|
968
|
-
|
|
995
|
+
storageKey: C ? De : void 0,
|
|
996
|
+
onOpenNav: Nt ? () => {
|
|
997
|
+
jt(!0), tt == null || tt();
|
|
969
998
|
} : void 0,
|
|
970
999
|
onOpenSurface: () => {
|
|
971
|
-
|
|
1000
|
+
ne.current = !0, z(!0), nt == null || nt();
|
|
972
1001
|
},
|
|
973
|
-
surfaceButtonBottomOffset:
|
|
974
|
-
onOpenSidebar:
|
|
975
|
-
|
|
1002
|
+
surfaceButtonBottomOffset: Xn,
|
|
1003
|
+
onOpenSidebar: dt ? () => {
|
|
1004
|
+
ne.current = !0, z(!0), be(!0), Ke(!0);
|
|
976
1005
|
} : void 0
|
|
977
1006
|
}
|
|
978
1007
|
)
|
|
979
1008
|
] }),
|
|
980
|
-
|
|
1009
|
+
b
|
|
981
1010
|
]
|
|
982
1011
|
}
|
|
983
1012
|
) });
|
|
984
1013
|
}
|
|
985
|
-
const
|
|
986
|
-
function
|
|
1014
|
+
const Os = 500;
|
|
1015
|
+
function Ls(e) {
|
|
987
1016
|
return new Promise((n, r) => {
|
|
988
1017
|
let s;
|
|
989
1018
|
const i = () => {
|
|
@@ -997,80 +1026,80 @@ function Ds(e) {
|
|
|
997
1026
|
}
|
|
998
1027
|
s = globalThis.setTimeout(() => {
|
|
999
1028
|
i(), n();
|
|
1000
|
-
},
|
|
1029
|
+
}, Os), e.addEventListener("abort", o, { once: !0 });
|
|
1001
1030
|
});
|
|
1002
1031
|
}
|
|
1003
|
-
function
|
|
1032
|
+
function Xs({
|
|
1004
1033
|
workspaceId: e,
|
|
1005
1034
|
requestHeaders: n,
|
|
1006
1035
|
apiBaseUrl: r,
|
|
1007
|
-
preloadPaths: s =
|
|
1036
|
+
preloadPaths: s = xn,
|
|
1008
1037
|
provisionWorkspace: i = !0,
|
|
1009
1038
|
loadingFallback: o,
|
|
1010
1039
|
errorFallback: c,
|
|
1011
|
-
children:
|
|
1040
|
+
children: d
|
|
1012
1041
|
}) {
|
|
1013
|
-
const [
|
|
1042
|
+
const [b, P] = x({
|
|
1014
1043
|
status: "loading",
|
|
1015
1044
|
label: "Waking workspace runtime"
|
|
1016
1045
|
});
|
|
1017
|
-
return
|
|
1018
|
-
const
|
|
1019
|
-
async function F(
|
|
1020
|
-
const
|
|
1021
|
-
headers:
|
|
1022
|
-
signal:
|
|
1023
|
-
}),
|
|
1024
|
-
if (!
|
|
1025
|
-
if (
|
|
1026
|
-
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}`);
|
|
1027
1056
|
}
|
|
1028
|
-
if (
|
|
1029
|
-
const
|
|
1030
|
-
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");
|
|
1031
1060
|
}
|
|
1032
|
-
return
|
|
1061
|
+
return Br(w) !== null && N && typeof N == "object" && Fn(r, B["x-boring-workspace-id"] ?? e, w, N), "ready";
|
|
1033
1062
|
}
|
|
1034
|
-
async function
|
|
1035
|
-
|
|
1063
|
+
async function k() {
|
|
1064
|
+
P({ status: "loading", label: "Waking workspace runtime" });
|
|
1036
1065
|
try {
|
|
1037
|
-
const
|
|
1038
|
-
let
|
|
1039
|
-
for (;
|
|
1040
|
-
if (
|
|
1041
|
-
|
|
1066
|
+
const w = Mn(s, i);
|
|
1067
|
+
let S = await Promise.all(w.map(async (h) => ({ path: h, status: await F(h) }))), N = S.filter((h) => h.status === "preparing").map((h) => h.path);
|
|
1068
|
+
for (; N.length > 0; ) {
|
|
1069
|
+
if (P({ status: "loading", label: "Workspace is still preparing" }), await Ls(y.signal), y.signal.aborted) return;
|
|
1070
|
+
S = await Promise.all(N.map(async (h) => ({ path: h, status: await F(h) }))), N = S.filter((h) => h.status === "preparing").map((h) => h.path);
|
|
1042
1071
|
}
|
|
1043
|
-
|
|
1044
|
-
} catch (
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1072
|
+
y.signal.aborted || P({ status: "ready" });
|
|
1073
|
+
} catch (w) {
|
|
1074
|
+
if (y.signal.aborted) return;
|
|
1075
|
+
P({
|
|
1047
1076
|
status: "error",
|
|
1048
|
-
message:
|
|
1077
|
+
message: w instanceof Error ? w.message : "Unknown workspace boot error"
|
|
1049
1078
|
});
|
|
1050
1079
|
}
|
|
1051
1080
|
}
|
|
1052
|
-
return
|
|
1053
|
-
}, [r, s, i, n, e]),
|
|
1054
|
-
|
|
1081
|
+
return k(), () => y.abort();
|
|
1082
|
+
}, [r, s, i, n, e]), b.status === "ready" ? /* @__PURE__ */ f(fe, { children: d }) : b.status === "error" ? typeof c == "function" ? /* @__PURE__ */ f(fe, { children: c(b.message) }) : c ? /* @__PURE__ */ f(fe, { children: c }) : /* @__PURE__ */ f(
|
|
1083
|
+
Tn,
|
|
1055
1084
|
{
|
|
1056
1085
|
title: "Workspace failed to open",
|
|
1057
|
-
description:
|
|
1086
|
+
description: b.message,
|
|
1058
1087
|
status: "Retry by reloading the page"
|
|
1059
1088
|
}
|
|
1060
|
-
) : typeof o == "function" ? /* @__PURE__ */
|
|
1061
|
-
|
|
1089
|
+
) : typeof o == "function" ? /* @__PURE__ */ f(fe, { children: o(b.label) }) : o ? /* @__PURE__ */ f(fe, { children: o }) : /* @__PURE__ */ f(
|
|
1090
|
+
Tn,
|
|
1062
1091
|
{
|
|
1063
1092
|
title: "Opening workspace",
|
|
1064
1093
|
description: "Preparing secure runtime, files, sessions, and layout.",
|
|
1065
|
-
status:
|
|
1094
|
+
status: b.label
|
|
1066
1095
|
}
|
|
1067
1096
|
);
|
|
1068
1097
|
}
|
|
1069
|
-
const
|
|
1070
|
-
function
|
|
1098
|
+
const xs = "FULL_PAGE_PANEL_MISSING_COMPONENT", Ms = "FULL_PAGE_PANEL_INVALID_PARAMS_JSON", Cs = "FULL_PAGE_PANEL_PARAMS_NOT_OBJECT", Ws = "FULL_PAGE_PANEL_UNKNOWN_COMPONENT", Fs = "FULL_PAGE_PANEL_NOT_SUPPORTED", Is = "FULL_PAGE_PANEL_RENDER_FAILED";
|
|
1099
|
+
function M() {
|
|
1071
1100
|
}
|
|
1072
|
-
const
|
|
1073
|
-
function
|
|
1101
|
+
const Gs = { dispose: M }, A = () => Gs;
|
|
1102
|
+
function $s(e) {
|
|
1074
1103
|
return {
|
|
1075
1104
|
id: `full-page:${e}`,
|
|
1076
1105
|
title: e,
|
|
@@ -1080,31 +1109,31 @@ function Fs(e) {
|
|
|
1080
1109
|
width: 0,
|
|
1081
1110
|
height: 0,
|
|
1082
1111
|
location: { type: "grid", referenceGroup: void 0 },
|
|
1083
|
-
setActive:
|
|
1112
|
+
setActive: M,
|
|
1084
1113
|
setTitle: (n) => {
|
|
1085
1114
|
document.title = n;
|
|
1086
1115
|
},
|
|
1087
|
-
setSize:
|
|
1116
|
+
setSize: M,
|
|
1088
1117
|
close: () => {
|
|
1089
1118
|
window.close();
|
|
1090
1119
|
},
|
|
1091
|
-
moveTo:
|
|
1092
|
-
maximize:
|
|
1093
|
-
exitMaximized:
|
|
1120
|
+
moveTo: M,
|
|
1121
|
+
maximize: M,
|
|
1122
|
+
exitMaximized: M,
|
|
1094
1123
|
isMaximized: () => !1,
|
|
1095
|
-
minimize:
|
|
1096
|
-
onDidActiveChange:
|
|
1097
|
-
onDidVisibilityChange:
|
|
1098
|
-
onDidDimensionsChange:
|
|
1099
|
-
onDidFocusChange:
|
|
1100
|
-
onDidLocationChange:
|
|
1101
|
-
onDidParametersChange:
|
|
1102
|
-
onDidTitleChange:
|
|
1103
|
-
onDidRenamed:
|
|
1104
|
-
onWillFocus:
|
|
1124
|
+
minimize: M,
|
|
1125
|
+
onDidActiveChange: A,
|
|
1126
|
+
onDidVisibilityChange: A,
|
|
1127
|
+
onDidDimensionsChange: A,
|
|
1128
|
+
onDidFocusChange: A,
|
|
1129
|
+
onDidLocationChange: A,
|
|
1130
|
+
onDidParametersChange: A,
|
|
1131
|
+
onDidTitleChange: A,
|
|
1132
|
+
onDidRenamed: A,
|
|
1133
|
+
onWillFocus: A
|
|
1105
1134
|
};
|
|
1106
1135
|
}
|
|
1107
|
-
function
|
|
1136
|
+
function Us() {
|
|
1108
1137
|
return {
|
|
1109
1138
|
width: window.innerWidth,
|
|
1110
1139
|
height: window.innerHeight,
|
|
@@ -1116,91 +1145,91 @@ function Is() {
|
|
|
1116
1145
|
panels: [],
|
|
1117
1146
|
groups: [],
|
|
1118
1147
|
activeGroup: void 0,
|
|
1119
|
-
addPanel:
|
|
1120
|
-
addGroup:
|
|
1121
|
-
removePanel:
|
|
1122
|
-
removeGroup:
|
|
1148
|
+
addPanel: M,
|
|
1149
|
+
addGroup: M,
|
|
1150
|
+
removePanel: M,
|
|
1151
|
+
removeGroup: M,
|
|
1123
1152
|
getPanel: () => {
|
|
1124
1153
|
},
|
|
1125
1154
|
getGroup: () => {
|
|
1126
1155
|
},
|
|
1127
|
-
moveGroupOrPanel:
|
|
1128
|
-
fromJSON:
|
|
1156
|
+
moveGroupOrPanel: M,
|
|
1157
|
+
fromJSON: M,
|
|
1129
1158
|
toJSON: () => ({}),
|
|
1130
|
-
clear:
|
|
1131
|
-
focus:
|
|
1132
|
-
layout:
|
|
1133
|
-
onDidLayoutChange:
|
|
1134
|
-
onDidLayoutFromJSON:
|
|
1135
|
-
onDidAddPanel:
|
|
1136
|
-
onDidRemovePanel:
|
|
1137
|
-
onDidActivePanelChange:
|
|
1138
|
-
onDidAddGroup:
|
|
1139
|
-
onDidRemoveGroup:
|
|
1140
|
-
onDidActiveGroupChange:
|
|
1141
|
-
onUnhandledDragOverEvent:
|
|
1142
|
-
onDidDrop:
|
|
1143
|
-
onWillDrop:
|
|
1144
|
-
onWillDragGroup:
|
|
1145
|
-
onWillDragPanel:
|
|
1146
|
-
onDidActivePanelChange_:
|
|
1159
|
+
clear: M,
|
|
1160
|
+
focus: M,
|
|
1161
|
+
layout: M,
|
|
1162
|
+
onDidLayoutChange: A,
|
|
1163
|
+
onDidLayoutFromJSON: A,
|
|
1164
|
+
onDidAddPanel: A,
|
|
1165
|
+
onDidRemovePanel: A,
|
|
1166
|
+
onDidActivePanelChange: A,
|
|
1167
|
+
onDidAddGroup: A,
|
|
1168
|
+
onDidRemoveGroup: A,
|
|
1169
|
+
onDidActiveGroupChange: A,
|
|
1170
|
+
onUnhandledDragOverEvent: A,
|
|
1171
|
+
onDidDrop: A,
|
|
1172
|
+
onWillDrop: A,
|
|
1173
|
+
onWillDragGroup: A,
|
|
1174
|
+
onWillDragPanel: A,
|
|
1175
|
+
onDidActivePanelChange_: A
|
|
1147
1176
|
};
|
|
1148
1177
|
}
|
|
1149
|
-
function
|
|
1150
|
-
return /* @__PURE__ */
|
|
1178
|
+
function vt({ code: e, title: n, description: r }) {
|
|
1179
|
+
return /* @__PURE__ */ f(
|
|
1151
1180
|
"div",
|
|
1152
1181
|
{
|
|
1153
1182
|
className: "flex min-h-screen items-center justify-center bg-background p-6 text-foreground",
|
|
1154
1183
|
"data-testid": "full-page-error-state",
|
|
1155
1184
|
"data-full-page-error-code": e,
|
|
1156
|
-
children: /* @__PURE__ */
|
|
1185
|
+
children: /* @__PURE__ */ f(ts, { className: "w-full max-w-lg", title: n, description: r })
|
|
1157
1186
|
}
|
|
1158
1187
|
);
|
|
1159
1188
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const r =
|
|
1162
|
-
|
|
1189
|
+
function Zs({ componentId: e, params: n = {} }) {
|
|
1190
|
+
const r = In(), { errors: s } = Vr(), i = r.get(e), o = r.getComponents()[e];
|
|
1191
|
+
Fr(() => {
|
|
1163
1192
|
document.title = (i == null ? void 0 : i.title) ?? e;
|
|
1164
1193
|
}, [e, i == null ? void 0 : i.title]);
|
|
1165
1194
|
const c = L(() => ({
|
|
1166
1195
|
params: n,
|
|
1167
|
-
api:
|
|
1168
|
-
containerApi:
|
|
1196
|
+
api: $s(e),
|
|
1197
|
+
containerApi: Us(),
|
|
1169
1198
|
className: "h-full"
|
|
1170
|
-
}), [e, n]),
|
|
1199
|
+
}), [e, n]), d = L(() => {
|
|
1171
1200
|
if (!i) return null;
|
|
1172
|
-
const
|
|
1173
|
-
for (let
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1176
|
-
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;
|
|
1177
1206
|
}
|
|
1178
1207
|
return null;
|
|
1179
1208
|
}, [e, s, i]);
|
|
1180
|
-
return i ? !i.supportsFullPage || !o ? /* @__PURE__ */
|
|
1181
|
-
|
|
1209
|
+
return i ? !i.supportsFullPage || !o ? /* @__PURE__ */ f(
|
|
1210
|
+
vt,
|
|
1182
1211
|
{
|
|
1183
|
-
code:
|
|
1212
|
+
code: Fs,
|
|
1184
1213
|
title: "Panel does not support full-page mode",
|
|
1185
1214
|
description: `Panel "${e}" can render in the workspace, but it has not opted into the dedicated full-page pane route.`
|
|
1186
1215
|
}
|
|
1187
|
-
) :
|
|
1188
|
-
|
|
1216
|
+
) : d ? /* @__PURE__ */ f(
|
|
1217
|
+
vt,
|
|
1189
1218
|
{
|
|
1190
|
-
code:
|
|
1219
|
+
code: Is,
|
|
1191
1220
|
title: "Panel failed to render",
|
|
1192
|
-
description: `Panel "${e}" crashed while rendering in full-page mode: ${
|
|
1221
|
+
description: `Panel "${e}" crashed while rendering in full-page mode: ${d.error.message}`
|
|
1193
1222
|
}
|
|
1194
|
-
) : /* @__PURE__ */
|
|
1195
|
-
|
|
1223
|
+
) : /* @__PURE__ */ f("div", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ f(zr, { mode: "full-page", children: /* @__PURE__ */ f(o, { ...c }) }) }) : /* @__PURE__ */ f(
|
|
1224
|
+
vt,
|
|
1196
1225
|
{
|
|
1197
|
-
code:
|
|
1226
|
+
code: Ws,
|
|
1198
1227
|
title: "Unknown panel",
|
|
1199
1228
|
description: `No full-page panel component is registered as "${e}".`
|
|
1200
1229
|
}
|
|
1201
1230
|
);
|
|
1202
1231
|
}
|
|
1203
|
-
function
|
|
1232
|
+
function ei(e) {
|
|
1204
1233
|
var o;
|
|
1205
1234
|
const n = new URLSearchParams(e), r = ((o = n.get("component")) == null ? void 0 : o.trim()) ?? "";
|
|
1206
1235
|
if (!r)
|
|
@@ -1208,7 +1237,7 @@ function Qs(e) {
|
|
|
1208
1237
|
componentId: null,
|
|
1209
1238
|
params: {},
|
|
1210
1239
|
error: {
|
|
1211
|
-
code:
|
|
1240
|
+
code: xs,
|
|
1212
1241
|
message: "Missing full-page panel component id."
|
|
1213
1242
|
}
|
|
1214
1243
|
};
|
|
@@ -1223,7 +1252,7 @@ function Qs(e) {
|
|
|
1223
1252
|
componentId: null,
|
|
1224
1253
|
params: {},
|
|
1225
1254
|
error: {
|
|
1226
|
-
code:
|
|
1255
|
+
code: Ms,
|
|
1227
1256
|
message: "Invalid full-page panel params JSON."
|
|
1228
1257
|
}
|
|
1229
1258
|
};
|
|
@@ -1232,23 +1261,23 @@ function Qs(e) {
|
|
|
1232
1261
|
componentId: null,
|
|
1233
1262
|
params: {},
|
|
1234
1263
|
error: {
|
|
1235
|
-
code:
|
|
1264
|
+
code: Cs,
|
|
1236
1265
|
message: "Full-page panel params must be a JSON object."
|
|
1237
1266
|
}
|
|
1238
1267
|
} : { componentId: r, params: i };
|
|
1239
1268
|
}
|
|
1240
1269
|
export {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1270
|
+
Ms as FULL_PAGE_PANEL_INVALID_PARAMS_JSON,
|
|
1271
|
+
xs as FULL_PAGE_PANEL_MISSING_COMPONENT,
|
|
1272
|
+
Fs as FULL_PAGE_PANEL_NOT_SUPPORTED,
|
|
1273
|
+
Cs as FULL_PAGE_PANEL_PARAMS_NOT_OBJECT,
|
|
1274
|
+
Is as FULL_PAGE_PANEL_RENDER_FAILED,
|
|
1275
|
+
Ws as FULL_PAGE_PANEL_UNKNOWN_COMPONENT,
|
|
1276
|
+
Qs as WorkspaceAgentFront,
|
|
1277
|
+
ms as WorkspaceBackgroundBoot,
|
|
1278
|
+
Xs as WorkspaceBootGate,
|
|
1279
|
+
Zs as WorkspaceFullPagePanel,
|
|
1280
|
+
os as createLocalStorageSessions,
|
|
1281
|
+
ei as parseFullPagePanelLocation,
|
|
1282
|
+
as as useLocalStorageSessions
|
|
1254
1283
|
};
|