@hachej/boring-workspace 0.1.58 → 0.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { jsxs as h, jsx as a, Fragment as le } from "react/jsx-runtime";
2
- import { useState as X, useMemo as W, useCallback as v, useEffect as y, useRef as J, useSyncExternalStore as xe, Suspense as ke } from "react";
3
- import { IconButton as V, LoadingState as Ce, ResizeHandle as ye, Button as Se, Kbd as Pe } from "@hachej/boring-ui-kit";
4
- import { ChevronLeft as Ne, MessageSquare as _e, Search as We, Plus as Ie } from "lucide-react";
5
- import { c as m } from "./utils-B6yFEsav.js";
6
- import { av as Oe, aC as Be, ac as ze, an as Re, Q as Ae, aF as ue, aR as De, ah as Le, aW as Me, aX as ee, u as Ee, ay as Ke } from "./WorkspaceProvider-Bp1Sm40K.js";
7
- function Ze(e, t, o = !0) {
8
- if (!o || typeof window > "u") return t;
1
+ import { jsx as a, jsxs as h, Fragment as Pe } from "react/jsx-runtime";
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";
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-Dxvh_Faj.js";
7
+ function lt(e, t, r = !0) {
8
+ if (!r || typeof window > "u") return t;
9
9
  try {
10
10
  const n = window.localStorage.getItem(e);
11
11
  if (n === "1") return !0;
@@ -14,235 +14,285 @@ function Ze(e, t, o = !0) {
14
14
  }
15
15
  return t;
16
16
  }
17
- function Ge(e, t, o = !0) {
18
- if (!(!o || typeof window > "u"))
17
+ function dt(e, t, r = !0) {
18
+ if (!(!r || typeof window > "u"))
19
19
  try {
20
20
  window.localStorage.setItem(e, t ? "1" : "0");
21
21
  } catch {
22
22
  }
23
23
  }
24
- function he(e, t, o = !0) {
25
- if (!o || typeof window > "u") return t;
24
+ function me(e, t, r = !0) {
25
+ if (!r || typeof window > "u") return t;
26
26
  try {
27
27
  const n = window.localStorage.getItem(e);
28
28
  if (n === null) return t;
29
- const d = Number(n);
30
- return Number.isFinite(d) ? d : t;
29
+ const l = Number(n);
30
+ return Number.isFinite(l) ? l : t;
31
31
  } catch {
32
32
  }
33
33
  return t;
34
34
  }
35
- function Fe(e, t, o = !0) {
36
- if (!(!o || typeof window > "u"))
35
+ function Ze(e, t, r = !0) {
36
+ if (!(!r || typeof window > "u"))
37
37
  try {
38
38
  window.localStorage.setItem(e, String(Math.round(t)));
39
39
  } catch {
40
40
  }
41
41
  }
42
- function Je(e = {}) {
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";
43
+ function be({
44
+ label: e,
45
+ hint: t,
46
+ side: r = "bottom",
47
+ onClick: n,
48
+ pressed: l,
49
+ pulse: s = !1,
50
+ children: d
51
+ }) {
52
+ return /* @__PURE__ */ a(pe, { label: e, hint: t, side: r, children: /* @__PURE__ */ h(
53
+ te,
54
+ {
55
+ type: "button",
56
+ variant: "ghost",
57
+ size: "icon-xs",
58
+ onClick: n,
59
+ "aria-label": e,
60
+ "aria-pressed": l,
61
+ title: e,
62
+ className: b(
63
+ Ye,
64
+ l && Ge
65
+ ),
66
+ children: [
67
+ d,
68
+ s ? /* @__PURE__ */ a(
69
+ "span",
70
+ {
71
+ className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-[color:var(--accent)] ring-1 ring-background",
72
+ "aria-hidden": "true"
73
+ }
74
+ ) : null
75
+ ]
76
+ }
77
+ ) });
78
+ }
79
+ function ut(e = {}) {
43
80
  const {
44
81
  nav: t = "session-list",
45
- navParams: o,
82
+ navParams: r,
46
83
  center: n = "chat",
47
- centerParams: d,
48
- surface: i,
49
- surfaceParams: u,
50
- sidebar: s,
51
- sidebarParams: x
52
- } = e, p = [];
53
- return t && p.push({
84
+ centerParams: l,
85
+ surface: s,
86
+ surfaceParams: d,
87
+ sidebar: i,
88
+ sidebarParams: f
89
+ } = e, w = [];
90
+ return t && w.push({
54
91
  id: "nav",
55
92
  position: "left",
56
93
  panel: t,
57
- params: o,
94
+ params: r,
58
95
  locked: !0,
59
96
  hideHeader: !0,
60
97
  constraints: { minWidth: 60, maxWidth: 60 }
61
- }), p.push({
98
+ }), w.push({
62
99
  id: "center",
63
100
  position: "center",
64
101
  panel: n,
65
- params: d,
102
+ params: l,
66
103
  hideHeader: !0
67
- }), s && p.push({
104
+ }), i && w.push({
68
105
  id: "sidebar",
69
106
  position: "left",
70
- panel: s,
71
- params: x,
107
+ panel: i,
108
+ params: f,
72
109
  hideHeader: !0,
73
110
  collapsible: !0,
74
111
  collapsedWidth: 40,
75
112
  constraints: { minWidth: 200, maxWidthViewportRatio: 0.5 }
76
- }), i && p.push({
113
+ }), s && w.push({
77
114
  id: "surface",
78
115
  position: "right",
79
- panel: i,
80
- params: u,
116
+ panel: s,
117
+ params: d,
81
118
  hideHeader: !0,
82
119
  dynamic: !0,
83
120
  placeholder: "empty"
84
- }), { version: "2.0", groups: p };
121
+ }), { version: "2.0", groups: w };
85
122
  }
86
- function et(e) {
87
- var ce, de;
88
- const t = e.nav !== null, o = e.surface !== void 0, n = !!e.surface, d = e.nav || "session-list", i = e.center ?? "chat", u = e.surface || "artifact-surface", s = He(), [x, p] = fe(
123
+ function ht(e) {
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(
89
126
  e.storageKey ? `${e.storageKey}:drawerWidth` : void 0,
90
127
  260
91
- ), [be, we] = fe(
128
+ ), [ne, xe] = J(
92
129
  e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
93
130
  680
94
- ), [c, g] = je(
131
+ ), [ye, ke] = J(
132
+ e.storageKey ? `${e.storageKey}:sidebarWidth` : void 0,
133
+ 280
134
+ ), [c, m] = Je(
95
135
  e.storageKey ? `${e.storageKey}:chatCollapsed` : void 0,
96
136
  !1
97
- ), [ve, I] = X(!1), { blockers: O } = Oe(), k = e.activeChatPaneId ?? ((ce = e.centerParams) == null ? void 0 : ce.sessionId), $ = W(
98
- () => O.filter((r) => !r.sessionId || !k || r.sessionId === k),
99
- [k, O]
100
- ), pe = W(
101
- () => O.some((r) => !!r.sessionId && !!Be(r)),
102
- [O]
103
- ), b = ze(), q = K(x, 200, 360), ne = Math.max(480, Math.floor(s * 0.72)), U = K(be, 480, ne), T = N(e.centerParams, "getSurface"), Q = N(e.centerParams, "isWorkbenchOpen"), Y = N(e.centerParams, "openWorkbench"), ae = N(e.centerParams, "openWorkbenchSources"), re = N(e.centerParams, "closeWorkbench"), oe = Ve(e.centerParams, "surfaceDispatch"), w = F(e.navParams, "onClose"), f = F(e.surfaceParams, "onClose"), S = F(e.sidebarParams, "onClose"), Z = F(e.navParams, "onCreate"), _ = ((de = e.chatPanes) == null ? void 0 : de.filter((r) => r.id.length > 0)) ?? [], G = _.length > 0, P = !!e.sidebar, B = t ? !!w : !!e.onOpenNav, z = n ? !!f : !!e.onOpenSurface, R = P ? !!S : !!e.onOpenSidebar, A = v(() => {
104
- var r;
137
+ ), [Ce, B] = j(!1), { blockers: W } = Te(), C = e.activeChatPaneId ?? ((ue = e.centerParams) == null ? void 0 : ue.sessionId), ae = R(
138
+ () => W.filter((o) => !o.sessionId || !C || o.sessionId === C),
139
+ [C, W]
140
+ ), Se = R(
141
+ () => W.some((o) => !!o.sessionId && !!Ke(o)),
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(() => {
144
+ var o;
105
145
  if (t) {
106
- w == null || w();
146
+ p == null || p();
107
147
  return;
108
148
  }
109
- (r = e.onOpenNav) == null || r.call(e);
110
- }, [w, t, e.onOpenNav]), D = v(() => {
111
- var r;
149
+ (o = e.onOpenNav) == null || o.call(e);
150
+ }, [p, t, e.onOpenNav]), I = k(() => {
151
+ var o;
112
152
  if (n) {
113
- f == null || f();
153
+ x == null || x();
114
154
  return;
115
155
  }
116
- (r = e.onOpenSurface) == null || r.call(e);
117
- }, [f, e.onOpenSurface, n]), L = v(() => {
118
- var r;
119
- if (P) {
120
- S == null || S();
156
+ (o = e.onOpenSurface) == null || o.call(e);
157
+ }, [x, e.onOpenSurface, n]), E = k(() => {
158
+ var o;
159
+ if (g) {
160
+ P == null || P();
121
161
  return;
122
162
  }
123
- (r = e.onOpenSidebar) == null || r.call(e);
124
- }, [S, e.onOpenSidebar, P]), M = v(() => {
125
- c && g(!1), t && (w == null || w()), n && (f == null || f()), te(), ge();
126
- }, [c, w, f, t, g, n]), E = v(() => {
127
- g((r) => {
128
- var C;
129
- const l = !r;
130
- return l && !n && ((C = e.onOpenSurface) == null || C.call(e)), l;
131
- }), I(!1);
132
- }, [g, n, e.onOpenSurface]);
133
- Re({
134
- shortcuts: W(() => {
135
- const r = [];
136
- return B && r.push({ key: "1", mod: !0, handler: A }), z && r.push({ key: "2", mod: !0, handler: D }), R && r.push({ key: "3", mod: !0, allowInEditable: !0, handler: L }), i === "chat" && (r.push({ key: "Escape", allowInEditable: !0, handler: M }), r.push({ key: "\\", mod: !0, allowInEditable: !0, handler: E })), r;
137
- }, [B, R, z, i, M, E, A, L, D])
163
+ (o = e.onOpenSidebar) == null || o.call(e);
164
+ }, [P, e.onOpenSidebar, g]), T = k(() => {
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) => {
168
+ var fe;
169
+ const S = !u;
170
+ return S && !n && ((fe = e.onOpenSurface) == null || fe.call(e)), S;
171
+ }), B(!1);
172
+ }, [c, e.chatOverlay, e.onOpenSurface, m, n]);
173
+ je({
174
+ shortcuts: R(() => {
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])
138
178
  }), y(() => {
139
- const r = "workspace:chat-layout", l = "agent:chat-layout";
140
- return b.unregisterByPluginId(r), b.unregisterByPluginId(l), b.registerCommand({
179
+ const o = "workspace:chat-layout", u = "agent:chat-layout";
180
+ return v.unregisterByPluginId(o), v.unregisterByPluginId(u), v.registerCommand({
141
181
  id: "workspace:open-session-history",
142
182
  title: t ? "Close Session History" : "Open Session History",
143
183
  keywords: ["sessions", "history", "drawer", t ? "close" : "open"],
144
184
  shortcut: "⌘1",
145
- pluginId: r,
146
- when: () => B,
147
- run: A
148
- }), b.registerCommand({
185
+ pluginId: o,
186
+ when: () => M,
187
+ run: D
188
+ }), v.registerCommand({
149
189
  id: "workspace:open-workbench",
150
190
  title: n ? "Close Workbench" : "Open Workbench",
151
191
  keywords: ["surface", "artifacts", "sources", "workbench", n ? "close" : "open"],
152
192
  shortcut: "⌘2",
153
- pluginId: r,
154
- when: () => z,
155
- run: D
156
- }), b.registerCommand({
193
+ pluginId: o,
194
+ when: () => O,
195
+ run: I
196
+ }), v.registerCommand({
157
197
  id: "workspace:toggle-workbench-left-panel",
158
- title: P ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
159
- keywords: ["left", "sidebar", "tabs", "workbench", P ? "close" : "open"],
198
+ title: g ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
199
+ keywords: ["left", "sidebar", "tabs", "workbench", g ? "close" : "open"],
160
200
  shortcut: "⌘3",
161
- pluginId: r,
162
- when: () => R,
163
- run: L
164
- }), i === "chat" && b.registerCommand({
201
+ pluginId: o,
202
+ when: () => A,
203
+ run: E
204
+ }), s === "chat" && v.registerCommand({
165
205
  id: "agent:focus-chat",
166
206
  title: "Focus Chat",
167
207
  keywords: ["agent", "chat", "prompt", "composer", "input", "focus"],
168
- pluginId: l,
169
- run: M
170
- }), Z && b.registerCommand({
208
+ pluginId: u,
209
+ run: T
210
+ }), Z && v.registerCommand({
171
211
  id: "agent:new-chat",
172
212
  title: "New Chat",
173
213
  keywords: ["agent", "chat", "session", "new"],
174
- pluginId: l,
214
+ pluginId: u,
175
215
  run: Z
176
216
  }), () => {
177
- b.unregisterByPluginId(r), b.unregisterByPluginId(l);
217
+ v.unregisterByPluginId(o), v.unregisterByPluginId(u);
178
218
  };
179
219
  }, [
180
- b,
220
+ v,
181
221
  t,
182
- i,
183
- o,
222
+ s,
223
+ r,
184
224
  n,
185
225
  e.navParams,
186
226
  e.surfaceParams,
187
227
  e.onOpenNav,
188
228
  e.onOpenSurface,
189
229
  e.onOpenSidebar,
190
- B,
191
- z,
192
- R,
193
- w,
194
- f,
195
- S,
196
- Z,
197
230
  M,
198
- P,
231
+ O,
199
232
  A,
233
+ p,
234
+ x,
235
+ P,
236
+ Z,
237
+ T,
238
+ g,
200
239
  D,
201
- L
240
+ I,
241
+ E
202
242
  ]), y(() => {
203
- const r = oe ?? (T && Q && Y ? {
204
- surface: T,
205
- isWorkbenchOpen: Q,
206
- openWorkbench: Y,
207
- openWorkbenchSources: ae,
208
- closeWorkbench: re,
243
+ const o = se ?? (q && U && X ? {
244
+ surface: q,
245
+ isWorkbenchOpen: U,
246
+ openWorkbench: X,
247
+ openWorkbenchSources: oe,
248
+ closeWorkbench: ie,
209
249
  // Fallback dispatch has no host-owned open-session set. Treat
210
250
  // session-gated requests as closed instead of accidentally opening
211
251
  // UI for a background session. Full shells should pass
212
252
  // `surfaceDispatch.shouldOpenSurface` to make this gate precise.
213
- shouldOpenSurface: (l) => {
214
- var C;
215
- return ((C = l.meta) == null ? void 0 : C.openOnlyWhenSessionOpen) !== !0;
253
+ shouldOpenSurface: (u) => {
254
+ var S;
255
+ return ((S = u.meta) == null ? void 0 : S.openOnlyWhenSessionOpen) !== !0;
216
256
  }
217
257
  } : void 0);
218
- if (r)
219
- return Ae.on(ue.uiCommand, ({ command: l }) => {
220
- De(l, r);
258
+ if (o)
259
+ return Fe.on(ge.uiCommand, ({ command: u }) => {
260
+ Ve(u, o);
221
261
  });
222
- }, [oe, T, Q, Y, ae, re]), Le(ue.agentData, () => {
223
- c && I(!0);
262
+ }, [se, q, U, X, oe, ie]), $e(ge.agentData, () => {
263
+ c && B(!0);
224
264
  }), y(() => {
225
265
  if (!c) {
226
- I(!1);
266
+ B(!1);
227
267
  return;
228
268
  }
229
- $.length > 0 && (g(!1), I(!1), ge());
230
- }, [$.length, c, g]);
231
- const ie = J(k);
269
+ ae.length > 0 && (m(!1), B(!1), we());
270
+ }, [ae.length, c, m]);
271
+ const le = H(C);
232
272
  y(() => {
233
- const r = ie.current;
234
- ie.current = k, r !== void 0 && k !== void 0 && k !== r && c && g(!1);
235
- }, [k, c, g]);
236
- const se = J(n);
273
+ const o = le.current;
274
+ le.current = C, o !== void 0 && C !== void 0 && C !== o && c && m(!1);
275
+ }, [C, c, m]), y(() => {
276
+ !n || c || e.chatOverlay || i < 1180 && m(!0);
277
+ }, [c, e.chatOverlay, m, n, i]), y(() => {
278
+ if (!(!e.chatOverlay || !c)) {
279
+ if (Y.current) {
280
+ Y.current = !1;
281
+ return;
282
+ }
283
+ m(!1);
284
+ }
285
+ }, [c, e.chatOverlay, m]);
286
+ const de = H(n);
237
287
  return y(() => {
238
- const r = se.current;
239
- se.current = n, r && !n && c && g(!1);
240
- }, [n, c, g]), /* @__PURE__ */ h(
288
+ const o = de.current;
289
+ de.current = n, o && !n && c && m(!1);
290
+ }, [n, c, m]), /* @__PURE__ */ h(
241
291
  "div",
242
292
  {
243
293
  "data-boring-workspace": "",
244
294
  "data-boring-workspace-part": "shell",
245
- className: m("relative flex h-full min-h-0 w-full overflow-hidden bg-background", e.className),
295
+ className: b("relative flex h-full min-h-0 w-full overflow-hidden bg-background", e.className),
246
296
  children: [
247
297
  /* @__PURE__ */ h(
248
298
  "aside",
@@ -251,35 +301,76 @@ function et(e) {
251
301
  "data-boring-state": t ? "expanded" : "collapsed",
252
302
  "aria-label": "Session browser",
253
303
  "aria-hidden": !t,
254
- className: m(
304
+ className: b(
255
305
  "relative h-full min-h-0 shrink-0 overflow-hidden bg-background",
256
306
  "transition-[width,min-width,max-width] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
257
307
  t && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
258
308
  ),
259
309
  style: {
260
- width: t ? q : 0,
261
- minWidth: t ? q : 0,
262
- maxWidth: t ? q : 0,
310
+ width: t ? F : 0,
311
+ minWidth: t ? F : 0,
312
+ maxWidth: t ? F : 0,
263
313
  willChange: "width"
264
314
  },
265
315
  children: [
266
316
  /* @__PURE__ */ a(
267
317
  "div",
268
318
  {
269
- className: m(
319
+ className: b(
270
320
  "h-full min-h-0 overflow-hidden",
271
321
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
272
322
  t ? "opacity-100" : "opacity-0"
273
323
  ),
274
- children: /* @__PURE__ */ a(j, { id: d, params: e.navParams })
324
+ children: /* @__PURE__ */ a(z, { id: l, params: e.navParams })
275
325
  }
276
326
  ),
277
327
  t ? /* @__PURE__ */ a(
278
- me,
328
+ Q,
279
329
  {
280
330
  side: "drawer-right",
281
331
  ariaLabel: "Resize sessions drawer",
282
- onResize: (r) => p((l) => K(l + r, 200, 360))
332
+ onResize: (o) => w((u) => _(u + o, 200, 360))
333
+ }
334
+ ) : null
335
+ ]
336
+ }
337
+ ),
338
+ /* @__PURE__ */ h(
339
+ "aside",
340
+ {
341
+ "data-boring-workspace-part": "workbench-left-shell",
342
+ "data-boring-state": g ? "expanded" : "collapsed",
343
+ "aria-label": g ? "Workbench left panel" : void 0,
344
+ "aria-hidden": !g,
345
+ className: b(
346
+ "relative h-full min-h-0 shrink-0 overflow-hidden bg-background",
347
+ "transition-[width,min-width,max-width] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
348
+ g && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
349
+ ),
350
+ style: {
351
+ width: g ? V : 0,
352
+ minWidth: g ? V : 0,
353
+ maxWidth: g ? V : 0,
354
+ willChange: "width"
355
+ },
356
+ children: [
357
+ /* @__PURE__ */ a(
358
+ "div",
359
+ {
360
+ className: b(
361
+ "h-full min-h-0 overflow-hidden",
362
+ "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
363
+ g ? "opacity-100" : "opacity-0"
364
+ ),
365
+ children: g ? /* @__PURE__ */ a(z, { id: e.sidebar ?? "workbench-left", params: e.sidebarParams }) : null
366
+ }
367
+ ),
368
+ g ? /* @__PURE__ */ a(
369
+ Q,
370
+ {
371
+ side: "drawer-right",
372
+ ariaLabel: "Resize workbench left panel",
373
+ onResize: (o) => ke((u) => _(u + o, 200, Math.max(240, Math.floor(i * 0.5))))
283
374
  }
284
375
  ) : null
285
376
  ]
@@ -293,7 +384,7 @@ function et(e) {
293
384
  "data-boring-state": c ? "collapsed" : "expanded",
294
385
  "aria-label": c ? "Collapsed chat" : "Chat",
295
386
  "aria-hidden": c,
296
- className: m(
387
+ className: b(
297
388
  "relative h-full min-h-0 min-w-0 overflow-hidden bg-background",
298
389
  // Animate flex-grow (not just width) so the chat slides open/closed
299
390
  // like the fixed-width nav/workbench panes instead of snapping.
@@ -304,58 +395,52 @@ function et(e) {
304
395
  /* @__PURE__ */ a(
305
396
  "div",
306
397
  {
307
- className: m(
398
+ className: b(
308
399
  "h-full min-h-0 overflow-hidden",
309
400
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
310
401
  c ? "opacity-0" : "opacity-100"
311
402
  ),
312
- children: G ? /* @__PURE__ */ a(
313
- Me,
403
+ children: ce ? /* @__PURE__ */ a(
404
+ qe,
314
405
  {
315
- panes: _,
406
+ panes: L,
316
407
  activePaneId: e.activeChatPaneId,
317
408
  onActivePaneChange: e.onActiveChatPaneChange,
318
409
  onClosePane: e.onCloseChatPane,
319
410
  flashPaneId: e.flashChatPaneId,
320
411
  storageKey: e.storageKey,
321
412
  onDropSession: e.onDropChatSession,
322
- renderPane: (r) => /* @__PURE__ */ a(
323
- j,
413
+ renderPane: (o) => /* @__PURE__ */ a(
414
+ z,
324
415
  {
325
- id: r.panel ?? i,
326
- params: r.params ?? e.centerParams
416
+ id: o.panel ?? s,
417
+ params: o.params ?? e.centerParams
327
418
  }
328
419
  )
329
420
  }
330
- ) : /* @__PURE__ */ a(j, { id: i, params: e.centerParams })
421
+ ) : /* @__PURE__ */ a(z, { id: s, params: e.centerParams })
331
422
  }
332
423
  ),
333
- c ? null : /* @__PURE__ */ a(ee, { label: "Collapse chat", hint: "⌘\\", side: "bottom", children: /* @__PURE__ */ a(
334
- V,
424
+ e.chatOverlay ? /* @__PURE__ */ a(
425
+ "div",
335
426
  {
336
- type: "button",
337
- variant: "ghost",
338
- size: "icon-xs",
339
- onClick: E,
340
- className: m(
341
- "absolute right-2 z-30 rounded-full bg-background/80 text-muted-foreground shadow-sm backdrop-blur hover:bg-muted hover:text-foreground",
342
- G && _.length > 1 ? "bottom-2" : "top-2"
343
- ),
344
- "aria-label": "Collapse chat",
345
- children: /* @__PURE__ */ a(Ne, { className: "h-4 w-4", strokeWidth: 1.75 })
427
+ "data-boring-workspace-part": "chat-left-overlay",
428
+ "aria-hidden": c,
429
+ className: "absolute inset-0 z-40 flex bg-background",
430
+ children: /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col border-r border-border bg-background", children: e.chatOverlay })
346
431
  }
347
- ) })
432
+ ) : null
348
433
  ]
349
434
  }
350
435
  ),
351
- o ? /* @__PURE__ */ h(
436
+ r ? /* @__PURE__ */ h(
352
437
  "aside",
353
438
  {
354
439
  "data-boring-workspace-part": "workbench",
355
440
  "data-boring-state": n ? "expanded" : "collapsed",
356
441
  "aria-label": n ? "Surface" : void 0,
357
442
  "aria-hidden": !n,
358
- className: m(
443
+ className: b(
359
444
  "relative h-full min-h-0 overflow-hidden bg-background",
360
445
  // When chat is collapsed the workbench grows to fill the freed
361
446
  // space (full width); otherwise it's a fixed-width side panel.
@@ -364,174 +449,146 @@ function et(e) {
364
449
  n && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
365
450
  ),
366
451
  style: c && n ? { willChange: "width" } : {
367
- width: n ? U : 0,
368
- minWidth: n ? U : 0,
369
- maxWidth: n ? U : 0,
452
+ width: n ? $ : 0,
453
+ minWidth: n ? $ : 0,
454
+ maxWidth: n ? $ : 0,
370
455
  willChange: "width"
371
456
  },
372
457
  children: [
373
458
  /* @__PURE__ */ a(
374
459
  "div",
375
460
  {
376
- className: m(
461
+ className: b(
377
462
  "h-full min-h-0 overflow-hidden",
378
463
  "transition-[opacity,padding] duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
379
- n ? "opacity-100" : "opacity-0",
380
- // When the chat is collapsed the workbench fills the full width
381
- // and the left-edge "expand chat" float button would sit on top
382
- // of the filetree — inset the content to leave a clear gutter.
383
- c && n && !t && "pl-14"
464
+ n ? "opacity-100" : "opacity-0"
384
465
  ),
385
- children: e.surfaceOverlay ? /* @__PURE__ */ h("div", { className: "relative h-full min-h-0", children: [
386
- e.surfaceOverlay,
387
- f ? /* @__PURE__ */ a(ee, { label: "Close workbench", hint: "⌘2", side: "left", children: /* @__PURE__ */ a(
388
- V,
389
- {
390
- type: "button",
391
- variant: "ghost",
392
- size: "icon-sm",
393
- onClick: f,
394
- className: "absolute right-3 top-3 z-20 rounded-full bg-background/80 text-muted-foreground shadow-sm backdrop-blur hover:bg-muted hover:text-foreground",
395
- "aria-label": "Close workbench",
396
- children: /* @__PURE__ */ a("span", { "aria-hidden": "true", children: "›" })
397
- }
398
- ) }) : null
399
- ] }) : /* @__PURE__ */ a(j, { id: u, params: e.surfaceParams })
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 })
400
467
  }
401
468
  ),
402
469
  n && !c ? /* @__PURE__ */ a(
403
- me,
470
+ Q,
404
471
  {
405
472
  side: "surface-left",
406
473
  ariaLabel: "Resize workbench",
407
- onResize: (r) => we((l) => K(l - r, 480, ne))
474
+ onResize: (o) => xe((u) => _(u - o, 480, re))
408
475
  }
409
476
  ) : null
410
477
  ]
411
478
  }
412
479
  ) : null
413
480
  ] }),
481
+ e.chatOverlay ? null : /* @__PURE__ */ a(
482
+ nt,
483
+ {
484
+ surfaceOpen: n,
485
+ canToggleSurface: O,
486
+ onToggleSurface: I,
487
+ chatCollapsed: c,
488
+ canToggleChat: s === "chat" && (!r || n && !c),
489
+ onToggleChat: G,
490
+ chatPulse: Ce || W.length > 0,
491
+ surfaceConfigured: r
492
+ }
493
+ ),
414
494
  !t && e.onOpenNav ? /* @__PURE__ */ a(
415
- H,
495
+ ve,
416
496
  {
417
497
  side: "left",
418
498
  icon: "sessions",
419
499
  onClick: e.onOpenNav,
420
500
  label: "Sessions",
421
501
  hint: "⌘1",
422
- pulse: pe
502
+ pulse: Se
423
503
  }
424
504
  ) : null,
425
- !c && !t && G && e.onCreateChatPaneAfter ? /* @__PURE__ */ a(
426
- H,
505
+ !c && !t && ce && e.onCreateChatPaneAfter ? /* @__PURE__ */ a(
506
+ ve,
427
507
  {
428
508
  side: "left",
429
509
  icon: "plus",
430
510
  onClick: () => {
431
- var l, C;
432
- const r = e.activeChatPaneId ?? ((l = _[_.length - 1]) == null ? void 0 : l.id);
433
- r && ((C = e.onCreateChatPaneAfter) == null || C.call(e, r));
511
+ var u, S;
512
+ const o = e.activeChatPaneId ?? ((u = L[L.length - 1]) == null ? void 0 : u.id);
513
+ o && ((S = e.onCreateChatPaneAfter) == null || S.call(e, o));
434
514
  },
435
515
  label: "New chat",
436
516
  stackIndex: e.onOpenNav ? 1 : 0
437
517
  }
438
- ) : null,
439
- c ? /* @__PURE__ */ a(
440
- H,
441
- {
442
- side: "left",
443
- icon: "chat",
444
- onClick: E,
445
- label: "Expand chat",
446
- hint: "⌘\\\\",
447
- stackIndex: 1,
448
- pulse: ve || $.length > 0
449
- }
450
- ) : null,
451
- !n && e.onOpenSurface ? /* @__PURE__ */ a(
452
- H,
453
- {
454
- side: "right",
455
- icon: "workbench",
456
- onClick: e.onOpenSurface,
457
- label: "Workbench",
458
- hint: "⌘2",
459
- bottomOffset: e.surfaceButtonBottomOffset
460
- }
461
518
  ) : null
462
519
  ]
463
520
  }
464
521
  );
465
522
  }
466
- function K(e, t, o) {
467
- return Math.max(t, Math.min(o, e));
523
+ function _(e, t, r) {
524
+ return Math.max(t, Math.min(r, e));
468
525
  }
469
- function fe(e, t) {
470
- const [o, n] = X(
471
- () => e ? he(e, t) : t
526
+ function J(e, t) {
527
+ const [r, n] = j(
528
+ () => e ? me(e, t) : t
472
529
  );
473
530
  y(() => {
474
- n(e ? he(e, t) : t);
531
+ n(e ? me(e, t) : t);
475
532
  }, [e, t]);
476
- const d = v(
477
- (i) => {
478
- n((u) => {
479
- const s = typeof i == "function" ? i(u) : i;
480
- return e && Fe(e, s), s;
533
+ const l = k(
534
+ (s) => {
535
+ n((d) => {
536
+ const i = typeof s == "function" ? s(d) : s;
537
+ return e && Ze(e, i), i;
481
538
  });
482
539
  },
483
540
  [e]
484
541
  );
485
- return [o, d];
542
+ return [r, l];
486
543
  }
487
- function je(e, t) {
488
- const [o, n] = X(() => !e || typeof window > "u" ? t : window.localStorage.getItem(e) === "1");
544
+ function Je(e, t) {
545
+ const [r, n] = j(() => !e || typeof window > "u" ? t : window.localStorage.getItem(e) === "1");
489
546
  y(() => {
490
547
  if (!e || typeof window > "u") {
491
548
  n(t);
492
549
  return;
493
550
  }
494
- const i = window.localStorage.getItem(e);
495
- n(i == null ? t : i === "1");
551
+ const s = window.localStorage.getItem(e);
552
+ n(s == null ? t : s === "1");
496
553
  }, [e, t]);
497
- const d = v(
498
- (i) => {
499
- n((u) => {
500
- const s = typeof i == "function" ? i(u) : i;
501
- return e && typeof window < "u" && window.localStorage.setItem(e, s ? "1" : "0"), s;
554
+ const l = k(
555
+ (s) => {
556
+ n((d) => {
557
+ const i = typeof s == "function" ? s(d) : s;
558
+ return e && typeof window < "u" && window.localStorage.setItem(e, i ? "1" : "0"), i;
502
559
  });
503
560
  },
504
561
  [e]
505
562
  );
506
- return [o, d];
563
+ return [r, l];
507
564
  }
508
- function He() {
509
- const [e, t] = X(() => typeof window < "u" ? window.innerWidth : 1200);
565
+ function Qe() {
566
+ const [e, t] = j(() => typeof window < "u" ? window.innerWidth : 1200);
510
567
  return y(() => {
511
- const o = () => t(window.innerWidth);
512
- return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
568
+ const r = () => t(window.innerWidth);
569
+ return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
513
570
  }, []), e;
514
571
  }
515
- function me({ side: e, ariaLabel: t, onResize: o }) {
516
- const n = J(null), d = v((s) => {
517
- s.preventDefault(), n.current = s.clientX, s.currentTarget.setPointerCapture(s.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
518
- }, []), i = v((s) => {
572
+ function Q({ side: e, ariaLabel: t, onResize: r }) {
573
+ const n = H(null), l = k((i) => {
574
+ i.preventDefault(), n.current = i.clientX, i.currentTarget.setPointerCapture(i.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
575
+ }, []), s = k((i) => {
519
576
  if (n.current === null) return;
520
- const x = s.clientX - n.current;
521
- n.current = s.clientX, o(x);
522
- }, [o]), u = v((s) => {
523
- n.current !== null && (n.current = null, s.currentTarget.releasePointerCapture(s.pointerId), document.body.style.cursor = "", document.body.style.userSelect = "");
577
+ const f = i.clientX - n.current;
578
+ n.current = i.clientX, r(f);
579
+ }, [r]), d = k((i) => {
580
+ n.current !== null && (n.current = null, i.currentTarget.releasePointerCapture(i.pointerId), document.body.style.cursor = "", document.body.style.userSelect = "");
524
581
  }, []);
525
582
  return /* @__PURE__ */ a(
526
- ye,
583
+ Oe,
527
584
  {
528
585
  "aria-label": t,
529
586
  orientation: "vertical",
530
- onResizeStart: d,
531
- onPointerMove: i,
532
- onPointerUp: u,
533
- onPointerCancel: u,
534
- className: m(
587
+ onResizeStart: l,
588
+ onPointerMove: s,
589
+ onPointerUp: d,
590
+ onPointerCancel: d,
591
+ className: b(
535
592
  "absolute -top-px -bottom-px z-20 w-3 bg-transparent hover:!bg-transparent active:!bg-transparent",
536
593
  "after:absolute after:inset-y-2 after:left-1/2 after:w-px after:-translate-x-1/2 after:rounded-full after:bg-border/55",
537
594
  "after:transition-[width,background-color] after:duration-150 hover:after:w-1 hover:after:bg-foreground/35 active:after:w-1 active:after:bg-foreground/50",
@@ -540,49 +597,49 @@ function me({ side: e, ariaLabel: t, onResize: o }) {
540
597
  }
541
598
  );
542
599
  }
543
- function Ve(e, t) {
544
- const o = e == null ? void 0 : e[t];
545
- if (!o || typeof o != "object") return;
546
- const n = o;
600
+ function et(e, t) {
601
+ const r = e == null ? void 0 : e[t];
602
+ if (!r || typeof r != "object") return;
603
+ const n = r;
547
604
  return typeof n.surface == "function" && typeof n.isWorkbenchOpen == "function" && typeof n.openWorkbench == "function" ? n : void 0;
548
605
  }
549
606
  function N(e, t) {
550
- const o = e == null ? void 0 : e[t];
551
- return typeof o == "function" ? o : void 0;
607
+ const r = e == null ? void 0 : e[t];
608
+ return typeof r == "function" ? r : void 0;
552
609
  }
553
- function F(e, t) {
610
+ function K(e, t) {
554
611
  return N(e, t);
555
612
  }
556
- function te() {
613
+ function ee() {
557
614
  if (typeof document > "u") return;
558
- const o = (document.querySelector(
615
+ const r = (document.querySelector(
559
616
  '[data-boring-workspace-part="chat-pane"][data-boring-state="active"]'
560
617
  ) ?? document).querySelector(
561
618
  '[data-boring-agent] textarea[name="message"], textarea[name="message"]'
562
619
  );
563
- o == null || o.focus();
620
+ r == null || r.focus();
564
621
  }
565
- function ge() {
622
+ function we() {
566
623
  typeof window > "u" || window.requestAnimationFrame(() => {
567
- te(), window.setTimeout(te, 320);
624
+ ee(), window.setTimeout(ee, 320);
568
625
  });
569
626
  }
570
- function j({ id: e, params: t }) {
571
- const o = Ee(), { debug: n } = Ke(), d = xe(
572
- o.subscribe,
573
- o.getSnapshot,
574
- o.getSnapshot
575
- ), u = W(() => o.getComponents(), [o, d])[e], s = W(() => Xe(e), [e]);
576
- return u ? /* @__PURE__ */ a(ke, { fallback: /* @__PURE__ */ a(Ce, { centered: !0 }), children: /* @__PURE__ */ a(
577
- u,
627
+ function z({ id: e, params: t }) {
628
+ const r = Ue(), { debug: n } = Xe(), l = _e(
629
+ r.subscribe,
630
+ r.getSnapshot,
631
+ r.getSnapshot
632
+ ), d = R(() => r.getComponents(), [r, l])[e], i = R(() => tt(e), [e]);
633
+ return d ? /* @__PURE__ */ a(Ne, { fallback: /* @__PURE__ */ a(We, { centered: !0 }), children: /* @__PURE__ */ a(
634
+ d,
578
635
  {
579
636
  params: { ...t, debug: n },
580
- api: s,
637
+ api: i,
581
638
  containerApi: {}
582
639
  }
583
640
  ) }) : null;
584
641
  }
585
- function Xe(e) {
642
+ function tt(e) {
586
643
  return {
587
644
  id: e,
588
645
  title: e,
@@ -618,103 +675,134 @@ function Xe(e) {
618
675
  } })
619
676
  };
620
677
  }
621
- function H({
678
+ function nt({
679
+ surfaceOpen: e,
680
+ canToggleSurface: t,
681
+ onToggleSurface: r,
682
+ chatCollapsed: n,
683
+ canToggleChat: l,
684
+ onToggleChat: s,
685
+ chatPulse: d,
686
+ surfaceConfigured: i
687
+ }) {
688
+ const f = t, w = l;
689
+ return !f && !w ? null : /* @__PURE__ */ h("div", { className: "pointer-events-none absolute right-3 top-2.5 z-[70] flex items-center gap-1", children: [
690
+ w ? /* @__PURE__ */ a(
691
+ be,
692
+ {
693
+ label: n ? "Show chat" : i ? "Expand workbench" : "Collapse chat",
694
+ hint: "⌘\\\\",
695
+ onClick: s,
696
+ pressed: n,
697
+ pulse: d,
698
+ children: n ? /* @__PURE__ */ a(Re, { className: "size-3", strokeWidth: 1.75 }) : /* @__PURE__ */ a(Be, { className: "size-3", strokeWidth: 1.75 })
699
+ }
700
+ ) : null,
701
+ f ? /* @__PURE__ */ a(
702
+ be,
703
+ {
704
+ label: e ? "Close workbench" : "Open workbench",
705
+ hint: "⌘2",
706
+ onClick: r,
707
+ pressed: e,
708
+ children: e ? /* @__PURE__ */ a(Le, { className: "size-3", strokeWidth: 1.75 }) : /* @__PURE__ */ a(Me, { className: "size-3", strokeWidth: 1.75 })
709
+ }
710
+ ) : null
711
+ ] });
712
+ }
713
+ function ve({
622
714
  side: e,
623
715
  icon: t,
624
- onClick: o,
716
+ onClick: r,
625
717
  label: n,
626
- hint: d,
627
- bottomOffset: i,
628
- stackIndex: u = 0,
629
- pulse: s = !1
718
+ hint: l,
719
+ bottomOffset: s,
720
+ stackIndex: d = 0,
721
+ pulse: i = !1
630
722
  }) {
631
- const x = e === "right" && i !== void 0, p = u * 44;
632
- return /* @__PURE__ */ a(ee, { label: n, hint: d, side: e === "left" ? "right" : "left", children: /* @__PURE__ */ a(
633
- V,
723
+ const f = e === "right" && s !== void 0, w = d * 44;
724
+ return /* @__PURE__ */ a(pe, { label: n, hint: l, side: e === "left" ? "right" : "left", children: /* @__PURE__ */ a(
725
+ te,
634
726
  {
635
727
  type: "button",
636
728
  variant: "ghost",
637
729
  size: "icon-sm",
638
- onClick: o,
730
+ onClick: r,
639
731
  "aria-label": n,
640
- className: m(
732
+ className: b(
641
733
  "absolute z-30 h-9 w-9 gap-0.5 rounded-lg bg-background text-muted-foreground",
642
734
  e === "left" ? "left-2" : "right-2",
643
- x ? "hover:-translate-y-0.5" : "top-1/2 hover:-translate-y-[1px]",
735
+ f ? "hover:-translate-y-0.5" : "top-1/2 hover:-translate-y-[1px]",
644
736
  "shadow-[0_1px_2px_-1px_oklch(0_0_0/0.08),0_2px_8px_-4px_oklch(0_0_0/0.10),inset_0_0_0_1px_oklch(from_var(--border)_l_c_h/0.7)]",
645
737
  "hover:bg-muted/60 hover:text-foreground hover:shadow-[0_2px_4px_-1px_oklch(0_0_0/0.08),0_4px_12px_-4px_oklch(0_0_0/0.10),inset_0_0_0_1px_oklch(from_var(--border)_l_c_h/0.9)]",
646
738
  "focus-visible:ring-ring/40"
647
739
  ),
648
- style: x ? { bottom: i } : { transform: `translateY(calc(-50% - ${p}px))` },
740
+ style: f ? { bottom: s } : { transform: `translateY(calc(-50% - ${w}px))` },
649
741
  children: t === "sessions" ? /* @__PURE__ */ h("span", { className: "relative flex items-center justify-center", children: [
650
742
  /* @__PURE__ */ h("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
651
743
  /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "1.8" }),
652
744
  /* @__PURE__ */ a("path", { d: "M12 7v5l3.2 2", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
653
745
  ] }),
654
- s ? /* @__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
746
+ 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
655
747
  ] }) : t === "chat" ? /* @__PURE__ */ h("span", { className: "relative flex items-center justify-center", children: [
656
- /* @__PURE__ */ a(_e, { className: "h-[15px] w-[15px]", strokeWidth: 1.8, "aria-hidden": "true" }),
657
- s ? /* @__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
748
+ /* @__PURE__ */ a(Ae, { className: "h-[15px] w-[15px]", strokeWidth: 1.8, "aria-hidden": "true" }),
749
+ 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
658
750
  ] }) : 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" }) })
659
751
  }
660
752
  ) });
661
753
  }
662
- function tt({
754
+ function ft({
663
755
  appTitle: e = "Boring",
664
756
  sessionTitle: t,
665
- onCommandPalette: o,
757
+ onCommandPalette: r,
666
758
  onNewChat: n,
667
- topBarLeft: d,
668
- topBarRight: i,
669
- className: u
759
+ topBarLeft: l,
760
+ topBarRight: s,
761
+ className: d
670
762
  }) {
671
- const s = i ?? null;
763
+ const i = s ?? null, f = t || e;
672
764
  return /* @__PURE__ */ h(
673
765
  "header",
674
766
  {
675
767
  "data-boring-workspace-part": "topbar",
676
- className: m(
768
+ className: b(
677
769
  "relative flex h-11 items-center justify-between gap-2 px-3",
678
770
  "bg-background border-b border-border",
679
- u
771
+ d
680
772
  ),
681
773
  "aria-label": "App top bar",
682
774
  children: [
683
- /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 leading-none", children: d ?? /* @__PURE__ */ h(le, { children: [
775
+ /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 leading-none", children: l ?? /* @__PURE__ */ h(Pe, { children: [
684
776
  /* @__PURE__ */ a(
685
777
  "span",
686
778
  {
687
779
  "aria-hidden": "true",
688
780
  className: "grid size-[22px] shrink-0 place-items-center rounded-sm bg-foreground text-[11px] font-semibold leading-none tracking-tight text-background",
689
- children: ((e == null ? void 0 : e[0]) ?? "B").toUpperCase()
781
+ children: ((f == null ? void 0 : f[0]) ?? "B").toUpperCase()
690
782
  }
691
783
  ),
692
- t ? /* @__PURE__ */ h(le, { children: [
693
- /* @__PURE__ */ a("span", { className: "shrink-0 text-[13px] font-medium leading-none tracking-tight text-foreground/65", children: e }),
694
- /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "text-[13px] leading-none text-muted-foreground/45", children: "·" }),
695
- /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: t })
696
- ] }) : /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: e })
784
+ /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: f })
697
785
  ] }) }),
698
786
  /* @__PURE__ */ h(
699
- Se,
787
+ Ie,
700
788
  {
701
789
  type: "button",
702
790
  variant: "ghost",
703
791
  size: "sm",
704
- onClick: o,
792
+ onClick: r,
705
793
  className: "group h-7 gap-1.5 px-2 text-[13px] leading-none text-muted-foreground/75 hover:bg-muted/70 hover:text-foreground focus-visible:text-foreground",
706
794
  "aria-label": "Search catalogs and commands",
707
795
  title: "Command palette (⌘K)",
708
796
  children: [
709
- /* @__PURE__ */ a(We, { className: "h-3.5 w-3.5 shrink-0 opacity-80", strokeWidth: 1.75 }),
797
+ /* @__PURE__ */ a(De, { className: "h-3.5 w-3.5 shrink-0 opacity-80", strokeWidth: 1.75 }),
710
798
  /* @__PURE__ */ a("span", { className: "font-normal tracking-tight", children: "Search" }),
711
- /* @__PURE__ */ a(Pe, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
799
+ /* @__PURE__ */ a(ze, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
712
800
  ]
713
801
  }
714
802
  ),
715
803
  /* @__PURE__ */ h("div", { className: "flex flex-1 shrink-0 items-center justify-end gap-1", children: [
716
804
  n && /* @__PURE__ */ a(
717
- V,
805
+ te,
718
806
  {
719
807
  type: "button",
720
808
  variant: "ghost",
@@ -722,21 +810,21 @@ function tt({
722
810
  onClick: n,
723
811
  "aria-label": "New chat",
724
812
  title: "New chat",
725
- children: /* @__PURE__ */ a(Ie, { className: "h-4 w-4" })
813
+ children: /* @__PURE__ */ a(Ee, { className: "h-4 w-4" })
726
814
  }
727
815
  ),
728
- s
816
+ i
729
817
  ] })
730
818
  ]
731
819
  }
732
820
  );
733
821
  }
734
- function nt({
822
+ function gt({
735
823
  title: e = "Loading workspace",
736
824
  description: t = "Preparing the workspace context.",
737
- status: o = "Loading",
825
+ status: r = "Loading",
738
826
  fullscreen: n = !0,
739
- className: d
827
+ className: l
740
828
  }) {
741
829
  return /* @__PURE__ */ a(
742
830
  "section",
@@ -744,10 +832,10 @@ function nt({
744
832
  role: "status",
745
833
  "aria-live": "polite",
746
834
  "aria-busy": "true",
747
- className: m(
835
+ className: b(
748
836
  "flex h-full w-full items-center justify-center bg-background px-6 text-foreground",
749
837
  n ? "min-h-screen" : "min-h-[240px]",
750
- d
838
+ l
751
839
  ),
752
840
  children: /* @__PURE__ */ h("div", { className: "flex w-full max-w-sm flex-col items-center gap-5 text-center", children: [
753
841
  /* @__PURE__ */ a("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg border border-border bg-card text-foreground", children: /* @__PURE__ */ a(
@@ -761,16 +849,18 @@ function nt({
761
849
  /* @__PURE__ */ a("h2", { className: "text-base font-medium text-foreground", children: e }),
762
850
  t ? /* @__PURE__ */ a("p", { className: "text-sm leading-6 text-muted-foreground", children: t }) : null
763
851
  ] }),
764
- o ? /* @__PURE__ */ a("p", { className: "text-xs font-medium text-muted-foreground/80", children: o }) : null
852
+ r ? /* @__PURE__ */ a("p", { className: "text-xs font-medium text-muted-foreground/80", children: r }) : null
765
853
  ] })
766
854
  }
767
855
  );
768
856
  }
769
857
  export {
770
- et as C,
771
- tt as T,
772
- nt as W,
773
- Je as b,
774
- Ze as r,
775
- Ge as w
858
+ ht as C,
859
+ ft as T,
860
+ gt as W,
861
+ me as a,
862
+ ut as b,
863
+ Ze as c,
864
+ lt as r,
865
+ dt as w
776
866
  };