@hachej/boring-workspace 0.1.27 → 0.1.29

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.
@@ -1,29 +1,29 @@
1
- var Qr = Object.defineProperty;
2
- var Zr = (e, t, n) => t in e ? Qr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var q = (e, t, n) => Zr(e, typeof t != "symbol" ? t + "" : t, n);
4
- import * as eo from "react/jsx-runtime";
5
- import { jsx as u, jsxs as E, Fragment as $e } from "react/jsx-runtime";
6
- import * as to from "react";
7
- import { useRef as N, useMemo as G, useContext as ce, createContext as be, useSyncExternalStore as tt, useState as O, useCallback as I, Component as no, useEffect as _, lazy as lt, createElement as Ae, Suspense as Et, Fragment as ro } from "react";
8
- import { AlertTriangleIcon as oo, ImageIcon as ze, FileTextIcon as ye, FileJsonIcon as dn, FileCodeIcon as re, FileIcon as It, Loader2 as so, X as Kn, FolderTree as Pt, TerminalIcon as Jt, ClockIcon as io, ArrowUp as ao, ArrowDown as co, CornerDownLeft as lo, Plus as uo, ChevronLeft as Gn, PanelLeft as fo, Search as fn, ChevronRight as Hn } from "lucide-react";
9
- import { Notice as Jn, IconButton as we, LoadingState as po, Input as Yn, toast as Ne, ErrorState as et, Skeleton as mo, Spinner as Tt, Button as _e, AlertDialog as ho, AlertDialogContent as go, AlertDialogHeader as vo, AlertDialogTitle as yo, AlertDialogDescription as wo, AlertDialogFooter as bo, AlertDialogCancel as So, AlertDialogAction as xo, EmptyState as Xn, Kbd as Ze, Dialog as ko, DialogContent as Po, DialogHeader as Co, DialogTitle as Eo, DialogDescription as Io, Command as To, CommandList as No, CommandEmpty as Ro, CommandInput as Ao, CommandGroup as Yt, CommandItem as Nt, CommandShortcut as Fo, Tabs as Do, TabsList as Lo, TabsTrigger as _o, Toaster as $o } from "@hachej/boring-ui-kit";
10
- import { useStore as Oe, create as Oo } from "zustand";
11
- import { persist as Mo } from "zustand/middleware";
1
+ var Yr = Object.defineProperty;
2
+ var Xr = (e, t, n) => t in e ? Yr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var q = (e, t, n) => Xr(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import * as Qr from "react/jsx-runtime";
5
+ import { jsx as u, jsxs as C, Fragment as $e } from "react/jsx-runtime";
6
+ import * as Zr from "react";
7
+ import { useRef as N, useMemo as G, useContext as ce, createContext as we, useSyncExternalStore as tt, useState as O, useCallback as I, Component as eo, useEffect as _, lazy as lt, createElement as Ae, Suspense as Et, Fragment as to } from "react";
8
+ import { AlertTriangleIcon as no, ImageIcon as ze, FileTextIcon as ye, FileJsonIcon as fn, FileCodeIcon as re, FileIcon as It, Loader2 as ro, X as Gn, FolderTree as Pt, TerminalIcon as Yt, ClockIcon as oo, ArrowUp as so, ArrowDown as io, CornerDownLeft as ao, Plus as co, ChevronLeft as Hn, PanelLeft as lo, Search as pn, ChevronRight as uo } from "lucide-react";
9
+ import { Notice as Jn, IconButton as Pe, LoadingState as fo, Input as Yn, toast as Ne, ErrorState as et, Skeleton as po, Spinner as Tt, Button as _e, AlertDialog as mo, AlertDialogContent as ho, AlertDialogHeader as go, AlertDialogTitle as vo, AlertDialogDescription as yo, AlertDialogFooter as wo, AlertDialogCancel as bo, AlertDialogAction as So, EmptyState as Xn, Kbd as Ze, Dialog as xo, DialogContent as ko, DialogHeader as Po, DialogTitle as Co, DialogDescription as Eo, Command as Io, CommandList as To, CommandEmpty as No, CommandInput as Ro, CommandGroup as Xt, CommandItem as Nt, CommandShortcut as Ao, Tabs as Fo, TabsList as Do, TabsTrigger as Lo, Toaster as _o } from "@hachej/boring-ui-kit";
10
+ import { useStore as Oe, create as $o } from "zustand";
11
+ import { persist as Oo } from "zustand/middleware";
12
12
  import { z as V } from "zod";
13
- import { useQueryClient as Qn, QueryClient as Wo, QueryClientProvider as zo, useQuery as Xt, useMutation as Rt } from "@tanstack/react-query";
13
+ import { useQueryClient as Qn, QueryClient as Mo, QueryClientProvider as Wo, useQuery as Qt, useMutation as Rt } from "@tanstack/react-query";
14
14
  import { c as oe } from "./utils-B6yFEsav.js";
15
- import { DockviewReact as jo } from "dockview-react";
15
+ import { DockviewReact as zo } from "dockview-react";
16
16
  import "dockview-react/dist/styles/dockview.css";
17
- import * as Bo from "react-dom";
18
- import { createPortal as Uo } from "react-dom";
19
- import * as qo from "react-dom/client";
20
- import * as Vo from "react/jsx-dev-runtime";
17
+ import * as jo from "react-dom";
18
+ import { createPortal as Bo } from "react-dom";
19
+ import * as Uo from "react-dom/client";
20
+ import * as qo from "react/jsx-dev-runtime";
21
21
  class Ut extends Error {
22
22
  constructor(t, n) {
23
23
  super(n), this.kind = t, this.name = "PluginError";
24
24
  }
25
25
  }
26
- function Ko(e) {
26
+ function Vo(e) {
27
27
  if (typeof e != "object" || e === null)
28
28
  throw typeof e == "string" || typeof e == "function" ? new Error(
29
29
  "definePlugin now takes a single declarative config object: definePlugin({ id, label?, panels, commands, leftTabs, surfaceResolvers, setup? }). The legacy positional form was removed — use the new shape."
@@ -40,9 +40,9 @@ function Ko(e) {
40
40
  for (const r of e.catalogs ?? []) n.registerCatalog(r);
41
41
  e.setup && e.setup(n);
42
42
  };
43
- return Go(e.id, t, { label: e.label });
43
+ return Ko(e.id, t, { label: e.label });
44
44
  }
45
- function Go(e, t, n) {
45
+ function Ko(e, t, n) {
46
46
  const r = t.pluginId;
47
47
  if (r !== void 0 && r !== e)
48
48
  throw new Error(`definePlugin: factory already branded as "${r}", cannot rebrand as "${e}"`);
@@ -100,7 +100,7 @@ function Zn(e = {}) {
100
100
  }
101
101
  };
102
102
  }
103
- function Ho(e) {
103
+ function Go(e) {
104
104
  if (typeof e != "function" || typeof e.pluginId != "string" || e.pluginId.length === 0)
105
105
  throw new Error(
106
106
  "WorkspaceProvider.plugins accepts plugins created by definePlugin({ id, ... }). Received a front plugin without a pluginId."
@@ -114,7 +114,7 @@ function Ho(e) {
114
114
  registrations: t.flush()
115
115
  };
116
116
  }
117
- function Jo(e, t) {
117
+ function Ho(e, t) {
118
118
  return {
119
119
  title: e.label ?? e.id,
120
120
  component: e.component,
@@ -129,7 +129,7 @@ function Jo(e, t) {
129
129
  ...e.supportsFullPage !== void 0 ? { supportsFullPage: e.supportsFullPage } : {}
130
130
  };
131
131
  }
132
- function Yo(e, t) {
132
+ function Jo(e, t) {
133
133
  return {
134
134
  title: e.title,
135
135
  component: e.component ?? (() => null),
@@ -142,7 +142,7 @@ function Yo(e, t) {
142
142
  ...e.chromeless !== void 0 ? { chromeless: e.chromeless } : {}
143
143
  };
144
144
  }
145
- function Xo(e, t) {
145
+ function Yo(e, t) {
146
146
  return {
147
147
  id: e.id,
148
148
  title: e.title,
@@ -154,7 +154,7 @@ function Xo(e, t) {
154
154
  ...e.when ? { when: e.when } : {}
155
155
  };
156
156
  }
157
- function Qo(e, t) {
157
+ function Xo(e, t) {
158
158
  return {
159
159
  id: e.id ?? `${t}:${e.kind}`,
160
160
  config: {
@@ -167,23 +167,23 @@ function Qo(e, t) {
167
167
  }
168
168
  };
169
169
  }
170
- function Zo(e, t) {
170
+ function Qo(e, t) {
171
171
  var r;
172
172
  const { registrations: n } = e;
173
173
  for (const o of n.panels)
174
- t.panels.register(o.id, Jo(o, e.id));
174
+ t.panels.register(o.id, Ho(o, e.id));
175
175
  for (const o of n.leftTabs)
176
- t.panels.register(o.id, Yo(o, e.id));
176
+ t.panels.register(o.id, Jo(o, e.id));
177
177
  for (const o of n.panelCommands)
178
- t.commands.registerCommand(Xo(o, e.id));
178
+ t.commands.registerCommand(Yo(o, e.id));
179
179
  for (const o of n.catalogs)
180
180
  t.catalogs.register(o, e.id);
181
181
  for (const o of n.surfaceResolvers) {
182
- const { id: s, config: i } = Qo(o, e.id);
182
+ const { id: s, config: i } = Xo(o, e.id);
183
183
  (r = t.surfaceResolvers) == null || r.register(s, i);
184
184
  }
185
185
  }
186
- function es(e) {
186
+ function Zo(e) {
187
187
  if (!e.chatPanel)
188
188
  throw new Ut("validation", "bootstrap requires chatPanel");
189
189
  const t = new Set(e.excludeDefaults ?? []), n = [
@@ -200,15 +200,15 @@ function es(e) {
200
200
  );
201
201
  r.add(s.pluginId);
202
202
  }
203
- const o = n.map(Ho);
203
+ const o = n.map(Go);
204
204
  for (const s of o)
205
- Zo(s, e.registries);
205
+ Qo(s, e.registries);
206
206
  return {
207
207
  registered: o.map((s) => s.id),
208
208
  plugins: o
209
209
  };
210
210
  }
211
- function ts() {
211
+ function es() {
212
212
  return !1;
213
213
  }
214
214
  class er {
@@ -221,7 +221,7 @@ class er {
221
221
  this.listeners.delete(t);
222
222
  }));
223
223
  q(this, "getSnapshot", () => (this.snapshotCache || (this.snapshotCache = Array.from(this.catalogs.values())), this.snapshotCache));
224
- this.warnOnDuplicate = t.warnOnDuplicate ?? ts();
224
+ this.warnOnDuplicate = t.warnOnDuplicate ?? es();
225
225
  }
226
226
  register(t, n) {
227
227
  this.catalogs.has(t.id) && this.warnOnDuplicate && console.warn(
@@ -355,8 +355,8 @@ class tr {
355
355
  for (const t of [...this.listeners]) t();
356
356
  }
357
357
  }
358
- const ut = be(null);
359
- function ns({
358
+ const ut = we(null);
359
+ function ts({
360
360
  panelRegistry: e,
361
361
  commandRegistry: t,
362
362
  catalogRegistry: n,
@@ -381,7 +381,7 @@ function At() {
381
381
  if (!e) throw new Error("useRegistry must be used within a RegistryProvider");
382
382
  return e.panelRegistry;
383
383
  }
384
- function Qt() {
384
+ function Zt() {
385
385
  const e = ce(ut);
386
386
  if (!e) throw new Error("useCommandRegistry must be used within a RegistryProvider");
387
387
  return e.commandRegistry;
@@ -396,23 +396,23 @@ function nr() {
396
396
  if (!e) throw new Error("useSurfaceResolverRegistry must be used within a RegistryProvider");
397
397
  return e.surfaceResolverRegistry;
398
398
  }
399
- function rs() {
400
- const e = Qt();
399
+ function ns() {
400
+ const e = Zt();
401
401
  return tt(e.subscribe, e.getSnapshot);
402
402
  }
403
- function os() {
403
+ function rs() {
404
404
  const e = Ft();
405
405
  return tt(e.subscribe, e.getSnapshot);
406
406
  }
407
- function ss({ pluginId: e, message: t, kind: n }) {
407
+ function os({ pluginId: e, message: t, kind: n }) {
408
408
  return /* @__PURE__ */ u(
409
409
  Jn,
410
410
  {
411
411
  tone: "error",
412
- icon: /* @__PURE__ */ u(oo, { className: "size-4" }),
412
+ icon: /* @__PURE__ */ u(no, { className: "size-4" }),
413
413
  className: "py-2",
414
- description: /* @__PURE__ */ E("span", { className: "block min-w-0 truncate", children: [
415
- /* @__PURE__ */ E("span", { className: "font-medium", children: [
414
+ description: /* @__PURE__ */ C("span", { className: "block min-w-0 truncate", children: [
415
+ /* @__PURE__ */ C("span", { className: "font-medium", children: [
416
416
  "[",
417
417
  e,
418
418
  "]"
@@ -425,22 +425,22 @@ function ss({ pluginId: e, message: t, kind: n }) {
425
425
  }
426
426
  );
427
427
  }
428
- const Zt = be(null);
429
- function is({ children: e }) {
428
+ const en = we(null);
429
+ function ss({ children: e }) {
430
430
  const [t, n] = O([]), r = I((s) => {
431
431
  n((i) => [...i, s]);
432
432
  }, []), o = G(
433
433
  () => ({ errors: t, reportPluginError: r }),
434
434
  [t, r]
435
435
  );
436
- return /* @__PURE__ */ u(Zt.Provider, { value: o, children: e });
436
+ return /* @__PURE__ */ u(en.Provider, { value: o, children: e });
437
437
  }
438
438
  function bl() {
439
- const e = ce(Zt);
439
+ const e = ce(en);
440
440
  if (!e) throw new Error("usePluginErrors must be used within a PluginErrorProvider");
441
441
  return e;
442
442
  }
443
- class Dt extends no {
443
+ class Dt extends eo {
444
444
  constructor() {
445
445
  super(...arguments);
446
446
  q(this, "state", { error: null });
@@ -456,13 +456,13 @@ class Dt extends no {
456
456
  contributionKind: this.props.contributionKind,
457
457
  contributionId: this.props.contributionId,
458
458
  error: n,
459
- componentStack: r.componentStack ? as(r.componentStack, 5) : null
459
+ componentStack: r.componentStack ? is(r.componentStack, 5) : null
460
460
  };
461
461
  (s = this.context) == null || s.reportPluginError(o);
462
462
  }
463
463
  render() {
464
464
  return this.state.error ? /* @__PURE__ */ u(
465
- ss,
465
+ os,
466
466
  {
467
467
  pluginId: this.props.pluginId,
468
468
  message: this.state.error.message,
@@ -471,42 +471,42 @@ class Dt extends no {
471
471
  ) : this.props.children;
472
472
  }
473
473
  }
474
- q(Dt, "contextType", Zt);
475
- function as(e, t) {
474
+ q(Dt, "contextType", en);
475
+ function is(e, t) {
476
476
  return e.split(`
477
477
  `).filter((r) => r.trim()).slice(0, t).join(`
478
478
  `);
479
479
  }
480
- const cs = 1024, ls = 500, us = /^[a-zA-Z0-9_-]+$/, ds = 64, mt = 50, pn = 16384, en = V.string().min(1).max(cs).refine((e) => !e.includes(".."), "path traversal not allowed").refine((e) => !e.includes("\0"), "null bytes not allowed"), fs = V.object({
481
- path: en,
480
+ const as = 1024, cs = 500, ls = /^[a-zA-Z0-9_-]+$/, us = 64, mt = 50, mn = 16384, tn = V.string().min(1).max(as).refine((e) => !e.includes(".."), "path traversal not allowed").refine((e) => !e.includes("\0"), "null bytes not allowed"), ds = V.object({
481
+ path: tn,
482
482
  mode: V.enum(["view", "edit", "diff"]).optional()
483
- }), ps = V.object({
484
- id: V.string().max(ds).regex(us, "invalid panel ID"),
483
+ }), fs = V.object({
484
+ id: V.string().max(us).regex(ls, "invalid panel ID"),
485
485
  component: V.string().min(1),
486
486
  params: V.record(V.unknown()).optional().refine(
487
487
  (e) => {
488
488
  if (!e) return !0;
489
489
  try {
490
- return new TextEncoder().encode(JSON.stringify(e)).byteLength <= pn;
490
+ return new TextEncoder().encode(JSON.stringify(e)).byteLength <= mn;
491
491
  } catch {
492
492
  return !1;
493
493
  }
494
494
  },
495
- `params must be JSON-serializable and under ${pn} bytes`
495
+ `params must be JSON-serializable and under ${mn} bytes`
496
496
  ),
497
497
  title: V.string().max(200).optional()
498
- }), ms = V.object({
498
+ }), ps = V.object({
499
499
  id: V.string().min(1)
500
- }), hs = V.object({
501
- msg: V.string().max(ls),
500
+ }), ms = V.object({
501
+ msg: V.string().max(cs),
502
502
  level: V.enum(["info", "warn", "error"]).optional()
503
- }), gs = V.object({
504
- file: en,
503
+ }), hs = V.object({
504
+ file: tn,
505
505
  line: V.number().int().positive()
506
- }), vs = V.object({
507
- path: en
506
+ }), gs = V.object({
507
+ path: tn
508
508
  });
509
- function ys(e) {
509
+ function vs(e) {
510
510
  let t = 0;
511
511
  const n = /* @__PURE__ */ new Map();
512
512
  function r() {
@@ -542,7 +542,7 @@ function ys(e) {
542
542
  return e.getState().visibleFiles;
543
543
  },
544
544
  async openFile(l, d) {
545
- const a = fs.safeParse({ path: l, mode: d == null ? void 0 : d.mode });
545
+ const a = ds.safeParse({ path: l, mode: d == null ? void 0 : d.mode });
546
546
  if (!a.success) return s("VALIDATION", a.error.issues[0].message);
547
547
  const f = e.getState(), p = a.data.mode ?? "edit", h = `file:${l}`;
548
548
  if (f.panels.find((y) => y.id === h)) {
@@ -552,7 +552,7 @@ function ys(e) {
552
552
  return f.panels.length >= mt ? s("MAX_PANELS", `cannot exceed ${mt} open panels`) : (f.openFile(l, h), f.openPanel({ id: h, component: "editor", params: { path: l, mode: p } }), i("file:opened", { path: l, mode: p }), i("panel:opened", { panelId: h, params: { path: l, mode: p } }), o());
553
553
  },
554
554
  async openPanel(l) {
555
- const d = ps.safeParse(l);
555
+ const d = fs.safeParse(l);
556
556
  if (!d.success) return s("VALIDATION", d.error.issues[0].message);
557
557
  const a = e.getState();
558
558
  if (a.panels.find((p) => p.id === l.id)) {
@@ -566,7 +566,7 @@ function ys(e) {
566
566
  }), i("panel:opened", { panelId: l.id, params: l.params ?? {} }), o());
567
567
  },
568
568
  async closePanel(l) {
569
- const d = ms.safeParse({ id: l });
569
+ const d = ps.safeParse({ id: l });
570
570
  if (!d.success) return s("VALIDATION", d.error.issues[0].message);
571
571
  const a = e.getState(), f = a.panels.find((p) => p.id === l);
572
572
  return f ? f.essential ? s("ESSENTIAL", `panel ${l} is essential and cannot be closed`) : (a.closePanel(l), i("panel:closed", { panelId: l }), o()) : s("NOT_FOUND", `panel ${l} not found`);
@@ -575,19 +575,19 @@ function ys(e) {
575
575
  return e.getState().setSidebar({ collapsed: !0 }), i("sidebar:toggled", { collapsed: !0 }), o();
576
576
  },
577
577
  async showNotification(l, d = "info") {
578
- const a = hs.safeParse({ msg: l, level: d });
578
+ const a = ms.safeParse({ msg: l, level: d });
579
579
  if (!a.success) return s("VALIDATION", a.error.issues[0].message);
580
580
  const f = a.data.level ?? "info", p = f === "warn" ? "warning" : f;
581
581
  return e.getState().showNotification({ message: a.data.msg, type: p }), i("notification:shown", { message: a.data.msg, level: f }), o();
582
582
  },
583
583
  async navigateToLine(l, d) {
584
- const a = gs.safeParse({ file: l, line: d });
584
+ const a = hs.safeParse({ file: l, line: d });
585
585
  if (!a.success) return s("VALIDATION", a.error.issues[0].message);
586
586
  const f = await c.openFile(l);
587
587
  return f.status === "error" ? f : (e.getState().navigateToLine(l, a.data.line), o());
588
588
  },
589
589
  async expandToFile(l) {
590
- const d = vs.safeParse({ path: l });
590
+ const d = gs.safeParse({ path: l });
591
591
  if (!d.success) return s("VALIDATION", d.error.issues[0].message);
592
592
  const a = e.getState();
593
593
  return a.sidebar.collapsed && (a.setSidebar({ collapsed: !1 }), i("sidebar:toggled", { collapsed: !1 })), i("tree:expand", { path: d.data.path }), o();
@@ -614,12 +614,12 @@ function ys(e) {
614
614
  };
615
615
  return c;
616
616
  }
617
- const ws = 100, bs = 3e3;
618
- function mn(e) {
617
+ const ys = 100, ws = 3e3;
618
+ function hn(e) {
619
619
  const t = { "Content-Type": "application/json" };
620
620
  return e && (t.Authorization = `Bearer ${e}`), t;
621
621
  }
622
- function Ss(e, t) {
622
+ function bs(e, t) {
623
623
  const n = e.getState();
624
624
  return {
625
625
  v: 1,
@@ -631,7 +631,7 @@ function Ss(e, t) {
631
631
  dirtyFiles: Object.keys(n.dirtyFiles)
632
632
  };
633
633
  }
634
- async function hn(e, t, n) {
634
+ async function gn(e, t, n) {
635
635
  switch (t) {
636
636
  case "openFile":
637
637
  await e.openFile(
@@ -676,14 +676,14 @@ async function hn(e, t, n) {
676
676
  break;
677
677
  }
678
678
  }
679
- function xs(e) {
679
+ function Ss(e) {
680
680
  const {
681
681
  endpoint: t,
682
682
  bridge: n,
683
683
  store: r,
684
684
  authToken: o,
685
685
  pollMode: s = !1,
686
- pollInterval: i = bs,
686
+ pollInterval: i = ws,
687
687
  onAuthError: c,
688
688
  onVersionMismatch: l,
689
689
  onConnectionChange: d
@@ -694,11 +694,11 @@ function xs(e) {
694
694
  }
695
695
  async function F(R) {
696
696
  if (y) return;
697
- const W = Ss(r, R);
697
+ const W = bs(r, R);
698
698
  try {
699
699
  const $ = await fetch(`${t}/api/v1/ui/state`, {
700
700
  method: "PUT",
701
- headers: mn(o),
701
+ headers: hn(o),
702
702
  body: JSON.stringify(W)
703
703
  });
704
704
  if (y) return;
@@ -709,7 +709,7 @@ function xs(e) {
709
709
  function v(R) {
710
710
  p !== null && clearTimeout(p), p = setTimeout(() => {
711
711
  p = null, F(R);
712
- }, ws);
712
+ }, ys);
713
713
  }
714
714
  function T(R, W) {
715
715
  if (!y)
@@ -729,7 +729,7 @@ function xs(e) {
729
729
  l == null || l($.v);
730
730
  return;
731
731
  }
732
- w++, hn(n, $.kind, $.params).finally(() => {
732
+ w++, gn(n, $.kind, $.params).finally(() => {
733
733
  w--;
734
734
  });
735
735
  break;
@@ -765,7 +765,7 @@ function xs(e) {
765
765
  async function L() {
766
766
  if (!y)
767
767
  try {
768
- const R = `${t}/api/v1/ui/commands/next?poll=true`, W = await fetch(R, { headers: mn(o) });
768
+ const R = `${t}/api/v1/ui/commands/next?poll=true`, W = await fetch(R, { headers: hn(o) });
769
769
  if (y) return;
770
770
  if (W.status === 401 || W.status === 403) {
771
771
  c == null || c(W.status);
@@ -782,7 +782,7 @@ function xs(e) {
782
782
  }
783
783
  w++;
784
784
  try {
785
- await hn(n, te.kind, te.params);
785
+ await gn(n, te.kind, te.params);
786
786
  } finally {
787
787
  w--;
788
788
  }
@@ -811,7 +811,7 @@ function xs(e) {
811
811
  }
812
812
  };
813
813
  }
814
- const ks = /* @__PURE__ */ new Set([
814
+ const xs = /* @__PURE__ */ new Set([
815
815
  "openFile",
816
816
  "openSurface",
817
817
  "openPanel",
@@ -830,7 +830,7 @@ function rr(e, t) {
830
830
  if (n !== null && typeof n == "object" && !Array.isArray(n))
831
831
  return n;
832
832
  }
833
- function Ps(e) {
833
+ function ks(e) {
834
834
  const t = Je(e, "kind"), n = Je(e, "target");
835
835
  return !t || !n ? null : {
836
836
  kind: t,
@@ -838,8 +838,8 @@ function Ps(e) {
838
838
  meta: rr(e, "meta")
839
839
  };
840
840
  }
841
- const Cs = 60;
842
- function Re(e, t, n = Cs) {
841
+ const Ps = 60;
842
+ function Re(e, t, n = Ps) {
843
843
  const r = e.surface();
844
844
  if (r) {
845
845
  t(r);
@@ -849,7 +849,7 @@ function Re(e, t, n = Cs) {
849
849
  }
850
850
  function qt(e, t) {
851
851
  var n;
852
- if (ks.has(e.kind))
852
+ if (xs.has(e.kind))
853
853
  switch (e.kind) {
854
854
  case "openFile": {
855
855
  const r = Je(e.params, "path");
@@ -870,7 +870,7 @@ function qt(e, t) {
870
870
  return;
871
871
  }
872
872
  case "openSurface": {
873
- const r = Ps(e.params);
873
+ const r = ks(e.params);
874
874
  if (!r) return;
875
875
  const o = !t.isWorkbenchOpen();
876
876
  o && (r.meta = { ...r.meta ?? {}, closeWorkbenchOnDone: !0 }, t.openWorkbench());
@@ -934,7 +934,7 @@ function qt(e, t) {
934
934
  }
935
935
  }
936
936
  }
937
- function Es() {
937
+ function Cs() {
938
938
  const e = /* @__PURE__ */ new Map();
939
939
  function t(o, s) {
940
940
  let i = e.get(o);
@@ -955,18 +955,18 @@ function Es() {
955
955
  }
956
956
  return { on: t, emit: n, _reset: r };
957
957
  }
958
- const Is = "workspace:ui.command", Ts = "workspace:editor.save.start", Ns = "workspace:editor.save.end", Rs = "workspace:panel.update", As = "workspace:panel.close", Fs = "workspace:agent.data", me = {
959
- uiCommand: Is,
960
- editorSaveStart: Ts,
961
- editorSaveEnd: Ns,
962
- panelUpdate: Rs,
963
- panelClose: As,
964
- agentData: Fs
958
+ const Es = "workspace:ui.command", Is = "workspace:editor.save.start", Ts = "workspace:editor.save.end", Ns = "workspace:panel.update", Rs = "workspace:panel.close", As = "workspace:agent.data", me = {
959
+ uiCommand: Es,
960
+ editorSaveStart: Is,
961
+ editorSaveEnd: Ts,
962
+ panelUpdate: Ns,
963
+ panelClose: Rs,
964
+ agentData: As
965
965
  };
966
966
  function nt() {
967
967
  return { cause: "user", ts: Date.now() };
968
968
  }
969
- function Ds(e) {
969
+ function Fs(e) {
970
970
  return { cause: "agent", toolCallId: e, ts: Date.now() };
971
971
  }
972
972
  function rt(e) {
@@ -976,15 +976,15 @@ function Vt(e, t) {
976
976
  const n = N(t);
977
977
  n.current = t, _(() => K.on(e, (r) => n.current(r)), [e]);
978
978
  }
979
- function Ls(e) {
979
+ function Ds(e) {
980
980
  K.emit(me.agentData, { ts: Date.now(), part: e });
981
981
  }
982
- const K = Es(), _s = "boring-workspace:ui-command";
982
+ const K = Cs(), Ls = "boring-workspace:ui-command";
983
983
  function or(e) {
984
- K.emit(me.uiCommand, { ...nt(), command: e }), typeof globalThis.dispatchEvent == "function" && typeof CustomEvent < "u" && globalThis.dispatchEvent(new CustomEvent(_s, { detail: e }));
984
+ K.emit(me.uiCommand, { ...nt(), command: e }), typeof globalThis.dispatchEvent == "function" && typeof CustomEvent < "u" && globalThis.dispatchEvent(new CustomEvent(Ls, { detail: e }));
985
985
  }
986
- const $s = 1500, Os = 1e3, Ms = 5;
987
- function gn(e, t) {
986
+ const _s = 1500, $s = 1e3, Os = 5;
987
+ function vn(e, t) {
988
988
  if (!t) return e;
989
989
  const n = new URLSearchParams();
990
990
  for (const [o, s] of Object.entries(t))
@@ -992,8 +992,8 @@ function gn(e, t) {
992
992
  const r = n.toString();
993
993
  return r ? `${e}${e.includes("?") ? "&" : "?"}${r}` : e;
994
994
  }
995
- function Ws(e) {
996
- const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), s = e.fetcher ?? (typeof fetch < "u" ? fetch : null), i = e.reconnectDelayMs ?? Os, c = e.maxReconnects ?? Ms, l = e.pollIntervalMs ?? $s;
995
+ function Ms(e) {
996
+ const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), s = e.fetcher ?? (typeof fetch < "u" ? fetch : null), i = e.reconnectDelayMs ?? $s, c = e.maxReconnects ?? Os, l = e.pollIntervalMs ?? _s;
997
997
  let d = !1, a = null, f = null, p = null, h = null, g = 0, y = !1;
998
998
  function w(v) {
999
999
  v && typeof v == "object" && typeof v.kind == "string" && qt(v, n);
@@ -1005,7 +1005,7 @@ function Ws(e) {
1005
1005
  if (!d) {
1006
1006
  p = new AbortController();
1007
1007
  try {
1008
- const T = await s(gn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1008
+ const T = await s(vn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1009
1009
  signal: p.signal
1010
1010
  });
1011
1011
  if (d) return;
@@ -1028,7 +1028,7 @@ function Ws(e) {
1028
1028
  m();
1029
1029
  return;
1030
1030
  }
1031
- a = new o(gn(`${t}/api/v1/ui/commands/next`, r)), a.addEventListener("command", (v) => {
1031
+ a = new o(vn(`${t}/api/v1/ui/commands/next`, r)), a.addEventListener("command", (v) => {
1032
1032
  const T = v.data;
1033
1033
  if (!(typeof T != "string" || T.length === 0))
1034
1034
  try {
@@ -1052,14 +1052,14 @@ function Ws(e) {
1052
1052
  d = !0, a && (a.close(), a = null), f && (clearTimeout(f), f = null), p && (p.abort(), p = null), h && (clearTimeout(h), h = null);
1053
1053
  };
1054
1054
  }
1055
- const zs = 1e4, js = 3, Bs = 1e3;
1056
- function vn(e) {
1055
+ const Ws = 1e4, zs = 3, js = 1e3;
1056
+ function yn(e) {
1057
1057
  return e >= 500;
1058
1058
  }
1059
- function Us(e) {
1059
+ function Bs(e) {
1060
1060
  return new Promise((t) => setTimeout(t, e));
1061
1061
  }
1062
- class qs {
1062
+ class Us {
1063
1063
  constructor(t) {
1064
1064
  q(this, "baseUrl");
1065
1065
  q(this, "headers");
@@ -1072,14 +1072,14 @@ class qs {
1072
1072
  const n = { ...t.authHeaders };
1073
1073
  for (const r of Object.keys(n))
1074
1074
  r.toLowerCase() === "content-type" && delete n[r];
1075
- this.headers = n, this.onAuthError = t.onAuthError, this.onTimeout = t.onTimeout, this.timeout = t.timeout ?? zs, this.maxRetries = t.maxRetries ?? js, this.retryBaseMs = t.retryBaseMs ?? Bs;
1075
+ this.headers = n, this.onAuthError = t.onAuthError, this.onTimeout = t.onTimeout, this.timeout = t.timeout ?? Ws, this.maxRetries = t.maxRetries ?? zs, this.retryBaseMs = t.retryBaseMs ?? js;
1076
1076
  }
1077
1077
  async request(t, n, r, o, s) {
1078
1078
  var l, d;
1079
1079
  const i = o ?? this.timeout;
1080
1080
  let c = null;
1081
1081
  for (let a = 0; a <= this.maxRetries; a++) {
1082
- a > 0 && await Us(this.retryBaseMs * 2 ** (a - 1));
1082
+ a > 0 && await Bs(this.retryBaseMs * 2 ** (a - 1));
1083
1083
  const f = new AbortController(), p = () => f.abort();
1084
1084
  s == null || s.addEventListener("abort", p, { once: !0 });
1085
1085
  const h = setTimeout(() => f.abort(), i);
@@ -1092,12 +1092,12 @@ class qs {
1092
1092
  });
1093
1093
  if (clearTimeout(h), s == null || s.removeEventListener("abort", p), y.status === 401 || y.status === 403)
1094
1094
  throw (l = this.onAuthError) == null || l.call(this, y.status), new je(y.status, `Auth error: ${y.status}`);
1095
- if (vn(y.status)) {
1095
+ if (yn(y.status)) {
1096
1096
  c = new je(y.status, `HTTP ${y.status}: ${y.statusText}`);
1097
1097
  continue;
1098
1098
  }
1099
1099
  if (!y.ok) {
1100
- const w = await Vs(y);
1100
+ const w = await qs(y);
1101
1101
  throw new je(
1102
1102
  y.status,
1103
1103
  `HTTP ${y.status}: ${y.statusText}`,
@@ -1106,7 +1106,7 @@ class qs {
1106
1106
  }
1107
1107
  return await y.json();
1108
1108
  } catch (g) {
1109
- if (clearTimeout(h), s == null || s.removeEventListener("abort", p), g instanceof je && !vn(g.status))
1109
+ if (clearTimeout(h), s == null || s.removeEventListener("abort", p), g instanceof je && !yn(g.status))
1110
1110
  throw g;
1111
1111
  if (g instanceof DOMException && g.name === "AbortError") {
1112
1112
  if (s != null && s.aborted)
@@ -1209,7 +1209,7 @@ class at extends Error {
1209
1209
  );
1210
1210
  }
1211
1211
  }
1212
- async function Vs(e) {
1212
+ async function qs(e) {
1213
1213
  try {
1214
1214
  const t = await e.text();
1215
1215
  return t ? JSON.parse(t) : null;
@@ -1217,12 +1217,12 @@ async function Vs(e) {
1217
1217
  return null;
1218
1218
  }
1219
1219
  }
1220
- const Ks = "filesystem:file.changed", Gs = "filesystem:file.created", Hs = "filesystem:file.moved", Js = "filesystem:file.deleted", ee = {
1221
- changed: Ks,
1222
- created: Gs,
1223
- moved: Hs,
1224
- deleted: Js
1225
- }, wt = "filesystem", Kt = "files", bt = Kt, tn = "files", Ys = "filesystem-path", sr = "code-editor", ir = "csv-viewer", ar = "markdown-editor", cr = "image-viewer", lr = "pdf-viewer", ur = "html-viewer", dr = "empty-file-panel";
1220
+ const Vs = "filesystem:file.changed", Ks = "filesystem:file.created", Gs = "filesystem:file.moved", Hs = "filesystem:file.deleted", ee = {
1221
+ changed: Vs,
1222
+ created: Ks,
1223
+ moved: Gs,
1224
+ deleted: Hs
1225
+ }, wt = "filesystem", Kt = "files", bt = Kt, nn = "files", Js = "filesystem-path", Gt = "code-editor", sr = "csv-viewer", ir = "markdown-editor", ar = "image-viewer", cr = "pdf-viewer", lr = "html-viewer", Ys = "empty-file-panel";
1226
1226
  function Xs() {
1227
1227
  const e = Qn(), t = Ye(), n = Xe();
1228
1228
  _(() => {
@@ -1231,9 +1231,9 @@ function Xs() {
1231
1231
  }), o = K.on(ee.created, (c) => {
1232
1232
  $t(e, t, n), c.kind === "file" && ot(e, t, n, c.path);
1233
1233
  }), s = K.on(ee.moved, (c) => {
1234
- $t(e, t, n), ot(e, t, n, c.from), ot(e, t, n, c.to), yn(e, t, n);
1234
+ $t(e, t, n), ot(e, t, n, c.from), ot(e, t, n, c.to), wn(e, t, n);
1235
1235
  }), i = K.on(ee.deleted, (c) => {
1236
- $t(e, t, n), ot(e, t, n, c.path), yn(e, t, n);
1236
+ $t(e, t, n), ot(e, t, n, c.path), wn(e, t, n);
1237
1237
  });
1238
1238
  return () => {
1239
1239
  r(), o(), s(), i();
@@ -1241,12 +1241,12 @@ function Xs() {
1241
1241
  }, [e, t, n]);
1242
1242
  }
1243
1243
  function ot(e, t, n, r) {
1244
- e.invalidateQueries({ queryKey: [t, n, tn, r] }), e.invalidateQueries({ queryKey: [t, n, "stat", r] });
1244
+ e.invalidateQueries({ queryKey: [t, n, nn, r] }), e.invalidateQueries({ queryKey: [t, n, "stat", r] });
1245
1245
  }
1246
1246
  function $t(e, t, n) {
1247
1247
  e.invalidateQueries({ queryKey: [t, n, "tree"] });
1248
1248
  }
1249
- function yn(e, t, n) {
1249
+ function wn(e, t, n) {
1250
1250
  e.invalidateQueries({ queryKey: [t, n, "search"] });
1251
1251
  }
1252
1252
  function Qs() {
@@ -1304,7 +1304,7 @@ function Zs(e) {
1304
1304
  }
1305
1305
  function ei(e) {
1306
1306
  for (const t of e)
1307
- if (t === tn || t === "tree" || t === "stat" || t === "search")
1307
+ if (t === nn || t === "tree" || t === "stat" || t === "search")
1308
1308
  return !0;
1309
1309
  return !1;
1310
1310
  }
@@ -1316,20 +1316,20 @@ function ni(e, t) {
1316
1316
  const n = e.includes("?") ? "&" : "?";
1317
1317
  return `${e}${n}workspaceId=${encodeURIComponent(t)}`;
1318
1318
  }
1319
- const nn = be(null), fr = be(""), pr = be(null);
1319
+ const rn = we(null), ur = we(""), dr = we(null);
1320
1320
  function Me() {
1321
- const e = ce(nn);
1321
+ const e = ce(rn);
1322
1322
  if (!e) throw new Error("useDataClient must be used within a DataProvider");
1323
1323
  return e;
1324
1324
  }
1325
1325
  function Sl() {
1326
- return ce(nn) != null;
1326
+ return ce(rn) != null;
1327
1327
  }
1328
1328
  function Ye() {
1329
- return ce(fr);
1329
+ return ce(ur);
1330
1330
  }
1331
1331
  function Xe() {
1332
- return ce(pr);
1332
+ return ce(dr);
1333
1333
  }
1334
1334
  function ri({
1335
1335
  apiBaseUrl: e,
@@ -1340,7 +1340,7 @@ function ri({
1340
1340
  children: s
1341
1341
  }) {
1342
1342
  const i = N(null);
1343
- i.current || (i.current = new Wo({
1343
+ i.current || (i.current = new Mo({
1344
1344
  defaultOptions: {
1345
1345
  queries: {
1346
1346
  retry: 3,
@@ -1349,10 +1349,10 @@ function ri({
1349
1349
  }
1350
1350
  }));
1351
1351
  const c = G(
1352
- () => o ?? new qs({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
1352
+ () => o ?? new Us({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
1353
1353
  [o, e, t, n, r]
1354
1354
  ), l = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
1355
- return /* @__PURE__ */ u(zo, { client: i.current, children: /* @__PURE__ */ u(fr.Provider, { value: e, children: /* @__PURE__ */ u(pr.Provider, { value: l, children: /* @__PURE__ */ E(nn.Provider, { value: c, children: [
1355
+ return /* @__PURE__ */ u(Wo, { client: i.current, children: /* @__PURE__ */ u(ur.Provider, { value: e, children: /* @__PURE__ */ u(dr.Provider, { value: l, children: /* @__PURE__ */ C(rn.Provider, { value: c, children: [
1356
1356
  /* @__PURE__ */ u(oi, {}),
1357
1357
  s
1358
1358
  ] }) }) }) });
@@ -1360,38 +1360,38 @@ function ri({
1360
1360
  function oi() {
1361
1361
  return Xs(), Qs(), null;
1362
1362
  }
1363
- const mr = /* @__PURE__ */ new Map();
1363
+ const fr = /* @__PURE__ */ new Map();
1364
1364
  function si(e) {
1365
1365
  return (e ?? "").replace(/\/$/, "");
1366
1366
  }
1367
1367
  function ii(e) {
1368
1368
  return e && e.length > 0 ? e : ".";
1369
1369
  }
1370
- function hr(e, t, n) {
1370
+ function pr(e, t, n) {
1371
1371
  return `${si(e)}\0${t ?? ""}\0${ii(n)}`;
1372
1372
  }
1373
1373
  function xl(e, t, n, r) {
1374
- mr.set(hr(e, t, n), r);
1374
+ fr.set(pr(e, t, n), r);
1375
1375
  }
1376
1376
  function ai(e, t, n) {
1377
- return mr.get(hr(e, t, n));
1377
+ return fr.get(pr(e, t, n));
1378
1378
  }
1379
- function rn(e, t) {
1379
+ function on(e, t) {
1380
1380
  return t instanceof je && t.status === 404 ? !1 : e < 3;
1381
1381
  }
1382
1382
  function ci(e) {
1383
1383
  const t = Me(), n = Ye(), r = Xe();
1384
- return Xt({
1385
- queryKey: [n, r, tn, e],
1384
+ return Qt({
1385
+ queryKey: [n, r, nn, e],
1386
1386
  queryFn: ({ signal: o }) => t.getFile(e, o),
1387
1387
  enabled: e != null,
1388
1388
  staleTime: 0,
1389
- retry: rn
1389
+ retry: on
1390
1390
  });
1391
1391
  }
1392
- function gr(e) {
1392
+ function mr(e) {
1393
1393
  const t = Me(), n = Ye(), r = Xe();
1394
- return Xt({
1394
+ return Qt({
1395
1395
  queryKey: [n, r, "tree", e],
1396
1396
  queryFn: async ({ signal: o }) => await t.getTree(e, o) ?? [],
1397
1397
  enabled: e != null,
@@ -1400,19 +1400,19 @@ function gr(e) {
1400
1400
  // File-event SSE invalidates this query when files change. Polling every
1401
1401
  // 3s made slow/dev backends self-abort before the first tree response,
1402
1402
  // leaving the workbench tree stuck on its skeleton.
1403
- retry: rn
1403
+ retry: on
1404
1404
  });
1405
1405
  }
1406
1406
  function li(e, t) {
1407
1407
  const n = Me(), r = Ye(), o = Xe(), [s, i] = O(e), c = N(void 0);
1408
- return _(() => (clearTimeout(c.current), c.current = setTimeout(() => i(e), 300), () => clearTimeout(c.current)), [e]), Xt({
1408
+ return _(() => (clearTimeout(c.current), c.current = setTimeout(() => i(e), 300), () => clearTimeout(c.current)), [e]), Qt({
1409
1409
  queryKey: [r, o, "search", s, t],
1410
1410
  queryFn: ({ signal: l }) => n.search(s, t, l),
1411
1411
  enabled: s.length > 0,
1412
- retry: rn
1412
+ retry: on
1413
1413
  });
1414
1414
  }
1415
- function vr() {
1415
+ function hr() {
1416
1416
  const e = Me();
1417
1417
  return Rt({
1418
1418
  mutationFn: ({ path: t, content: n, expectedMtimeMs: r }) => e.writeFile(t, n, r != null ? { expectedMtimeMs: r } : void 0),
@@ -1588,7 +1588,7 @@ class pi {
1588
1588
  return (n = t.requiresCapabilities) != null && n.length ? t.requiresCapabilities.every((r) => this.capabilities.has(r)) : !0;
1589
1589
  }
1590
1590
  }
1591
- const wn = {
1591
+ const bn = {
1592
1592
  ts: re,
1593
1593
  tsx: re,
1594
1594
  js: re,
@@ -1609,8 +1609,8 @@ const wn = {
1609
1609
  sh: re,
1610
1610
  bash: re,
1611
1611
  zsh: re,
1612
- json: dn,
1613
- jsonl: dn,
1612
+ json: fn,
1613
+ jsonl: fn,
1614
1614
  md: ye,
1615
1615
  mdx: ye,
1616
1616
  txt: ye,
@@ -1635,17 +1635,17 @@ const wn = {
1635
1635
  function mi(e) {
1636
1636
  var n;
1637
1637
  const t = (n = e.split(".").pop()) == null ? void 0 : n.toLowerCase();
1638
- return t && t in wn ? wn[t] : It;
1638
+ return t && t in bn ? bn[t] : It;
1639
1639
  }
1640
1640
  const Be = "workspace.open.path";
1641
- function yr(e, t) {
1641
+ function gr(e, t) {
1642
1642
  const n = [], r = [];
1643
1643
  for (const o of e)
1644
1644
  if (o.kind === "dir") {
1645
1645
  const s = t.get(o.path);
1646
1646
  n.push({
1647
1647
  ...o,
1648
- children: s ? yr(s, t) : []
1648
+ children: s ? gr(s, t) : []
1649
1649
  });
1650
1650
  } else
1651
1651
  r.push({ ...o });
@@ -1665,7 +1665,7 @@ function Mt(e, t) {
1665
1665
  for (const r of t) n.set(r.path, r);
1666
1666
  return Array.from(n.values());
1667
1667
  }
1668
- function wr(e, t, n) {
1668
+ function vr(e, t, n) {
1669
1669
  if (!t || t.kind === "rename") return e;
1670
1670
  const r = {
1671
1671
  name: "",
@@ -1677,20 +1677,20 @@ function wr(e, t, n) {
1677
1677
  var i;
1678
1678
  return s.kind !== "dir" ? s : s.path === o ? { ...s, children: [r, ...s.children ?? []] } : (i = s.children) != null && i.length ? {
1679
1679
  ...s,
1680
- children: wr(s.children, t, n)
1680
+ children: vr(s.children, t, n)
1681
1681
  } : s;
1682
1682
  });
1683
1683
  }
1684
- let Gt = null;
1685
- function br(e) {
1686
- Gt = e;
1684
+ let Ht = null;
1685
+ function yr(e) {
1686
+ Ht = e;
1687
1687
  }
1688
1688
  function We() {
1689
- if (!Gt)
1689
+ if (!Ht)
1690
1690
  throw new Error(
1691
1691
  "Workspace store not initialized. Wrap your app in WorkspaceProvider."
1692
1692
  );
1693
- return Gt;
1693
+ return Ht;
1694
1694
  }
1695
1695
  function kl() {
1696
1696
  return Oe(We(), (e) => e.activeFile);
@@ -1710,7 +1710,7 @@ function Il() {
1710
1710
  function Tl() {
1711
1711
  return Oe(We(), (e) => e.dirtyFiles);
1712
1712
  }
1713
- function on() {
1713
+ function sn() {
1714
1714
  return Oe(We(), (e) => e.preferences.theme);
1715
1715
  }
1716
1716
  function hi() {
@@ -1810,8 +1810,8 @@ function xi(e) {
1810
1810
  var v, T;
1811
1811
  s(null), (v = t.setActive) == null || v.call(t);
1812
1812
  for (const D of f) (T = D.close) == null || T.call(D);
1813
- }, F = o && typeof document < "u" ? Uo(
1814
- /* @__PURE__ */ E(
1813
+ }, F = o && typeof document < "u" ? Bo(
1814
+ /* @__PURE__ */ C(
1815
1815
  "div",
1816
1816
  {
1817
1817
  ref: i,
@@ -1848,8 +1848,8 @@ function xi(e) {
1848
1848
  ),
1849
1849
  document.body
1850
1850
  ) : null;
1851
- return /* @__PURE__ */ E(ro, { children: [
1852
- /* @__PURE__ */ E(
1851
+ return /* @__PURE__ */ C(to, { children: [
1852
+ /* @__PURE__ */ C(
1853
1853
  "div",
1854
1854
  {
1855
1855
  className: oe(
@@ -1864,7 +1864,7 @@ function xi(e) {
1864
1864
  onContextMenu: y,
1865
1865
  children: [
1866
1866
  p ? /* @__PURE__ */ u(
1867
- so,
1867
+ ro,
1868
1868
  {
1869
1869
  "data-testid": "tab-saving-spinner",
1870
1870
  "aria-label": "Saving",
@@ -1893,7 +1893,7 @@ function xi(e) {
1893
1893
  }
1894
1894
  ) : null,
1895
1895
  /* @__PURE__ */ u(
1896
- we,
1896
+ Pe,
1897
1897
  {
1898
1898
  type: "button",
1899
1899
  variant: "ghost",
@@ -1906,7 +1906,7 @@ function xi(e) {
1906
1906
  ),
1907
1907
  onClick: g,
1908
1908
  "aria-label": `Close ${l}`,
1909
- children: /* @__PURE__ */ u(Kn, { className: "h-3 w-3", strokeWidth: 2.25 })
1909
+ children: /* @__PURE__ */ u(Gn, { className: "h-3 w-3", strokeWidth: 2.25 })
1910
1910
  }
1911
1911
  )
1912
1912
  ]
@@ -1915,7 +1915,7 @@ function xi(e) {
1915
1915
  F
1916
1916
  ] });
1917
1917
  }
1918
- const ki = 300, Sr = be(null);
1918
+ const ki = 300, wr = we(null);
1919
1919
  function Pi(e, t) {
1920
1920
  if ("id" in t) return e.id === t.id;
1921
1921
  const n = e.params;
@@ -1925,14 +1925,14 @@ function Pi(e, t) {
1925
1925
  }
1926
1926
  return (n == null ? void 0 : n[t.param]) === t.value;
1927
1927
  }
1928
- function bn(e, t) {
1928
+ function Sn(e, t) {
1929
1929
  const n = Array.isArray(t) ? t : [t], r = /* @__PURE__ */ new Set(), o = [];
1930
1930
  for (const s of e.panels)
1931
1931
  n.some((i) => Pi(s, i)) && (r.has(s.id) || (r.add(s.id), o.push(s)));
1932
1932
  return o;
1933
1933
  }
1934
1934
  function Rl() {
1935
- const e = ce(Sr);
1935
+ const e = ce(wr);
1936
1936
  if (!e)
1937
1937
  throw new Error(
1938
1938
  "useDockviewApi must be used within a DockviewShell"
@@ -2038,7 +2038,7 @@ function Ii(e) {
2038
2038
  maximumHeight: e.constraints.maxHeight
2039
2039
  };
2040
2040
  }
2041
- function Sn(e, t) {
2041
+ function xn(e, t) {
2042
2042
  const n = e.getPanel(t.panel ?? t.id);
2043
2043
  if (!(n != null && n.group)) return;
2044
2044
  const r = Ii(t);
@@ -2068,7 +2068,7 @@ function Ti(e, t, n, r, o, s) {
2068
2068
  }
2069
2069
  for (const a of t.groups) {
2070
2070
  const f = i.getPanel(a.panel ?? a.id);
2071
- f != null && f.group && (a.locked && (f.group.locked = "no-drop-target"), a.hideHeader && (f.group.header.hidden = !0), Sn(i, a));
2071
+ f != null && f.group && (a.locked && (f.group.locked = "no-drop-target"), a.hideHeader && (f.group.header.hidden = !0), xn(i, a));
2072
2072
  }
2073
2073
  const c = t.groups.filter(
2074
2074
  (a) => {
@@ -2080,7 +2080,7 @@ function Ti(e, t, n, r, o, s) {
2080
2080
  if (c.length > 0) {
2081
2081
  const a = () => {
2082
2082
  for (const f of c)
2083
- Sn(i, f);
2083
+ xn(i, f);
2084
2084
  };
2085
2085
  window.addEventListener("resize", a), l = () => window.removeEventListener("resize", a);
2086
2086
  }
@@ -2143,7 +2143,7 @@ function Ni({
2143
2143
  const T = K.on(me.panelUpdate, ({ match: L, params: x, title: U }) => {
2144
2144
  const R = p.current;
2145
2145
  if (R)
2146
- for (const W of bn(R, L))
2146
+ for (const W of Sn(R, L))
2147
2147
  x && W.api.updateParameters({
2148
2148
  ...W.params ?? {},
2149
2149
  ...x
@@ -2151,7 +2151,7 @@ function Ni({
2151
2151
  }), D = K.on(me.panelClose, ({ match: L }) => {
2152
2152
  const x = p.current;
2153
2153
  if (x)
2154
- for (const U of bn(x, L))
2154
+ for (const U of Sn(x, L))
2155
2155
  x.removePanel(U);
2156
2156
  });
2157
2157
  return () => {
@@ -2170,8 +2170,8 @@ function Ni({
2170
2170
  );
2171
2171
  return _(() => {
2172
2172
  f && h.current && (F(h.current), h.current = null);
2173
- }, [f, F]), f ? /* @__PURE__ */ u(Sr.Provider, { value: m, children: /* @__PURE__ */ u(
2174
- jo,
2173
+ }, [f, F]), f ? /* @__PURE__ */ u(wr.Provider, { value: m, children: /* @__PURE__ */ u(
2174
+ zo,
2175
2175
  {
2176
2176
  className: `dv-shell ${s ?? ""}`,
2177
2177
  components: w,
@@ -2184,7 +2184,7 @@ function Ni({
2184
2184
  ) }) : /* @__PURE__ */ u(Ri, {});
2185
2185
  }
2186
2186
  function Ri() {
2187
- return /* @__PURE__ */ u(po, { centered: !0, className: "bg-background", label: "Loading workspace..." });
2187
+ return /* @__PURE__ */ u(fo, { centered: !0, className: "bg-background", label: "Loading workspace..." });
2188
2188
  }
2189
2189
  function Ai(e) {
2190
2190
  return {
@@ -2219,13 +2219,13 @@ function Fi({
2219
2219
  return G(
2220
2220
  () => s ? Ai(s) : null,
2221
2221
  [s]
2222
- ), /* @__PURE__ */ E("div", { className: oe("flex h-full flex-col overflow-hidden", o), children: [
2223
- /* @__PURE__ */ E("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2222
+ ), /* @__PURE__ */ C("div", { className: oe("flex h-full flex-col overflow-hidden", o), children: [
2223
+ /* @__PURE__ */ C("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2224
2224
  t && /* @__PURE__ */ u(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
2225
2225
  /* @__PURE__ */ u("span", { className: "truncate text-sm font-medium", children: e }),
2226
2226
  /* @__PURE__ */ u("div", { className: "flex-1" }),
2227
2227
  !n && s && /* @__PURE__ */ u(
2228
- we,
2228
+ Pe,
2229
2229
  {
2230
2230
  type: "button",
2231
2231
  variant: "ghost",
@@ -2262,15 +2262,15 @@ const Di = [
2262
2262
  ".next",
2263
2263
  ".cache"
2264
2264
  ];
2265
- function Ht(e, t) {
2265
+ function Jt(e, t) {
2266
2266
  for (const n of t)
2267
2267
  if (typeof n == "string" ? n === e : n.test(e)) return !0;
2268
2268
  return !1;
2269
2269
  }
2270
2270
  function Li(e, t) {
2271
- return t.length === 0 ? e : e == null ? void 0 : e.filter((n) => !Ht(n.name, t));
2271
+ return t.length === 0 ? e : e == null ? void 0 : e.filter((n) => !Jt(n.name, t));
2272
2272
  }
2273
- function xr(e) {
2273
+ function br(e) {
2274
2274
  const t = e.trim();
2275
2275
  if (!t) return t;
2276
2276
  const n = /[*?\[\]{}]/.test(t) ? t : `*${t}*`;
@@ -2324,21 +2324,21 @@ async function $i(e) {
2324
2324
  }
2325
2325
  if (!n) throw new Error("Clipboard not available");
2326
2326
  }
2327
- const kr = () => import("./FileTree-DDO-RrZ8.js").then((e) => ({ default: e.FileTree }));
2327
+ const Sr = () => import("./FileTree-DUxjUbxL.js").then((e) => ({ default: e.FileTree }));
2328
2328
  function Oi() {
2329
- kr();
2329
+ Sr();
2330
2330
  }
2331
- const Mi = lt(kr);
2332
- function Pr(e) {
2331
+ const Mi = lt(Sr);
2332
+ function xr(e) {
2333
2333
  return e.trim().replace(/\\/g, "/").replace(/^\.\/+/, "").replace(/^\/+/, "").replace(/\/+/g, "/").replace(/\/+$/, "") || ".";
2334
2334
  }
2335
- function xn(e) {
2336
- const t = Pr(e).split("/").filter(Boolean), n = [];
2335
+ function kn(e) {
2336
+ const t = xr(e).split("/").filter(Boolean), n = [];
2337
2337
  for (let r = 1; r < t.length; r++)
2338
2338
  n.push(t.slice(0, r).join("/"));
2339
2339
  return n;
2340
2340
  }
2341
- function kn({
2341
+ function Pn({
2342
2342
  rootDir: e = ".",
2343
2343
  searchQuery: t,
2344
2344
  bridge: n,
@@ -2346,47 +2346,47 @@ function kn({
2346
2346
  ignoreNames: o = Di,
2347
2347
  className: s
2348
2348
  }) {
2349
- var un;
2350
- const i = Me(), { data: c, error: l, isLoading: d } = gr(e), [a, f] = O(/* @__PURE__ */ new Map()), p = Ot(e), h = G(
2349
+ var dn;
2350
+ const i = Me(), { data: c, error: l, isLoading: d } = mr(e), [a, f] = O(/* @__PURE__ */ new Map()), p = Ot(e), h = G(
2351
2351
  () => Mt(c, a.get(p)),
2352
2352
  [c, a, p]
2353
2353
  ), g = G(
2354
2354
  () => Li(h, o),
2355
2355
  [h, o]
2356
- ), { mutateAsync: y } = vr(), { mutateAsync: w } = ui(), { mutateAsync: m } = di(), { mutateAsync: F } = fi(), [v, T] = O(/* @__PURE__ */ new Map()), D = G(() => {
2356
+ ), { mutateAsync: y } = hr(), { mutateAsync: w } = ui(), { mutateAsync: m } = di(), { mutateAsync: F } = fi(), [v, T] = O(/* @__PURE__ */ new Map()), D = G(() => {
2357
2357
  if (a.size === 0) return v;
2358
2358
  const S = new Map(v);
2359
- for (const [C, A] of a) {
2360
- if (C === p) continue;
2361
- const B = Mt(S.get(C), A);
2362
- B && S.set(C, B);
2359
+ for (const [E, A] of a) {
2360
+ if (E === p) continue;
2361
+ const B = Mt(S.get(E), A);
2362
+ B && S.set(E, B);
2363
2363
  }
2364
2364
  return S;
2365
2365
  }, [v, a, p]), L = N(null), [x, U] = O(400), [R, W] = O(null), [$, te] = O(null), j = N(null), [se, le] = O(
2366
- ((un = n == null ? void 0 : n.getActiveFile) == null ? void 0 : un.call(n)) ?? null
2367
- ), [M, J] = O(null), [H, ue] = O(null), Ce = N(0), pe = N(0), Se = N(0), xe = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Ue } = li(
2368
- xe ? xr(t ?? "") : "",
2366
+ ((dn = n == null ? void 0 : n.getActiveFile) == null ? void 0 : dn.call(n)) ?? null
2367
+ ), [M, J] = O(null), [H, ue] = O(null), Ce = N(0), pe = N(0), be = N(0), Se = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Ue } = li(
2368
+ Se ? br(t ?? "") : "",
2369
2369
  50
2370
2370
  );
2371
2371
  _(() => {
2372
2372
  if (!R) return;
2373
- function S(C) {
2374
- j.current && !j.current.contains(C.target) && W(null);
2373
+ function S(E) {
2374
+ j.current && !j.current.contains(E.target) && W(null);
2375
2375
  }
2376
2376
  return document.addEventListener("pointerdown", S), () => document.removeEventListener("pointerdown", S);
2377
2377
  }, [R]), _(() => {
2378
2378
  const S = L.current;
2379
2379
  if (!S) return;
2380
- const C = new ResizeObserver(([A]) => {
2380
+ const E = new ResizeObserver(([A]) => {
2381
2381
  A && U(Math.floor(A.contentRect.height));
2382
2382
  });
2383
- return C.observe(S), () => C.disconnect();
2383
+ return E.observe(S), () => E.disconnect();
2384
2384
  }, []);
2385
- const Qe = (xe && Ue ? Ue.map((S) => ({
2385
+ const Qe = (Se && Ue ? Ue.map((S) => ({
2386
2386
  name: S.split("/").pop() ?? S,
2387
2387
  kind: "file",
2388
2388
  path: S
2389
- })) : void 0) ?? yr(g ?? [], D), X = wr(Qe, M, e), ie = I(
2389
+ })) : void 0) ?? gr(g ?? [], D), X = vr(Qe, M, e), ie = I(
2390
2390
  (S) => {
2391
2391
  le(S), n == null || n.openFile(S, { mode: "edit" });
2392
2392
  },
@@ -2394,14 +2394,14 @@ function kn({
2394
2394
  ), he = I(
2395
2395
  async (S) => {
2396
2396
  try {
2397
- const C = await i.getTree(S), A = o.length === 0 ? C : C.filter((B) => !Ht(B.name, o));
2397
+ const E = await i.getTree(S), A = o.length === 0 ? E : E.filter((B) => !Jt(B.name, o));
2398
2398
  T((B) => new Map(B).set(S, A));
2399
2399
  } catch {
2400
2400
  }
2401
2401
  },
2402
2402
  [i, o]
2403
2403
  ), ae = I(
2404
- async (S, C) => {
2404
+ async (S, E) => {
2405
2405
  const A = Array.from(new Set(S)).filter(
2406
2406
  (Y) => Y && Y !== e && Y !== "."
2407
2407
  );
@@ -2409,8 +2409,8 @@ function kn({
2409
2409
  const B = await Promise.all(
2410
2410
  A.map(async (Y) => {
2411
2411
  try {
2412
- const Z = await i.getTree(Y), ke = o.length === 0 ? Z : Z.filter((Te) => !Ht(Te.name, o));
2413
- return [Y, ke];
2412
+ const Z = await i.getTree(Y), xe = o.length === 0 ? Z : Z.filter((Te) => !Jt(Te.name, o));
2413
+ return [Y, xe];
2414
2414
  } catch {
2415
2415
  return null;
2416
2416
  }
@@ -2418,33 +2418,33 @@ function kn({
2418
2418
  );
2419
2419
  T((Y) => {
2420
2420
  const Z = new Map(Y);
2421
- for (const ke of B) {
2422
- if (!ke) continue;
2423
- const [Te, Pe] = ke;
2424
- (C != null && C.force || Z.has(Te)) && Z.set(Te, Pe);
2421
+ for (const xe of B) {
2422
+ if (!xe) continue;
2423
+ const [Te, ke] = xe;
2424
+ (E != null && E.force || Z.has(Te)) && Z.set(Te, ke);
2425
2425
  }
2426
2426
  return Z;
2427
2427
  });
2428
2428
  },
2429
2429
  [i, e, o]
2430
2430
  ), ge = I(
2431
- async (S, C) => {
2431
+ async (S, E) => {
2432
2432
  if (!S) return;
2433
- const A = Pr(S), B = ++Ce.current;
2433
+ const A = xr(S), B = ++Ce.current;
2434
2434
  le(A);
2435
- const Y = C != null && C.refreshTargetDir ? [...xn(A), A] : xn(A);
2435
+ const Y = E != null && E.refreshTargetDir ? [...kn(A), A] : kn(A);
2436
2436
  await ae([...new Set(Y)], { force: !0 }), Ce.current === B && ue(A);
2437
2437
  },
2438
2438
  [ae]
2439
2439
  ), Ve = I((S) => {
2440
- ue((C) => C === S ? null : C);
2440
+ ue((E) => E === S ? null : E);
2441
2441
  }, []), Ee = I(
2442
2442
  async (S) => {
2443
- const C = ++pe.current;
2443
+ const E = ++pe.current;
2444
2444
  try {
2445
2445
  await ge(S, { refreshTargetDir: !0 });
2446
2446
  } finally {
2447
- pe.current === C && (pe.current = 0);
2447
+ pe.current === E && (pe.current = 0);
2448
2448
  }
2449
2449
  },
2450
2450
  [ge]
@@ -2455,51 +2455,51 @@ function kn({
2455
2455
  var A;
2456
2456
  const S = ((A = n == null ? void 0 : n.getActiveFile) == null ? void 0 : A.call(n)) ?? null;
2457
2457
  S && pe.current === 0 && ge(S);
2458
- const C = [];
2459
- return n != null && n.select && C.push(
2458
+ const E = [];
2459
+ return n != null && n.select && E.push(
2460
2460
  n.select((B) => B.activeFile, (B) => {
2461
2461
  B ? pe.current === 0 && ge(B) : le(null);
2462
2462
  })
2463
- ), n != null && n.subscribe && C.push(
2463
+ ), n != null && n.subscribe && E.push(
2464
2464
  n.subscribe("tree:expand", ({ path: B }) => {
2465
2465
  Ee(B);
2466
2466
  })
2467
2467
  ), () => {
2468
- for (const B of C) B();
2468
+ for (const B of E) B();
2469
2469
  };
2470
2470
  }, [n, Ee, ge]);
2471
- const Ke = I((S, C) => {
2471
+ const Ke = I((S, E) => {
2472
2472
  f((A) => {
2473
- const B = Ot(S), Y = new Map(A), Z = Mt(Y.get(B), [C]) ?? [C];
2473
+ const B = Ot(S), Y = new Map(A), Z = Mt(Y.get(B), [E]) ?? [E];
2474
2474
  return Y.set(B, Z), Y;
2475
2475
  });
2476
- }, []), Fe = I((S, C) => {
2476
+ }, []), Fe = I((S, E) => {
2477
2477
  f((A) => {
2478
2478
  const B = Ot(S), Y = A.get(B);
2479
2479
  if (!(Y != null && Y.length)) return A;
2480
- const Z = Y.filter((Te) => Te.path !== C), ke = new Map(A);
2481
- return Z.length > 0 ? ke.set(B, Z) : ke.delete(B), ke;
2480
+ const Z = Y.filter((Te) => Te.path !== E), xe = new Map(A);
2481
+ return Z.length > 0 ? xe.set(B, Z) : xe.delete(B), xe;
2482
2482
  });
2483
2483
  }, []), [Ie, b] = O(/* @__PURE__ */ new Set()), k = I((S) => {
2484
- b((C) => {
2485
- const A = new Set(C);
2484
+ b((E) => {
2485
+ const A = new Set(E);
2486
2486
  return A.add(S), A;
2487
2487
  });
2488
2488
  }, []), P = I((S) => {
2489
- b((C) => {
2490
- if (!C.has(S)) return C;
2491
- const A = new Set(C);
2489
+ b((E) => {
2490
+ if (!E.has(S)) return E;
2491
+ const A = new Set(E);
2492
2492
  return A.delete(S), A;
2493
2493
  });
2494
2494
  }, []), z = I(
2495
- (S, C) => {
2496
- W({ node: C, x: S.clientX, y: S.clientY });
2495
+ (S, E) => {
2496
+ W({ node: E, x: S.clientX, y: S.clientY });
2497
2497
  },
2498
2498
  []
2499
2499
  ), Q = I(
2500
2500
  (S) => {
2501
- const C = S.target;
2502
- C.closest("[role=treeitem]") || C.closest("[data-path]") || (S.preventDefault(), W({
2501
+ const E = S.target;
2502
+ E.closest("[role=treeitem]") || E.closest("[data-path]") || (S.preventDefault(), W({
2503
2503
  node: { name: e, kind: "dir", path: e },
2504
2504
  x: S.clientX,
2505
2505
  y: S.clientY,
@@ -2508,8 +2508,8 @@ function kn({
2508
2508
  },
2509
2509
  [e]
2510
2510
  ), de = I(
2511
- async (S, C) => {
2512
- const A = S.split("/").pop() ?? S, B = C === "." ? e : C, Y = B === "." ? A : `${B}/${A}`;
2511
+ async (S, E) => {
2512
+ const A = S.split("/").pop() ?? S, B = E === "." ? e : E, Y = B === "." ? A : `${B}/${A}`;
2513
2513
  if (Y !== S) {
2514
2514
  k(S);
2515
2515
  try {
@@ -2531,60 +2531,60 @@ function kn({
2531
2531
  W(null), (async () => {
2532
2532
  try {
2533
2533
  await S();
2534
- } catch (C) {
2534
+ } catch (E) {
2535
2535
  Ne.error({
2536
2536
  title: "Action failed",
2537
- description: C instanceof Error ? C.message : String(C)
2537
+ description: E instanceof Error ? E.message : String(E)
2538
2538
  });
2539
2539
  }
2540
2540
  })();
2541
2541
  };
2542
2542
  }
2543
2543
  const ne = (S) => {
2544
- const C = R == null ? void 0 : R.node;
2544
+ const E = R == null ? void 0 : R.node;
2545
2545
  W(null);
2546
- const A = (C == null ? void 0 : C.kind) === "dir" ? C.path : C ? He(C.path) : e, B = `__draft__:${++Se.current}`;
2546
+ const A = (E == null ? void 0 : E.kind) === "dir" ? E.path : E ? He(E.path) : e, B = `__draft__:${++be.current}`;
2547
2547
  J({ kind: S, parentDir: A, path: B });
2548
2548
  }, ve = () => ne("create-file"), dt = () => ne("create-folder"), ft = () => {
2549
2549
  const S = R == null ? void 0 : R.node;
2550
2550
  W(null), S && J({ kind: "rename", path: S.path, initialValue: S.name });
2551
2551
  }, Lt = I(
2552
- async (S, C) => {
2552
+ async (S, E) => {
2553
2553
  const A = M;
2554
2554
  if (J(null), !A) return;
2555
- const B = C.trim();
2555
+ const B = E.trim();
2556
2556
  if (!B) return;
2557
- const Y = A.kind === "rename" ? He(A.path) : A.parentDir, Z = A.kind === "rename" ? A.path : Y === "." || Y === "" ? B : `${Y}/${B}`, ke = A.kind === "rename" ? A.path : Z;
2558
- k(ke);
2557
+ const Y = A.kind === "rename" ? He(A.path) : A.parentDir, Z = A.kind === "rename" ? A.path : Y === "." || Y === "" ? B : `${Y}/${B}`, xe = A.kind === "rename" ? A.path : Z;
2558
+ k(xe);
2559
2559
  let Te = null;
2560
2560
  try {
2561
2561
  if (A.kind === "rename") {
2562
2562
  if (B === A.initialValue) return;
2563
- const Pe = A.path.split("/");
2564
- Pe[Pe.length - 1] = B;
2565
- const pt = Pe.join("/");
2563
+ const ke = A.path.split("/");
2564
+ ke[ke.length - 1] = B;
2565
+ const pt = ke.join("/");
2566
2566
  await m({ from: A.path, to: pt }), await ae([He(A.path)]), Ne.success({ title: "Renamed", description: `${A.path} → ${pt}` });
2567
2567
  } else {
2568
- const Pe = {
2568
+ const ke = {
2569
2569
  name: B,
2570
2570
  kind: A.kind === "create-file" ? "file" : "dir",
2571
2571
  path: Z
2572
2572
  };
2573
- Ke(Y, Pe), Te = Z, A.kind === "create-file" ? (await y({ path: Z, content: "" }), K.emit(ee.created, {
2573
+ Ke(Y, ke), Te = Z, A.kind === "create-file" ? (await y({ path: Z, content: "" }), K.emit(ee.created, {
2574
2574
  ...nt(),
2575
2575
  path: Z,
2576
2576
  kind: "file"
2577
2577
  }), Ne.success({ title: "File created", description: Z })) : (await w({ path: Z }), Ne.success({ title: "Folder created", description: Z })), await ae([Y], { force: !0 }), ue(Z);
2578
2578
  }
2579
- } catch (Pe) {
2579
+ } catch (ke) {
2580
2580
  Te && Fe(Y, Te);
2581
- const pt = Pe instanceof Error ? Pe.message : String(Pe);
2581
+ const pt = ke instanceof Error ? ke.message : String(ke);
2582
2582
  Ne.error({
2583
2583
  title: A.kind === "rename" ? "Rename failed" : A.kind === "create-file" ? "Create file failed" : "Create folder failed",
2584
2584
  description: pt
2585
2585
  });
2586
2586
  } finally {
2587
- P(ke);
2587
+ P(xe);
2588
2588
  }
2589
2589
  },
2590
2590
  [
@@ -2600,23 +2600,23 @@ function kn({
2600
2600
  ]
2601
2601
  ), _t = I(() => {
2602
2602
  J(null);
2603
- }, []), Jr = fe(async () => {
2603
+ }, []), Gr = fe(async () => {
2604
2604
  R != null && R.node && (await $i(R.node.path), Ne.success({ title: "Path copied", description: R.node.path }));
2605
- }), Yr = I(async () => {
2605
+ }), Hr = I(async () => {
2606
2606
  if (!$) return;
2607
2607
  const S = $;
2608
2608
  te(null), k(S.path);
2609
2609
  try {
2610
- await F({ path: S.path }), Fe(He(S.path), S.path), S.kind === "dir" && T((C) => {
2611
- const A = new Map(C);
2610
+ await F({ path: S.path }), Fe(He(S.path), S.path), S.kind === "dir" && T((E) => {
2611
+ const A = new Map(E);
2612
2612
  for (const B of A.keys())
2613
2613
  (B === S.path || B.startsWith(`${S.path}/`)) && A.delete(B);
2614
2614
  return A;
2615
2615
  }), await ae([He(S.path)]), Ne.success({ title: "Deleted", description: S.path });
2616
- } catch (C) {
2616
+ } catch (E) {
2617
2617
  Ne.error({
2618
2618
  title: "Delete failed",
2619
- description: C instanceof Error ? C.message : String(C)
2619
+ description: E instanceof Error ? E.message : String(E)
2620
2620
  });
2621
2621
  } finally {
2622
2622
  P(S.path);
@@ -2628,8 +2628,8 @@ function kn({
2628
2628
  k,
2629
2629
  P,
2630
2630
  Fe
2631
- ]), Xr = !xe && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
2632
- return /* @__PURE__ */ E("div", { className: "flex h-full min-h-0 flex-col", children: [
2631
+ ]), Jr = !Se && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
2632
+ return /* @__PURE__ */ C("div", { className: "flex h-full min-h-0 flex-col", children: [
2633
2633
  l && /* @__PURE__ */ u(
2634
2634
  et,
2635
2635
  {
@@ -2644,17 +2644,17 @@ function kn({
2644
2644
  ref: L,
2645
2645
  className: "min-h-0 flex-1 overflow-hidden",
2646
2646
  onContextMenu: Q,
2647
- children: d ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((S, C) => /* @__PURE__ */ u(
2648
- mo,
2647
+ children: d ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((S, E) => /* @__PURE__ */ u(
2648
+ po,
2649
2649
  {
2650
2650
  className: "h-5",
2651
- style: { width: `${60 + C * 13 % 30}%` }
2651
+ style: { width: `${60 + E * 13 % 30}%` }
2652
2652
  },
2653
- C
2653
+ E
2654
2654
  )) }) : /* @__PURE__ */ u(
2655
2655
  Et,
2656
2656
  {
2657
- fallback: /* @__PURE__ */ E("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2657
+ fallback: /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2658
2658
  /* @__PURE__ */ u(Tt, { className: "size-3.5" }),
2659
2659
  /* @__PURE__ */ u("span", { children: "Loading..." })
2660
2660
  ] }),
@@ -2663,7 +2663,7 @@ function kn({
2663
2663
  {
2664
2664
  files: X,
2665
2665
  selectedPath: se,
2666
- searchQuery: Xr,
2666
+ searchQuery: Jr,
2667
2667
  editing: M ? {
2668
2668
  path: M.path,
2669
2669
  isDraft: M.kind !== "rename",
@@ -2686,7 +2686,7 @@ function kn({
2686
2686
  )
2687
2687
  }
2688
2688
  ),
2689
- R && /* @__PURE__ */ E(
2689
+ R && /* @__PURE__ */ C(
2690
2690
  "div",
2691
2691
  {
2692
2692
  ref: j,
@@ -2696,7 +2696,7 @@ function kn({
2696
2696
  children: [
2697
2697
  /* @__PURE__ */ u(_e, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: ve, children: "New file" }),
2698
2698
  /* @__PURE__ */ u(_e, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: dt, children: "New folder" }),
2699
- !R.isBackground && /* @__PURE__ */ E($e, { children: [
2699
+ !R.isBackground && /* @__PURE__ */ C($e, { children: [
2700
2700
  /* @__PURE__ */ u(_e, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: ft, children: "Rename" }),
2701
2701
  /* @__PURE__ */ u(
2702
2702
  _e,
@@ -2712,30 +2712,30 @@ function kn({
2712
2712
  children: "Delete"
2713
2713
  }
2714
2714
  ),
2715
- /* @__PURE__ */ u(_e, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Jr, children: "Copy path" })
2715
+ /* @__PURE__ */ u(_e, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Gr, children: "Copy path" })
2716
2716
  ] })
2717
2717
  ]
2718
2718
  }
2719
2719
  ),
2720
2720
  /* @__PURE__ */ u(
2721
- ho,
2721
+ mo,
2722
2722
  {
2723
2723
  open: $ !== null,
2724
2724
  onOpenChange: (S) => {
2725
2725
  S || te(null);
2726
2726
  },
2727
- children: /* @__PURE__ */ E(go, { children: [
2728
- /* @__PURE__ */ E(vo, { children: [
2729
- /* @__PURE__ */ E(yo, { children: [
2727
+ children: /* @__PURE__ */ C(ho, { children: [
2728
+ /* @__PURE__ */ C(go, { children: [
2729
+ /* @__PURE__ */ C(vo, { children: [
2730
2730
  "Delete ",
2731
2731
  $ == null ? void 0 : $.name,
2732
2732
  "?"
2733
2733
  ] }),
2734
- /* @__PURE__ */ u(wo, { children: "This action cannot be undone." })
2734
+ /* @__PURE__ */ u(yo, { children: "This action cannot be undone." })
2735
2735
  ] }),
2736
- /* @__PURE__ */ E(bo, { children: [
2737
- /* @__PURE__ */ u(So, { children: "Cancel" }),
2738
- /* @__PURE__ */ u(xo, { onClick: Yr, children: "Delete" })
2736
+ /* @__PURE__ */ C(wo, { children: [
2737
+ /* @__PURE__ */ u(bo, { children: "Cancel" }),
2738
+ /* @__PURE__ */ u(So, { onClick: Hr, children: "Delete" })
2739
2739
  ] })
2740
2740
  ] })
2741
2741
  }
@@ -2756,7 +2756,7 @@ function Wi({
2756
2756
  _(() => (clearTimeout(F.current), F.current = setTimeout(() => m(g), 200), () => clearTimeout(F.current)), [g]);
2757
2757
  const v = p !== void 0 ? p || void 0 : w || void 0;
2758
2758
  return a ? /* @__PURE__ */ u(
2759
- kn,
2759
+ Pn,
2760
2760
  {
2761
2761
  rootDir: l,
2762
2762
  searchQuery: v,
@@ -2764,7 +2764,7 @@ function Wi({
2764
2764
  revealFileTreeRequest: f,
2765
2765
  className: oe("px-1 pt-1 [&_[role=treeitem]]:!indent-0", c)
2766
2766
  }
2767
- ) : /* @__PURE__ */ u(Fi, { title: "Files", panelApi: h, children: /* @__PURE__ */ E("div", { className: "flex h-full flex-col", children: [
2767
+ ) : /* @__PURE__ */ u(Fi, { title: "Files", panelApi: h, children: /* @__PURE__ */ C("div", { className: "flex h-full flex-col", children: [
2768
2768
  /* @__PURE__ */ u("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ u(
2769
2769
  Yn,
2770
2770
  {
@@ -2776,7 +2776,7 @@ function Wi({
2776
2776
  }
2777
2777
  ) }),
2778
2778
  /* @__PURE__ */ u("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ u(
2779
- kn,
2779
+ Pn,
2780
2780
  {
2781
2781
  rootDir: l,
2782
2782
  searchQuery: v,
@@ -2833,7 +2833,7 @@ function Ui(e) {
2833
2833
  function qi(e) {
2834
2834
  const t = Ui(e);
2835
2835
  if (!t) return;
2836
- const n = Ds(t.toolCallId);
2836
+ const n = Fs(t.toolCallId);
2837
2837
  switch (t.op) {
2838
2838
  case "rename":
2839
2839
  t.oldPath && K.emit(ee.moved, {
@@ -2892,16 +2892,16 @@ function Yi(e, t) {
2892
2892
  var pe;
2893
2893
  d(!0), K.emit(me.editorSaveStart, { panelId: r });
2894
2894
  let ue;
2895
- const Ce = new Promise((Se) => {
2896
- ue = setTimeout(() => Se("timeout"), Ji);
2895
+ const Ce = new Promise((be) => {
2896
+ ue = setTimeout(() => be("timeout"), Ji);
2897
2897
  });
2898
2898
  try {
2899
- const Se = await Promise.race([
2899
+ const be = await Promise.race([
2900
2900
  M.save().then(() => "saved"),
2901
2901
  Ce
2902
2902
  ]);
2903
2903
  if (T.current !== J) return;
2904
- Se === "saved" && (F.current = Date.now(), f(Date.now()), c(!1), (pe = L.current) == null || pe.call(L, e, !1));
2904
+ be === "saved" && (F.current = Date.now(), f(Date.now()), c(!1), (pe = L.current) == null || pe.call(L, e, !1));
2905
2905
  } catch {
2906
2906
  if (T.current !== J) return;
2907
2907
  } finally {
@@ -2968,7 +2968,7 @@ function Xi(e, t) {
2968
2968
  function Qi(e) {
2969
2969
  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;
2970
2970
  }
2971
- function Cr({ shortcuts: e, enabled: t = !0 }) {
2971
+ function kr({ shortcuts: e, enabled: t = !0 }) {
2972
2972
  const n = N(e);
2973
2973
  n.current = e, _(() => {
2974
2974
  if (!t) return;
@@ -2990,8 +2990,8 @@ function Fl(e) {
2990
2990
  return n.push(r[e.key] ?? e.key.toUpperCase()), n.join(t ? "" : "+");
2991
2991
  }
2992
2992
  let Zi = 0;
2993
- function Er(e) {
2994
- const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, s = N(n ?? `file-pane:${Zi++}`), i = n ?? s.current, { data: c, isLoading: l, error: d, refetch: a } = ci(o), { mutateAsync: f } = vr(), [p, h] = O(r), g = N(""), y = N(!1), w = N(null), m = N(null), F = N(null), v = N(0), [T, D] = O(null);
2993
+ function Pr(e) {
2994
+ const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, s = N(n ?? `file-pane:${Zi++}`), i = n ?? s.current, { data: c, isLoading: l, error: d, refetch: a } = ci(o), { mutateAsync: f } = hr(), [p, h] = O(r), g = N(""), y = N(!1), w = N(null), m = N(null), F = N(null), v = N(0), [T, D] = O(null);
2995
2995
  _(() => {
2996
2996
  w.current !== t && (h(r), g.current = r ?? "", y.current = !1, m.current = null, v.current += 1, D(null), w.current = t);
2997
2997
  }, [t, r]), _(() => {
@@ -3083,7 +3083,7 @@ function ea({ conflict: e, onReload: t, onOverwrite: n }) {
3083
3083
  tone: "accent",
3084
3084
  className: "rounded-none border-x-0 border-t-0",
3085
3085
  description: /* @__PURE__ */ u($e, { 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." }),
3086
- actions: /* @__PURE__ */ E($e, { children: [
3086
+ actions: /* @__PURE__ */ C($e, { children: [
3087
3087
  /* @__PURE__ */ u(_e, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
3088
3088
  /* @__PURE__ */ u(
3089
3089
  _e,
@@ -3100,7 +3100,7 @@ function ea({ conflict: e, onReload: t, onOverwrite: n }) {
3100
3100
  }
3101
3101
  );
3102
3102
  }
3103
- function Ir({
3103
+ function Cr({
3104
3104
  path: e,
3105
3105
  content: t,
3106
3106
  isLoading: n,
@@ -3119,11 +3119,11 @@ function Ir({
3119
3119
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(Xn, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
3120
3120
  if (r)
3121
3121
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(et, { title: "Failed to load file", description: f ?? r.message }) });
3122
- const h = a ?? /* @__PURE__ */ E("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3122
+ const h = a ?? /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3123
3123
  /* @__PURE__ */ u(Tt, { className: "size-3.5" }),
3124
3124
  /* @__PURE__ */ u("span", { children: "Loading file..." })
3125
3125
  ] });
3126
- return /* @__PURE__ */ E("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
3126
+ return /* @__PURE__ */ C("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
3127
3127
  o && /* @__PURE__ */ u(
3128
3128
  ea,
3129
3129
  {
@@ -3171,7 +3171,7 @@ function na(e) {
3171
3171
  return "typescript";
3172
3172
  }
3173
3173
  }
3174
- function Pn({ params: e, api: t, className: n }) {
3174
+ function Cn({ params: e, api: t, className: n }) {
3175
3175
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
3176
3176
  content: o,
3177
3177
  isLoading: s,
@@ -3181,11 +3181,11 @@ function Pn({ params: e, api: t, className: n }) {
3181
3181
  onReloadFromServer: d,
3182
3182
  onOverwrite: a,
3183
3183
  tabTitle: f
3184
- } = Er({ path: r, panelId: t == null ? void 0 : t.id });
3184
+ } = Pr({ path: r, panelId: t == null ? void 0 : t.id });
3185
3185
  t && f && t.setTitle(f);
3186
3186
  const p = na(r);
3187
3187
  return /* @__PURE__ */ u(
3188
- Ir,
3188
+ Cr,
3189
3189
  {
3190
3190
  path: r,
3191
3191
  content: o,
@@ -3201,7 +3201,7 @@ function Pn({ params: e, api: t, className: n }) {
3201
3201
  );
3202
3202
  }
3203
3203
  const ra = lt(
3204
- () => import("./MarkdownEditor-Bx5InUeG.js").then((e) => ({ default: e.MarkdownEditor }))
3204
+ () => import("./MarkdownEditor-DPBSzTBz.js").then((e) => ({ default: e.MarkdownEditor }))
3205
3205
  );
3206
3206
  function oa({ params: e, api: t, className: n }) {
3207
3207
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
@@ -3213,9 +3213,9 @@ function oa({ params: e, api: t, className: n }) {
3213
3213
  onReloadFromServer: d,
3214
3214
  onOverwrite: a,
3215
3215
  tabTitle: f
3216
- } = Er({ path: r, panelId: t == null ? void 0 : t.id });
3216
+ } = Pr({ path: r, panelId: t == null ? void 0 : t.id });
3217
3217
  return t && f && t.setTitle(f), /* @__PURE__ */ u(
3218
- Ir,
3218
+ Cr,
3219
3219
  {
3220
3220
  path: r,
3221
3221
  content: o,
@@ -3261,11 +3261,11 @@ function ia({ path: e, kind: t, className: n }) {
3261
3261
  }), () => {
3262
3262
  p.abort(), h && URL.revokeObjectURL(h);
3263
3263
  };
3264
- }, [f, o]), e ? d ? /* @__PURE__ */ E("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3264
+ }, [f, o]), e ? d ? /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3265
3265
  /* @__PURE__ */ u(Tt, { className: "size-3.5" }),
3266
3266
  /* @__PURE__ */ u("span", { children: "Loading preview..." })
3267
- ] }) : c || !s ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(et, { title: "Failed to load preview", description: c ?? "Preview unavailable." }) }) : /* @__PURE__ */ E("div", { className: oe("flex h-full min-h-0 flex-col bg-background", n), children: [
3268
- /* @__PURE__ */ E("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3267
+ ] }) : c || !s ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(et, { title: "Failed to load preview", description: c ?? "Preview unavailable." }) }) : /* @__PURE__ */ C("div", { className: oe("flex h-full min-h-0 flex-col bg-background", n), children: [
3268
+ /* @__PURE__ */ C("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3269
3269
  /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: ht(e) }),
3270
3270
  /* @__PURE__ */ u(
3271
3271
  "a",
@@ -3297,31 +3297,31 @@ function ia({ path: e, kind: t, className: n }) {
3297
3297
  function aa(e, t) {
3298
3298
  return t || (e.toLowerCase().endsWith(".pdf") ? "pdf" : "image");
3299
3299
  }
3300
- function Cn({ params: e, className: t }) {
3300
+ function En({ params: e, className: t }) {
3301
3301
  const n = (e == null ? void 0 : e.path) ?? "";
3302
3302
  return /* @__PURE__ */ u(ia, { path: n, kind: aa(n, e == null ? void 0 : e.kind), className: t });
3303
3303
  }
3304
3304
  function ca(e, t) {
3305
3305
  return `${e.replace(/\/$/, "")}${t}`;
3306
3306
  }
3307
- function En(e) {
3307
+ function In(e) {
3308
3308
  return e.split("/").pop() ?? e;
3309
3309
  }
3310
3310
  function la(e) {
3311
3311
  const t = e.replace(/\\/g, "/"), n = t.lastIndexOf("/");
3312
3312
  return n === -1 ? "" : t.slice(0, n);
3313
3313
  }
3314
- function Tr(e) {
3314
+ function Er(e) {
3315
3315
  const t = e.search(/[?#]/);
3316
3316
  return t === -1 ? { pathname: e, suffix: "" } : { pathname: e.slice(0, t), suffix: e.slice(t) };
3317
3317
  }
3318
3318
  function ua(e) {
3319
3319
  return /^[a-z][a-z0-9+.-]*:/i.test(e) || e.startsWith("//") || e.startsWith("#") || e.startsWith("/api/");
3320
3320
  }
3321
- function Nr(e, t) {
3321
+ function Ir(e, t) {
3322
3322
  const n = t.trim();
3323
3323
  if (!n || ua(n)) return null;
3324
- const { pathname: r } = Tr(n);
3324
+ const { pathname: r } = Er(n);
3325
3325
  if (!r) return null;
3326
3326
  const o = r.startsWith("/") ? r.split("/") : [...la(e).split("/"), ...r.split("/")], s = [];
3327
3327
  for (const i of o)
@@ -3335,15 +3335,15 @@ function Nr(e, t) {
3335
3335
  }
3336
3336
  return s.join("/");
3337
3337
  }
3338
- function sn(e, t, n) {
3338
+ function an(e, t, n) {
3339
3339
  const r = new URLSearchParams({ path: t });
3340
3340
  return n && r.set("workspaceId", n), ca(e, `/api/v1/files/raw?${r.toString()}`);
3341
3341
  }
3342
3342
  function ct(e, t, n, r) {
3343
- const o = Nr(t, n);
3343
+ const o = Ir(t, n);
3344
3344
  if (!o) return n;
3345
- const { suffix: s } = Tr(n.trim()), i = s.indexOf("#"), c = i === -1 ? "" : s.slice(i);
3346
- return `${sn(e, o, r)}${c}`;
3345
+ const { suffix: s } = Er(n.trim()), i = s.indexOf("#"), c = i === -1 ? "" : s.slice(i);
3346
+ return `${an(e, o, r)}${c}`;
3347
3347
  }
3348
3348
  function Wt(e, t, n, r) {
3349
3349
  return e.replace(/url\(\s*(["']?)([^"')]+)\1\s*\)/gi, (o, s, i) => `url(${s}${ct(n, t, i, r)}${s})`).replace(/@import\s+(url\(\s*)?(["'])([^"']+)\2\s*\)?/gi, (o, s, i, c) => {
@@ -3357,7 +3357,7 @@ function da(e, t, n, r) {
3357
3357
  return i ? [ct(n, t, i, r), ...c].join(" ") : o;
3358
3358
  }).join(", ");
3359
3359
  }
3360
- async function Rr(e, t, n) {
3360
+ async function Tr(e, t, n) {
3361
3361
  const r = await fetch(e, {
3362
3362
  credentials: "include",
3363
3363
  headers: t,
@@ -3372,10 +3372,10 @@ async function fa(e) {
3372
3372
  Array.from(c.querySelectorAll('link[rel~="stylesheet"][href]')).map(async (d) => {
3373
3373
  const a = d.getAttribute("href");
3374
3374
  if (!a) return;
3375
- const f = Nr(n, a);
3375
+ const f = Ir(n, a);
3376
3376
  if (f)
3377
3377
  try {
3378
- const p = await Rr(sn(r, f, s), o, i), h = c.createElement("style");
3378
+ const p = await Tr(an(r, f, s), o, i), h = c.createElement("style");
3379
3379
  h.setAttribute("data-boring-html-viewer-href", a), h.textContent = Wt(p, f, r, s), d.replaceWith(h);
3380
3380
  } catch {
3381
3381
  d.setAttribute("href", ct(r, n, a, s));
@@ -3414,14 +3414,14 @@ ${c.documentElement.outerHTML}`;
3414
3414
  }
3415
3415
  function pa({ path: e, className: t }) {
3416
3416
  const n = Ye(), r = Xe(), [o, s] = O(null), [i, c] = O(null), [l, d] = O(!0), a = G(
3417
- () => sn(n, e, r),
3417
+ () => an(n, e, r),
3418
3418
  [n, e, r]
3419
3419
  );
3420
3420
  return _(() => {
3421
3421
  const f = new AbortController();
3422
3422
  d(!0), c(null), s(null);
3423
3423
  const p = {};
3424
- return r && (p["x-boring-workspace-id"] = r), Rr(a, p, f.signal).then(async (h) => {
3424
+ return r && (p["x-boring-workspace-id"] = r), Tr(a, p, f.signal).then(async (h) => {
3425
3425
  s(await fa({
3426
3426
  html: h,
3427
3427
  path: e,
@@ -3435,12 +3435,12 @@ function pa({ path: e, className: t }) {
3435
3435
  }).finally(() => {
3436
3436
  f.signal.aborted || d(!1);
3437
3437
  }), () => f.abort();
3438
- }, [n, e, a, r]), e ? l ? /* @__PURE__ */ E("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3438
+ }, [n, e, a, r]), e ? l ? /* @__PURE__ */ C("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3439
3439
  /* @__PURE__ */ u(Tt, { className: "size-3.5" }),
3440
3440
  /* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
3441
- ] }) : i || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(et, { title: "Failed to load HTML preview", description: i ?? "Preview unavailable." }) }) : /* @__PURE__ */ E("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
3442
- /* @__PURE__ */ E("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3443
- /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: En(e) }),
3441
+ ] }) : i || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(et, { title: "Failed to load HTML preview", description: i ?? "Preview unavailable." }) }) : /* @__PURE__ */ C("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
3442
+ /* @__PURE__ */ C("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3443
+ /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: In(e) }),
3444
3444
  /* @__PURE__ */ u(
3445
3445
  "a",
3446
3446
  {
@@ -3456,7 +3456,7 @@ function pa({ path: e, className: t }) {
3456
3456
  "iframe",
3457
3457
  {
3458
3458
  srcDoc: o,
3459
- title: En(e),
3459
+ title: In(e),
3460
3460
  sandbox: "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox",
3461
3461
  className: "min-h-0 flex-1 border-0 bg-white"
3462
3462
  }
@@ -3479,14 +3479,14 @@ function ha({ params: e }) {
3479
3479
  ) });
3480
3480
  }
3481
3481
  const st = {
3482
- id: dr,
3482
+ id: Ys,
3483
3483
  title: "Unsupported file",
3484
3484
  component: ha,
3485
3485
  placement: "center",
3486
3486
  source: "builtin"
3487
- }, In = [
3487
+ }, Tn = [
3488
3488
  {
3489
- component: sr,
3489
+ component: Gt,
3490
3490
  patterns: [
3491
3491
  "**/*.ts",
3492
3492
  "**/*.tsx",
@@ -3507,27 +3507,29 @@ const st = {
3507
3507
  ]
3508
3508
  },
3509
3509
  {
3510
- component: ir,
3510
+ component: sr,
3511
3511
  patterns: ["**/*.csv", "**/*.tsv", "**/*.data"]
3512
3512
  },
3513
3513
  {
3514
- component: ar,
3514
+ component: ir,
3515
3515
  patterns: ["**/*.md", "**/*.mdx"]
3516
3516
  },
3517
3517
  {
3518
- component: cr,
3518
+ component: ar,
3519
3519
  patterns: ["**/*.avif", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.png", "**/*.svg", "**/*.webp"]
3520
3520
  },
3521
3521
  {
3522
- component: lr,
3522
+ component: cr,
3523
3523
  patterns: ["**/*.pdf"]
3524
3524
  },
3525
3525
  {
3526
- component: ur,
3526
+ component: lr,
3527
3527
  patterns: ["**/*.html", "**/*.htm"]
3528
3528
  },
3529
3529
  {
3530
- component: dr,
3530
+ // Unknown file types fall back to the code editor — it can render any text
3531
+ // file, which is more useful than a "no editor available" placeholder.
3532
+ component: Gt,
3531
3533
  fallback: !0
3532
3534
  }
3533
3535
  ];
@@ -3567,16 +3569,16 @@ function wa(e) {
3567
3569
  }
3568
3570
  function ba(e) {
3569
3571
  let t, n = -1;
3570
- for (const r of In)
3572
+ for (const r of Tn)
3571
3573
  for (const o of r.patterns ?? []) {
3572
3574
  if (!ya(e, o)) continue;
3573
3575
  const s = ga(o);
3574
3576
  s >= n && (t = r, n = s);
3575
3577
  }
3576
- return t ?? In.find((r) => r.fallback);
3578
+ return t ?? Tn.find((r) => r.fallback);
3577
3579
  }
3578
3580
  const zt = {
3579
- id: Ys,
3581
+ id: Js,
3580
3582
  source: "builtin",
3581
3583
  resolve(e) {
3582
3584
  if (e.kind !== Be) return;
@@ -3599,7 +3601,7 @@ function Sa(e) {
3599
3601
  subtitle: t >= 0 ? e.slice(0, t + 1) : void 0
3600
3602
  };
3601
3603
  }
3602
- function Tn() {
3604
+ function Nn() {
3603
3605
  return { items: [], total: 0, hasMore: !1 };
3604
3606
  }
3605
3607
  function xa({
@@ -3612,9 +3614,9 @@ function xa({
3612
3614
  adapter: {
3613
3615
  async search({ query: n, limit: r, signal: o }) {
3614
3616
  const s = n.trim();
3615
- if (!s || o != null && o.aborted) return Tn();
3616
- const i = await e.search(xr(s), r, o);
3617
- return o != null && o.aborted ? Tn() : {
3617
+ if (!s || o != null && o.aborted) return Nn();
3618
+ const i = await e.search(br(s), r, o);
3619
+ return o != null && o.aborted ? Nn() : {
3618
3620
  items: i.map(Sa),
3619
3621
  total: i.length,
3620
3622
  hasMore: !1
@@ -3645,7 +3647,7 @@ function ka({
3645
3647
  function Pa() {
3646
3648
  return _(() => {
3647
3649
  Oi();
3648
- }, []), gr("."), null;
3650
+ }, []), mr("."), null;
3649
3651
  }
3650
3652
  function Ca() {
3651
3653
  const e = Me(), t = Ft();
@@ -3685,39 +3687,39 @@ const Ea = (e) => {
3685
3687
  placement: st.placement,
3686
3688
  source: st.source
3687
3689
  }), e.registerPanel({
3688
- id: sr,
3690
+ id: Gt,
3689
3691
  label: "Code",
3690
- component: Pn,
3692
+ component: Cn,
3691
3693
  placement: "center",
3692
3694
  source: "builtin"
3693
3695
  }), e.registerPanel({
3694
- id: ir,
3696
+ id: sr,
3695
3697
  label: "CSV",
3696
3698
  // CSV currently uses the text editor shell; a tabular viewer can replace
3697
3699
  // this panel without changing the filesystem resolver contract.
3698
- component: Pn,
3700
+ component: Cn,
3699
3701
  placement: "center",
3700
3702
  source: "builtin"
3701
3703
  }), e.registerPanel({
3702
- id: ar,
3704
+ id: ir,
3703
3705
  label: "Markdown",
3704
3706
  component: oa,
3705
3707
  placement: "center",
3706
3708
  source: "builtin"
3707
3709
  }), e.registerPanel({
3708
- id: cr,
3710
+ id: ar,
3709
3711
  label: "Image",
3710
- component: Cn,
3712
+ component: En,
3711
3713
  placement: "center",
3712
3714
  source: "builtin"
3713
3715
  }), e.registerPanel({
3714
- id: lr,
3716
+ id: cr,
3715
3717
  label: "PDF",
3716
- component: Cn,
3718
+ component: En,
3717
3719
  placement: "center",
3718
3720
  source: "builtin"
3719
3721
  }), e.registerPanel({
3720
- id: ur,
3722
+ id: lr,
3721
3723
  label: "HTML",
3722
3724
  component: ma,
3723
3725
  placement: "center",
@@ -3737,7 +3739,7 @@ const Ea = (e) => {
3737
3739
  id: "filesystem-agent-file-bridge",
3738
3740
  component: Ki
3739
3741
  });
3740
- }, Nn = Ko({
3742
+ }, Rn = Vo({
3741
3743
  id: wt,
3742
3744
  label: "Filesystem",
3743
3745
  setup: Ea
@@ -3811,19 +3813,19 @@ class Ia {
3811
3813
  for (const t of [...this.listeners]) t();
3812
3814
  }
3813
3815
  }
3814
- const Ar = be(null), Fr = be("dock");
3816
+ const Nr = we(null), Rr = we("dock");
3815
3817
  function Ta({ basePath: e, children: t }) {
3816
- return /* @__PURE__ */ u(Ar.Provider, { value: e ?? null, children: t });
3818
+ return /* @__PURE__ */ u(Nr.Provider, { value: e ?? null, children: t });
3817
3819
  }
3818
3820
  function Dl({ mode: e, children: t }) {
3819
- return /* @__PURE__ */ u(Fr.Provider, { value: e, children: t });
3821
+ return /* @__PURE__ */ u(Rr.Provider, { value: e, children: t });
3820
3822
  }
3821
3823
  function Na({ componentId: e, params: t, basePath: n }) {
3822
3824
  const r = new URLSearchParams({ component: e });
3823
3825
  return t && Object.keys(t).length > 0 && r.set("params", JSON.stringify(t)), `${n}?${r.toString()}`;
3824
3826
  }
3825
3827
  function Ll(e) {
3826
- const t = ce(Ar);
3828
+ const t = ce(Nr);
3827
3829
  return G(() => t ? Na({
3828
3830
  componentId: e.componentId,
3829
3831
  params: e.params,
@@ -3831,7 +3833,7 @@ function Ll(e) {
3831
3833
  }) : null, [t, e.componentId, e.params]);
3832
3834
  }
3833
3835
  function Ra() {
3834
- return ce(Fr);
3836
+ return ce(Rr);
3835
3837
  }
3836
3838
  function _l() {
3837
3839
  return Ra() === "full-page";
@@ -3866,10 +3868,10 @@ function ja(e) {
3866
3868
  const t = Wa.safeParse(e);
3867
3869
  return t.success ? t.data : (console.error("Preferences validation failed:", t.error.issues), null);
3868
3870
  }
3869
- const Rn = 1e5, An = "2.0";
3870
- let Fn = !1, it = null;
3871
- function Dn(e, t) {
3872
- if (!Fn)
3871
+ const An = 1e5, Fn = "2.0";
3872
+ let Dn = !1, it = null;
3873
+ function Ln(e, t) {
3874
+ if (!Dn)
3873
3875
  try {
3874
3876
  localStorage.setItem(e, t);
3875
3877
  } catch (n) {
@@ -3878,7 +3880,7 @@ function Dn(e, t) {
3878
3880
  try {
3879
3881
  localStorage.setItem(e, t);
3880
3882
  } catch {
3881
- Fn = !0, console.error(
3883
+ Dn = !0, console.error(
3882
3884
  "localStorage quota exceeded. Persistence disabled for this session."
3883
3885
  ), it == null || it();
3884
3886
  }
@@ -3895,9 +3897,9 @@ function Ba(e) {
3895
3897
  return { theme: "light" };
3896
3898
  }
3897
3899
  }
3898
- function Dr(e = {}) {
3899
- const t = e.storageKey ?? (e.workspaceId ? `boring-ui-v2:layout:${e.workspaceId}` : "boring-ui-v2:layout"), n = "boring-ui-v2:preferences", r = e.persistenceEnabled === !1, o = r ? { theme: "light" } : Ba(n), s = Oo()(
3900
- Mo(
3900
+ function Ar(e = {}) {
3901
+ const t = e.storageKey ?? (e.workspaceId ? `boring-ui-v2:layout:${e.workspaceId}` : "boring-ui-v2:layout"), n = "boring-ui-v2:preferences", r = e.persistenceEnabled === !1, o = r ? { theme: "light" } : Ba(n), s = $o()(
3902
+ Oo(
3901
3903
  (l, d) => ({
3902
3904
  hydrationComplete: !1,
3903
3905
  layout: null,
@@ -3915,7 +3917,7 @@ function Dr(e = {}) {
3915
3917
  setSidebar: (a) => l({ sidebar: { ...d().sidebar, ...a } }),
3916
3918
  setPanelSize: (a, f) => l({ panelSizes: { ...d().panelSizes, [a]: f } }),
3917
3919
  setTheme: (a) => {
3918
- l({ preferences: { theme: a } }), r || Dn(
3920
+ l({ preferences: { theme: a } }), r || Ln(
3919
3921
  n,
3920
3922
  JSON.stringify({ state: { theme: a }, version: 0 })
3921
3923
  );
@@ -3984,7 +3986,7 @@ function Dr(e = {}) {
3984
3986
  const d = localStorage.getItem(l);
3985
3987
  if (!d) return null;
3986
3988
  const a = JSON.parse(d);
3987
- if ((a == null ? void 0 : a.version) !== void 0 && String(a.version) !== An)
3989
+ if ((a == null ? void 0 : a.version) !== void 0 && String(a.version) !== Fn)
3988
3990
  return e.onLayoutVersionMismatch ? e.onLayoutVersionMismatch() : localStorage.removeItem(l), null;
3989
3991
  const f = za(a == null ? void 0 : a.state);
3990
3992
  return f ? { ...a, state: f } : (console.error("Layout restored with defaults"), null);
@@ -3993,10 +3995,10 @@ function Dr(e = {}) {
3993
3995
  }
3994
3996
  },
3995
3997
  setItem: (l, d) => {
3996
- const a = { ...d, version: An }, f = JSON.stringify(a);
3997
- f.length > Rn && console.warn(
3998
- `Workspace state serialized to ${f.length} bytes (budget: <${Rn})`
3999
- ), Dn(l, f);
3998
+ const a = { ...d, version: Fn }, f = JSON.stringify(a);
3999
+ f.length > An && console.warn(
4000
+ `Workspace state serialized to ${f.length} bytes (budget: <${An})`
4001
+ ), Ln(l, f);
4000
4002
  },
4001
4003
  removeItem: (l) => {
4002
4004
  localStorage.removeItem(l);
@@ -4018,11 +4020,11 @@ function Dr(e = {}) {
4018
4020
  i && typeof window < "u" && (window.removeEventListener("storage", i), i = null), it = null;
4019
4021
  } });
4020
4022
  }
4021
- const Ct = 50, Lr = "Catalogs";
4022
- function Ln(e) {
4023
+ const Ct = 50, Fr = "Catalogs";
4024
+ function _n(e) {
4023
4025
  return e instanceof Error ? e.message : "Search failed";
4024
4026
  }
4025
- function _r(e) {
4027
+ function Dr(e) {
4026
4028
  if (!e.when) return !0;
4027
4029
  try {
4028
4030
  return e.when();
@@ -4031,7 +4033,7 @@ function _r(e) {
4031
4033
  }
4032
4034
  }
4033
4035
  function Ua(e, t) {
4034
- const n = e.filter(_r);
4036
+ const n = e.filter(Dr);
4035
4037
  if (!t) return n.slice(0, Ct);
4036
4038
  const r = t.toLowerCase();
4037
4039
  return n.filter((o) => {
@@ -4044,31 +4046,31 @@ function qa(e, t, n) {
4044
4046
  if (r.type === "catalog")
4045
4047
  return t.some((s) => s.id === r.catalogId);
4046
4048
  const o = n.find((s) => s.id === r.commandId);
4047
- return !!o && _r(o);
4049
+ return !!o && Dr(o);
4048
4050
  });
4049
4051
  }
4050
- const $r = "boring-ui-v2:command-palette:recent", Or = 50;
4051
- function an() {
4052
+ const Lr = "boring-ui-v2:command-palette:recent", _r = 50;
4053
+ function cn() {
4052
4054
  try {
4053
- const e = localStorage.getItem($r);
4055
+ const e = localStorage.getItem(Lr);
4054
4056
  if (!e) return [];
4055
4057
  const t = JSON.parse(e);
4056
- return Array.isArray(t) ? t.filter(Va).slice(0, Or) : [];
4058
+ return Array.isArray(t) ? t.filter(Va).slice(0, _r) : [];
4057
4059
  } catch {
4058
4060
  return [];
4059
4061
  }
4060
4062
  }
4061
- function Mr(e) {
4063
+ function $r(e) {
4062
4064
  try {
4063
4065
  localStorage.setItem(
4064
- $r,
4065
- JSON.stringify(e.slice(0, Or))
4066
+ Lr,
4067
+ JSON.stringify(e.slice(0, _r))
4066
4068
  );
4067
4069
  } catch {
4068
4070
  }
4069
4071
  }
4070
- function _n(e, t) {
4071
- const n = an().filter(
4072
+ function $n(e, t) {
4073
+ const n = cn().filter(
4072
4074
  (r) => !(r.type === "catalog" && r.catalogId === e && r.rowId === t.id)
4073
4075
  );
4074
4076
  n.unshift({
@@ -4077,10 +4079,10 @@ function _n(e, t) {
4077
4079
  rowId: t.id,
4078
4080
  rowSnapshot: t,
4079
4081
  selectedAt: Date.now()
4080
- }), Mr(n);
4082
+ }), $r(n);
4081
4083
  }
4082
- function $n(e, t) {
4083
- const n = an().filter(
4084
+ function On(e, t) {
4085
+ const n = cn().filter(
4084
4086
  (r) => !(r.type === "command" && r.commandId === e)
4085
4087
  );
4086
4088
  n.unshift({
@@ -4088,7 +4090,7 @@ function $n(e, t) {
4088
4090
  commandId: e,
4089
4091
  titleSnapshot: t,
4090
4092
  selectedAt: Date.now()
4091
- }), Mr(n);
4093
+ }), $r(n);
4092
4094
  }
4093
4095
  function Va(e) {
4094
4096
  if (typeof e != "object" || e === null) return !1;
@@ -4102,20 +4104,20 @@ function Ka({
4102
4104
  searchQuery: r,
4103
4105
  close: o
4104
4106
  }) {
4105
- const s = G(() => n || r ? [] : qa(an(), e, t), [n, r, e, t]), i = I((d, a) => {
4106
- _n(d.id, a), d.onSelect(a), o();
4107
+ const s = G(() => n || r ? [] : qa(cn(), e, t), [n, r, e, t]), i = I((d, a) => {
4108
+ $n(d.id, a), d.onSelect(a), o();
4107
4109
  }, [o]), c = I(
4108
4110
  (d) => {
4109
- $n(d.id, d.title), d.run(), o();
4111
+ On(d.id, d.title), d.run(), o();
4110
4112
  },
4111
4113
  [o]
4112
4114
  ), l = I((d) => {
4113
4115
  if (d.type === "catalog") {
4114
4116
  const a = e.find((f) => f.id === d.catalogId);
4115
- a && (_n(a.id, d.rowSnapshot), a.onSelect(d.rowSnapshot));
4117
+ a && ($n(a.id, d.rowSnapshot), a.onSelect(d.rowSnapshot));
4116
4118
  } else {
4117
4119
  const a = t.find((f) => f.id === d.commandId);
4118
- a && ($n(a.id, a.title), a.run());
4120
+ a && (On(a.id, a.title), a.run());
4119
4121
  }
4120
4122
  o();
4121
4123
  }, [e, t, o]);
@@ -4151,7 +4153,7 @@ function Ga({
4151
4153
  const l = I(() => {
4152
4154
  !e && document.activeElement instanceof HTMLElement && (i.current = document.activeElement), t(!0);
4153
4155
  }, [e, t]);
4154
- Cr({
4156
+ kr({
4155
4157
  shortcuts: G(
4156
4158
  () => [
4157
4159
  { key: "k", mod: !0, allowInEditable: !0, handler: l },
@@ -4244,7 +4246,7 @@ function Ha({
4244
4246
  d(a, {
4245
4247
  rows: [],
4246
4248
  loading: !1,
4247
- error: Ln(p)
4249
+ error: _n(p)
4248
4250
  });
4249
4251
  }
4250
4252
  );
@@ -4252,7 +4254,7 @@ function Ha({
4252
4254
  d(a, {
4253
4255
  rows: [],
4254
4256
  loading: !1,
4255
- error: Ln(f)
4257
+ error: _n(f)
4256
4258
  });
4257
4259
  }
4258
4260
  return () => {
@@ -4261,7 +4263,7 @@ function Ha({
4261
4263
  }, [e, r, t]), s;
4262
4264
  }
4263
4265
  function Ja(e) {
4264
- const [t, n] = O(!1), [r, o] = O(""), [s, i] = O("catalogs"), c = os(), l = rs(), d = Qc(), a = G(() => {
4266
+ const [t, n] = O(!1), [r, o] = O(""), [s, i] = O("catalogs"), c = rs(), l = ns(), d = Qc(), a = G(() => {
4265
4267
  const x = {};
4266
4268
  for (const U of (d == null ? void 0 : d.registeredPlugins) ?? [])
4267
4269
  U.label && (x[U.id] = U.label);
@@ -4294,8 +4296,8 @@ function Ja(e) {
4294
4296
  searchQuery: p,
4295
4297
  close: () => n(!1)
4296
4298
  });
4297
- return /* @__PURE__ */ u(ko, { open: t, onOpenChange: n, children: /* @__PURE__ */ E(
4298
- Po,
4299
+ return /* @__PURE__ */ u(xo, { open: t, onOpenChange: n, children: /* @__PURE__ */ C(
4300
+ ko,
4299
4301
  {
4300
4302
  className: "cmdk-shell flex flex-col gap-0 overflow-hidden border-border/60 p-0 shadow-2xl backdrop-blur-md [&>button.dialog-close]:hidden",
4301
4303
  style: { height: 520, width: "min(640px, calc(100vw - 2rem))", maxWidth: 640 },
@@ -4303,11 +4305,11 @@ function Ja(e) {
4303
4305
  onPointerDownOutside: () => n(!1),
4304
4306
  onEscapeKeyDown: () => n(!1),
4305
4307
  children: [
4306
- /* @__PURE__ */ E(Co, { className: "sr-only", children: [
4307
- /* @__PURE__ */ u(Eo, { children: "Command Palette" }),
4308
- /* @__PURE__ */ u(Io, { children: "Search catalogs or switch to commands" })
4308
+ /* @__PURE__ */ C(Po, { className: "sr-only", children: [
4309
+ /* @__PURE__ */ u(Co, { children: "Command Palette" }),
4310
+ /* @__PURE__ */ u(Eo, { children: "Search catalogs or switch to commands" })
4309
4311
  ] }),
4310
- /* @__PURE__ */ E(To, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4312
+ /* @__PURE__ */ C(Io, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4311
4313
  /* @__PURE__ */ u(
4312
4314
  Ya,
4313
4315
  {
@@ -4320,13 +4322,13 @@ function Ja(e) {
4320
4322
  loading: !f && h.some((x) => x.loading)
4321
4323
  }
4322
4324
  ),
4323
- /* @__PURE__ */ E(
4324
- No,
4325
+ /* @__PURE__ */ C(
4326
+ To,
4325
4327
  {
4326
4328
  className: "min-h-0 flex-1 overflow-y-auto py-1",
4327
4329
  style: { maxHeight: "none" },
4328
4330
  children: [
4329
- /* @__PURE__ */ u(Ro, { className: "py-10 text-center text-sm text-muted-foreground", children: f ? "No matching commands" : "No catalog results" }),
4331
+ /* @__PURE__ */ u(No, { className: "py-10 text-center text-sm text-muted-foreground", children: f ? "No matching commands" : "No catalog results" }),
4330
4332
  /* @__PURE__ */ u(
4331
4333
  Xa,
4332
4334
  {
@@ -4371,9 +4373,9 @@ function Ya({
4371
4373
  onSwitchMode: s,
4372
4374
  loading: i
4373
4375
  }) {
4374
- return /* @__PURE__ */ E("div", { className: "relative shrink-0", children: [
4375
- /* @__PURE__ */ E("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
4376
- /* @__PURE__ */ E(
4376
+ return /* @__PURE__ */ C("div", { className: "relative shrink-0", children: [
4377
+ /* @__PURE__ */ C("div", { className: "relative flex items-stretch [&>[data-slot=command-input-wrapper]]:flex-1 [&>[data-slot=command-input-wrapper]]:h-auto", children: [
4378
+ /* @__PURE__ */ C(
4377
4379
  "div",
4378
4380
  {
4379
4381
  role: "group",
@@ -4381,19 +4383,19 @@ function Ya({
4381
4383
  className: "my-2 ml-3 inline-flex shrink-0 self-center rounded-md border border-border/60 bg-muted/40 p-0.5",
4382
4384
  children: [
4383
4385
  /* @__PURE__ */ u(
4384
- On,
4386
+ Mn,
4385
4387
  {
4386
4388
  active: !t,
4387
4389
  icon: /* @__PURE__ */ u(It, { className: "size-3" }),
4388
- label: Lr,
4390
+ label: Fr,
4389
4391
  onClick: () => s("catalogs")
4390
4392
  }
4391
4393
  ),
4392
4394
  /* @__PURE__ */ u(
4393
- On,
4395
+ Mn,
4394
4396
  {
4395
4397
  active: t,
4396
- icon: /* @__PURE__ */ u(Jt, { className: "size-3" }),
4398
+ icon: /* @__PURE__ */ u(Yt, { className: "size-3" }),
4397
4399
  label: "Commands",
4398
4400
  onClick: () => s("commands")
4399
4401
  }
@@ -4402,7 +4404,7 @@ function Ya({
4402
4404
  }
4403
4405
  ),
4404
4406
  /* @__PURE__ */ u(
4405
- Ao,
4407
+ Ro,
4406
4408
  {
4407
4409
  ref: e,
4408
4410
  placeholder: t ? "Run a command..." : "Search catalogs or type > for commands",
@@ -4428,7 +4430,7 @@ function Xa({
4428
4430
  searchQuery: n,
4429
4431
  onRecentSelect: r
4430
4432
  }) {
4431
- return e || t.length === 0 || n ? null : /* @__PURE__ */ u(Yt, { heading: "Recent", children: t.map((o) => {
4433
+ return e || t.length === 0 || n ? null : /* @__PURE__ */ u(Xt, { heading: "Recent", children: t.map((o) => {
4432
4434
  const s = o.type === "catalog" ? `recent:catalog:${o.catalogId}:${o.rowId}` : `recent:command:${o.commandId}`;
4433
4435
  return /* @__PURE__ */ u(
4434
4436
  Nt,
@@ -4436,11 +4438,11 @@ function Xa({
4436
4438
  value: s,
4437
4439
  onSelect: () => r(o),
4438
4440
  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",
4439
- children: o.type === "catalog" ? /* @__PURE__ */ E($e, { children: [
4440
- /* @__PURE__ */ u(io, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4441
- /* @__PURE__ */ u(Wr, { row: o.rowSnapshot })
4442
- ] }) : /* @__PURE__ */ E($e, { children: [
4443
- /* @__PURE__ */ u(Jt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4441
+ children: o.type === "catalog" ? /* @__PURE__ */ C($e, { children: [
4442
+ /* @__PURE__ */ u(oo, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4443
+ /* @__PURE__ */ u(Or, { row: o.rowSnapshot })
4444
+ ] }) : /* @__PURE__ */ C($e, { children: [
4445
+ /* @__PURE__ */ u(Yt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4444
4446
  /* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
4445
4447
  /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
4446
4448
  ] })
@@ -4454,7 +4456,7 @@ function Qa({
4454
4456
  isCommandMode: t,
4455
4457
  onCatalogSelect: n
4456
4458
  }) {
4457
- return t ? null : /* @__PURE__ */ u($e, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ E(Yt, { heading: r.catalog.label, children: [
4459
+ return t ? null : /* @__PURE__ */ u($e, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ C(Xt, { heading: r.catalog.label, children: [
4458
4460
  r.error ? /* @__PURE__ */ u(Za, { catalogId: r.catalog.id, error: r.error }) : null,
4459
4461
  r.rows.map((o) => /* @__PURE__ */ u(
4460
4462
  Nt,
@@ -4462,7 +4464,7 @@ function Qa({
4462
4464
  value: `${r.catalog.id}:${o.id}`,
4463
4465
  onSelect: () => n(r.catalog, o),
4464
4466
  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",
4465
- children: /* @__PURE__ */ E(
4467
+ children: /* @__PURE__ */ C(
4466
4468
  Dt,
4467
4469
  {
4468
4470
  pluginId: r.catalog.pluginId ?? r.catalog.id,
@@ -4470,7 +4472,7 @@ function Qa({
4470
4472
  contributionId: o.id,
4471
4473
  children: [
4472
4474
  /* @__PURE__ */ u(It, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4473
- /* @__PURE__ */ u(Wr, { row: o })
4475
+ /* @__PURE__ */ u(Or, { row: o })
4474
4476
  ]
4475
4477
  }
4476
4478
  )
@@ -4480,7 +4482,7 @@ function Qa({
4480
4482
  ] }, r.catalog.id)) });
4481
4483
  }
4482
4484
  function Za({ catalogId: e, error: t }) {
4483
- return /* @__PURE__ */ E(
4485
+ return /* @__PURE__ */ C(
4484
4486
  Nt,
4485
4487
  {
4486
4488
  value: `${e}:error`,
@@ -4499,53 +4501,53 @@ function ec({
4499
4501
  pluginLabelMap: n,
4500
4502
  onCommandSelect: r
4501
4503
  }) {
4502
- return !t || e.length === 0 ? null : /* @__PURE__ */ u(Yt, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ E(
4504
+ return !t || e.length === 0 ? null : /* @__PURE__ */ u(Xt, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ C(
4503
4505
  Nt,
4504
4506
  {
4505
4507
  value: o.title,
4506
4508
  onSelect: () => r(o),
4507
4509
  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",
4508
4510
  children: [
4509
- /* @__PURE__ */ u(Jt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4511
+ /* @__PURE__ */ u(Yt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4510
4512
  /* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.title }),
4511
4513
  n[o.pluginId ?? ""] && /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: n[o.pluginId ?? ""] }),
4512
- o.shortcut && /* @__PURE__ */ u(Fo, { children: o.shortcut })
4514
+ o.shortcut && /* @__PURE__ */ u(Ao, { children: o.shortcut })
4513
4515
  ]
4514
4516
  },
4515
4517
  o.id
4516
4518
  )) });
4517
4519
  }
4518
4520
  function tc({ isCommandMode: e }) {
4519
- return /* @__PURE__ */ E("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: [
4520
- /* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : Lr }),
4521
- /* @__PURE__ */ E("div", { className: "flex items-center gap-3", children: [
4522
- /* @__PURE__ */ E("span", { className: "flex items-center gap-1", children: [
4521
+ return /* @__PURE__ */ C("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: [
4522
+ /* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : Fr }),
4523
+ /* @__PURE__ */ C("div", { className: "flex items-center gap-3", children: [
4524
+ /* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
4523
4525
  /* @__PURE__ */ u(Ze, { children: "tab" }),
4524
4526
  /* @__PURE__ */ u("span", { children: "switch" })
4525
4527
  ] }),
4526
- /* @__PURE__ */ E("span", { className: "flex items-center gap-1", children: [
4527
- /* @__PURE__ */ u(Ze, { children: /* @__PURE__ */ u(ao, { className: "size-3" }) }),
4528
- /* @__PURE__ */ u(Ze, { children: /* @__PURE__ */ u(co, { className: "size-3" }) }),
4528
+ /* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
4529
+ /* @__PURE__ */ u(Ze, { children: /* @__PURE__ */ u(so, { className: "size-3" }) }),
4530
+ /* @__PURE__ */ u(Ze, { children: /* @__PURE__ */ u(io, { className: "size-3" }) }),
4529
4531
  /* @__PURE__ */ u("span", { children: "navigate" })
4530
4532
  ] }),
4531
- /* @__PURE__ */ E("span", { className: "flex items-center gap-1", children: [
4532
- /* @__PURE__ */ u(Ze, { children: /* @__PURE__ */ u(lo, { className: "size-3" }) }),
4533
+ /* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
4534
+ /* @__PURE__ */ u(Ze, { children: /* @__PURE__ */ u(ao, { className: "size-3" }) }),
4533
4535
  /* @__PURE__ */ u("span", { children: "open" })
4534
4536
  ] }),
4535
- /* @__PURE__ */ E("span", { className: "flex items-center gap-1", children: [
4537
+ /* @__PURE__ */ C("span", { className: "flex items-center gap-1", children: [
4536
4538
  /* @__PURE__ */ u(Ze, { children: "esc" }),
4537
4539
  /* @__PURE__ */ u("span", { children: "close" })
4538
4540
  ] })
4539
4541
  ] })
4540
4542
  ] });
4541
4543
  }
4542
- function On({
4544
+ function Mn({
4543
4545
  active: e,
4544
4546
  icon: t,
4545
4547
  label: n,
4546
4548
  onClick: r
4547
4549
  }) {
4548
- return /* @__PURE__ */ E(
4550
+ return /* @__PURE__ */ C(
4549
4551
  _e,
4550
4552
  {
4551
4553
  type: "button",
@@ -4564,8 +4566,8 @@ function On({
4564
4566
  }
4565
4567
  );
4566
4568
  }
4567
- function Wr({ row: e }) {
4568
- return /* @__PURE__ */ E("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4569
+ function Or({ row: e }) {
4570
+ return /* @__PURE__ */ C("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4569
4571
  /* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: e.title }),
4570
4572
  e.subtitle ? /* @__PURE__ */ u("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
4571
4573
  e.meta ? /* @__PURE__ */ u("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
@@ -4600,7 +4602,7 @@ function oc(e) {
4600
4602
  ), f = nc(d.requestHeaders), p = n.filter((w) => !w.sessionId || w.sessionId === d.sessionId);
4601
4603
  _(() => {
4602
4604
  if (!(l === null || !r || !o || !s))
4603
- return Ws({
4605
+ return Ms({
4604
4606
  endpoint: rc(l),
4605
4607
  query: f ? { workspaceId: f } : void 0,
4606
4608
  ctx: {
@@ -4630,7 +4632,7 @@ function oc(e) {
4630
4632
  ), y = I(
4631
4633
  (w) => {
4632
4634
  var m;
4633
- Ls(w), (m = e.onData) == null || m.call(e, w);
4635
+ Ds(w), (m = e.onData) == null || m.call(e, w);
4634
4636
  },
4635
4637
  [e.onData]
4636
4638
  );
@@ -4658,25 +4660,25 @@ const ic = {
4658
4660
  component: sc,
4659
4661
  placement: "left",
4660
4662
  source: "builtin"
4661
- }, Mn = 1440 * 60 * 1e3;
4663
+ }, Wn = 1440 * 60 * 1e3;
4662
4664
  function xt(e) {
4663
4665
  if (e == null) return null;
4664
4666
  const t = typeof e == "number" ? new Date(e) : new Date(e);
4665
4667
  return Number.isNaN(t.getTime()) ? null : t;
4666
4668
  }
4667
- function Wn(e) {
4669
+ function zn(e) {
4668
4670
  const t = new Date(e);
4669
4671
  return t.setHours(0, 0, 0, 0), t.getTime();
4670
4672
  }
4671
4673
  function ac(e) {
4672
- const n = Wn(/* @__PURE__ */ new Date()), r = n - Mn, o = n - 7 * Mn, s = [], i = [], c = [], l = [], d = [];
4674
+ const n = zn(/* @__PURE__ */ new Date()), r = n - Wn, o = n - 7 * Wn, s = [], i = [], c = [], l = [], d = [];
4673
4675
  for (const p of e) {
4674
4676
  const h = xt(p.updatedAt);
4675
4677
  if (!h) {
4676
4678
  d.push(p);
4677
4679
  continue;
4678
4680
  }
4679
- const g = Wn(h);
4681
+ const g = zn(h);
4680
4682
  g >= n ? s.push(p) : g >= r ? i.push(p) : g >= o ? c.push(p) : l.push(p);
4681
4683
  }
4682
4684
  const a = (p, h) => {
@@ -4712,7 +4714,7 @@ function lc({
4712
4714
  className: i
4713
4715
  }) {
4714
4716
  const c = G(() => ac(e), [e]);
4715
- return /* @__PURE__ */ E(
4717
+ return /* @__PURE__ */ C(
4716
4718
  "div",
4717
4719
  {
4718
4720
  "data-boring-workspace-part": "session-list",
@@ -4723,21 +4725,21 @@ function lc({
4723
4725
  role: "navigation",
4724
4726
  "aria-label": "Session history",
4725
4727
  children: [
4726
- /* @__PURE__ */ E("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
4728
+ /* @__PURE__ */ C("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
4727
4729
  /* @__PURE__ */ u("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
4728
- /* @__PURE__ */ E("div", { className: "flex items-center gap-0.5", children: [
4729
- r && /* @__PURE__ */ u(we, { type: "button", variant: "ghost", size: "icon-xs", onClick: r, "aria-label": "New session", title: "New chat", children: /* @__PURE__ */ u(uo, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
4730
- s && /* @__PURE__ */ u(we, { type: "button", variant: "ghost", size: "icon-xs", onClick: s, "aria-label": "Close sessions", title: "Close sessions (⌘1)", children: /* @__PURE__ */ u(Gn, { className: "h-4 w-4", strokeWidth: 1.75 }) })
4730
+ /* @__PURE__ */ C("div", { className: "flex items-center gap-0.5", children: [
4731
+ r && /* @__PURE__ */ u(Pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: r, "aria-label": "New session", title: "New chat", children: /* @__PURE__ */ u(co, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
4732
+ s && /* @__PURE__ */ u(Pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: s, "aria-label": "Close sessions", title: "Close sessions (⌘1)", children: /* @__PURE__ */ u(Hn, { className: "h-4 w-4", strokeWidth: 1.75 }) })
4731
4733
  ] })
4732
4734
  ] }),
4733
- /* @__PURE__ */ E("div", { className: "flex-1 overflow-y-auto py-2.5", children: [
4734
- e.length === 0 && /* @__PURE__ */ E("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
4735
+ /* @__PURE__ */ C("div", { className: "flex-1 overflow-y-auto py-2.5", children: [
4736
+ e.length === 0 && /* @__PURE__ */ C("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
4735
4737
  "No sessions yet.",
4736
4738
  /* @__PURE__ */ u("br", {}),
4737
4739
  "Start a new chat to begin."
4738
4740
  ] }),
4739
- c.map((l, d) => /* @__PURE__ */ E("section", { className: oe(d > 0 && "mt-4"), children: [
4740
- /* @__PURE__ */ E("div", { className: "flex items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
4741
+ c.map((l, d) => /* @__PURE__ */ C("section", { className: oe(d > 0 && "mt-4"), children: [
4742
+ /* @__PURE__ */ C("div", { className: "flex items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
4741
4743
  /* @__PURE__ */ u("span", { children: l.label }),
4742
4744
  /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: l.items.length })
4743
4745
  ] }),
@@ -4764,7 +4766,7 @@ function uc({
4764
4766
  onDelete: r
4765
4767
  }) {
4766
4768
  const o = cc(e.updatedAt);
4767
- return /* @__PURE__ */ E(
4769
+ return /* @__PURE__ */ C(
4768
4770
  "li",
4769
4771
  {
4770
4772
  role: "listitem",
@@ -4777,7 +4779,7 @@ function uc({
4777
4779
  ),
4778
4780
  onClick: () => n == null ? void 0 : n(e.id),
4779
4781
  children: [
4780
- /* @__PURE__ */ E("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
4782
+ /* @__PURE__ */ C("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
4781
4783
  /* @__PURE__ */ u("span", { className: oe(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }),
4782
4784
  o && /* @__PURE__ */ u(
4783
4785
  "span",
@@ -4791,7 +4793,7 @@ function uc({
4791
4793
  )
4792
4794
  ] }),
4793
4795
  r && /* @__PURE__ */ u(
4794
- we,
4796
+ Pe,
4795
4797
  {
4796
4798
  type: "button",
4797
4799
  variant: "ghost",
@@ -4824,8 +4826,8 @@ const fc = {
4824
4826
  component: dc,
4825
4827
  placement: "left",
4826
4828
  source: "builtin"
4827
- }, zn = "files";
4828
- function zr({
4829
+ }, jn = "files";
4830
+ function Mr({
4829
4831
  rootDir: e = "",
4830
4832
  bridge: t,
4831
4833
  defaultTab: n,
@@ -4848,7 +4850,7 @@ function zr({
4848
4850
  j.push({
4849
4851
  id: se.id,
4850
4852
  title: se.title,
4851
- icon: le ? /* @__PURE__ */ u(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ u(fo, { className: "h-3.5 w-3.5" }),
4853
+ icon: le ? /* @__PURE__ */ u(le, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ u(lo, { className: "h-3.5 w-3.5" }),
4852
4854
  panel: se
4853
4855
  });
4854
4856
  }
@@ -4860,7 +4862,7 @@ function zr({
4860
4862
  }, [h]), _(() => {
4861
4863
  d.length > 0 && !d.some((j) => j.id === a) && f(d[0].id);
4862
4864
  }, [a, d]), _(() => {
4863
- r && d.some((j) => j.id === zn) && f(zn);
4865
+ r && d.some((j) => j.id === jn) && f(jn);
4864
4866
  }, [r, d]);
4865
4867
  const D = I(() => {
4866
4868
  g((j) => (j && w(""), !j));
@@ -4877,10 +4879,10 @@ function zr({
4877
4879
  }),
4878
4880
  [t, m, r, e]
4879
4881
  );
4880
- return /* @__PURE__ */ E("div", { "data-boring-workspace-part": "workbench-left", className: oe("workbench-left-root flex h-full min-h-0 flex-col", s), children: [
4881
- /* @__PURE__ */ E("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 px-2.5", children: [
4882
- /* @__PURE__ */ u(Do, { value: p, onValueChange: f, className: "min-w-0 flex-1 overflow-hidden", "aria-label": "Workbench sources", children: /* @__PURE__ */ u(Lo, { variant: "line", className: "h-auto min-w-0 max-w-full gap-0.5 overflow-x-auto p-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: d.map((j) => /* @__PURE__ */ E(
4883
- _o,
4882
+ return /* @__PURE__ */ C("div", { "data-boring-workspace-part": "workbench-left", className: oe("workbench-left-root flex h-full min-h-0 flex-col", s), children: [
4883
+ /* @__PURE__ */ C("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 px-2.5", children: [
4884
+ /* @__PURE__ */ u(Fo, { value: p, onValueChange: f, className: "min-w-0 flex-1 overflow-hidden", "aria-label": "Workbench sources", children: /* @__PURE__ */ u(Do, { variant: "line", className: "h-auto min-w-0 max-w-full gap-0.5 overflow-x-auto p-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: d.map((j) => /* @__PURE__ */ C(
4885
+ Lo,
4884
4886
  {
4885
4887
  value: j.id,
4886
4888
  className: "h-8 flex-none gap-1.5 px-2 py-1 text-[12px] data-[state=active]:text-foreground data-[state=active]:after:bg-[color:var(--accent)]",
@@ -4892,7 +4894,7 @@ function zr({
4892
4894
  j.id
4893
4895
  )) }) }),
4894
4896
  R && /* @__PURE__ */ u(
4895
- we,
4897
+ Pe,
4896
4898
  {
4897
4899
  type: "button",
4898
4900
  variant: "ghost",
@@ -4901,11 +4903,11 @@ function zr({
4901
4903
  className: oe(h && "bg-foreground/5 text-foreground"),
4902
4904
  "aria-label": "Search",
4903
4905
  title: "Search",
4904
- children: /* @__PURE__ */ u(fn, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
4906
+ children: /* @__PURE__ */ u(pn, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
4905
4907
  }
4906
4908
  ),
4907
4909
  o && /* @__PURE__ */ u(
4908
- we,
4910
+ Pe,
4909
4911
  {
4910
4912
  type: "button",
4911
4913
  variant: "ghost",
@@ -4913,12 +4915,12 @@ function zr({
4913
4915
  onClick: o,
4914
4916
  "aria-label": "Hide sources",
4915
4917
  title: "Hide sources",
4916
- children: /* @__PURE__ */ u(Gn, { className: "h-4 w-4", strokeWidth: 1.75 })
4918
+ children: /* @__PURE__ */ u(Hn, { className: "h-4 w-4", strokeWidth: 1.75 })
4917
4919
  }
4918
4920
  )
4919
4921
  ] }),
4920
- R && h && /* @__PURE__ */ E("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
4921
- /* @__PURE__ */ u(fn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
4922
+ R && h && /* @__PURE__ */ C("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
4923
+ /* @__PURE__ */ u(pn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
4922
4924
  /* @__PURE__ */ u(
4923
4925
  Yn,
4924
4926
  {
@@ -4932,14 +4934,14 @@ function zr({
4932
4934
  }
4933
4935
  ),
4934
4936
  y && /* @__PURE__ */ u(
4935
- we,
4937
+ Pe,
4936
4938
  {
4937
4939
  type: "button",
4938
4940
  variant: "ghost",
4939
4941
  size: "icon-xs",
4940
4942
  onClick: () => w(""),
4941
4943
  "aria-label": "Clear search",
4942
- children: /* @__PURE__ */ u(Kn, { className: "h-3 w-3" })
4944
+ children: /* @__PURE__ */ u(Gn, { className: "h-3 w-3" })
4943
4945
  }
4944
4946
  )
4945
4947
  ] }),
@@ -4985,7 +4987,7 @@ function gc({ panel: e, params: t }) {
4985
4987
  );
4986
4988
  }
4987
4989
  function vc({ params: e }) {
4988
- return Ae(zr, e ?? {});
4990
+ return Ae(Mr, e ?? {});
4989
4991
  }
4990
4992
  const yc = {
4991
4993
  id: "workbench-left",
@@ -4993,7 +4995,7 @@ const yc = {
4993
4995
  component: vc,
4994
4996
  placement: "left",
4995
4997
  source: "builtin"
4996
- }, wc = "boring-ui-v2:surface", jr = 1, bc = {
4998
+ }, wc = "boring-ui-v2:surface", Wr = 1, bc = {
4997
4999
  version: "2.0",
4998
5000
  groups: [{ id: "artifacts", position: "center", dynamic: !0 }]
4999
5001
  };
@@ -5014,7 +5016,7 @@ function Sc(e, t) {
5014
5016
  }
5015
5017
  if (!r || typeof r != "object") return;
5016
5018
  const o = r;
5017
- if (o.v !== jr) return;
5019
+ if (o.v !== Wr) return;
5018
5020
  const s = o.layout;
5019
5021
  if (!s || typeof s != "object") return;
5020
5022
  const i = s.panels;
@@ -5027,7 +5029,7 @@ function Sc(e, t) {
5027
5029
  return s;
5028
5030
  }
5029
5031
  }
5030
- function Br({
5032
+ function zr({
5031
5033
  visible: e = !0,
5032
5034
  storageKey: t = wc,
5033
5035
  allowedPanels: n,
@@ -5048,7 +5050,7 @@ function Br({
5048
5050
  o(g);
5049
5051
  return;
5050
5052
  }
5051
- const y = { v: jr, layout: g };
5053
+ const y = { v: Wr, layout: g };
5052
5054
  try {
5053
5055
  window.localStorage.setItem(t, JSON.stringify(y));
5054
5056
  } catch {
@@ -5078,14 +5080,14 @@ function Br({
5078
5080
  }
5079
5081
  ) : null;
5080
5082
  }
5081
- Br.defaultAllowedPanels = [];
5083
+ zr.defaultAllowedPanels = [];
5082
5084
  function kt(e) {
5083
5085
  const r = e.trim().replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+/g, "/");
5084
5086
  if (r.includes(".."))
5085
5087
  throw new Error("Invalid path: path traversal not allowed");
5086
5088
  return r;
5087
5089
  }
5088
- function jn(e, t) {
5090
+ function Bn(e, t) {
5089
5091
  const n = `file:${t}`;
5090
5092
  return e.getPanel(n) ?? e.panels.find(
5091
5093
  (r) => {
@@ -5103,26 +5105,26 @@ function xc(e) {
5103
5105
  function jt(e, t) {
5104
5106
  return t.id ?? `surface:${e.kind}:${e.target}`;
5105
5107
  }
5106
- const Ur = "__boringFileBacked";
5107
- function Bn(e, t) {
5108
+ const jr = "__boringFileBacked";
5109
+ function Un(e, t) {
5108
5110
  var r, o;
5109
- if (!e || !e.id.startsWith("file:") && !e.id.startsWith(`surface:${Be}:`) && !t.has(e.id) && ((r = e.params) == null ? void 0 : r[Ur]) !== !0) return null;
5111
+ if (!e || !e.id.startsWith("file:") && !e.id.startsWith(`surface:${Be}:`) && !t.has(e.id) && ((r = e.params) == null ? void 0 : r[jr]) !== !0) return null;
5110
5112
  const n = (o = e.params) == null ? void 0 : o.path;
5111
5113
  return typeof n == "string" ? n : null;
5112
5114
  }
5113
- let qr = 0;
5115
+ let Br = 0;
5114
5116
  function Bt(e, t) {
5115
5117
  return {
5116
5118
  ...e ?? {},
5117
5119
  path: typeof (e == null ? void 0 : e.path) == "string" ? e.path : t,
5118
- [Ur]: !0
5120
+ [jr]: !0
5119
5121
  };
5120
5122
  }
5121
5123
  function De() {
5122
- return { seq: ++qr, status: "ok" };
5124
+ return { seq: ++Br, status: "ok" };
5123
5125
  }
5124
5126
  function gt(e, t) {
5125
- return { seq: ++qr, status: "error", error: { code: e, message: t } };
5127
+ return { seq: ++Br, status: "error", error: { code: e, message: t } };
5126
5128
  }
5127
5129
  function kc({
5128
5130
  rootDir: e = "",
@@ -5208,7 +5210,7 @@ function kc({
5208
5210
  });
5209
5211
  return;
5210
5212
  }
5211
- const de = jn(k, P);
5213
+ const de = Bn(k, P);
5212
5214
  if (de) {
5213
5215
  de.api.setActive();
5214
5216
  return;
@@ -5246,7 +5248,7 @@ function kc({
5246
5248
  title: z.title ?? P.target,
5247
5249
  params: ve
5248
5250
  });
5249
- }, []), Se = I((b) => {
5251
+ }, []), be = I((b) => {
5250
5252
  const k = w.current;
5251
5253
  if (!k) return;
5252
5254
  const P = k.getPanel(b.id);
@@ -5267,7 +5269,7 @@ function kc({
5267
5269
  title: b.title ?? b.id,
5268
5270
  params: b.params
5269
5271
  });
5270
- }, []), xe = I(() => {
5272
+ }, []), Se = I(() => {
5271
5273
  var P;
5272
5274
  const b = w.current;
5273
5275
  return b ? { openTabs: b.panels.map((z) => ({
@@ -5287,17 +5289,17 @@ function kc({
5287
5289
  }, [Ue]), Qe = G(() => ({
5288
5290
  openFile: Ce,
5289
5291
  openSurface: pe,
5290
- openPanel: Se,
5292
+ openPanel: be,
5291
5293
  closeWorkbenchLeftPane: () => h(!0),
5292
5294
  expandToFile: qe,
5293
- getSnapshot: xe
5294
- }), [qe, xe, Ce, Se, pe]), X = I(() => {
5295
+ getSnapshot: Se
5296
+ }), [qe, Se, Ce, be, pe]), X = I(() => {
5295
5297
  var fe;
5296
5298
  const b = w.current, k = b ? b.panels.map((ne) => ({
5297
5299
  id: ne.id,
5298
5300
  component: String(ne.component ?? ""),
5299
5301
  params: ne.params ?? void 0
5300
- })) : [], P = ((fe = b == null ? void 0 : b.activePanel) == null ? void 0 : fe.id) ?? null, z = $.current, Q = k.find((ne) => ne.id === P), de = Bn(Q, z);
5302
+ })) : [], P = ((fe = b == null ? void 0 : b.activePanel) == null ? void 0 : fe.id) ?? null, z = $.current, Q = k.find((ne) => ne.id === P), de = Un(Q, z);
5301
5303
  return {
5302
5304
  hydrationComplete: !0,
5303
5305
  layout: null,
@@ -5307,7 +5309,7 @@ function kc({
5307
5309
  panels: k,
5308
5310
  activePanel: P,
5309
5311
  activeFile: de,
5310
- visibleFiles: k.map((ne) => Bn(ne, z)).filter((ne) => ne !== null),
5312
+ visibleFiles: k.map((ne) => Un(ne, z)).filter((ne) => ne !== null),
5311
5313
  dirtyFiles: {},
5312
5314
  notifications: []
5313
5315
  };
@@ -5325,10 +5327,10 @@ function kc({
5325
5327
  (P = x.current) == null || P.call(x, Qe);
5326
5328
  const k = () => {
5327
5329
  var z;
5328
- (z = U.current) == null || z.call(U, xe()), ie();
5330
+ (z = U.current) == null || z.call(U, Se()), ie();
5329
5331
  };
5330
5332
  b.onDidAddPanel(k), b.onDidRemovePanel(k), b.onDidActivePanelChange(k), k();
5331
- }, [Qe, xe, ie]), ge = I(
5333
+ }, [Qe, Se, ie]), ge = I(
5332
5334
  async (b) => {
5333
5335
  try {
5334
5336
  const k = w.current;
@@ -5353,7 +5355,7 @@ function kc({
5353
5355
  params: ne
5354
5356
  }), De());
5355
5357
  }
5356
- const de = jn(k, P);
5358
+ const de = Bn(k, P);
5357
5359
  return de ? (de.api.setActive(), De()) : gt("NO_SURFACE_RESOLVER", `no registered surface resolver handles ${P}`);
5358
5360
  } catch (k) {
5359
5361
  return gt(
@@ -5427,7 +5429,7 @@ function kc({
5427
5429
  localStorage.setItem(`${o}:sidebarCollapsed`, p ? "1" : "0");
5428
5430
  } catch {
5429
5431
  }
5430
- }, [o, p]), /* @__PURE__ */ E(
5432
+ }, [o, p]), /* @__PURE__ */ C(
5431
5433
  "div",
5432
5434
  {
5433
5435
  ref: m,
@@ -5435,7 +5437,7 @@ function kc({
5435
5437
  className: oe("flex h-full min-h-0 w-full bg-background", f),
5436
5438
  "data-testid": "surface-shell",
5437
5439
  children: [
5438
- p ? null : /* @__PURE__ */ E($e, { children: [
5440
+ p ? null : /* @__PURE__ */ C($e, { children: [
5439
5441
  /* @__PURE__ */ u(
5440
5442
  "aside",
5441
5443
  {
@@ -5445,7 +5447,7 @@ function kc({
5445
5447
  style: { width: g, minWidth: g, maxWidth: g },
5446
5448
  "aria-label": "Workbench left pane",
5447
5449
  children: /* @__PURE__ */ u(
5448
- zr,
5450
+ Mr,
5449
5451
  {
5450
5452
  rootDir: e,
5451
5453
  bridge: Ve,
@@ -5476,7 +5478,7 @@ function kc({
5476
5478
  }
5477
5479
  )
5478
5480
  ] }),
5479
- /* @__PURE__ */ E("div", { className: "relative min-w-0 flex-1", children: [
5481
+ /* @__PURE__ */ C("div", { className: "relative min-w-0 flex-1", children: [
5480
5482
  /* @__PURE__ */ u(
5481
5483
  "div",
5482
5484
  {
@@ -5485,36 +5487,37 @@ function kc({
5485
5487
  className: "workbench-dockview h-full",
5486
5488
  "data-collapsed-sources": p ? "true" : void 0,
5487
5489
  children: /* @__PURE__ */ u(
5488
- Br,
5490
+ zr,
5489
5491
  {
5490
5492
  storageKey: o,
5491
5493
  onReady: ae,
5492
- allowedPanels: ue,
5493
- rightHeaderActions: c ? () => /* @__PURE__ */ u(Pc, { onClose: c }) : void 0
5494
+ allowedPanels: ue
5494
5495
  }
5495
5496
  )
5496
5497
  }
5497
5498
  ),
5498
- p && /* @__PURE__ */ u("div", { className: "pointer-events-none absolute left-0 top-0 z-20 flex items-center", style: { height: 44 }, children: /* @__PURE__ */ u(
5499
- we,
5500
- {
5501
- type: "button",
5502
- variant: "ghost",
5503
- size: "icon-xs",
5504
- onClick: () => h(!1),
5505
- className: "pointer-events-auto ml-2",
5506
- "aria-label": "Show sources",
5507
- title: "Show sources",
5508
- children: /* @__PURE__ */ u(Pt, { className: "h-4 w-4", strokeWidth: 1.75 })
5509
- }
5510
- ) }),
5499
+ /* @__PURE__ */ C("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-20 flex items-center justify-between", style: { height: 44 }, children: [
5500
+ /* @__PURE__ */ u("div", { children: p && /* @__PURE__ */ u(
5501
+ Pe,
5502
+ {
5503
+ type: "button",
5504
+ variant: "ghost",
5505
+ size: "icon-xs",
5506
+ onClick: () => h(!1),
5507
+ className: "pointer-events-auto ml-2",
5508
+ "aria-label": "Show sources",
5509
+ title: "Show sources",
5510
+ children: /* @__PURE__ */ u(Pt, { className: "h-4 w-4", strokeWidth: 1.75 })
5511
+ }
5512
+ ) }),
5513
+ c && /* @__PURE__ */ u(Pc, { onClose: c })
5514
+ ] }),
5511
5515
  /* @__PURE__ */ u(
5512
5516
  Cc,
5513
5517
  {
5514
5518
  api: v,
5515
5519
  collapsed: p,
5516
- onExpandFiles: () => h(!1),
5517
- onClose: c
5520
+ onExpandFiles: () => h(!1)
5518
5521
  }
5519
5522
  )
5520
5523
  ] })
@@ -5524,38 +5527,37 @@ function kc({
5524
5527
  }
5525
5528
  function Pc({ onClose: e }) {
5526
5529
  return /* @__PURE__ */ u(
5527
- we,
5530
+ Pe,
5528
5531
  {
5529
5532
  type: "button",
5530
5533
  variant: "ghost",
5531
5534
  size: "icon-xs",
5532
5535
  onClick: e,
5533
- className: "mx-1",
5536
+ className: "pointer-events-auto mx-1",
5534
5537
  "aria-label": "Close workbench",
5535
5538
  title: "Close workbench (⌘2)",
5536
- children: /* @__PURE__ */ u(Hn, { className: "h-4 w-4", strokeWidth: 1.75 })
5539
+ children: /* @__PURE__ */ u(uo, { className: "h-4 w-4", strokeWidth: 1.75 })
5537
5540
  }
5538
5541
  );
5539
5542
  }
5540
5543
  function Cc({
5541
5544
  api: e,
5542
5545
  collapsed: t,
5543
- onExpandFiles: n,
5544
- onClose: r
5546
+ onExpandFiles: n
5545
5547
  }) {
5546
- const [o, s] = O(!0);
5548
+ const [r, o] = O(!0);
5547
5549
  return _(() => {
5548
5550
  if (!e) return;
5549
- const i = () => s(e.panels.length === 0);
5550
- i();
5551
- const c = e.onDidAddPanel(i), l = e.onDidRemovePanel(i);
5551
+ const s = () => o(e.panels.length === 0);
5552
+ s();
5553
+ const i = e.onDidAddPanel(s), c = e.onDidRemovePanel(s);
5552
5554
  return () => {
5553
- c.dispose(), l.dispose();
5555
+ i.dispose(), c.dispose();
5554
5556
  };
5555
- }, [e]), o ? /* @__PURE__ */ E($e, { children: [
5556
- /* @__PURE__ */ E("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: [
5557
+ }, [e]), r ? /* @__PURE__ */ C($e, { children: [
5558
+ /* @__PURE__ */ C("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: [
5557
5559
  t && /* @__PURE__ */ u(
5558
- we,
5560
+ Pe,
5559
5561
  {
5560
5562
  type: "button",
5561
5563
  variant: "ghost",
@@ -5567,29 +5569,16 @@ function Cc({
5567
5569
  children: /* @__PURE__ */ u(Pt, { className: "h-4 w-4", strokeWidth: 1.75 })
5568
5570
  }
5569
5571
  ),
5570
- /* @__PURE__ */ u("div", { className: "flex-1" }),
5571
- r && /* @__PURE__ */ u(
5572
- we,
5573
- {
5574
- type: "button",
5575
- variant: "ghost",
5576
- size: "icon-xs",
5577
- onClick: r,
5578
- className: "pointer-events-auto mx-1",
5579
- "aria-label": "Close workbench",
5580
- title: "Close workbench (⌘2)",
5581
- children: /* @__PURE__ */ u(Hn, { className: "h-4 w-4", strokeWidth: 1.75 })
5582
- }
5583
- )
5572
+ /* @__PURE__ */ u("div", { className: "flex-1" })
5584
5573
  ] }),
5585
- /* @__PURE__ */ E("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
5586
- /* @__PURE__ */ E("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
5574
+ /* @__PURE__ */ C("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
5575
+ /* @__PURE__ */ C("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
5587
5576
  /* @__PURE__ */ u("span", { className: "inline-block h-px w-3 bg-[color:var(--accent)]", "aria-hidden": "true" }),
5588
5577
  "Workbench"
5589
5578
  ] }),
5590
5579
  /* @__PURE__ */ u("div", { className: "text-[15px] font-medium tracking-tight text-foreground", children: "Nothing open yet" }),
5591
5580
  /* @__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." }),
5592
- t && /* @__PURE__ */ E(
5581
+ t && /* @__PURE__ */ C(
5593
5582
  _e,
5594
5583
  {
5595
5584
  type: "button",
@@ -5626,9 +5615,9 @@ const Ic = {
5626
5615
  },
5627
5616
  removeBlocker: () => {
5628
5617
  }
5629
- }, Vr = be(null);
5618
+ }, Ur = we(null);
5630
5619
  function Rc() {
5631
- return ce(Vr) ?? Nc;
5620
+ return ce(Ur) ?? Nc;
5632
5621
  }
5633
5622
  function Ac({ children: e }) {
5634
5623
  const [t, n] = O([]), r = I((i) => {
@@ -5639,18 +5628,18 @@ function Ac({ children: e }) {
5639
5628
  () => ({ blockers: t, addBlocker: r, removeBlocker: o }),
5640
5629
  [t, r, o]
5641
5630
  );
5642
- return /* @__PURE__ */ u(Vr.Provider, { value: s, children: e });
5631
+ return /* @__PURE__ */ u(Ur.Provider, { value: s, children: e });
5643
5632
  }
5644
5633
  const Le = "boring-ui:agent-plugins-reloaded", Fc = "PLUGIN_LOAD_FAILED";
5645
5634
  globalThis.__BORING_RUNTIME_SINGLETONS__ = {
5646
5635
  ...globalThis.__BORING_RUNTIME_SINGLETONS__,
5647
- react: to,
5648
- "react-dom": Bo,
5649
- "react-dom/client": qo,
5650
- "react/jsx-dev-runtime": Vo,
5651
- "react/jsx-runtime": eo
5636
+ react: Zr,
5637
+ "react-dom": jo,
5638
+ "react-dom/client": Uo,
5639
+ "react/jsx-dev-runtime": qo,
5640
+ "react/jsx-runtime": Qr
5652
5641
  };
5653
- function Kr(e, t) {
5642
+ function qr(e, t) {
5654
5643
  return e ? `${e.replace(/\/$/, "")}${t}` : t;
5655
5644
  }
5656
5645
  function Dc(e, t) {
@@ -5661,13 +5650,13 @@ function Dc(e, t) {
5661
5650
  function Lc(e) {
5662
5651
  return /^[A-Za-z][A-Za-z0-9+.-]*:/.test(e) || e.startsWith("//");
5663
5652
  }
5664
- function Un(e, t) {
5665
- return !t || Lc(e) ? e : Kr(t, e.startsWith("/") ? e : `/${e}`);
5653
+ function qn(e, t) {
5654
+ return !t || Lc(e) ? e : qr(t, e.startsWith("/") ? e : `/${e}`);
5666
5655
  }
5667
5656
  function _c(e, t) {
5668
5657
  const n = e.frontTarget;
5669
- if (n != null && n.entryUrl) return Un(n.entryUrl, t);
5670
- if (e.frontUrl) return Un(e.frontUrl, t);
5658
+ if (n != null && n.entryUrl) return qn(n.entryUrl, t);
5659
+ if (e.frontUrl) return qn(e.frontUrl, t);
5671
5660
  }
5672
5661
  function $c(e, t, n, r) {
5673
5662
  return { panels: e, commands: t, catalogs: n, surfaceResolvers: r };
@@ -5685,13 +5674,13 @@ function Wc(e, t, n) {
5685
5674
  const r = `${e}${e.includes("?") ? "&" : "?"}v=${t}`;
5686
5675
  return n === void 0 ? r : `${r}&t=${encodeURIComponent(String(n))}`;
5687
5676
  }
5688
- const qn = 3e4;
5677
+ const Vn = 3e4;
5689
5678
  async function zc(e, t) {
5690
5679
  let n = !1;
5691
5680
  const r = new Promise((s, i) => {
5692
5681
  setTimeout(() => {
5693
- n || i(new Error(`importFront timed out after ${qn}ms (plugin asset at ${e})`));
5694
- }, qn);
5682
+ n || i(new Error(`importFront timed out after ${Vn}ms (plugin asset at ${e})`));
5683
+ }, Vn);
5695
5684
  }), o = await Promise.race([
5696
5685
  import(
5697
5686
  /* @vite-ignore */
@@ -5812,7 +5801,7 @@ function yt(e, t) {
5812
5801
  t.panels.replaceByPluginId(e, []), t.commands.replaceByPluginId(e, []), t.catalogs.replaceByPluginId(e, []), t.surfaceResolvers.replaceByPluginId(e, []);
5813
5802
  }
5814
5803
  function Gc(e) {
5815
- const t = At(), n = Qt(), r = Ft(), o = nr(), s = N(/* @__PURE__ */ new Map()), i = N(/* @__PURE__ */ new Map()), c = N(/* @__PURE__ */ new Set());
5804
+ const t = At(), n = Zt(), r = Ft(), o = nr(), s = N(/* @__PURE__ */ new Map()), i = N(/* @__PURE__ */ new Map()), c = N(/* @__PURE__ */ new Set());
5816
5805
  _(() => {
5817
5806
  if (e.enabled === !1 || typeof EventSource > "u") return;
5818
5807
  if (Mc(e.authHeaders)) {
@@ -5822,7 +5811,7 @@ function Gc(e) {
5822
5811
  return;
5823
5812
  }
5824
5813
  let l = !1;
5825
- const d = $c(t, n, r, o), a = Dc(Kr(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), f = new EventSource(a, { withCredentials: !0 }), p = (w) => {
5814
+ const d = $c(t, n, r, o), a = Dc(qr(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), f = new EventSource(a, { withCredentials: !0 }), p = (w) => {
5826
5815
  (async () => {
5827
5816
  let m, F = !1;
5828
5817
  try {
@@ -5960,21 +5949,21 @@ function Jc(e) {
5960
5949
  enabled: e.mode === "vite"
5961
5950
  }), null;
5962
5951
  }
5963
- function Gr() {
5952
+ function Vr() {
5964
5953
  return typeof window > "u" || typeof window.matchMedia != "function" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
5965
5954
  }
5966
- const Vn = "workspace-provider", Yc = "workspace-provider", cn = be(null);
5955
+ const Kn = "workspace-provider", Yc = "workspace-provider", ln = we(null);
5967
5956
  function $l() {
5968
- const e = ce(cn);
5957
+ const e = ce(ln);
5969
5958
  if (!e) throw new Error("useTheme must be used within a WorkspaceProvider");
5970
- return { theme: on(), setTheme: e.setTheme, toggleTheme: e.toggleTheme };
5959
+ return { theme: sn(), setTheme: e.setTheme, toggleTheme: e.toggleTheme };
5971
5960
  }
5972
5961
  function Ol({ children: e, defaultTheme: t, onThemeChange: n }) {
5973
5962
  const r = N(null);
5974
5963
  if (!r.current) {
5975
- const d = Dr({ persistenceEnabled: !1 });
5976
- br(d);
5977
- const a = t ?? Gr();
5964
+ const d = Ar({ persistenceEnabled: !1 });
5965
+ yr(d);
5966
+ const a = t ?? Vr();
5978
5967
  a !== "light" && d.getState().setTheme(a), r.current = d;
5979
5968
  }
5980
5969
  const o = r.current, s = I(
@@ -5985,27 +5974,27 @@ function Ol({ children: e, defaultTheme: t, onThemeChange: n }) {
5985
5974
  ), i = I(() => {
5986
5975
  const d = o.getState().preferences.theme === "light" ? "dark" : "light";
5987
5976
  s(d);
5988
- }, [o, s]), c = on();
5977
+ }, [o, s]), c = sn();
5989
5978
  _(() => (document.documentElement.setAttribute("data-theme", c), () => {
5990
5979
  document.documentElement.removeAttribute("data-theme");
5991
5980
  }), [c]);
5992
5981
  const l = G(() => ({ setTheme: s, toggleTheme: i }), [s, i]);
5993
- return /* @__PURE__ */ u(cn.Provider, { value: l, children: e });
5982
+ return /* @__PURE__ */ u(ln.Provider, { value: l, children: e });
5994
5983
  }
5995
- const Hr = be(null);
5984
+ const Kr = we(null);
5996
5985
  function Ml() {
5997
- const e = ce(Hr);
5986
+ const e = ce(Kr);
5998
5987
  if (!e) throw new Error("useWorkspaceBridge must be used within a WorkspaceProvider");
5999
5988
  return e;
6000
5989
  }
6001
- const ln = be(null);
5990
+ const un = we(null);
6002
5991
  function Xc() {
6003
- const e = ce(ln);
5992
+ const e = ce(un);
6004
5993
  if (!e) throw new Error("useWorkspaceContext must be used within a WorkspaceProvider");
6005
5994
  return e;
6006
5995
  }
6007
5996
  function Qc() {
6008
- return ce(ln);
5997
+ return ce(un);
6009
5998
  }
6010
5999
  function Zc() {
6011
6000
  const { chatPanel: e } = Xc();
@@ -6045,10 +6034,10 @@ function el({
6045
6034
  ],
6046
6035
  [e]
6047
6036
  );
6048
- return Cr({ shortcuts: t }), null;
6037
+ return kr({ shortcuts: t }), null;
6049
6038
  }
6050
6039
  function tl({ commands: e }) {
6051
- const t = Qt();
6040
+ const t = Zt();
6052
6041
  return _(() => {
6053
6042
  if (!(e != null && e.length)) return;
6054
6043
  const n = e.map((r) => r.id);
@@ -6067,9 +6056,9 @@ function nl({
6067
6056
  return _(() => {
6068
6057
  if (e != null && e.length) {
6069
6058
  for (const n of e)
6070
- t.register(n, Vn);
6059
+ t.register(n, Kn);
6071
6060
  return () => {
6072
- t.unregisterByPluginId(Vn);
6061
+ t.unregisterByPluginId(Kn);
6073
6062
  };
6074
6063
  }
6075
6064
  }, [t, e]), null;
@@ -6146,13 +6135,13 @@ function Wl({
6146
6135
  }) {
6147
6136
  const L = N(null);
6148
6137
  if (!L.current) {
6149
- const X = Dr({
6138
+ const X = Ar({
6150
6139
  workspaceId: h,
6151
6140
  storageKey: g,
6152
6141
  persistenceEnabled: y
6153
6142
  });
6154
- br(X);
6155
- const ie = f ?? Gr();
6143
+ yr(X);
6144
+ const ie = f ?? Vr();
6156
6145
  ie !== "light" && !y ? X.getState().setTheme(ie) : ie !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || X.getState().setTheme(ie)), L.current = X;
6157
6146
  }
6158
6147
  const x = L.current, U = N(null), R = N(d);
@@ -6164,7 +6153,7 @@ function Wl({
6164
6153
  }, [x]), _(() => {
6165
6154
  var ae, ge;
6166
6155
  if (U.current && (U.current.disconnect(), U.current = null), !w) return;
6167
- const X = ys(x), ie = (ge = (ae = R.current) == null ? void 0 : ae.Authorization) == null ? void 0 : ge.replace(/^Bearer\s+/i, ""), he = xs({
6156
+ const X = vs(x), ie = (ge = (ae = R.current) == null ? void 0 : ae.Authorization) == null ? void 0 : ge.replace(/^Bearer\s+/i, ""), he = Ss({
6168
6157
  endpoint: w,
6169
6158
  bridge: X,
6170
6159
  store: x,
@@ -6185,7 +6174,7 @@ function Wl({
6185
6174
  const { id: b, ...k } = Ie;
6186
6175
  X.register(b, k);
6187
6176
  }
6188
- const Ve = new Set(r ?? []).has(Nn.pluginId) ? [] : [Nn], Ke = es({
6177
+ const Ve = new Set(r ?? []).has(Rn.pluginId) ? [] : [Rn], Ke = Zo({
6189
6178
  chatPanel: t ?? Hc,
6190
6179
  plugins: n ?? [],
6191
6180
  defaults: Ve,
@@ -6223,41 +6212,41 @@ function Wl({
6223
6212
  ), ue = I(() => {
6224
6213
  const X = x.getState().preferences.theme === "light" ? "dark" : "light";
6225
6214
  H(X);
6226
- }, [x, H]), Ce = on();
6215
+ }, [x, H]), Ce = sn();
6227
6216
  _(() => (document.documentElement.setAttribute("data-theme", Ce), () => {
6228
6217
  document.documentElement.removeAttribute("data-theme");
6229
6218
  }), [Ce]);
6230
6219
  const pe = G(
6231
6220
  () => ({ setTheme: H, toggleTheme: ue }),
6232
6221
  [H, ue]
6233
- ), Se = G(
6222
+ ), be = G(
6234
6223
  () => il(h, d),
6235
6224
  [d, h]
6236
- ), [xe, Ue] = O(!1), qe = G(
6237
- () => ({ connected: xe }),
6238
- [xe]
6225
+ ), [Se, Ue] = O(!1), qe = G(
6226
+ () => ({ connected: Se }),
6227
+ [Se]
6239
6228
  ), Qe = G(
6240
6229
  () => ({ chatPanel: t ?? null, registeredPlugins: le, debug: v }),
6241
6230
  [t, le, v]
6242
6231
  );
6243
- return /* @__PURE__ */ u(ln.Provider, { value: Qe, children: /* @__PURE__ */ u(cn.Provider, { value: pe, children: /* @__PURE__ */ u(Hr.Provider, { value: qe, children: /* @__PURE__ */ u(Ta, { basePath: D, children: /* @__PURE__ */ u(Ac, { children: /* @__PURE__ */ u(is, { children: /* @__PURE__ */ u(
6244
- ns,
6232
+ return /* @__PURE__ */ u(un.Provider, { value: Qe, children: /* @__PURE__ */ u(ln.Provider, { value: pe, children: /* @__PURE__ */ u(Kr.Provider, { value: qe, children: /* @__PURE__ */ u(Ta, { basePath: D, children: /* @__PURE__ */ u(Ac, { children: /* @__PURE__ */ u(ss, { children: /* @__PURE__ */ u(
6233
+ ts,
6245
6234
  {
6246
6235
  panelRegistry: $,
6247
6236
  commandRegistry: te,
6248
6237
  catalogRegistry: j,
6249
6238
  surfaceResolverRegistry: se,
6250
- children: /* @__PURE__ */ E(
6239
+ children: /* @__PURE__ */ C(
6251
6240
  ol,
6252
6241
  {
6253
6242
  plugins: M,
6254
6243
  apiBaseUrl: l,
6255
- authHeaders: Se,
6244
+ authHeaders: be,
6256
6245
  onAuthError: m,
6257
6246
  apiTimeout: a,
6258
6247
  children: [
6259
6248
  /* @__PURE__ */ u(rl, { plugins: M }),
6260
- /* @__PURE__ */ u(Jc, { apiBaseUrl: l, workspaceId: h, mode: T, authHeaders: Se }),
6249
+ /* @__PURE__ */ u(Jc, { apiBaseUrl: l, workspaceId: h, mode: T, authHeaders: be }),
6261
6250
  /* @__PURE__ */ u(sl, { onOpenFile: F }),
6262
6251
  /* @__PURE__ */ u(tl, { commands: s }),
6263
6252
  /* @__PURE__ */ u(
@@ -6268,7 +6257,7 @@ function Wl({
6268
6257
  ),
6269
6258
  /* @__PURE__ */ u(el, { store: x }),
6270
6259
  /* @__PURE__ */ u(Ja, {}),
6271
- /* @__PURE__ */ u($o, {}),
6260
+ /* @__PURE__ */ u(_o, {}),
6272
6261
  e,
6273
6262
  typeof import.meta < "u" && !1
6274
6263
  ]
@@ -6279,28 +6268,28 @@ function Wl({
6279
6268
  }
6280
6269
  export {
6281
6270
  Vi as $,
6282
- Br as A,
6271
+ zr as A,
6283
6272
  qi as B,
6284
6273
  er as C,
6285
6274
  Ni as D,
6286
6275
  K as E,
6287
6276
  Wi as F,
6288
- vs as G,
6277
+ gs as G,
6289
6278
  ee as H,
6290
- Nn as I,
6279
+ Rn as I,
6291
6280
  Fl as J,
6292
6281
  mi as K,
6293
- gs as L,
6282
+ hs as L,
6294
6283
  mt as M,
6295
- hs as N,
6284
+ ms as N,
6296
6285
  Al as O,
6297
6286
  Fi as P,
6298
- fs as Q,
6299
- ns as R,
6287
+ ds as Q,
6288
+ ts as R,
6300
6289
  lc as S,
6301
6290
  Ol as T,
6302
- _s as U,
6303
- ps as V,
6291
+ Ls as U,
6292
+ fs as V,
6304
6293
  Be as W,
6305
6294
  or as X,
6306
6295
  kl as Y,
@@ -6308,26 +6297,26 @@ export {
6308
6297
  Ye as _,
6309
6298
  Cl as a,
6310
6299
  Ft as a0,
6311
- os as a1,
6312
- Qt as a2,
6313
- rs as a3,
6300
+ rs as a1,
6301
+ Zt as a2,
6302
+ ns as a3,
6314
6303
  Tl as a4,
6315
6304
  Rl as a5,
6316
6305
  Yi as a6,
6317
6306
  Vt as a7,
6318
- Er as a8,
6307
+ Pr as a8,
6319
6308
  Ll as a9,
6320
6309
  Sl as aa,
6321
6310
  hi as ab,
6322
6311
  _l as ac,
6323
- Cr as ad,
6312
+ kr as ad,
6324
6313
  Il as ae,
6325
6314
  Ra as af,
6326
6315
  bl as ag,
6327
6316
  Nl as ah,
6328
6317
  nr as ai,
6329
6318
  $l as aj,
6330
- on as ak,
6319
+ sn as ak,
6331
6320
  Rc as al,
6332
6321
  Ml as am,
6333
6322
  Zc as an,
@@ -6336,33 +6325,33 @@ export {
6336
6325
  Xe as aq,
6337
6326
  nt as ar,
6338
6327
  xl as as,
6339
- Ho as at,
6328
+ Go as at,
6340
6329
  qt as au,
6341
6330
  Dl as av,
6342
6331
  me as aw,
6343
6332
  El as b,
6344
- Pn as c,
6333
+ Cn as c,
6345
6334
  Ja as d,
6346
6335
  Ia as e,
6347
- kn as f,
6336
+ Pn as f,
6348
6337
  oa as g,
6349
6338
  pi as h,
6350
6339
  Ut as i,
6351
6340
  Dt as j,
6352
- is as k,
6341
+ ss as k,
6353
6342
  tr as l,
6354
6343
  kc as m,
6355
- zr as n,
6344
+ Mr as n,
6356
6345
  ri as o,
6357
6346
  Wl as p,
6358
- Ds as q,
6359
- br as r,
6360
- es as s,
6347
+ Fs as q,
6348
+ yr as r,
6349
+ Zo as s,
6361
6350
  Na as t,
6362
6351
  At as u,
6363
- ms as v,
6364
- ys as w,
6365
- xs as x,
6366
- Dr as y,
6367
- Ls as z
6352
+ ps as v,
6353
+ vs as w,
6354
+ Ss as x,
6355
+ Ar as y,
6356
+ Ds as z
6368
6357
  };