@hachej/boring-workspace 0.1.38 → 0.1.40

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.
@@ -2,11 +2,11 @@ var Po = Object.defineProperty;
2
2
  var Co = (e, t, n) => t in e ? Po(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Q = (e, t, n) => Co(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as Eo from "react/jsx-runtime";
5
- import { jsx as u, jsxs as x, Fragment as Le } from "react/jsx-runtime";
5
+ import { jsx as u, jsxs as w, Fragment as Le } from "react/jsx-runtime";
6
6
  import * as Io from "react";
7
- import { useRef as L, useMemo as V, useContext as ue, createContext as me, useSyncExternalStore as ot, useState as j, useCallback as T, Component as No, useEffect as W, createElement as fe, Suspense as Tt, Fragment as ar, lazy as pt, useLayoutEffect as To } from "react";
8
- import { AlertTriangleIcon as Ro, ImageIcon as He, FileTextIcon as ke, FileJsonIcon as wn, FileCodeIcon as ce, FileIcon as Rt, X as sn, RefreshCw as Ao, Download as Do, RefreshCcw as _o, ExternalLink as cr, FolderTree as Fo, TerminalIcon as an, ClockIcon as Lo, ArrowUp as $o, ArrowDown as Oo, CornerDownLeft as Mo, GripVertical as Wo, Plus as zo, ChevronLeft as jo, ChevronRight as lr, Pin as Bo, Menu as Et, Search as xn } from "lucide-react";
9
- import { Notice as ur, IconButton as pe, LoadingState as Uo, Input as dr, toast as Ne, ErrorState as rt, Skeleton as qo, Spinner as At, Button as Fe, AlertDialog as Ho, AlertDialogContent as Go, AlertDialogHeader as Vo, AlertDialogTitle as Ko, AlertDialogDescription as Jo, AlertDialogFooter as Yo, AlertDialogCancel as Xo, AlertDialogAction as Qo, EmptyState as fr, Kbd as nt, TooltipProvider as Zo, Tooltip as ei, TooltipTrigger as ti, TooltipContent as ni, Dialog as ri, DialogContent as oi, DialogHeader as ii, DialogTitle as si, DialogDescription as ai, Command as ci, CommandList as li, CommandEmpty as ui, CommandInput as di, CommandGroup as cn, CommandItem as Dt, CommandShortcut as fi, Toaster as pi } from "@hachej/boring-ui-kit";
7
+ import { useRef as $, useMemo as K, useContext as ue, createContext as me, useSyncExternalStore as ot, useState as j, useCallback as N, Component as Ro, useEffect as z, createElement as fe, Suspense as Tt, Fragment as ar, lazy as pt, useLayoutEffect as To } from "react";
8
+ import { AlertTriangleIcon as No, ImageIcon as He, FileTextIcon as ke, FileJsonIcon as wn, FileCodeIcon as ce, FileIcon as Nt, X as sn, RefreshCw as Ao, Download as Do, RefreshCcw as _o, ExternalLink as cr, FolderTree as Fo, TerminalIcon as an, ClockIcon as Lo, ArrowUp as $o, ArrowDown as Oo, CornerDownLeft as Mo, GripVertical as Wo, Plus as zo, ChevronLeft as jo, ChevronRight as lr, Pin as Bo, Menu as Et, Search as xn } from "lucide-react";
9
+ import { Notice as ur, IconButton as pe, LoadingState as Uo, Input as dr, toast as Re, ErrorState as rt, Skeleton as qo, Spinner as At, Button as Fe, AlertDialog as Ho, AlertDialogContent as Go, AlertDialogHeader as Vo, AlertDialogTitle as Ko, AlertDialogDescription as Jo, AlertDialogFooter as Yo, AlertDialogCancel as Xo, AlertDialogAction as Qo, EmptyState as fr, Kbd as nt, TooltipProvider as Zo, Tooltip as ei, TooltipTrigger as ti, TooltipContent as ni, Dialog as ri, DialogContent as oi, DialogHeader as ii, DialogTitle as si, DialogDescription as ai, Command as ci, CommandList as li, CommandEmpty as ui, CommandInput as di, CommandGroup as cn, CommandItem as Dt, CommandShortcut as fi, Toaster as pi } from "@hachej/boring-ui-kit";
10
10
  import { useStore as ze, create as hi } from "zustand";
11
11
  import { persist as mi } from "zustand/middleware";
12
12
  import { z as Z } from "zod";
@@ -172,7 +172,7 @@ function Ii(e, t) {
172
172
  }
173
173
  };
174
174
  }
175
- function Ni(e, t) {
175
+ function Ri(e, t) {
176
176
  var r;
177
177
  const { registrations: n } = e;
178
178
  for (const o of n.panels)
@@ -207,13 +207,13 @@ function Ti(e) {
207
207
  }
208
208
  const o = n.map(Si);
209
209
  for (const i of o)
210
- Ni(i, e.registries);
210
+ Ri(i, e.registries);
211
211
  return {
212
212
  registered: o.map((i) => i.id),
213
213
  plugins: o
214
214
  };
215
215
  }
216
- function Ri() {
216
+ function Ni() {
217
217
  return !1;
218
218
  }
219
219
  class vr {
@@ -226,7 +226,7 @@ class vr {
226
226
  this.listeners.delete(t);
227
227
  }));
228
228
  Q(this, "getSnapshot", () => (this.snapshotCache || (this.snapshotCache = Array.from(this.catalogs.values())), this.snapshotCache));
229
- this.warnOnDuplicate = t.warnOnDuplicate ?? Ri();
229
+ this.warnOnDuplicate = t.warnOnDuplicate ?? Ni();
230
230
  }
