@hachej/boring-workspace 0.1.64 → 0.1.65

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.
Files changed (36) hide show
  1. package/dist/FileTree-B_fRS4Om.js +230 -0
  2. package/dist/MarkdownEditor-C55gVDyW.js +743 -0
  3. package/dist/WorkspaceLoadingState-D3i4X-eH.js +847 -0
  4. package/dist/WorkspaceProvider-Ddx7GByq.js +8770 -0
  5. package/dist/app-front.d.ts +79 -2
  6. package/dist/app-front.js +3110 -2467
  7. package/dist/app-server.d.ts +2 -2
  8. package/dist/app-server.js +6 -4
  9. package/dist/boring-workspace.css +2 -1
  10. package/dist/charts.d.ts +6 -1
  11. package/dist/charts.js +131 -138
  12. package/dist/plugin.d.ts +64 -1
  13. package/dist/plugin.js +32 -0
  14. package/dist/rolldown-runtime-Dqa2HsxW.js +20 -0
  15. package/dist/{runtimeEnv-HolIkcoB.d.ts → runtimeEnv-CU-c4kaV.d.ts} +7 -0
  16. package/dist/server.d.ts +2 -2
  17. package/dist/server.js +4 -3
  18. package/dist/testing-e2e.d.ts +5 -0
  19. package/dist/testing-e2e.js +33 -42
  20. package/dist/testing.d.ts +6 -1
  21. package/dist/testing.js +9474 -10814
  22. package/dist/utils-BRcxFdrz.js +8 -0
  23. package/dist/workspace.css +2756 -290
  24. package/dist/workspace.d.ts +132 -15
  25. package/dist/workspace.js +568 -734
  26. package/docs/plans/archive/CODE_OWNERSHIP_CLEANUP_PLAN.md +1 -1
  27. package/docs/plans/archive/DECLARATIVE_LAYOUT_MIGRATION.md +4 -4
  28. package/docs/plans/archive/GENERIC_EXPLORER_PLUGIN_PLAN.md +10 -10
  29. package/docs/plans/archive/PLUGIN_MODEL.md +37 -37
  30. package/docs/plans/archive/WORKSPACE_V2_PLAN.md +2 -2
  31. package/package.json +50 -50
  32. package/dist/FileTree-DjhAzlg3.js +0 -315
  33. package/dist/MarkdownEditor-CeN7n6mw.js +0 -610
  34. package/dist/WorkspaceLoadingState-D4SB2awA.js +0 -867
  35. package/dist/WorkspaceProvider-CEZUOy1M.js +0 -8725
  36. package/dist/utils-B6yFEsav.js +0 -8
