@hachej/boring-workspace 0.1.49 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { jsx as d, jsxs as y } from "react/jsx-runtime";
2
2
  import { useRef as C, useMemo as I, useEffect as M, useCallback as k, createContext as E, useContext as J } from "react";
3
3
  import { Tree as K } from "react-arborist";
4
4
  import { FolderOpenIcon as U, FolderIcon as V, ChevronRightIcon as X, Loader2Icon as Y } from "lucide-react";
5
- import { L as Z } from "./WorkspaceProvider-CbvaXxgT.js";
5
+ import { O as Z } from "./WorkspaceProvider-BvLlkZR_.js";
6
6
  import { EmptyState as G, Input as H } from "@hachej/boring-ui-kit";
7
7
  import { c as g } from "./utils-B6yFEsav.js";
8
8
  import { createDragDropManager as Q } from "dnd-core";
@@ -15,10 +15,10 @@ function et() {
15
15
  typeof window > "u" ? void 0 : window
16
16
  )), r[D];
17
17
  }
18
- const W = /* @__PURE__ */ new Set(), j = E({
18
+ const O = /* @__PURE__ */ new Set(), W = E({
19
19
  onContextMenu: void 0,
20
20
  editing: null,
21
- pendingPaths: W,
21
+ pendingPaths: O,
22
22
  onSubmitEdit: void 0,
23
23
  onCancelEdit: void 0
24
24
  });
@@ -95,7 +95,7 @@ function ot(r, u) {
95
95
  return l(r);
96
96
  }
97
97
  function it({ node: r, style: u, dragHandle: s }) {
98
- const { onContextMenu: l, editing: e, pendingPaths: a, onSubmitEdit: n, onCancelEdit: t } = J(j), i = r.data, m = i.kind === "dir", h = (e == null ? void 0 : e.path) === i.path, w = a.has(i.path), F = m ? r.isOpen ? U : V : Z(i.name || "untitled");
98
+ const { onContextMenu: l, editing: e, pendingPaths: a, onSubmitEdit: n, onCancelEdit: t } = J(W), i = r.data, m = i.kind === "dir", h = (e == null ? void 0 : e.path) === i.path, w = a.has(i.path), F = m ? r.isOpen ? U : V : Z(i.name || "untitled");
99
99
  return /* @__PURE__ */ y(
100
100
  "div",
101
101
  {
@@ -216,7 +216,7 @@ function ht({
216
216
  cancelAnimationFrame(c), cancelAnimationFrame(o);
217
217
  };
218
218
  }, [r, f, a]);
219
- const O = I(
219
+ const j = I(
220
220
  () => u || void 0,
221
221
  [u]
222
222
  ), R = k(
@@ -259,7 +259,7 @@ function ht({
259
259
  () => ({
260
260
  onContextMenu: h,
261
261
  editing: e ?? null,
262
- pendingPaths: n ?? W,
262
+ pendingPaths: n ?? O,
263
263
  onSubmitEdit: w,
264
264
  onCancelEdit: F
265
265
  }),
@@ -284,7 +284,7 @@ function ht({
284
284
  title: "No matching files",
285
285
  description: s != null && s.trim() ? `No files match “${s.trim()}”.` : "No files match the current filter."
286
286
  }
287
- ) }) : /* @__PURE__ */ d(j.Provider, { value: _, children: /* @__PURE__ */ d("div", { "data-boring-workspace-part": "file-tree", className: g("file-tree", P), children: /* @__PURE__ */ d(
287
+ ) }) : /* @__PURE__ */ d(W.Provider, { value: _, children: /* @__PURE__ */ d("div", { "data-boring-workspace-part": "file-tree", className: g("file-tree", P), children: /* @__PURE__ */ d(
288
288
  K,
289
289
  {
290
290
  ref: b,
@@ -296,7 +296,7 @@ function ht({
296
296
  height: l,
297
297
  rowHeight: 26,
298
298
  indent: 14,
299
- selection: O,
299
+ selection: j,
300
300
  searchTerm: s ?? "",
301
301
  searchMatch: S,
302
302
  onActivate: R,
@@ -15,7 +15,7 @@ import { TableHeader as pt } from "@tiptap/extension-table-header";
15
15
  import { TableCell as mt } from "@tiptap/extension-table-cell";
16
16
  import ht from "@tiptap/extension-image";
17
17
  import { c as E } from "./utils-B6yFEsav.js";
18
- import { _ as O, aq as V, p as wt } from "./WorkspaceProvider-CbvaXxgT.js";
18
+ import { a0 as O, as as V, p as wt } from "./WorkspaceProvider-BvLlkZR_.js";
19
19
  import { uploadFile as kt } from "@hachej/boring-agent/front";
20
20
  import bt from "@tiptap/extension-code-block-lowlight";
21
21
  import { createLowlight as vt, common as It } from "lowlight";
@@ -1,9 +1,9 @@
1
1
  import { jsxs as h, jsx as a, Fragment as ce } from "react/jsx-runtime";
2
- import { useState as V, useCallback as v, useMemo as Y, useEffect as k, useRef as Z, useSyncExternalStore as we, Suspense as ve } from "react";
2
+ import { useState as V, useCallback as v, useMemo as Z, useEffect as k, useRef as J, useSyncExternalStore as we, Suspense as ve } from "react";
3
3
  import { IconButton as F, LoadingState as xe, ResizeHandle as pe, Button as ke, Kbd as Ce } from "@hachej/boring-ui-kit";
4
4
  import { ChevronLeft as ye, MessageSquare as Se, Search as Pe, Plus as _e } from "lucide-react";
5
5
  import { c as m } from "./utils-B6yFEsav.js";
6
- import { al as Ne, a2 as We, ad as Ie, G as Oe, as as de, aE as Be, a7 as ze, aJ as Re, aK as Q, u as Le, ao as Ae } from "./WorkspaceProvider-CbvaXxgT.js";
6
+ import { an as Ne, a4 as We, af as Ie, I as Oe, au as de, aG as Be, a9 as ze, aL as Le, aM as Q, u as Re, aq as Ae } from "./WorkspaceProvider-BvLlkZR_.js";
7
7
  function Ue(e, t, r = !0) {
8
8
  if (!r || typeof window > "u") return t;
9
9
  try {
@@ -94,21 +94,21 @@ function Ge(e) {
94
94
  ), [c, g] = Me(
95
95
  e.storageKey ? `${e.storageKey}:chatCollapsed` : void 0,
96
96
  !1
97
- ), [be, W] = V(!1), { blockers: j } = Ne(), b = We(), $ = M(p, 200, 360), te = Math.max(480, Math.floor(s * 0.72)), q = M(me, 480, te), U = S(e.centerParams, "getSurface"), X = S(e.centerParams, "isWorkbenchOpen"), T = S(e.centerParams, "openWorkbench"), ne = S(e.centerParams, "openWorkbenchSources"), ae = S(e.centerParams, "closeWorkbench"), w = E(e.navParams, "onClose"), f = E(e.surfaceParams, "onClose"), C = E(e.sidebarParams, "onClose"), G = E(e.navParams, "onCreate"), P = ((ie = e.chatPanes) == null ? void 0 : ie.filter((o) => o.id.length > 0)) ?? [], J = P.length > 0, y = !!e.sidebar, I = t ? !!w : !!e.onOpenNav, O = n ? !!f : !!e.onOpenSurface, B = y ? !!C : !!e.onOpenSidebar, z = v(() => {
97
+ ), [be, W] = V(!1), { blockers: j } = Ne(), b = We(), q = M(p, 200, 360), te = Math.max(480, Math.floor(s * 0.72)), $ = M(me, 480, te), U = S(e.centerParams, "getSurface"), X = S(e.centerParams, "isWorkbenchOpen"), T = S(e.centerParams, "openWorkbench"), ne = S(e.centerParams, "openWorkbenchSources"), ae = S(e.centerParams, "closeWorkbench"), w = E(e.navParams, "onClose"), f = E(e.surfaceParams, "onClose"), C = E(e.sidebarParams, "onClose"), G = E(e.navParams, "onCreate"), P = ((ie = e.chatPanes) == null ? void 0 : ie.filter((o) => o.id.length > 0)) ?? [], Y = P.length > 0, y = !!e.sidebar, I = t ? !!w : !!e.onOpenNav, O = n ? !!f : !!e.onOpenSurface, B = y ? !!C : !!e.onOpenSidebar, z = v(() => {
98
98
  var o;
99
99
  if (t) {
100
100
  w == null || w();
101
101
  return;
102
102
  }
103
103
  (o = e.onOpenNav) == null || o.call(e);
104
- }, [w, t, e.onOpenNav]), R = v(() => {
104
+ }, [w, t, e.onOpenNav]), L = v(() => {
105
105
  var o;
106
106
  if (n) {
107
107
  f == null || f();
108
108
  return;
109
109
  }
110
110
  (o = e.onOpenSurface) == null || o.call(e);
111
- }, [f, e.onOpenSurface, n]), L = v(() => {
111
+ }, [f, e.onOpenSurface, n]), R = v(() => {
112
112
  var o;
113
113
  if (y) {
114
114
  C == null || C();
@@ -125,10 +125,10 @@ function Ge(e) {
125
125
  }), W(!1);
126
126
  }, [g, n, e.onOpenSurface]);
127
127
  Ie({
128
- shortcuts: Y(() => {
128
+ shortcuts: Z(() => {
129
129
  const o = [];
130
- return I && o.push({ key: "1", mod: !0, handler: z }), O && o.push({ key: "2", mod: !0, handler: R }), B && o.push({ key: "3", mod: !0, allowInEditable: !0, handler: L }), i === "chat" && (o.push({ key: "Escape", allowInEditable: !0, handler: A }), o.push({ key: "\\", mod: !0, allowInEditable: !0, handler: D })), o;
131
- }, [I, B, O, i, A, D, z, L, R])
130
+ return I && o.push({ key: "1", mod: !0, handler: z }), O && o.push({ key: "2", mod: !0, handler: L }), B && o.push({ key: "3", mod: !0, allowInEditable: !0, handler: R }), i === "chat" && (o.push({ key: "Escape", allowInEditable: !0, handler: A }), o.push({ key: "\\", mod: !0, allowInEditable: !0, handler: D })), o;
131
+ }, [I, B, O, i, A, D, z, R, L])
132
132
  }), k(() => {
133
133
  const o = "workspace:chat-layout", u = "agent:chat-layout";
134
134
  return b.unregisterByPluginId(o), b.unregisterByPluginId(u), b.registerCommand({
@@ -146,7 +146,7 @@ function Ge(e) {
146
146
  shortcut: "⌘2",
147
147
  pluginId: o,
148
148
  when: () => O,
149
- run: R
149
+ run: L
150
150
  }), b.registerCommand({
151
151
  id: "workspace:toggle-workbench-left-panel",
152
152
  title: y ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
@@ -154,7 +154,7 @@ function Ge(e) {
154
154
  shortcut: "⌘3",
155
155
  pluginId: o,
156
156
  when: () => B,
157
- run: L
157
+ run: R
158
158
  }), i === "chat" && b.registerCommand({
159
159
  id: "agent:focus-chat",
160
160
  title: "Focus Chat",
@@ -191,8 +191,8 @@ function Ge(e) {
191
191
  A,
192
192
  y,
193
193
  z,
194
- R,
195
- L
194
+ L,
195
+ R
196
196
  ]), k(() => {
197
197
  if (!U || !X || !T) return;
198
198
  const o = {
@@ -214,12 +214,12 @@ function Ge(e) {
214
214
  }
215
215
  j.length > 0 && (g(!1), W(!1), fe());
216
216
  }, [j.length, c, g]);
217
- const _ = e.activeChatPaneId ?? ((se = e.centerParams) == null ? void 0 : se.sessionId), re = Z(_);
217
+ const _ = e.activeChatPaneId ?? ((se = e.centerParams) == null ? void 0 : se.sessionId), re = J(_);
218
218
  k(() => {
219
219
  const o = re.current;
220
220
  re.current = _, o !== void 0 && _ !== void 0 && _ !== o && c && g(!1);
221
221
  }, [_, c, g]);
222
- const oe = Z(n);
222
+ const oe = J(n);
223
223
  return k(() => {
224
224
  const o = oe.current;
225
225
  oe.current = n, o && !n && c && g(!1);
@@ -243,9 +243,9 @@ function Ge(e) {
243
243
  t && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
244
244
  ),
245
245
  style: {
246
- width: t ? $ : 0,
247
- minWidth: t ? $ : 0,
248
- maxWidth: t ? $ : 0,
246
+ width: t ? q : 0,
247
+ minWidth: t ? q : 0,
248
+ maxWidth: t ? q : 0,
249
249
  willChange: "width"
250
250
  },
251
251
  children: [
@@ -295,8 +295,8 @@ function Ge(e) {
295
295
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
296
296
  c ? "opacity-0" : "opacity-100"
297
297
  ),
298
- children: J ? /* @__PURE__ */ a(
299
- Re,
298
+ children: Y ? /* @__PURE__ */ a(
299
+ Le,
300
300
  {
301
301
  panes: P,
302
302
  activePaneId: e.activeChatPaneId,
@@ -325,7 +325,7 @@ function Ge(e) {
325
325
  onClick: D,
326
326
  className: m(
327
327
  "absolute right-2 z-30 rounded-full bg-background/80 text-muted-foreground shadow-sm backdrop-blur hover:bg-muted hover:text-foreground",
328
- J && P.length > 1 ? "bottom-2" : "top-2"
328
+ Y && P.length > 1 ? "bottom-2" : "top-2"
329
329
  ),
330
330
  "aria-label": "Collapse chat",
331
331
  children: /* @__PURE__ */ a(ye, { className: "h-4 w-4", strokeWidth: 1.75 })
@@ -350,9 +350,9 @@ function Ge(e) {
350
350
  n && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
351
351
  ),
352
352
  style: c && n ? { willChange: "width" } : {
353
- width: n ? q : 0,
354
- minWidth: n ? q : 0,
355
- maxWidth: n ? q : 0,
353
+ width: n ? $ : 0,
354
+ minWidth: n ? $ : 0,
355
+ maxWidth: n ? $ : 0,
356
356
  willChange: "width"
357
357
  },
358
358
  children: [
@@ -407,7 +407,7 @@ function Ge(e) {
407
407
  hint: "⌘1"
408
408
  }
409
409
  ) : null,
410
- !c && !t && J && e.onCreateChatPaneAfter ? /* @__PURE__ */ a(
410
+ !c && !t && Y && e.onCreateChatPaneAfter ? /* @__PURE__ */ a(
411
411
  H,
412
412
  {
413
413
  side: "left",
@@ -498,7 +498,7 @@ function Ee() {
498
498
  }, []), e;
499
499
  }
500
500
  function he({ side: e, ariaLabel: t, onResize: r }) {
501
- const n = Z(null), d = v((s) => {
501
+ const n = J(null), d = v((s) => {
502
502
  s.preventDefault(), n.current = s.clientX, s.currentTarget.setPointerCapture(s.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
503
503
  }, []), i = v((s) => {
504
504
  if (n.current === null) return;
@@ -547,11 +547,11 @@ function fe() {
547
547
  });
548
548
  }
549
549
  function K({ id: e, params: t }) {
550
- const r = Le(), { debug: n } = Ae(), d = we(
550
+ const r = Re(), { debug: n } = Ae(), d = we(
551
551
  r.subscribe,
552
552
  r.getSnapshot,
553
553
  r.getSnapshot
554
- ), l = Y(() => r.getComponents(), [r, d])[e], s = Y(() => Ke(e), [e]);
554
+ ), l = Z(() => r.getComponents(), [r, d])[e], s = Z(() => Ke(e), [e]);
555
555
  return l ? /* @__PURE__ */ a(ve, { fallback: /* @__PURE__ */ a(xe, { centered: !0 }), children: /* @__PURE__ */ a(
556
556
  l,
557
557
  {
@@ -635,7 +635,7 @@ function H({
635
635
  }
636
636
  ) });
637
637
  }
638
- function Je({
638
+ function Ye({
639
639
  appTitle: e = "Boring",
640
640
  sessionTitle: t,
641
641
  onCommandPalette: r,
@@ -707,7 +707,7 @@ function Je({
707
707
  }
708
708
  );
709
709
  }
710
- function Ye({
710
+ function Ze({
711
711
  title: e = "Loading workspace",
712
712
  description: t = "Preparing the workspace context.",
713
713
  status: r = "Loading",
@@ -744,8 +744,8 @@ function Ye({
744
744
  }
745
745
  export {
746
746
  Ge as C,
747
- Je as T,
748
- Ye as W,
747
+ Ye as T,
748
+ Ze as W,
749
749
  Te as b,
750
750
  Ue as r,
751
751
  Xe as w