231
231
  register(t, n) {
232
232
  this.catalogs.has(t.id) && this.warnOnDuplicate && console.warn(
@@ -368,9 +368,9 @@ function Ai({
368
368
  surfaceResolverRegistry: r,
369
369
  children: o
370
370
  }) {
371
- const i = L(null), a = L(null);
371
+ const i = $(null), a = $(null);
372
372
  i.current || (i.current = new vr()), a.current || (a.current = new yr());
373
- const c = n ?? i.current, s = r ?? a.current, f = V(
373
+ const c = n ?? i.current, s = r ?? a.current, f = K(
374
374
  () => ({
375
375
  panelRegistry: e,
376
376
  commandRegistry: t,
@@ -414,10 +414,10 @@ function Fi({ pluginId: e, message: t, kind: n }) {
414
414
  ur,
415
415
  {
416
416
  tone: "error",
417
- icon: /* @__PURE__ */ u(Ro, { className: "size-4" }),
417
+ icon: /* @__PURE__ */ u(No, { className: "size-4" }),
418
418
  className: "py-2",
419
- description: /* @__PURE__ */ x("span", { className: "block min-w-0 truncate", children: [
420
- /* @__PURE__ */ x("span", { className: "font-medium", children: [
419
+ description: /* @__PURE__ */ w("span", { className: "block min-w-0 truncate", children: [
420
+ /* @__PURE__ */ w("span", { className: "font-medium", children: [
421
421
  "[",
422
422
  e,
423
423
  "]"
@@ -432,20 +432,20 @@ function Fi({ pluginId: e, message: t, kind: n }) {
432
432
  }
433
433
  const un = me(null);
434
434
  function Li({ children: e }) {
435
- const [t, n] = j([]), r = T((i) => {
435
+ const [t, n] = j([]), r = N((i) => {
436
436
  n((a) => [...a, i]);
437
- }, []), o = V(
437
+ }, []), o = K(
438
438
  () => ({ errors: t, reportPluginError: r }),
439
439
  [t, r]
440
440
  );
441
441
  return /* @__PURE__ */ u(un.Provider, { value: o, children: e });
442
442
  }
443
- function Tu() {
443
+ function Du() {
444
444
  const e = ue(un);
445
445
  if (!e) throw new Error("usePluginErrors must be used within a PluginErrorProvider");
446
446
  return e;
447
447
  }
448
- class Ot extends No {
448
+ class Ot extends Ro {
449
449
  constructor() {
450
450
  super(...arguments);
451
451
  Q(this, "state", { error: null });
@@ -702,40 +702,40 @@ function Xi(e) {
702
702
  onVersionMismatch: s,
703
703
  onConnectionChange: f
704
704
  } = e;
705
- let l = null, d = null, p = null, m = null, g = !1, v = !1, C = 0;
706
- function S(w) {
707
- v || g !== w && (g = w, f == null || f(w));
705
+ let l = null, d = null, p = null, m = null, g = !1, v = !1, E = 0;
706
+ function k(b) {
707
+ v || g !== b && (g = b, f == null || f(b));
708
708
  }
709
- async function D(w) {
709
+ async function _(b) {
710
710
  if (v) return;
711
- const M = Yi(r, w);
711
+ const D = Yi(r, b);
712
712
  try {
713
713
  const B = await fetch(`${t}/api/v1/ui/state`, {
714
714
  method: "PUT",
715
715
  headers: Sn(o),
716
- body: JSON.stringify(M)
716
+ body: JSON.stringify(D)
717
717
  });
718
718
  if (v) return;
719
719
  (B.status === 401 || B.status === 403) && (c == null || c(B.status));
720
720
  } catch {
721
721
  }
722
722
  }
723
- function I(w) {
723
+ function I(b) {
724
724
  p !== null && clearTimeout(p), p = setTimeout(() => {
725
- p = null, D(w);
725
+ p = null, _(b);
726
726
  }, Ki);
727
727
  }
728
- function F(w, M) {
728
+ function L(b, D) {
729
729
  if (!v)
730
- switch (w) {
730
+ switch (b) {
731
731
  case "init": {
732
- S(!0), D("restore");
732
+ k(!0), _("restore");
733
733
  break;
734
734
  }
735
735
  case "command": {
736
736
  let B;
737
737
  try {
738
- B = JSON.parse(M);
738
+ B = JSON.parse(D);
739
739
  } catch {
740
740
  return;
741
741
  }
@@ -743,15 +743,15 @@ function Xi(e) {
743
743
  s == null || s(B.v);
744
744
  return;
745
745
  }
746
- C++, Pn(n, B.kind, B.params).finally(() => {
747
- C--;
746
+ E++, Pn(n, B.kind, B.params).finally(() => {
747
+ E--;
748
748
  });
749
749
  break;
750
750
  }
751
751
  case "error": {
752
752
  let B;
753
753
  try {
754
- B = JSON.parse(M);
754
+ B = JSON.parse(D);
755
755
  } catch {
756
756
  return;
757
757
  }
@@ -764,64 +764,64 @@ function Xi(e) {
764
764
  }
765
765
  }
766
766
  }
767
- function O() {
768
- const w = `${t}/api/v1/ui/commands/next`, M = new EventSource(w, { withCredentials: !0 });
769
- M.addEventListener("init", (B) => {
770
- F("init", B.data);
771
- }), M.addEventListener("command", (B) => {
772
- F("command", B.data);
773
- }), M.addEventListener("error", (B) => {
774
- B.data ? F("error", B.data) : S(!1);
775
- }), M.addEventListener("heartbeat", (B) => {
776
- F("heartbeat", B.data);
777
- }), l = M;
767
+ function M() {
768
+ const b = `${t}/api/v1/ui/commands/next`, D = new EventSource(b, { withCredentials: !0 });
769
+ D.addEventListener("init", (B) => {
770
+ L("init", B.data);
771
+ }), D.addEventListener("command", (B) => {
772
+ L("command", B.data);
773
+ }), D.addEventListener("error", (B) => {
774
+ B.data ? L("error", B.data) : k(!1);
775
+ }), D.addEventListener("heartbeat", (B) => {
776
+ L("heartbeat", B.data);
777
+ }), l = D;
778
778
  }
779
779
  async function h() {
780
780
  if (!v)
781
781
  try {
782
- const w = `${t}/api/v1/ui/commands/next?poll=true`, M = await fetch(w, { headers: Sn(o) });
782
+ const b = `${t}/api/v1/ui/commands/next?poll=true`, D = await fetch(b, { headers: Sn(o) });
783
783
  if (v) return;
784
- if (M.status === 401 || M.status === 403) {
785
- c == null || c(M.status);
784
+ if (D.status === 401 || D.status === 403) {
785
+ c == null || c(D.status);
786
786
  return;
787
787
  }
788
- if (!M.ok) return;
789
- const B = await M.json();
788
+ if (!D.ok) return;
789
+ const B = await D.json();
790
790
  if (!Array.isArray(B)) return;
791
- for (const R of B) {
791
+ for (const T of B) {
792
792
  if (v) return;
793
- if (R.v !== 1) {
794
- s == null || s(R.v);
793
+ if (T.v !== 1) {
794
+ s == null || s(T.v);
795
795
  continue;
796
796
  }
797
- C++;
797
+ E++;
798
798
  try {
799
- await Pn(n, R.kind, R.params);
799
+ await Pn(n, T.kind, T.params);
800
800
  } finally {
801
- C--;
801
+ E--;
802
802
  }
803
803
  }
804
- S(!0);
804
+ k(!0);
805
805
  } catch {
806
- S(!1);
806
+ k(!1);
807
807
  }
808
808
  }
809
- function k() {
809
+ function x() {
810
810
  m = r.subscribe(() => {
811
811
  if (v) return;
812
- const w = C > 0 ? "agent" : "user";
813
- I(w);
812
+ const b = E > 0 ? "agent" : "user";
813
+ I(b);
814
814
  });
815
815
  }
816
816
  return {
817
817
  connect() {
818
- v = !1, !i && typeof EventSource < "u" ? O() : (h(), d = setInterval(h, a)), k();
818
+ v = !1, !i && typeof EventSource < "u" ? M() : (h(), d = setInterval(h, a)), x();
819
819
  },
820
820
  disconnect() {
821
- l && (l.close(), l = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), m && (m(), m = null), S(!1), v = !0;
821
+ l && (l.close(), l = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), m && (m(), m = null), k(!1), v = !0;
822
822
  },
823
- pushState(w) {
824
- D(w);
823
+ pushState(b) {
824
+ _(b);
825
825
  }
826
826
  };
827
827
  }
@@ -998,15 +998,15 @@ function et(e) {
998
998
  return { cause: "remote", toolCallId: e, ts: Date.now() };
999
999
  }
1000
1000
  function Zt(e, t) {
1001
- const n = L(t);
1002
- n.current = t, W(() => K.on(e, (r) => n.current(r)), [e]);
1001
+ const n = $(t);
1002
+ n.current = t, z(() => J.on(e, (r) => n.current(r)), [e]);
1003
1003
  }
1004
1004
  function us(e) {
1005
- K.emit(ve.agentData, { ts: Date.now(), part: e });
1005
+ J.emit(ve.agentData, { ts: Date.now(), part: e });
1006
1006
  }
1007
- const K = ns(), ds = "boring-workspace:ui-command";
1007
+ const J = ns(), ds = "boring-workspace:ui-command";
1008
1008
  function xr(e) {
1009
- K.emit(ve.uiCommand, { ...it(), command: e }), typeof globalThis.dispatchEvent == "function" && typeof CustomEvent < "u" && globalThis.dispatchEvent(new CustomEvent(ds, { detail: e }));
1009
+ J.emit(ve.uiCommand, { ...it(), command: e }), typeof globalThis.dispatchEvent == "function" && typeof CustomEvent < "u" && globalThis.dispatchEvent(new CustomEvent(ds, { detail: e }));
1010
1010
  }
1011
1011
  const fs = 1500, ps = 1e3, hs = 5;
1012
1012
  function Cn(e, t) {
@@ -1020,23 +1020,23 @@ function Cn(e, t) {
1020
1020
  function ms(e) {
1021
1021
  const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), i = e.fetcher ?? (typeof fetch < "u" ? fetch : null), a = e.reconnectDelayMs ?? ps, c = e.maxReconnects ?? hs, s = e.pollIntervalMs ?? fs;
1022
1022
  let f = !1, l = null, d = null, p = null, m = null, g = 0, v = !1;
1023
- function C(I) {
1023
+ function E(I) {
1024
1024
  I && typeof I == "object" && typeof I.kind == "string" && Qt(I, n);
1025
1025
  }
1026
- function S() {
1026
+ function k() {
1027
1027
  if (f || v || !i) return;
1028
1028
  v = !0;
1029
1029
  const I = async () => {
1030
1030
  if (!f) {
1031
1031
  p = new AbortController();
1032
1032
  try {
1033
- const F = await i(Cn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1033
+ const L = await i(Cn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1034
1034
  signal: p.signal
1035
1035
  });
1036
1036
  if (f) return;
1037
- if (F.ok) {
1038
- const O = await F.json();
1039
- if (Array.isArray(O)) for (const h of O) C(h);
1037
+ if (L.ok) {
1038
+ const M = await L.json();
1039
+ if (Array.isArray(M)) for (const h of M) E(h);
1040
1040
  }
1041
1041
  } catch {
1042
1042
  } finally {
@@ -1047,17 +1047,17 @@ function ms(e) {
1047
1047
  };
1048
1048
  I();
1049
1049
  }
1050
- function D() {
1050
+ function _() {
1051
1051
  if (!f) {
1052
1052
  if (!o) {
1053
- S();
1053
+ k();
1054
1054
  return;
1055
1055
  }
1056
1056
  l = new o(Cn(`${t}/api/v1/ui/commands/next`, r)), l.addEventListener("command", (I) => {
1057
- const F = I.data;
1058
- if (!(typeof F != "string" || F.length === 0))
1057
+ const L = I.data;
1058
+ if (!(typeof L != "string" || L.length === 0))
1059
1059
  try {
1060
- C(JSON.parse(F));
1060
+ E(JSON.parse(L));
1061
1061
  } catch {
1062
1062
  }
1063
1063
  }), l.addEventListener("init", () => {
@@ -1065,15 +1065,15 @@ function ms(e) {
1065
1065
  }), l.addEventListener("error", () => {
1066
1066
  if (!f) {
1067
1067
  if (l == null || l.close(), l = null, g += 1, g > c) {
1068
- S();
1068
+ k();
1069
1069
  return;
1070
1070
  }
1071
- m = setTimeout(D, a * g);
1071
+ m = setTimeout(_, a * g);
1072
1072
  }
1073
1073
  });
1074
1074
  }
1075
1075
  }
1076
- return D(), () => {
1076
+ return _(), () => {
1077
1077
  f = !0, l && (l.close(), l = null), d && (clearTimeout(d), d = null), p && (p.abort(), p = null), m && (clearTimeout(m), m = null);
1078
1078
  };
1079
1079
  }
@@ -1122,11 +1122,11 @@ class ws {
1122
1122
  continue;
1123
1123
  }
1124
1124
  if (!v.ok) {
1125
- const C = await xs(v);
1125
+ const E = await xs(v);
1126
1126
  throw new Ke(
1127
1127
  v.status,
1128
1128
  `HTTP ${v.status}: ${v.statusText}`,
1129
- C
1129
+ E
1130
1130
  );
1131
1131
  }
1132
1132
  return await v.json();
@@ -1257,16 +1257,16 @@ const ks = "filesystem:file.changed", Ss = "filesystem:file.created", Ps = "file
1257
1257
  moved: Ps,
1258
1258
  deleted: Cs
1259
1259
  }, xt = "filesystem", en = "files", kt = en, fn = "files", Es = "filesystem-path", tn = "code-editor", kr = "csv-viewer", Sr = "markdown-editor", Pr = "image-viewer", Cr = "pdf-viewer", Er = "html-viewer", Is = "empty-file-panel";
1260
- function Ns() {
1260
+ function Rs() {
1261
1261
  const e = pr(), t = Ye(), n = Xe();
1262
- W(() => {
1263
- const r = Rs(e), o = K.on(te.changed, (s) => {
1262
+ z(() => {
1263
+ const r = Ns(e), o = J.on(te.changed, (s) => {
1264
1264
  ct(r, t, n, s.path);
1265
- }), i = K.on(te.created, (s) => {
1265
+ }), i = J.on(te.created, (s) => {
1266
1266
  jt(r, t, n), s.kind === "file" && ct(r, t, n, s.path);
1267
- }), a = K.on(te.moved, (s) => {
1267
+ }), a = J.on(te.moved, (s) => {
1268
1268
  jt(r, t, n), ct(r, t, n, s.from), ct(r, t, n, s.to), In(r, t, n);
1269
- }), c = K.on(te.deleted, (s) => {
1269
+ }), c = J.on(te.deleted, (s) => {
1270
1270
  jt(r, t, n), ct(r, t, n, s.path), In(r, t, n);
1271
1271
  });
1272
1272
  return () => {
@@ -1275,7 +1275,7 @@ function Ns() {
1275
1275
  }, [e, t, n]);
1276
1276
  }
1277
1277
  const Ts = 25;
1278
- function Rs(e) {
1278
+ function Ns(e) {
1279
1279
  const t = /* @__PURE__ */ new Map();
1280
1280
  let n;
1281
1281
  const r = () => {
@@ -1305,7 +1305,7 @@ function In(e, t, n) {
1305
1305
  }
1306
1306
  function As() {
1307
1307
  const e = Ye(), t = Xe(), n = pr();
1308
- W(() => {
1308
+ z(() => {
1309
1309
  if (typeof window > "u" || typeof EventSource > "u") return;
1310
1310
  const r = Ls(Fs(e, "/api/v1/fs/events"), t);
1311
1311
  let o, i = !1;
@@ -1343,16 +1343,16 @@ function As() {
1343
1343
  function Ds(e) {
1344
1344
  switch (e.op) {
1345
1345
  case "write":
1346
- K.emit(te.created, { ...et(), path: e.path, kind: "file" }), K.emit(te.changed, { ...et(), path: e.path });
1346
+ J.emit(te.created, { ...et(), path: e.path, kind: "file" }), J.emit(te.changed, { ...et(), path: e.path });
1347
1347
  return;
1348
1348
  case "mkdir":
1349
- K.emit(te.created, { ...et(), path: e.path, kind: "dir" });
1349
+ J.emit(te.created, { ...et(), path: e.path, kind: "dir" });
1350
1350
  return;
1351
1351
  case "unlink":
1352
- K.emit(te.deleted, { ...et(), path: e.path });
1352
+ J.emit(te.deleted, { ...et(), path: e.path });
1353
1353
  return;
1354
1354
  case "rename":
1355
- e.oldPath ? K.emit(te.moved, { ...et(), from: e.oldPath, to: e.path }) : K.emit(te.created, { ...et(), path: e.path, kind: "file" });
1355
+ e.oldPath ? J.emit(te.moved, { ...et(), from: e.oldPath, to: e.path }) : J.emit(te.created, { ...et(), path: e.path, kind: "file" });
1356
1356
  return;
1357
1357
  }
1358
1358
  }
@@ -1370,20 +1370,20 @@ function Ls(e, t) {
1370
1370
  const n = e.includes("?") ? "&" : "?";
1371
1371
  return `${e}${n}workspaceId=${encodeURIComponent(t)}`;
1372
1372
  }
1373
- const pn = me(null), Ir = me(""), Nr = me(null);
1373
+ const pn = me(null), Ir = me(""), Rr = me(null);
1374
1374
  function $e() {
1375
1375
  const e = ue(pn);
1376
1376
  if (!e) throw new Error("useDataClient must be used within a DataProvider");
1377
1377
  return e;
1378
1378
  }
1379
- function Ru() {
1379
+ function _u() {
1380
1380
  return ue(pn) != null;
1381
1381
  }
1382
1382
  function Ye() {
1383
1383
  return ue(Ir);
1384
1384
  }
1385
1385
  function Xe() {
1386
- return ue(Nr);
1386
+ return ue(Rr);
1387
1387
  }
1388
1388
  function $s({
1389
1389
  apiBaseUrl: e,
@@ -1393,7 +1393,7 @@ function $s({
1393
1393
  client: o,
1394
1394
  children: i
1395
1395
  }) {
1396
- const a = L(null);
1396
+ const a = $(null);
1397
1397
  a.current || (a.current = new gi({
1398
1398
  defaultOptions: {
1399
1399
  queries: {
@@ -1402,17 +1402,17 @@ function $s({
1402
1402
  }
1403
1403
  }
1404
1404
  }));
1405
- const c = V(
1405
+ const c = K(
1406
1406
  () => o ?? new ws({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
1407
1407
  [o, e, t, n, r]
1408
1408
  ), s = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
1409
- return /* @__PURE__ */ u(vi, { client: a.current, children: /* @__PURE__ */ u(Ir.Provider, { value: e, children: /* @__PURE__ */ u(Nr.Provider, { value: s, children: /* @__PURE__ */ x(pn.Provider, { value: c, children: [
1409
+ return /* @__PURE__ */ u(vi, { client: a.current, children: /* @__PURE__ */ u(Ir.Provider, { value: e, children: /* @__PURE__ */ u(Rr.Provider, { value: s, children: /* @__PURE__ */ w(pn.Provider, { value: c, children: [
1410
1410
  /* @__PURE__ */ u(Os, {}),
1411
1411
  i
1412
1412
  ] }) }) }) });
1413
1413
  }
1414
1414
  function Os() {
1415
- return Ns(), As(), null;
1415
+ return Rs(), As(), null;
1416
1416
  }
1417
1417
  const Tr = /* @__PURE__ */ new Map();
1418
1418
  function Ms(e) {
@@ -1421,14 +1421,14 @@ function Ms(e) {
1421
1421
  function Ws(e) {
1422
1422
  return e && e.length > 0 ? e : ".";
1423
1423
  }
1424
- function Rr(e, t, n) {
1424
+ function Nr(e, t, n) {
1425
1425
  return `${Ms(e)}\0${t ?? ""}\0${Ws(n)}`;
1426
1426
  }
1427
1427
  function zs(e, t, n, r) {
1428
- Tr.set(Rr(e, t, n), r);
1428
+ Tr.set(Nr(e, t, n), r);
1429
1429
  }
1430
1430
  function js(e, t, n) {
1431
- return Tr.get(Rr(e, t, n));
1431
+ return Tr.get(Nr(e, t, n));
1432
1432
  }
1433
1433
  function Mt(e, t) {
1434
1434
  return t instanceof Ke && t.status === 404 ? !1 : e < 3;
@@ -1468,8 +1468,8 @@ function Us(e) {
1468
1468
  });
1469
1469
  }
1470
1470
  function qs(e, t) {
1471
- const n = $e(), r = Ye(), o = Xe(), [i, a] = j(e), c = L(void 0);
1472
- return W(() => (clearTimeout(c.current), c.current = setTimeout(() => a(e), 300), () => clearTimeout(c.current)), [e]), _t({
1471
+ const n = $e(), r = Ye(), o = Xe(), [i, a] = j(e), c = $(void 0);
1472
+ return z(() => (clearTimeout(c.current), c.current = setTimeout(() => a(e), 300), () => clearTimeout(c.current)), [e]), _t({
1473
1473
  queryKey: [r, o, "search", i, t],
1474
1474
  queryFn: ({ signal: s }) => n.search(i, t, s),
1475
1475
  enabled: i.length > 0,
@@ -1481,7 +1481,7 @@ function Dr() {
1481
1481
  return Ft({
1482
1482
  mutationFn: ({ path: t, content: n, expectedMtimeMs: r }) => e.writeFile(t, n, r != null ? { expectedMtimeMs: r } : void 0),
1483
1483
  onSuccess: (t, { path: n }) => {
1484
- K.emit(te.changed, { ...it(), path: n });
1484
+ J.emit(te.changed, { ...it(), path: n });
1485
1485
  }
1486
1486
  });
1487
1487
  }
@@ -1490,7 +1490,7 @@ function Hs() {
1490
1490
  return Ft({
1491
1491
  mutationFn: ({ path: t }) => e.createDir(t),
1492
1492
  onSuccess: (t, { path: n }) => {
1493
- K.emit(te.created, { ...it(), path: n, kind: "dir" });
1493
+ J.emit(te.created, { ...it(), path: n, kind: "dir" });
1494
1494
  }
1495
1495
  });
1496
1496
  }
@@ -1499,7 +1499,7 @@ function Gs() {
1499
1499
  return Ft({
1500
1500
  mutationFn: ({ from: t, to: n }) => e.moveFile(t, n),
1501
1501
  onSuccess: (t, { from: n, to: r }) => {
1502
- K.emit(te.moved, { ...it(), from: n, to: r });
1502
+ J.emit(te.moved, { ...it(), from: n, to: r });
1503
1503
  }
1504
1504
  });
1505
1505
  }
@@ -1508,7 +1508,7 @@ function Vs() {
1508
1508
  return Ft({
1509
1509
  mutationFn: ({ path: t }) => e.deleteFile(t),
1510
1510
  onSuccess: (t, { path: n }) => {
1511
- K.emit(te.deleted, { ...it(), path: n });
1511
+ J.emit(te.deleted, { ...it(), path: n });
1512
1512
  }
1513
1513
  });
1514
1514
  }
@@ -1521,7 +1521,7 @@ function Ys(e) {
1521
1521
  return { "content-type": "application/json", ...e ?? {} };
1522
1522
  }
1523
1523
  function Xs(e) {
1524
- const t = T((n) => {
1524
+ const t = N((n) => {
1525
1525
  if (!n.panelInstanceId) return;
1526
1526
  const r = n;
1527
1527
  fetch(Js(e.apiBaseUrl, "/api/v1/ui/panels/status"), {
@@ -1534,12 +1534,12 @@ function Xs(e) {
1534
1534
  return fe(_r.Provider, { value: { report: t } }, e.children);
1535
1535
  }
1536
1536
  function Qs(e) {
1537
- return W(() => {
1537
+ return z(() => {
1538
1538
  e.onReady();
1539
1539
  }, [e.onReady]), fe(ar, null, e.children);
1540
1540
  }
1541
1541
  function Zs(e) {
1542
- return W(() => {
1542
+ return z(() => {
1543
1543
  e.onLoading();
1544
1544
  }, [e.onLoading]), fe(
1545
1545
  "div",
@@ -1551,7 +1551,7 @@ function Zs(e) {
1551
1551
  );
1552
1552
  }
1553
1553
  function ea(e) {
1554
- const t = ue(_r), n = e.panelInstanceId, r = T((i, a) => {
1554
+ const t = ue(_r), n = e.panelInstanceId, r = N((i, a) => {
1555
1555
  n != null && n.startsWith("self-test:") && t.report({
1556
1556
  pluginId: e.pluginId,
1557
1557
  panelId: e.panelId,
@@ -1561,8 +1561,8 @@ function ea(e) {
1561
1561
  ...a ? { error: a } : {}
1562
1562
  });
1563
1563
  }, [n, e.panelId, e.pluginId, e.revision, t]);
1564
- W(() => () => r("missing"), [r]);
1565
- const o = T((i) => {
1564
+ z(() => () => r("missing"), [r]);
1565
+ const o = N((i) => {
1566
1566
  r("error", { code: "PLUGIN_PANEL_RENDER_ERROR", message: i.message });
1567
1567
  }, [r]);
1568
1568
  return fe(
@@ -1690,7 +1690,7 @@ class ta {
1690
1690
  const r = this, o = function(a) {
1691
1691
  var m;
1692
1692
  ot(r.subscribe, r.getSnapshot, r.getSnapshot);
1693
- const c = r.get(t), s = r.generation, f = !!(c && r.satisfiesCapabilities(c)), l = V(() => !c || !r.satisfiesCapabilities(c) ? () => null : c.lazy ? r.getLazyComponent(t, c.component) : c.component, [c == null ? void 0 : c.component, c == null ? void 0 : c.lazy, c == null ? void 0 : c.requiresCapabilities, s]);
1693
+ const c = r.get(t), s = r.generation, f = !!(c && r.satisfiesCapabilities(c)), l = K(() => !c || !r.satisfiesCapabilities(c) ? () => null : c.lazy ? r.getLazyComponent(t, c.component) : c.component, [c == null ? void 0 : c.component, c == null ? void 0 : c.lazy, c == null ? void 0 : c.requiresCapabilities, s]);
1694
1694
  if (!f) return null;
1695
1695
  const d = (c == null ? void 0 : c.pluginId) ?? (c == null ? void 0 : c.id) ?? t, p = typeof ((m = a == null ? void 0 : a.api) == null ? void 0 : m.id) == "string" ? a.api.id : void 0;
1696
1696
  return fe(
@@ -1726,7 +1726,7 @@ class ta {
1726
1726
  return (n = t.requiresCapabilities) != null && n.length ? t.requiresCapabilities.every((r) => this.capabilities.has(r)) : !0;
1727
1727
  }
1728
1728
  }
1729
- const Nn = {
1729
+ const Rn = {
1730
1730
  ts: ce,
1731
1731
  tsx: ce,
1732
1732
  js: ce,
@@ -1773,7 +1773,7 @@ const Nn = {
1773
1773
  function na(e) {
1774
1774
  var n;
1775
1775
  const t = (n = e.split(".").pop()) == null ? void 0 : n.toLowerCase();
1776
- return t && t in Nn ? Nn[t] : Rt;
1776
+ return t && t in Rn ? Rn[t] : Nt;
1777
1777
  }
1778
1778
  const Je = "workspace.open.path";
1779
1779
  function Fr(e, t) {
@@ -1830,22 +1830,22 @@ function je() {
1830
1830
  );
1831
1831
  return nn;
1832
1832
  }
1833
- function Au() {
1833
+ function Fu() {
1834
1834
  return ze(je(), (e) => e.activeFile);
1835
1835
  }
1836
- function Du() {
1836
+ function Lu() {
1837
1837
  return ze(je(), (e) => e.activePanel);
1838
1838
  }
1839
- function _u() {
1839
+ function $u() {
1840
1840
  return ze(je(), (e) => e.sidebar);
1841
1841
  }
1842
- function Fu() {
1842
+ function Ou() {
1843
1843
  return ze(je(), (e) => e.setSidebar);
1844
1844
  }
1845
- function Lu() {
1845
+ function Mu() {
1846
1846
  return ze(je(), (e) => e.panels);
1847
1847
  }
1848
- function $u() {
1848
+ function Wu() {
1849
1849
  return ze(je(), (e) => e.dirtyFiles);
1850
1850
  }
1851
1851
  function hn() {
@@ -1854,7 +1854,7 @@ function hn() {
1854
1854
  function ra() {
1855
1855
  return ze(je(), (e) => e.hydrationComplete);
1856
1856
  }
1857
- function Ou() {
1857
+ function zu() {
1858
1858
  return ze(je(), (e) => e.resetLayout);
1859
1859
  }
1860
1860
  function oa(e) {
@@ -1920,20 +1920,20 @@ function ua() {
1920
1920
  );
1921
1921
  }
1922
1922
  function da(e) {
1923
- const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] = j(t.title ?? t.id), [i, a] = j(null), c = L(null);
1924
- W(() => {
1925
- var y;
1923
+ const { api: t } = e, n = e.tabLocation === "headerOverflow", [r, o] = j(t.title ?? t.id), [i, a] = j(null), c = $(null);
1924
+ z(() => {
1925
+ var C;
1926
1926
  const h = () => o(t.title ?? t.id);
1927
1927
  h();
1928
- const k = (y = t.onDidTitleChange) == null ? void 0 : y.call(t, h);
1928
+ const x = (C = t.onDidTitleChange) == null ? void 0 : C.call(t, h);
1929
1929
  return () => {
1930
- var w;
1931
- return (w = k == null ? void 0 : k.dispose) == null ? void 0 : w.call(k);
1930
+ var b;
1931
+ return (b = x == null ? void 0 : x.dispose) == null ? void 0 : b.call(x);
1932
1932
  };
1933
- }, [t]), W(() => {
1933
+ }, [t]), z(() => {
1934
1934
  if (!i) return;
1935
- function h(k) {
1936
- c.current && !c.current.contains(k.target) && a(null);
1935
+ function h(x) {
1936
+ c.current && !c.current.contains(x.target) && a(null);
1937
1937
  }
1938
1938
  return document.addEventListener("pointerdown", h), () => document.removeEventListener("pointerdown", h);
1939
1939
  }, [i]);
@@ -1943,22 +1943,22 @@ function da(e) {
1943
1943
  }), Zt(ve.editorSaveEnd, (h) => {
1944
1944
  h.panelId === t.id && v(!1);
1945
1945
  });
1946
- const C = (h) => {
1946
+ const E = (h) => {
1947
1947
  h.preventDefault(), h.stopPropagation(), n && h.nativeEvent.stopImmediatePropagation(), t.close(), n && ua();
1948
- }, S = (h) => {
1948
+ }, k = (h) => {
1949
1949
  !d && m.length === 0 || (h.preventDefault(), h.stopPropagation(), a({ x: h.clientX, y: h.clientY }));
1950
- }, D = (h) => {
1950
+ }, _ = (h) => {
1951
1951
  a(null), la(h);
1952
1952
  }, I = () => {
1953
- var h, k;
1953
+ var h, x;
1954
1954
  a(null), (h = t.setActive) == null || h.call(t);
1955
- for (const y of m) (k = y.close) == null || k.call(y);
1956
- }, F = () => {
1957
- var h, k;
1955
+ for (const C of m) (x = C.close) == null || x.call(C);
1956
+ }, L = () => {
1957
+ var h, x;
1958
1958
  a(null), (h = t.setActive) == null || h.call(t);
1959
- for (const y of p) (k = y.close) == null || k.call(y);
1960
- }, O = i && typeof document < "u" ? hr(
1961
- /* @__PURE__ */ x(
1959
+ for (const C of p) (x = C.close) == null || x.call(C);
1960
+ }, M = i && typeof document < "u" ? hr(
1961
+ /* @__PURE__ */ w(
1962
1962
  "div",
1963
1963
  {
1964
1964
  ref: c,
@@ -1976,7 +1976,7 @@ function da(e) {
1976
1976
  type: "button",
1977
1977
  role: "menuitem",
1978
1978
  className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
1979
- onClick: () => D(d),
1979
+ onClick: () => _(d),
1980
1980
  children: "Copy path"
1981
1981
  }
1982
1982
  ) : null,
@@ -1996,7 +1996,7 @@ function da(e) {
1996
1996
  type: "button",
1997
1997
  role: "menuitem",
1998
1998
  className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
1999
- onClick: F,
1999
+ onClick: L,
2000
2000
  children: "Close all"
2001
2001
  }
2002
2002
  ) : null
@@ -2005,8 +2005,8 @@ function da(e) {
2005
2005
  ),
2006
2006
  document.body
2007
2007
  ) : null;
2008
- return /* @__PURE__ */ x(ar, { children: [
2009
- /* @__PURE__ */ x(
2008
+ return /* @__PURE__ */ w(ar, { children: [
2009
+ /* @__PURE__ */ w(
2010
2010
  "div",
2011
2011
  {
2012
2012
  className: re(
@@ -2016,9 +2016,9 @@ function da(e) {
2016
2016
  ),
2017
2017
  title: s ? `${f} (unsaved changes)` : f,
2018
2018
  onPointerDown: (h) => {
2019
- h.button === 2 && S(h);
2019
+ h.button === 2 && k(h);
2020
2020
  },
2021
- onContextMenu: S,
2021
+ onContextMenu: k,
2022
2022
  children: [
2023
2023
  /* @__PURE__ */ u(
2024
2024
  l,
@@ -2031,7 +2031,7 @@ function da(e) {
2031
2031
  }
2032
2032
  ),
2033
2033
  /* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: f }),
2034
- /* @__PURE__ */ x("div", { className: "flex shrink-0 items-center gap-1", children: [
2034
+ /* @__PURE__ */ w("div", { className: "flex shrink-0 items-center gap-1", children: [
2035
2035
  s || g ? /* @__PURE__ */ u(
2036
2036
  "span",
2037
2037
  {
@@ -2058,8 +2058,8 @@ function da(e) {
2058
2058
  ...n ? (
2059
2059
  // In the overflow popover, intercept on capture so we run before
2060
2060
  // dockview's native row click listener (see handleClose).
2061
- { onClickCapture: C }
2062
- ) : { onClick: C },
2061
+ { onClickCapture: E }
2062
+ ) : { onClick: E },
2063
2063
  "aria-label": `Close ${f}`,
2064
2064
  children: /* @__PURE__ */ u(sn, { className: "h-3 w-3", strokeWidth: 2.25 })
2065
2065
  }
@@ -2068,7 +2068,7 @@ function da(e) {
2068
2068
  ]
2069
2069
  }
2070
2070
  ),
2071
- O
2071
+ M
2072
2072
  ] });
2073
2073
  }
2074
2074
  const fa = 300, Or = me(null);
@@ -2087,7 +2087,7 @@ function Tn(e, t) {
2087
2087
  n.some((a) => pa(i, a)) && (r.has(i.id) || (r.add(i.id), o.push(i)));
2088
2088
  return o;
2089
2089
  }
2090
- function Mu() {
2090
+ function ju() {
2091
2091
  const e = ue(Or);
2092
2092
  if (!e)
2093
2093
  throw new Error(
@@ -2194,7 +2194,7 @@ function ga(e) {
2194
2194
  maximumHeight: e.constraints.maxHeight
2195
2195
  };
2196
2196
  }
2197
- function Rn(e, t) {
2197
+ function Nn(e, t) {
2198
2198
  const n = e.getPanel(t.panel ?? t.id);
2199
2199
  if (!(n != null && n.group)) return;
2200
2200
  const r = ga(t);
@@ -2224,7 +2224,7 @@ function va(e, t, n, r, o, i) {
2224
2224
  }
2225
2225
  for (const l of t.groups) {
2226
2226
  const d = a.getPanel(l.panel ?? l.id);
2227
- d != null && d.group && (l.locked && (d.group.locked = "no-drop-target"), l.hideHeader && (d.group.header.hidden = !0), Rn(a, l));
2227
+ d != null && d.group && (l.locked && (d.group.locked = "no-drop-target"), l.hideHeader && (d.group.header.hidden = !0), Nn(a, l));
2228
2228
  }
2229
2229
  const c = t.groups.filter(
2230
2230
  (l) => {
@@ -2236,7 +2236,7 @@ function va(e, t, n, r, o, i) {
2236
2236
  if (c.length > 0) {
2237
2237
  const l = () => {
2238
2238
  for (const d of c)
2239
- Rn(a, d);
2239
+ Nn(a, d);
2240
2240
  };
2241
2241
  window.addEventListener("resize", l), s = () => window.removeEventListener("resize", l);
2242
2242
  }
@@ -2270,67 +2270,67 @@ function ya({
2270
2270
  rightHeaderActions: c,
2271
2271
  watermarkComponent: s
2272
2272
  }) {
2273
- const f = Lt(), l = ot(f.subscribe, f.getSnapshot, f.getSnapshot), d = ra(), p = L(null), m = L(null), g = L(void 0), v = L(null), C = V(() => {
2274
- const F = f.getComponents(), O = o ? Object.fromEntries(Object.entries(F).filter(([k]) => o.includes(k))) : F, h = v.current;
2273
+ const f = Lt(), l = ot(f.subscribe, f.getSnapshot, f.getSnapshot), d = ra(), p = $(null), m = $(null), g = $(void 0), v = $(null), E = K(() => {
2274
+ const L = f.getComponents(), M = o ? Object.fromEntries(Object.entries(L).filter(([x]) => o.includes(x))) : L, h = v.current;
2275
2275
  if (h) {
2276
- const k = Object.keys(h), y = Object.keys(O);
2277
- if (k.length === y.length && y.every((w) => h[w] === O[w]))
2276
+ const x = Object.keys(h), C = Object.keys(M);
2277
+ if (x.length === C.length && C.every((b) => h[b] === M[b]))
2278
2278
  return h;
2279
2279
  }
2280
- return v.current = O, O;
2281
- }, [f, l, o]), S = V(() => ma(p), []), D = T(
2282
- (F) => {
2283
- var O;
2284
- (O = g.current) == null || O.call(g), g.current = va(
2285
- F,
2280
+ return v.current = M, M;
2281
+ }, [f, l, o]), k = K(() => ma(p), []), _ = N(
2282
+ (L) => {
2283
+ var M;
2284
+ (M = g.current) == null || M.call(g), g.current = va(
2285
+ L,
2286
2286
  e,
2287
2287
  t,
2288
2288
  f,
2289
2289
  r,
2290
2290
  p
2291
- ), n == null || n(F.api);
2291
+ ), n == null || n(L.api);
2292
2292
  },
2293
2293
  [e, t, f, r, n]
2294
2294
  );
2295
- W(() => () => {
2296
- var F;
2297
- return (F = g.current) == null ? void 0 : F.call(g);
2298
- }, []), W(() => {
2299
- const F = K.on(ve.panelUpdate, ({ match: h, params: k, title: y }) => {
2300
- const w = p.current;
2301
- if (w)
2302
- for (const M of Tn(w, h))
2303
- k && M.api.updateParameters({
2304
- ...M.params ?? {},
2305
- ...k
2306
- }), y && M.api.setTitle(y);
2307
- }), O = K.on(ve.panelClose, ({ match: h }) => {
2308
- const k = p.current;
2309
- if (k)
2310
- for (const y of Tn(k, h))
2311
- k.removePanel(y);
2295
+ z(() => () => {
2296
+ var L;
2297
+ return (L = g.current) == null ? void 0 : L.call(g);
2298
+ }, []), z(() => {
2299
+ const L = J.on(ve.panelUpdate, ({ match: h, params: x, title: C }) => {
2300
+ const b = p.current;
2301
+ if (b)
2302
+ for (const D of Tn(b, h))
2303
+ x && D.api.updateParameters({
2304
+ ...D.params ?? {},
2305
+ ...x
2306
+ }), C && D.api.setTitle(C);
2307
+ }), M = J.on(ve.panelClose, ({ match: h }) => {
2308
+ const x = p.current;
2309
+ if (x)
2310
+ for (const C of Tn(x, h))
2311
+ x.removePanel(C);
2312
2312
  });
2313
2313
  return () => {
2314
- F(), O();
2314
+ L(), M();
2315
2315
  };
2316
2316
  }, []);
2317
- const I = T(
2318
- (F) => {
2317
+ const I = N(
2318
+ (L) => {
2319
2319
  if (!d) {
2320
- m.current = F;
2320
+ m.current = L;
2321
2321
  return;
2322
2322
  }
2323
- D(F);
2323
+ _(L);
2324
2324
  },
2325
- [d, D]
2325
+ [d, _]
2326
2326
  );
2327
- return W(() => {
2328
- d && m.current && (D(m.current), m.current = null);
2329
- }, [d, D]), d ? /* @__PURE__ */ u(Or.Provider, { value: S, children: /* @__PURE__ */ u(
2327
+ return z(() => {
2328
+ d && m.current && (_(m.current), m.current = null);
2329
+ }, [d, _]), d ? /* @__PURE__ */ u(Or.Provider, { value: k, children: /* @__PURE__ */ u(
2330
2330
  mr,
2331
2331
  {
2332
2332
  className: `dv-shell ${i ?? ""}`,
2333
- components: C,
2333
+ components: E,
2334
2334
  defaultTabComponent: da,
2335
2335
  prefixHeaderActionsComponent: a,
2336
2336
  rightHeaderActionsComponent: c,
@@ -2372,11 +2372,11 @@ function xa({
2372
2372
  className: o,
2373
2373
  panelApi: i
2374
2374
  }) {
2375
- return V(
2375
+ return K(
2376
2376
  () => i ? wa(i) : null,
2377
2377
  [i]
2378
- ), /* @__PURE__ */ x("div", { className: re("flex h-full flex-col overflow-hidden", o), children: [
2379
- /* @__PURE__ */ x("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2378
+ ), /* @__PURE__ */ w("div", { className: re("flex h-full flex-col overflow-hidden", o), children: [
2379
+ /* @__PURE__ */ w("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2380
2380
  t && /* @__PURE__ */ u(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
2381
2381
  /* @__PURE__ */ u("span", { className: "truncate text-sm font-medium", children: e }),
2382
2382
  /* @__PURE__ */ u("div", { className: "flex-1" }),
@@ -2481,7 +2481,7 @@ async function An(e) {
2481
2481
  }
2482
2482
  if (!n) throw new Error("Clipboard not available");
2483
2483
  }
2484
- const Wr = () => import("./FileTree-D6oUyX8I.js").then((e) => ({ default: e.FileTree }));
2484
+ const Wr = () => import("./FileTree-DNIzusWa.js").then((e) => ({ default: e.FileTree }));
2485
2485
  function Ca() {
2486
2486
  Wr();
2487
2487
  }
@@ -2516,271 +2516,271 @@ function _n({
2516
2516
  className: i
2517
2517
  }) {
2518
2518
  var bn;
2519
- const a = $e(), { data: c, error: s, isLoading: f } = Ar(e), [l, d] = j(/* @__PURE__ */ new Map()), p = Bt(e), m = V(
2519
+ const a = $e(), { data: c, error: s, isLoading: f } = Ar(e), [l, d] = j(/* @__PURE__ */ new Map()), p = Bt(e), m = K(
2520
2520
  () => Ut(c, l.get(p)),
2521
2521
  [c, l, p]
2522
- ), g = V(
2522
+ ), g = K(
2523
2523
  () => Sa(m, o),
2524
2524
  [m, o]
2525
- ), { mutateAsync: v } = Dr(), { mutateAsync: C } = Hs(), { mutateAsync: S } = Gs(), { mutateAsync: D } = Vs(), [I, F] = j(/* @__PURE__ */ new Map()), O = V(() => {
2525
+ ), { mutateAsync: v } = Dr(), { mutateAsync: E } = Hs(), { mutateAsync: k } = Gs(), { mutateAsync: _ } = Vs(), [I, L] = j(/* @__PURE__ */ new Map()), M = K(() => {
2526
2526
  if (l.size === 0) return I;
2527
- const b = new Map(I);
2528
- for (const [N, $] of l) {
2529
- if (N === p) continue;
2530
- const H = Ut(b.get(N), $);
2531
- H && b.set(N, H);
2527
+ const y = new Map(I);
2528
+ for (const [R, O] of l) {
2529
+ if (R === p) continue;
2530
+ const H = Ut(y.get(R), O);
2531
+ H && y.set(R, H);
2532
2532
  }
2533
- return b;
2534
- }, [I, l, p]), h = L(null), [k, y] = j(400), [w, M] = j(null), B = w && !w.isBackground && w.node.kind === "file" ? w.node.path : null, { data: R } = Us(B), [E, Y] = j(null), z = L(null), [U, ee] = j(
2533
+ return y;
2534
+ }, [I, l, p]), h = $(null), [x, C] = j(400), [b, D] = j(null), B = b && !b.isBackground && b.node.kind === "file" ? b.node.path : null, { data: T } = Us(B), [S, G] = j(null), W = $(null), [U, ee] = j(
2535
2535
  ((bn = n == null ? void 0 : n.getActiveFile) == null ? void 0 : bn.call(n)) ?? null
2536
- ), [J, le] = j(null), [Se, ye] = j(null), ge = L(0), be = L(0), Be = L(0), Pe = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Qe } = qs(
2536
+ ), [Y, le] = j(null), [Se, ye] = j(null), ge = $(0), be = $(0), Be = $(0), Pe = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Qe } = qs(
2537
2537
  Pe ? Mr(t ?? "") : "",
2538
2538
  50
2539
2539
  );
2540
- W(() => {
2541
- if (!w) return;
2542
- function b(N) {
2543
- z.current && !z.current.contains(N.target) && M(null);
2540
+ z(() => {
2541
+ if (!b) return;
2542
+ function y(R) {
2543
+ W.current && !W.current.contains(R.target) && D(null);
2544
2544
  }
2545
- return document.addEventListener("pointerdown", b), () => document.removeEventListener("pointerdown", b);
2546
- }, [w]), To(() => {
2547
- if (!w || !z.current) return;
2548
- const { x: b, y: N } = Ia(
2549
- w.x,
2550
- w.y,
2551
- z.current.getBoundingClientRect(),
2545
+ return document.addEventListener("pointerdown", y), () => document.removeEventListener("pointerdown", y);
2546
+ }, [b]), To(() => {
2547
+ if (!b || !W.current) return;
2548
+ const { x: y, y: R } = Ia(
2549
+ b.x,
2550
+ b.y,
2551
+ W.current.getBoundingClientRect(),
2552
2552
  window.innerWidth,
2553
2553
  window.innerHeight
2554
2554
  );
2555
- b === w.x && N === w.y || M(($) => !$ || $.x === b && $.y === N ? $ : { ...$, x: b, y: N });
2556
- }, [w]), W(() => {
2557
- const b = h.current;
2558
- if (!b) return;
2559
- const N = new ResizeObserver(([$]) => {
2560
- $ && y(Math.floor($.contentRect.height));
2555
+ y === b.x && R === b.y || D((O) => !O || O.x === y && O.y === R ? O : { ...O, x: y, y: R });
2556
+ }, [b]), z(() => {
2557
+ const y = h.current;
2558
+ if (!y) return;
2559
+ const R = new ResizeObserver(([O]) => {
2560
+ O && C(Math.floor(O.contentRect.height));
2561
2561
  });
2562
- return N.observe(b), () => N.disconnect();
2562
+ return R.observe(y), () => R.disconnect();
2563
2563
  }, []);
2564
- const Ze = (Pe && Qe ? Qe.map((b) => ({
2565
- name: b.split("/").pop() ?? b,
2564
+ const Ze = (Pe && Qe ? Qe.map((y) => ({
2565
+ name: y.split("/").pop() ?? y,
2566
2566
  kind: "file",
2567
- path: b
2568
- })) : void 0) ?? Fr(g ?? [], O), oe = Lr(Ze, J, e), de = T(
2569
- (b) => {
2570
- ee(b), n == null || n.openFile(b, { mode: "edit" });
2567
+ path: y
2568
+ })) : void 0) ?? Fr(g ?? [], M), oe = Lr(Ze, Y, e), de = N(
2569
+ (y) => {
2570
+ ee(y), n == null || n.openFile(y, { mode: "edit" });
2571
2571
  },
2572
2572
  [n]
2573
- ), we = T(
2574
- async (b) => {
2573
+ ), we = N(
2574
+ async (y) => {
2575
2575
  try {
2576
- const N = await a.getTree(b), $ = o.length === 0 ? N : N.filter((H) => !rn(H.name, o));
2577
- F((H) => new Map(H).set(b, $));
2576
+ const R = await a.getTree(y), O = o.length === 0 ? R : R.filter((H) => !rn(H.name, o));
2577
+ L((H) => new Map(H).set(y, O));
2578
2578
  } catch {
2579
2579
  }
2580
2580
  },
2581
2581
  [a, o]
2582
- ), ie = T(
2583
- async (b, N) => {
2584
- const $ = Array.from(new Set(b)).filter(
2585
- (G) => G && G !== e && G !== "."
2582
+ ), ie = N(
2583
+ async (y, R) => {
2584
+ const O = Array.from(new Set(y)).filter(
2585
+ (V) => V && V !== e && V !== "."
2586
2586
  );
2587
- if ($.length === 0) return;
2587
+ if (O.length === 0) return;
2588
2588
  const H = await Promise.all(
2589
- $.map(async (G) => {
2589
+ O.map(async (V) => {
2590
2590
  try {
2591
- const X = await a.getTree(G), Ee = o.length === 0 ? X : X.filter((Ae) => !rn(Ae.name, o));
2592
- return [G, Ee];
2591
+ const X = await a.getTree(V), Ee = o.length === 0 ? X : X.filter((Ae) => !rn(Ae.name, o));
2592
+ return [V, Ee];
2593
2593
  } catch {
2594
2594
  return null;
2595
2595
  }
2596
2596
  })
2597
2597
  );
2598
- F((G) => {
2599
- const X = new Map(G);
2598
+ L((V) => {
2599
+ const X = new Map(V);
2600
2600
  for (const Ee of H) {
2601
2601
  if (!Ee) continue;
2602
2602
  const [Ae, Ie] = Ee;
2603
- (N != null && N.force || X.has(Ae)) && X.set(Ae, Ie);
2603
+ (R != null && R.force || X.has(Ae)) && X.set(Ae, Ie);
2604
2604
  }
2605
2605
  return X;
2606
2606
  });
2607
2607
  },
2608
2608
  [a, e, o]
2609
- ), Ue = L(/* @__PURE__ */ new Set());
2610
- W(() => {
2609
+ ), Ue = $(/* @__PURE__ */ new Set());
2610
+ z(() => {
2611
2611
  Ue.current = new Set(I.keys());
2612
- }, [I]), W(() => {
2613
- const b = (G) => Array.from(new Set(G.map(Ve))).filter((X) => Ue.current.has(X)), N = K.on(te.created, (G) => {
2614
- if (G.cause === "user") return;
2615
- const X = b([G.path]);
2612
+ }, [I]), z(() => {
2613
+ const y = (V) => Array.from(new Set(V.map(Ve))).filter((X) => Ue.current.has(X)), R = J.on(te.created, (V) => {
2614
+ if (V.cause === "user") return;
2615
+ const X = y([V.path]);
2616
2616
  X.length && ie(X);
2617
- }), $ = K.on(te.deleted, (G) => {
2618
- if (G.cause === "user") return;
2619
- const X = b([G.path]);
2617
+ }), O = J.on(te.deleted, (V) => {
2618
+ if (V.cause === "user") return;
2619
+ const X = y([V.path]);
2620
2620
  X.length && ie(X);
2621
- }), H = K.on(te.moved, (G) => {
2622
- if (G.cause === "user") return;
2623
- const X = b([G.from, G.to]);
2621
+ }), H = J.on(te.moved, (V) => {
2622
+ if (V.cause === "user") return;
2623
+ const X = y([V.from, V.to]);
2624
2624
  X.length && ie(X);
2625
2625
  });
2626
2626
  return () => {
2627
- N(), $(), H();
2627
+ R(), O(), H();
2628
2628
  };
2629
2629
  }, [ie]);
2630
- const Ce = T(
2631
- async (b, N) => {
2632
- if (!b) return;
2633
- const $ = zr(b), H = ++ge.current;
2634
- ee($);
2635
- const G = N != null && N.refreshTargetDir ? [...Dn($), $] : Dn($);
2636
- await ie([...new Set(G)], { force: !0 }), ge.current === H && ye($);
2630
+ const Ce = N(
2631
+ async (y, R) => {
2632
+ if (!y) return;
2633
+ const O = zr(y), H = ++ge.current;
2634
+ ee(O);
2635
+ const V = R != null && R.refreshTargetDir ? [...Dn(O), O] : Dn(O);
2636
+ await ie([...new Set(V)], { force: !0 }), ge.current === H && ye(O);
2637
2637
  },
2638
2638
  [ie]
2639
- ), qe = T((b) => {
2640
- ye((N) => N === b ? null : N);
2641
- }, []), Oe = T(
2642
- async (b) => {
2643
- const N = ++be.current;
2639
+ ), qe = N((y) => {
2640
+ ye((R) => R === y ? null : R);
2641
+ }, []), Oe = N(
2642
+ async (y) => {
2643
+ const R = ++be.current;
2644
2644
  try {
2645
- await Ce(b, { refreshTargetDir: !0 });
2645
+ await Ce(y, { refreshTargetDir: !0 });
2646
2646
  } finally {
2647
- be.current === N && (be.current = 0);
2647
+ be.current === R && (be.current = 0);
2648
2648
  }
2649
2649
  },
2650
2650
  [Ce]
2651
2651
  );
2652
- W(() => {
2652
+ z(() => {
2653
2653
  r && Oe(r.path);
2654
- }, [r, Oe]), W(() => {
2655
- var $;
2656
- const b = (($ = n == null ? void 0 : n.getActiveFile) == null ? void 0 : $.call(n)) ?? null;
2657
- b && be.current === 0 && Ce(b);
2658
- const N = [];
2659
- return n != null && n.select && N.push(
2654
+ }, [r, Oe]), z(() => {
2655
+ var O;
2656
+ const y = ((O = n == null ? void 0 : n.getActiveFile) == null ? void 0 : O.call(n)) ?? null;
2657
+ y && be.current === 0 && Ce(y);
2658
+ const R = [];
2659
+ return n != null && n.select && R.push(
2660
2660
  n.select((H) => H.activeFile, (H) => {
2661
2661
  H ? be.current === 0 && Ce(H) : ee(null);
2662
2662
  })
2663
- ), n != null && n.subscribe && N.push(
2663
+ ), n != null && n.subscribe && R.push(
2664
2664
  n.subscribe("tree:expand", ({ path: H }) => {
2665
2665
  Oe(H);
2666
2666
  })
2667
2667
  ), () => {
2668
- for (const H of N) H();
2668
+ for (const H of R) H();
2669
2669
  };
2670
2670
  }, [n, Oe, Ce]);
2671
- const P = T((b, N) => {
2672
- d(($) => {
2673
- const H = Bt(b), G = new Map($), X = Ut(G.get(H), [N]) ?? [N];
2674
- return G.set(H, X), G;
2671
+ const P = N((y, R) => {
2672
+ d((O) => {
2673
+ const H = Bt(y), V = new Map(O), X = Ut(V.get(H), [R]) ?? [R];
2674
+ return V.set(H, X), V;
2675
2675
  });
2676
- }, []), A = T((b, N) => {
2677
- d(($) => {
2678
- const H = Bt(b), G = $.get(H);
2679
- if (!(G != null && G.length)) return $;
2680
- const X = G.filter((Ae) => Ae.path !== N), Ee = new Map($);
2676
+ }, []), A = N((y, R) => {
2677
+ d((O) => {
2678
+ const H = Bt(y), V = O.get(H);
2679
+ if (!(V != null && V.length)) return O;
2680
+ const X = V.filter((Ae) => Ae.path !== R), Ee = new Map(O);
2681
2681
  return X.length > 0 ? Ee.set(H, X) : Ee.delete(H), Ee;
2682
2682
  });
2683
- }, []), [_, q] = j(/* @__PURE__ */ new Set()), ne = T((b) => {
2684
- q((N) => {
2685
- const $ = new Set(N);
2686
- return $.add(b), $;
2683
+ }, []), [F, q] = j(/* @__PURE__ */ new Set()), ne = N((y) => {
2684
+ q((R) => {
2685
+ const O = new Set(R);
2686
+ return O.add(y), O;
2687
2687
  });
2688
- }, []), ae = T((b) => {
2689
- q((N) => {
2690
- if (!N.has(b)) return N;
2691
- const $ = new Set(N);
2692
- return $.delete(b), $;
2688
+ }, []), ae = N((y) => {
2689
+ q((R) => {
2690
+ if (!R.has(y)) return R;
2691
+ const O = new Set(R);
2692
+ return O.delete(y), O;
2693
2693
  });
2694
- }, []), he = T(
2695
- (b, N) => {
2696
- M({ node: N, x: b.clientX, y: b.clientY });
2694
+ }, []), he = N(
2695
+ (y, R) => {
2696
+ D({ node: R, x: y.clientX, y: y.clientY });
2697
2697
  },
2698
2698
  []
2699
- ), se = T(
2700
- (b) => {
2701
- const N = b.target;
2702
- N.closest("[role=treeitem]") || N.closest("[data-path]") || (b.preventDefault(), M({
2699
+ ), se = N(
2700
+ (y) => {
2701
+ const R = y.target;
2702
+ R.closest("[role=treeitem]") || R.closest("[data-path]") || (y.preventDefault(), D({
2703
2703
  node: { name: e, kind: "dir", path: e },
2704
- x: b.clientX,
2705
- y: b.clientY,
2704
+ x: y.clientX,
2705
+ y: y.clientY,
2706
2706
  isBackground: !0
2707
2707
  }));
2708
2708
  },
2709
2709
  [e]
2710
- ), xe = T(
2711
- async (b, N) => {
2712
- const $ = b.split("/").pop() ?? b, H = N === "." ? e : N, G = H === "." ? $ : `${H}/${$}`;
2713
- if (G !== b) {
2714
- ne(b);
2710
+ ), xe = N(
2711
+ async (y, R) => {
2712
+ const O = y.split("/").pop() ?? y, H = R === "." ? e : R, V = H === "." ? O : `${H}/${O}`;
2713
+ if (V !== y) {
2714
+ ne(y);
2715
2715
  try {
2716
- await S({ from: b, to: G }), await ie([Ve(b), Ve(G)]), Ne.success({ title: "Moved", description: `${b} → ${G}` });
2716
+ await k({ from: y, to: V }), await ie([Ve(y), Ve(V)]), Re.success({ title: "Moved", description: `${y} → ${V}` });
2717
2717
  } catch (X) {
2718
- Ne.error({
2718
+ Re.error({
2719
2719
  title: "Move failed",
2720
2720
  description: X instanceof Error ? X.message : String(X)
2721
2721
  });
2722
2722
  } finally {
2723
- ae(b);
2723
+ ae(y);
2724
2724
  }
2725
2725
  }
2726
2726
  },
2727
- [S, ie, e, ne, ae]
2727
+ [k, ie, e, ne, ae]
2728
2728
  );
2729
- function st(b) {
2729
+ function st(y) {
2730
2730
  return () => {
2731
- M(null), (async () => {
2731
+ D(null), (async () => {
2732
2732
  try {
2733
- await b();
2734
- } catch (N) {
2735
- Ne.error({
2733
+ await y();
2734
+ } catch (R) {
2735
+ Re.error({
2736
2736
  title: "Action failed",
2737
- description: N instanceof Error ? N.message : String(N)
2737
+ description: R instanceof Error ? R.message : String(R)
2738
2738
  });
2739
2739
  }
2740
2740
  })();
2741
2741
  };
2742
2742
  }
2743
- const at = (b) => {
2744
- const N = w == null ? void 0 : w.node;
2745
- M(null);
2746
- const $ = (N == null ? void 0 : N.kind) === "dir" ? N.path : N ? Ve(N.path) : e, H = `__draft__:${++Be.current}`;
2747
- le({ kind: b, parentDir: $, path: H });
2743
+ const at = (y) => {
2744
+ const R = b == null ? void 0 : b.node;
2745
+ D(null);
2746
+ const O = (R == null ? void 0 : R.kind) === "dir" ? R.path : R ? Ve(R.path) : e, H = `__draft__:${++Be.current}`;
2747
+ le({ kind: y, parentDir: O, path: H });
2748
2748
  }, Wt = () => at("create-file"), zt = () => at("create-folder"), vo = () => {
2749
- const b = w == null ? void 0 : w.node;
2750
- M(null), b && le({ kind: "rename", path: b.path, initialValue: b.name });
2751
- }, yo = T(
2752
- async (b, N) => {
2753
- const $ = J;
2754
- if (le(null), !$) return;
2755
- const H = N.trim();
2749
+ const y = b == null ? void 0 : b.node;
2750
+ D(null), y && le({ kind: "rename", path: y.path, initialValue: y.name });
2751
+ }, yo = N(
2752
+ async (y, R) => {
2753
+ const O = Y;
2754
+ if (le(null), !O) return;
2755
+ const H = R.trim();
2756
2756
  if (!H) return;
2757
- const G = $.kind === "rename" ? Ve($.path) : $.parentDir, X = $.kind === "rename" ? $.path : G === "." || G === "" ? H : `${G}/${H}`, Ee = $.kind === "rename" ? $.path : X;
2757
+ const V = O.kind === "rename" ? Ve(O.path) : O.parentDir, X = O.kind === "rename" ? O.path : V === "." || V === "" ? H : `${V}/${H}`, Ee = O.kind === "rename" ? O.path : X;
2758
2758
  ne(Ee);
2759
2759
  let Ae = null;
2760
2760
  try {
2761
- if ($.kind === "rename") {
2762
- if (H === $.initialValue) return;
2763
- const Ie = $.path.split("/");
2761
+ if (O.kind === "rename") {
2762
+ if (H === O.initialValue) return;
2763
+ const Ie = O.path.split("/");
2764
2764
  Ie[Ie.length - 1] = H;
2765
2765
  const mt = Ie.join("/");
2766
- await S({ from: $.path, to: mt }), await ie([Ve($.path)]), Ne.success({ title: "Renamed", description: `${$.path} → ${mt}` });
2766
+ await k({ from: O.path, to: mt }), await ie([Ve(O.path)]), Re.success({ title: "Renamed", description: `${O.path} → ${mt}` });
2767
2767
  } else {
2768
2768
  const Ie = {
2769
2769
  name: H,
2770
- kind: $.kind === "create-file" ? "file" : "dir",
2770
+ kind: O.kind === "create-file" ? "file" : "dir",
2771
2771
  path: X
2772
2772
  };
2773
- P(G, Ie), Ae = X, $.kind === "create-file" ? (await v({ path: X, content: "" }), K.emit(te.created, {
2773
+ P(V, Ie), Ae = X, O.kind === "create-file" ? (await v({ path: X, content: "" }), J.emit(te.created, {
2774
2774
  ...it(),
2775
2775
  path: X,
2776
2776
  kind: "file"
2777
- }), de(X), Ne.success({ title: "File created", description: X })) : (await C({ path: X }), Ne.success({ title: "Folder created", description: X })), await ie([G], { force: !0 }), ye(X);
2777
+ }), de(X), Re.success({ title: "File created", description: X })) : (await E({ path: X }), Re.success({ title: "Folder created", description: X })), await ie([V], { force: !0 }), ye(X);
2778
2778
  }
2779
2779
  } catch (Ie) {
2780
- Ae && A(G, Ae);
2780
+ Ae && A(V, Ae);
2781
2781
  const mt = Ie instanceof Error ? Ie.message : String(Ie);
2782
- Ne.error({
2783
- title: $.kind === "rename" ? "Rename failed" : $.kind === "create-file" ? "Create file failed" : "Create folder failed",
2782
+ Re.error({
2783
+ title: O.kind === "rename" ? "Rename failed" : O.kind === "create-file" ? "Create file failed" : "Create folder failed",
2784
2784
  description: mt
2785
2785
  });
2786
2786
  } finally {
@@ -2788,10 +2788,10 @@ function _n({
2788
2788
  }
2789
2789
  },
2790
2790
  [
2791
- J,
2792
- S,
2791
+ Y,
2792
+ k,
2793
2793
  v,
2794
- C,
2794
+ E,
2795
2795
  ie,
2796
2796
  ne,
2797
2797
  ae,
@@ -2799,42 +2799,42 @@ function _n({
2799
2799
  A,
2800
2800
  de
2801
2801
  ]
2802
- ), bo = T(() => {
2802
+ ), bo = N(() => {
2803
2803
  le(null);
2804
2804
  }, []), wo = st(async () => {
2805
- w != null && w.node && (await An(w.node.path), Ne.success({ title: "Path copied", description: w.node.path }));
2805
+ b != null && b.node && (await An(b.node.path), Re.success({ title: "Path copied", description: b.node.path }));
2806
2806
  }), xo = st(async () => {
2807
- if (!(R != null && R.enabled) || !R.url)
2808
- throw new Error((R == null ? void 0 : R.reason) ?? "Git URL unavailable");
2809
- await An(R.url), Ne.success({ title: "Git URL copied", description: R.url });
2810
- }), ko = T(async () => {
2811
- if (!E) return;
2812
- const b = E;
2813
- Y(null), ne(b.path);
2807
+ if (!(T != null && T.enabled) || !T.url)
2808
+ throw new Error((T == null ? void 0 : T.reason) ?? "Git URL unavailable");
2809
+ await An(T.url), Re.success({ title: "Git URL copied", description: T.url });
2810
+ }), ko = N(async () => {
2811
+ if (!S) return;
2812
+ const y = S;
2813
+ G(null), ne(y.path);
2814
2814
  try {
2815
- await D({ path: b.path }), A(Ve(b.path), b.path), b.kind === "dir" && F((N) => {
2816
- const $ = new Map(N);
2817
- for (const H of $.keys())
2818
- (H === b.path || H.startsWith(`${b.path}/`)) && $.delete(H);
2819
- return $;
2820
- }), await ie([Ve(b.path)]), Ne.success({ title: "Deleted", description: b.path });
2821
- } catch (N) {
2822
- Ne.error({
2815
+ await _({ path: y.path }), A(Ve(y.path), y.path), y.kind === "dir" && L((R) => {
2816
+ const O = new Map(R);
2817
+ for (const H of O.keys())
2818
+ (H === y.path || H.startsWith(`${y.path}/`)) && O.delete(H);
2819
+ return O;
2820
+ }), await ie([Ve(y.path)]), Re.success({ title: "Deleted", description: y.path });
2821
+ } catch (R) {
2822
+ Re.error({
2823
2823
  title: "Delete failed",
2824
- description: N instanceof Error ? N.message : String(N)
2824
+ description: R instanceof Error ? R.message : String(R)
2825
2825
  });
2826
2826
  } finally {
2827
- ae(b.path);
2827
+ ae(y.path);
2828
2828
  }
2829
2829
  }, [
2830
- E,
2831
- D,
2830
+ S,
2831
+ _,
2832
2832
  ie,
2833
2833
  ne,
2834
2834
  ae,
2835
2835
  A
2836
2836
  ]), So = !Pe && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
2837
- return /* @__PURE__ */ x("div", { className: "flex h-full min-h-0 flex-col", children: [
2837
+ return /* @__PURE__ */ w("div", { className: "flex h-full min-h-0 flex-col", children: [
2838
2838
  s && /* @__PURE__ */ u(
2839
2839
  rt,
2840
2840
  {
@@ -2849,17 +2849,17 @@ function _n({
2849
2849
  ref: h,
2850
2850
  className: "min-h-0 flex-1 overflow-hidden",
2851
2851
  onContextMenu: se,
2852
- children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((b, N) => /* @__PURE__ */ u(
2852
+ children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y, R) => /* @__PURE__ */ u(
2853
2853
  qo,
2854
2854
  {
2855
2855
  className: "h-5",
2856
- style: { width: `${60 + N * 13 % 30}%` }
2856
+ style: { width: `${60 + R * 13 % 30}%` }
2857
2857
  },
2858
- N
2858
+ R
2859
2859
  )) }) : /* @__PURE__ */ u(
2860
2860
  Tt,
2861
2861
  {
2862
- fallback: /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2862
+ fallback: /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2863
2863
  /* @__PURE__ */ u(At, { className: "size-3.5" }),
2864
2864
  /* @__PURE__ */ u("span", { children: "Loading..." })
2865
2865
  ] }),
@@ -2869,21 +2869,21 @@ function _n({
2869
2869
  files: oe,
2870
2870
  selectedPath: U,
2871
2871
  searchQuery: So,
2872
- editing: J ? {
2873
- path: J.path,
2874
- isDraft: J.kind !== "rename",
2875
- initialValue: J.kind === "rename" ? J.initialValue : void 0
2872
+ editing: Y ? {
2873
+ path: Y.path,
2874
+ isDraft: Y.kind !== "rename",
2875
+ initialValue: Y.kind === "rename" ? Y.initialValue : void 0
2876
2876
  } : null,
2877
2877
  revealPath: Se,
2878
2878
  onRevealHandled: qe,
2879
- pendingPaths: _,
2879
+ pendingPaths: F,
2880
2880
  onSelect: de,
2881
2881
  onExpand: we,
2882
2882
  onContextMenu: he,
2883
2883
  onSubmitEdit: yo,
2884
2884
  onCancelEdit: bo,
2885
2885
  onDragDrop: xe,
2886
- height: k,
2886
+ height: x,
2887
2887
  className: re(i)
2888
2888
  }
2889
2889
  )
@@ -2891,18 +2891,18 @@ function _n({
2891
2891
  )
2892
2892
  }
2893
2893
  ),
2894
- w && hr(
2895
- /* @__PURE__ */ x(
2894
+ b && hr(
2895
+ /* @__PURE__ */ w(
2896
2896
  "div",
2897
2897
  {
2898
- ref: z,
2898
+ ref: W,
2899
2899
  role: "menu",
2900
2900
  className: "fixed z-50 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
2901
- style: { left: w.x, top: w.y },
2901
+ style: { left: b.x, top: b.y },
2902
2902
  children: [
2903
2903
  /* @__PURE__ */ u(Fe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Wt, children: "New file" }),
2904
2904
  /* @__PURE__ */ u(Fe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: zt, children: "New folder" }),
2905
- !w.isBackground && /* @__PURE__ */ x(Le, { children: [
2905
+ !b.isBackground && /* @__PURE__ */ w(Le, { children: [
2906
2906
  /* @__PURE__ */ u(Fe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: vo, children: "Rename" }),
2907
2907
  /* @__PURE__ */ u(
2908
2908
  Fe,
@@ -2913,13 +2913,13 @@ function _n({
2913
2913
  size: "sm",
2914
2914
  className: "w-full justify-start text-destructive hover:bg-destructive/10 hover:text-destructive",
2915
2915
  onClick: () => {
2916
- Y(w.node), M(null);
2916
+ G(b.node), D(null);
2917
2917
  },
2918
2918
  children: "Delete"
2919
2919
  }
2920
2920
  ),
2921
2921
  /* @__PURE__ */ u(Fe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: wo, children: "Copy path" }),
2922
- R != null && R.enabled ? /* @__PURE__ */ u(Fe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: xo, children: "Copy Git URL" }) : R != null && R.reason ? /* @__PURE__ */ u("div", { className: "px-2 py-1 text-xs text-muted-foreground", "aria-live": "polite", children: R.reason }) : null
2922
+ T != null && T.enabled ? /* @__PURE__ */ u(Fe, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: xo, children: "Copy Git URL" }) : T != null && T.reason ? /* @__PURE__ */ u("div", { className: "px-2 py-1 text-xs text-muted-foreground", "aria-live": "polite", children: T.reason }) : null
2923
2923
  ] })
2924
2924
  ]
2925
2925
  }
@@ -2933,20 +2933,20 @@ function _n({
2933
2933
  /* @__PURE__ */ u(
2934
2934
  Ho,
2935
2935
  {
2936
- open: E !== null,
2937
- onOpenChange: (b) => {
2938
- b || Y(null);
2936
+ open: S !== null,
2937
+ onOpenChange: (y) => {
2938
+ y || G(null);
2939
2939
  },
2940
- children: /* @__PURE__ */ x(Go, { children: [
2941
- /* @__PURE__ */ x(Vo, { children: [
2942
- /* @__PURE__ */ x(Ko, { children: [
2940
+ children: /* @__PURE__ */ w(Go, { children: [
2941
+ /* @__PURE__ */ w(Vo, { children: [
2942
+ /* @__PURE__ */ w(Ko, { children: [
2943
2943
  "Delete ",
2944
- E == null ? void 0 : E.name,
2944
+ S == null ? void 0 : S.name,
2945
2945
  "?"
2946
2946
  ] }),
2947
2947
  /* @__PURE__ */ u(Jo, { children: "This action cannot be undone." })
2948
2948
  ] }),
2949
- /* @__PURE__ */ x(Yo, { children: [
2949
+ /* @__PURE__ */ w(Yo, { children: [
2950
2950
  /* @__PURE__ */ u(Xo, { children: "Cancel" }),
2951
2951
  /* @__PURE__ */ u(Qo, { onClick: ko, children: "Delete" })
2952
2952
  ] })
@@ -2955,7 +2955,7 @@ function _n({
2955
2955
  )
2956
2956
  ] });
2957
2957
  }
2958
- function Na({
2958
+ function Ra({
2959
2959
  params: e,
2960
2960
  rootDir: t = ".",
2961
2961
  searchQuery: n,
@@ -2965,9 +2965,9 @@ function Na({
2965
2965
  chromeless: a = !1,
2966
2966
  className: c
2967
2967
  }) {
2968
- const s = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, l = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? i, [g, v] = j(""), [C, S] = j(""), D = L(void 0);
2969
- W(() => (clearTimeout(D.current), D.current = setTimeout(() => S(g), 200), () => clearTimeout(D.current)), [g]);
2970
- const I = p !== void 0 ? p || void 0 : C || void 0;
2968
+ const s = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, l = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? i, [g, v] = j(""), [E, k] = j(""), _ = $(void 0);
2969
+ z(() => (clearTimeout(_.current), _.current = setTimeout(() => k(g), 200), () => clearTimeout(_.current)), [g]);
2970
+ const I = p !== void 0 ? p || void 0 : E || void 0;
2971
2971
  return l ? /* @__PURE__ */ u(
2972
2972
  _n,
2973
2973
  {
@@ -2977,13 +2977,13 @@ function Na({
2977
2977
  revealFileTreeRequest: d,
2978
2978
  className: re("px-1 pt-1 [&_[role=treeitem]]:!indent-0", c)
2979
2979
  }
2980
- ) : /* @__PURE__ */ u(xa, { title: "Files", panelApi: m, children: /* @__PURE__ */ x("div", { className: "flex h-full flex-col", children: [
2980
+ ) : /* @__PURE__ */ u(xa, { title: "Files", panelApi: m, children: /* @__PURE__ */ w("div", { className: "flex h-full flex-col", children: [
2981
2981
  /* @__PURE__ */ u("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ u(
2982
2982
  dr,
2983
2983
  {
2984
2984
  placeholder: "Search files...",
2985
2985
  value: p ?? g,
2986
- onChange: (F) => v(F.target.value),
2986
+ onChange: (L) => v(L.target.value),
2987
2987
  className: "h-7 text-xs",
2988
2988
  "aria-label": "Search files"
2989
2989
  }
@@ -3003,17 +3003,17 @@ function Na({
3003
3003
  function Ta(e) {
3004
3004
  return e.split("/").pop() ?? e;
3005
3005
  }
3006
- function Ra() {
3007
- return W(() => {
3008
- const e = K.on(te.moved, ({ from: n, to: r, ...o }) => {
3009
- K.emit(ve.panelUpdate, {
3006
+ function Na() {
3007
+ return z(() => {
3008
+ const e = J.on(te.moved, ({ from: n, to: r, ...o }) => {
3009
+ J.emit(ve.panelUpdate, {
3010
3010
  ...o,
3011
3011
  match: [{ id: `file:${n}` }, { param: "path", value: n }],
3012
3012
  params: { path: r },
3013
3013
  title: Ta(r)
3014
3014
  });
3015
- }), t = K.on(te.deleted, ({ path: n, ...r }) => {
3016
- K.emit(ve.panelClose, {
3015
+ }), t = J.on(te.deleted, ({ path: n, ...r }) => {
3016
+ J.emit(ve.panelClose, {
3017
3017
  ...r,
3018
3018
  match: [
3019
3019
  { id: `file:${n}` },
@@ -3049,27 +3049,27 @@ function _a(e) {
3049
3049
  const n = ls(t.toolCallId);
3050
3050
  switch (t.op) {
3051
3051
  case "rename":
3052
- t.oldPath && K.emit(te.moved, {
3052
+ t.oldPath && J.emit(te.moved, {
3053
3053
  ...n,
3054
3054
  from: t.oldPath,
3055
3055
  to: t.path
3056
3056
  });
3057
3057
  return;
3058
3058
  case "unlink":
3059
- K.emit(te.deleted, { ...n, path: t.path });
3059
+ J.emit(te.deleted, { ...n, path: t.path });
3060
3060
  return;
3061
3061
  case "mkdir":
3062
- K.emit(te.created, { ...n, path: t.path, kind: "dir" });
3062
+ J.emit(te.created, { ...n, path: t.path, kind: "dir" });
3063
3063
  return;
3064
3064
  case "write":
3065
- t.existsBefore === !1 ? K.emit(te.created, {
3065
+ t.existsBefore === !1 ? J.emit(te.created, {
3066
3066
  ...n,
3067
3067
  path: t.path,
3068
3068
  kind: "file"
3069
- }) : K.emit(te.changed, { ...n, path: t.path });
3069
+ }) : J.emit(te.changed, { ...n, path: t.path });
3070
3070
  return;
3071
3071
  case "edit":
3072
- K.emit(te.changed, { ...n, path: t.path });
3072
+ J.emit(te.changed, { ...n, path: t.path });
3073
3073
  return;
3074
3074
  }
3075
3075
  }
@@ -3079,11 +3079,11 @@ function Fa(e, t = {}) {
3079
3079
  o.cause === "agent" && (r && o.kind !== "file" || n != null && n(o.path) || e(o.path));
3080
3080
  });
3081
3081
  }
3082
- function Wu(e) {
3083
- return K.on(te.changed, e);
3082
+ function Bu(e) {
3083
+ return J.on(te.changed, e);
3084
3084
  }
3085
3085
  function La() {
3086
- return W(() => K.on(ve.agentData, ({ part: e }) => {
3086
+ return z(() => J.on(ve.agentData, ({ part: e }) => {
3087
3087
  _a(e);
3088
3088
  }), []), Fa((e) => {
3089
3089
  xr({ kind: "openFile", params: { path: e } });
@@ -3091,19 +3091,19 @@ function La() {
3091
3091
  }
3092
3092
  const $a = 250, Oa = 3e3, Ma = 3e4;
3093
3093
  function Wa(e, t) {
3094
- const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, c] = j(!1), [s, f] = j(!1), [l, d] = j(null), [p, m] = j(!1), [g, v] = j(!1), C = L(void 0), S = L(null), D = L(0), I = L(null), F = L(0), O = L(void 0), h = L(o);
3094
+ const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, c] = j(!1), [s, f] = j(!1), [l, d] = j(null), [p, m] = j(!1), [g, v] = j(!1), E = $(void 0), k = $(null), _ = $(0), I = $(null), L = $(0), M = $(void 0), h = $(o);
3095
3095
  h.current = o;
3096
- const k = L(n);
3097
- k.current = n;
3098
- const y = T(async () => {
3099
- const U = k.current;
3096
+ const x = $(n);
3097
+ x.current = n;
3098
+ const C = N(async () => {
3099
+ const U = x.current;
3100
3100
  if (!U || !e || !U.isDirty()) return;
3101
- if (S.current) return S.current;
3102
- const ee = F.current;
3103
- let J = null;
3104
- return J = (async () => {
3101
+ if (k.current) return k.current;
3102
+ const ee = L.current;
3103
+ let Y = null;
3104
+ return Y = (async () => {
3105
3105
  var ye;
3106
- f(!0), K.emit(ve.editorSaveStart, { panelId: r });
3106
+ f(!0), J.emit(ve.editorSaveStart, { panelId: r });
3107
3107
  let le;
3108
3108
  const Se = new Promise((ge) => {
3109
3109
  le = setTimeout(() => ge("timeout"), Ma);
@@ -3113,63 +3113,63 @@ function Wa(e, t) {
3113
3113
  U.save().then(() => "saved"),
3114
3114
  Se
3115
3115
  ]);
3116
- if (F.current !== ee) return;
3117
- ge === "saved" && (D.current = Date.now(), d(Date.now()), c(!1), (ye = h.current) == null || ye.call(h, e, !1));
3116
+ if (L.current !== ee) return;
3117
+ ge === "saved" && (_.current = Date.now(), d(Date.now()), c(!1), (ye = h.current) == null || ye.call(h, e, !1));
3118
3118
  } catch {
3119
- if (F.current !== ee) return;
3119
+ if (L.current !== ee) return;
3120
3120
  } finally {
3121
- if (le && clearTimeout(le), S.current === J && (S.current = null), F.current !== ee) return;
3122
- K.emit(ve.editorSaveEnd, { panelId: r }), f(!1);
3121
+ if (le && clearTimeout(le), k.current === Y && (k.current = null), L.current !== ee) return;
3122
+ J.emit(ve.editorSaveEnd, { panelId: r }), f(!1);
3123
3123
  }
3124
- })(), S.current = J, J;
3125
- }, [e, r]), w = T(() => {
3126
- clearTimeout(C.current), C.current = setTimeout(y, $a);
3127
- }, [y]), M = T(() => {
3124
+ })(), k.current = Y, Y;
3125
+ }, [e, r]), b = N(() => {
3126
+ clearTimeout(E.current), E.current = setTimeout(C, $a);
3127
+ }, [C]), D = N(() => {
3128
3128
  var U;
3129
- e && (c(!0), (U = h.current) == null || U.call(h, e, !0), w());
3130
- }, [e, w]), B = T(() => {
3129
+ e && (c(!0), (U = h.current) == null || U.call(h, e, !0), b());
3130
+ }, [e, b]), B = N(() => {
3131
3131
  var U;
3132
- clearTimeout(C.current), c(!1), v(!1), e && ((U = h.current) == null || U.call(h, e, !1));
3133
- }, [e]), R = T(async () => {
3132
+ clearTimeout(E.current), c(!1), v(!1), e && ((U = h.current) == null || U.call(h, e, !1));
3133
+ }, [e]), T = N(async () => {
3134
3134
  var U;
3135
- if (clearTimeout(C.current), S.current) return S.current;
3136
- if ((U = k.current) != null && U.isDirty())
3137
- return y();
3138
- }, [y]), E = T(() => m(!1), []), Y = T(() => v(!1), []), z = T((U) => {
3135
+ if (clearTimeout(E.current), k.current) return k.current;
3136
+ if ((U = x.current) != null && U.isDirty())
3137
+ return C();
3138
+ }, [C]), S = N(() => m(!1), []), G = N(() => v(!1), []), W = N((U) => {
3139
3139
  I.current = U, v(!1);
3140
3140
  }, []);
3141
- return W(() => {
3141
+ return z(() => {
3142
3142
  if (!(i == null || !e)) {
3143
3143
  if (I.current === null) {
3144
3144
  I.current = i;
3145
3145
  return;
3146
3146
  }
3147
3147
  if (i !== I.current) {
3148
- if (Date.now() - D.current < Oa) {
3148
+ if (Date.now() - _.current < Oa) {
3149
3149
  I.current = i;
3150
3150
  return;
3151
3151
  }
3152
3152
  I.current = i, a ? v(!0) : m(!0);
3153
3153
  }
3154
3154
  }
3155
- }, [i, e, a]), W(() => {
3156
- if (O.current === void 0) {
3157
- O.current = e;
3155
+ }, [i, e, a]), z(() => {
3156
+ if (M.current === void 0) {
3157
+ M.current = e;
3158
3158
  return;
3159
3159
  }
3160
- O.current !== e && (O.current = e, F.current += 1, clearTimeout(C.current), S.current && K.emit(ve.editorSaveEnd, { panelId: r }), S.current = null, I.current = null, D.current = 0, c(!1), f(!1), m(!1), v(!1));
3161
- }, [e]), W(() => () => clearTimeout(C.current), []), {
3160
+ M.current !== e && (M.current = e, L.current += 1, clearTimeout(E.current), k.current && J.emit(ve.editorSaveEnd, { panelId: r }), k.current = null, I.current = null, _.current = 0, c(!1), f(!1), m(!1), v(!1));
3161
+ }, [e]), z(() => () => clearTimeout(E.current), []), {
3162
3162
  isDirty: a,
3163
3163
  isSaving: s,
3164
3164
  lastSavedAt: l,
3165
- markDirty: M,
3165
+ markDirty: D,
3166
3166
  markClean: B,
3167
- flushSave: R,
3167
+ flushSave: T,
3168
3168
  shouldSync: p,
3169
- ackSync: E,
3169
+ ackSync: S,
3170
3170
  externalChangeWhileDirty: g,
3171
- ackExternalChange: Y,
3172
- notifySaved: z
3171
+ ackExternalChange: G,
3172
+ notifySaved: W
3173
3173
  };
3174
3174
  }
3175
3175
  function za(e, t) {
@@ -3182,8 +3182,8 @@ function ja(e) {
3182
3182
  return e instanceof HTMLElement ? e.isContentEditable || e.closest("[contenteditable='true'], [contenteditable=''], [contenteditable='plaintext-only']") || e.closest("[role='textbox'], [role='searchbox'], [role='combobox']") ? !0 : !!e.closest("input, textarea, select") : !1;
3183
3183
  }
3184
3184
  function jr({ shortcuts: e, enabled: t = !0 }) {
3185
- const n = L(e);
3186
- n.current = e, W(() => {
3185
+ const n = $(e);
3186
+ n.current = e, z(() => {
3187
3187
  if (!t) return;
3188
3188
  function r(o) {
3189
3189
  const i = ja(o.target);
@@ -3196,7 +3196,7 @@ function jr({ shortcuts: e, enabled: t = !0 }) {
3196
3196
  return document.addEventListener("keydown", r, !0), () => document.removeEventListener("keydown", r, !0);
3197
3197
  }, [t]);
3198
3198
  }
3199
- function zu(e) {
3199
+ function Uu(e) {
3200
3200
  const t = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.userAgent), n = [];
3201
3201
  e.mod && n.push(t ? "⌘" : "Ctrl"), e.shift && n.push(t ? "⇧" : "Shift");
3202
3202
  const r = { "\\": "\\", p: "P", b: "B", s: "S", w: "W" };
@@ -3204,11 +3204,11 @@ function zu(e) {
3204
3204
  }
3205
3205
  let Ba = 0;
3206
3206
  function Br(e) {
3207
- const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = L(n ?? `file-pane:${Ba++}`), a = n ?? i.current, { data: c, isLoading: s, error: f, refetch: l } = Bs(o), { mutateAsync: d } = Dr(), [p, m] = j(r), g = L(""), v = L(!1), C = L(null), S = L(null), D = L(null), I = L(0), [F, O] = j(null);
3208
- W(() => {
3209
- C.current !== t && (m(r), g.current = r ?? "", v.current = !1, S.current = null, I.current += 1, O(null), C.current = t);
3210
- }, [t, r]), W(() => {
3211
- (c == null ? void 0 : c.content) != null && p === null && (m(c.content), g.current = c.content, S.current = c.mtimeMs ?? null);
3207
+ const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = $(n ?? `file-pane:${Ba++}`), a = n ?? i.current, { data: c, isLoading: s, error: f, refetch: l } = Bs(o), { mutateAsync: d } = Dr(), [p, m] = j(r), g = $(""), v = $(!1), E = $(null), k = $(null), _ = $(null), I = $(0), [L, M] = j(null);
3208
+ z(() => {
3209
+ E.current !== t && (m(r), g.current = r ?? "", v.current = !1, k.current = null, I.current += 1, M(null), E.current = t);
3210
+ }, [t, r]), z(() => {
3211
+ (c == null ? void 0 : c.content) != null && p === null && (m(c.content), g.current = c.content, k.current = c.mtimeMs ?? null);
3212
3212
  }, [c, p]);
3213
3213
  const h = o && p != null ? {
3214
3214
  isDirty: () => v.current,
@@ -3216,76 +3216,76 @@ function Br(e) {
3216
3216
  var ee;
3217
3217
  const U = ++I.current;
3218
3218
  try {
3219
- const J = await d({
3219
+ const Y = await d({
3220
3220
  path: o,
3221
3221
  content: g.current,
3222
- expectedMtimeMs: S.current ?? void 0
3222
+ expectedMtimeMs: k.current ?? void 0
3223
3223
  });
3224
3224
  if (I.current !== U) return;
3225
- typeof J.mtimeMs == "number" && (S.current = J.mtimeMs, (ee = D.current) == null || ee.call(D, J.mtimeMs)), v.current = !1, O(null);
3226
- } catch (J) {
3227
- throw I.current !== U || J instanceof dt && (typeof J.currentMtimeMs == "number" && (S.current = J.currentMtimeMs), O(J)), J;
3225
+ typeof Y.mtimeMs == "number" && (k.current = Y.mtimeMs, (ee = _.current) == null || ee.call(_, Y.mtimeMs)), v.current = !1, M(null);
3226
+ } catch (Y) {
3227
+ throw I.current !== U || Y instanceof dt && (typeof Y.currentMtimeMs == "number" && (k.current = Y.currentMtimeMs), M(Y)), Y;
3228
3228
  }
3229
3229
  },
3230
3230
  getContent: () => g.current
3231
- } : null, k = Wa(o, {
3231
+ } : null, x = Wa(o, {
3232
3232
  adapter: h,
3233
3233
  panelId: a,
3234
3234
  serverMtime: (c == null ? void 0 : c.mtimeMs) ?? null
3235
3235
  });
3236
- D.current = k.notifySaved, W(() => {
3237
- if (!(!k.shouldSync || (c == null ? void 0 : c.content) == null)) {
3236
+ _.current = x.notifySaved, z(() => {
3237
+ if (!(!x.shouldSync || (c == null ? void 0 : c.content) == null)) {
3238
3238
  if (v.current) {
3239
- k.ackSync();
3239
+ x.ackSync();
3240
3240
  return;
3241
3241
  }
3242
- m(c.content), g.current = c.content, S.current = c.mtimeMs ?? null, v.current = !1, k.ackSync();
3242
+ m(c.content), g.current = c.content, k.current = c.mtimeMs ?? null, v.current = !1, x.ackSync();
3243
3243
  }
3244
- }, [k.shouldSync, k, c, m]), W(() => {
3245
- !k.externalChangeWhileDirty || (c == null ? void 0 : c.mtimeMs) == null || (O(new dt(o ?? t, c.mtimeMs, S.current)), S.current = c.mtimeMs, k.ackExternalChange());
3246
- }, [o, k.externalChangeWhileDirty, k, c, t]);
3247
- const y = o ? o.split("/").pop() ?? o : "", [w, M] = j("");
3248
- W(() => {
3249
- const U = y ? k.isDirty ? `${y} ●` : y : "";
3250
- M(U);
3251
- }, [y, k.isDirty]);
3252
- const B = T((U) => {
3253
- m(U), g.current = U, v.current = !0, k.markDirty();
3254
- }, [m, k]), R = T(async () => {
3255
- var J;
3244
+ }, [x.shouldSync, x, c, m]), z(() => {
3245
+ !x.externalChangeWhileDirty || (c == null ? void 0 : c.mtimeMs) == null || (M(new dt(o ?? t, c.mtimeMs, k.current)), k.current = c.mtimeMs, x.ackExternalChange());
3246
+ }, [o, x.externalChangeWhileDirty, x, c, t]);
3247
+ const C = o ? o.split("/").pop() ?? o : "", [b, D] = j("");
3248
+ z(() => {
3249
+ const U = C ? x.isDirty ? `${C} ●` : C : "";
3250
+ D(U);
3251
+ }, [C, x.isDirty]);
3252
+ const B = N((U) => {
3253
+ m(U), g.current = U, v.current = !0, x.markDirty();
3254
+ }, [m, x]), T = N(async () => {
3255
+ var Y;
3256
3256
  if (!o) return;
3257
3257
  const U = await l();
3258
3258
  if (U.status !== "success" || U.data == null) return;
3259
3259
  const ee = U.data;
3260
- m(ee.content), g.current = ee.content, S.current = ee.mtimeMs ?? null, v.current = !1, k.markClean(), typeof ee.mtimeMs == "number" && ((J = D.current) == null || J.call(D, ee.mtimeMs)), O(null);
3261
- }, [o, k, l, m]), E = T(async () => {
3260
+ m(ee.content), g.current = ee.content, k.current = ee.mtimeMs ?? null, v.current = !1, x.markClean(), typeof ee.mtimeMs == "number" && ((Y = _.current) == null || Y.call(_, ee.mtimeMs)), M(null);
3261
+ }, [o, x, l, m]), S = N(async () => {
3262
3262
  var ee;
3263
3263
  const U = ++I.current;
3264
3264
  try {
3265
3265
  if (!o) return;
3266
- const J = g.current, le = await d({ path: o, content: J });
3266
+ const Y = g.current, le = await d({ path: o, content: Y });
3267
3267
  if (I.current !== U) return;
3268
- typeof le.mtimeMs == "number" && (S.current = le.mtimeMs, (ee = D.current) == null || ee.call(D, le.mtimeMs)), v.current = !1, O(null);
3268
+ typeof le.mtimeMs == "number" && (k.current = le.mtimeMs, (ee = _.current) == null || ee.call(_, le.mtimeMs)), v.current = !1, M(null);
3269
3269
  } catch {
3270
3270
  }
3271
- }, [o, d]), Y = T(async () => {
3271
+ }, [o, d]), G = N(async () => {
3272
3272
  !h || !v.current || await h.save();
3273
- }, [h]), z = T(async () => {
3274
- await k.flushSave();
3275
- }, [k]);
3273
+ }, [h]), W = N(async () => {
3274
+ await x.flushSave();
3275
+ }, [x]);
3276
3276
  return {
3277
3277
  isLoading: s,
3278
3278
  error: f,
3279
3279
  content: p,
3280
- isDirty: k.isDirty,
3281
- conflict: F,
3282
- onReloadFromServer: R,
3283
- onOverwrite: E,
3280
+ isDirty: x.isDirty,
3281
+ conflict: L,
3282
+ onReloadFromServer: T,
3283
+ onOverwrite: S,
3284
3284
  setContent: B,
3285
- save: Y,
3286
- flushSave: z,
3287
- fileName: y,
3288
- tabTitle: w
3285
+ save: G,
3286
+ flushSave: W,
3287
+ fileName: C,
3288
+ tabTitle: b
3289
3289
  };
3290
3290
  }
3291
3291
  function Ua({ conflict: e, onReload: t, onOverwrite: n }) {
@@ -3296,7 +3296,7 @@ function Ua({ conflict: e, onReload: t, onOverwrite: n }) {
3296
3296
  tone: "accent",
3297
3297
  className: "rounded-none border-x-0 border-t-0",
3298
3298
  description: /* @__PURE__ */ u(Le, { children: "This file has been modified outside the editor. Your unsaved changes will be lost if you reload, or will overwrite the latest version on disk if you save." }),
3299
- actions: /* @__PURE__ */ x(Le, { children: [
3299
+ actions: /* @__PURE__ */ w(Le, { children: [
3300
3300
  /* @__PURE__ */ u(Fe, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
3301
3301
  /* @__PURE__ */ u(
3302
3302
  Fe,
@@ -3332,11 +3332,11 @@ function Ur({
3332
3332
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(fr, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
3333
3333
  if (r)
3334
3334
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load file", description: d ?? r.message }) });
3335
- const m = l ?? /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3335
+ const m = l ?? /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3336
3336
  /* @__PURE__ */ u(At, { className: "size-3.5" }),
3337
3337
  /* @__PURE__ */ u("span", { children: "Loading file..." })
3338
3338
  ] });
3339
- return /* @__PURE__ */ x("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
3339
+ return /* @__PURE__ */ w("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
3340
3340
  o && /* @__PURE__ */ u(
3341
3341
  Ua,
3342
3342
  {
@@ -3414,7 +3414,7 @@ function Fn({ params: e, api: t, className: n }) {
3414
3414
  );
3415
3415
  }
3416
3416
  const Ga = pt(
3417
- () => import("./MarkdownEditor-DPFwqtbH.js").then((e) => ({ default: e.MarkdownEditor }))
3417
+ () => import("./MarkdownEditor-DhVfKSAq.js").then((e) => ({ default: e.MarkdownEditor }))
3418
3418
  );
3419
3419
  function Va({ params: e, api: t, className: n }) {
3420
3420
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
@@ -3450,34 +3450,34 @@ function tt(e) {
3450
3450
  return e.split("/").pop() ?? e;
3451
3451
  }
3452
3452
  function Ja({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3453
- const i = Ye(), a = Xe(), [c, s] = j(null), [f, l] = j(null), [d, p] = j(!0), m = V(() => {
3453
+ const i = Ye(), a = Xe(), [c, s] = j(null), [f, l] = j(null), [d, p] = j(!0), m = K(() => {
3454
3454
  const g = new URLSearchParams({ path: e });
3455
3455
  return n > 0 && g.set("reload", String(n)), Ka(i, `/api/v1/files/raw?${g.toString()}`);
3456
3456
  }, [i, e, n]);
3457
- return W(() => {
3457
+ return z(() => {
3458
3458
  const g = new AbortController();
3459
3459
  let v = null;
3460
3460
  p(!0), l(null), s(null);
3461
- const C = {};
3462
- return a && (C["x-boring-workspace-id"] = a), fetch(m, {
3461
+ const E = {};
3462
+ return a && (E["x-boring-workspace-id"] = a), fetch(m, {
3463
3463
  credentials: "include",
3464
- headers: C,
3464
+ headers: E,
3465
3465
  signal: g.signal
3466
- }).then(async (S) => {
3467
- if (!S.ok) throw new Error(`HTTP ${S.status}`);
3468
- const D = await S.blob();
3469
- v = URL.createObjectURL(D), s(v);
3470
- }).catch((S) => {
3471
- g.signal.aborted || l(S instanceof Error ? S.message : "Failed to load preview");
3466
+ }).then(async (k) => {
3467
+ if (!k.ok) throw new Error(`HTTP ${k.status}`);
3468
+ const _ = await k.blob();
3469
+ v = URL.createObjectURL(_), s(v);
3470
+ }).catch((k) => {
3471
+ g.signal.aborted || l(k instanceof Error ? k.message : "Failed to load preview");
3472
3472
  }).finally(() => {
3473
3473
  g.signal.aborted || p(!1);
3474
3474
  }), () => {
3475
3475
  g.abort(), v && URL.revokeObjectURL(v);
3476
3476
  };
3477
- }, [m, a]), e ? /* @__PURE__ */ x("div", { className: re("flex h-full min-h-0 flex-col bg-background", o), children: [
3478
- /* @__PURE__ */ x("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3477
+ }, [m, a]), e ? /* @__PURE__ */ w("div", { className: re("flex h-full min-h-0 flex-col bg-background", o), children: [
3478
+ /* @__PURE__ */ w("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3479
3479
  /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: tt(e) }),
3480
- /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
3480
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-1", children: [
3481
3481
  /* @__PURE__ */ u(
3482
3482
  "button",
3483
3483
  {
@@ -3503,7 +3503,7 @@ function Ja({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3503
3503
  ) : null
3504
3504
  ] })
3505
3505
  ] }),
3506
- /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3506
+ /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */ w("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3507
3507
  /* @__PURE__ */ u(At, { className: "size-3.5" }),
3508
3508
  /* @__PURE__ */ u("span", { children: "Loading preview..." })
3509
3509
  ] }) : f || !c ? /* @__PURE__ */ u(rt, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) : t === "image" ? /* @__PURE__ */ u(
@@ -3524,16 +3524,16 @@ function Ja({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3524
3524
  ] }) : /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "No file selected", description: "Choose an image or PDF from the file tree." }) });
3525
3525
  }
3526
3526
  function Ya({ path: e }) {
3527
- const [t, n] = j(0), r = T(() => {
3527
+ const [t, n] = j(0), r = N(() => {
3528
3528
  n((o) => o + 1);
3529
3529
  }, []);
3530
- return W(() => {
3530
+ return z(() => {
3531
3531
  if (!e) return;
3532
- const o = K.on(te.changed, (c) => {
3532
+ const o = J.on(te.changed, (c) => {
3533
3533
  c.path === e && r();
3534
- }), i = K.on(te.created, (c) => {
3534
+ }), i = J.on(te.created, (c) => {
3535
3535
  c.kind === "file" && c.path === e && r();
3536
- }), a = K.on(te.moved, (c) => {
3536
+ }), a = J.on(te.moved, (c) => {
3537
3537
  c.to === e && r();
3538
3538
  });
3539
3539
  return () => {
@@ -3669,35 +3669,35 @@ async function rc(e) {
3669
3669
  ${c.documentElement.outerHTML}`;
3670
3670
  }
3671
3671
  function oc({ path: e, className: t }) {
3672
- const n = Ye(), r = Xe(), [o, i] = j(null), [a, c] = j(null), [s, f] = j(!0), l = V(
3672
+ const n = Ye(), r = Xe(), [o, i] = j(null), [a, c] = j(null), [s, f] = j(!0), l = K(
3673
3673
  () => mn(n, e, r),
3674
3674
  [n, e, r]
3675
- ), [d, p] = j(0), m = T(() => {
3675
+ ), [d, p] = j(0), m = N(() => {
3676
3676
  p((g) => g + 1);
3677
3677
  }, []);
3678
- return W(() => {
3678
+ return z(() => {
3679
3679
  const g = new AbortController();
3680
3680
  f(!0), c(null), i(null);
3681
3681
  const v = {};
3682
- return r && (v["x-boring-workspace-id"] = r), Gr(l, v, g.signal).then(async (C) => {
3682
+ return r && (v["x-boring-workspace-id"] = r), Gr(l, v, g.signal).then(async (E) => {
3683
3683
  i(await rc({
3684
- html: C,
3684
+ html: E,
3685
3685
  path: e,
3686
3686
  apiBaseUrl: n,
3687
3687
  headers: v,
3688
3688
  workspaceRequestId: r,
3689
3689
  signal: g.signal
3690
3690
  }));
3691
- }).catch((C) => {
3692
- g.signal.aborted || c(C instanceof Error ? C.message : "Failed to load HTML preview");
3691
+ }).catch((E) => {
3692
+ g.signal.aborted || c(E instanceof Error ? E.message : "Failed to load HTML preview");
3693
3693
  }).finally(() => {
3694
3694
  g.signal.aborted || f(!1);
3695
3695
  }), () => g.abort();
3696
- }, [n, e, l, r, d]), e ? s ? /* @__PURE__ */ x("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3696
+ }, [n, e, l, r, d]), e ? s ? /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3697
3697
  /* @__PURE__ */ u(At, { className: "size-3.5" }),
3698
3698
  /* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
3699
- ] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */ x("div", { className: re("flex h-full min-h-0 flex-col bg-background", t), children: [
3700
- /* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
3699
+ ] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(rt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */ w("div", { className: re("flex h-full min-h-0 flex-col bg-background", t), children: [
3700
+ /* @__PURE__ */ u("div", { className: "flex shrink-0 items-center justify-end gap-3 border-b border-border/60 px-3 py-2", children: /* @__PURE__ */ w("div", { className: "flex items-center gap-1", children: [
3701
3701
  /* @__PURE__ */ u(
3702
3702
  pe,
3703
3703
  {
@@ -3917,13 +3917,13 @@ function hc({
3917
3917
  );
3918
3918
  }
3919
3919
  function mc() {
3920
- return W(() => {
3920
+ return z(() => {
3921
3921
  Ca();
3922
3922
  }, []), Ar("."), null;
3923
3923
  }
3924
3924
  function gc() {
3925
3925
  const e = $e(), t = $t();
3926
- return W(() => {
3926
+ return z(() => {
3927
3927
  const n = t.get(kt);
3928
3928
  if (n && n.pluginId !== xt) return;
3929
3929
  const r = pc({
@@ -3949,7 +3949,7 @@ const vc = (e) => {
3949
3949
  id: en,
3950
3950
  title: "Files",
3951
3951
  panelId: en,
3952
- component: Na,
3952
+ component: Ra,
3953
3953
  source: "builtin",
3954
3954
  icon: Fo
3955
3955
  }), e.registerPanel({
@@ -4006,7 +4006,7 @@ const vc = (e) => {
4006
4006
  component: gc
4007
4007
  }), e.registerBinding({
4008
4008
  id: "filesystem-file-panel",
4009
- component: Ra
4009
+ component: Na
4010
4010
  }), e.registerBinding({
4011
4011
  id: "filesystem-agent-file-bridge",
4012
4012
  component: La
@@ -4091,9 +4091,9 @@ function Te({
4091
4091
  side: n = "top",
4092
4092
  children: r
4093
4093
  }) {
4094
- return /* @__PURE__ */ u(Zo, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */ x(ei, { children: [
4094
+ return /* @__PURE__ */ u(Zo, { delayDuration: 0, skipDelayDuration: 300, children: /* @__PURE__ */ w(ei, { children: [
4095
4095
  /* @__PURE__ */ u(ti, { asChild: !0, children: r }),
4096
- /* @__PURE__ */ x(ni, { side: n, children: [
4096
+ /* @__PURE__ */ w(ni, { side: n, children: [
4097
4097
  e,
4098
4098
  t ? /* @__PURE__ */ u("span", { className: "ml-1.5 opacity-60", children: t }) : null
4099
4099
  ] })
@@ -4103,16 +4103,16 @@ const Vr = me(null), Kr = me("dock");
4103
4103
  function bc({ basePath: e, children: t }) {
4104
4104
  return /* @__PURE__ */ u(Vr.Provider, { value: e ?? null, children: t });
4105
4105
  }
4106
- function ju({ mode: e, children: t }) {
4106
+ function qu({ mode: e, children: t }) {
4107
4107
  return /* @__PURE__ */ u(Kr.Provider, { value: e, children: t });
4108
4108
  }
4109
4109
  function wc({ componentId: e, params: t, basePath: n }) {
4110
4110
  const r = new URLSearchParams({ component: e });
4111
4111
  return t && Object.keys(t).length > 0 && r.set("params", JSON.stringify(t)), `${n}?${r.toString()}`;
4112
4112
  }
4113
- function Bu(e) {
4113
+ function Hu(e) {
4114
4114
  const t = ue(Vr);
4115
- return V(() => t ? wc({
4115
+ return K(() => t ? wc({
4116
4116
  componentId: e.componentId,
4117
4117
  params: e.params,
4118
4118
  basePath: t
@@ -4121,7 +4121,7 @@ function Bu(e) {
4121
4121
  function xc() {
4122
4122
  return ue(Kr);
4123
4123
  }
4124
- function Uu() {
4124
+ function Gu() {
4125
4125
  return xc() === "full-page";
4126
4126
  }
4127
4127
  const kc = Z.string().max(64).regex(/^[a-zA-Z0-9_-]+$/), St = Z.string().max(1024), Sc = Z.number().nonnegative(), Pc = Z.object({
@@ -4136,14 +4136,14 @@ const kc = Z.string().max(64).regex(/^[a-zA-Z0-9_-]+$/), St = Z.string().max(102
4136
4136
  id: St,
4137
4137
  contentComponent: St.optional(),
4138
4138
  title: St.optional()
4139
- }).passthrough(), Nc = Z.object({
4139
+ }).passthrough(), Rc = Z.object({
4140
4140
  grid: Ec,
4141
4141
  panels: Z.record(St, Ic)
4142
4142
  }).passthrough().nullable(), Tc = Z.object({
4143
- layout: Nc,
4143
+ layout: Rc,
4144
4144
  sidebar: Pc,
4145
4145
  panelSizes: Cc
4146
- }), Rc = Z.object({
4146
+ }), Nc = Z.object({
4147
4147
  theme: Z.enum(["light", "dark"])
4148
4148
  });
4149
4149
  function Ac(e) {
@@ -4151,7 +4151,7 @@ function Ac(e) {
4151
4151
  return t.success ? t.data : (console.error("Layout validation failed:", t.error.issues), null);
4152
4152
  }
4153
4153
  function Dc(e) {
4154
- const t = Rc.safeParse(e);
4154
+ const t = Nc.safeParse(e);
4155
4155
  return t.success ? t.data : (console.error("Preferences validation failed:", t.error.issues), null);
4156
4156
  }
4157
4157
  const Wn = 1e5, zn = "2.0";
@@ -4390,14 +4390,14 @@ function Oc({
4390
4390
  searchQuery: r,
4391
4391
  close: o
4392
4392
  }) {
4393
- const i = V(() => n || r ? [] : Lc(gn(), e, t), [n, r, e, t]), a = T((f, l) => {
4393
+ const i = K(() => n || r ? [] : Lc(gn(), e, t), [n, r, e, t]), a = N((f, l) => {
4394
4394
  qn(f.id, l), f.onSelect(l), o();
4395
- }, [o]), c = T(
4395
+ }, [o]), c = N(
4396
4396
  (f) => {
4397
4397
  Hn(f.id, f.title), f.run(), o();
4398
4398
  },
4399
4399
  [o]
4400
- ), s = T((f) => {
4400
+ ), s = N((f) => {
4401
4401
  if (f.type === "catalog") {
4402
4402
  const l = e.find((d) => d.id === f.catalogId);
4403
4403
  l && (qn(l.id, f.rowSnapshot), l.onSelect(f.rowSnapshot));
@@ -4421,33 +4421,33 @@ function Mc({
4421
4421
  setMode: r,
4422
4422
  setQuery: o
4423
4423
  }) {
4424
- const i = L(null), a = L(null), c = L(!1);
4425
- W(() => {
4424
+ const i = $(null), a = $(null), c = $(!1);
4425
+ z(() => {
4426
4426
  if (!e) return;
4427
4427
  const p = (g) => {
4428
4428
  g.key === "Escape" && (g.preventDefault(), g.stopPropagation(), t(!1));
4429
4429
  }, m = (g) => {
4430
4430
  const v = g.target;
4431
4431
  if (!v) return;
4432
- const C = document.querySelector('[data-slot="dialog-content"]');
4433
- C && !C.contains(v) && (g.preventDefault(), g.stopPropagation(), t(!1));
4432
+ const E = document.querySelector('[data-slot="dialog-content"]');
4433
+ E && !E.contains(v) && (g.preventDefault(), g.stopPropagation(), t(!1));
4434
4434
  };
4435
4435
  return window.addEventListener("keydown", p, { capture: !0 }), window.addEventListener("pointerdown", m, { capture: !0 }), () => {
4436
4436
  window.removeEventListener("keydown", p, { capture: !0 }), window.removeEventListener("pointerdown", m, { capture: !0 });
4437
4437
  };
4438
4438
  }, [e, t]);
4439
- const s = T(() => {
4439
+ const s = N(() => {
4440
4440
  !e && document.activeElement instanceof HTMLElement && (a.current = document.activeElement), t(!0);
4441
4441
  }, [e, t]);
4442
4442
  jr({
4443
- shortcuts: V(
4443
+ shortcuts: K(
4444
4444
  () => [
4445
4445
  { key: "k", mod: !0, allowInEditable: !0, handler: s },
4446
4446
  { key: "p", mod: !0, allowInEditable: !0, handler: s }
4447
4447
  ],
4448
4448
  [s]
4449
4449
  )
4450
- }), W(() => {
4450
+ }), z(() => {
4451
4451
  if (e)
4452
4452
  o(""), r("catalogs"), requestAnimationFrame(() => {
4453
4453
  var p;
@@ -4459,14 +4459,14 @@ function Mc({
4459
4459
  }
4460
4460
  c.current = e;
4461
4461
  }, [e, r, o]);
4462
- const f = T((p) => {
4462
+ const f = N((p) => {
4463
4463
  r(p), o((m) => m.replace(/^>\s*/, "")), requestAnimationFrame(() => {
4464
4464
  var m;
4465
4465
  return (m = i.current) == null ? void 0 : m.focus();
4466
4466
  });
4467
- }, [r, o]), l = T(() => {
4467
+ }, [r, o]), l = N(() => {
4468
4468
  f(n === "commands" ? "catalogs" : "commands");
4469
- }, [n, f]), d = T((p) => {
4469
+ }, [n, f]), d = N((p) => {
4470
4470
  p.key === "Tab" && (p.preventDefault(), p.stopPropagation(), l());
4471
4471
  }, [l]);
4472
4472
  return {
@@ -4481,14 +4481,14 @@ function Wc({
4481
4481
  searchQuery: n
4482
4482
  }) {
4483
4483
  const [r, o] = j(""), [i, a] = j([]);
4484
- return W(() => {
4484
+ return z(() => {
4485
4485
  if (t) {
4486
4486
  o("");
4487
4487
  return;
4488
4488
  }
4489
4489
  const c = setTimeout(() => o(n), 180);
4490
4490
  return () => clearTimeout(c);
4491
- }, [t, n]), W(() => {
4491
+ }, [t, n]), z(() => {
4492
4492
  if (t || !r) {
4493
4493
  a([]);
4494
4494
  return;
@@ -4549,31 +4549,31 @@ function Wc({
4549
4549
  }, [e, r, t]), i;
4550
4550
  }
4551
4551
  function zc(e) {
4552
- const [t, n] = j(!1), [r, o] = j(""), [i, a] = j("catalogs"), c = _i(), s = Di(), f = au(), l = V(() => {
4553
- const k = {};
4554
- for (const y of (f == null ? void 0 : f.registeredPlugins) ?? [])
4555
- y.label && (k[y.id] = y.label);
4556
- return k;
4552
+ const [t, n] = j(!1), [r, o] = j(""), [i, a] = j("catalogs"), c = _i(), s = Di(), f = uu(), l = K(() => {
4553
+ const x = {};
4554
+ for (const C of (f == null ? void 0 : f.registeredPlugins) ?? [])
4555
+ C.label && (x[C.id] = C.label);
4556
+ return x;
4557
4557
  }, [f == null ? void 0 : f.registeredPlugins]), d = i === "commands", p = r.trim(), m = Wc({
4558
4558
  catalogs: c,
4559
4559
  isCommandMode: d,
4560
4560
  searchQuery: p
4561
- }), { inputRef: g, switchMode: v, handleInputKeyDown: C } = Mc({
4561
+ }), { inputRef: g, switchMode: v, handleInputKeyDown: E } = Mc({
4562
4562
  open: t,
4563
4563
  setOpen: n,
4564
4564
  mode: i,
4565
4565
  setMode: a,
4566
4566
  setQuery: o
4567
- }), S = T((k) => {
4568
- if (k.startsWith(">")) {
4569
- a("commands"), o(k.slice(1));
4567
+ }), k = N((x) => {
4568
+ if (x.startsWith(">")) {
4569
+ a("commands"), o(x.slice(1));
4570
4570
  return;
4571
4571
  }
4572
- o(k);
4573
- }, []), D = V(() => d ? Fc(s, p) : [], [s, d, p]), {
4572
+ o(x);
4573
+ }, []), _ = K(() => d ? Fc(s, p) : [], [s, d, p]), {
4574
4574
  recentEntries: I,
4575
- handleCatalogSelect: F,
4576
- handleCommandSelect: O,
4575
+ handleCatalogSelect: L,
4576
+ handleCommandSelect: M,
4577
4577
  handleRecentSelect: h
4578
4578
  } = Oc({
4579
4579
  catalogs: c,
@@ -4582,7 +4582,7 @@ function zc(e) {
4582
4582
  searchQuery: p,
4583
4583
  close: () => n(!1)
4584
4584
  });
4585
- return /* @__PURE__ */ u(ri, { open: t, onOpenChange: n, children: /* @__PURE__ */ x(
4585
+ return /* @__PURE__ */ u(ri, { open: t, onOpenChange: n, children: /* @__PURE__ */ w(
4586
4586
  oi,
4587
4587
  {
4588
4588
  className: "cmdk-shell flex flex-col gap-0 overflow-hidden border-border/60 p-0 shadow-2xl backdrop-blur-md [&>button.dialog-close]:hidden",
@@ -4591,24 +4591,24 @@ function zc(e) {
4591
4591
  onPointerDownOutside: () => n(!1),
4592
4592
  onEscapeKeyDown: () => n(!1),
4593
4593
  children: [
4594
- /* @__PURE__ */ x(ii, { className: "sr-only", children: [
4594
+ /* @__PURE__ */ w(ii, { className: "sr-only", children: [
4595
4595
  /* @__PURE__ */ u(si, { children: "Command Palette" }),
4596
4596
  /* @__PURE__ */ u(ai, { children: "Search catalogs or switch to commands" })
4597
4597
  ] }),
4598
- /* @__PURE__ */ x(ci, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4598
+ /* @__PURE__ */ w(ci, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4599
4599
  /* @__PURE__ */ u(
4600
4600
  jc,
4601
4601
  {
4602
4602
  inputRef: g,
4603
4603
  isCommandMode: d,
4604
4604
  query: r,
4605
- onQueryChange: S,
4606
- onInputKeyDown: C,
4605
+ onQueryChange: k,
4606
+ onInputKeyDown: E,
4607
4607
  onSwitchMode: v,
4608
- loading: !d && m.some((k) => k.loading)
4608
+ loading: !d && m.some((x) => x.loading)
4609
4609
  }
4610
4610
  ),
4611
- /* @__PURE__ */ x(
4611
+ /* @__PURE__ */ w(
4612
4612
  li,
4613
4613
  {
4614
4614
  className: "min-h-0 flex-1 overflow-y-auto py-1",
@@ -4629,16 +4629,16 @@ function zc(e) {
4629
4629
  {
4630
4630
  catalogGroups: m,
4631
4631
  isCommandMode: d,
4632
- onCatalogSelect: F
4632
+ onCatalogSelect: L
4633
4633
  }
4634
4634
  ),
4635
4635
  /* @__PURE__ */ u(
4636
4636
  Hc,
4637
4637
  {
4638
- commandResults: D,
4638
+ commandResults: _,
4639
4639
  isCommandMode: d,
4640
4640
  pluginLabelMap: l,
4641
- onCommandSelect: O
4641
+ onCommandSelect: M
4642
4642
  }
4643
4643
  )
4644
4644
  ]
@@ -4659,9 +4659,9 @@ function jc({
4659
4659
  onSwitchMode: i,
4660
4660
  loading: a
4661
4661
  }) {
4662
- return /* @__PURE__ */ x("div", { className: "relative shrink-0", children: [
4663
- /* @__PURE__ */ x("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
4664
- /* @__PURE__ */ x(
4662
+ return /* @__PURE__ */ w("div", { className: "relative shrink-0", children: [
4663
+ /* @__PURE__ */ w("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
4664
+ /* @__PURE__ */ w(
4665
4665
  "div",
4666
4666
  {
4667
4667
  role: "group",
@@ -4672,7 +4672,7 @@ function jc({
4672
4672
  Gn,
4673
4673
  {
4674
4674
  active: !t,
4675
- icon: /* @__PURE__ */ u(Rt, { className: "size-3" }),
4675
+ icon: /* @__PURE__ */ u(Nt, { className: "size-3" }),
4676
4676
  label: Yr,
4677
4677
  onClick: () => i("catalogs")
4678
4678
  }
@@ -4724,10 +4724,10 @@ function Bc({
4724
4724
  value: i,
4725
4725
  onSelect: () => r(o),
4726
4726
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
4727
- children: o.type === "catalog" ? /* @__PURE__ */ x(Le, { children: [
4727
+ children: o.type === "catalog" ? /* @__PURE__ */ w(Le, { children: [
4728
4728
  /* @__PURE__ */ u(Lo, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4729
4729
  /* @__PURE__ */ u(to, { row: o.rowSnapshot })
4730
- ] }) : /* @__PURE__ */ x(Le, { children: [
4730
+ ] }) : /* @__PURE__ */ w(Le, { children: [
4731
4731
  /* @__PURE__ */ u(an, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4732
4732
  /* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
4733
4733
  /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
@@ -4742,7 +4742,7 @@ function Uc({
4742
4742
  isCommandMode: t,
4743
4743
  onCatalogSelect: n
4744
4744
  }) {
4745
- return t ? null : /* @__PURE__ */ u(Le, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ x(cn, { heading: r.catalog.label, children: [
4745
+ return t ? null : /* @__PURE__ */ u(Le, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ w(cn, { heading: r.catalog.label, children: [
4746
4746
  r.error ? /* @__PURE__ */ u(qc, { catalogId: r.catalog.id, error: r.error }) : null,
4747
4747
  r.rows.map((o) => /* @__PURE__ */ u(
4748
4748
  Dt,
@@ -4750,14 +4750,14 @@ function Uc({
4750
4750
  value: `${r.catalog.id}:${o.id}`,
4751
4751
  onSelect: () => n(r.catalog, o),
4752
4752
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
4753
- children: /* @__PURE__ */ x(
4753
+ children: /* @__PURE__ */ w(
4754
4754
  Ot,
4755
4755
  {
4756
4756
  pluginId: r.catalog.pluginId ?? r.catalog.id,
4757
4757
  contributionKind: "catalog-row",
4758
4758
  contributionId: o.id,
4759
4759
  children: [
4760
- /* @__PURE__ */ u(Rt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4760
+ /* @__PURE__ */ u(Nt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4761
4761
  /* @__PURE__ */ u(to, { row: o })
4762
4762
  ]
4763
4763
  }
@@ -4768,14 +4768,14 @@ function Uc({
4768
4768
  ] }, r.catalog.id)) });
4769
4769
  }
4770
4770
  function qc({ catalogId: e, error: t }) {
4771
- return /* @__PURE__ */ x(
4771
+ return /* @__PURE__ */ w(
4772
4772
  Dt,
4773
4773
  {
4774
4774
  value: `${e}:error`,
4775
4775
  disabled: !0,
4776
4776
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm",
4777
4777
  children: [
4778
- /* @__PURE__ */ u(Rt, { className: "size-4 shrink-0 text-destructive/70" }),
4778
+ /* @__PURE__ */ u(Nt, { className: "size-4 shrink-0 text-destructive/70" }),
4779
4779
  /* @__PURE__ */ u("span", { className: "text-destructive", children: t })
4780
4780
  ]
4781
4781
  }
@@ -4787,7 +4787,7 @@ function Hc({
4787
4787
  pluginLabelMap: n,
4788
4788
  onCommandSelect: r
4789
4789
  }) {
4790
- return !t || e.length === 0 ? null : /* @__PURE__ */ u(cn, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ x(
4790
+ return !t || e.length === 0 ? null : /* @__PURE__ */ u(cn, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ w(
4791
4791
  Dt,
4792
4792
  {
4793
4793
  value: o.title,
@@ -4804,23 +4804,23 @@ function Hc({
4804
4804
  )) });
4805
4805
  }
4806
4806
  function Gc({ isCommandMode: e }) {
4807
- return /* @__PURE__ */ x("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
4807
+ return /* @__PURE__ */ w("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
4808
4808
  /* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : Yr }),
4809
- /* @__PURE__ */ x("div", { className: "flex items-center gap-3", children: [
4810
- /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4809
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-3", children: [
4810
+ /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4811
4811
  /* @__PURE__ */ u(nt, { children: "tab" }),
4812
4812
  /* @__PURE__ */ u("span", { children: "switch" })
4813
4813
  ] }),
4814
- /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4814
+ /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4815
4815
  /* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u($o, { className: "size-3" }) }),
4816
4816
  /* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Oo, { className: "size-3" }) }),
4817
4817
  /* @__PURE__ */ u("span", { children: "navigate" })
4818
4818
  ] }),
4819
- /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4819
+ /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4820
4820
  /* @__PURE__ */ u(nt, { children: /* @__PURE__ */ u(Mo, { className: "size-3" }) }),
4821
4821
  /* @__PURE__ */ u("span", { children: "open" })
4822
4822
  ] }),
4823
- /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
4823
+ /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4824
4824
  /* @__PURE__ */ u(nt, { children: "esc" }),
4825
4825
  /* @__PURE__ */ u("span", { children: "close" })
4826
4826
  ] })
@@ -4833,7 +4833,7 @@ function Gn({
4833
4833
  label: n,
4834
4834
  onClick: r
4835
4835
  }) {
4836
- return /* @__PURE__ */ x(
4836
+ return /* @__PURE__ */ w(
4837
4837
  Fe,
4838
4838
  {
4839
4839
  type: "button",
@@ -4853,13 +4853,13 @@ function Gn({
4853
4853
  );
4854
4854
  }
4855
4855
  function to({ row: e }) {
4856
- return /* @__PURE__ */ x("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4856
+ return /* @__PURE__ */ w("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4857
4857
  /* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: e.title }),
4858
4858
  e.subtitle ? /* @__PURE__ */ u("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
4859
4859
  e.meta ? /* @__PURE__ */ u("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
4860
4860
  ] });
4861
4861
  }
4862
- const qu = ["/api/v1/tree?path=."], Vc = /* @__PURE__ */ new Set([
4862
+ const Vu = ["/api/v1/tree?path=."], Vc = /* @__PURE__ */ new Set([
4863
4863
  "WORKSPACE_NOT_READY",
4864
4864
  "AGENT_RUNTIME_NOT_READY",
4865
4865
  "RUNTIME_PROVISIONING_LOCKED"
@@ -4869,10 +4869,10 @@ function Kc(e, t) {
4869
4869
  const n = e.replace(/\\/g, "/").replace(/\/+$/, ""), r = t.replace(/\\/g, "/").replace(/\/+$/, "");
4870
4870
  return n.startsWith("/") ? n === r ? "." : n.startsWith(`${r}/`) ? n.slice(r.length + 1) : e : e;
4871
4871
  }
4872
- function Hu(e, t) {
4872
+ function Ku(e, t) {
4873
4873
  return /^https?:\/\//i.test(t) || !e ? t : `${e.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
4874
4874
  }
4875
- function Gu(e, t) {
4875
+ function Ju(e, t) {
4876
4876
  const n = { ...t ?? {} };
4877
4877
  for (const r of Object.keys(n))
4878
4878
  r.toLowerCase() === "x-boring-workspace-id" && delete n[r];
@@ -4882,7 +4882,7 @@ function Jc(e) {
4882
4882
  const t = new URL(e, "http://workspace.local");
4883
4883
  return t.pathname !== "/api/v1/tree" ? null : t.searchParams.get("path") ?? ".";
4884
4884
  }
4885
- function Vu(e, t, n, r) {
4885
+ function Yu(e, t, n, r) {
4886
4886
  const o = Jc(n);
4887
4887
  o === null || !r || !Array.isArray(r.entries) || zs(e, t, o, r.entries);
4888
4888
  }
@@ -4897,7 +4897,7 @@ function Xc(e) {
4897
4897
  requirement: r.requirement ?? n.requirement
4898
4898
  };
4899
4899
  }
4900
- function Ku(e) {
4900
+ function Xu(e) {
4901
4901
  const t = Xc(e);
4902
4902
  if (typeof (t == null ? void 0 : t.code) != "string" || !Vc.has(t.code) || t.retryable !== !0) return null;
4903
4903
  const n = typeof t.requirement == "string" && Yc.has(t.requirement) ? t.requirement : void 0;
@@ -4907,14 +4907,14 @@ function Qc(e) {
4907
4907
  const t = new URL(e, "http://workspace.local");
4908
4908
  return t.pathname === "/api/v1/agent/pi-chat/sessions" || t.pathname === "/api/v1/ready-status";
4909
4909
  }
4910
- function Ju(e) {
4910
+ function Qu(e) {
4911
4911
  return new URL(e, "http://workspace.local").pathname === "/api/v1/ready-status";
4912
4912
  }
4913
- function Yu(e, t) {
4913
+ function Zu(e, t) {
4914
4914
  const n = t ? [...e, "/api/v1/ready-status"] : e.filter((r) => !Qc(r));
4915
4915
  return Array.from(new Set(n));
4916
4916
  }
4917
- function Xu(e) {
4917
+ function ed(e) {
4918
4918
  if (typeof e == "string") return e || null;
4919
4919
  if (!e || typeof e != "object") return null;
4920
4920
  const t = e;
@@ -4936,7 +4936,7 @@ function Vn(e) {
4936
4936
  runtimeDependenciesRequirement: typeof ((d = (l = t.capabilities) == null ? void 0 : l.runtimeDependencies) == null ? void 0 : d.requirement) == "string" ? t.capabilities.runtimeDependencies.requirement : void 0
4937
4937
  };
4938
4938
  }
4939
- function Qu(e) {
4939
+ function td(e) {
4940
4940
  if (e && typeof e == "object") return Vn(e);
4941
4941
  if (typeof e != "string" || !e.trim()) return null;
4942
4942
  const t = e.split(/\n\n+/);
@@ -4953,10 +4953,10 @@ function Qu(e) {
4953
4953
  }
4954
4954
  return null;
4955
4955
  }
4956
- function Zu(e) {
4956
+ function nd(e) {
4957
4957
  return e ? e.chatState || e.workspaceState ? e.chatState === "ready" && e.workspaceState === "ready" : e.state === "ready" : !0;
4958
4958
  }
4959
- async function ed(e) {
4959
+ async function rd(e) {
4960
4960
  const t = await e.text().catch(() => "");
4961
4961
  if (!t) return null;
4962
4962
  try {
@@ -4986,7 +4986,7 @@ function Zc(e) {
4986
4986
  };
4987
4987
  }
4988
4988
  function el(e) {
4989
- const t = cu(), { blockers: n } = ro(), {
4989
+ const t = du(), { blockers: n } = ro(), {
4990
4990
  getSurface: r,
4991
4991
  isWorkbenchOpen: o,
4992
4992
  openWorkbench: i,
@@ -4994,29 +4994,29 @@ function el(e) {
4994
4994
  closeWorkbench: c,
4995
4995
  bridgeEndpoint: s,
4996
4996
  ...f
4997
- } = e, l = L(null), d = Jn(s) ?? "", p = Kn(f.requestHeaders);
4998
- W(() => {
4997
+ } = e, l = $(null), d = Jn(s) ?? "", p = Kn(f.requestHeaders);
4998
+ z(() => {
4999
4999
  let I = !1;
5000
- const F = p ? { "x-boring-workspace-id": p } : {};
5001
- return fetch(`${d}/api/v1/workspace/meta`, { headers: F }).then((O) => O.ok ? O.json() : null).then((O) => {
5002
- I || O && typeof O.workspaceRoot == "string" && (l.current = O.workspaceRoot);
5000
+ const L = p ? { "x-boring-workspace-id": p } : {};
5001
+ return fetch(`${d}/api/v1/workspace/meta`, { headers: L }).then((M) => M.ok ? M.json() : null).then((M) => {
5002
+ I || M && typeof M.workspaceRoot == "string" && (l.current = M.workspaceRoot);
5003
5003
  }).catch(() => {
5004
5004
  }), () => {
5005
5005
  I = !0;
5006
5006
  };
5007
5007
  }, [d, p]);
5008
- const m = T(
5008
+ const m = N(
5009
5009
  (I) => {
5010
- var O;
5011
- const F = Kc(I, l.current);
5010
+ var M;
5011
+ const L = Kc(I, l.current);
5012
5012
  r && o && i && Qt(
5013
- { kind: "openFile", params: { path: F } },
5013
+ { kind: "openFile", params: { path: L } },
5014
5014
  { surface: r, isWorkbenchOpen: o, openWorkbench: i, openWorkbenchSources: a, closeWorkbench: c }
5015
- ), (O = e.onOpenArtifact) == null || O.call(e, F);
5015
+ ), (M = e.onOpenArtifact) == null || M.call(e, L);
5016
5016
  },
5017
5017
  [r, o, i, a, c, e.onOpenArtifact]
5018
5018
  ), g = Kn(f.requestHeaders), v = n.filter((I) => !I.sessionId || I.sessionId === f.sessionId);
5019
- W(() => {
5019
+ z(() => {
5020
5020
  if (!(s === null || !r || !o || !i))
5021
5021
  return ms({
5022
5022
  endpoint: Jn(s),
@@ -5030,25 +5030,25 @@ function el(e) {
5030
5030
  }
5031
5031
  });
5032
5032
  }, [s, r, o, i, a, c, g]);
5033
- const C = T(() => {
5033
+ const E = N(() => {
5034
5034
  var I;
5035
5035
  window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: f.sessionId } })), (I = e.onComposerStop) == null || I.call(e);
5036
- }, [f.sessionId, e.onComposerStop]), S = T(
5037
- (I, F) => {
5038
- if (F === "cancel") {
5036
+ }, [f.sessionId, e.onComposerStop]), k = N(
5037
+ (I, L) => {
5038
+ if (L === "cancel") {
5039
5039
  window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: f.sessionId } }));
5040
5040
  return;
5041
5041
  }
5042
- F !== "open" || !I.surfaceKind || r && o && i && Qt(
5042
+ L !== "open" || !I.surfaceKind || r && o && i && Qt(
5043
5043
  { kind: "openSurface", params: { kind: I.surfaceKind, target: I.target, meta: {} } },
5044
5044
  { surface: r, isWorkbenchOpen: o, openWorkbench: i, openWorkbenchSources: a, closeWorkbench: c }
5045
5045
  );
5046
5046
  },
5047
5047
  [f.sessionId, c, r, o, i, a]
5048
- ), D = T(
5048
+ ), _ = N(
5049
5049
  (I) => {
5050
- var F;
5051
- us(Zc(I)), (F = e.onData) == null || F.call(e, I);
5050
+ var L;
5051
+ us(Zc(I)), (L = e.onData) == null || L.call(e, I);
5052
5052
  },
5053
5053
  [e.onData]
5054
5054
  );
@@ -5058,10 +5058,10 @@ function el(e) {
5058
5058
  chrome: !1,
5059
5059
  ...f,
5060
5060
  onOpenArtifact: m,
5061
- onData: D,
5061
+ onData: _,
5062
5062
  composerBlockers: v,
5063
- onComposerStop: C,
5064
- onComposerBlockerAction: S
5063
+ onComposerStop: E,
5064
+ onComposerBlockerAction: k
5065
5065
  }
5066
5066
  );
5067
5067
  }
@@ -5087,11 +5087,11 @@ function ro() {
5087
5087
  return ue(no) ?? rl;
5088
5088
  }
5089
5089
  function ol({ children: e }) {
5090
- const [t, n] = j([]), r = T((a) => {
5090
+ const [t, n] = j([]), r = N((a) => {
5091
5091
  n((c) => [...c.filter((s) => s.id !== a.id), a]);
5092
- }, []), o = T((a) => {
5092
+ }, []), o = N((a) => {
5093
5093
  n((c) => c.filter((s) => s.id !== a));
5094
- }, []), i = V(
5094
+ }, []), i = K(
5095
5095
  () => ({ blockers: t, addBlocker: r, removeBlocker: o }),
5096
5096
  [t, r, o]
5097
5097
  );
@@ -5140,7 +5140,7 @@ function Yn(e, t, n) {
5140
5140
  (o = e.addPanel({
5141
5141
  id: t.id,
5142
5142
  component: oo,
5143
- title: Nt(t),
5143
+ title: Rt(t),
5144
5144
  params: { paneId: t.id },
5145
5145
  position: n
5146
5146
  }).group) == null || o.api.setConstraints({ minimumWidth: il });
@@ -5172,7 +5172,7 @@ function Xn(e, t, n, r) {
5172
5172
  });
5173
5173
  for (const a of t) {
5174
5174
  const c = e.getPanel(a.id);
5175
- c && c.title !== Nt(a) && c.api.setTitle(Nt(a));
5175
+ c && c.title !== Rt(a) && c.api.setTitle(Rt(a));
5176
5176
  }
5177
5177
  if (n) {
5178
5178
  const a = e.getPanel(n);
@@ -5189,73 +5189,73 @@ function ul({
5189
5189
  storageKey: a,
5190
5190
  onDropSession: c
5191
5191
  }) {
5192
- var C;
5193
- const s = L(null), f = L(!1), l = L(null), d = L(/* @__PURE__ */ new Map()), p = L({ panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: c, storageKey: a });
5192
+ var E;
5193
+ const s = $(null), f = $(!1), l = $(null), d = $(/* @__PURE__ */ new Map()), p = $({ panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: c, storageKey: a });
5194
5194
  p.current = { panes: e, activePaneId: t ?? null, onActivePaneChange: r, onDropSession: c, storageKey: a };
5195
- const m = t ?? ((C = e[0]) == null ? void 0 : C.id) ?? null, g = V(() => ({
5195
+ const m = t ?? ((E = e[0]) == null ? void 0 : E.id) ?? null, g = K(() => ({
5196
5196
  panes: e,
5197
5197
  activePaneId: m,
5198
5198
  flashPaneId: i ?? null,
5199
5199
  renderPane: n,
5200
5200
  onActivePaneChange: r,
5201
5201
  onClosePane: e.length > 1 ? o : void 0
5202
- }), [e, m, i, n, r, o]), v = T((S) => {
5203
- const D = S.api;
5204
- s.current = D;
5205
- const { panes: I, activePaneId: F, storageKey: O } = p.current;
5202
+ }), [e, m, i, n, r, o]), v = N((k) => {
5203
+ const _ = k.api;
5204
+ s.current = _;
5205
+ const { panes: I, activePaneId: L, storageKey: M } = p.current;
5206
5206
  f.current = !0;
5207
5207
  try {
5208
- const R = O ? cl(O, I.map((E) => E.id)) : null;
5209
- if (R)
5208
+ const T = M ? cl(M, I.map((S) => S.id)) : null;
5209
+ if (T)
5210
5210
  try {
5211
- D.fromJSON(R);
5211
+ _.fromJSON(T);
5212
5212
  } catch {
5213
5213
  }
5214
- Xn(D, I, F, d.current);
5214
+ Xn(_, I, L, d.current);
5215
5215
  } finally {
5216
5216
  f.current = !1;
5217
5217
  }
5218
- const h = D.onDidActivePanelChange((R) => {
5219
- var Y, z;
5218
+ const h = _.onDidActivePanelChange((T) => {
5219
+ var G, W;
5220
5220
  if (f.current) return;
5221
- const E = R == null ? void 0 : R.id;
5222
- E && E !== p.current.activePaneId && ((z = (Y = p.current).onActivePaneChange) == null || z.call(Y, E));
5223
- }), k = D.onWillShowOverlay((R) => {
5224
- if (R.kind === "tab" || R.kind === "header_space") {
5225
- R.preventDefault();
5221
+ const S = T == null ? void 0 : T.id;
5222
+ S && S !== p.current.activePaneId && ((W = (G = p.current).onActivePaneChange) == null || W.call(G, S));
5223
+ }), x = _.onWillShowOverlay((T) => {
5224
+ if (T.kind === "tab" || T.kind === "header_space") {
5225
+ T.preventDefault();
5226
5226
  return;
5227
5227
  }
5228
- R.kind === "content" && R.position === "center" && R.preventDefault();
5229
- }), y = D.onUnhandledDragOverEvent((R) => {
5230
- var Y;
5231
- const E = (Y = R.nativeEvent.dataTransfer) == null ? void 0 : Y.types;
5232
- E && Array.from(E).includes(on) && R.accept();
5233
- }), w = D.onDidDrop((R) => {
5234
- var Y, z, U, ee, J;
5235
- const E = (Y = R.nativeEvent.dataTransfer) == null ? void 0 : Y.getData(on);
5236
- E && (d.current.set(E, {
5237
- referencePanelId: ((U = (z = R.group) == null ? void 0 : z.activePanel) == null ? void 0 : U.id) ?? null,
5238
- direction: al(R.position)
5239
- }), (J = (ee = p.current).onDropSession) == null || J.call(ee, E));
5228
+ T.kind === "content" && T.position === "center" && T.preventDefault();
5229
+ }), C = _.onUnhandledDragOverEvent((T) => {
5230
+ var G;
5231
+ const S = (G = T.nativeEvent.dataTransfer) == null ? void 0 : G.types;
5232
+ S && Array.from(S).includes(on) && T.accept();
5233
+ }), b = _.onDidDrop((T) => {
5234
+ var G, W, U, ee, Y;
5235
+ const S = (G = T.nativeEvent.dataTransfer) == null ? void 0 : G.getData(on);
5236
+ S && (d.current.set(S, {
5237
+ referencePanelId: ((U = (W = T.group) == null ? void 0 : W.activePanel) == null ? void 0 : U.id) ?? null,
5238
+ direction: al(T.position)
5239
+ }), (Y = (ee = p.current).onDropSession) == null || Y.call(ee, S));
5240
5240
  });
5241
- let M = null;
5242
- const B = D.onDidLayoutChange(() => {
5243
- const R = p.current.storageKey;
5244
- R && (M && clearTimeout(M), M = setTimeout(() => ll(R, D.toJSON()), sl));
5241
+ let D = null;
5242
+ const B = _.onDidLayoutChange(() => {
5243
+ const T = p.current.storageKey;
5244
+ T && (D && clearTimeout(D), D = setTimeout(() => ll(T, _.toJSON()), sl));
5245
5245
  });
5246
5246
  l.current = () => {
5247
- M && clearTimeout(M), h.dispose(), k.dispose(), y.dispose(), w.dispose(), B.dispose();
5247
+ D && clearTimeout(D), h.dispose(), x.dispose(), C.dispose(), b.dispose(), B.dispose();
5248
5248
  };
5249
5249
  }, []);
5250
- return W(() => () => {
5251
- var S;
5252
- return (S = l.current) == null ? void 0 : S.call(l);
5253
- }, []), W(() => {
5254
- const S = s.current;
5255
- if (S) {
5250
+ return z(() => () => {
5251
+ var k;
5252
+ return (k = l.current) == null ? void 0 : k.call(l);
5253
+ }, []), z(() => {
5254
+ const k = s.current;
5255
+ if (k) {
5256
5256
  f.current = !0;
5257
5257
  try {
5258
- Xn(S, e, m, d.current);
5258
+ Xn(k, e, m, d.current);
5259
5259
  } finally {
5260
5260
  f.current = !1;
5261
5261
  }
@@ -5289,12 +5289,12 @@ function dl(e) {
5289
5289
  const t = ao(), n = typeof ((a = e.params) == null ? void 0 : a.paneId) == "string" ? e.params.paneId : e.api.id, r = t.panes.find((c) => c.id === n);
5290
5290
  if (!r) return null;
5291
5291
  const o = n === t.activePaneId, i = n === t.flashPaneId;
5292
- return /* @__PURE__ */ x(
5292
+ return /* @__PURE__ */ w(
5293
5293
  "div",
5294
5294
  {
5295
5295
  "data-boring-workspace-part": "chat-pane",
5296
5296
  "data-boring-state": o ? "active" : "inactive",
5297
- "aria-label": `Chat session ${Nt(r)}`,
5297
+ "aria-label": `Chat session ${Rt(r)}`,
5298
5298
  className: "relative flex h-full min-h-0 w-full flex-col overflow-hidden bg-background",
5299
5299
  onMouseDown: (c) => {
5300
5300
  var f;
@@ -5318,7 +5318,7 @@ const fl = {
5318
5318
  };
5319
5319
  function pl(e) {
5320
5320
  const t = ao(), { api: n } = e, [r, o] = j(n.title ?? n.id);
5321
- W(() => {
5321
+ z(() => {
5322
5322
  var f;
5323
5323
  const c = () => o(n.title ?? n.id);
5324
5324
  c();
@@ -5329,7 +5329,7 @@ function pl(e) {
5329
5329
  };
5330
5330
  }, [n]);
5331
5331
  const i = t.panes.length > 1, a = !!t.onClosePane;
5332
- return /* @__PURE__ */ x(
5332
+ return /* @__PURE__ */ w(
5333
5333
  "div",
5334
5334
  {
5335
5335
  className: re(
@@ -5370,10 +5370,10 @@ function pl(e) {
5370
5370
  }
5371
5371
  );
5372
5372
  }
5373
- function td(e) {
5373
+ function od(e) {
5374
5374
  return /* @__PURE__ */ u(ul, { ...e });
5375
5375
  }
5376
- function Nt(e) {
5376
+ function Rt(e) {
5377
5377
  return e.title || "Untitled";
5378
5378
  }
5379
5379
  const on = "application/x-boring-chat-session";
@@ -5395,7 +5395,7 @@ function hl({ dimmed: e, flash: t }) {
5395
5395
  const Qn = "boring:chat-session-status";
5396
5396
  function ml() {
5397
5397
  const [e, t] = j(() => /* @__PURE__ */ new Set());
5398
- return W(() => {
5398
+ return z(() => {
5399
5399
  const n = (r) => {
5400
5400
  const o = r.detail;
5401
5401
  if (typeof (o == null ? void 0 : o.sessionId) != "string") return;
@@ -5431,9 +5431,9 @@ function gl(e) {
5431
5431
  g >= n ? i.push(p) : g >= r ? a.push(p) : g >= o ? c.push(p) : s.push(p);
5432
5432
  }
5433
5433
  const l = (p, m) => {
5434
- var C, S;
5435
- const g = ((C = Pt(p.updatedAt)) == null ? void 0 : C.getTime()) ?? 0;
5436
- return (((S = Pt(m.updatedAt)) == null ? void 0 : S.getTime()) ?? 0) - g;
5434
+ var E, k;
5435
+ const g = ((E = Pt(p.updatedAt)) == null ? void 0 : E.getTime()) ?? 0;
5436
+ return (((k = Pt(m.updatedAt)) == null ? void 0 : k.getTime()) ?? 0) - g;
5437
5437
  }, d = [];
5438
5438
  return i.length && d.push({ key: "today", label: "Today", items: i.sort(l) }), a.length && d.push({ key: "yesterday", label: "Yesterday", items: a.sort(l) }), c.length && d.push({ key: "week", label: "This week", items: c.sort(l) }), s.length && d.push({ key: "earlier", label: "Earlier", items: s.sort(l) }), f.length && d.push({ key: "undated", label: "Other", items: f }), d;
5439
5439
  }
@@ -5469,24 +5469,24 @@ function yl({
5469
5469
  onClose: p,
5470
5470
  className: m
5471
5471
  }) {
5472
- const g = V(() => new Set(n ?? []), [n]), v = V(() => new Set(r ?? []), [r]), C = V(
5473
- () => (r ?? []).map((E) => e.find((Y) => Y.id === E)).filter((E) => !!E),
5472
+ const g = K(() => new Set(n ?? []), [n]), v = K(() => new Set(r ?? []), [r]), E = K(
5473
+ () => (r ?? []).map((S) => e.find((G) => G.id === S)).filter((S) => !!S),
5474
5474
  [r, e]
5475
- ), S = V(
5476
- () => (n ?? []).filter((E) => !v.has(E)).map((E) => e.find((Y) => Y.id === E)).filter((E) => !!E),
5475
+ ), k = K(
5476
+ () => (n ?? []).filter((S) => !v.has(S)).map((S) => e.find((G) => G.id === S)).filter((S) => !!S),
5477
5477
  [n, v, e]
5478
- ), D = V(
5479
- () => g.size > 0 || v.size > 0 ? e.filter((E) => !g.has(E.id) && !v.has(E.id)) : e,
5478
+ ), _ = K(
5479
+ () => g.size > 0 || v.size > 0 ? e.filter((S) => !g.has(S.id) && !v.has(S.id)) : e,
5480
5480
  [g, v, e]
5481
- ), I = V(() => gl(D), [D]), [F, O] = j(!1), [h, k] = j(!1), [y, w] = j(
5481
+ ), I = K(() => gl(_), [_]), [L, M] = j(!1), [h, x] = j(!1), [C, b] = j(
5482
5482
  () => ((n == null ? void 0 : n.length) ?? 0) > 0 || ((r == null ? void 0 : r.length) ?? 0) > 0
5483
- ), M = ml(), { blockers: B } = ro(), R = V(() => {
5484
- const E = /* @__PURE__ */ new Set();
5485
- for (const Y of B)
5486
- Y.reason === "waiting_for_user_input" && Y.sessionId && E.add(Y.sessionId);
5487
- return E;
5483
+ ), D = ml(), { blockers: B } = ro(), T = K(() => {
5484
+ const S = /* @__PURE__ */ new Set();
5485
+ for (const G of B)
5486
+ G.reason === "waiting_for_user_input" && G.sessionId && S.add(G.sessionId);
5487
+ return S;
5488
5488
  }, [B]);
5489
- return /* @__PURE__ */ x(
5489
+ return /* @__PURE__ */ w(
5490
5490
  "div",
5491
5491
  {
5492
5492
  "data-boring-workspace-part": "session-list",
@@ -5497,111 +5497,111 @@ function yl({
5497
5497
  role: "navigation",
5498
5498
  "aria-label": "Session history",
5499
5499
  children: [
5500
- /* @__PURE__ */ x("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
5500
+ /* @__PURE__ */ w("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
5501
5501
  /* @__PURE__ */ u("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
5502
- /* @__PURE__ */ x("div", { className: "flex items-center gap-0.5", children: [
5502
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-0.5", children: [
5503
5503
  c && /* @__PURE__ */ u(Te, { label: "New chat", side: "bottom", children: /* @__PURE__ */ u(pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: c, "aria-label": "New session", children: /* @__PURE__ */ u(zo, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }) }),
5504
5504
  p && /* @__PURE__ */ u(Te, { label: "Close sessions", hint: "⌘1", side: "bottom", children: /* @__PURE__ */ u(pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: p, "aria-label": "Close sessions", children: /* @__PURE__ */ u(jo, { className: "h-4 w-4", strokeWidth: 1.75 }) }) })
5505
5505
  ] })
5506
5506
  ] }),
5507
- /* @__PURE__ */ x("div", { className: "boring-scrollbar-discreet flex-1 overflow-y-auto py-2.5", children: [
5508
- e.length === 0 && /* @__PURE__ */ x("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
5507
+ /* @__PURE__ */ w("div", { className: "boring-scrollbar-discreet flex-1 overflow-y-auto py-2.5", children: [
5508
+ e.length === 0 && /* @__PURE__ */ w("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
5509
5509
  "No sessions yet.",
5510
5510
  /* @__PURE__ */ u("br", {}),
5511
5511
  "Start a new chat to begin."
5512
5512
  ] }),
5513
- C.length > 0 && /* @__PURE__ */ x("section", { "data-boring-workspace-part": "session-pinned-section", children: [
5513
+ E.length > 0 && /* @__PURE__ */ w("section", { "data-boring-workspace-part": "session-pinned-section", children: [
5514
5514
  /* @__PURE__ */ u(
5515
5515
  Gt,
5516
5516
  {
5517
5517
  label: "Pinned",
5518
- count: C.length,
5519
- collapsed: F,
5520
- onToggle: () => O((E) => !E)
5518
+ count: E.length,
5519
+ collapsed: L,
5520
+ onToggle: () => M((S) => !S)
5521
5521
  }
5522
5522
  ),
5523
- !F && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: C.map((E) => /* @__PURE__ */ u(
5523
+ !L && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: E.map((S) => /* @__PURE__ */ u(
5524
5524
  Vt,
5525
5525
  {
5526
- session: E,
5527
- active: E.id === t,
5528
- open: g.has(E.id),
5526
+ session: S,
5527
+ active: S.id === t,
5528
+ open: g.has(S.id),
5529
5529
  pinned: !0,
5530
- working: M.has(E.id),
5531
- needsInput: R.has(E.id),
5530
+ working: D.has(S.id),
5531
+ needsInput: T.has(S.id),
5532
5532
  onSwitch: i,
5533
5533
  onOpenAsTab: a,
5534
5534
  onTogglePin: o,
5535
5535
  onDelete: s
5536
5536
  },
5537
- E.id
5537
+ S.id
5538
5538
  )) })
5539
5539
  ] }),
5540
- S.length > 0 && /* @__PURE__ */ x("section", { "data-boring-workspace-part": "session-active-section", className: re(C.length > 0 && "mt-3"), children: [
5540
+ k.length > 0 && /* @__PURE__ */ w("section", { "data-boring-workspace-part": "session-active-section", className: re(E.length > 0 && "mt-3"), children: [
5541
5541
  /* @__PURE__ */ u(
5542
5542
  Gt,
5543
5543
  {
5544
5544
  label: "Active",
5545
- count: S.length,
5545
+ count: k.length,
5546
5546
  collapsed: h,
5547
- onToggle: () => k((E) => !E)
5547
+ onToggle: () => x((S) => !S)
5548
5548
  }
5549
5549
  ),
5550
- !h && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: S.map((E) => /* @__PURE__ */ u(
5550
+ !h && /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: k.map((S) => /* @__PURE__ */ u(
5551
5551
  Vt,
5552
5552
  {
5553
- session: E,
5554
- active: E.id === t,
5553
+ session: S,
5554
+ active: S.id === t,
5555
5555
  open: !0,
5556
- pinned: v.has(E.id),
5557
- working: M.has(E.id),
5558
- needsInput: R.has(E.id),
5556
+ pinned: v.has(S.id),
5557
+ working: D.has(S.id),
5558
+ needsInput: T.has(S.id),
5559
5559
  onSwitch: i,
5560
5560
  onOpenAsTab: a,
5561
5561
  onTogglePin: o,
5562
5562
  onDelete: s
5563
5563
  },
5564
- E.id
5564
+ S.id
5565
5565
  )) })
5566
5566
  ] }),
5567
- I.length > 0 && /* @__PURE__ */ x(
5567
+ I.length > 0 && /* @__PURE__ */ w(
5568
5568
  "section",
5569
5569
  {
5570
5570
  "data-boring-workspace-part": "session-history-section",
5571
- className: re(S.length > 0 && "mt-3"),
5571
+ className: re(k.length > 0 && "mt-3"),
5572
5572
  children: [
5573
5573
  /* @__PURE__ */ u(
5574
5574
  Gt,
5575
5575
  {
5576
5576
  label: "History",
5577
- count: D.length,
5578
- collapsed: y,
5579
- onToggle: () => w((E) => !E)
5577
+ count: _.length,
5578
+ collapsed: C,
5579
+ onToggle: () => b((S) => !S)
5580
5580
  }
5581
5581
  ),
5582
- !y && /* @__PURE__ */ x(Le, { children: [
5583
- I.map((E, Y) => /* @__PURE__ */ x("section", { className: re(Y > 0 && "mt-2"), children: [
5584
- /* @__PURE__ */ x("div", { className: "flex items-baseline justify-between gap-2 px-5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/60", children: [
5585
- /* @__PURE__ */ u("span", { children: E.label }),
5586
- /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: E.items.length })
5582
+ !C && /* @__PURE__ */ w(Le, { children: [
5583
+ I.map((S, G) => /* @__PURE__ */ w("section", { className: re(G > 0 && "mt-2"), children: [
5584
+ /* @__PURE__ */ w("div", { className: "flex items-baseline justify-between gap-2 px-5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/60", children: [
5585
+ /* @__PURE__ */ u("span", { children: S.label }),
5586
+ /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: S.items.length })
5587
5587
  ] }),
5588
- /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: E.items.map((z) => /* @__PURE__ */ u(
5588
+ /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: S.items.map((W) => /* @__PURE__ */ u(
5589
5589
  Vt,
5590
5590
  {
5591
- session: z,
5592
- active: z.id === t,
5591
+ session: W,
5592
+ active: W.id === t,
5593
5593
  open: !1,
5594
- pinned: v.has(z.id),
5595
- working: M.has(z.id),
5596
- needsInput: R.has(z.id),
5594
+ pinned: v.has(W.id),
5595
+ working: D.has(W.id),
5596
+ needsInput: T.has(W.id),
5597
5597
  onSwitch: i,
5598
5598
  onOpenAsTab: a,
5599
5599
  onTogglePin: o,
5600
5600
  onDelete: s
5601
5601
  },
5602
- z.id
5602
+ W.id
5603
5603
  )) })
5604
- ] }, E.key)),
5604
+ ] }, S.key)),
5605
5605
  l && f ? /* @__PURE__ */ u("div", { className: "px-3 py-3", children: /* @__PURE__ */ u(
5606
5606
  "button",
5607
5607
  {
@@ -5627,7 +5627,7 @@ function Gt({
5627
5627
  collapsed: n,
5628
5628
  onToggle: r
5629
5629
  }) {
5630
- return /* @__PURE__ */ x(
5630
+ return /* @__PURE__ */ w(
5631
5631
  "button",
5632
5632
  {
5633
5633
  type: "button",
@@ -5636,7 +5636,7 @@ function Gt({
5636
5636
  "data-boring-workspace-part": "session-section-toggle",
5637
5637
  className: "flex w-full items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75 transition-colors hover:text-foreground/80",
5638
5638
  children: [
5639
- /* @__PURE__ */ x("span", { className: "flex items-center gap-1", children: [
5639
+ /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
5640
5640
  /* @__PURE__ */ u(
5641
5641
  lr,
5642
5642
  {
@@ -5665,7 +5665,7 @@ function Vt({
5665
5665
  onDelete: f
5666
5666
  }) {
5667
5667
  const l = vl(e.updatedAt);
5668
- return /* @__PURE__ */ x(
5668
+ return /* @__PURE__ */ w(
5669
5669
  "li",
5670
5670
  {
5671
5671
  role: "listitem",
@@ -5693,7 +5693,7 @@ function Vt({
5693
5693
  )
5694
5694
  }
5695
5695
  ),
5696
- /* @__PURE__ */ x("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
5696
+ /* @__PURE__ */ w("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
5697
5697
  /* @__PURE__ */ u("span", { className: re(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }),
5698
5698
  l && /* @__PURE__ */ u(
5699
5699
  "span",
@@ -5706,7 +5706,7 @@ function Vt({
5706
5706
  }
5707
5707
  )
5708
5708
  ] }),
5709
- i ? /* @__PURE__ */ x(
5709
+ i ? /* @__PURE__ */ w(
5710
5710
  "span",
5711
5711
  {
5712
5712
  "data-boring-workspace-part": "session-badge",
@@ -5717,7 +5717,7 @@ function Vt({
5717
5717
  "needs input"
5718
5718
  ]
5719
5719
  }
5720
- ) : o ? /* @__PURE__ */ x(
5720
+ ) : o ? /* @__PURE__ */ w(
5721
5721
  "span",
5722
5722
  {
5723
5723
  "data-boring-workspace-part": "session-badge",
@@ -5816,19 +5816,19 @@ function co({
5816
5816
  onCollapse: i,
5817
5817
  className: a
5818
5818
  }) {
5819
- var E, Y;
5819
+ var S, G;
5820
5820
  const c = Lt(), s = ot(
5821
5821
  c.subscribe,
5822
5822
  c.getSnapshot,
5823
5823
  c.getSnapshot
5824
- ), f = V(
5825
- () => s.filter((z) => z.placement === "left-tab"),
5824
+ ), f = K(
5825
+ () => s.filter((W) => W.placement === "left-tab"),
5826
5826
  [s]
5827
- ), l = V(() => {
5828
- const z = [];
5827
+ ), l = K(() => {
5828
+ const W = [];
5829
5829
  for (const U of f) {
5830
5830
  const ee = U.icon;
5831
- z.push({
5831
+ W.push({
5832
5832
  id: U.id,
5833
5833
  title: U.title,
5834
5834
  // Icon-less plugins get an initial-letter glyph instead of a shared
@@ -5838,31 +5838,31 @@ function co({
5838
5838
  panel: U
5839
5839
  });
5840
5840
  }
5841
- return z;
5842
- }, [f]), [d, p] = j(n ?? ""), m = l.some((z) => z.id === d) ? d : ((E = l[0]) == null ? void 0 : E.id) ?? "", [g, v] = j(!1), [C, S] = j(""), [D, I] = j(""), F = L(null), O = L(void 0);
5843
- W(() => (clearTimeout(O.current), O.current = setTimeout(() => I(C), 180), () => clearTimeout(O.current)), [C]), W(() => {
5844
- var z;
5845
- g && ((z = F.current) == null || z.focus());
5846
- }, [g]), W(() => {
5847
- l.length > 0 && !l.some((z) => z.id === d) && p(l[0].id);
5848
- }, [d, l]), W(() => {
5849
- r && l.some((z) => z.id === tr) && p(tr);
5841
+ return W;
5842
+ }, [f]), [d, p] = j(n ?? ""), m = l.some((W) => W.id === d) ? d : ((S = l[0]) == null ? void 0 : S.id) ?? "", [g, v] = j(!1), [E, k] = j(""), [_, I] = j(""), L = $(null), M = $(void 0);
5843
+ z(() => (clearTimeout(M.current), M.current = setTimeout(() => I(E), 180), () => clearTimeout(M.current)), [E]), z(() => {
5844
+ var W;
5845
+ g && ((W = L.current) == null || W.focus());
5846
+ }, [g]), z(() => {
5847
+ l.length > 0 && !l.some((W) => W.id === d) && p(l[0].id);
5848
+ }, [d, l]), z(() => {
5849
+ r && l.some((W) => W.id === tr) && p(tr);
5850
5850
  }, [r, l]);
5851
- const h = T(() => {
5852
- v((z) => (z && S(""), !z));
5853
- }, []), k = T((z) => {
5854
- z.key === "Escape" && (z.preventDefault(), v(!1), S(""));
5855
- }, []), y = l.find((z) => z.id === m), M = !!!((Y = y == null ? void 0 : y.panel) != null && Y.chromeless), B = V(
5851
+ const h = N(() => {
5852
+ v((W) => (W && k(""), !W));
5853
+ }, []), x = N((W) => {
5854
+ W.key === "Escape" && (W.preventDefault(), v(!1), k(""));
5855
+ }, []), C = l.find((W) => W.id === m), D = !!!((G = C == null ? void 0 : C.panel) != null && G.chromeless), B = K(
5856
5856
  () => ({
5857
5857
  rootDir: e,
5858
5858
  bridge: t,
5859
- query: D,
5860
- searchQuery: D || void 0,
5859
+ query: _,
5860
+ searchQuery: _ || void 0,
5861
5861
  chromeless: !0,
5862
5862
  revealFileTreeRequest: r
5863
5863
  }),
5864
- [t, D, r, e]
5865
- ), R = /* @__PURE__ */ x(
5864
+ [t, _, r, e]
5865
+ ), T = /* @__PURE__ */ w(
5866
5866
  "nav",
5867
5867
  {
5868
5868
  className: "flex w-11 shrink-0 flex-col items-center gap-1 bg-muted/35 px-1.5 py-2",
@@ -5878,35 +5878,35 @@ function co({
5878
5878
  children: /* @__PURE__ */ u(Et, { className: "h-4 w-4", strokeWidth: 1.75 })
5879
5879
  }
5880
5880
  ) }),
5881
- l.map((z) => {
5882
- const U = z.id === m;
5883
- return /* @__PURE__ */ u(Te, { label: z.title, side: "right", children: /* @__PURE__ */ u(
5881
+ l.map((W) => {
5882
+ const U = W.id === m;
5883
+ return /* @__PURE__ */ u(Te, { label: W.title, side: "right", children: /* @__PURE__ */ u(
5884
5884
  "button",
5885
5885
  {
5886
5886
  type: "button",
5887
- "aria-label": z.title,
5887
+ "aria-label": W.title,
5888
5888
  "aria-pressed": U,
5889
- onClick: () => p(z.id),
5889
+ onClick: () => p(W.id),
5890
5890
  className: re(
5891
5891
  "relative flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
5892
5892
  U && "rounded-r-none bg-muted/35 text-foreground shadow-none hover:bg-muted/35 before:absolute before:-right-1.5 before:top-0 before:h-full before:w-1.5 before:bg-muted/35"
5893
5893
  ),
5894
- children: z.icon
5894
+ children: W.icon
5895
5895
  }
5896
- ) }, z.id);
5896
+ ) }, W.id);
5897
5897
  })
5898
5898
  ]
5899
5899
  }
5900
5900
  );
5901
- return /* @__PURE__ */ x("div", { "data-boring-workspace-part": "workbench-left", className: re("workbench-left-root flex h-full min-h-0", a), children: [
5902
- R,
5903
- /* @__PURE__ */ x("div", { className: "flex h-full min-w-0 flex-1 flex-col bg-muted/35", children: [
5904
- /* @__PURE__ */ x("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 bg-muted/35 px-2.5", children: [
5905
- /* @__PURE__ */ x("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
5906
- /* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children: y == null ? void 0 : y.icon }),
5907
- /* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (y == null ? void 0 : y.title) ?? "Sources" })
5901
+ return /* @__PURE__ */ w("div", { "data-boring-workspace-part": "workbench-left", className: re("workbench-left-root flex h-full min-h-0", a), children: [
5902
+ T,
5903
+ /* @__PURE__ */ w("div", { className: "flex h-full min-w-0 flex-1 flex-col bg-muted/35", children: [
5904
+ /* @__PURE__ */ w("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 bg-muted/35 px-2.5", children: [
5905
+ /* @__PURE__ */ w("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
5906
+ /* @__PURE__ */ u("span", { className: "shrink-0 text-foreground/80", children: C == null ? void 0 : C.icon }),
5907
+ /* @__PURE__ */ u("div", { className: "truncate text-[14px] font-medium tracking-tight text-foreground", children: (C == null ? void 0 : C.title) ?? "Sources" })
5908
5908
  ] }),
5909
- M && /* @__PURE__ */ u(Te, { label: "Search", side: "bottom", children: /* @__PURE__ */ u(
5909
+ D && /* @__PURE__ */ u(Te, { label: "Search", side: "bottom", children: /* @__PURE__ */ u(
5910
5910
  pe,
5911
5911
  {
5912
5912
  type: "button",
@@ -5919,33 +5919,33 @@ function co({
5919
5919
  }
5920
5920
  ) })
5921
5921
  ] }),
5922
- M && g && /* @__PURE__ */ x("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
5922
+ D && g && /* @__PURE__ */ w("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
5923
5923
  /* @__PURE__ */ u(xn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
5924
5924
  /* @__PURE__ */ u(
5925
5925
  dr,
5926
5926
  {
5927
- ref: F,
5927
+ ref: L,
5928
5928
  type: "text",
5929
- value: C,
5930
- onChange: (z) => S(z.target.value),
5931
- onKeyDown: k,
5932
- placeholder: `Search ${((y == null ? void 0 : y.title) ?? "sources").toLowerCase()}...`,
5929
+ value: E,
5930
+ onChange: (W) => k(W.target.value),
5931
+ onKeyDown: x,
5932
+ placeholder: `Search ${((C == null ? void 0 : C.title) ?? "sources").toLowerCase()}...`,
5933
5933
  className: "h-7 flex-1 border-0 bg-transparent px-0 py-0 text-xs shadow-none focus-visible:ring-0 dark:bg-transparent"
5934
5934
  }
5935
5935
  ),
5936
- C && /* @__PURE__ */ u(
5936
+ E && /* @__PURE__ */ u(
5937
5937
  pe,
5938
5938
  {
5939
5939
  type: "button",
5940
5940
  variant: "ghost",
5941
5941
  size: "icon-xs",
5942
- onClick: () => S(""),
5942
+ onClick: () => k(""),
5943
5943
  "aria-label": "Clear search",
5944
5944
  children: /* @__PURE__ */ u(sn, { className: "h-3 w-3" })
5945
5945
  }
5946
5946
  )
5947
5947
  ] }),
5948
- /* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(Cl, { panel: y == null ? void 0 : y.panel, params: B, onOpenPanel: o }) })
5948
+ /* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(Cl, { panel: C == null ? void 0 : C.panel, params: B, onOpenPanel: o }) })
5949
5949
  ] })
5950
5950
  ] });
5951
5951
  }
@@ -5978,9 +5978,9 @@ function Pl(e) {
5978
5978
  );
5979
5979
  }
5980
5980
  function Cl({ panel: e, params: t, onOpenPanel: n }) {
5981
- const r = V(() => e ? e.lazy ? pt(
5981
+ const r = K(() => e ? e.lazy ? pt(
5982
5982
  e.component
5983
- ) : e.component : null, [e]), o = V(() => Pl(n), [n]);
5983
+ ) : e.component : null, [e]), o = K(() => Pl(n), [n]);
5984
5984
  return !e || !r ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center px-4 text-center text-[12px] text-muted-foreground", children: "No workspace category registered." }) : /* @__PURE__ */ u(
5985
5985
  Ot,
5986
5986
  {
@@ -6011,11 +6011,11 @@ const Il = {
6011
6011
  component: El,
6012
6012
  placement: "left",
6013
6013
  source: "builtin"
6014
- }, Nl = "boring-ui-v2:surface", lo = 1, Tl = {
6014
+ }, Rl = "boring-ui-v2:surface", lo = 1, Tl = {
6015
6015
  version: "2.0",
6016
6016
  groups: [{ id: "artifacts", position: "center", dynamic: !0 }]
6017
6017
  };
6018
- function Rl(e, t) {
6018
+ function Nl(e, t) {
6019
6019
  if (typeof window > "u") return;
6020
6020
  let n;
6021
6021
  try {
@@ -6047,7 +6047,7 @@ function Rl(e, t) {
6047
6047
  }
6048
6048
  function uo({
6049
6049
  visible: e = !0,
6050
- storageKey: t = Nl,
6050
+ storageKey: t = Rl,
6051
6051
  allowedPanels: n,
6052
6052
  persistedLayout: r,
6053
6053
  onLayoutChange: o,
@@ -6057,10 +6057,10 @@ function uo({
6057
6057
  watermarkComponent: s,
6058
6058
  className: f
6059
6059
  }) {
6060
- const l = !!(o || r), d = (n == null ? void 0 : n.slice().sort().join("\0")) ?? "*", p = V(() => {
6060
+ const l = !!(o || r), d = (n == null ? void 0 : n.slice().sort().join("\0")) ?? "*", p = K(() => {
6061
6061
  if (!l)
6062
- return Rl(t, n ? new Set(n) : void 0);
6063
- }, [n, l, t]), m = T(
6062
+ return Nl(t, n ? new Set(n) : void 0);
6063
+ }, [n, l, t]), m = N(
6064
6064
  (g) => {
6065
6065
  if (o) {
6066
6066
  o(g);
@@ -6173,47 +6173,47 @@ function Dl({
6173
6173
  } catch {
6174
6174
  return t;
6175
6175
  }
6176
- }), C = L(null), S = L(null), D = L(null), [I, F] = j(null), [O, h] = j(null), k = L(i);
6177
- k.current = i;
6178
- const y = L(a);
6179
- y.current = a;
6180
- const w = L(c);
6181
- w.current = c;
6182
- const M = L(/* @__PURE__ */ new Set()), B = L(/* @__PURE__ */ new Set()), R = L(null), E = L(
6176
+ }), E = $(null), k = $(null), _ = $(null), [I, L] = j(null), [M, h] = j(null), x = $(i);
6177
+ x.current = i;
6178
+ const C = $(a);
6179
+ C.current = a;
6180
+ const b = $(c);
6181
+ b.current = c;
6182
+ const D = $(/* @__PURE__ */ new Set()), B = $(/* @__PURE__ */ new Set()), T = $(null), S = $(
6183
6183
  /* @__PURE__ */ new Map()
6184
- ), Y = Lt(), z = ot(
6185
- Y.subscribe,
6186
- Y.getSnapshot,
6187
- Y.getSnapshot
6188
- ), U = br(), ee = L(Y);
6189
- ee.current = Y;
6190
- const J = L(U);
6191
- J.current = U;
6192
- const le = V(() => {
6184
+ ), G = Lt(), W = ot(
6185
+ G.subscribe,
6186
+ G.getSnapshot,
6187
+ G.getSnapshot
6188
+ ), U = br(), ee = $(G);
6189
+ ee.current = G;
6190
+ const Y = $(U);
6191
+ Y.current = U;
6192
+ const le = K(() => {
6193
6193
  const P = /* @__PURE__ */ new Set();
6194
- for (const A of z)
6194
+ for (const A of W)
6195
6195
  A.placement === "center" && P.add(A.id);
6196
6196
  for (const A of s ?? [])
6197
6197
  P.add(A);
6198
6198
  return [...P];
6199
- }, [s, z]), Se = T((P) => {
6200
- const A = C.current;
6199
+ }, [s, W]), Se = N((P) => {
6200
+ const A = E.current;
6201
6201
  if (!A) {
6202
6202
  console.warn("[SurfaceShell] openFile: surface not ready (dockview not initialized)");
6203
6203
  return;
6204
6204
  }
6205
- const _ = Ct(P), q = {
6205
+ const F = Ct(P), q = {
6206
6206
  kind: Je,
6207
- target: _
6208
- }, ne = J.current.resolve(q);
6207
+ target: F
6208
+ }, ne = Y.current.resolve(q);
6209
6209
  if (ne) {
6210
6210
  if (!ee.current.has(ne.component)) {
6211
- console.warn(`[SurfaceShell] openFile: resolver returned unknown panel "${ne.component}" for "${_}"`);
6211
+ console.warn(`[SurfaceShell] openFile: resolver returned unknown panel "${ne.component}" for "${F}"`);
6212
6212
  return;
6213
6213
  }
6214
6214
  const he = Kt(q, ne);
6215
6215
  B.current.add(he);
6216
- const se = A.getPanel(he), xe = Jt(ne.params, _);
6216
+ const se = A.getPanel(he), xe = Jt(ne.params, F);
6217
6217
  if (se) {
6218
6218
  se.api.updateParameters(xe), se.api.setActive();
6219
6219
  return;
@@ -6221,32 +6221,32 @@ function Dl({
6221
6221
  A.addPanel({
6222
6222
  id: he,
6223
6223
  component: ne.component,
6224
- title: ne.title ?? _.split("/").pop() ?? _,
6224
+ title: ne.title ?? F.split("/").pop() ?? F,
6225
6225
  params: xe
6226
6226
  });
6227
6227
  return;
6228
6228
  }
6229
- const ae = nr(A, _);
6229
+ const ae = nr(A, F);
6230
6230
  if (ae) {
6231
6231
  ae.api.setActive();
6232
6232
  return;
6233
6233
  }
6234
- console.warn(`[SurfaceShell] openFile: no surface resolver matched "${_}"`);
6235
- }, []), ye = T((P) => {
6234
+ console.warn(`[SurfaceShell] openFile: no surface resolver matched "${F}"`);
6235
+ }, []), ye = N((P) => {
6236
6236
  var at;
6237
- const A = C.current;
6237
+ const A = E.current;
6238
6238
  if (!A) {
6239
6239
  console.warn("[SurfaceShell] openSurface: surface not ready (dockview not initialized)");
6240
6240
  return;
6241
6241
  }
6242
- const _ = Al(P), q = J.current.resolve(_);
6242
+ const F = Al(P), q = Y.current.resolve(F);
6243
6243
  if (!q) {
6244
- console.warn(`[SurfaceShell] openSurface: no resolver matched kind="${_.kind}" target="${_.target}"`);
6244
+ console.warn(`[SurfaceShell] openSurface: no resolver matched kind="${F.kind}" target="${F.target}"`);
6245
6245
  return;
6246
6246
  }
6247
- const ne = Kt(_, q);
6248
- _.kind === Je && B.current.add(ne);
6249
- const ae = A.getPanel(ne), he = ((at = _.meta) == null ? void 0 : at.closeWorkbenchOnDone) === !0, se = _.kind === Je ? Jt(q.params, _.target) : q.params, xe = he && w.current ? { ...se ?? {}, __closeWorkbenchOnDone: w.current } : se;
6247
+ const ne = Kt(F, q);
6248
+ F.kind === Je && B.current.add(ne);
6249
+ const ae = A.getPanel(ne), he = ((at = F.meta) == null ? void 0 : at.closeWorkbenchOnDone) === !0, se = F.kind === Je ? Jt(q.params, F.target) : q.params, xe = he && b.current ? { ...se ?? {}, __closeWorkbenchOnDone: b.current } : se;
6250
6250
  if (ae) {
6251
6251
  xe && ae.api.updateParameters(xe), ae.api.setActive();
6252
6252
  return;
@@ -6261,15 +6261,15 @@ function Dl({
6261
6261
  A.addPanel({
6262
6262
  id: ne,
6263
6263
  component: q.component,
6264
- title: q.title ?? _.target,
6264
+ title: q.title ?? F.target,
6265
6265
  params: xe
6266
6266
  });
6267
- }, []), ge = T((P) => {
6268
- const A = C.current;
6267
+ }, []), ge = N((P) => {
6268
+ const A = E.current;
6269
6269
  if (!A) return;
6270
- const _ = A.getPanel(P.id);
6271
- if (_) {
6272
- P.params && _.api.updateParameters(P.params), _.api.setActive();
6270
+ const F = A.getPanel(P.id);
6271
+ if (F) {
6272
+ P.params && F.api.updateParameters(P.params), F.api.setActive();
6273
6273
  return;
6274
6274
  }
6275
6275
  const q = ee.current;
@@ -6285,37 +6285,37 @@ function Dl({
6285
6285
  title: P.title ?? P.id,
6286
6286
  params: P.params
6287
6287
  });
6288
- }, []), be = T(() => {
6289
- var _;
6290
- const P = C.current;
6288
+ }, []), be = N(() => {
6289
+ var F;
6290
+ const P = E.current;
6291
6291
  return P ? { openTabs: P.panels.map((q) => ({
6292
6292
  id: q.id,
6293
6293
  title: q.title ?? q.id,
6294
6294
  params: q.params ?? void 0
6295
- })), activeTab: ((_ = P.activePanel) == null ? void 0 : _.id) ?? null } : { openTabs: [], activeTab: null };
6296
- }, []), Be = T((P, A) => {
6297
- const _ = E.current.get(P);
6298
- if (!_ || _.size === 0) return !1;
6299
- for (const q of [..._])
6295
+ })), activeTab: ((F = P.activePanel) == null ? void 0 : F.id) ?? null } : { openTabs: [], activeTab: null };
6296
+ }, []), Be = N((P, A) => {
6297
+ const F = S.current.get(P);
6298
+ if (!F || F.size === 0) return !1;
6299
+ for (const q of [...F])
6300
6300
  q(A);
6301
6301
  return !0;
6302
- }, []), Pe = T((P) => {
6302
+ }, []), Pe = N((P) => {
6303
6303
  const A = Ct(P);
6304
- R.current = A, h((_) => ({ path: A, seq: ((_ == null ? void 0 : _.seq) ?? 0) + 1 })), m(!1), Be("tree:expand", { path: A }) && (R.current = null);
6305
- }, [Be]), Qe = V(() => ({
6304
+ T.current = A, h((F) => ({ path: A, seq: ((F == null ? void 0 : F.seq) ?? 0) + 1 })), m(!1), Be("tree:expand", { path: A }) && (T.current = null);
6305
+ }, [Be]), Qe = K(() => ({
6306
6306
  openFile: Se,
6307
6307
  openSurface: ye,
6308
6308
  openPanel: ge,
6309
6309
  closeWorkbenchLeftPane: () => m(!0),
6310
6310
  expandToFile: Pe,
6311
6311
  getSnapshot: be
6312
- }), [Pe, be, Se, ge, ye]), Re = T(() => {
6312
+ }), [Pe, be, Se, ge, ye]), Ne = N(() => {
6313
6313
  var he;
6314
- const P = C.current, A = P ? P.panels.map((se) => ({
6314
+ const P = E.current, A = P ? P.panels.map((se) => ({
6315
6315
  id: se.id,
6316
6316
  component: String(se.component ?? ""),
6317
6317
  params: se.params ?? void 0
6318
- })) : [], _ = ((he = P == null ? void 0 : P.activePanel) == null ? void 0 : he.id) ?? null, q = B.current, ne = A.find((se) => se.id === _), ae = rr(ne, q);
6318
+ })) : [], F = ((he = P == null ? void 0 : P.activePanel) == null ? void 0 : he.id) ?? null, q = B.current, ne = A.find((se) => se.id === F), ae = rr(ne, q);
6319
6319
  return {
6320
6320
  hydrationComplete: !0,
6321
6321
  layout: null,
@@ -6323,38 +6323,38 @@ function Dl({
6323
6323
  panelSizes: {},
6324
6324
  preferences: { theme: "dark" },
6325
6325
  panels: A,
6326
- activePanel: _,
6326
+ activePanel: F,
6327
6327
  activeFile: ae,
6328
6328
  visibleFiles: A.map((se) => rr(se, q)).filter((se) => se !== null),
6329
6329
  dirtyFiles: {},
6330
6330
  notifications: []
6331
6331
  };
6332
- }, [t]), Ze = T(() => {
6333
- const P = Re();
6334
- for (const A of M.current)
6332
+ }, [t]), Ze = N(() => {
6333
+ const P = Ne();
6334
+ for (const A of D.current)
6335
6335
  A(P);
6336
- }, [Re]), oe = L(!1), de = T((P) => {
6337
- var _;
6338
- if (C.current = P, F(P), !oe.current) {
6336
+ }, [Ne]), oe = $(!1), de = N((P) => {
6337
+ var F;
6338
+ if (E.current = P, L(P), !oe.current) {
6339
6339
  oe.current = !0;
6340
6340
  for (const q of l ?? [])
6341
6341
  P.getPanel(q.id) || P.addPanel({ id: q.id, component: q.component, title: q.title, params: q.params });
6342
6342
  }
6343
- (_ = k.current) == null || _.call(k, Qe);
6343
+ (F = x.current) == null || F.call(x, Qe);
6344
6344
  const A = () => {
6345
6345
  var q;
6346
- (q = y.current) == null || q.call(y, be()), Ze();
6346
+ (q = C.current) == null || q.call(C, be()), Ze();
6347
6347
  };
6348
6348
  P.onDidAddPanel(A), P.onDidRemovePanel(A), P.onDidActivePanelChange(A), A();
6349
- }, [Qe, be, Ze]), we = T(
6349
+ }, [Qe, be, Ze]), we = N(
6350
6350
  async (P) => {
6351
6351
  try {
6352
- const A = C.current;
6352
+ const A = E.current;
6353
6353
  if (!A) return yt("not-ready", "surface not ready");
6354
- const _ = Ct(P), q = {
6354
+ const F = Ct(P), q = {
6355
6355
  kind: Je,
6356
- target: _
6357
- }, ne = J.current.resolve(q);
6356
+ target: F
6357
+ }, ne = Y.current.resolve(q);
6358
6358
  if (ne) {
6359
6359
  if (!ee.current.has(ne.component))
6360
6360
  return yt(
@@ -6363,16 +6363,16 @@ function Dl({
6363
6363
  );
6364
6364
  const he = Kt(q, ne);
6365
6365
  B.current.add(he);
6366
- const se = Jt(ne.params, _), xe = A.getPanel(he);
6366
+ const se = Jt(ne.params, F), xe = A.getPanel(he);
6367
6367
  return xe ? (xe.api.updateParameters(se), xe.api.setActive(), Me()) : (A.addPanel({
6368
6368
  id: he,
6369
6369
  component: ne.component,
6370
- title: ne.title ?? _.split("/").pop() ?? _,
6370
+ title: ne.title ?? F.split("/").pop() ?? F,
6371
6371
  params: se
6372
6372
  }), Me());
6373
6373
  }
6374
- const ae = nr(A, _);
6375
- return ae ? (ae.api.setActive(), Me()) : yt("NO_SURFACE_RESOLVER", `no registered surface resolver handles ${_}`);
6374
+ const ae = nr(A, F);
6375
+ return ae ? (ae.api.setActive(), Me()) : yt("NO_SURFACE_RESOLVER", `no registered surface resolver handles ${F}`);
6376
6376
  } catch (A) {
6377
6377
  return yt(
6378
6378
  "INVALID_SURFACE_PATH",
@@ -6381,11 +6381,11 @@ function Dl({
6381
6381
  }
6382
6382
  },
6383
6383
  []
6384
- ), ie = V(() => ({
6385
- getOpenPanels: () => Re().panels,
6386
- getActiveFile: () => Re().activeFile,
6384
+ ), ie = K(() => ({
6385
+ getOpenPanels: () => Ne().panels,
6386
+ getActiveFile: () => Ne().activeFile,
6387
6387
  getDirtyFiles: () => [],
6388
- getVisibleFiles: () => Re().visibleFiles,
6388
+ getVisibleFiles: () => Ne().visibleFiles,
6389
6389
  openFile: we,
6390
6390
  openPanel: async () => Me(),
6391
6391
  closePanel: async () => Me(),
@@ -6398,62 +6398,62 @@ function Dl({
6398
6398
  markClean: () => {
6399
6399
  },
6400
6400
  subscribe: (P, A) => {
6401
- let _ = E.current.get(P);
6402
- return _ || (_ = /* @__PURE__ */ new Set(), E.current.set(P, _)), _.add(A), P === "tree:expand" && R.current && (A({ path: R.current }), R.current = null), () => {
6403
- _ == null || _.delete(A);
6401
+ let F = S.current.get(P);
6402
+ return F || (F = /* @__PURE__ */ new Set(), S.current.set(P, F)), F.add(A), P === "tree:expand" && T.current && (A({ path: T.current }), T.current = null), () => {
6403
+ F == null || F.delete(A);
6404
6404
  };
6405
6405
  },
6406
6406
  select: (P, A) => {
6407
- const _ = (q) => A(P(q));
6408
- return M.current.add(_), _(Re()), () => {
6409
- M.current.delete(_);
6407
+ const F = (q) => A(P(q));
6408
+ return D.current.add(F), F(Ne()), () => {
6409
+ D.current.delete(F);
6410
6410
  };
6411
6411
  }
6412
- }), [Pe, we, Re]), Ue = T(
6412
+ }), [Pe, we, Ne]), Ue = N(
6413
6413
  (P) => {
6414
6414
  if (p) return;
6415
- P.preventDefault(), P.currentTarget.setPointerCapture(P.pointerId), D.current = { startX: P.clientX, startWidth: g };
6415
+ P.preventDefault(), P.currentTarget.setPointerCapture(P.pointerId), _.current = { startX: P.clientX, startWidth: g };
6416
6416
  },
6417
6417
  [p, g]
6418
- ), Ce = T(
6418
+ ), Ce = N(
6419
6419
  (P) => {
6420
- const A = D.current;
6420
+ const A = _.current;
6421
6421
  if (!A) return;
6422
- const _ = P.clientX - A.startX, q = Math.max(n, Math.min(r, A.startWidth + _));
6422
+ const F = P.clientX - A.startX, q = Math.max(n, Math.min(r, A.startWidth + F));
6423
6423
  v(q);
6424
6424
  },
6425
6425
  [n, r]
6426
- ), qe = T((P) => {
6427
- D.current && (D.current = null, P.currentTarget.releasePointerCapture(P.pointerId));
6428
- }, []), Oe = T(
6426
+ ), qe = N((P) => {
6427
+ _.current && (_.current = null, P.currentTarget.releasePointerCapture(P.pointerId));
6428
+ }, []), Oe = N(
6429
6429
  (P) => {
6430
6430
  if (p) return;
6431
6431
  const A = P.shiftKey ? 32 : 16;
6432
- P.key === "ArrowLeft" ? (P.preventDefault(), v((_) => Math.max(n, _ - A))) : P.key === "ArrowRight" ? (P.preventDefault(), v((_) => Math.min(r, _ + A))) : P.key === "Home" ? (P.preventDefault(), v(n)) : P.key === "End" && (P.preventDefault(), v(r));
6432
+ P.key === "ArrowLeft" ? (P.preventDefault(), v((F) => Math.max(n, F - A))) : P.key === "ArrowRight" ? (P.preventDefault(), v((F) => Math.min(r, F + A))) : P.key === "Home" ? (P.preventDefault(), v(n)) : P.key === "End" && (P.preventDefault(), v(r));
6433
6433
  },
6434
6434
  [p, n, r]
6435
6435
  );
6436
- return W(() => {
6436
+ return z(() => {
6437
6437
  if (o)
6438
6438
  try {
6439
6439
  localStorage.setItem(`${o}:sidebarWidth`, String(g));
6440
6440
  } catch {
6441
6441
  }
6442
- }, [o, g]), W(() => {
6442
+ }, [o, g]), z(() => {
6443
6443
  if (o)
6444
6444
  try {
6445
6445
  localStorage.setItem(`${o}:sidebarCollapsed`, p ? "1" : "0");
6446
6446
  } catch {
6447
6447
  }
6448
- }, [o, p]), /* @__PURE__ */ x(
6448
+ }, [o, p]), /* @__PURE__ */ w(
6449
6449
  "div",
6450
6450
  {
6451
- ref: S,
6451
+ ref: k,
6452
6452
  "data-boring-workspace-part": "surface",
6453
6453
  className: re("flex h-full min-h-0 w-full bg-background", d),
6454
6454
  "data-testid": "surface-shell",
6455
6455
  children: [
6456
- p ? null : /* @__PURE__ */ x(Le, { children: [
6456
+ p ? null : /* @__PURE__ */ w(Le, { children: [
6457
6457
  /* @__PURE__ */ u(
6458
6458
  "aside",
6459
6459
  {
@@ -6468,7 +6468,7 @@ function Dl({
6468
6468
  rootDir: e,
6469
6469
  bridge: ie,
6470
6470
  defaultTab: f,
6471
- revealFileTreeRequest: O,
6471
+ revealFileTreeRequest: M,
6472
6472
  onOpenPanel: ge,
6473
6473
  onCollapse: () => m(!0)
6474
6474
  }
@@ -6495,7 +6495,7 @@ function Dl({
6495
6495
  }
6496
6496
  )
6497
6497
  ] }),
6498
- /* @__PURE__ */ x("div", { className: "relative min-w-0 flex-1", children: [
6498
+ /* @__PURE__ */ w("div", { className: "relative min-w-0 flex-1", children: [
6499
6499
  /* @__PURE__ */ u(
6500
6500
  "div",
6501
6501
  {
@@ -6513,7 +6513,7 @@ function Dl({
6513
6513
  )
6514
6514
  }
6515
6515
  ),
6516
- /* @__PURE__ */ x(
6516
+ /* @__PURE__ */ w(
6517
6517
  "div",
6518
6518
  {
6519
6519
  className: "pointer-events-none absolute inset-x-0 top-0 flex items-center justify-between",
@@ -6569,7 +6569,7 @@ function Fl({
6569
6569
  onExpandFiles: n
6570
6570
  }) {
6571
6571
  const [r, o] = j(!0);
6572
- return W(() => {
6572
+ return z(() => {
6573
6573
  if (!e) return;
6574
6574
  const i = () => o(e.panels.length === 0);
6575
6575
  i();
@@ -6577,8 +6577,8 @@ function Fl({
6577
6577
  return () => {
6578
6578
  a.dispose(), c.dispose();
6579
6579
  };
6580
- }, [e]), r ? /* @__PURE__ */ x(Le, { children: [
6581
- /* @__PURE__ */ x("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
6580
+ }, [e]), r ? /* @__PURE__ */ w(Le, { children: [
6581
+ /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
6582
6582
  t && /* @__PURE__ */ u(Te, { label: "Show workspace menu", side: "right", children: /* @__PURE__ */ u(
6583
6583
  pe,
6584
6584
  {
@@ -6593,14 +6593,14 @@ function Fl({
6593
6593
  ) }),
6594
6594
  /* @__PURE__ */ u("div", { className: "flex-1" })
6595
6595
  ] }),
6596
- /* @__PURE__ */ x("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
6597
- /* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
6596
+ /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
6597
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
6598
6598
  /* @__PURE__ */ u("span", { className: "inline-block h-px w-3 bg-[color:var(--accent)]", "aria-hidden": "true" }),
6599
6599
  "Workbench"
6600
6600
  ] }),
6601
6601
  /* @__PURE__ */ u("div", { className: "text-[15px] font-medium tracking-tight text-foreground", children: "Nothing open yet" }),
6602
6602
  /* @__PURE__ */ u("p", { className: "max-w-[280px] text-[12.5px] leading-relaxed text-muted-foreground/85", children: "Open a source item, or let the agent produce an artifact here." }),
6603
- t && /* @__PURE__ */ x(
6603
+ t && /* @__PURE__ */ w(
6604
6604
  Fe,
6605
6605
  {
6606
6606
  type: "button",
@@ -6700,7 +6700,33 @@ async function Kl(e, t, n, r = Vl) {
6700
6700
  const i = gr({ pluginId: e });
6701
6701
  return await o.default(i), i.flush();
6702
6702
  }
6703
- function Jl(e, t, n) {
6703
+ const Jl = 4, Yl = 750;
6704
+ async function Xl({
6705
+ pluginId: e,
6706
+ frontEntryUrl: t,
6707
+ revision: n,
6708
+ importFront: r,
6709
+ isStale: o,
6710
+ attempts: i = Jl,
6711
+ delayMs: a = Yl
6712
+ }) {
6713
+ const c = Math.max(1, i);
6714
+ let s;
6715
+ for (let f = 0; f < c; f += 1) {
6716
+ if (o()) throw s ?? new Error(`plugin ${e} front import superseded`);
6717
+ try {
6718
+ return await Kl(e, t, n, r);
6719
+ } catch (l) {
6720
+ if (s = l, f === c - 1 || o()) break;
6721
+ console.warn(
6722
+ `[boring-ui] plugin ${e} front import failed (attempt ${f + 1}/${c}); retrying`,
6723
+ l
6724
+ ), await new Promise((d) => setTimeout(d, a));
6725
+ }
6726
+ }
6727
+ throw s;
6728
+ }
6729
+ function Ql(e, t, n) {
6704
6730
  const r = [], o = new Map(n.panels.map((s) => [s.id, s]));
6705
6731
  for (const s of n.panels)
6706
6732
  r.push({
@@ -6758,7 +6784,7 @@ function Jl(e, t, n) {
6758
6784
  }));
6759
6785
  return { panels: r, commands: i, catalogs: a, surfaceResolvers: c };
6760
6786
  }
6761
- function Yl(e, t) {
6787
+ function Zl(e, t) {
6762
6788
  const n = [
6763
6789
  t.providers.length > 0 ? `${t.providers.length} provider(s)` : null,
6764
6790
  t.bindings.length > 0 ? `${t.bindings.length} binding(s)` : null
@@ -6767,16 +6793,16 @@ function Yl(e, t) {
6767
6793
  `[boring-ui] hot-loaded plugin "${e}" registered ${n}. Dynamic provider/binding mounting is not implemented yet, so this plugin's hot-loaded UI contributions were skipped to avoid rendering panels without their required provider tree.`
6768
6794
  );
6769
6795
  }
6770
- function Xl(e) {
6796
+ function eu(e) {
6771
6797
  return e ?? "system/builtin";
6772
6798
  }
6773
6799
  function bt(e, t, n, r) {
6774
6800
  const o = `${e}.${t === "panel" ? "panel" : t}`;
6775
6801
  return new Error(
6776
- `PLUGIN_OUTPUT_ID_COLLISION: plugin "${e}" tried to register ${t} "${n}" already owned by "${Xl(r)}". Use a namespaced id like "${o}".`
6802
+ `PLUGIN_OUTPUT_ID_COLLISION: plugin "${e}" tried to register ${t} "${n}" already owned by "${eu(r)}". Use a namespaced id like "${o}".`
6777
6803
  );
6778
6804
  }
6779
- function Ql(e, t, n) {
6805
+ function tu(e, t, n) {
6780
6806
  for (const r of t.panels) {
6781
6807
  const o = n.panels.get(r.id);
6782
6808
  if (o && o.pluginId !== e)
@@ -6798,29 +6824,29 @@ function Ql(e, t, n) {
6798
6824
  throw bt(e, "surface-resolver", r.id, o.pluginId);
6799
6825
  }
6800
6826
  }
6801
- function Zl(e, t, n, r) {
6802
- (n.providers.length > 0 || n.bindings.length > 0) && Yl(e, n);
6803
- const o = Jl(e, t, n);
6804
- Ql(e, o, r), r.panels.replaceByPluginId(e, o.panels), r.commands.replaceByPluginId(e, o.commands), r.catalogs.replaceByPluginId(e, o.catalogs), r.surfaceResolvers.replaceByPluginId(e, o.surfaceResolvers);
6827
+ function nu(e, t, n, r) {
6828
+ (n.providers.length > 0 || n.bindings.length > 0) && Zl(e, n);
6829
+ const o = Ql(e, t, n);
6830
+ tu(e, o, r), r.panels.replaceByPluginId(e, o.panels), r.commands.replaceByPluginId(e, o.commands), r.catalogs.replaceByPluginId(e, o.catalogs), r.surfaceResolvers.replaceByPluginId(e, o.surfaceResolvers);
6805
6831
  }
6806
6832
  function wt(e, t) {
6807
6833
  t.panels.replaceByPluginId(e, []), t.commands.replaceByPluginId(e, []), t.catalogs.replaceByPluginId(e, []), t.surfaceResolvers.replaceByPluginId(e, []);
6808
6834
  }
6809
- function eu(e) {
6835
+ function ru(e) {
6810
6836
  if (!e || typeof e != "object") return !0;
6811
6837
  const t = e.type;
6812
6838
  return typeof t != "string" || !t.startsWith("boring.plugin.");
6813
6839
  }
6814
- function tu(e) {
6815
- const t = Lt(), n = ln(), r = $t(), o = br(), i = L(/* @__PURE__ */ new Map()), a = L(/* @__PURE__ */ new Map()), c = L(/* @__PURE__ */ new Set()), s = L(/* @__PURE__ */ new Set()), [f, l] = j(0), d = L(!1);
6816
- W(() => {
6840
+ function ou(e) {
6841
+ const t = Lt(), n = ln(), r = $t(), o = br(), i = $(/* @__PURE__ */ new Map()), a = $(/* @__PURE__ */ new Map()), c = $(/* @__PURE__ */ new Set()), s = $(/* @__PURE__ */ new Set()), [f, l] = j(0), d = $(!1);
6842
+ z(() => {
6817
6843
  if (e.enabled === !1 || typeof EventSource > "u") return;
6818
6844
  const p = (m) => {
6819
6845
  const g = m.detail;
6820
- eu(g) && (d.current = !0, l((v) => v + 1));
6846
+ ru(g) && (d.current = !0, l((v) => v + 1));
6821
6847
  };
6822
6848
  return window.addEventListener(De, p), () => window.removeEventListener(De, p);
6823
- }, [e.enabled]), W(() => {
6849
+ }, [e.enabled]), z(() => {
6824
6850
  if (e.enabled === !1 || typeof EventSource > "u") return;
6825
6851
  const p = d.current;
6826
6852
  if (d.current = !1, Hl(e.authHeaders)) {
@@ -6830,17 +6856,18 @@ function tu(e) {
6830
6856
  return;
6831
6857
  }
6832
6858
  let m = !1;
6833
- const g = Ul(t, n, r, o), v = Wl(ho(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), C = new EventSource(v, { withCredentials: !0 }), S = (O) => {
6859
+ const g = Ul(t, n, r, o), v = Wl(ho(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), E = new EventSource(v, { withCredentials: !0 }), k = (M) => {
6834
6860
  (async () => {
6835
- let h, k = !1;
6861
+ var C, b;
6862
+ let h, x = !1;
6836
6863
  try {
6837
- if (h = JSON.parse(O.data), m || h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
6864
+ if (h = JSON.parse(M.data), m || h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
6838
6865
  h.replay && c.current.add(h.id);
6839
- const y = p && h.replay === !0, w = i.current.get(h.id) ?? 0, M = a.current.get(h.id) ?? 0;
6840
- if (!y && h.revision <= Math.max(w, M)) return;
6866
+ const D = p && h.replay === !0, B = i.current.get(h.id) ?? 0, T = a.current.get(h.id) ?? 0;
6867
+ if (!D && h.revision <= Math.max(B, T)) return;
6841
6868
  a.current.set(h.id, h.revision);
6842
- const B = Bl(h, e.apiBaseUrl);
6843
- B && (k = !0, window.dispatchEvent(new CustomEvent(De, {
6869
+ const S = Bl(h, e.apiBaseUrl);
6870
+ S && (x = !0, window.dispatchEvent(new CustomEvent(De, {
6844
6871
  detail: {
6845
6872
  type: "boring.plugin.front-pending",
6846
6873
  id: h.id,
@@ -6849,48 +6876,56 @@ function tu(e) {
6849
6876
  replay: h.replay
6850
6877
  }
6851
6878
  })));
6852
- let R = null;
6879
+ let G = null;
6853
6880
  try {
6854
- R = B ? await Kl(h.id, B, h.revision, e.importFront) : null;
6855
- } catch (E) {
6881
+ G = S ? await Xl({
6882
+ pluginId: h.id,
6883
+ frontEntryUrl: S,
6884
+ revision: h.revision,
6885
+ importFront: e.importFront,
6886
+ isStale: () => m || a.current.get(h.id) !== h.revision,
6887
+ ...((C = e.frontImportRetry) == null ? void 0 : C.attempts) !== void 0 ? { attempts: e.frontImportRetry.attempts } : {},
6888
+ ...((b = e.frontImportRetry) == null ? void 0 : b.delayMs) !== void 0 ? { delayMs: e.frontImportRetry.delayMs } : {}
6889
+ }) : null;
6890
+ } catch (W) {
6856
6891
  throw {
6857
6892
  stage: "import",
6858
- error: E
6893
+ error: W
6859
6894
  };
6860
6895
  }
6861
- if (m || a.current.get(h.id) !== h.revision || !y && h.revision <= (i.current.get(h.id) ?? 0)) return;
6862
- if (!R) {
6896
+ if (m || a.current.get(h.id) !== h.revision || !D && h.revision <= (i.current.get(h.id) ?? 0)) return;
6897
+ if (!G) {
6863
6898
  s.current.has(h.id) && (wt(h.id, g), s.current.delete(h.id)), i.current.set(h.id, h.revision);
6864
6899
  return;
6865
6900
  }
6866
6901
  try {
6867
- Zl(h.id, h.revision, R, g);
6868
- } catch (E) {
6902
+ nu(h.id, h.revision, G, g);
6903
+ } catch (W) {
6869
6904
  throw {
6870
6905
  stage: "register",
6871
- error: E
6906
+ error: W
6872
6907
  };
6873
6908
  }
6874
6909
  s.current.add(h.id), i.current.set(h.id, h.revision), window.dispatchEvent(new CustomEvent(De, { detail: h }));
6875
- } catch (y) {
6910
+ } catch (D) {
6876
6911
  h && a.current.get(h.id) === h.revision && a.current.delete(h.id);
6877
- const w = typeof y == "object" && y && "stage" in y && y.stage === "register" ? "register" : "import", M = typeof y == "object" && y && "error" in y ? y.error : y;
6912
+ const B = typeof D == "object" && D && "stage" in D && D.stage === "register" ? "register" : "import", T = typeof D == "object" && D && "error" in D ? D.error : D;
6878
6913
  if (m) return;
6879
- const B = (h == null ? void 0 : h.id) ?? "<malformed>", R = M instanceof Error ? M.message : String(M);
6880
- console.error(`[boring-ui] failed to load plugin ${B}; keeping previous version`, M), h && window.dispatchEvent(new CustomEvent(De, {
6914
+ const S = (h == null ? void 0 : h.id) ?? "<malformed>", G = T instanceof Error ? T.message : String(T);
6915
+ console.error(`[boring-ui] failed to load plugin ${S}; keeping previous version`, T), h && window.dispatchEvent(new CustomEvent(De, {
6881
6916
  detail: {
6882
6917
  type: "boring.plugin.front-error",
6883
6918
  id: h.id,
6884
6919
  revision: h.revision,
6885
6920
  workspaceId: h.workspaceId ?? e.workspaceId,
6886
- message: R,
6921
+ message: G,
6887
6922
  code: Ml,
6888
- stage: w,
6923
+ stage: B,
6889
6924
  replay: h.replay
6890
6925
  }
6891
6926
  }));
6892
6927
  } finally {
6893
- k && h && window.dispatchEvent(new CustomEvent(De, {
6928
+ x && h && window.dispatchEvent(new CustomEvent(De, {
6894
6929
  detail: {
6895
6930
  type: "boring.plugin.front-settled",
6896
6931
  id: h.id,
@@ -6901,21 +6936,21 @@ function tu(e) {
6901
6936
  }));
6902
6937
  }
6903
6938
  })();
6904
- }, D = (O) => {
6939
+ }, _ = (M) => {
6905
6940
  if (!m)
6906
6941
  try {
6907
- const h = JSON.parse(O.data);
6942
+ const h = JSON.parse(M.data);
6908
6943
  if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
6909
- const k = i.current.get(h.id) ?? 0, y = a.current.get(h.id) ?? 0;
6910
- if (h.revision <= Math.max(k, y)) return;
6944
+ const x = i.current.get(h.id) ?? 0, C = a.current.get(h.id) ?? 0;
6945
+ if (h.revision <= Math.max(x, C)) return;
6911
6946
  a.current.set(h.id, h.revision), s.current.has(h.id) && (wt(h.id, g), s.current.delete(h.id)), i.current.set(h.id, h.revision), window.dispatchEvent(new CustomEvent(De, { detail: h }));
6912
6947
  } catch (h) {
6913
6948
  console.error("[boring-ui] failed to process plugin unload event", h);
6914
6949
  }
6915
- }, I = (O) => {
6950
+ }, I = (M) => {
6916
6951
  if (!m)
6917
6952
  try {
6918
- const h = JSON.parse(O.data);
6953
+ const h = JSON.parse(M.data);
6919
6954
  if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
6920
6955
  console.error(`[boring-ui] plugin ${h.id} failed to reload: ${h.message}`), window.dispatchEvent(new CustomEvent(De, {
6921
6956
  detail: {
@@ -6929,52 +6964,52 @@ function tu(e) {
6929
6964
  } catch (h) {
6930
6965
  console.error("[boring-ui] failed to process plugin error event", h);
6931
6966
  }
6932
- }, F = (O) => {
6967
+ }, L = (M) => {
6933
6968
  if (!m)
6934
6969
  try {
6935
- const h = JSON.parse(O.data);
6970
+ const h = JSON.parse(M.data);
6936
6971
  if (h.workspaceId && e.workspaceId && h.workspaceId !== e.workspaceId) return;
6937
- const k = c.current;
6938
- for (const [y, w] of i.current.entries())
6939
- k.has(y) || (s.current.has(y) && (wt(y, g), s.current.delete(y)), i.current.delete(y), a.current.delete(y), window.dispatchEvent(new CustomEvent(De, {
6972
+ const x = c.current;
6973
+ for (const [C, b] of i.current.entries())
6974
+ x.has(C) || (s.current.has(C) && (wt(C, g), s.current.delete(C)), i.current.delete(C), a.current.delete(C), window.dispatchEvent(new CustomEvent(De, {
6940
6975
  detail: {
6941
6976
  type: "boring.plugin.unload",
6942
- id: y,
6943
- revision: w + 1,
6977
+ id: C,
6978
+ revision: b + 1,
6944
6979
  workspaceId: h.workspaceId ?? e.workspaceId,
6945
6980
  replay: !0
6946
6981
  }
6947
6982
  })));
6948
- k.clear(), window.dispatchEvent(new CustomEvent(De, { detail: h }));
6983
+ x.clear(), window.dispatchEvent(new CustomEvent(De, { detail: h }));
6949
6984
  } catch (h) {
6950
6985
  console.error("[boring-ui] failed to process plugin replay-complete event", h);
6951
6986
  }
6952
6987
  };
6953
- return C.addEventListener("boring.plugin.load", S), C.addEventListener("boring.plugin.unload", D), C.addEventListener("boring.plugin.error", I), C.addEventListener("boring.plugin.replay-complete", F), () => {
6988
+ return E.addEventListener("boring.plugin.load", k), E.addEventListener("boring.plugin.unload", _), E.addEventListener("boring.plugin.error", I), E.addEventListener("boring.plugin.replay-complete", L), () => {
6954
6989
  if (m = !0, !d.current) {
6955
- for (const O of s.current) wt(O, g);
6990
+ for (const M of s.current) wt(M, g);
6956
6991
  s.current.clear(), i.current.clear(), a.current.clear(), c.current.clear();
6957
6992
  }
6958
- C.close();
6993
+ E.close();
6959
6994
  };
6960
- }, [e.apiBaseUrl, e.workspaceId, e.enabled, e.authHeaders, e.importFront, t, n, r, o, f]);
6995
+ }, [e.apiBaseUrl, e.workspaceId, e.enabled, e.authHeaders, e.importFront, e.frontImportRetry, t, n, r, o, f]);
6961
6996
  }
6962
6997
  const Yt = "Boring UI";
6963
6998
  function ir(e) {
6964
6999
  const t = e == null ? void 0 : e.trim();
6965
7000
  return !t || /^(?:[a-z][a-z\d+.-]*:\/\/|[a-z]:[\\/]|\\\\|\/|\.\.?[\\/])/i.test(t) || /^(?:::1|localhost(?::\d+)?|\d{1,3}(?:\.\d{1,3}){3}(?::\d+)?|\[[a-f\d:]+\](?::\d+)?|[a-z\d-]+(?:\.[a-z\d-]+)+(?::\d+)?)$/i.test(t) ? null : t;
6966
7001
  }
6967
- function nu(e) {
7002
+ function iu(e) {
6968
7003
  const t = ir(e.workspaceLabel);
6969
7004
  if (t) return `${t} · ${Yt}`;
6970
7005
  const n = ir(e.workspaceId);
6971
7006
  return n ? `${n} · ${Yt}` : Yt;
6972
7007
  }
6973
- function ru(e) {
7008
+ function su(e) {
6974
7009
  return null;
6975
7010
  }
6976
- function ou(e) {
6977
- return tu({
7011
+ function au(e) {
7012
+ return ou({
6978
7013
  apiBaseUrl: e.apiBaseUrl,
6979
7014
  workspaceId: e.workspaceId,
6980
7015
  authHeaders: e.authHeaders,
@@ -6984,60 +7019,60 @@ function ou(e) {
6984
7019
  function mo() {
6985
7020
  return typeof window > "u" || typeof window.matchMedia != "function" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
6986
7021
  }
6987
- const sr = "workspace-provider", iu = "workspace-provider", vn = me(null);
6988
- function nd() {
7022
+ const sr = "workspace-provider", cu = "workspace-provider", vn = me(null);
7023
+ function id() {
6989
7024
  const e = ue(vn);
6990
7025
  if (!e) throw new Error("useTheme must be used within a WorkspaceProvider");
6991
7026
  return { theme: hn(), setTheme: e.setTheme, toggleTheme: e.toggleTheme };
6992
7027
  }
6993
- function rd({ children: e, defaultTheme: t, onThemeChange: n }) {
6994
- const r = L(null);
7028
+ function sd({ children: e, defaultTheme: t, onThemeChange: n }) {
7029
+ const r = $(null);
6995
7030
  if (!r.current) {
6996
7031
  const f = Jr({ persistenceEnabled: !1 });
6997
7032
  $r(f);
6998
7033
  const l = t ?? mo();
6999
7034
  l !== "light" && f.getState().setTheme(l), r.current = f;
7000
7035
  }
7001
- const o = r.current, i = T(
7036
+ const o = r.current, i = N(
7002
7037
  (f) => {
7003
7038
  o.getState().setTheme(f), n == null || n(f);
7004
7039
  },
7005
7040
  [o, n]
7006
- ), a = T(() => {
7041
+ ), a = N(() => {
7007
7042
  const f = o.getState().preferences.theme === "light" ? "dark" : "light";
7008
7043
  i(f);
7009
7044
  }, [o, i]), c = hn();
7010
- W(() => (document.documentElement.setAttribute("data-theme", c), () => {
7045
+ z(() => (document.documentElement.setAttribute("data-theme", c), () => {
7011
7046
  document.documentElement.removeAttribute("data-theme");
7012
7047
  }), [c]);
7013
- const s = V(() => ({ setTheme: i, toggleTheme: a }), [i, a]);
7048
+ const s = K(() => ({ setTheme: i, toggleTheme: a }), [i, a]);
7014
7049
  return /* @__PURE__ */ u(vn.Provider, { value: s, children: e });
7015
7050
  }
7016
7051
  const go = me(null);
7017
- function od() {
7052
+ function ad() {
7018
7053
  const e = ue(go);
7019
7054
  if (!e) throw new Error("useWorkspaceBridge must be used within a WorkspaceProvider");
7020
7055
  return e;
7021
7056
  }
7022
7057
  const yn = me(null);
7023
- function su() {
7058
+ function lu() {
7024
7059
  const e = ue(yn);
7025
7060
  if (!e) throw new Error("useWorkspaceContext must be used within a WorkspaceProvider");
7026
7061
  return e;
7027
7062
  }
7028
- function au() {
7063
+ function uu() {
7029
7064
  return ue(yn);
7030
7065
  }
7031
- function cu() {
7032
- const { chatPanel: e } = su();
7066
+ function du() {
7067
+ const { chatPanel: e } = lu();
7033
7068
  if (!e)
7034
7069
  throw new Error("WorkspaceProvider requires a chatPanel prop before rendering ChatPanelHost");
7035
7070
  return e;
7036
7071
  }
7037
- function lu({
7072
+ function fu({
7038
7073
  store: e
7039
7074
  }) {
7040
- const t = V(
7075
+ const t = K(
7041
7076
  () => [
7042
7077
  {
7043
7078
  key: "b",
@@ -7068,24 +7103,24 @@ function lu({
7068
7103
  );
7069
7104
  return jr({ shortcuts: t }), null;
7070
7105
  }
7071
- function uu({ commands: e }) {
7106
+ function pu({ commands: e }) {
7072
7107
  const t = ln();
7073
- return W(() => {
7108
+ return z(() => {
7074
7109
  if (!(e != null && e.length)) return;
7075
7110
  const n = e.map((r) => r.id);
7076
7111
  for (const r of n) t.unregisterCommand(r);
7077
7112
  for (const r of e)
7078
- t.registerCommand({ ...r, pluginId: r.pluginId ?? iu });
7113
+ t.registerCommand({ ...r, pluginId: r.pluginId ?? cu });
7079
7114
  return () => {
7080
7115
  for (const r of n) t.unregisterCommand(r);
7081
7116
  };
7082
7117
  }, [t, e]), null;
7083
7118
  }
7084
- function du({
7119
+ function hu({
7085
7120
  catalogs: e
7086
7121
  }) {
7087
7122
  const t = $t();
7088
- return W(() => {
7123
+ return z(() => {
7089
7124
  if (e != null && e.length) {
7090
7125
  for (const n of e)
7091
7126
  t.register(n, sr);
@@ -7095,7 +7130,7 @@ function du({
7095
7130
  }
7096
7131
  }, [t, e]), null;
7097
7132
  }
7098
- function fu({ plugins: e }) {
7133
+ function mu({ plugins: e }) {
7099
7134
  return /* @__PURE__ */ u(Le, { children: e.flatMap(
7100
7135
  (t) => t.registrations.bindings.map((n) => {
7101
7136
  const r = n.component;
@@ -7103,7 +7138,7 @@ function fu({ plugins: e }) {
7103
7138
  })
7104
7139
  ) });
7105
7140
  }
7106
- function pu({
7141
+ function gu({
7107
7142
  plugins: e,
7108
7143
  apiBaseUrl: t,
7109
7144
  authHeaders: n,
@@ -7128,20 +7163,20 @@ function pu({
7128
7163
  );
7129
7164
  }, i);
7130
7165
  }
7131
- function hu({ onOpenFile: e }) {
7132
- return W(() => {
7166
+ function vu({ onOpenFile: e }) {
7167
+ return z(() => {
7133
7168
  if (e)
7134
- return K.on(ve.uiCommand, ({ command: t }) => {
7169
+ return J.on(ve.uiCommand, ({ command: t }) => {
7135
7170
  if (t.kind !== "openFile") return;
7136
7171
  const n = t.params.path;
7137
7172
  typeof n == "string" && e(n);
7138
7173
  });
7139
7174
  }, [e]), null;
7140
7175
  }
7141
- function mu(e, t) {
7176
+ function yu(e, t) {
7142
7177
  return !e || (t == null ? void 0 : t["x-boring-workspace-id"]) != null || (t == null ? void 0 : t["X-Boring-Workspace-Id"]) != null ? t : { "x-boring-workspace-id": e, ...t };
7143
7178
  }
7144
- function id({
7179
+ function cd({
7145
7180
  children: e,
7146
7181
  chatPanel: t,
7147
7182
  plugins: n,
@@ -7158,58 +7193,58 @@ function id({
7158
7193
  workspaceId: m,
7159
7194
  workspaceLabel: g,
7160
7195
  storageKey: v,
7161
- persistenceEnabled: C = !0,
7162
- manageDocumentTitle: S = !0,
7163
- bridgeEndpoint: D,
7196
+ persistenceEnabled: E = !0,
7197
+ manageDocumentTitle: k = !0,
7198
+ bridgeEndpoint: _,
7164
7199
  onAuthError: I,
7165
- onOpenFile: F,
7166
- debug: O = !1,
7200
+ onOpenFile: L,
7201
+ debug: M = !1,
7167
7202
  frontPluginHotReload: h = !1,
7168
- fullPageBasePath: k
7203
+ fullPageBasePath: x
7169
7204
  }) {
7170
- const y = L(null);
7171
- if (!y.current) {
7205
+ const C = $(null);
7206
+ if (!C.current) {
7172
7207
  const oe = Jr({
7173
7208
  workspaceId: m,
7174
7209
  storageKey: v,
7175
- persistenceEnabled: C
7210
+ persistenceEnabled: E
7176
7211
  });
7177
7212
  $r(oe);
7178
7213
  const de = d ?? mo();
7179
- de !== "light" && !C ? oe.getState().setTheme(de) : de !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || oe.getState().setTheme(de)), y.current = oe;
7214
+ de !== "light" && !E ? oe.getState().setTheme(de) : de !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || oe.getState().setTheme(de)), C.current = oe;
7180
7215
  }
7181
- const w = y.current, M = L(null), B = L(f);
7216
+ const b = C.current, D = $(null), B = $(f);
7182
7217
  B.current = f;
7183
- const R = L(I);
7184
- R.current = I, W(() => () => {
7218
+ const T = $(I);
7219
+ T.current = I, z(() => () => {
7185
7220
  var oe;
7186
- (oe = M.current) == null || oe.disconnect(), M.current = null, w.cleanup();
7187
- }, [w]), W(() => {
7221
+ (oe = D.current) == null || oe.disconnect(), D.current = null, b.cleanup();
7222
+ }, [b]), z(() => {
7188
7223
  var ie, Ue;
7189
- if (M.current && (M.current.disconnect(), M.current = null), !D) return;
7190
- const oe = Vi(w), de = (Ue = (ie = B.current) == null ? void 0 : ie.Authorization) == null ? void 0 : Ue.replace(/^Bearer\s+/i, ""), we = Xi({
7191
- endpoint: D,
7224
+ if (D.current && (D.current.disconnect(), D.current = null), !_) return;
7225
+ const oe = Vi(b), de = (Ue = (ie = B.current) == null ? void 0 : ie.Authorization) == null ? void 0 : Ue.replace(/^Bearer\s+/i, ""), we = Xi({
7226
+ endpoint: _,
7192
7227
  bridge: oe,
7193
- store: w,
7228
+ store: b,
7194
7229
  authToken: de,
7195
7230
  onAuthError: (Ce) => {
7196
7231
  var qe;
7197
- return (qe = R.current) == null ? void 0 : qe.call(R, Ce);
7232
+ return (qe = T.current) == null ? void 0 : qe.call(T, Ce);
7198
7233
  },
7199
7234
  onConnectionChange: Qe
7200
7235
  });
7201
- return we.connect(), M.current = we, () => {
7202
- we.disconnect(), M.current = null;
7236
+ return we.connect(), D.current = we, () => {
7237
+ we.disconnect(), D.current = null;
7203
7238
  };
7204
- }, [D, w]);
7205
- const { panelRegistry: E, commandRegistry: Y, catalogRegistry: z, surfaceResolverRegistry: U, pluginMetas: ee, pluginsWithBindings: J } = V(() => {
7239
+ }, [_, b]);
7240
+ const { panelRegistry: S, commandRegistry: G, catalogRegistry: W, surfaceResolverRegistry: U, pluginMetas: ee, pluginsWithBindings: Y } = K(() => {
7206
7241
  const oe = new ta(c), de = new yc(), we = new vr(), ie = new yr();
7207
7242
  for (const A of Ol) {
7208
- const { id: _, ...q } = A;
7209
- oe.register(_, q);
7243
+ const { id: F, ...q } = A;
7244
+ oe.register(F, q);
7210
7245
  }
7211
7246
  const Ce = new Set(r ?? []).has(Mn.pluginId) ? [] : [Mn], Oe = Ti({
7212
- chatPanel: t ?? ru,
7247
+ chatPanel: t ?? su,
7213
7248
  plugins: n ?? [],
7214
7249
  defaults: Ce,
7215
7250
  excludeDefaults: r,
@@ -7224,8 +7259,8 @@ function id({
7224
7259
  ];
7225
7260
  if (o)
7226
7261
  for (const A of o) {
7227
- const { id: _, ...q } = A;
7228
- oe.register(_, q);
7262
+ const { id: F, ...q } = A;
7263
+ oe.register(F, q);
7229
7264
  }
7230
7265
  return {
7231
7266
  panelRegistry: oe,
@@ -7235,65 +7270,65 @@ function id({
7235
7270
  pluginMetas: P,
7236
7271
  pluginsWithBindings: Oe.plugins
7237
7272
  };
7238
- }, [c, t, n, r, o]), le = L(p);
7273
+ }, [c, t, n, r, o]), le = $(p);
7239
7274
  le.current = p;
7240
- const Se = T(
7275
+ const Se = N(
7241
7276
  (oe) => {
7242
7277
  var de;
7243
- w.getState().setTheme(oe), (de = le.current) == null || de.call(le, oe);
7278
+ b.getState().setTheme(oe), (de = le.current) == null || de.call(le, oe);
7244
7279
  },
7245
- [w]
7246
- ), ye = T(() => {
7247
- const oe = w.getState().preferences.theme === "light" ? "dark" : "light";
7280
+ [b]
7281
+ ), ye = N(() => {
7282
+ const oe = b.getState().preferences.theme === "light" ? "dark" : "light";
7248
7283
  Se(oe);
7249
- }, [w, Se]), ge = hn();
7250
- W(() => (document.documentElement.setAttribute("data-theme", ge), () => {
7284
+ }, [b, Se]), ge = hn();
7285
+ z(() => (document.documentElement.setAttribute("data-theme", ge), () => {
7251
7286
  document.documentElement.removeAttribute("data-theme");
7252
7287
  }), [ge]);
7253
- const be = V(
7288
+ const be = K(
7254
7289
  () => ({ setTheme: Se, toggleTheme: ye }),
7255
7290
  [Se, ye]
7256
- ), Be = V(
7257
- () => mu(m, f),
7291
+ ), Be = K(
7292
+ () => yu(m, f),
7258
7293
  [f, m]
7259
7294
  );
7260
- W(() => {
7261
- S && (document.title = nu({ workspaceLabel: g, workspaceId: m }));
7262
- }, [S, m, g]);
7263
- const [Pe, Qe] = j(!1), Re = V(
7295
+ z(() => {
7296
+ k && (document.title = iu({ workspaceLabel: g, workspaceId: m }));
7297
+ }, [k, m, g]);
7298
+ const [Pe, Qe] = j(!1), Ne = K(
7264
7299
  () => ({ connected: Pe }),
7265
7300
  [Pe]
7266
- ), Ze = V(
7267
- () => ({ chatPanel: t ?? null, registeredPlugins: ee, debug: O }),
7268
- [t, ee, O]
7301
+ ), Ze = K(
7302
+ () => ({ chatPanel: t ?? null, registeredPlugins: ee, debug: M }),
7303
+ [t, ee, M]
7269
7304
  );
7270
- return /* @__PURE__ */ u(yn.Provider, { value: Ze, children: /* @__PURE__ */ u(vn.Provider, { value: be, children: /* @__PURE__ */ u(go.Provider, { value: Re, children: /* @__PURE__ */ u(bc, { basePath: k, children: /* @__PURE__ */ u(ol, { children: /* @__PURE__ */ u(Li, { children: /* @__PURE__ */ u(
7305
+ return /* @__PURE__ */ u(yn.Provider, { value: Ze, children: /* @__PURE__ */ u(vn.Provider, { value: be, children: /* @__PURE__ */ u(go.Provider, { value: Ne, children: /* @__PURE__ */ u(bc, { basePath: x, children: /* @__PURE__ */ u(ol, { children: /* @__PURE__ */ u(Li, { children: /* @__PURE__ */ u(
7271
7306
  Ai,
7272
7307
  {
7273
- panelRegistry: E,
7274
- commandRegistry: Y,
7275
- catalogRegistry: z,
7308
+ panelRegistry: S,
7309
+ commandRegistry: G,
7310
+ catalogRegistry: W,
7276
7311
  surfaceResolverRegistry: U,
7277
- children: /* @__PURE__ */ u(Xs, { apiBaseUrl: s, workspaceId: m, authHeaders: Be, children: /* @__PURE__ */ x(
7278
- pu,
7312
+ children: /* @__PURE__ */ u(Xs, { apiBaseUrl: s, workspaceId: m, authHeaders: Be, children: /* @__PURE__ */ w(
7313
+ gu,
7279
7314
  {
7280
- plugins: J,
7315
+ plugins: Y,
7281
7316
  apiBaseUrl: s,
7282
7317
  authHeaders: Be,
7283
7318
  onAuthError: I,
7284
7319
  apiTimeout: l,
7285
7320
  children: [
7286
- /* @__PURE__ */ u(fu, { plugins: J }),
7287
- /* @__PURE__ */ u(ou, { apiBaseUrl: s, workspaceId: m, mode: h, authHeaders: Be }),
7288
- /* @__PURE__ */ u(hu, { onOpenFile: F }),
7289
- /* @__PURE__ */ u(uu, { commands: i }),
7321
+ /* @__PURE__ */ u(mu, { plugins: Y }),
7322
+ /* @__PURE__ */ u(au, { apiBaseUrl: s, workspaceId: m, mode: h, authHeaders: Be }),
7323
+ /* @__PURE__ */ u(vu, { onOpenFile: L }),
7324
+ /* @__PURE__ */ u(pu, { commands: i }),
7290
7325
  /* @__PURE__ */ u(
7291
- du,
7326
+ hu,
7292
7327
  {
7293
7328
  catalogs: a
7294
7329
  }
7295
7330
  ),
7296
- /* @__PURE__ */ u(lu, { store: w }),
7331
+ /* @__PURE__ */ u(fu, { store: b }),
7297
7332
  /* @__PURE__ */ u(zc, {}),
7298
7333
  /* @__PURE__ */ u(pi, {}),
7299
7334
  e,
@@ -7311,77 +7346,77 @@ export {
7311
7346
  vr as C,
7312
7347
  ya as D,
7313
7348
  _a as E,
7314
- Na as F,
7315
- K as G,
7349
+ Ra as F,
7350
+ J as G,
7316
7351
  Gi as H,
7317
7352
  te as I,
7318
7353
  Mn as J,
7319
- zu as K,
7354
+ Uu as K,
7320
7355
  na as L,
7321
7356
  gt as M,
7322
7357
  Hi as N,
7323
7358
  qi as O,
7324
7359
  xa as P,
7325
- Wu as Q,
7360
+ Bu as Q,
7326
7361
  Ai as R,
7327
7362
  yl as S,
7328
- rd as T,
7363
+ sd as T,
7329
7364
  ds as U,
7330
7365
  ji as V,
7331
7366
  Je as W,
7332
7367
  Bi as X,
7333
- Au as Y,
7334
- Du as Z,
7368
+ Fu as Y,
7369
+ Lu as Z,
7335
7370
  Ye as _,
7336
- _u as a,
7371
+ $u as a,
7337
7372
  $t as a0,
7338
7373
  _i as a1,
7339
7374
  ln as a2,
7340
7375
  Di as a3,
7341
- $u as a4,
7342
- Mu as a5,
7376
+ Wu as a4,
7377
+ ju as a5,
7343
7378
  Wa as a6,
7344
7379
  Zt as a7,
7345
7380
  Br as a8,
7346
- Bu as a9,
7347
- Xu as aA,
7348
- Vu as aB,
7349
- Zu as aC,
7350
- Qu as aD,
7381
+ Hu as a9,
7382
+ ed as aA,
7383
+ Yu as aB,
7384
+ nd as aC,
7385
+ td as aD,
7351
7386
  Si as aE,
7352
7387
  De as aF,
7353
7388
  Qt as aG,
7354
7389
  Jc as aH,
7355
- ju as aI,
7356
- td as aJ,
7390
+ qu as aI,
7391
+ od as aJ,
7357
7392
  Te as aK,
7358
- Ru as aa,
7393
+ _u as aa,
7359
7394
  ra as ab,
7360
- Uu as ac,
7395
+ Gu as ac,
7361
7396
  jr as ad,
7362
- Lu as ae,
7397
+ Mu as ae,
7363
7398
  xc as af,
7364
- Tu as ag,
7365
- Ou as ah,
7399
+ Du as ag,
7400
+ zu as ah,
7366
7401
  br as ai,
7367
- nd as aj,
7402
+ id as aj,
7368
7403
  hn as ak,
7369
7404
  ro as al,
7370
- od as am,
7371
- cu as an,
7372
- su as ao,
7373
- au as ap,
7405
+ ad as am,
7406
+ du as an,
7407
+ lu as ao,
7408
+ uu as ap,
7374
7409
  Xe as aq,
7375
7410
  it as ar,
7376
7411
  ve as as,
7377
- Gu as at,
7378
- qu as au,
7379
- Yu as av,
7380
- Hu as aw,
7381
- Ju as ax,
7382
- ed as ay,
7383
- Ku as az,
7384
- Fu as b,
7412
+ Ju as at,
7413
+ Vu as au,
7414
+ Zu as av,
7415
+ Ku as aw,
7416
+ Qu as ax,
7417
+ rd as ay,
7418
+ Xu as az,
7419
+ Ou as b,
7385
7420
  Fn as c,
7386
7421
  zc as d,
7387
7422
  yc as e,
@@ -7396,7 +7431,7 @@ export {
7396
7431
  co as n,
7397
7432
  $s as o,
7398
7433
  xr as p,
7399
- id as q,
7434
+ cd as q,
7400
7435
  ls as r,
7401
7436
  $r as s,
7402
7437
  Ti as t,