package/dist/workspace.js CHANGED
@@ -1,756 +1,590 @@
1
- var X = Object.defineProperty;
2
- var Q = (e, t, a) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
- var T = (e, t, a) => Q(e, typeof t != "symbol" ? t + "" : t, a);
4
- import { u as D, p as Y, a as Z, b as ee, D as te } from "./WorkspaceProvider-CEZUOy1M.js";
5
- import { A as qe, C as Je, c as Ve, d as Ge, e as Xe, f as Qe, F as Ye, g as Ze, M as et, h as tt, P as at, i as rt, j as nt, k as st, l as ot, R as it, S as lt, m as ct, n as dt, T as ut, U as pt, W as mt, o as ft, q as ht, r as gt, s as yt, t as bt, v as kt, w as St, x as vt, y as Pt, z as xt, B as wt, E as Ct, G as Et, H as Nt, I as Rt, J as Tt, K as Ot, L as It, N as Wt, O as Ft, Q as Lt, V as Mt, X as Bt, Y as Kt, Z as _t, _ as Dt, $ as At, a0 as $t, a1 as jt, a2 as zt, a3 as Ht, a4 as Ut, a5 as qt, a6 as Jt, a7 as Vt, a8 as Gt, a9 as Xt, aa as Qt, ab as Yt, ac as Zt, ad as ea, ae as ta, af as aa, ag as ra, ah as na, ai as sa, aj as oa, ak as ia, al as la, am as ca, an as da, ao as ua, ap as pa, aq as ma, ar as fa, as as ha, at as ga, au as ya, av as ba, aw as ka, ax as Sa, ay as va, az as Pa, aA as xa, aB as wa, aC as Ca, aD as Ea, aE as Na, aF as Ra, aG as Ta, aH as Oa, aI as Ia, aJ as Wa, aK as Fa, aL as La, aM as Ma } from "./WorkspaceProvider-CEZUOy1M.js";
6
- import { c as C } from "./utils-B6yFEsav.js";
7
- import { C as Ka, T as _a, W as Da, b as Aa } from "./WorkspaceLoadingState-D4SB2awA.js";
8
- import { jsx as r, jsxs as g, Fragment as ae } from "react/jsx-runtime";
9
- import { Button as x, Sheet as re, SheetContent as ne, SheetHeader as se, SheetTitle as oe, SheetDescription as ie, EmptyState as le, Kbd as O, ErrorState as ce, IconButton as I } from "@hachej/boring-ui-kit";
10
- import { Toaster as ja, dismissToast as za, toast as Ha } from "@hachej/boring-ui-kit";
11
- import { useSyncExternalStore as A, useState as E, useEffect as v, useRef as w, useCallback as y, useMemo as P, Suspense as de, Component as ue } from "react";
12
- import { FileTree as qa } from "./FileTree-DjhAzlg3.js";
13
- import { MarkdownEditor as Va } from "./MarkdownEditor-CeN7n6mw.js";
14
- import { MenuIcon as pe, PanelLeftIcon as M, PinIcon as me, CheckIcon as fe, CopyIcon as he } from "lucide-react";
15
- function Me() {
16
- const e = D();
17
- return A(e.subscribe, e.getSnapshot);
1
+ import { $ as e, $t as t, At as n, Bt as r, C as i, Ct as a, D as o, Dt as s, E as c, Et as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, Kt as v, Lt as y, Mt as b, Nt as x, O as S, Pt as C, Q as ee, Qt as te, Rt as ne, St as re, T as ie, Tt as w, U as ae, Ut as oe, Vt as se, Wt as ce, X as le, Xt as ue, Yt as de, Z as fe, Zt as pe, _n as me, _t as he, a as ge, an as _e, at as ve, b as ye, bt as be, cn as xe, ct as Se, d as Ce, dn as we, dt as Te, en as T, et as E, f as D, fn as O, ft as Ee, gn as De, gt as Oe, h as ke, hn as Ae, ht as k, i as je, in as Me, it as Ne, jt as Pe, k as Fe, kt as Ie, l as Le, ln as Re, lt as ze, mn as Be, mt as Ve, n as He, nn as Ue, nt as We, o as Ge, on as Ke, ot as qe, p as Je, pn as A, pt as Ye, q as Xe, qt as Ze, r as Qe, rn as $e, rt as et, s as tt, sn as nt, st as rt, t as it, tt as at, u as ot, un as st, ut as ct, v as lt, vn as ut, vt as dt, w as ft, wt as j, x as pt, xn as mt, xt as ht, y as gt, yn as _t, yt as vt, zt as yt } from "./WorkspaceProvider-Ddx7GByq.js";
2
+ import { t as bt } from "./MarkdownEditor-C55gVDyW.js";
3
+ import { t as M } from "./utils-BRcxFdrz.js";
4
+ import { f as xt, i as St, n as Ct, r as wt, t as Tt, u as Et } from "./WorkspaceLoadingState-D3i4X-eH.js";
5
+ import { t as Dt } from "./FileTree-B_fRS4Om.js";
6
+ import { Component as Ot, Suspense as kt, useCallback as N, useEffect as P, useMemo as F, useRef as I, useState as L, useSyncExternalStore as R } from "react";
7
+ import { Fragment as At, jsx as z, jsxs as B } from "react/jsx-runtime";
8
+ import { CheckIcon as jt, CopyIcon as Mt, MenuIcon as Nt, PanelLeftIcon as V, PinIcon as Pt } from "lucide-react";
9
+ import { Button as H, EmptyState as Ft, ErrorState as It, IconButton as U, Kbd as W, Sheet as Lt, SheetContent as Rt, SheetDescription as zt, SheetHeader as Bt, SheetTitle as Vt } from "@hachej/boring-ui-kit";
10
+ //#region src/front/plugin/useActivePanels.ts
11
+ function Ht() {
12
+ let e = A();
13
+ return R(e.subscribe, e.getSnapshot);
18
14
  }
19
- function $(e) {
20
- switch (e.kind) {
21
- case "openFile":
22
- return { kind: "openFile", params: { path: e.path, ...e.mode ? { mode: e.mode } : {}, ...e.filesystem ? { filesystem: e.filesystem } : {} } };
23
- case "openSurface":
24
- return { kind: "openSurface", params: { kind: e.surfaceKind, target: e.target, ...e.filesystem ? { filesystem: e.filesystem } : {}, ...e.meta ? { meta: e.meta } : {} } };
25
- case "openPanel":
26
- return {
27
- kind: "openPanel",
28
- params: {
29
- id: e.id,
30
- component: e.component,
31
- ...e.title ? { title: e.title } : {},
32
- ...e.params ? { params: e.params } : {}
33
- }
34
- };
35
- case "expandToFile":
36
- return { kind: "expandToFile", params: { path: e.path } };
37
- }
15
+ //#endregion
16
+ //#region src/front/bridge/WorkspaceLink.tsx
17
+ function G(e) {
18
+ switch (e.kind) {
19
+ case "openFile": return {
20
+ kind: "openFile",
21
+ params: {
22
+ path: e.path,
23
+ ...e.mode ? { mode: e.mode } : {},
24
+ ...e.filesystem ? { filesystem: e.filesystem } : {}
25
+ }
26
+ };
27
+ case "openSurface": return {
28
+ kind: "openSurface",
29
+ params: {
30
+ kind: e.surfaceKind,
31
+ target: e.target,
32
+ ...e.filesystem ? { filesystem: e.filesystem } : {},
33
+ ...e.meta ? { meta: e.meta } : {}
34
+ }
35
+ };
36
+ case "openPanel": return {
37
+ kind: "openPanel",
38
+ params: {
39
+ id: e.id,
40
+ component: e.component,
41
+ ...e.title ? { title: e.title } : {},
42
+ ...e.params ? { params: e.params } : {}
43
+ }
44
+ };
45
+ case "expandToFile": return {
46
+ kind: "expandToFile",
47
+ params: { path: e.path }
48
+ };
49
+ }
38
50
  }
39
- function ge(e) {
40
- return `boring-workspace-command:${encodeURIComponent(JSON.stringify($(e)))}`;
51
+ function K(e) {
52
+ return `boring-workspace-command:${encodeURIComponent(JSON.stringify(G(e)))}`;
41
53
  }
42
- function ye(e) {
43
- return e.button === 0 && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;
54
+ function Ut(e) {
55
+ return e.button === 0 && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;
44
56
  }
45
- function Be({ to: e, children: t, className: a, title: n, href: o, onClick: i }) {
46
- return /* @__PURE__ */ r(
47
- "a",
48
- {
49
- href: o ?? ge(e),
50
- className: a,
51
- title: n,
52
- onClick: (u) => {
53
- i == null || i(u), !(u.defaultPrevented || !ye(u)) && (u.preventDefault(), Y($(e)));
54
- },
55
- children: t
56
- }
57
- );
57
+ function Wt({ to: e, children: t, className: n, title: r, href: i, onClick: a }) {
58
+ return /* @__PURE__ */ z("a", {
59
+ href: i ?? K(e),
60
+ className: n,
61
+ title: r,
62
+ onClick: (t) => {
63
+ a?.(t), !(t.defaultPrevented || !Ut(t)) && (t.preventDefault(), y(G(e)));
64
+ },
65
+ children: t
66
+ });
58
67
  }
59
- function be(e, t) {
60
- return e ? `${e.replace(/\/$/, "")}${t}` : t;
68
+ //#endregion
69
+ //#region src/plugins/filesystemPlugin/front/data/fileRecords.ts
70
+ function Gt(e, t) {
71
+ return e ? `${e.replace(/\/$/, "")}${t}` : t;
61
72
  }
62
- function ke() {
63
- if (typeof window > "u") return;
64
- const e = window.location.pathname.match(/^\/workspace\/([^/?#]+)/);
65
- if (e != null && e[1])
66
- try {
67
- return decodeURIComponent(e[1]);
68
- } catch {
69
- return e[1];
70
- }
73
+ function Kt() {
74
+ if (typeof window > "u") return;
75
+ let e = window.location.pathname.match(/^\/workspace\/([^/?#]+)/);
76
+ if (e?.[1]) try {
77
+ return decodeURIComponent(e[1]);
78
+ } catch {
79
+ return e[1];
80
+ }
71
81
  }
72
- async function Ke(e) {
73
- const t = new URLSearchParams({ path: e.path });
74
- e.recordSet && t.set("recordSet", e.recordSet), e.offset !== void 0 && t.set("offset", String(e.offset)), e.limit !== void 0 && t.set("limit", String(e.limit)), e.q && t.set("q", e.q);
75
- const a = { ...e.headers ?? {} }, n = e.workspaceId ?? ke();
76
- n && !Object.keys(a).some((i) => i.toLowerCase() === "x-boring-workspace-id") && (a["x-boring-workspace-id"] = n);
77
- const o = await fetch(be(e.apiBaseUrl, `/api/v1/files/records?${t}`), {
78
- method: "GET",
79
- headers: a,
80
- signal: e.signal
81
- });
82
- if (!o.ok)
83
- throw new Error(`readFileRecords failed: HTTP ${o.status}`);
84
- return await o.json();
82
+ async function q(e) {
83
+ let t = new URLSearchParams({ path: e.path });
84
+ e.recordSet && t.set("recordSet", e.recordSet), e.offset !== void 0 && t.set("offset", String(e.offset)), e.limit !== void 0 && t.set("limit", String(e.limit)), e.q && t.set("q", e.q);
85
+ let n = { ...e.headers ?? {} }, r = e.workspaceId ?? Kt();
86
+ r && !Object.keys(n).some((e) => e.toLowerCase() === "x-boring-workspace-id") && (n["x-boring-workspace-id"] = r);
87
+ let i = await fetch(Gt(e.apiBaseUrl, `/api/v1/files/records?${t}`), {
88
+ method: "GET",
89
+ headers: n,
90
+ signal: e.signal
91
+ });
92
+ if (!i.ok) throw Error(`readFileRecords failed: HTTP ${i.status}`);
93
+ return await i.json();
85
94
  }
86
- function B(e) {
87
- return typeof window > "u" ? !1 : window.innerWidth < e;
95
+ //#endregion
96
+ //#region src/front/hooks/useViewportBreakpoint.ts
97
+ function J(e) {
98
+ return typeof window > "u" ? !1 : window.innerWidth < e;
88
99
  }
89
- function K(e = 1024) {
90
- const [t, a] = E(() => B(e));
91
- return v(() => {
92
- const n = () => {
93
- a(B(e));
94
- };
95
- return n(), window.addEventListener("resize", n), () => {
96
- window.removeEventListener("resize", n);
97
- };
98
- }, [e]), t;
100
+ function Y(e = 1024) {
101
+ let [t, n] = L(() => J(e));
102
+ return P(() => {
103
+ let t = () => {
104
+ n(J(e));
105
+ };
106
+ return t(), window.addEventListener("resize", t), () => {
107
+ window.removeEventListener("resize", t);
108
+ };
109
+ }, [e]), t;
99
110
  }
100
- function Se({
101
- isNarrowViewport: e,
102
- isCollapsed: t,
103
- setCollapsed: a
104
- }) {
105
- const n = w(t), o = w(!1), i = w(null);
106
- return v(() => {
107
- n.current = t;
108
- }, [t]), v(() => {
109
- const u = i.current, d = u !== !0 && e, l = u === !0 && !e;
110
- if (i.current = e, e && d && !n.current) {
111
- o.current = !0, a(!0);
112
- return;
113
- }
114
- l && o.current && (o.current = !1, a(!1));
115
- }, [e, a]), y(() => {
116
- o.current = !1;
117
- }, []);
111
+ //#endregion
112
+ //#region src/front/hooks/useResponsiveSidebarCollapse.ts
113
+ function X({ isNarrowViewport: e, isCollapsed: t, setCollapsed: n }) {
114
+ let r = I(t), i = I(!1), a = I(null);
115
+ return P(() => {
116
+ r.current = t;
117
+ }, [t]), P(() => {
118
+ let t = a.current, o = t !== !0 && e, s = t === !0 && !e;
119
+ if (a.current = e, e && o && !r.current) {
120
+ i.current = !0, n(!0);
121
+ return;
122
+ }
123
+ s && i.current && (i.current = !1, n(!1));
124
+ }, [e, n]), N(() => {
125
+ i.current = !1;
126
+ }, []);
118
127
  }
119
- function _e(e) {
120
- const [t, a] = E([]), n = w(t);
121
- n.current = t, v(() => {
122
- if (!e) {
123
- a([]);
124
- return;
125
- }
126
- function l() {
127
- try {
128
- const p = e.toJSON(), f = [];
129
- if (p && typeof p == "object" && "panels" in p) {
130
- const b = p;
131
- if (b.panels)
132
- for (const [, m] of Object.entries(b.panels))
133
- m.id && f.push({
134
- id: m.id,
135
- component: m.contentComponent ?? m.id,
136
- params: m.params
137
- });
138
- }
139
- const s = n.current;
140
- (s.length !== f.length || s.some((b, m) => {
141
- var k;
142
- return b.id !== ((k = f[m]) == null ? void 0 : k.id);
143
- })) && a(f);
144
- } catch {
145
- }
146
- }
147
- l();
148
- const c = setInterval(l, 500);
149
- return () => clearInterval(c);
150
- }, [e]);
151
- const o = y(
152
- (l) => {
153
- e == null || e.addPanel("artifacts", {
154
- id: l.id,
155
- component: l.component,
156
- params: l.params
157
- });
158
- },
159
- [e]
160
- ), i = y(
161
- (l) => {
162
- e == null || e.removePanel(l);
163
- },
164
- [e]
165
- ), u = y(
166
- (l) => {
167
- e == null || e.activatePanel(l);
168
- },
169
- [e]
170
- ), d = y(
171
- (l) => n.current.some((c) => c.id === l),
172
- []
173
- );
174
- return { panels: t, open: o, close: i, activate: u, isOpen: d };
128
+ //#endregion
129
+ //#region src/front/hooks/useArtifactPanels.ts
130
+ function qt(e) {
131
+ let [t, n] = L([]), r = I(t);
132
+ return r.current = t, P(() => {
133
+ if (!e) {
134
+ n([]);
135
+ return;
136
+ }
137
+ function t() {
138
+ try {
139
+ let t = e.toJSON(), i = [];
140
+ if (t && typeof t == "object" && "panels" in t) {
141
+ let e = t;
142
+ if (e.panels) for (let [, t] of Object.entries(e.panels)) t.id && i.push({
143
+ id: t.id,
144
+ component: t.contentComponent ?? t.id,
145
+ params: t.params
146
+ });
147
+ }
148
+ let a = r.current;
149
+ (a.length !== i.length || a.some((e, t) => e.id !== i[t]?.id)) && n(i);
150
+ } catch {}
151
+ }
152
+ t();
153
+ let i = setInterval(t, 500);
154
+ return () => clearInterval(i);
155
+ }, [e]), {
156
+ panels: t,
157
+ open: N((t) => {
158
+ e?.addPanel("artifacts", {
159
+ id: t.id,
160
+ component: t.component,
161
+ params: t.params
162
+ });
163
+ }, [e]),
164
+ close: N((t) => {
165
+ e?.removePanel(t);
166
+ }, [e]),
167
+ activate: N((t) => {
168
+ e?.activatePanel(t);
169
+ }, [e]),
170
+ isOpen: N((e) => r.current.some((t) => t.id === e), [])
171
+ };
175
172
  }
176
- function De(e, t = {}) {
177
- const a = t.toolPanelMap ?? {}, n = y(
178
- (i) => a[i],
179
- [a]
180
- );
181
- return { openForTool: y(
182
- (i, u) => {
183
- const d = a[i];
184
- if (!d) return;
185
- const l = `artifact-${u.path}`;
186
- e.isOpen(l) ? e.activate(l) : e.open({ id: l, component: d, params: u });
187
- },
188
- [a, e]
189
- ), resolvePanel: n };
173
+ //#endregion
174
+ //#region src/front/hooks/useArtifactRouting.ts
175
+ function Jt(e, t = {}) {
176
+ let n = t.toolPanelMap ?? {}, r = N((e) => n[e], [n]);
177
+ return {
178
+ openForTool: N((t, r) => {
179
+ let i = n[t];
180
+ if (!i) return;
181
+ let a = `artifact-${r.path}`;
182
+ e.isOpen(a) ? e.activate(a) : e.open({
183
+ id: a,
184
+ component: i,
185
+ params: r
186
+ });
187
+ }, [n, e]),
188
+ resolvePanel: r
189
+ };
190
190
  }
191
- const ve = 768, Pe = 1024;
192
- function xe(e) {
193
- return {
194
- ...e,
195
- groups: e.groups.filter((t) => t.id !== "sidebar")
196
- };
191
+ //#endregion
192
+ //#region src/front/layout/ResponsiveDockviewShell.tsx
193
+ var Yt = 768, Xt = 1024;
194
+ function Zt(e) {
195
+ return {
196
+ ...e,
197
+ groups: e.groups.filter((e) => e.id !== "sidebar")
198
+ };
197
199
  }
198
- function we({
199
- layout: e,
200
- className: t
201
- }) {
202
- var F;
203
- const a = D(), n = Z(), o = ee(), i = K(ve), u = K(Pe), d = u && !i, l = P(
204
- () => e.groups.find((S) => S.id === "sidebar" && S.panel),
205
- [e]
206
- ), c = l == null ? void 0 : l.panel, p = !!c, f = Se({
207
- isNarrowViewport: p && u,
208
- isCollapsed: n.collapsed,
209
- setCollapsed: (S) => o({ collapsed: S })
210
- }), [s, h] = E(!1);
211
- v(() => {
212
- (!p || !i && !d) && h(!1);
213
- }, [p, i, d]);
214
- const b = p && (i || d && n.collapsed), m = p && !i && (!d || !n.collapsed), k = P(
215
- () => m ? e : xe(e),
216
- [m, e]
217
- ), j = P(() => {
218
- const S = m ? "inline-sidebar" : "overlay-sidebar", L = k.groups.map((N) => {
219
- let R = "";
220
- try {
221
- R = JSON.stringify(N.params ?? null);
222
- } catch {
223
- R = "unserializable";
224
- }
225
- return `${N.id}:${N.panel ?? ""}:${R}`;
226
- }).join(",");
227
- return `${k.version}:${S}:${L}`;
228
- }, [k, m]), z = A(
229
- a.subscribe,
230
- a.getSnapshot,
231
- a.getSnapshot
232
- ), H = P(() => a.getComponents(), [a, z]), W = c ? H[c] : null, U = c ? ((F = a.get(c)) == null ? void 0 : F.title) ?? "Sidebar" : "Sidebar", q = y(() => {
233
- h(!0);
234
- }, []), J = y(() => {
235
- f(), o({ collapsed: !1 }), h(!1);
236
- }, [f, o]), V = y(() => {
237
- f(), o({ collapsed: !0 }), h(!1);
238
- }, [f, o]), G = y(
239
- (S) => {
240
- S.target.closest("[role='treeitem']") && h(!1);
241
- },
242
- []
243
- );
244
- return /* @__PURE__ */ g("div", { className: "relative h-full w-full", children: [
245
- d && p && n.collapsed && /* @__PURE__ */ r(
246
- "div",
247
- {
248
- className: "pointer-events-none absolute inset-y-0 left-0 z-20 w-10 border-r border-border bg-background/95",
249
- "aria-hidden": "true"
250
- }
251
- ),
252
- b && /* @__PURE__ */ r(
253
- "div",
254
- {
255
- className: C(
256
- "absolute z-30",
257
- "left-2 top-2"
258
- ),
259
- children: /* @__PURE__ */ r(
260
- x,
261
- {
262
- type: "button",
263
- variant: "outline",
264
- size: "icon-sm",
265
- onClick: q,
266
- "aria-label": i ? "Open sidebar menu" : "Open collapsed sidebar",
267
- children: i ? /* @__PURE__ */ r(pe, { className: "h-4 w-4" }) : /* @__PURE__ */ r(M, { className: "h-4 w-4" })
268
- }
269
- )
270
- }
271
- ),
272
- d && p && !n.collapsed && /* @__PURE__ */ r("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ r(
273
- x,
274
- {
275
- type: "button",
276
- variant: "outline",
277
- size: "icon-sm",
278
- onClick: V,
279
- "aria-label": "Collapse sidebar",
280
- children: /* @__PURE__ */ r(M, { className: "h-4 w-4" })
281
- }
282
- ) }),
283
- /* @__PURE__ */ r(
284
- te,
285
- {
286
- layout: k,
287
- className: C(
288
- t,
289
- d && p && n.collapsed && "pl-10"
290
- )
291
- },
292
- j
293
- ),
294
- b && /* @__PURE__ */ r(re, { open: s, onOpenChange: h, children: /* @__PURE__ */ g(
295
- ne,
296
- {
297
- side: "left",
298
- className: "w-[85vw] max-w-sm p-0",
299
- children: [
300
- /* @__PURE__ */ g(se, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
301
- /* @__PURE__ */ g("div", { children: [
302
- /* @__PURE__ */ r(oe, { children: U }),
303
- /* @__PURE__ */ r(ie, { className: "sr-only", children: "Responsive sidebar panel" })
304
- ] }),
305
- d && /* @__PURE__ */ g(
306
- x,
307
- {
308
- type: "button",
309
- variant: "outline",
310
- size: "sm",
311
- onClick: J,
312
- "aria-label": "Pin sidebar open",
313
- children: [
314
- /* @__PURE__ */ r(me, { className: "h-4 w-4" }),
315
- "Pin"
316
- ]
317
- }
318
- )
319
- ] }),
320
- /* @__PURE__ */ r(
321
- "div",
322
- {
323
- className: "h-full min-h-0 overflow-auto",
324
- onClickCapture: G,
325
- children: W ? /* @__PURE__ */ r(de, { fallback: /* @__PURE__ */ r(_, {}), children: /* @__PURE__ */ r(W, {}) }) : /* @__PURE__ */ r(_, {})
326
- }
327
- )
328
- ]
329
- }
330
- ) })
331
- ] });
200
+ function Z({ layout: e, className: t }) {
201
+ let n = A(), r = w(), i = j(), a = Y(Yt), o = Y(Xt), s = o && !a, c = F(() => e.groups.find((e) => e.id === "sidebar" && e.panel), [e])?.panel, l = !!c, u = X({
202
+ isNarrowViewport: l && o,
203
+ isCollapsed: r.collapsed,
204
+ setCollapsed: (e) => i({ collapsed: e })
205
+ }), [d, f] = L(!1);
206
+ P(() => {
207
+ (!l || !a && !s) && f(!1);
208
+ }, [
209
+ l,
210
+ a,
211
+ s
212
+ ]);
213
+ let p = l && (a || s && r.collapsed), m = l && !a && (!s || !r.collapsed), h = F(() => m ? e : Zt(e), [m, e]), g = F(() => {
214
+ let e = m ? "inline-sidebar" : "overlay-sidebar", t = h.groups.map((e) => {
215
+ let t = "";
216
+ try {
217
+ t = JSON.stringify(e.params ?? null);
218
+ } catch {
219
+ t = "unserializable";
220
+ }
221
+ return `${e.id}:${e.panel ?? ""}:${t}`;
222
+ }).join(",");
223
+ return `${h.version}:${e}:${t}`;
224
+ }, [h, m]), _ = F(() => n.getComponents(), [n, R(n.subscribe, n.getSnapshot, n.getSnapshot)]), v = c ? _[c] : null, y = c ? n.get(c)?.title ?? "Sidebar" : "Sidebar", b = N(() => {
225
+ f(!0);
226
+ }, []), x = N(() => {
227
+ u(), i({ collapsed: !1 }), f(!1);
228
+ }, [u, i]), S = N(() => {
229
+ u(), i({ collapsed: !0 }), f(!1);
230
+ }, [u, i]), C = N((e) => {
231
+ e.target.closest("[role='treeitem']") && f(!1);
232
+ }, []);
233
+ return /* @__PURE__ */ B("div", {
234
+ className: "relative h-full w-full",
235
+ children: [
236
+ s && l && r.collapsed && /* @__PURE__ */ z("div", {
237
+ className: "pointer-events-none absolute inset-y-0 left-0 z-20 w-10 border-r border-border bg-background/95",
238
+ "aria-hidden": "true"
239
+ }),
240
+ p && /* @__PURE__ */ z("div", {
241
+ className: M("absolute z-30", "left-2 top-2"),
242
+ children: /* @__PURE__ */ z(H, {
243
+ type: "button",
244
+ variant: "outline",
245
+ size: "icon-sm",
246
+ onClick: b,
247
+ "aria-label": a ? "Open sidebar menu" : "Open collapsed sidebar",
248
+ children: z(a ? Nt : V, { className: "h-4 w-4" })
249
+ })
250
+ }),
251
+ s && l && !r.collapsed && /* @__PURE__ */ z("div", {
252
+ className: "absolute left-2 top-2 z-30",
253
+ children: /* @__PURE__ */ z(H, {
254
+ type: "button",
255
+ variant: "outline",
256
+ size: "icon-sm",
257
+ onClick: S,
258
+ "aria-label": "Collapse sidebar",
259
+ children: /* @__PURE__ */ z(V, { className: "h-4 w-4" })
260
+ })
261
+ }),
262
+ /* @__PURE__ */ z(k, {
263
+ layout: h,
264
+ className: M(t, s && l && r.collapsed && "pl-10")
265
+ }, g),
266
+ p && /* @__PURE__ */ z(Lt, {
267
+ open: d,
268
+ onOpenChange: f,
269
+ children: /* @__PURE__ */ B(Rt, {
270
+ side: "left",
271
+ className: "w-[85vw] max-w-sm p-0",
272
+ children: [/* @__PURE__ */ B(Bt, {
273
+ className: "flex flex-row items-center justify-between border-b border-border px-4 py-3",
274
+ children: [/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z(Vt, { children: y }), /* @__PURE__ */ z(zt, {
275
+ className: "sr-only",
276
+ children: "Responsive sidebar panel"
277
+ })] }), s && /* @__PURE__ */ B(H, {
278
+ type: "button",
279
+ variant: "outline",
280
+ size: "sm",
281
+ onClick: x,
282
+ "aria-label": "Pin sidebar open",
283
+ children: [/* @__PURE__ */ z(Pt, { className: "h-4 w-4" }), "Pin"]
284
+ })]
285
+ }), /* @__PURE__ */ z("div", {
286
+ className: "h-full min-h-0 overflow-auto",
287
+ onClickCapture: C,
288
+ children: v ? /* @__PURE__ */ z(kt, {
289
+ fallback: /* @__PURE__ */ z(Q, {}),
290
+ children: /* @__PURE__ */ z(v, {})
291
+ }) : /* @__PURE__ */ z(Q, {})
292
+ })]
293
+ })
294
+ })
295
+ ]
296
+ });
332
297
  }
333
- function _() {
334
- return /* @__PURE__ */ r("div", { className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground", children: "Loading sidebar..." });
298
+ function Q() {
299
+ return /* @__PURE__ */ z("div", {
300
+ className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground",
301
+ children: "Loading sidebar..."
302
+ });
335
303
  }
336
- function Ce(e = {}) {
337
- const { sidebar: t = "filetree", center: a = "empty", right: n } = e, o = [
338
- {
339
- id: "sidebar",
340
- position: "left",
341
- panel: t,
342
- locked: !0,
343
- collapsible: !0,
344
- collapsedWidth: 40,
345
- constraints: { minWidth: 200, maxWidthViewportRatio: 0.5 }
346
- },
347
- {
348
- id: "center",
349
- position: "center",
350
- panel: a,
351
- dynamic: !0,
352
- placeholder: "empty",
353
- constraints: { minWidth: 300 }
354
- }
355
- ];
356
- return n && o.push({
357
- id: "right",
358
- position: "right",
359
- panel: n,
360
- hideHeader: !0,
361
- constraints: { minWidth: 250 }
362
- }), { version: "2.0", groups: o };
304
+ //#endregion
305
+ //#region src/front/layout/IdeLayout.tsx
306
+ function $(e = {}) {
307
+ let { sidebar: t = "filetree", center: n = "empty", right: r } = e, i = [{
308
+ id: "sidebar",
309
+ position: "left",
310
+ panel: t,
311
+ locked: !0,
312
+ collapsible: !0,
313
+ collapsedWidth: 40,
314
+ constraints: {
315
+ minWidth: 200,
316
+ maxWidthViewportRatio: .5
317
+ }
318
+ }, {
319
+ id: "center",
320
+ position: "center",
321
+ panel: n,
322
+ dynamic: !0,
323
+ placeholder: "empty",
324
+ constraints: { minWidth: 300 }
325
+ }];
326
+ return r && i.push({
327
+ id: "right",
328
+ position: "right",
329
+ panel: r,
330
+ hideHeader: !0,
331
+ constraints: { minWidth: 250 }
332
+ }), {
333
+ version: "2.0",
334
+ groups: i
335
+ };
363
336
  }
364
- function Ae(e) {
365
- return /* @__PURE__ */ r(we, { layout: Ce(e), className: e.className });
337
+ function Qt(e) {
338
+ return /* @__PURE__ */ z(Z, {
339
+ layout: $(e),
340
+ className: e.className
341
+ });
366
342
  }
367
- function $e({ className: e, onOpenFile: t }) {
368
- return /* @__PURE__ */ r(
369
- le,
370
- {
371
- className: C("h-full border-0 text-muted-foreground", e),
372
- title: "No file open",
373
- description: "Open a file to get started",
374
- actions: t ? /* @__PURE__ */ r(x, { type: "button", variant: "outline", onClick: t, children: "Open file" }) : null,
375
- children: /* @__PURE__ */ g("div", { className: "space-y-2 text-sm", children: [
376
- /* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
377
- /* @__PURE__ */ r(O, { children: "⌘P" }),
378
- /* @__PURE__ */ r("span", { children: "Open file" })
379
- ] }),
380
- /* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
381
- /* @__PURE__ */ r(O, { children: "⌘⇧P" }),
382
- /* @__PURE__ */ r("span", { children: "Command palette" })
383
- ] }),
384
- /* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
385
- /* @__PURE__ */ r(O, { children: "⌘B" }),
386
- /* @__PURE__ */ r("span", { children: "Toggle sidebar" })
387
- ] })
388
- ] })
389
- }
390
- );
343
+ //#endregion
344
+ //#region src/front/chrome/empty-pane/EmptyPane.tsx
345
+ function $t({ className: e, onOpenFile: t }) {
346
+ return /* @__PURE__ */ z(Ft, {
347
+ className: M("h-full border-0 text-muted-foreground", e),
348
+ title: "No file open",
349
+ description: "Open a file to get started",
350
+ actions: t ? /* @__PURE__ */ z(H, {
351
+ type: "button",
352
+ variant: "outline",
353
+ onClick: t,
354
+ children: "Open file"
355
+ }) : null,
356
+ children: /* @__PURE__ */ B("div", {
357
+ className: "space-y-2 text-sm",
358
+ children: [
359
+ /* @__PURE__ */ B("div", {
360
+ className: "flex items-center gap-3",
361
+ children: [/* @__PURE__ */ z(W, { children: "⌘P" }), /* @__PURE__ */ z("span", { children: "Open file" })]
362
+ }),
363
+ /* @__PURE__ */ B("div", {
364
+ className: "flex items-center gap-3",
365
+ children: [/* @__PURE__ */ z(W, { children: "⌘⇧P" }), /* @__PURE__ */ z("span", { children: "Command palette" })]
366
+ }),
367
+ /* @__PURE__ */ B("div", {
368
+ className: "flex items-center gap-3",
369
+ children: [/* @__PURE__ */ z(W, { children: "⌘B" }), /* @__PURE__ */ z("span", { children: "Toggle sidebar" })]
370
+ })
371
+ ]
372
+ })
373
+ });
391
374
  }
392
- class je extends ue {
393
- constructor() {
394
- super(...arguments);
395
- T(this, "state", { hasError: !1, error: null });
396
- T(this, "handleRetry", () => {
397
- this.setState({ hasError: !1, error: null });
398
- });
399
- }
400
- static getDerivedStateFromError(a) {
401
- return { hasError: !0, error: a };
402
- }
403
- componentDidCatch(a, n) {
404
- const { panelId: o, onError: i } = this.props;
405
- console.error(`[PanelErrorBoundary] Panel "${o}" crashed:`, a, n.componentStack), i == null || i({
406
- panelId: o,
407
- error: a.message,
408
- stack: n.componentStack ?? void 0
409
- });
410
- }
411
- render() {
412
- var a;
413
- return this.state.hasError ? /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ r(
414
- ce,
415
- {
416
- className: "w-full max-w-md",
417
- title: "Something went wrong",
418
- description: /* @__PURE__ */ g(ae, { children: [
419
- "Panel ",
420
- /* @__PURE__ */ r("code", { className: "rounded bg-muted px-1 py-0.5 text-xs", children: this.props.panelId }),
421
- " ",
422
- "encountered an error."
423
- ] }),
424
- details: (a = this.state.error) == null ? void 0 : a.message,
425
- actions: /* @__PURE__ */ r(x, { type: "button", variant: "outline", onClick: this.handleRetry, children: "Retry" })
426
- }
427
- ) }) : this.props.children;
428
- }
429
- }
430
- function ze({
431
- sessions: e,
432
- activeId: t,
433
- onSwitch: a,
434
- onCreate: n,
435
- onDelete: o,
436
- className: i
437
- }) {
438
- const [u, d] = E(null), l = w({}), c = P(() => e.map((s) => s.id), [e]);
439
- v(() => {
440
- if (c.length === 0) {
441
- d(null);
442
- return;
443
- }
444
- d((s) => s && c.includes(s) ? s : t && c.includes(t) ? t : c[0] ?? null);
445
- }, [c, t]);
446
- const p = y((s) => {
447
- var h;
448
- d(s), (h = l.current[s]) == null || h.focus();
449
- }, []), f = y(
450
- (s, h) => {
451
- if (s.target !== s.currentTarget) return;
452
- if (s.key === "Enter" || s.key === " ") {
453
- s.preventDefault(), a == null || a(h);
454
- return;
455
- }
456
- const b = c.indexOf(h);
457
- if (b < 0) return;
458
- let m = b;
459
- if (s.key === "ArrowDown")
460
- m = Math.min(b + 1, c.length - 1);
461
- else if (s.key === "ArrowUp")
462
- m = Math.max(b - 1, 0);
463
- else if (s.key === "Home")
464
- m = 0;
465
- else if (s.key === "End")
466
- m = c.length - 1;
467
- else
468
- return;
469
- s.preventDefault();
470
- const k = c[m];
471
- k && p(k);
472
- },
473
- [p, a, c]
474
- );
475
- return /* @__PURE__ */ g(
476
- "div",
477
- {
478
- "data-boring-workspace-part": "session-list",
479
- className: C("flex h-full flex-col", i),
480
- role: "navigation",
481
- "aria-label": "Sessions",
482
- children: [
483
- /* @__PURE__ */ g("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [
484
- /* @__PURE__ */ r("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Sessions" }),
485
- n && /* @__PURE__ */ r(I, { type: "button", variant: "ghost", size: "icon-xs", onClick: n, "aria-label": "New session", children: /* @__PURE__ */ r(
486
- "svg",
487
- {
488
- width: "16",
489
- height: "16",
490
- viewBox: "0 0 16 16",
491
- fill: "none",
492
- stroke: "currentColor",
493
- strokeWidth: "1.5",
494
- strokeLinecap: "round",
495
- children: /* @__PURE__ */ r("path", { d: "M8 3v10M3 8h10" })
496
- }
497
- ) })
498
- ] }),
499
- /* @__PURE__ */ g("div", { className: "flex-1 overflow-y-auto", role: "list", "aria-label": "Session list", children: [
500
- e.length === 0 && /* @__PURE__ */ r("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No sessions" }),
501
- e.map((s) => /* @__PURE__ */ r(
502
- Ne,
503
- {
504
- session: s,
505
- isActive: s.id === t,
506
- isFocused: s.id === u,
507
- onSwitch: a,
508
- onDelete: o,
509
- onFocus: () => d(s.id),
510
- onKeyDown: f,
511
- rowRef: (h) => {
512
- l.current[s.id] = h;
513
- }
514
- },
515
- s.id
516
- ))
517
- ] })
518
- ]
519
- }
520
- );
375
+ //#endregion
376
+ //#region src/front/components/PanelErrorBoundary.tsx
377
+ var en = class extends Ot {
378
+ state = {
379
+ hasError: !1,
380
+ error: null
381
+ };
382
+ static getDerivedStateFromError(e) {
383
+ return {
384
+ hasError: !0,
385
+ error: e
386
+ };
387
+ }
388
+ componentDidCatch(e, t) {
389
+ let { panelId: n, onError: r } = this.props;
390
+ console.error(`[PanelErrorBoundary] Panel "${n}" crashed:`, e, t.componentStack), r?.({
391
+ panelId: n,
392
+ error: e.message,
393
+ stack: t.componentStack ?? void 0
394
+ });
395
+ }
396
+ handleRetry = () => {
397
+ this.setState({
398
+ hasError: !1,
399
+ error: null
400
+ });
401
+ };
402
+ render() {
403
+ return this.state.hasError ? /* @__PURE__ */ z("div", {
404
+ className: "flex h-full items-center justify-center p-6",
405
+ children: /* @__PURE__ */ z(It, {
406
+ className: "w-full max-w-md",
407
+ title: "Something went wrong",
408
+ description: /* @__PURE__ */ B(At, { children: [
409
+ "Panel ",
410
+ /* @__PURE__ */ z("code", {
411
+ className: "rounded bg-muted px-1 py-0.5 text-xs",
412
+ children: this.props.panelId
413
+ }),
414
+ " ",
415
+ "encountered an error."
416
+ ] }),
417
+ details: this.state.error?.message,
418
+ actions: /* @__PURE__ */ z(H, {
419
+ type: "button",
420
+ variant: "outline",
421
+ onClick: this.handleRetry,
422
+ children: "Retry"
423
+ })
424
+ })
425
+ }) : this.props.children;
426
+ }
427
+ };
428
+ //#endregion
429
+ //#region src/front/components/SessionList.tsx
430
+ function tn({ sessions: e, activeId: t, onSwitch: n, onCreate: r, onDelete: i, className: a }) {
431
+ let [o, s] = L(null), c = I({}), l = F(() => e.map((e) => e.id), [e]);
432
+ P(() => {
433
+ if (l.length === 0) {
434
+ s(null);
435
+ return;
436
+ }
437
+ s((e) => e && l.includes(e) ? e : t && l.includes(t) ? t : l[0] ?? null);
438
+ }, [l, t]);
439
+ let u = N((e) => {
440
+ s(e), c.current[e]?.focus();
441
+ }, []), d = N((e, t) => {
442
+ if (e.target !== e.currentTarget) return;
443
+ if (e.key === "Enter" || e.key === " ") {
444
+ e.preventDefault(), n?.(t);
445
+ return;
446
+ }
447
+ let r = l.indexOf(t);
448
+ if (r < 0) return;
449
+ let i = r;
450
+ if (e.key === "ArrowDown") i = Math.min(r + 1, l.length - 1);
451
+ else if (e.key === "ArrowUp") i = Math.max(r - 1, 0);
452
+ else if (e.key === "Home") i = 0;
453
+ else if (e.key === "End") i = l.length - 1;
454
+ else return;
455
+ e.preventDefault();
456
+ let a = l[i];
457
+ a && u(a);
458
+ }, [
459
+ u,
460
+ n,
461
+ l
462
+ ]);
463
+ return /* @__PURE__ */ B("div", {
464
+ "data-boring-workspace-part": "session-list",
465
+ className: M("flex h-full flex-col", a),
466
+ role: "navigation",
467
+ "aria-label": "Sessions",
468
+ children: [/* @__PURE__ */ B("div", {
469
+ className: "flex items-center justify-between border-b border-border px-3 py-2",
470
+ children: [/* @__PURE__ */ z("span", {
471
+ className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
472
+ children: "Sessions"
473
+ }), r && /* @__PURE__ */ z(U, {
474
+ type: "button",
475
+ variant: "ghost",
476
+ size: "icon-xs",
477
+ onClick: r,
478
+ "aria-label": "New session",
479
+ children: /* @__PURE__ */ z("svg", {
480
+ width: "16",
481
+ height: "16",
482
+ viewBox: "0 0 16 16",
483
+ fill: "none",
484
+ stroke: "currentColor",
485
+ strokeWidth: "1.5",
486
+ strokeLinecap: "round",
487
+ children: /* @__PURE__ */ z("path", { d: "M8 3v10M3 8h10" })
488
+ })
489
+ })]
490
+ }), /* @__PURE__ */ B("div", {
491
+ className: "flex-1 overflow-y-auto",
492
+ role: "list",
493
+ "aria-label": "Session list",
494
+ children: [e.length === 0 && /* @__PURE__ */ z("div", {
495
+ className: "px-3 py-6 text-center text-sm text-muted-foreground",
496
+ children: "No sessions"
497
+ }), e.map((e) => /* @__PURE__ */ z(rn, {
498
+ session: e,
499
+ isActive: e.id === t,
500
+ isFocused: e.id === o,
501
+ onSwitch: n,
502
+ onDelete: i,
503
+ onFocus: () => s(e.id),
504
+ onKeyDown: d,
505
+ rowRef: (t) => {
506
+ c.current[e.id] = t;
507
+ }
508
+ }, e.id))]
509
+ })]
510
+ });
521
511
  }
522
- async function Ee(e) {
523
- var a, n;
524
- if (typeof navigator < "u" && ((a = navigator.clipboard) != null && a.writeText))
525
- try {
526
- return await navigator.clipboard.writeText(e), !0;
527
- } catch {
528
- }
529
- if (typeof document > "u") return !1;
530
- const t = document.createElement("textarea");
531
- t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.top = "-9999px", t.style.left = "-9999px", t.style.opacity = "0", t.style.pointerEvents = "none", document.body.appendChild(t);
532
- try {
533
- return t.focus(), t.select(), ((n = document.execCommand) == null ? void 0 : n.call(document, "copy")) ?? !1;
534
- } catch {
535
- return !1;
536
- } finally {
537
- document.body.removeChild(t);
538
- }
512
+ async function nn(e) {
513
+ if (typeof navigator < "u" && navigator.clipboard?.writeText) try {
514
+ return await navigator.clipboard.writeText(e), !0;
515
+ } catch {}
516
+ if (typeof document > "u") return !1;
517
+ let t = document.createElement("textarea");
518
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.top = "-9999px", t.style.left = "-9999px", t.style.opacity = "0", t.style.pointerEvents = "none", document.body.appendChild(t);
519
+ try {
520
+ return t.focus(), t.select(), document.execCommand?.("copy") ?? !1;
521
+ } catch {
522
+ return !1;
523
+ } finally {
524
+ document.body.removeChild(t);
525
+ }
539
526
  }
540
- function Ne({
541
- session: e,
542
- isActive: t,
543
- isFocused: a,
544
- onSwitch: n,
545
- onDelete: o,
546
- onFocus: i,
547
- onKeyDown: u,
548
- rowRef: d
549
- }) {
550
- const [l, c] = E(!1), p = y((f) => {
551
- f.stopPropagation(), Ee(e.id).then((s) => {
552
- s && (c(!0), window.setTimeout(() => c(!1), 1200));
553
- });
554
- }, [e.id]);
555
- return /* @__PURE__ */ g(
556
- "div",
557
- {
558
- ref: d,
559
- role: "listitem",
560
- "data-boring-workspace-part": "session-row",
561
- "data-boring-state": t ? "selected" : void 0,
562
- "data-focused": a ? "true" : "false",
563
- className: C(
564
- "group flex items-center gap-2 border-b border-border px-3 py-2 text-sm cursor-pointer transition-colors",
565
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
566
- t ? "bg-accent text-accent-foreground" : "text-foreground hover:bg-accent/50"
567
- ),
568
- onClick: () => n == null ? void 0 : n(e.id),
569
- onFocus: i,
570
- onKeyDown: (f) => u(f, e.id),
571
- tabIndex: a ? 0 : -1,
572
- "aria-current": t ? "true" : void 0,
573
- children: [
574
- /* @__PURE__ */ r("span", { className: "flex-1 truncate", children: e.title }),
575
- /* @__PURE__ */ r(
576
- I,
577
- {
578
- type: "button",
579
- variant: "ghost",
580
- size: "icon-xs",
581
- className: "hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:inline-flex group-data-[focused=true]:inline-flex",
582
- onClick: p,
583
- tabIndex: a ? 0 : -1,
584
- "aria-label": `Copy Pi session id for ${e.title}`,
585
- title: "Copy Pi session id",
586
- children: l ? /* @__PURE__ */ r(fe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(he, { className: "h-3.5 w-3.5" })
587
- }
588
- ),
589
- t && /* @__PURE__ */ r(
590
- "span",
591
- {
592
- className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary",
593
- "aria-label": "Active"
594
- }
595
- ),
596
- o && /* @__PURE__ */ r(
597
- I,
598
- {
599
- type: "button",
600
- variant: "ghost",
601
- size: "icon-xs",
602
- className: "hidden shrink-0 text-muted-foreground hover:text-destructive group-hover:inline-flex group-data-[focused=true]:inline-flex",
603
- onClick: (f) => {
604
- f.stopPropagation(), o(e.id);
605
- },
606
- tabIndex: a ? 0 : -1,
607
- "aria-label": `Delete ${e.title}`,
608
- children: /* @__PURE__ */ r(
609
- "svg",
610
- {
611
- width: "14",
612
- height: "14",
613
- viewBox: "0 0 14 14",
614
- fill: "none",
615
- stroke: "currentColor",
616
- strokeWidth: "1.5",
617
- strokeLinecap: "round",
618
- children: /* @__PURE__ */ r("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" })
619
- }
620
- )
621
- }
622
- )
623
- ]
624
- }
625
- );
527
+ function rn({ session: e, isActive: t, isFocused: n, onSwitch: r, onDelete: i, onFocus: a, onKeyDown: o, rowRef: s }) {
528
+ let [c, l] = L(!1), u = N((t) => {
529
+ t.stopPropagation(), nn(e.id).then((e) => {
530
+ e && (l(!0), window.setTimeout(() => l(!1), 1200));
531
+ });
532
+ }, [e.id]);
533
+ return /* @__PURE__ */ B("div", {
534
+ ref: s,
535
+ role: "listitem",
536
+ "data-boring-workspace-part": "session-row",
537
+ "data-boring-state": t ? "selected" : void 0,
538
+ "data-focused": n ? "true" : "false",
539
+ className: M("group flex items-center gap-2 border-b border-border px-3 py-2 text-sm cursor-pointer transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1", t ? "bg-accent text-accent-foreground" : "text-foreground hover:bg-accent/50"),
540
+ onClick: () => r?.(e.id),
541
+ onFocus: a,
542
+ onKeyDown: (t) => o(t, e.id),
543
+ tabIndex: n ? 0 : -1,
544
+ "aria-current": t ? "true" : void 0,
545
+ children: [
546
+ /* @__PURE__ */ z("span", {
547
+ className: "flex-1 truncate",
548
+ children: e.title
549
+ }),
550
+ /* @__PURE__ */ z(U, {
551
+ type: "button",
552
+ variant: "ghost",
553
+ size: "icon-xs",
554
+ className: "hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:inline-flex group-data-[focused=true]:inline-flex",
555
+ onClick: u,
556
+ tabIndex: n ? 0 : -1,
557
+ "aria-label": `Copy Pi session id for ${e.title}`,
558
+ title: "Copy Pi session id",
559
+ children: z(c ? jt : Mt, { className: "h-3.5 w-3.5" })
560
+ }),
561
+ t && /* @__PURE__ */ z("span", {
562
+ className: "h-1.5 w-1.5 shrink-0 rounded-full bg-primary",
563
+ "aria-label": "Active"
564
+ }),
565
+ i && /* @__PURE__ */ z(U, {
566
+ type: "button",
567
+ variant: "ghost",
568
+ size: "icon-xs",
569
+ className: "hidden shrink-0 text-muted-foreground hover:text-destructive group-hover:inline-flex group-data-[focused=true]:inline-flex",
570
+ onClick: (t) => {
571
+ t.stopPropagation(), i(e.id);
572
+ },
573
+ tabIndex: n ? 0 : -1,
574
+ "aria-label": `Delete ${e.title}`,
575
+ children: /* @__PURE__ */ z("svg", {
576
+ width: "14",
577
+ height: "14",
578
+ viewBox: "0 0 14 14",
579
+ fill: "none",
580
+ stroke: "currentColor",
581
+ strokeWidth: "1.5",
582
+ strokeLinecap: "round",
583
+ children: /* @__PURE__ */ z("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" })
584
+ })
585
+ })
586
+ ]
587
+ });
626
588
  }
627
- export {
628
- qe as ArtifactSurfacePane,
629
- Je as CatalogRegistry,
630
- Ka as ChatLayout,
631
- Ve as CodeEditor,
632
- Ge as CodeEditorPane,
633
- Xe as CommandPalette,
634
- Qe as CommandRegistry,
635
- te as DockviewShell,
636
- $e as EmptyPane,
637
- qa as FileTree,
638
- Ye as FileTreePane,
639
- Ze as FileTreeView,
640
- Ae as IdeLayout,
641
- et as MAX_PANELS,
642
- Va as MarkdownEditor,
643
- tt as MarkdownEditorPane,
644
- at as PanelChrome,
645
- je as PanelErrorBoundary,
646
- rt as PanelRegistry,
647
- nt as PluginError,
648
- st as PluginErrorBoundary,
649
- ot as PluginErrorProvider,
650
- it as RegistryProvider,
651
- we as ResponsiveDockviewShell,
652
- lt as SessionBrowser,
653
- ze as SessionList,
654
- ct as SurfaceResolverRegistry,
655
- dt as SurfaceShell,
656
- ut as ThemeProvider,
657
- ja as Toaster,
658
- _a as TopBar,
659
- pt as UI_COMMAND_EVENT,
660
- mt as WORKSPACE_ATTENTION_ACTION_EVENT,
661
- ft as WORKSPACE_COMPOSER_STOP_EVENT,
662
- ht as WORKSPACE_COMPOSER_STOP_REASONS,
663
- gt as WORKSPACE_OPEN_PATH_SURFACE_KIND,
664
- yt as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT,
665
- bt as WorkbenchLeftPane,
666
- kt as WorkspaceFilesProvider,
667
- Be as WorkspaceLink,
668
- Da as WorkspaceLoadingState,
669
- St as WorkspacePluginClientProvider,
670
- vt as WorkspaceProvider,
671
- Pt as WorkspaceSourceRegistry,
672
- xt as agentMeta,
673
- wt as bindStore,
674
- Ct as bootstrap,
675
- Aa as buildChatLayout,
676
- Et as buildFullPagePanelHref,
677
- Ce as buildIdeLayout,
678
- Nt as closePanelSchema,
679
- C as cn,
680
- Rt as createBridge,
681
- Tt as createBridgeClient,
682
- Ot as createShadcnTheme,
683
- It as createWorkspacePluginClient,
684
- Wt as createWorkspaceStore,
685
- Ft as definePanel,
686
- za as dismissToast,
687
- Lt as emitAgentData,
688
- Mt as emitFilesystemAgentFileChange,
689
- Bt as emitWorkspaceAttentionAction,
690
- Kt as emitWorkspaceComposerStop,
691
- _t as events,
692
- Dt as expandToFileSchema,
693
- At as filesystemEvents,
694
- $t as filesystemPlugin,
695
- jt as formatShortcut,
696
- zt as getFileIcon,
697
- Ht as isWorkspaceComposerStopDetail,
698
- Ut as isWorkspaceComposerStopReason,
699
- qt as navigateToLineSchema,
700
- Jt as notificationSchema,
701
- Vt as onFilesystemChanged,
702
- Gt as openFileSchema,
703
- Xt as openPanelSchema,
704
- Y as postUiCommand,
705
- Ke as readFileRecords,
706
- Ha as toast,
707
- Qt as useActiveFile,
708
- Yt as useActivePanel,
709
- Me as useActivePanels,
710
- Zt as useApiBaseUrl,
711
- _e as useArtifactPanels,
712
- De as useArtifactRouting,
713
- ea as useAutoOpenAgentFiles,
714
- ta as useCatalogRegistry,
715
- aa as useCatalogs,
716
- ra as useCommandRegistry,
717
- na as useCommands,
718
- sa as useDirtyFiles,
719
- oa as useDockviewApi,
720
- ia as useEditorLifecycle,
721
- la as useEvent,
722
- ca as useFilePane,
723
- da as useFullPagePanelHref,
724
- ua as useHasWorkspaceFilesProvider,
725
- pa as useHydrationComplete,
726
- ma as useIsFullPagePanel,
727
- fa as useKeyboardShortcuts,
728
- ha as useOpenPanels,
729
- ga as usePanelRenderMode,
730
- ya as usePluginErrors,
731
- D as useRegistry,
732
- ba as useResetLayout,
733
- Se as useResponsiveSidebarCollapse,
734
- ee as useSetSidebar,
735
- Z as useSidebarState,
736
- ka as useSurfaceResolverRegistry,
737
- Sa as useTheme,
738
- va as useThemePreference,
739
- K as useViewportBreakpoint,
740
- Pa as useWorkspaceAttention,
741
- xa as useWorkspaceBridge,
742
- wa as useWorkspaceChatPanel,
743
- Ca as useWorkspaceContext,
744
- Ea as useWorkspaceContextOptional,
745
- Na as useWorkspaceLeftPaneActions,
746
- Ra as useWorkspacePluginClient,
747
- Ta as useWorkspaceRequestId,
748
- Oa as useWorkspaceSourceRegistry,
749
- Ia as userMeta,
750
- Wa as workspaceAttentionSessionBadgeForBlocker,
751
- Fa as workspaceComposerStopAppliesToSession,
752
- La as workspaceComposerStopTargetSessionId,
753
- Ma as workspaceEvents,
754
- $ as workspaceLinkCommand,
755
- ge as workspaceLinkHref
756
- };
589
+ //#endregion
590
+ export { ot as ArtifactSurfacePane, ut as CatalogRegistry, wt as ChatLayout, E as CodeEditor, e as CodeEditorPane, f as CommandPalette, le as CommandRegistry, k as DockviewShell, $t as EmptyPane, Dt as FileTree, ze as FileTreePane, ct as FileTreeView, Qt as IdeLayout, g as MAX_PANELS, bt as MarkdownEditor, ee as MarkdownEditorPane, Ve as PanelChrome, en as PanelErrorBoundary, n as PanelRegistry, mt as PluginError, _e as PluginErrorBoundary, Ke as PluginErrorProvider, st as RegistryProvider, Z as ResponsiveDockviewShell, ke as SessionBrowser, tn as SessionList, De as SurfaceResolverRegistry, Le as SurfaceShell, it as ThemeProvider, Te as Toaster, Ct as TopBar, m as UI_COMMAND_EVENT, lt as WORKSPACE_ATTENTION_ACTION_EVENT, i as WORKSPACE_COMPOSER_STOP_EVENT, ft as WORKSPACE_COMPOSER_STOP_REASONS, s as WORKSPACE_OPEN_PATH_SURFACE_KIND, ce as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT, Ce as WorkbenchLeftPane, Pe as WorkspaceFilesProvider, Wt as WorkspaceLink, Tt as WorkspaceLoadingState, Ue as WorkspacePluginClientProvider, He as WorkspaceProvider, me as WorkspaceSourceRegistry, se as agentMeta, he as bindStore, _t as bootstrap, St as buildChatLayout, d as buildFullPagePanelHref, $ as buildIdeLayout, de as closePanelSchema, M as cn, Ze as createBridge, v as createBridgeClient, at as createShadcnTheme, $e as createWorkspacePluginClient, ae as createWorkspaceStore, Je as definePanel, Ee as dismissToast, yt as emitAgentData, qe as emitFilesystemAgentFileChange, gt as emitWorkspaceAttentionAction, ie as emitWorkspaceComposerStop, ne as events, ue as expandToFileSchema, u as filesystemEvents, fe as filesystemPlugin, et as formatShortcut, Ie as getFileIcon, c as isWorkspaceComposerStopDetail, o as isWorkspaceComposerStopReason, pe as navigateToLineSchema, te as notificationSchema, rt as onFilesystemChanged, t as openFileSchema, T as openPanelSchema, y as postUiCommand, q as readFileRecords, Ye as toast, dt as useActiveFile, vt as useActivePanel, Ht as useActivePanels, b as useApiBaseUrl, xt as useAppLeftOverlayChrome, qt as useArtifactPanels, Jt as useArtifactRouting, Se as useAutoOpenAgentFiles, we as useCatalogRegistry, xe as useCatalogs, O as useCommandRegistry, Re as useCommands, be as useDirtyFiles, Oe as useDockviewApi, ve as useEditorLifecycle, r as useEvent, We as useFilePane, _ as useFullPagePanelHref, x as useHasWorkspaceFilesProvider, ht as useHydrationComplete, Xe as useIsFullPagePanel, Ne as useKeyboardShortcuts, re as useOpenPanels, h as usePanelRenderMode, nt as usePluginErrors, A as useRegistry, a as useResetLayout, X as useResponsiveSidebarCollapse, j as useSetSidebar, w as useSidebarState, Be as useSurfaceResolverRegistry, Qe as useTheme, l as useThemePreference, Y as useViewportBreakpoint, ye as useWorkspaceAttention, je as useWorkspaceBridge, ge as useWorkspaceChatPanel, Ge as useWorkspaceContext, tt as useWorkspaceContextOptional, D as useWorkspaceLeftPaneActions, Me as useWorkspacePluginClient, C as useWorkspaceRequestId, Et as useWorkspaceShellCapabilities, Ae as useWorkspaceSourceRegistry, p as userMeta, pt as workspaceAttentionSessionBadgeForBlocker, S as workspaceComposerStopAppliesToSession, Fe as workspaceComposerStopTargetSessionId, oe as workspaceEvents, G as workspaceLinkCommand, K as workspaceLinkHref };