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