@hachej/boring-workspace 0.1.40 → 0.1.42
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/README.md +26 -261
- package/dist/{FileTree-DNIzusWa.js → FileTree-CVsvICGP.js} +1 -1
- package/dist/MarkdownEditor-BvaGmzWP.js +582 -0
- package/dist/{WorkspaceLoadingState-EratTJfG.js → WorkspaceLoadingState-yp4vNmrT.js} +21 -22
- package/dist/{WorkspaceProvider-uuxyAx3i.js → WorkspaceProvider-DkZAxsYo.js} +2902 -2741
- package/dist/app-front.d.ts +5 -0
- package/dist/app-front.js +221 -217
- package/dist/app-server.d.ts +2 -2
- package/dist/app-server.js +23 -5
- package/dist/{createInMemoryBridge-DSjZ9efK.d.ts → createInMemoryBridge-siFWq_R_.d.ts} +8 -0
- package/dist/plugin.d.ts +4 -2
- package/dist/server.d.ts +3 -3
- package/dist/server.js +23 -5
- package/dist/shared.d.ts +1 -1
- package/dist/{surface-obE7YwJk.d.ts → surface-DmIalUmP.d.ts} +2 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +1 -1
- package/dist/workspace.css +112 -16
- package/dist/workspace.d.ts +8 -2
- package/dist/workspace.js +5 -5
- package/docs/INTERFACES.md +1 -1
- package/docs/PLUGIN_STRUCTURE.md +3 -3
- package/docs/PLUGIN_SYSTEM.md +46 -4
- package/docs/README.md +85 -22
- package/package.json +4 -4
- package/dist/MarkdownEditor-DhVfKSAq.js +0 -549
- /package/docs/plans/{ASK_USER_QUESTIONS_PLUGIN_SPEC.md → archive/ASK_USER_QUESTIONS_PLUGIN_SPEC.md} +0 -0
- /package/docs/plans/{FULL_PAGE_PANEL_ROUTE_SPEC.md → archive/FULL_PAGE_PANEL_ROUTE_SPEC.md} +0 -0
- /package/docs/plans/{GENERIC_EXPLORER_PLUGIN_PLAN.md → archive/GENERIC_EXPLORER_PLUGIN_PLAN.md} +0 -0
- /package/docs/plans/{PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md → archive/PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md} +0 -0
- /package/docs/plans/{PLUGIN_OUTPUTS_ISOLATION_PLAN.md → archive/PLUGIN_OUTPUTS_ISOLATION_PLAN.md} +0 -0
- /package/docs/plans/{README.md → archive/README.md} +0 -0
- /package/docs/plans/{UI_BRIDGE_OWNERSHIP_REFACTOR.md → archive/UI_BRIDGE_OWNERSHIP_REFACTOR.md} +0 -0
package/dist/app-front.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as f, jsxs as ye, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as A, useSyncExternalStore as vr, useMemo as
|
|
2
|
+
import { useEffect as A, useSyncExternalStore as vr, useMemo as W, useState as O, useCallback as w, useRef as j, useLayoutEffect as Sr } from "react";
|
|
3
3
|
import { PiChatPanel as br, usePiSessions as yr } from "@hachej/boring-agent/front";
|
|
4
|
-
import { aj as Pr, at as
|
|
5
|
-
import { T as Lr, C as Or, r as dn, w as xr, W as fn } from "./WorkspaceLoadingState-
|
|
4
|
+
import { aj as Pr, at as ze, au as bn, av as yn, aw as Pn, ax as An, ay as Ve, az as ht, aA as vt, aB as En, aC as Ar, aD as qe, aE as Er, U as un, aF as wr, q as Tr, aG as Nr, u as wn, aH as Rr, ag as Dr, aI as _r } from "./WorkspaceProvider-DkZAxsYo.js";
|
|
5
|
+
import { T as Lr, C as Or, r as dn, w as xr, W as fn } from "./WorkspaceLoadingState-yp4vNmrT.js";
|
|
6
6
|
import { Sun as Mr, Moon as Cr } from "lucide-react";
|
|
7
7
|
import { IconButton as Wr, ErrorState as Fr } from "@hachej/boring-ui-kit";
|
|
8
8
|
function Gr() {
|
|
@@ -104,7 +104,7 @@ function gn(e) {
|
|
|
104
104
|
}
|
|
105
105
|
async function Hr(e) {
|
|
106
106
|
const n = e.body;
|
|
107
|
-
if (!n) return
|
|
107
|
+
if (!n) return qe(await Ve(e));
|
|
108
108
|
const r = n.getReader(), i = new TextDecoder();
|
|
109
109
|
let o = "";
|
|
110
110
|
try {
|
|
@@ -112,11 +112,11 @@ async function Hr(e) {
|
|
|
112
112
|
const { done: s, value: c } = await r.read();
|
|
113
113
|
if (c) {
|
|
114
114
|
o += i.decode(c, { stream: !s });
|
|
115
|
-
const u =
|
|
115
|
+
const u = qe(o);
|
|
116
116
|
if (u) return u;
|
|
117
117
|
}
|
|
118
118
|
if (s)
|
|
119
|
-
return o += i.decode(),
|
|
119
|
+
return o += i.decode(), qe(o);
|
|
120
120
|
}
|
|
121
121
|
} finally {
|
|
122
122
|
await r.cancel().catch(() => {
|
|
@@ -133,9 +133,9 @@ function qr(e) {
|
|
|
133
133
|
}
|
|
134
134
|
async function zr(e) {
|
|
135
135
|
if (!e.ok) {
|
|
136
|
-
const o = await
|
|
137
|
-
if (
|
|
138
|
-
throw new Error(
|
|
136
|
+
const o = await Ve(e);
|
|
137
|
+
if (ht(o)) return { status: "preparing" };
|
|
138
|
+
throw new Error(vt(o) ?? `/api/v1/ready-status failed with ${e.status}`);
|
|
139
139
|
}
|
|
140
140
|
const n = await Hr(e), r = qr(n), i = Ar(n);
|
|
141
141
|
if ((n == null ? void 0 : n.state) === "degraded" || (n == null ? void 0 : n.state) === "failed") {
|
|
@@ -157,11 +157,11 @@ async function Vr({
|
|
|
157
157
|
try {
|
|
158
158
|
const S = await fetch(Pn(e, n), { headers: r, signal: s.signal });
|
|
159
159
|
if (An(n)) return await zr(S);
|
|
160
|
-
const y = await
|
|
160
|
+
const y = await Ve(S);
|
|
161
161
|
if (!S.ok) {
|
|
162
|
-
const b =
|
|
162
|
+
const b = ht(y);
|
|
163
163
|
if (b) return { status: "preparing", ...b };
|
|
164
|
-
throw new Error(
|
|
164
|
+
throw new Error(vt(y) ?? `${n} failed with ${S.status}`);
|
|
165
165
|
}
|
|
166
166
|
return y && typeof y == "object" && En(e, r["x-boring-workspace-id"] ?? o, n, y), { status: "ready" };
|
|
167
167
|
} catch (S) {
|
|
@@ -182,42 +182,42 @@ function Yr({
|
|
|
182
182
|
}) {
|
|
183
183
|
return A(() => {
|
|
184
184
|
let c = !1;
|
|
185
|
-
const u = new AbortController(), S =
|
|
185
|
+
const u = new AbortController(), S = ze(e, n);
|
|
186
186
|
async function y() {
|
|
187
187
|
var b, B;
|
|
188
188
|
s == null || s({ status: "preparing" });
|
|
189
189
|
try {
|
|
190
|
-
const
|
|
190
|
+
const F = yn(i, o), k = (p) => Vr({
|
|
191
191
|
apiBaseUrl: r,
|
|
192
|
-
path:
|
|
192
|
+
path: p,
|
|
193
193
|
headers: S,
|
|
194
194
|
signal: u.signal,
|
|
195
195
|
workspaceId: e
|
|
196
196
|
});
|
|
197
|
-
let T = await Promise.all(
|
|
197
|
+
let T = await Promise.all(F.map(async (p) => ({ path: p, result: await k(p) })));
|
|
198
198
|
if (c || u.signal.aborted) return;
|
|
199
|
-
let h = (b = T.find((
|
|
199
|
+
let h = (b = T.find((p) => p.result.runtimeDependencies)) == null ? void 0 : b.result.runtimeDependencies, N = T.filter((p) => p.result.status === "preparing");
|
|
200
200
|
for (; N.length > 0; ) {
|
|
201
|
-
let
|
|
202
|
-
for (const
|
|
203
|
-
if (
|
|
204
|
-
|
|
201
|
+
let p;
|
|
202
|
+
for (const R of N)
|
|
203
|
+
if (R.result.status === "preparing" && R.result.requirement) {
|
|
204
|
+
p = R.result.requirement;
|
|
205
205
|
break;
|
|
206
206
|
}
|
|
207
|
-
if (s == null || s({ status: "preparing", message: "Workspace is still preparing", ...
|
|
208
|
-
h = ((B = T.find((
|
|
207
|
+
if (s == null || s({ status: "preparing", message: "Workspace is still preparing", ...p ? { requirement: p } : {} }), await gn(u.signal), c || u.signal.aborted || (T = await Promise.all(N.map(async (R) => ({ path: R.path, result: await k(R.path) }))), c || u.signal.aborted)) return;
|
|
208
|
+
h = ((B = T.find((R) => R.result.runtimeDependencies)) == null ? void 0 : B.result.runtimeDependencies) ?? h, N = T.filter((R) => R.result.status === "preparing");
|
|
209
209
|
}
|
|
210
210
|
for (s == null || s({ status: "ready", ...h ? { runtimeDependencies: h } : {} }); (h == null ? void 0 : h.state) === "preparing"; ) {
|
|
211
211
|
if (await gn(u.signal), c || u.signal.aborted) return;
|
|
212
|
-
const
|
|
212
|
+
const p = await k("/api/v1/ready-status");
|
|
213
213
|
if (c || u.signal.aborted) return;
|
|
214
|
-
h =
|
|
214
|
+
h = p.runtimeDependencies, h && (s == null || s({ status: "ready", runtimeDependencies: h }));
|
|
215
215
|
}
|
|
216
|
-
} catch (
|
|
216
|
+
} catch (F) {
|
|
217
217
|
if (c || u.signal.aborted) return;
|
|
218
218
|
s == null || s({
|
|
219
219
|
status: "failed",
|
|
220
|
-
message:
|
|
220
|
+
message: F instanceof Error ? F.message : "Workspace failed to prepare"
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -229,7 +229,7 @@ function Yr({
|
|
|
229
229
|
function kr(e) {
|
|
230
230
|
return typeof (e == null ? void 0 : e.id) == "string" ? e.id : null;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function He(e, n, r) {
|
|
233
233
|
if (e.includes(r)) return e;
|
|
234
234
|
const i = n ? e.indexOf(n) : -1, o = i >= 0 ? i + 1 : e.length;
|
|
235
235
|
return [...e.slice(0, o), r, ...e.slice(o)];
|
|
@@ -246,7 +246,7 @@ function Xr(e, n) {
|
|
|
246
246
|
function Qr(e, n) {
|
|
247
247
|
return e.endsWith(":surface") ? e.slice(0, -8) : n;
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function gt(e, n, r) {
|
|
250
250
|
const [i, o] = O(() => dn(e, n, r));
|
|
251
251
|
A(() => {
|
|
252
252
|
o(dn(e, n, r));
|
|
@@ -259,7 +259,7 @@ function ft(e, n, r) {
|
|
|
259
259
|
);
|
|
260
260
|
return [i, s];
|
|
261
261
|
}
|
|
262
|
-
const
|
|
262
|
+
const mt = {}, Zr = [], pn = { status: "preparing" }, hn = {
|
|
263
263
|
openTabs: [],
|
|
264
264
|
activeTab: null
|
|
265
265
|
};
|
|
@@ -420,106 +420,106 @@ function Mi({
|
|
|
420
420
|
panels: y,
|
|
421
421
|
commands: b,
|
|
422
422
|
catalogs: B,
|
|
423
|
-
plugins:
|
|
423
|
+
plugins: F,
|
|
424
424
|
excludeDefaults: k,
|
|
425
425
|
capabilities: T,
|
|
426
426
|
apiBaseUrl: h,
|
|
427
427
|
authHeaders: N,
|
|
428
|
-
apiTimeout:
|
|
429
|
-
defaultTheme:
|
|
428
|
+
apiTimeout: p,
|
|
429
|
+
defaultTheme: R,
|
|
430
430
|
onThemeChange: Tn,
|
|
431
|
-
persistenceEnabled:
|
|
432
|
-
bridgeEndpoint:
|
|
431
|
+
persistenceEnabled: St,
|
|
432
|
+
bridgeEndpoint: Ye,
|
|
433
433
|
fullPageBasePath: Nn,
|
|
434
|
-
onAuthError:
|
|
435
|
-
sessions:
|
|
436
|
-
activeSessionId:
|
|
437
|
-
onSwitchSession:
|
|
438
|
-
onCreateSession:
|
|
439
|
-
onDeleteSession:
|
|
434
|
+
onAuthError: Rn,
|
|
435
|
+
sessions: bt,
|
|
436
|
+
activeSessionId: yt,
|
|
437
|
+
onSwitchSession: Pt,
|
|
438
|
+
onCreateSession: At,
|
|
439
|
+
onDeleteSession: Et,
|
|
440
440
|
onActiveSessionIdChange: Pe,
|
|
441
|
-
appTitle:
|
|
441
|
+
appTitle: Dn = "Boring",
|
|
442
442
|
workspaceLabel: _n,
|
|
443
443
|
defaultSessionTitle: q = "New session",
|
|
444
|
-
navEnabled:
|
|
444
|
+
navEnabled: wt = !0,
|
|
445
445
|
defaultNavOpen: Ln = !1,
|
|
446
446
|
defaultSurfaceOpen: On,
|
|
447
447
|
defaultWorkbenchLeftTab: Ae,
|
|
448
|
-
surfaceInitialPanels:
|
|
448
|
+
surfaceInitialPanels: Tt,
|
|
449
449
|
topBarLeft: xn,
|
|
450
450
|
topBarRight: Mn,
|
|
451
451
|
showThemeToggle: Cn = !0,
|
|
452
452
|
chatParams: _,
|
|
453
|
-
hotReloadEnabled:
|
|
453
|
+
hotReloadEnabled: ke,
|
|
454
454
|
frontPluginHotReload: Wn,
|
|
455
|
-
extraPanels:
|
|
456
|
-
extraCommands:
|
|
457
|
-
provisionWorkspace:
|
|
455
|
+
extraPanels: Nt,
|
|
456
|
+
extraCommands: Rt,
|
|
457
|
+
provisionWorkspace: Xe,
|
|
458
458
|
bootPreloadPaths: Fn,
|
|
459
459
|
onWorkspaceWarmupStatusChange: Ee,
|
|
460
|
-
onOpenNav:
|
|
461
|
-
onOpenSurface:
|
|
460
|
+
onOpenNav: Qe,
|
|
461
|
+
onOpenSurface: Ze,
|
|
462
462
|
surfaceButtonBottomOffset: Gn,
|
|
463
463
|
className: In
|
|
464
464
|
}) {
|
|
465
465
|
var nn, rn;
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
), x =
|
|
470
|
-
() =>
|
|
466
|
+
const et = s ?? `boring-ui-v2:layout:${e}`, G = c ?? `${et}:surface`, we = Qr(
|
|
467
|
+
G,
|
|
468
|
+
et
|
|
469
|
+
), x = St !== !1, Te = o ?? `boring-workspace:sessions:${e}`, X = W(
|
|
470
|
+
() => ze(e, i ?? mt),
|
|
471
471
|
[i, e]
|
|
472
|
-
), $n =
|
|
473
|
-
() =>
|
|
472
|
+
), $n = W(
|
|
473
|
+
() => ze(e, { ...i ?? mt, ...N ?? mt }),
|
|
474
474
|
[N, i, e]
|
|
475
|
-
), Ne =
|
|
475
|
+
), Ne = W(
|
|
476
476
|
() => Kr({ storageKey: Te }),
|
|
477
477
|
[Te]
|
|
478
|
-
), Dt = Jr(Ne), [
|
|
478
|
+
), Dt = Jr(Ne), [_t, Un] = O(() => ({
|
|
479
479
|
workspaceId: e,
|
|
480
480
|
status: pn
|
|
481
|
-
})), [
|
|
481
|
+
})), [Re, tt] = O(() => ({
|
|
482
482
|
workspaceId: e,
|
|
483
483
|
expired: !1
|
|
484
|
-
})), [
|
|
484
|
+
})), [Lt, De] = O(() => ({
|
|
485
485
|
workspaceId: e,
|
|
486
486
|
creating: !1
|
|
487
|
-
})), [
|
|
487
|
+
})), [Ot, _e] = O(() => ({
|
|
488
488
|
workspaceId: e,
|
|
489
489
|
failed: !1
|
|
490
|
-
})), [
|
|
490
|
+
})), [nt, xt] = O(null), ue = `boring-workspace:chat-panes:${e}`, [D, z] = O(
|
|
491
491
|
() => (x ? vn(ue, e) : null) ?? { workspaceId: e, ids: [], activeId: null }
|
|
492
|
-
), [re,
|
|
492
|
+
), [re, Mt] = O(null);
|
|
493
493
|
A(() => {
|
|
494
494
|
if (!re) return;
|
|
495
|
-
const t = setTimeout(() =>
|
|
495
|
+
const t = setTimeout(() => Mt(null), 700);
|
|
496
496
|
return () => clearTimeout(t);
|
|
497
497
|
}, [re]);
|
|
498
|
-
const de = `boring-workspace:pinned-sessions:${e}`, [
|
|
498
|
+
const de = `boring-workspace:pinned-sessions:${e}`, [Ct, Wt] = O(
|
|
499
499
|
() => (x ? Sn(de, e) : null) ?? { workspaceId: e, ids: [] }
|
|
500
|
-
), Kn =
|
|
500
|
+
), Kn = Ct.workspaceId === e ? Ct.ids : Zr;
|
|
501
501
|
A(() => {
|
|
502
|
-
|
|
502
|
+
Wt((t) => t.workspaceId === e ? t : (x ? Sn(de, e) : null) ?? { workspaceId: e, ids: [] });
|
|
503
503
|
}, [de, x, e]);
|
|
504
504
|
const Jn = w((t) => {
|
|
505
|
-
|
|
505
|
+
Wt((a) => {
|
|
506
506
|
const l = a.workspaceId === e ? a.ids : [], g = l.includes(t) ? l.filter((v) => v !== t) : [t, ...l];
|
|
507
507
|
return x && si(de, g), { workspaceId: e, ids: g };
|
|
508
508
|
});
|
|
509
509
|
}, [de, x, e]);
|
|
510
510
|
A(() => {
|
|
511
|
-
x &&
|
|
512
|
-
}, [
|
|
511
|
+
x && D.workspaceId === e && oi(ue, D);
|
|
512
|
+
}, [D, ue, x, e]), A(() => {
|
|
513
513
|
z((t) => t.workspaceId === e ? t : (x ? vn(ue, e) : null) ?? { workspaceId: e, ids: [], activeId: null });
|
|
514
514
|
}, [ue, x, e]);
|
|
515
|
-
const Le =
|
|
515
|
+
const Le = _t.workspaceId === e ? _t.status : pn, jn = n ?? br, Bn = r ?? ti, ie = !n || !!r, Oe = ie && Xe !== !1, rt = () => {
|
|
516
516
|
}, M = Bn({
|
|
517
517
|
requestHeaders: X,
|
|
518
518
|
storageKey: Te,
|
|
519
519
|
workspaceId: e,
|
|
520
520
|
apiBaseUrl: h,
|
|
521
521
|
enabled: Oe
|
|
522
|
-
}), [fe, Hn] = O(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), qn = Oe && M.workspaceId != null && M.workspaceId !== e, V = Oe && !M.loading && !M.error && !qn,
|
|
522
|
+
}), [fe, Hn] = O(() => ({ workspaceId: e, sessions: [], activeSessionId: null })), qn = Oe && M.workspaceId != null && M.workspaceId !== e, V = Oe && !M.loading && !M.error && !qn, I = Oe && !V;
|
|
523
523
|
A(() => {
|
|
524
524
|
V && Hn((t) => {
|
|
525
525
|
const a = t.workspaceId === e, l = t.activeSessionId === M.activeSessionId, g = t.sessions.length === M.sessions.length && t.sessions.every((v, E) => {
|
|
@@ -533,31 +533,31 @@ function Mi({
|
|
|
533
533
|
};
|
|
534
534
|
});
|
|
535
535
|
}, [M.activeSessionId, M.sessions, V, e]);
|
|
536
|
-
const
|
|
536
|
+
const it = I && fe.workspaceId === e && fe.sessions.length > 0, ot = I ? ii(Te) : null, Y = V ? M.sessions : it ? fe.sessions : [], zn = V ? M.activeSessionId : it ? fe.activeSessionId : null, d = ie && (V || it) ? M : void 0, ge = bt !== void 0 || yt !== void 0 || Pt !== void 0 || At !== void 0 || Et !== void 0, Ft = Re.workspaceId === e && Re.expired, me = j(!1), pe = !!(V && d && !ge && Y.length === 0 && !Ft), Vn = Lt.workspaceId === e && Lt.creating, Yn = Ot.workspaceId === e && Ot.failed, kn = !!(V && d && !ge && Y.length === 0 && Ft && !me.current && !Yn), xe = pe || Vn || kn;
|
|
537
537
|
A(() => {
|
|
538
538
|
if (!pe) {
|
|
539
|
-
|
|
539
|
+
Re.workspaceId !== e && tt({ workspaceId: e, expired: !1 });
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
|
-
|
|
542
|
+
tt({ workspaceId: e, expired: !1 });
|
|
543
543
|
const t = globalThis.setTimeout(() => {
|
|
544
|
-
|
|
544
|
+
tt({ workspaceId: e, expired: !0 });
|
|
545
545
|
}, 2e3);
|
|
546
546
|
return () => globalThis.clearTimeout(t);
|
|
547
|
-
}, [
|
|
547
|
+
}, [Re.workspaceId, pe, e]);
|
|
548
548
|
const Xn = d ? Y.map((t) => ({
|
|
549
549
|
...t,
|
|
550
550
|
title: t.title ?? "New session"
|
|
551
|
-
})) : void 0, Qn =
|
|
552
|
-
id:
|
|
551
|
+
})) : void 0, Qn = ot ? [{
|
|
552
|
+
id: ot,
|
|
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
|
-
}] : [], $ = d ? Xn ?? [] :
|
|
557
|
+
}] : [], $ = d ? Xn ?? [] : I ? Qn : ge ? bt ?? [] : Dt.sessions, Zn = d ? zn ?? null : I ? ot : ge ? yt ?? null : Dt.activeId, oe = (_ == null ? void 0 : _.autoSubmitInitialDraft) === !0, Me = oe && ie && !ge, [U, he] = O(() => Me ? null : void 0), Gt = j(e), se = j(!1);
|
|
558
558
|
A(() => {
|
|
559
|
-
if (
|
|
560
|
-
|
|
559
|
+
if (Gt.current !== e) {
|
|
560
|
+
Gt.current = e, se.current = !1, he(Me ? null : void 0);
|
|
561
561
|
return;
|
|
562
562
|
}
|
|
563
563
|
Me && U === void 0 && (se.current = !1, he(null));
|
|
@@ -570,170 +570,170 @@ function Mi({
|
|
|
570
570
|
se.current = !1, he(void 0);
|
|
571
571
|
}));
|
|
572
572
|
}, [U, q, d]);
|
|
573
|
-
const
|
|
574
|
-
const t = Y.find((l) => l.id ===
|
|
573
|
+
const C = U !== void 0 ? U ?? null : Zn, J = I ? rt : (d == null ? void 0 : d.switch) ?? Pt ?? Ne.switchTo, Ce = w((t) => (C && t !== C && window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: C } })), J(t)), [C, J]), st = I ? rt : d ? () => {
|
|
574
|
+
const t = Y.find((l) => l.id === C && Xr(l, q)), a = d.create();
|
|
575
575
|
return t && Promise.resolve(a).then(() => d.delete(t.id)).catch(() => {
|
|
576
576
|
}), a;
|
|
577
|
-
} :
|
|
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(
|
|
578
578
|
`${we}:drawer`,
|
|
579
579
|
Ln,
|
|
580
580
|
x
|
|
581
|
-
),
|
|
581
|
+
), Kt = wt && tr, [Q, H] = gt(
|
|
582
582
|
// Key must NOT match resolvedSurfaceStorageKey (which stores the dockview
|
|
583
583
|
// layout JSON at the same ":surface" suffix). Writing "1"/"0" to the same
|
|
584
584
|
// key corrupts the JSON and drops the persisted workbench layout on reload.
|
|
585
585
|
`${we}:workbenchOpen`,
|
|
586
586
|
On ?? !1,
|
|
587
587
|
x
|
|
588
|
-
), [nr,
|
|
588
|
+
), [nr, at] = O(!1), [rr, ve] = gt(
|
|
589
589
|
`${we}:workbenchLeftOpen`,
|
|
590
590
|
!0,
|
|
591
591
|
x
|
|
592
|
-
), Se = j(!1), Z = j(null), ee = j(Q),
|
|
593
|
-
|
|
594
|
-
const [
|
|
595
|
-
key:
|
|
592
|
+
), Se = j(!1), Z = j(null), ee = j(Q), Jt = j(G), lt = j(null);
|
|
593
|
+
Jt.current = G;
|
|
594
|
+
const [jt, Bt] = O(() => ({
|
|
595
|
+
key: G,
|
|
596
596
|
snapshot: hn
|
|
597
|
-
})), ir =
|
|
597
|
+
})), ir = jt.key === G ? jt.snapshot : hn;
|
|
598
598
|
A(() => {
|
|
599
|
-
Se.current = !1, me.current = !1,
|
|
599
|
+
Se.current = !1, me.current = !1, De({ workspaceId: e, creating: !1 }), _e({ workspaceId: e, failed: !1 }), xt(null);
|
|
600
600
|
}, [e]), A(() => {
|
|
601
|
-
|
|
602
|
-
}, [
|
|
601
|
+
at(!1);
|
|
602
|
+
}, [G]), A(() => {
|
|
603
603
|
if (!(!d || d.loading) && !pe && U === void 0) {
|
|
604
604
|
if (Y.length > 0) {
|
|
605
|
-
Se.current = !1, me.current = !1,
|
|
605
|
+
Se.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
606
|
return;
|
|
607
607
|
}
|
|
608
|
-
me.current || Se.current || (Se.current = !0,
|
|
608
|
+
me.current || Se.current || (Se.current = !0, De({ workspaceId: e, creating: !0 }), _e({ workspaceId: e, failed: !1 }), Promise.resolve(d.create({ title: q })).then((t) => {
|
|
609
609
|
const a = t == null ? void 0 : t.id;
|
|
610
|
-
typeof a == "string" &&
|
|
610
|
+
typeof a == "string" && xt({ workspaceId: e, id: a });
|
|
611
611
|
}).catch(() => {
|
|
612
|
-
Se.current = !1,
|
|
612
|
+
Se.current = !1, De({ workspaceId: e, creating: !1 }), _e({ workspaceId: e, failed: !0 });
|
|
613
613
|
}));
|
|
614
614
|
}
|
|
615
615
|
}, [Y.length, U, q, pe, d, e]), A(() => {
|
|
616
616
|
ee.current = Q;
|
|
617
617
|
}, [Q]);
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
key:
|
|
618
|
+
const Ht = w((t) => {
|
|
619
|
+
lt.current = { key: G, api: t }, at(!0), Bt({
|
|
620
|
+
key: G,
|
|
621
621
|
snapshot: t.getSnapshot()
|
|
622
622
|
});
|
|
623
|
-
}, [
|
|
624
|
-
|
|
625
|
-
key:
|
|
623
|
+
}, [G]), qt = w((t) => {
|
|
624
|
+
Bt({
|
|
625
|
+
key: G,
|
|
626
626
|
snapshot: t
|
|
627
627
|
});
|
|
628
|
-
}, [
|
|
629
|
-
const t =
|
|
630
|
-
return (t == null ? void 0 : t.key) ===
|
|
628
|
+
}, [G]), We = w(() => {
|
|
629
|
+
const t = lt.current;
|
|
630
|
+
return (t == null ? void 0 : t.key) === Jt.current ? t.api : null;
|
|
631
631
|
}, []), Fe = w(() => ee.current, []), Ge = w(() => {
|
|
632
632
|
ee.current = !0, H(!0);
|
|
633
633
|
}, [H]), Ie = w(() => {
|
|
634
634
|
ee.current = !0, H(!0), ve(!0);
|
|
635
635
|
}, [H, ve]), $e = w(() => {
|
|
636
|
-
ee.current = !1,
|
|
637
|
-
}, [H]), ae =
|
|
638
|
-
() => (
|
|
639
|
-
[
|
|
640
|
-
),
|
|
636
|
+
ee.current = !1, lt.current = null, at(!1), H(!1);
|
|
637
|
+
}, [H]), ae = W(
|
|
638
|
+
() => (F == null ? void 0 : F.map(Er)) ?? [],
|
|
639
|
+
[F]
|
|
640
|
+
), ct = W(
|
|
641
641
|
() => ae.some((t) => t.registrations.leftTabs.length > 0),
|
|
642
642
|
[ae]
|
|
643
|
-
),
|
|
643
|
+
), zt = W(
|
|
644
644
|
() => ae.flatMap((t) => t.registrations.panels.map((a) => a.id)),
|
|
645
645
|
[ae]
|
|
646
|
-
),
|
|
646
|
+
), Vt = W(() => {
|
|
647
647
|
const t = {};
|
|
648
648
|
for (const a of ae)
|
|
649
649
|
for (const l of a.registrations.toolRenderers)
|
|
650
650
|
t[l.id] = l.render;
|
|
651
651
|
return t;
|
|
652
|
-
}, [ae]),
|
|
653
|
-
() => [...
|
|
654
|
-
[
|
|
655
|
-
),
|
|
652
|
+
}, [ae]), Yt = W(
|
|
653
|
+
() => [...Nt ?? [], ...zt],
|
|
654
|
+
[Nt, zt]
|
|
655
|
+
), m = ie && !r && fe.workspaceId !== e ? "default" : C ?? (U !== void 0 ? "default" : ((rn = $[0]) == null ? void 0 : rn.id) ?? "default"), kt = !(d != null && d.hasMore) && !I;
|
|
656
656
|
A(() => {
|
|
657
657
|
var te, on;
|
|
658
658
|
if (xe) return;
|
|
659
|
-
const t = Z.current, a = new Set($.map((K) => K.id)), l = t ? t.createdId ?? (a.has(
|
|
659
|
+
const t = Z.current, a = new Set($.map((K) => K.id)), l = t ? t.createdId ?? (a.has(m) && !t.knownIds.has(m) ? m : ((te = $.find((K) => !t.knownIds.has(K.id))) == null ? void 0 : te.id) ?? null) : null;
|
|
660
660
|
l && a.has(l) && (Z.current = null);
|
|
661
|
-
const g =
|
|
661
|
+
const g = m === "default" && U !== void 0, v = kt && a.size > 0 && !g, E = l ?? (v && !a.has(m) ? ((on = $[0]) == null ? void 0 : on.id) ?? m : m);
|
|
662
662
|
z((K) => {
|
|
663
663
|
const ne = K.workspaceId === e ? K : { workspaceId: e, ids: [], activeId: null };
|
|
664
|
-
if (
|
|
665
|
-
const sn = ne.ids.length > 0 ? ne.ids : [E], an = v ? sn.filter((
|
|
666
|
-
return K.workspaceId === e && K.activeId === cn && K.ids.length === be.length && K.ids.every((
|
|
664
|
+
if (I && ne.ids.length > 0 && !l) return ne;
|
|
665
|
+
const sn = ne.ids.length > 0 ? ne.ids : [E], an = v ? sn.filter((Be) => a.has(Be) || Be === l) : sn, le = an.length > 0 ? an : [E], ln = ne.activeId && le.includes(ne.activeId) ? ne.activeId : le[0] ?? E, be = l ? He(le, t == null ? void 0 : t.afterId, l) : E === ln || le.includes(E) ? le : mn(le, ln, E), cn = be.includes(E) ? E : be[0] ?? E;
|
|
666
|
+
return K.workspaceId === e && K.activeId === cn && K.ids.length === be.length && K.ids.every((Be, hr) => Be === be[hr]) ? K : { workspaceId: e, ids: be, activeId: cn };
|
|
667
667
|
});
|
|
668
|
-
}, [U,
|
|
669
|
-
const
|
|
668
|
+
}, [U, m, I, xe, $, kt, e]);
|
|
669
|
+
const Xt = W(() => {
|
|
670
670
|
const t = /* @__PURE__ */ new Map();
|
|
671
671
|
for (const a of $) t.set(a.id, a.title);
|
|
672
672
|
return t;
|
|
673
|
-
}, [$]),
|
|
674
|
-
const l = (
|
|
673
|
+
}, [$]), ut = D.workspaceId === e ? D : { ids: [], activeId: null }, Ue = ut.ids.length > 0 ? ut.ids : [m], Ke = ut.activeId ?? Ue[0] ?? m, or = w((t) => {
|
|
674
|
+
const l = (D.workspaceId === e ? D : { ids: [m] }).ids.includes(t);
|
|
675
675
|
return z((g) => {
|
|
676
|
-
const v = g.workspaceId === e ? g : { ids: [
|
|
676
|
+
const v = g.workspaceId === e ? g : { ids: [m], activeId: m }, E = v.ids.includes(t) ? v.ids : mn(v.ids, v.activeId, t);
|
|
677
677
|
return { workspaceId: e, ids: E, activeId: t };
|
|
678
678
|
}), l ? J(t) : Ce(t);
|
|
679
|
-
}, [
|
|
680
|
-
const l = a.workspaceId === e ? a : { ids: [
|
|
679
|
+
}, [D, m, J, Ce, e]), sr = w((t) => (z((a) => {
|
|
680
|
+
const l = a.workspaceId === e ? a : { ids: [m], activeId: m };
|
|
681
681
|
return {
|
|
682
682
|
workspaceId: e,
|
|
683
|
-
ids: l.ids.includes(t) ? l.ids :
|
|
683
|
+
ids: l.ids.includes(t) ? l.ids : He(l.ids, l.activeId, t),
|
|
684
684
|
activeId: t
|
|
685
685
|
};
|
|
686
|
-
}), J(t)), [
|
|
687
|
-
const g = l.workspaceId === e ? l : { ids: [
|
|
686
|
+
}), J(t)), [m, J, e]), Qt = w((t) => ((D.workspaceId === e ? D : { ids: [m] }).ids.includes(t) && Mt({ workspaceId: e, id: t }), z((l) => {
|
|
687
|
+
const g = l.workspaceId === e ? l : { ids: [m], activeId: m };
|
|
688
688
|
return {
|
|
689
689
|
workspaceId: e,
|
|
690
|
-
ids:
|
|
690
|
+
ids: He(g.ids, g.activeId, t),
|
|
691
691
|
activeId: t
|
|
692
692
|
};
|
|
693
|
-
}), J(t)), [
|
|
694
|
-
const a =
|
|
693
|
+
}), J(t)), [D, m, J, e]), ar = w((t) => {
|
|
694
|
+
const a = D.workspaceId === e ? D : { ids: [m], activeId: m };
|
|
695
695
|
if (a.ids.length <= 1) return;
|
|
696
696
|
const l = a.ids.indexOf(t);
|
|
697
697
|
if (l < 0) return;
|
|
698
698
|
const g = a.ids.filter((E) => E !== t), v = a.activeId === t ? g[Math.max(0, l - 1)] ?? g[0] ?? null : a.activeId;
|
|
699
699
|
z({ workspaceId: e, ids: g, activeId: v }), v && a.activeId === t && J(v);
|
|
700
|
-
}, [
|
|
700
|
+
}, [D, m, J, e]), lr = w((t) => {
|
|
701
701
|
const a = {
|
|
702
702
|
afterId: t,
|
|
703
703
|
knownIds: new Set($.map((g) => g.id))
|
|
704
704
|
};
|
|
705
705
|
Z.current = a;
|
|
706
|
-
const l =
|
|
706
|
+
const l = st();
|
|
707
707
|
return Promise.resolve(l).then((g) => {
|
|
708
708
|
const v = kr(g);
|
|
709
709
|
v && (Z.current === a && (Z.current = { ...a, createdId: v }), z((E) => {
|
|
710
|
-
const te = E.workspaceId === e ? E : { ids: [
|
|
710
|
+
const te = E.workspaceId === e ? E : { ids: [m] };
|
|
711
711
|
return {
|
|
712
712
|
workspaceId: e,
|
|
713
|
-
ids:
|
|
713
|
+
ids: He(te.ids, t, v),
|
|
714
714
|
activeId: v
|
|
715
715
|
};
|
|
716
716
|
}));
|
|
717
717
|
}).catch(() => {
|
|
718
718
|
Z.current === a && (Z.current = null);
|
|
719
719
|
}), l;
|
|
720
|
-
}, [
|
|
721
|
-
const a =
|
|
720
|
+
}, [m, st, $, e]), cr = w((t) => {
|
|
721
|
+
const a = D.workspaceId === e ? D : { ids: [m], activeId: m }, l = a.ids.indexOf(t);
|
|
722
722
|
let g = a.activeId;
|
|
723
723
|
if (l >= 0) {
|
|
724
724
|
const v = a.ids.filter((E) => E !== t);
|
|
725
725
|
g = a.activeId === t ? v[Math.max(0, l - 1)] ?? v[0] ?? null : a.activeId, z({ workspaceId: e, ids: v, activeId: g }), g && a.activeId === t && Ce(g);
|
|
726
726
|
}
|
|
727
|
-
return
|
|
728
|
-
}, [
|
|
727
|
+
return $t(t);
|
|
728
|
+
}, [D, m, $t, Ce, e]), [ur, dt] = O(oe), Zt = j(e);
|
|
729
729
|
A(() => {
|
|
730
|
-
if (
|
|
731
|
-
|
|
730
|
+
if (Zt.current !== e) {
|
|
731
|
+
Zt.current = e, dt(oe);
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
|
-
oe &&
|
|
734
|
+
oe && dt(!0);
|
|
735
735
|
}, [oe, e]);
|
|
736
|
-
const
|
|
736
|
+
const en = oe && ie && !C, tn = !!!(nt && nt.workspaceId === e && nt.id === C) && !ur && Xe !== !1 && (ie ? !!C : !0), dr = w((t) => {
|
|
737
737
|
Un({ workspaceId: e, status: t }), Ee == null || Ee(t);
|
|
738
738
|
}, [Ee, e]);
|
|
739
739
|
A(() => {
|
|
@@ -752,9 +752,9 @@ function Mi({
|
|
|
752
752
|
return (l = globalThis.removeEventListener) == null ? void 0 : l.call(globalThis, un, t);
|
|
753
753
|
};
|
|
754
754
|
}, [We, Fe, Ge, Ie]), A(() => {
|
|
755
|
-
|
|
756
|
-
}, [
|
|
757
|
-
const
|
|
755
|
+
I || Pe == null || Pe(C ?? null);
|
|
756
|
+
}, [C, Pe, I]);
|
|
757
|
+
const ft = Le.status !== "ready", fr = ft ? /* @__PURE__ */ f(ei, { status: Le }) : void 0, Je = w(async (t) => {
|
|
758
758
|
const a = `${(h == null ? void 0 : h.replace(/\/$/, "")) ?? ""}/api/v1/agent/reload`;
|
|
759
759
|
try {
|
|
760
760
|
const l = await fetch(a, {
|
|
@@ -769,65 +769,69 @@ function Mi({
|
|
|
769
769
|
} catch (l) {
|
|
770
770
|
return l instanceof Error ? l.message : "Agent plugin reload failed.";
|
|
771
771
|
}
|
|
772
|
-
}, [h, X]),
|
|
772
|
+
}, [h, X]), je = w(
|
|
773
773
|
(t, a = {}) => {
|
|
774
774
|
const l = a.bridgeEnabled ?? !0, g = _ != null && _.toolRenderers && typeof _.toolRenderers == "object" ? _.toolRenderers : void 0;
|
|
775
775
|
return {
|
|
776
776
|
..._,
|
|
777
|
-
...
|
|
777
|
+
...en ? { autoSubmitInitialDraft: !1, initialDraft: void 0 } : {},
|
|
778
778
|
sessionId: t,
|
|
779
779
|
apiBaseUrl: h,
|
|
780
780
|
workspaceId: e,
|
|
781
781
|
storageScope: e,
|
|
782
782
|
requestHeaders: X,
|
|
783
783
|
showSessions: !1,
|
|
784
|
-
onReloadAgentPlugins: (_ == null ? void 0 : _.onReloadAgentPlugins) ?? (() =>
|
|
785
|
-
toolRenderers: { ...
|
|
786
|
-
bridgeEndpoint: l ?
|
|
784
|
+
onReloadAgentPlugins: (_ == null ? void 0 : _.onReloadAgentPlugins) ?? (() => Je(t)),
|
|
785
|
+
toolRenderers: { ...Vt, ...g ?? {} },
|
|
786
|
+
bridgeEndpoint: l ? Ye : null,
|
|
787
787
|
getSurface: We,
|
|
788
788
|
isWorkbenchOpen: Fe,
|
|
789
789
|
openWorkbench: Ge,
|
|
790
790
|
openWorkbenchSources: Ie,
|
|
791
791
|
closeWorkbench: $e,
|
|
792
|
-
extraCommands:
|
|
792
|
+
extraCommands: Rt,
|
|
793
793
|
workspaceWarmupStatus: Le,
|
|
794
|
-
hydrateMessages:
|
|
794
|
+
hydrateMessages: tn,
|
|
795
795
|
onAutoSubmitInitialDraftSettled: () => {
|
|
796
|
-
se.current = !1,
|
|
796
|
+
se.current = !1, dt(!1), he(void 0);
|
|
797
797
|
const v = _ == null ? void 0 : _.onAutoSubmitInitialDraftSettled;
|
|
798
798
|
typeof v == "function" && v();
|
|
799
799
|
},
|
|
800
800
|
// Forward the explicit prop when set. Omitting the key (when undefined)
|
|
801
801
|
// lets ChatPanel apply its own default (true) and avoids overriding a
|
|
802
802
|
// value passed through chatParams.
|
|
803
|
-
...
|
|
803
|
+
...ke !== void 0 ? { hotReloadEnabled: ke } : {}
|
|
804
804
|
};
|
|
805
805
|
},
|
|
806
|
-
[h, _,
|
|
807
|
-
), gr =
|
|
808
|
-
() =>
|
|
809
|
-
[
|
|
810
|
-
), mr =
|
|
806
|
+
[h, _, en, X, Ye, We, Fe, Ge, Ie, $e, Rt, Le, tn, ke, Vt, Je, e]
|
|
807
|
+
), gr = W(
|
|
808
|
+
() => je(m),
|
|
809
|
+
[m, je]
|
|
810
|
+
), mr = W(() => Ue.map((t) => ({
|
|
811
811
|
id: t,
|
|
812
|
-
title:
|
|
812
|
+
title: Xt.get(t) ?? (t === "default" ? q : t),
|
|
813
813
|
panel: "chat",
|
|
814
|
-
params:
|
|
815
|
-
})), [Ke, Ue, q,
|
|
816
|
-
storageKey:
|
|
814
|
+
params: je(t, { bridgeEnabled: t === Ke })
|
|
815
|
+
})), [Ke, Ue, q, je, Xt]), pr = W(() => ({
|
|
816
|
+
storageKey: G,
|
|
817
817
|
defaultLeftTab: Ae,
|
|
818
|
-
initialPanels:
|
|
819
|
-
extraPanels:
|
|
820
|
-
|
|
821
|
-
|
|
818
|
+
initialPanels: Tt,
|
|
819
|
+
extraPanels: Yt,
|
|
820
|
+
onReloadAgentPlugins: () => Je(C ?? m),
|
|
821
|
+
onReady: Ht,
|
|
822
|
+
onChange: qt,
|
|
822
823
|
onClose: $e
|
|
823
824
|
}), [
|
|
824
825
|
$e,
|
|
825
826
|
Ae,
|
|
826
|
-
|
|
827
|
+
Tt,
|
|
828
|
+
Je,
|
|
829
|
+
C,
|
|
830
|
+
m,
|
|
831
|
+
qt,
|
|
827
832
|
Ht,
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
Vt,
|
|
833
|
+
G,
|
|
834
|
+
Yt,
|
|
831
835
|
H
|
|
832
836
|
]);
|
|
833
837
|
return /* @__PURE__ */ f("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ ye(
|
|
@@ -837,20 +841,20 @@ function Mi({
|
|
|
837
841
|
panels: y,
|
|
838
842
|
commands: b,
|
|
839
843
|
catalogs: B,
|
|
840
|
-
plugins:
|
|
844
|
+
plugins: F,
|
|
841
845
|
excludeDefaults: k,
|
|
842
846
|
capabilities: T,
|
|
843
847
|
apiBaseUrl: h,
|
|
844
848
|
authHeaders: $n,
|
|
845
|
-
apiTimeout:
|
|
846
|
-
defaultTheme:
|
|
849
|
+
apiTimeout: p,
|
|
850
|
+
defaultTheme: R,
|
|
847
851
|
onThemeChange: Tn,
|
|
848
852
|
workspaceId: e,
|
|
849
853
|
workspaceLabel: _n,
|
|
850
|
-
storageKey:
|
|
851
|
-
persistenceEnabled:
|
|
854
|
+
storageKey: et,
|
|
855
|
+
persistenceEnabled: St,
|
|
852
856
|
bridgeEndpoint: null,
|
|
853
|
-
onAuthError:
|
|
857
|
+
onAuthError: Rn,
|
|
854
858
|
frontPluginHotReload: Wn,
|
|
855
859
|
fullPageBasePath: Nn,
|
|
856
860
|
children: [
|
|
@@ -862,16 +866,16 @@ function Mi({
|
|
|
862
866
|
requestHeaders: X,
|
|
863
867
|
apiBaseUrl: h,
|
|
864
868
|
preloadPaths: Fn,
|
|
865
|
-
provisionWorkspace:
|
|
869
|
+
provisionWorkspace: Xe,
|
|
866
870
|
onStatusChange: dr
|
|
867
871
|
}
|
|
868
872
|
),
|
|
869
873
|
/* @__PURE__ */ f(
|
|
870
874
|
di,
|
|
871
875
|
{
|
|
872
|
-
bridgeEndpoint:
|
|
876
|
+
bridgeEndpoint: Ye,
|
|
873
877
|
requestHeaders: X,
|
|
874
|
-
navOpen:
|
|
878
|
+
navOpen: Kt,
|
|
875
879
|
surfaceOpen: Q,
|
|
876
880
|
surfaceReady: nr,
|
|
877
881
|
snapshot: ir
|
|
@@ -881,7 +885,7 @@ function Mi({
|
|
|
881
885
|
/* @__PURE__ */ f(
|
|
882
886
|
Lr,
|
|
883
887
|
{
|
|
884
|
-
appTitle:
|
|
888
|
+
appTitle: Dn,
|
|
885
889
|
sessionTitle: xe ? "Loading sessions…" : er ?? q,
|
|
886
890
|
onCommandPalette: () => {
|
|
887
891
|
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
@@ -903,7 +907,7 @@ function Mi({
|
|
|
903
907
|
Or,
|
|
904
908
|
{
|
|
905
909
|
className: In,
|
|
906
|
-
nav:
|
|
910
|
+
nav: Kt ? "session-list" : null,
|
|
907
911
|
navParams: {
|
|
908
912
|
sessions: $,
|
|
909
913
|
activeId: Ke,
|
|
@@ -911,13 +915,13 @@ function Mi({
|
|
|
911
915
|
pinnedIds: Kn,
|
|
912
916
|
onTogglePin: Jn,
|
|
913
917
|
onSwitch: or,
|
|
914
|
-
onOpenAsTab:
|
|
915
|
-
onCreate:
|
|
918
|
+
onOpenAsTab: Qt,
|
|
919
|
+
onCreate: st,
|
|
916
920
|
onDelete: cr,
|
|
917
921
|
onLoadMore: d == null ? void 0 : d.loadMore,
|
|
918
922
|
hasMore: d == null ? void 0 : d.hasMore,
|
|
919
923
|
loadingMore: d == null ? void 0 : d.loadingMore,
|
|
920
|
-
onClose: () =>
|
|
924
|
+
onClose: () => Ut(!1)
|
|
921
925
|
},
|
|
922
926
|
center: "chat",
|
|
923
927
|
centerParams: gr,
|
|
@@ -926,26 +930,26 @@ function Mi({
|
|
|
926
930
|
onActiveChatPaneChange: sr,
|
|
927
931
|
onCloseChatPane: ar,
|
|
928
932
|
onCreateChatPaneAfter: lr,
|
|
929
|
-
onDropChatSession:
|
|
933
|
+
onDropChatSession: Qt,
|
|
930
934
|
flashChatPaneId: (re == null ? void 0 : re.workspaceId) === e ? re.id : null,
|
|
931
935
|
surface: Q ? "artifact-surface" : null,
|
|
932
936
|
surfaceParams: pr,
|
|
933
937
|
surfaceOverlay: fr,
|
|
934
|
-
sidebar: Q && !
|
|
935
|
-
sidebarParams: Q && !
|
|
938
|
+
sidebar: Q && !ft && ct && rr ? "workbench-left" : null,
|
|
939
|
+
sidebarParams: Q && !ft && ct ? {
|
|
936
940
|
...Ae ? { defaultTab: Ae } : {},
|
|
937
941
|
onClose: () => ve(!1),
|
|
938
942
|
onCollapse: () => ve(!1)
|
|
939
943
|
} : void 0,
|
|
940
944
|
storageKey: x ? we : void 0,
|
|
941
|
-
onOpenNav:
|
|
942
|
-
|
|
945
|
+
onOpenNav: wt ? () => {
|
|
946
|
+
Ut(!0), Qe == null || Qe();
|
|
943
947
|
} : void 0,
|
|
944
948
|
onOpenSurface: () => {
|
|
945
|
-
ee.current = !0, H(!0),
|
|
949
|
+
ee.current = !0, H(!0), Ze == null || Ze();
|
|
946
950
|
},
|
|
947
951
|
surfaceButtonBottomOffset: Gn,
|
|
948
|
-
onOpenSidebar:
|
|
952
|
+
onOpenSidebar: ct ? () => {
|
|
949
953
|
ee.current = !0, H(!0), ve(!0);
|
|
950
954
|
} : void 0
|
|
951
955
|
}
|
|
@@ -989,30 +993,30 @@ function Ci({
|
|
|
989
993
|
label: "Waking workspace runtime"
|
|
990
994
|
});
|
|
991
995
|
return A(() => {
|
|
992
|
-
const b = new AbortController(), B =
|
|
993
|
-
async function
|
|
996
|
+
const b = new AbortController(), B = ze(e, n);
|
|
997
|
+
async function F(T) {
|
|
994
998
|
const h = await fetch(Pn(r, T), {
|
|
995
999
|
headers: B,
|
|
996
1000
|
signal: b.signal
|
|
997
|
-
}), N = await
|
|
1001
|
+
}), N = await Ve(h);
|
|
998
1002
|
if (!h.ok) {
|
|
999
|
-
if (
|
|
1000
|
-
throw new Error(
|
|
1003
|
+
if (ht(N)) return "preparing";
|
|
1004
|
+
throw new Error(vt(N) ?? `${T} failed with ${h.status}`);
|
|
1001
1005
|
}
|
|
1002
1006
|
if (An(T)) {
|
|
1003
|
-
const
|
|
1004
|
-
if ((
|
|
1007
|
+
const R = qe(N);
|
|
1008
|
+
if ((R == null ? void 0 : R.state) === "degraded") throw new Error(R.message ?? "Workspace failed to prepare");
|
|
1005
1009
|
}
|
|
1006
|
-
return
|
|
1010
|
+
return Rr(T) !== null && N && typeof N == "object" && En(r, B["x-boring-workspace-id"] ?? e, T, N), "ready";
|
|
1007
1011
|
}
|
|
1008
1012
|
async function k() {
|
|
1009
1013
|
y({ status: "loading", label: "Waking workspace runtime" });
|
|
1010
1014
|
try {
|
|
1011
1015
|
const T = yn(i, o);
|
|
1012
|
-
let h = await Promise.all(T.map(async (
|
|
1016
|
+
let h = await Promise.all(T.map(async (p) => ({ path: p, status: await F(p) }))), N = h.filter((p) => p.status === "preparing").map((p) => p.path);
|
|
1013
1017
|
for (; N.length > 0; ) {
|
|
1014
1018
|
if (y({ status: "loading", label: "Workspace is still preparing" }), await gi(b.signal), b.signal.aborted) return;
|
|
1015
|
-
h = await Promise.all(N.map(async (
|
|
1019
|
+
h = await Promise.all(N.map(async (p) => ({ path: p, status: await F(p) }))), N = h.filter((p) => p.status === "preparing").map((p) => p.path);
|
|
1016
1020
|
}
|
|
1017
1021
|
b.signal.aborted || y({ status: "ready" });
|
|
1018
1022
|
} catch (T) {
|
|
@@ -1120,7 +1124,7 @@ function Ai() {
|
|
|
1120
1124
|
onDidActivePanelChange_: P
|
|
1121
1125
|
};
|
|
1122
1126
|
}
|
|
1123
|
-
function
|
|
1127
|
+
function pt({ code: e, title: n, description: r }) {
|
|
1124
1128
|
return /* @__PURE__ */ f(
|
|
1125
1129
|
"div",
|
|
1126
1130
|
{
|
|
@@ -1132,16 +1136,16 @@ function mt({ code: e, title: n, description: r }) {
|
|
|
1132
1136
|
);
|
|
1133
1137
|
}
|
|
1134
1138
|
function Wi({ componentId: e, params: n = {} }) {
|
|
1135
|
-
const r = wn(), { errors: i } =
|
|
1139
|
+
const r = wn(), { errors: i } = Dr(), o = r.get(e), s = r.getComponents()[e];
|
|
1136
1140
|
Sr(() => {
|
|
1137
1141
|
document.title = (o == null ? void 0 : o.title) ?? e;
|
|
1138
1142
|
}, [e, o == null ? void 0 : o.title]);
|
|
1139
|
-
const c =
|
|
1143
|
+
const c = W(() => ({
|
|
1140
1144
|
params: n,
|
|
1141
1145
|
api: Pi(e),
|
|
1142
1146
|
containerApi: Ai(),
|
|
1143
1147
|
className: "h-full"
|
|
1144
|
-
}), [e, n]), u =
|
|
1148
|
+
}), [e, n]), u = W(() => {
|
|
1145
1149
|
if (!o) return null;
|
|
1146
1150
|
const S = o.pluginId ?? o.id;
|
|
1147
1151
|
for (let y = i.length - 1; y >= 0; y -= 1) {
|
|
@@ -1152,21 +1156,21 @@ function Wi({ componentId: e, params: n = {} }) {
|
|
|
1152
1156
|
return null;
|
|
1153
1157
|
}, [e, i, o]);
|
|
1154
1158
|
return o ? !o.supportsFullPage || !s ? /* @__PURE__ */ f(
|
|
1155
|
-
|
|
1159
|
+
pt,
|
|
1156
1160
|
{
|
|
1157
1161
|
code: Si,
|
|
1158
1162
|
title: "Panel does not support full-page mode",
|
|
1159
1163
|
description: `Panel "${e}" can render in the workspace, but it has not opted into the dedicated full-page pane route.`
|
|
1160
1164
|
}
|
|
1161
1165
|
) : u ? /* @__PURE__ */ f(
|
|
1162
|
-
|
|
1166
|
+
pt,
|
|
1163
1167
|
{
|
|
1164
1168
|
code: bi,
|
|
1165
1169
|
title: "Panel failed to render",
|
|
1166
1170
|
description: `Panel "${e}" crashed while rendering in full-page mode: ${u.error.message}`
|
|
1167
1171
|
}
|
|
1168
1172
|
) : /* @__PURE__ */ f("div", { className: "min-h-screen bg-background text-foreground", children: /* @__PURE__ */ f(_r, { mode: "full-page", children: /* @__PURE__ */ f(s, { ...c }) }) }) : /* @__PURE__ */ f(
|
|
1169
|
-
|
|
1173
|
+
pt,
|
|
1170
1174
|
{
|
|
1171
1175
|
code: vi,
|
|
1172
1176
|
title: "Unknown panel",
|