@hachej/boring-workspace 0.1.62 → 0.1.64

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,9 +1,9 @@
1
1
  import { jsx as a, jsxs as h, Fragment as Pe } from "react/jsx-runtime";
2
2
  import { useState as j, useMemo as R, useCallback as k, useRef as H, useEffect as y, useSyncExternalStore as _e, Suspense as Ne } from "react";
3
- import { IconButton as te, LoadingState as We, ResizeHandle as Oe, Button as Ie, Kbd as ze } from "@hachej/boring-ui-kit";
4
- import { Minimize2 as Re, Maximize2 as Be, PanelRightClose as Le, PanelRightOpen as Me, MessageSquare as Ae, Search as De, Plus as Ee } from "lucide-react";
3
+ import { IconButton as te, LoadingState as We, ResizeHandle as Oe, Button as ze, Kbd as Ie } from "@hachej/boring-ui-kit";
4
+ import { Minimize2 as Re, Maximize2 as Be, PanelRightClose as Ae, PanelRightOpen as Me, MessageSquare as Le, Search as De, Plus as Ee } from "lucide-react";
5
5
  import { c as b } from "./utils-B6yFEsav.js";
6
- import { b3 as pe, az as Te, aI as Ke, ag as He, ar as je, Z as Fe, aL as ge, a$ as Ve, al as $e, b4 as qe, u as Ue, aC as Xe } from "./WorkspaceProvider-kf-pjz6V.js";
6
+ import { b4 as pe, az as Te, aJ as Ke, ag as He, ar as je, Z as Fe, aM as ge, b0 as Ve, al as $e, b5 as qe, u as Ue, aC as Xe } from "./WorkspaceProvider-CEZUOy1M.js";
7
7
  function lt(e, t, r = !0) {
8
8
  if (!r || typeof window > "u") return t;
9
9
  try {
@@ -39,7 +39,7 @@ function Ze(e, t, r = !0) {
39
39
  } catch {
40
40
  }
41
41
  }
42
- const Ye = "pointer-events-auto relative border border-border/70 bg-muted text-muted-foreground transition-colors hover:bg-foreground/[0.06] hover:text-foreground", Ge = "border-border bg-foreground/[0.09] text-foreground";
42
+ const Je = "pointer-events-auto relative border border-border/70 bg-muted text-muted-foreground transition-colors hover:bg-foreground/[0.06] hover:text-foreground", Ye = "border-border bg-foreground/[0.09] text-foreground";
43
43
  function be({
44
44
  label: e,
45
45
  hint: t,
@@ -60,8 +60,8 @@ function be({
60
60
  "aria-pressed": l,
61
61
  title: e,
62
62
  className: b(
63
- Ye,
64
- l && Ge
63
+ Je,
64
+ l && Ye
65
65
  ),
66
66
  children: [
67
67
  d,
@@ -122,16 +122,16 @@ function ut(e = {}) {
122
122
  }
123
123
  function ht(e) {
124
124
  var ue, he;
125
- const t = e.nav !== null, r = e.surface !== void 0, n = !!e.surface, l = e.nav || "session-list", s = e.center ?? "chat", d = e.surface || "artifact-surface", i = Qe(), [f, w] = J(
125
+ const t = e.nav !== null, r = e.surface !== void 0, n = !!e.surface, l = e.nav || "session-list", s = e.center ?? "chat", d = e.surface || "artifact-surface", i = Qe(), [f, w] = G(
126
126
  e.storageKey ? `${e.storageKey}:drawerWidth` : void 0,
127
127
  260
128
- ), [ne, xe] = J(
128
+ ), [ne, xe] = G(
129
129
  e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
130
130
  680
131
- ), [ye, ke] = J(
131
+ ), [ye, ke] = G(
132
132
  e.storageKey ? `${e.storageKey}:sidebarWidth` : void 0,
133
133
  280
134
- ), [c, m] = Je(
134
+ ), [c, m] = Ge(
135
135
  e.storageKey ? `${e.storageKey}:chatCollapsed` : void 0,
136
136
  !1
137
137
  ), [Ce, B] = j(!1), { blockers: W } = Te(), C = e.activeChatPaneId ?? ((ue = e.centerParams) == null ? void 0 : ue.sessionId), ae = R(
@@ -140,14 +140,14 @@ function ht(e) {
140
140
  ), Se = R(
141
141
  () => W.some((o) => !!o.sessionId && !!Ke(o)),
142
142
  [W]
143
- ), v = He(), F = _(f, 200, 360), V = _(ye, 200, Math.max(240, Math.floor(i * 0.5))), re = Math.max(480, Math.floor(i * 0.72)), $ = _(ne, 480, re), q = N(e.centerParams, "getSurface"), U = N(e.centerParams, "isWorkbenchOpen"), X = N(e.centerParams, "openWorkbench"), oe = N(e.centerParams, "openWorkbenchSources"), ie = N(e.centerParams, "closeWorkbench"), se = et(e.centerParams, "surfaceDispatch"), p = K(e.navParams, "onClose"), x = K(e.surfaceParams, "onClose"), P = K(e.sidebarParams, "onClose"), Z = K(e.navParams, "onCreate"), L = ((he = e.chatPanes) == null ? void 0 : he.filter((o) => o.id.length > 0)) ?? [], ce = L.length > 0, g = !!e.sidebar, M = t ? !!p : !!e.onOpenNav, O = n ? !!x : !!e.onOpenSurface, A = g ? !!P : !!e.onOpenSidebar, D = k(() => {
143
+ ), v = He(), F = _(f, 200, 360), V = _(ye, 200, Math.max(240, Math.floor(i * 0.5))), re = Math.max(480, Math.floor(i * 0.72)), $ = _(ne, 480, re), q = N(e.centerParams, "getSurface"), U = N(e.centerParams, "isWorkbenchOpen"), X = N(e.centerParams, "openWorkbench"), oe = N(e.centerParams, "openWorkbenchSources"), ie = N(e.centerParams, "closeWorkbench"), se = et(e.centerParams, "surfaceDispatch"), p = K(e.navParams, "onClose"), x = K(e.surfaceParams, "onClose"), P = K(e.sidebarParams, "onClose"), Z = K(e.navParams, "onCreate"), A = ((he = e.chatPanes) == null ? void 0 : he.filter((o) => o.id.length > 0)) ?? [], ce = A.length > 0, g = !!e.sidebar, M = t ? !!p : !!e.onOpenNav, O = n ? !!x : !!e.onOpenSurface, L = g ? !!P : !!e.onOpenSidebar, D = k(() => {
144
144
  var o;
145
145
  if (t) {
146
146
  p == null || p();
147
147
  return;
148
148
  }
149
149
  (o = e.onOpenNav) == null || o.call(e);
150
- }, [p, t, e.onOpenNav]), I = k(() => {
150
+ }, [p, t, e.onOpenNav]), z = k(() => {
151
151
  var o;
152
152
  if (n) {
153
153
  x == null || x();
@@ -163,8 +163,8 @@ function ht(e) {
163
163
  (o = e.onOpenSidebar) == null || o.call(e);
164
164
  }, [P, e.onOpenSidebar, g]), T = k(() => {
165
165
  c && m(!1), t && (p == null || p()), n && (x == null || x()), ee(), we();
166
- }, [c, p, x, t, m, n]), Y = H(!1), G = k(() => {
167
- !c && e.chatOverlay && (Y.current = !0), m((u) => {
166
+ }, [c, p, x, t, m, n]), J = H(!1), Y = k(() => {
167
+ !c && e.chatOverlay && (J.current = !0), m((u) => {
168
168
  var fe;
169
169
  const S = !u;
170
170
  return S && !n && ((fe = e.onOpenSurface) == null || fe.call(e)), S;
@@ -173,8 +173,8 @@ function ht(e) {
173
173
  je({
174
174
  shortcuts: R(() => {
175
175
  const o = [];
176
- return M && o.push({ key: "1", mod: !0, handler: D }), O && o.push({ key: "2", mod: !0, handler: I }), A && o.push({ key: "3", mod: !0, allowInEditable: !0, handler: E }), s === "chat" && (o.push({ key: "Escape", allowInEditable: !0, handler: T }), o.push({ key: "\\", mod: !0, allowInEditable: !0, handler: G })), o;
177
- }, [M, A, O, s, T, G, D, E, I])
176
+ return M && o.push({ key: "1", mod: !0, handler: D }), O && o.push({ key: "2", mod: !0, handler: z }), L && o.push({ key: "3", mod: !0, allowInEditable: !0, handler: E }), s === "chat" && (o.push({ key: "Escape", allowInEditable: !0, handler: T }), o.push({ key: "\\", mod: !0, allowInEditable: !0, handler: Y })), o;
177
+ }, [M, L, O, s, T, Y, D, E, z])
178
178
  }), y(() => {
179
179
  const o = "workspace:chat-layout", u = "agent:chat-layout";
180
180
  return v.unregisterByPluginId(o), v.unregisterByPluginId(u), v.registerCommand({
@@ -192,14 +192,14 @@ function ht(e) {
192
192
  shortcut: "⌘2",
193
193
  pluginId: o,
194
194
  when: () => O,
195
- run: I
195
+ run: z
196
196
  }), v.registerCommand({
197
197
  id: "workspace:toggle-workbench-left-panel",
198
198
  title: g ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
199
199
  keywords: ["left", "sidebar", "tabs", "workbench", g ? "close" : "open"],
200
200
  shortcut: "⌘3",
201
201
  pluginId: o,
202
- when: () => A,
202
+ when: () => L,
203
203
  run: E
204
204
  }), s === "chat" && v.registerCommand({
205
205
  id: "agent:focus-chat",
@@ -229,7 +229,7 @@ function ht(e) {
229
229
  e.onOpenSidebar,
230
230
  M,
231
231
  O,
232
- A,
232
+ L,
233
233
  p,
234
234
  x,
235
235
  P,
@@ -237,7 +237,7 @@ function ht(e) {
237
237
  T,
238
238
  g,
239
239
  D,
240
- I,
240
+ z,
241
241
  E
242
242
  ]), y(() => {
243
243
  const o = se ?? (q && U && X ? {
@@ -276,8 +276,8 @@ function ht(e) {
276
276
  !n || c || e.chatOverlay || i < 1180 && m(!0);
277
277
  }, [c, e.chatOverlay, m, n, i]), y(() => {
278
278
  if (!(!e.chatOverlay || !c)) {
279
- if (Y.current) {
280
- Y.current = !1;
279
+ if (J.current) {
280
+ J.current = !1;
281
281
  return;
282
282
  }
283
283
  m(!1);
@@ -321,7 +321,7 @@ function ht(e) {
321
321
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
322
322
  t ? "opacity-100" : "invisible pointer-events-none opacity-0"
323
323
  ),
324
- children: /* @__PURE__ */ a(z, { id: l, params: e.navParams })
324
+ children: /* @__PURE__ */ a(I, { id: l, params: e.navParams })
325
325
  }
326
326
  ),
327
327
  t ? /* @__PURE__ */ a(
@@ -362,7 +362,7 @@ function ht(e) {
362
362
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
363
363
  g ? "opacity-100" : "opacity-0"
364
364
  ),
365
- children: g ? /* @__PURE__ */ a(z, { id: e.sidebar ?? "workbench-left", params: e.sidebarParams }) : null
365
+ children: g ? /* @__PURE__ */ a(I, { id: e.sidebar ?? "workbench-left", params: e.sidebarParams }) : null
366
366
  }
367
367
  ),
368
368
  g ? /* @__PURE__ */ a(
@@ -403,7 +403,8 @@ function ht(e) {
403
403
  children: ce ? /* @__PURE__ */ a(
404
404
  qe,
405
405
  {
406
- panes: L,
406
+ panes: A,
407
+ topActions: e.chatTopActions,
407
408
  activePaneId: e.activeChatPaneId,
408
409
  onActivePaneChange: e.onActiveChatPaneChange,
409
410
  onClosePane: e.onCloseChatPane,
@@ -411,14 +412,14 @@ function ht(e) {
411
412
  storageKey: e.storageKey,
412
413
  onDropSession: e.onDropChatSession,
413
414
  renderPane: (o) => /* @__PURE__ */ a(
414
- z,
415
+ I,
415
416
  {
416
417
  id: o.panel ?? s,
417
418
  params: o.params ?? e.centerParams
418
419
  }
419
420
  )
420
421
  }
421
- ) : /* @__PURE__ */ a(z, { id: s, params: e.centerParams })
422
+ ) : /* @__PURE__ */ a(I, { id: s, params: e.centerParams })
422
423
  }
423
424
  ),
424
425
  e.chatOverlay ? /* @__PURE__ */ a(
@@ -463,7 +464,7 @@ function ht(e) {
463
464
  "transition-[opacity,padding] duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
464
465
  n ? "opacity-100" : "opacity-0"
465
466
  ),
466
- children: e.surfaceOverlay ? /* @__PURE__ */ a("div", { className: "relative h-full min-h-0", children: e.surfaceOverlay }) : /* @__PURE__ */ a(z, { id: d, params: e.surfaceParams })
467
+ children: e.surfaceOverlay ? /* @__PURE__ */ a("div", { className: "relative h-full min-h-0", children: e.surfaceOverlay }) : /* @__PURE__ */ a(I, { id: d, params: e.surfaceParams })
467
468
  }
468
469
  ),
469
470
  n && !c ? /* @__PURE__ */ a(
@@ -483,10 +484,10 @@ function ht(e) {
483
484
  {
484
485
  surfaceOpen: n,
485
486
  canToggleSurface: O,
486
- onToggleSurface: I,
487
+ onToggleSurface: z,
487
488
  chatCollapsed: c,
488
489
  canToggleChat: s === "chat" && (!r || n && !c),
489
- onToggleChat: G,
490
+ onToggleChat: Y,
490
491
  chatPulse: Ce || W.length > 0,
491
492
  surfaceConfigured: r
492
493
  }
@@ -509,7 +510,7 @@ function ht(e) {
509
510
  icon: "plus",
510
511
  onClick: () => {
511
512
  var u, S;
512
- const o = e.activeChatPaneId ?? ((u = L[L.length - 1]) == null ? void 0 : u.id);
513
+ const o = e.activeChatPaneId ?? ((u = A[A.length - 1]) == null ? void 0 : u.id);
513
514
  o && ((S = e.onCreateChatPaneAfter) == null || S.call(e, o));
514
515
  },
515
516
  label: "New chat",
@@ -523,7 +524,7 @@ function ht(e) {
523
524
  function _(e, t, r) {
524
525
  return Math.max(t, Math.min(r, e));
525
526
  }
526
- function J(e, t) {
527
+ function G(e, t) {
527
528
  const [r, n] = j(
528
529
  () => e ? me(e, t) : t
529
530
  );
@@ -541,7 +542,7 @@ function J(e, t) {
541
542
  );
542
543
  return [r, l];
543
544
  }
544
- function Je(e, t) {
545
+ function Ge(e, t) {
545
546
  const [r, n] = j(() => !e || typeof window > "u" ? t : window.localStorage.getItem(e) === "1");
546
547
  y(() => {
547
548
  if (!e || typeof window > "u") {
@@ -624,7 +625,7 @@ function we() {
624
625
  ee(), window.setTimeout(ee, 320);
625
626
  });
626
627
  }
627
- function z({ id: e, params: t }) {
628
+ function I({ id: e, params: t }) {
628
629
  const r = Ue(), { debug: n } = Xe(), l = _e(
629
630
  r.subscribe,
630
631
  r.getSnapshot,
@@ -705,7 +706,7 @@ function nt({
705
706
  hint: "⌘2",
706
707
  onClick: r,
707
708
  pressed: e,
708
- children: e ? /* @__PURE__ */ a(Le, { className: "size-3", strokeWidth: 1.75 }) : /* @__PURE__ */ a(Me, { className: "size-3", strokeWidth: 1.75 })
709
+ children: e ? /* @__PURE__ */ a(Ae, { className: "size-3", strokeWidth: 1.75 }) : /* @__PURE__ */ a(Me, { className: "size-3", strokeWidth: 1.75 })
709
710
  }
710
711
  ) : null
711
712
  ] });
@@ -745,7 +746,7 @@ function ve({
745
746
  ] }),
746
747
  i ? /* @__PURE__ */ a("span", { className: "absolute -right-1.5 -top-1.5 h-2 w-2 rounded-full bg-[color:var(--accent)]", "aria-hidden": "true", "data-boring-workspace-part": "edge-attention-dot" }) : null
747
748
  ] }) : t === "chat" ? /* @__PURE__ */ h("span", { className: "relative flex items-center justify-center", children: [
748
- /* @__PURE__ */ a(Ae, { className: "h-[15px] w-[15px]", strokeWidth: 1.8, "aria-hidden": "true" }),
749
+ /* @__PURE__ */ a(Le, { className: "h-[15px] w-[15px]", strokeWidth: 1.8, "aria-hidden": "true" }),
749
750
  i ? /* @__PURE__ */ a("span", { className: "absolute -right-1.5 -top-1.5 h-2 w-2 rounded-full bg-[color:var(--accent)]", "aria-hidden": "true" }) : null
750
751
  ] }) : t === "plus" ? /* @__PURE__ */ a("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) }) : /* @__PURE__ */ a("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "M3 7.5 A1.5 1.5 0 0 1 4.5 6 h4 l2 2 h9 A1.5 1.5 0 0 1 21 9.5 V17.5 A1.5 1.5 0 0 1 19.5 19 H4.5 A1.5 1.5 0 0 1 3 17.5 Z", stroke: "currentColor", strokeWidth: "1.8", strokeLinejoin: "round" }) })
751
752
  }
@@ -784,7 +785,7 @@ function ft({
784
785
  /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: f })
785
786
  ] }) }),
786
787
  /* @__PURE__ */ h(
787
- Ie,
788
+ ze,
788
789
  {
789
790
  type: "button",
790
791
  variant: "ghost",
@@ -796,7 +797,7 @@ function ft({
796
797
  children: [
797
798
  /* @__PURE__ */ a(De, { className: "h-3.5 w-3.5 shrink-0 opacity-80", strokeWidth: 1.75 }),
798
799
  /* @__PURE__ */ a("span", { className: "font-normal tracking-tight", children: "Search" }),
799
- /* @__PURE__ */ a(ze, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
800
+ /* @__PURE__ */ a(Ie, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
800
801
  ]
801
802
  }
802
803
  ),