@hachej/boring-workspace 0.1.59 → 0.1.60

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/workspace.js CHANGED
@@ -1,23 +1,22 @@
1
- var G = Object.defineProperty;
2
- var X = (e, t, a) => t in e ? G(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
- var T = (e, t, a) => X(e, typeof t != "symbol" ? t + "" : t, a);
4
- import { u as _, p as Q, a as Y, b as Z, D as ee } from "./WorkspaceProvider-Bp1Sm40K.js";
5
- import { A as Ve, C as Je, c as Ge, d as Xe, e as Qe, f as Ye, F as Ze, g as et, M as tt, h as at, P as rt, i as nt, j as st, k as ot, l as it, R as lt, S as ct, m as dt, n as ut, T as pt, U as mt, W as ft, o as ht, q as gt, r as bt, s as yt, t as vt, v as St, w as kt, x as xt, y as Pt, z as wt, B as Ct, E as Et, G as Nt, H as Rt, I as Tt, J as Ot, K as It, L as Ft, N as Wt, O as Lt, Q as Bt, V as Mt, X as Kt, Y as _t, Z as Dt, _ as At, $ as $t, a0 as jt, a1 as zt, a2 as Ht, a3 as Ut, a4 as qt, a5 as Vt, a6 as Jt, a7 as Gt, a8 as Xt, a9 as Qt, aa as Yt, ab as Zt, ac as ea, ad as ta, ae as aa, af as ra, ag as na, ah as sa, ai as oa, aj as ia, ak as la, al as ca, am as da, an as ua, ao as pa, ap as ma, aq as fa, ar as ha, as as ga, at as ba, au as ya, av as va, aw as Sa, ax as ka, ay as xa, az as Pa, aA as wa, aB as Ca, aC as Ea, aD as Na, aE as Ra, aF as Ta } from "./WorkspaceProvider-Bp1Sm40K.js";
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-Dxvh_Faj.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 bt, t as yt, 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 Bt, X as Mt, 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 ba, av as ya, 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 } from "./WorkspaceProvider-Dxvh_Faj.js";
6
6
  import { c as C } from "./utils-B6yFEsav.js";
7
- import { C as Ia, T as Fa, W as Wa, b as La } from "./WorkspaceLoadingState-BYTO4wdt.js";
8
- import { jsx as r, jsxs as g, Fragment as te } from "react/jsx-runtime";
9
- import { Button as P, Sheet as ae, SheetContent as re, SheetHeader as ne, SheetTitle as se, SheetDescription as oe, EmptyState as ie, Kbd as O, ErrorState as le, IconButton as I } from "@hachej/boring-ui-kit";
10
- import { Toaster as Ma, dismissToast as Ka, toast as _a } from "@hachej/boring-ui-kit";
11
- import { useSyncExternalStore as D, useState as E, useEffect as k, useRef as w, useCallback as b, useMemo as x, Suspense as ce, Component as de } from "react";
12
- import { FileTree as Aa } from "./FileTree-ChkSU4gL.js";
13
- import { MarkdownEditor as ja } from "./MarkdownEditor-BlYGosmH.js";
14
- import { MenuIcon as ue, PanelLeftOpenIcon as pe, PanelLeftCloseIcon as me, PinIcon as fe, CheckIcon as he, CopyIcon as ge } from "lucide-react";
15
- import { d as Ha } from "./panel-DnvDNQac.js";
16
- function Me() {
17
- const e = _();
18
- return D(e.subscribe, e.getSnapshot);
7
+ import { C as Ma, T as Ka, W as _a, b as Da } from "./WorkspaceLoadingState-D9v0oLDq.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 $a, dismissToast as ja, toast as za } from "@hachej/boring-ui-kit";
11
+ import { useSyncExternalStore as A, useState as E, useEffect as v, useRef as w, useCallback as b, useMemo as P, Suspense as de, Component as ue } from "react";
12
+ import { FileTree as Ua } from "./FileTree-BMXXbAgy.js";
13
+ import { MarkdownEditor as Ja } from "./MarkdownEditor-P47F3En6.js";
14
+ import { MenuIcon as pe, PanelLeftIcon as B, PinIcon as me, CheckIcon as fe, CopyIcon as he } from "lucide-react";
15
+ function Be() {
16
+ const e = D();
17
+ return A(e.subscribe, e.getSnapshot);
19
18
  }
20
- function A(e) {
19
+ function $(e) {
21
20
  switch (e.kind) {
22
21
  case "openFile":
23
22
  return { kind: "openFile", params: { path: e.path, ...e.mode ? { mode: e.mode } : {} } };
@@ -37,30 +36,30 @@ function A(e) {
37
36
  return { kind: "expandToFile", params: { path: e.path } };
38
37
  }
39
38
  }
40
- function be(e) {
41
- return `boring-workspace-command:${encodeURIComponent(JSON.stringify(A(e)))}`;
39
+ function ge(e) {
40
+ return `boring-workspace-command:${encodeURIComponent(JSON.stringify($(e)))}`;
42
41
  }
43
- function ye(e) {
42
+ function be(e) {
44
43
  return e.button === 0 && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey;
45
44
  }
46
- function Ke({ to: e, children: t, className: a, title: n, href: i, onClick: o }) {
45
+ function Me({ to: e, children: t, className: a, title: n, href: o, onClick: i }) {
47
46
  return /* @__PURE__ */ r(
48
47
  "a",
49
48
  {
50
- href: i ?? be(e),
49
+ href: o ?? ge(e),
51
50
  className: a,
52
51
  title: n,
53
52
  onClick: (u) => {
54
- o == null || o(u), !(u.defaultPrevented || !ye(u)) && (u.preventDefault(), Q(A(e)));
53
+ i == null || i(u), !(u.defaultPrevented || !be(u)) && (u.preventDefault(), Y($(e)));
55
54
  },
56
55
  children: t
57
56
  }
58
57
  );
59
58
  }
60
- function ve(e, t) {
59
+ function ye(e, t) {
61
60
  return e ? `${e.replace(/\/$/, "")}${t}` : t;
62
61
  }
63
- function Se() {
62
+ function ke() {
64
63
  if (typeof window > "u") return;
65
64
  const e = window.location.pathname.match(/^\/workspace\/([^/?#]+)/);
66
65
  if (e != null && e[1])
@@ -70,56 +69,56 @@ function Se() {
70
69
  return e[1];
71
70
  }
72
71
  }
73
- async function _e(e) {
72
+ async function Ke(e) {
74
73
  const t = new URLSearchParams({ path: e.path });
75
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);
76
- const a = { ...e.headers ?? {} }, n = e.workspaceId ?? Se();
77
- n && !Object.keys(a).some((o) => o.toLowerCase() === "x-boring-workspace-id") && (a["x-boring-workspace-id"] = n);
78
- const i = await fetch(ve(e.apiBaseUrl, `/api/v1/files/records?${t}`), {
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(ye(e.apiBaseUrl, `/api/v1/files/records?${t}`), {
79
78
  method: "GET",
80
79
  headers: a,
81
80
  signal: e.signal
82
81
  });
83
- if (!i.ok)
84
- throw new Error(`readFileRecords failed: HTTP ${i.status}`);
85
- return await i.json();
82
+ if (!o.ok)
83
+ throw new Error(`readFileRecords failed: HTTP ${o.status}`);
84
+ return await o.json();
86
85
  }
87
- function B(e) {
86
+ function M(e) {
88
87
  return typeof window > "u" ? !1 : window.innerWidth < e;
89
88
  }
90
- function M(e = 1024) {
91
- const [t, a] = E(() => B(e));
92
- return k(() => {
89
+ function K(e = 1024) {
90
+ const [t, a] = E(() => M(e));
91
+ return v(() => {
93
92
  const n = () => {
94
- a(B(e));
93
+ a(M(e));
95
94
  };
96
95
  return n(), window.addEventListener("resize", n), () => {
97
96
  window.removeEventListener("resize", n);
98
97
  };
99
98
  }, [e]), t;
100
99
  }
101
- function ke({
100
+ function Se({
102
101
  isNarrowViewport: e,
103
102
  isCollapsed: t,
104
103
  setCollapsed: a
105
104
  }) {
106
- const n = w(t), i = w(!1), o = w(null);
107
- return k(() => {
105
+ const n = w(t), o = w(!1), i = w(null);
106
+ return v(() => {
108
107
  n.current = t;
109
- }, [t]), k(() => {
110
- const u = o.current, d = u !== !0 && e, l = u === !0 && !e;
111
- if (o.current = e, e && d && !n.current) {
112
- i.current = !0, a(!0);
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);
113
112
  return;
114
113
  }
115
- l && i.current && (i.current = !1, a(!1));
114
+ l && o.current && (o.current = !1, a(!1));
116
115
  }, [e, a]), b(() => {
117
- i.current = !1;
116
+ o.current = !1;
118
117
  }, []);
119
118
  }
120
- function De(e) {
119
+ function _e(e) {
121
120
  const [t, a] = E([]), n = w(t);
122
- n.current = t, k(() => {
121
+ n.current = t, v(() => {
123
122
  if (!e) {
124
123
  a([]);
125
124
  return;
@@ -139,8 +138,8 @@ function De(e) {
139
138
  }
140
139
  const s = n.current;
141
140
  (s.length !== f.length || s.some((y, m) => {
142
- var v;
143
- return y.id !== ((v = f[m]) == null ? void 0 : v.id);
141
+ var k;
142
+ return y.id !== ((k = f[m]) == null ? void 0 : k.id);
144
143
  })) && a(f);
145
144
  } catch {
146
145
  }
@@ -149,7 +148,7 @@ function De(e) {
149
148
  const c = setInterval(l, 500);
150
149
  return () => clearInterval(c);
151
150
  }, [e]);
152
- const i = b(
151
+ const o = b(
153
152
  (l) => {
154
153
  e == null || e.addPanel("artifacts", {
155
154
  id: l.id,
@@ -158,7 +157,7 @@ function De(e) {
158
157
  });
159
158
  },
160
159
  [e]
161
- ), o = b(
160
+ ), i = b(
162
161
  (l) => {
163
162
  e == null || e.removePanel(l);
164
163
  },
@@ -172,16 +171,16 @@ function De(e) {
172
171
  (l) => n.current.some((c) => c.id === l),
173
172
  []
174
173
  );
175
- return { panels: t, open: i, close: o, activate: u, isOpen: d };
174
+ return { panels: t, open: o, close: i, activate: u, isOpen: d };
176
175
  }
177
- function Ae(e, t = {}) {
176
+ function De(e, t = {}) {
178
177
  const a = t.toolPanelMap ?? {}, n = b(
179
- (o) => a[o],
178
+ (i) => a[i],
180
179
  [a]
181
180
  );
182
181
  return { openForTool: b(
183
- (o, u) => {
184
- const d = a[o];
182
+ (i, u) => {
183
+ const d = a[i];
185
184
  if (!d) return;
186
185
  const l = `artifact-${u.path}`;
187
186
  e.isOpen(l) ? e.activate(l) : e.open({ id: l, component: d, params: u });
@@ -189,34 +188,34 @@ function Ae(e, t = {}) {
189
188
  [a, e]
190
189
  ), resolvePanel: n };
191
190
  }
192
- const xe = 768, Pe = 1024;
193
- function we(e) {
191
+ const ve = 768, Pe = 1024;
192
+ function xe(e) {
194
193
  return {
195
194
  ...e,
196
195
  groups: e.groups.filter((t) => t.id !== "sidebar")
197
196
  };
198
197
  }
199
- function Ce({
198
+ function we({
200
199
  layout: e,
201
200
  className: t
202
201
  }) {
203
- var W;
204
- const a = _(), n = Y(), i = Z(), o = M(xe), u = M(Pe), d = u && !o, l = x(
202
+ var F;
203
+ const a = D(), n = Z(), o = ee(), i = K(ve), u = K(Pe), d = u && !i, l = P(
205
204
  () => e.groups.find((S) => S.id === "sidebar" && S.panel),
206
205
  [e]
207
- ), c = l == null ? void 0 : l.panel, p = !!c, f = ke({
206
+ ), c = l == null ? void 0 : l.panel, p = !!c, f = Se({
208
207
  isNarrowViewport: p && u,
209
208
  isCollapsed: n.collapsed,
210
- setCollapsed: (S) => i({ collapsed: S })
209
+ setCollapsed: (S) => o({ collapsed: S })
211
210
  }), [s, h] = E(!1);
212
- k(() => {
213
- (!p || !o && !d) && h(!1);
214
- }, [p, o, d]);
215
- const y = p && (o || d && n.collapsed), m = p && !o && (!d || !n.collapsed), v = x(
216
- () => m ? e : we(e),
211
+ v(() => {
212
+ (!p || !i && !d) && h(!1);
213
+ }, [p, i, d]);
214
+ const y = p && (i || d && n.collapsed), m = p && !i && (!d || !n.collapsed), k = P(
215
+ () => m ? e : xe(e),
217
216
  [m, e]
218
- ), $ = x(() => {
219
- const S = m ? "inline-sidebar" : "overlay-sidebar", L = v.groups.map((N) => {
217
+ ), j = P(() => {
218
+ const S = m ? "inline-sidebar" : "overlay-sidebar", L = k.groups.map((N) => {
220
219
  let R = "";
221
220
  try {
222
221
  R = JSON.stringify(N.params ?? null);
@@ -225,18 +224,18 @@ function Ce({
225
224
  }
226
225
  return `${N.id}:${N.panel ?? ""}:${R}`;
227
226
  }).join(",");
228
- return `${v.version}:${S}:${L}`;
229
- }, [v, m]), j = D(
227
+ return `${k.version}:${S}:${L}`;
228
+ }, [k, m]), z = A(
230
229
  a.subscribe,
231
230
  a.getSnapshot,
232
231
  a.getSnapshot
233
- ), z = x(() => a.getComponents(), [a, j]), F = c ? z[c] : null, H = c ? ((W = a.get(c)) == null ? void 0 : W.title) ?? "Sidebar" : "Sidebar", U = b(() => {
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 = b(() => {
234
233
  h(!0);
235
- }, []), q = b(() => {
236
- f(), i({ collapsed: !1 }), h(!1);
237
- }, [f, i]), V = b(() => {
238
- f(), i({ collapsed: !0 }), h(!1);
239
- }, [f, i]), J = b(
234
+ }, []), J = b(() => {
235
+ f(), o({ collapsed: !1 }), h(!1);
236
+ }, [f, o]), V = b(() => {
237
+ f(), o({ collapsed: !0 }), h(!1);
238
+ }, [f, o]), G = b(
240
239
  (S) => {
241
240
  S.target.closest("[role='treeitem']") && h(!1);
242
241
  },
@@ -255,64 +254,64 @@ function Ce({
255
254
  {
256
255
  className: C(
257
256
  "absolute z-30",
258
- o ? "left-2 top-2" : "left-1 top-2"
257
+ "left-2 top-2"
259
258
  ),
260
259
  children: /* @__PURE__ */ r(
261
- P,
260
+ x,
262
261
  {
263
262
  type: "button",
264
263
  variant: "outline",
265
264
  size: "icon-sm",
266
- onClick: U,
267
- "aria-label": o ? "Open sidebar menu" : "Open collapsed sidebar",
268
- children: o ? /* @__PURE__ */ r(ue, { className: "h-4 w-4" }) : /* @__PURE__ */ r(pe, { className: "h-4 w-4" })
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(B, { className: "h-4 w-4" })
269
268
  }
270
269
  )
271
270
  }
272
271
  ),
273
272
  d && p && !n.collapsed && /* @__PURE__ */ r("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ r(
274
- P,
273
+ x,
275
274
  {
276
275
  type: "button",
277
276
  variant: "outline",
278
277
  size: "icon-sm",
279
278
  onClick: V,
280
279
  "aria-label": "Collapse sidebar",
281
- children: /* @__PURE__ */ r(me, { className: "h-4 w-4" })
280
+ children: /* @__PURE__ */ r(B, { className: "h-4 w-4" })
282
281
  }
283
282
  ) }),
284
283
  /* @__PURE__ */ r(
285
- ee,
284
+ te,
286
285
  {
287
- layout: v,
286
+ layout: k,
288
287
  className: C(
289
288
  t,
290
289
  d && p && n.collapsed && "pl-10"
291
290
  )
292
291
  },
293
- $
292
+ j
294
293
  ),
295
- y && /* @__PURE__ */ r(ae, { open: s, onOpenChange: h, children: /* @__PURE__ */ g(
296
- re,
294
+ y && /* @__PURE__ */ r(re, { open: s, onOpenChange: h, children: /* @__PURE__ */ g(
295
+ ne,
297
296
  {
298
297
  side: "left",
299
298
  className: "w-[85vw] max-w-sm p-0",
300
299
  children: [
301
- /* @__PURE__ */ g(ne, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
300
+ /* @__PURE__ */ g(se, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
302
301
  /* @__PURE__ */ g("div", { children: [
303
- /* @__PURE__ */ r(se, { children: H }),
304
- /* @__PURE__ */ r(oe, { className: "sr-only", children: "Responsive sidebar panel" })
302
+ /* @__PURE__ */ r(oe, { children: U }),
303
+ /* @__PURE__ */ r(ie, { className: "sr-only", children: "Responsive sidebar panel" })
305
304
  ] }),
306
305
  d && /* @__PURE__ */ g(
307
- P,
306
+ x,
308
307
  {
309
308
  type: "button",
310
309
  variant: "outline",
311
310
  size: "sm",
312
- onClick: q,
311
+ onClick: J,
313
312
  "aria-label": "Pin sidebar open",
314
313
  children: [
315
- /* @__PURE__ */ r(fe, { className: "h-4 w-4" }),
314
+ /* @__PURE__ */ r(me, { className: "h-4 w-4" }),
316
315
  "Pin"
317
316
  ]
318
317
  }
@@ -322,8 +321,8 @@ function Ce({
322
321
  "div",
323
322
  {
324
323
  className: "h-full min-h-0 overflow-auto",
325
- onClickCapture: J,
326
- children: F ? /* @__PURE__ */ r(ce, { fallback: /* @__PURE__ */ r(K, {}), children: /* @__PURE__ */ r(F, {}) }) : /* @__PURE__ */ r(K, {})
324
+ onClickCapture: G,
325
+ children: W ? /* @__PURE__ */ r(de, { fallback: /* @__PURE__ */ r(_, {}), children: /* @__PURE__ */ r(W, {}) }) : /* @__PURE__ */ r(_, {})
327
326
  }
328
327
  )
329
328
  ]
@@ -331,11 +330,11 @@ function Ce({
331
330
  ) })
332
331
  ] });
333
332
  }
334
- function K() {
333
+ function _() {
335
334
  return /* @__PURE__ */ r("div", { className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground", children: "Loading sidebar..." });
336
335
  }
337
- function Ee(e = {}) {
338
- const { sidebar: t = "filetree", center: a = "empty", right: n } = e, i = [
336
+ function Ce(e = {}) {
337
+ const { sidebar: t = "filetree", center: a = "empty", right: n } = e, o = [
339
338
  {
340
339
  id: "sidebar",
341
340
  position: "left",
@@ -354,25 +353,25 @@ function Ee(e = {}) {
354
353
  constraints: { minWidth: 300 }
355
354
  }
356
355
  ];
357
- return n && i.push({
356
+ return n && o.push({
358
357
  id: "right",
359
358
  position: "right",
360
359
  panel: n,
361
360
  hideHeader: !0,
362
361
  constraints: { minWidth: 250 }
363
- }), { version: "2.0", groups: i };
362
+ }), { version: "2.0", groups: o };
364
363
  }
365
- function $e(e) {
366
- return /* @__PURE__ */ r(Ce, { layout: Ee(e), className: e.className });
364
+ function Ae(e) {
365
+ return /* @__PURE__ */ r(we, { layout: Ce(e), className: e.className });
367
366
  }
368
- function je({ className: e, onOpenFile: t }) {
367
+ function $e({ className: e, onOpenFile: t }) {
369
368
  return /* @__PURE__ */ r(
370
- ie,
369
+ le,
371
370
  {
372
371
  className: C("h-full border-0 text-muted-foreground", e),
373
372
  title: "No file open",
374
373
  description: "Open a file to get started",
375
- actions: t ? /* @__PURE__ */ r(P, { type: "button", variant: "outline", onClick: t, children: "Open file" }) : null,
374
+ actions: t ? /* @__PURE__ */ r(x, { type: "button", variant: "outline", onClick: t, children: "Open file" }) : null,
376
375
  children: /* @__PURE__ */ g("div", { className: "space-y-2 text-sm", children: [
377
376
  /* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
378
377
  /* @__PURE__ */ r(O, { children: "⌘P" }),
@@ -390,7 +389,7 @@ function je({ className: e, onOpenFile: t }) {
390
389
  }
391
390
  );
392
391
  }
393
- class ze extends de {
392
+ class je extends ue {
394
393
  constructor() {
395
394
  super(...arguments);
396
395
  T(this, "state", { hasError: !1, error: null });
@@ -402,9 +401,9 @@ class ze extends de {
402
401
  return { hasError: !0, error: a };
403
402
  }
404
403
  componentDidCatch(a, n) {
405
- const { panelId: i, onError: o } = this.props;
406
- console.error(`[PanelErrorBoundary] Panel "${i}" crashed:`, a, n.componentStack), o == null || o({
407
- panelId: i,
404
+ const { panelId: o, onError: i } = this.props;
405
+ console.error(`[PanelErrorBoundary] Panel "${o}" crashed:`, a, n.componentStack), i == null || i({
406
+ panelId: o,
408
407
  error: a.message,
409
408
  stack: n.componentStack ?? void 0
410
409
  });
@@ -412,32 +411,32 @@ class ze extends de {
412
411
  render() {
413
412
  var a;
414
413
  return this.state.hasError ? /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ r(
415
- le,
414
+ ce,
416
415
  {
417
416
  className: "w-full max-w-md",
418
417
  title: "Something went wrong",
419
- description: /* @__PURE__ */ g(te, { children: [
418
+ description: /* @__PURE__ */ g(ae, { children: [
420
419
  "Panel ",
421
420
  /* @__PURE__ */ r("code", { className: "rounded bg-muted px-1 py-0.5 text-xs", children: this.props.panelId }),
422
421
  " ",
423
422
  "encountered an error."
424
423
  ] }),
425
424
  details: (a = this.state.error) == null ? void 0 : a.message,
426
- actions: /* @__PURE__ */ r(P, { type: "button", variant: "outline", onClick: this.handleRetry, children: "Retry" })
425
+ actions: /* @__PURE__ */ r(x, { type: "button", variant: "outline", onClick: this.handleRetry, children: "Retry" })
427
426
  }
428
427
  ) }) : this.props.children;
429
428
  }
430
429
  }
431
- function He({
430
+ function ze({
432
431
  sessions: e,
433
432
  activeId: t,
434
433
  onSwitch: a,
435
434
  onCreate: n,
436
- onDelete: i,
437
- className: o
435
+ onDelete: o,
436
+ className: i
438
437
  }) {
439
- const [u, d] = E(null), l = w({}), c = x(() => e.map((s) => s.id), [e]);
440
- k(() => {
438
+ const [u, d] = E(null), l = w({}), c = P(() => e.map((s) => s.id), [e]);
439
+ v(() => {
441
440
  if (c.length === 0) {
442
441
  d(null);
443
442
  return;
@@ -468,8 +467,8 @@ function He({
468
467
  else
469
468
  return;
470
469
  s.preventDefault();
471
- const v = c[m];
472
- v && p(v);
470
+ const k = c[m];
471
+ k && p(k);
473
472
  },
474
473
  [p, a, c]
475
474
  );
@@ -477,7 +476,7 @@ function He({
477
476
  "div",
478
477
  {
479
478
  "data-boring-workspace-part": "session-list",
480
- className: C("flex h-full flex-col", o),
479
+ className: C("flex h-full flex-col", i),
481
480
  role: "navigation",
482
481
  "aria-label": "Sessions",
483
482
  children: [
@@ -500,13 +499,13 @@ function He({
500
499
  /* @__PURE__ */ g("div", { className: "flex-1 overflow-y-auto", role: "list", "aria-label": "Session list", children: [
501
500
  e.length === 0 && /* @__PURE__ */ r("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No sessions" }),
502
501
  e.map((s) => /* @__PURE__ */ r(
503
- Re,
502
+ Ne,
504
503
  {
505
504
  session: s,
506
505
  isActive: s.id === t,
507
506
  isFocused: s.id === u,
508
507
  onSwitch: a,
509
- onDelete: i,
508
+ onDelete: o,
510
509
  onFocus: () => d(s.id),
511
510
  onKeyDown: f,
512
511
  rowRef: (h) => {
@@ -520,7 +519,7 @@ function He({
520
519
  }
521
520
  );
522
521
  }
523
- async function Ne(e) {
522
+ async function Ee(e) {
524
523
  var a, n;
525
524
  if (typeof navigator < "u" && ((a = navigator.clipboard) != null && a.writeText))
526
525
  try {
@@ -538,18 +537,18 @@ async function Ne(e) {
538
537
  document.body.removeChild(t);
539
538
  }
540
539
  }
541
- function Re({
540
+ function Ne({
542
541
  session: e,
543
542
  isActive: t,
544
543
  isFocused: a,
545
544
  onSwitch: n,
546
- onDelete: i,
547
- onFocus: o,
545
+ onDelete: o,
546
+ onFocus: i,
548
547
  onKeyDown: u,
549
548
  rowRef: d
550
549
  }) {
551
550
  const [l, c] = E(!1), p = b((f) => {
552
- f.stopPropagation(), Ne(e.id).then((s) => {
551
+ f.stopPropagation(), Ee(e.id).then((s) => {
553
552
  s && (c(!0), window.setTimeout(() => c(!1), 1200));
554
553
  });
555
554
  }, [e.id]);
@@ -567,7 +566,7 @@ function Re({
567
566
  t ? "bg-accent text-accent-foreground" : "text-foreground hover:bg-accent/50"
568
567
  ),
569
568
  onClick: () => n == null ? void 0 : n(e.id),
570
- onFocus: o,
569
+ onFocus: i,
571
570
  onKeyDown: (f) => u(f, e.id),
572
571
  tabIndex: a ? 0 : -1,
573
572
  "aria-current": t ? "true" : void 0,
@@ -584,7 +583,7 @@ function Re({
584
583
  tabIndex: a ? 0 : -1,
585
584
  "aria-label": `Copy Pi session id for ${e.title}`,
586
585
  title: "Copy Pi session id",
587
- children: l ? /* @__PURE__ */ r(he, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(ge, { className: "h-3.5 w-3.5" })
586
+ children: l ? /* @__PURE__ */ r(fe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(he, { className: "h-3.5 w-3.5" })
588
587
  }
589
588
  ),
590
589
  t && /* @__PURE__ */ r(
@@ -594,7 +593,7 @@ function Re({
594
593
  "aria-label": "Active"
595
594
  }
596
595
  ),
597
- i && /* @__PURE__ */ r(
596
+ o && /* @__PURE__ */ r(
598
597
  I,
599
598
  {
600
599
  type: "button",
@@ -602,7 +601,7 @@ function Re({
602
601
  size: "icon-xs",
603
602
  className: "hidden shrink-0 text-muted-foreground hover:text-destructive group-hover:inline-flex group-data-[focused=true]:inline-flex",
604
603
  onClick: (f) => {
605
- f.stopPropagation(), i(e.id);
604
+ f.stopPropagation(), o(e.id);
606
605
  },
607
606
  tabIndex: a ? 0 : -1,
608
607
  "aria-label": `Delete ${e.title}`,
@@ -626,126 +625,131 @@ function Re({
626
625
  );
627
626
  }
628
627
  export {
629
- Ve as ArtifactSurfacePane,
628
+ qe as ArtifactSurfacePane,
630
629
  Je as CatalogRegistry,
631
- Ia as ChatLayout,
632
- Ge as CodeEditor,
633
- Xe as CodeEditorPane,
634
- Qe as CommandPalette,
635
- Ye as CommandRegistry,
636
- ee as DockviewShell,
637
- je as EmptyPane,
638
- Aa as FileTree,
639
- Ze as FileTreePane,
640
- et as FileTreeView,
641
- $e as IdeLayout,
642
- tt as MAX_PANELS,
643
- ja as MarkdownEditor,
644
- at as MarkdownEditorPane,
645
- rt as PanelChrome,
646
- ze as PanelErrorBoundary,
647
- nt as PanelRegistry,
648
- st as PluginError,
649
- ot as PluginErrorBoundary,
650
- it as PluginErrorProvider,
651
- lt as RegistryProvider,
652
- Ce as ResponsiveDockviewShell,
653
- ct as SessionBrowser,
654
- He as SessionList,
655
- dt as SurfaceResolverRegistry,
656
- ut as SurfaceShell,
657
- pt as ThemeProvider,
658
- Ma as Toaster,
659
- Fa as TopBar,
660
- mt as UI_COMMAND_EVENT,
661
- ft as WORKSPACE_ATTENTION_ACTION_EVENT,
662
- ht as WORKSPACE_COMPOSER_STOP_EVENT,
663
- gt as WORKSPACE_COMPOSER_STOP_REASONS,
664
- bt as WORKSPACE_OPEN_PATH_SURFACE_KIND,
665
- yt as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT,
666
- vt as WorkbenchLeftPane,
667
- St as WorkspaceFilesProvider,
668
- Ke as WorkspaceLink,
669
- Wa as WorkspaceLoadingState,
670
- kt as WorkspaceProvider,
630
+ Ma 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
+ Ua as FileTree,
638
+ Ye as FileTreePane,
639
+ Ze as FileTreeView,
640
+ Ae as IdeLayout,
641
+ et as MAX_PANELS,
642
+ Ja 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
+ $a as Toaster,
658
+ Ka 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
+ bt as WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT,
665
+ yt as WorkbenchLeftPane,
666
+ kt as WorkspaceFilesProvider,
667
+ Me as WorkspaceLink,
668
+ _a as WorkspaceLoadingState,
669
+ St as WorkspacePluginClientProvider,
670
+ vt as WorkspaceProvider,
671
+ Pt as WorkspaceSourceRegistry,
671
672
  xt as agentMeta,
672
- Pt as bindStore,
673
- wt as bootstrap,
674
- La as buildChatLayout,
675
- Ct as buildFullPagePanelHref,
676
- Ee as buildIdeLayout,
677
- Et as closePanelSchema,
673
+ wt as bindStore,
674
+ Ct as bootstrap,
675
+ Da as buildChatLayout,
676
+ Et as buildFullPagePanelHref,
677
+ Ce as buildIdeLayout,
678
+ Nt as closePanelSchema,
678
679
  C as cn,
679
- Nt as createBridge,
680
- Rt as createBridgeClient,
681
- Tt as createShadcnTheme,
682
- Ot as createWorkspaceStore,
683
- Ha as definePanel,
684
- Ka as dismissToast,
685
- It as emitAgentData,
686
- Ft as emitFilesystemAgentFileChange,
687
- Wt as emitWorkspaceAttentionAction,
688
- Lt as emitWorkspaceComposerStop,
689
- Bt as events,
690
- Mt as expandToFileSchema,
691
- Kt as filesystemEvents,
692
- _t as filesystemPlugin,
693
- Dt as formatShortcut,
694
- At as getFileIcon,
695
- $t as isWorkspaceComposerStopDetail,
696
- jt as isWorkspaceComposerStopReason,
697
- zt as navigateToLineSchema,
698
- Ht as notificationSchema,
699
- Ut as onFilesystemChanged,
700
- qt as openFileSchema,
701
- Vt as openPanelSchema,
702
- Q as postUiCommand,
703
- _e as readFileRecords,
704
- _a as toast,
705
- Jt as useActiveFile,
706
- Gt as useActivePanel,
707
- Me as useActivePanels,
708
- Xt as useApiBaseUrl,
709
- De as useArtifactPanels,
710
- Ae as useArtifactRouting,
711
- Qt as useAutoOpenAgentFiles,
712
- Yt as useCatalogRegistry,
713
- Zt as useCatalogs,
714
- ea as useCommandRegistry,
715
- ta as useCommands,
716
- aa as useDirtyFiles,
717
- ra as useDockviewApi,
718
- na as useEditorLifecycle,
719
- sa as useEvent,
720
- oa as useFilePane,
721
- ia as useFullPagePanelHref,
722
- la as useHasWorkspaceFilesProvider,
723
- ca as useHydrationComplete,
724
- da as useIsFullPagePanel,
725
- ua as useKeyboardShortcuts,
726
- pa as useOpenPanels,
727
- ma as usePanelRenderMode,
728
- fa as usePluginErrors,
729
- _ as useRegistry,
730
- ha as useResetLayout,
731
- ke as useResponsiveSidebarCollapse,
732
- Z as useSetSidebar,
733
- Y as useSidebarState,
734
- ga as useSurfaceResolverRegistry,
735
- ba as useTheme,
736
- ya as useThemePreference,
737
- M as useViewportBreakpoint,
738
- va as useWorkspaceAttention,
739
- Sa as useWorkspaceBridge,
740
- ka as useWorkspaceChatPanel,
741
- xa as useWorkspaceContext,
742
- Pa as useWorkspaceContextOptional,
743
- wa as useWorkspaceRequestId,
744
- Ca as userMeta,
745
- Ea as workspaceAttentionSessionBadgeForBlocker,
746
- Na as workspaceComposerStopAppliesToSession,
747
- Ra as workspaceComposerStopTargetSessionId,
748
- Ta as workspaceEvents,
749
- A as workspaceLinkCommand,
750
- be as workspaceLinkHref
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
+ ja as dismissToast,
687
+ Lt as emitAgentData,
688
+ Bt as emitFilesystemAgentFileChange,
689
+ Mt 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
+ za as toast,
707
+ Qt as useActiveFile,
708
+ Yt as useActivePanel,
709
+ Be 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
+ ba as usePluginErrors,
731
+ D as useRegistry,
732
+ ya 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 useWorkspacePluginClient,
746
+ Ra as useWorkspaceRequestId,
747
+ Ta as useWorkspaceSourceRegistry,
748
+ Oa as userMeta,
749
+ Ia as workspaceAttentionSessionBadgeForBlocker,
750
+ Wa as workspaceComposerStopAppliesToSession,
751
+ Fa as workspaceComposerStopTargetSessionId,
752
+ La as workspaceEvents,
753
+ $ as workspaceLinkCommand,
754
+ ge as workspaceLinkHref
751
755
  };