@hachej/boring-workspace 0.1.22 → 0.1.24

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,59 +1,59 @@
1
- import { jsxs as l, jsx as a, Fragment as V } from "react/jsx-runtime";
2
- import { useCallback as b, useMemo as E, useEffect as z, useState as q, useSyncExternalStore as Q, Suspense as Y, useRef as ee } from "react";
3
- import { LoadingState as te, ResizeHandle as ne, IconButton as Z, Button as re, Kbd as ae } from "@hachej/boring-ui-kit";
1
+ import { jsxs as l, jsx as o, Fragment as U } from "react/jsx-runtime";
2
+ import { useCallback as b, useMemo as H, useEffect as z, useState as G, useSyncExternalStore as Y, Suspense as ee, useRef as ne } from "react";
3
+ import { IconButton as K, LoadingState as te, ResizeHandle as re, Button as oe, Kbd as ae } from "@hachej/boring-ui-kit";
4
4
  import { c as g } from "./utils-B6yFEsav.js";
5
- import { $ as oe, a6 as ie, z as se, an as ce, al as de, u as le, ag as ue } from "./WorkspaceProvider-DihXY2wk.js";
6
- import { Search as he, Plus as me } from "lucide-react";
7
- function _e(e, t, r = !0) {
8
- if (!r || typeof window > "u") return t;
5
+ import { a2 as ie, ad as se, E as ce, aw as de, au as le, u as ue, ao as he } from "./WorkspaceProvider-BW4wzbpR.js";
6
+ import { Search as me, Plus as fe } from "lucide-react";
7
+ function _e(e, n, r = !0) {
8
+ if (!r || typeof window > "u") return n;
9
9
  try {
10
- const n = window.localStorage.getItem(e);
11
- if (n === "1") return !0;
12
- if (n === "0") return !1;
10
+ const t = window.localStorage.getItem(e);
11
+ if (t === "1") return !0;
12
+ if (t === "0") return !1;
13
13
  } catch {
14
14
  }
15
- return t;
15
+ return n;
16
16
  }
17
- function Se(e, t, r = !0) {
17
+ function We(e, n, r = !0) {
18
18
  if (!(!r || typeof window > "u"))
19
19
  try {
20
- window.localStorage.setItem(e, t ? "1" : "0");
20
+ window.localStorage.setItem(e, n ? "1" : "0");
21
21
  } catch {
22
22
  }
23
23
  }
24
- function $(e, t, r = !0) {
25
- if (!r || typeof window > "u") return t;
24
+ function X(e, n, r = !0) {
25
+ if (!r || typeof window > "u") return n;
26
26
  try {
27
- const n = window.localStorage.getItem(e);
28
- if (n === null) return t;
29
- const s = Number(n);
30
- return Number.isFinite(s) ? s : t;
27
+ const t = window.localStorage.getItem(e);
28
+ if (t === null) return n;
29
+ const c = Number(t);
30
+ return Number.isFinite(c) ? c : n;
31
31
  } catch {
32
32
  }
33
- return t;
33
+ return n;
34
34
  }
35
- function fe(e, t, r = !0) {
35
+ function ge(e, n, r = !0) {
36
36
  if (!(!r || typeof window > "u"))
37
37
  try {
38
- window.localStorage.setItem(e, String(Math.round(t)));
38
+ window.localStorage.setItem(e, String(Math.round(n)));
39
39
  } catch {
40
40
  }
41
41
  }
42
- function We(e = {}) {
42
+ function Ne(e = {}) {
43
43
  const {
44
- nav: t = "session-list",
44
+ nav: n = "session-list",
45
45
  navParams: r,
46
- center: n = "chat",
47
- centerParams: s,
48
- surface: c,
46
+ center: t = "chat",
47
+ centerParams: c,
48
+ surface: s,
49
49
  surfaceParams: d,
50
50
  sidebar: i,
51
- sidebarParams: x
51
+ sidebarParams: k
52
52
  } = e, w = [];
53
- return t && w.push({
53
+ return n && w.push({
54
54
  id: "nav",
55
55
  position: "left",
56
- panel: t,
56
+ panel: n,
57
57
  params: r,
58
58
  locked: !0,
59
59
  hideHeader: !0,
@@ -61,140 +61,141 @@ function We(e = {}) {
61
61
  }), w.push({
62
62
  id: "center",
63
63
  position: "center",
64
- panel: n,
65
- params: s,
64
+ panel: t,
65
+ params: c,
66
66
  hideHeader: !0
67
67
  }), i && w.push({
68
68
  id: "sidebar",
69
69
  position: "left",
70
70
  panel: i,
71
- params: x,
71
+ params: k,
72
72
  hideHeader: !0,
73
73
  collapsible: !0,
74
74
  collapsedWidth: 40,
75
75
  constraints: { minWidth: 200, maxWidthViewportRatio: 0.5 }
76
- }), c && w.push({
76
+ }), s && w.push({
77
77
  id: "surface",
78
78
  position: "right",
79
- panel: c,
79
+ panel: s,
80
80
  params: d,
81
81
  hideHeader: !0,
82
82
  dynamic: !0,
83
83
  placeholder: "empty"
84
84
  }), { version: "2.0", groups: w };
85
85
  }
86
- function Ne(e) {
87
- const t = e.nav !== null, r = e.surface !== void 0, n = !!e.surface, s = e.nav || "session-list", c = e.center ?? "chat", d = e.surface || "artifact-surface", i = ge(), [x, w] = T(
86
+ function Pe(e) {
87
+ const n = e.nav !== null, r = e.surface !== void 0, t = !!e.surface, c = e.nav || "session-list", s = e.center ?? "chat", d = e.surface || "artifact-surface", i = be(), [k, w] = q(
88
88
  e.storageKey ? `${e.storageKey}:drawerWidth` : void 0,
89
89
  260
90
- ), [G, J] = T(
90
+ ), [J, Q] = q(
91
91
  e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
92
92
  680
93
- ), u = oe(), I = O(x, 200, 360), K = Math.max(480, Math.floor(i * 0.72)), L = O(G, 480, K), R = y(e.centerParams, "getSurface"), D = y(e.centerParams, "isWorkbenchOpen"), A = y(e.centerParams, "openWorkbench"), j = y(e.centerParams, "closeWorkbench"), h = B(e.navParams, "onClose"), m = B(e.surfaceParams, "onClose"), p = B(e.sidebarParams, "onClose"), M = B(e.navParams, "onCreate"), v = !!e.sidebar, k = t ? !!h : !!e.onOpenNav, C = n ? !!m : !!e.onOpenSurface, _ = v ? !!p : !!e.onOpenSidebar, S = b(() => {
94
- var o;
95
- if (t) {
96
- h == null || h();
97
- return;
98
- }
99
- (o = e.onOpenNav) == null || o.call(e);
100
- }, [h, t, e.onOpenNav]), W = b(() => {
101
- var o;
93
+ ), h = ie(), I = O(k, 200, 360), j = Math.max(480, Math.floor(i * 0.72)), L = O(J, 480, j), R = x(e.centerParams, "getSurface"), D = x(e.centerParams, "isWorkbenchOpen"), A = x(e.centerParams, "openWorkbench"), V = x(e.centerParams, "openWorkbenchSources"), $ = x(e.centerParams, "closeWorkbench"), m = B(e.navParams, "onClose"), u = B(e.surfaceParams, "onClose"), p = B(e.sidebarParams, "onClose"), M = B(e.navParams, "onCreate"), v = !!e.sidebar, y = n ? !!m : !!e.onOpenNav, C = t ? !!u : !!e.onOpenSurface, S = v ? !!p : !!e.onOpenSidebar, _ = b(() => {
94
+ var a;
102
95
  if (n) {
103
96
  m == null || m();
104
97
  return;
105
98
  }
106
- (o = e.onOpenSurface) == null || o.call(e);
107
- }, [m, e.onOpenSurface, n]), N = b(() => {
108
- var o;
99
+ (a = e.onOpenNav) == null || a.call(e);
100
+ }, [m, n, e.onOpenNav]), W = b(() => {
101
+ var a;
102
+ if (t) {
103
+ u == null || u();
104
+ return;
105
+ }
106
+ (a = e.onOpenSurface) == null || a.call(e);
107
+ }, [u, e.onOpenSurface, t]), N = b(() => {
108
+ var a;
109
109
  if (v) {
110
110
  p == null || p();
111
111
  return;
112
112
  }
113
- (o = e.onOpenSidebar) == null || o.call(e);
113
+ (a = e.onOpenSidebar) == null || a.call(e);
114
114
  }, [p, e.onOpenSidebar, v]), P = b(() => {
115
- t && (h == null || h()), n && (m == null || m()), F(), be();
116
- }, [h, m, t, n]);
117
- return ie({
118
- shortcuts: E(() => {
119
- const o = [];
120
- return k && o.push({ key: "1", mod: !0, handler: S }), C && o.push({ key: "2", mod: !0, handler: W }), _ && o.push({ key: "3", mod: !0, allowInEditable: !0, handler: N }), c === "chat" && o.push({ key: "Escape", allowInEditable: !0, handler: P }), o;
121
- }, [k, _, C, c, P, S, N, W])
115
+ n && (m == null || m()), t && (u == null || u()), F(), we();
116
+ }, [m, u, n, t]);
117
+ return se({
118
+ shortcuts: H(() => {
119
+ const a = [];
120
+ return y && a.push({ key: "1", mod: !0, handler: _ }), C && a.push({ key: "2", mod: !0, handler: W }), S && a.push({ key: "3", mod: !0, allowInEditable: !0, handler: N }), s === "chat" && a.push({ key: "Escape", allowInEditable: !0, handler: P }), a;
121
+ }, [y, S, C, s, P, _, N, W])
122
122
  }), z(() => {
123
- const o = "workspace:chat-layout", f = "agent:chat-layout";
124
- return u.unregisterByPluginId(o), u.unregisterByPluginId(f), u.registerCommand({
123
+ const a = "workspace:chat-layout", f = "agent:chat-layout";
124
+ return h.unregisterByPluginId(a), h.unregisterByPluginId(f), h.registerCommand({
125
125
  id: "workspace:open-session-history",
126
- title: t ? "Close Session History" : "Open Session History",
127
- keywords: ["sessions", "history", "drawer", t ? "close" : "open"],
126
+ title: n ? "Close Session History" : "Open Session History",
127
+ keywords: ["sessions", "history", "drawer", n ? "close" : "open"],
128
128
  shortcut: "⌘1",
129
- pluginId: o,
130
- when: () => k,
131
- run: S
132
- }), u.registerCommand({
129
+ pluginId: a,
130
+ when: () => y,
131
+ run: _
132
+ }), h.registerCommand({
133
133
  id: "workspace:open-workbench",
134
- title: n ? "Close Workbench" : "Open Workbench",
135
- keywords: ["surface", "artifacts", "sources", "workbench", n ? "close" : "open"],
134
+ title: t ? "Close Workbench" : "Open Workbench",
135
+ keywords: ["surface", "artifacts", "sources", "workbench", t ? "close" : "open"],
136
136
  shortcut: "⌘2",
137
- pluginId: o,
137
+ pluginId: a,
138
138
  when: () => C,
139
139
  run: W
140
- }), u.registerCommand({
140
+ }), h.registerCommand({
141
141
  id: "workspace:toggle-workbench-left-panel",
142
142
  title: v ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
143
143
  keywords: ["left", "sidebar", "tabs", "workbench", v ? "close" : "open"],
144
144
  shortcut: "⌘3",
145
- pluginId: o,
146
- when: () => _,
145
+ pluginId: a,
146
+ when: () => S,
147
147
  run: N
148
- }), c === "chat" && u.registerCommand({
148
+ }), s === "chat" && h.registerCommand({
149
149
  id: "agent:focus-chat",
150
150
  title: "Focus Chat",
151
151
  keywords: ["agent", "chat", "prompt", "composer", "input", "focus"],
152
152
  pluginId: f,
153
153
  run: P
154
- }), M && u.registerCommand({
154
+ }), M && h.registerCommand({
155
155
  id: "agent:new-chat",
156
156
  title: "New Chat",
157
157
  keywords: ["agent", "chat", "session", "new"],
158
158
  pluginId: f,
159
159
  run: M
160
160
  }), () => {
161
- u.unregisterByPluginId(o), u.unregisterByPluginId(f);
161
+ h.unregisterByPluginId(a), h.unregisterByPluginId(f);
162
162
  };
163
163
  }, [
164
- u,
165
- t,
166
- c,
167
- r,
164
+ h,
168
165
  n,
166
+ s,
167
+ r,
168
+ t,
169
169
  e.navParams,
170
170
  e.surfaceParams,
171
171
  e.onOpenNav,
172
172
  e.onOpenSurface,
173
173
  e.onOpenSidebar,
174
- k,
174
+ y,
175
175
  C,
176
- _,
177
- h,
176
+ S,
178
177
  m,
178
+ u,
179
179
  p,
180
180
  M,
181
181
  P,
182
182
  v,
183
- S,
183
+ _,
184
184
  W,
185
185
  N
186
186
  ]), z(() => {
187
187
  if (!R || !D || !A) return;
188
- const o = {
188
+ const a = {
189
189
  surface: R,
190
190
  isWorkbenchOpen: D,
191
191
  openWorkbench: A,
192
- closeWorkbench: j
192
+ openWorkbenchSources: V,
193
+ closeWorkbench: $
193
194
  };
194
- return se.on(ce.uiCommand, ({ command: f }) => {
195
- de(f, o);
195
+ return ce.on(de.uiCommand, ({ command: f }) => {
196
+ le(f, a);
196
197
  });
197
- }, [R, D, A, j]), /* @__PURE__ */ l(
198
+ }, [R, D, A, V, $]), /* @__PURE__ */ l(
198
199
  "div",
199
200
  {
200
201
  "data-boring-workspace": "",
@@ -205,38 +206,38 @@ function Ne(e) {
205
206
  "aside",
206
207
  {
207
208
  "data-boring-workspace-part": "session-drawer",
208
- "data-boring-state": t ? "expanded" : "collapsed",
209
+ "data-boring-state": n ? "expanded" : "collapsed",
209
210
  "aria-label": "Session browser",
210
- "aria-hidden": !t,
211
+ "aria-hidden": !n,
211
212
  className: g(
212
213
  "relative h-full min-h-0 shrink-0 overflow-hidden bg-background",
213
214
  "transition-[width,min-width,max-width] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
214
- t && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
215
+ n && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
215
216
  ),
216
217
  style: {
217
- width: t ? I : 0,
218
- minWidth: t ? I : 0,
219
- maxWidth: t ? I : 0,
218
+ width: n ? I : 0,
219
+ minWidth: n ? I : 0,
220
+ maxWidth: n ? I : 0,
220
221
  willChange: "width"
221
222
  },
222
223
  children: [
223
- /* @__PURE__ */ a(
224
+ /* @__PURE__ */ o(
224
225
  "div",
225
226
  {
226
227
  className: g(
227
228
  "h-full min-h-0 overflow-hidden",
228
229
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
229
- t ? "opacity-100" : "opacity-0"
230
+ n ? "opacity-100" : "opacity-0"
230
231
  ),
231
- children: /* @__PURE__ */ a(H, { id: s, params: e.navParams })
232
+ children: /* @__PURE__ */ o(E, { id: c, params: e.navParams })
232
233
  }
233
234
  ),
234
- t ? /* @__PURE__ */ a(
235
- X,
235
+ n ? /* @__PURE__ */ o(
236
+ T,
236
237
  {
237
238
  side: "drawer-right",
238
239
  ariaLabel: "Resize sessions drawer",
239
- onResize: (o) => w((f) => O(f + o, 200, 360))
240
+ onResize: (a) => w((f) => O(f + a, 200, 360))
240
241
  }
241
242
  ) : null
242
243
  ]
@@ -249,9 +250,9 @@ function Ne(e) {
249
250
  "aria-label": "Chat stage",
250
251
  className: "relative h-full min-h-0 min-w-0 flex-1 overflow-hidden bg-background",
251
252
  children: [
252
- /* @__PURE__ */ a(H, { id: c, params: e.centerParams }),
253
- !t && e.onOpenNav ? /* @__PURE__ */ a(
254
- U,
253
+ /* @__PURE__ */ o(E, { id: s, params: e.centerParams }),
254
+ !n && e.onOpenNav ? /* @__PURE__ */ o(
255
+ Z,
255
256
  {
256
257
  side: "left",
257
258
  icon: "sessions",
@@ -260,14 +261,15 @@ function Ne(e) {
260
261
  hint: "⌘1"
261
262
  }
262
263
  ) : null,
263
- !n && e.onOpenSurface ? /* @__PURE__ */ a(
264
- U,
264
+ !t && e.onOpenSurface ? /* @__PURE__ */ o(
265
+ Z,
265
266
  {
266
267
  side: "right",
267
268
  icon: "workbench",
268
269
  onClick: e.onOpenSurface,
269
270
  label: "Workbench",
270
- hint: "⌘2"
271
+ hint: "⌘2",
272
+ bottomOffset: e.surfaceButtonBottomOffset
271
273
  }
272
274
  ) : null
273
275
  ]
@@ -277,38 +279,53 @@ function Ne(e) {
277
279
  "aside",
278
280
  {
279
281
  "data-boring-workspace-part": "workbench",
280
- "data-boring-state": n ? "expanded" : "collapsed",
281
- "aria-label": n ? "Surface" : void 0,
282
- "aria-hidden": !n,
282
+ "data-boring-state": t ? "expanded" : "collapsed",
283
+ "aria-label": t ? "Surface" : void 0,
284
+ "aria-hidden": !t,
283
285
  className: g(
284
286
  "relative h-full min-h-0 shrink-0 overflow-hidden bg-background",
285
287
  "transition-[width,min-width,max-width] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
286
- n && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
288
+ t && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
287
289
  ),
288
290
  style: {
289
- width: n ? L : 0,
290
- minWidth: n ? L : 0,
291
- maxWidth: n ? L : 0,
291
+ width: t ? L : 0,
292
+ minWidth: t ? L : 0,
293
+ maxWidth: t ? L : 0,
292
294
  willChange: "width"
293
295
  },
294
296
  children: [
295
- /* @__PURE__ */ a(
297
+ /* @__PURE__ */ o(
296
298
  "div",
297
299
  {
298
300
  className: g(
299
301
  "h-full min-h-0 overflow-hidden",
300
302
  "transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
301
- n ? "opacity-100" : "opacity-0"
303
+ t ? "opacity-100" : "opacity-0"
302
304
  ),
303
- children: /* @__PURE__ */ a(H, { id: d, params: e.surfaceParams })
305
+ children: e.surfaceOverlay ? /* @__PURE__ */ l("div", { className: "relative h-full min-h-0", children: [
306
+ e.surfaceOverlay,
307
+ u ? /* @__PURE__ */ o(
308
+ K,
309
+ {
310
+ type: "button",
311
+ variant: "ghost",
312
+ size: "icon-sm",
313
+ onClick: u,
314
+ 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",
315
+ "aria-label": "Close workbench",
316
+ title: "Close workbench (⌘2)",
317
+ children: /* @__PURE__ */ o("span", { "aria-hidden": "true", children: "›" })
318
+ }
319
+ ) : null
320
+ ] }) : /* @__PURE__ */ o(E, { id: d, params: e.surfaceParams })
304
321
  }
305
322
  ),
306
- n ? /* @__PURE__ */ a(
307
- X,
323
+ t ? /* @__PURE__ */ o(
324
+ T,
308
325
  {
309
326
  side: "surface-left",
310
327
  ariaLabel: "Resize workbench",
311
- onResize: (o) => J((f) => O(f - o, 480, K))
328
+ onResize: (a) => Q((f) => O(f - a, 480, j))
312
329
  }
313
330
  ) : null
314
331
  ]
@@ -318,51 +335,51 @@ function Ne(e) {
318
335
  }
319
336
  );
320
337
  }
321
- function O(e, t, r) {
322
- return Math.max(t, Math.min(r, e));
338
+ function O(e, n, r) {
339
+ return Math.max(n, Math.min(r, e));
323
340
  }
324
- function T(e, t) {
325
- const [r, n] = q(
326
- () => e ? $(e, t) : t
341
+ function q(e, n) {
342
+ const [r, t] = G(
343
+ () => e ? X(e, n) : n
327
344
  );
328
345
  z(() => {
329
- n(e ? $(e, t) : t);
330
- }, [e, t]);
331
- const s = b(
332
- (c) => {
333
- n((d) => {
334
- const i = typeof c == "function" ? c(d) : c;
335
- return e && fe(e, i), i;
346
+ t(e ? X(e, n) : n);
347
+ }, [e, n]);
348
+ const c = b(
349
+ (s) => {
350
+ t((d) => {
351
+ const i = typeof s == "function" ? s(d) : s;
352
+ return e && ge(e, i), i;
336
353
  });
337
354
  },
338
355
  [e]
339
356
  );
340
- return [r, s];
357
+ return [r, c];
341
358
  }
342
- function ge() {
343
- const [e, t] = q(() => typeof window < "u" ? window.innerWidth : 1200);
359
+ function be() {
360
+ const [e, n] = G(() => typeof window < "u" ? window.innerWidth : 1200);
344
361
  return z(() => {
345
- const r = () => t(window.innerWidth);
362
+ const r = () => n(window.innerWidth);
346
363
  return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
347
364
  }, []), e;
348
365
  }
349
- function X({ side: e, ariaLabel: t, onResize: r }) {
350
- const n = ee(null), s = b((i) => {
351
- i.preventDefault(), n.current = i.clientX, i.currentTarget.setPointerCapture(i.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
352
- }, []), c = b((i) => {
353
- if (n.current === null) return;
354
- const x = i.clientX - n.current;
355
- n.current = i.clientX, r(x);
366
+ function T({ side: e, ariaLabel: n, onResize: r }) {
367
+ const t = ne(null), c = b((i) => {
368
+ i.preventDefault(), t.current = i.clientX, i.currentTarget.setPointerCapture(i.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
369
+ }, []), s = b((i) => {
370
+ if (t.current === null) return;
371
+ const k = i.clientX - t.current;
372
+ t.current = i.clientX, r(k);
356
373
  }, [r]), d = b((i) => {
357
- n.current !== null && (n.current = null, i.currentTarget.releasePointerCapture(i.pointerId), document.body.style.cursor = "", document.body.style.userSelect = "");
374
+ t.current !== null && (t.current = null, i.currentTarget.releasePointerCapture(i.pointerId), document.body.style.cursor = "", document.body.style.userSelect = "");
358
375
  }, []);
359
- return /* @__PURE__ */ a(
360
- ne,
376
+ return /* @__PURE__ */ o(
377
+ re,
361
378
  {
362
- "aria-label": t,
379
+ "aria-label": n,
363
380
  orientation: "vertical",
364
- onResizeStart: s,
365
- onPointerMove: c,
381
+ onResizeStart: c,
382
+ onPointerMove: s,
366
383
  onPointerUp: d,
367
384
  onPointerCancel: d,
368
385
  className: g(
@@ -375,12 +392,12 @@ function X({ side: e, ariaLabel: t, onResize: r }) {
375
392
  }
376
393
  );
377
394
  }
378
- function y(e, t) {
379
- const r = e == null ? void 0 : e[t];
395
+ function x(e, n) {
396
+ const r = e == null ? void 0 : e[n];
380
397
  return typeof r == "function" ? r : void 0;
381
398
  }
382
- function B(e, t) {
383
- return y(e, t);
399
+ function B(e, n) {
400
+ return x(e, n);
384
401
  }
385
402
  function F() {
386
403
  if (typeof document > "u") return;
@@ -389,27 +406,27 @@ function F() {
389
406
  );
390
407
  e == null || e.focus();
391
408
  }
392
- function be() {
409
+ function we() {
393
410
  typeof window > "u" || window.requestAnimationFrame(() => {
394
411
  F(), window.setTimeout(F, 320);
395
412
  });
396
413
  }
397
- function H({ id: e, params: t }) {
398
- const r = le(), { debug: n } = ue(), s = Q(
414
+ function E({ id: e, params: n }) {
415
+ const r = ue(), { debug: t } = he(), c = Y(
399
416
  r.subscribe,
400
417
  r.getSnapshot,
401
418
  r.getSnapshot
402
- ), d = E(() => r.getComponents(), [r, s])[e], i = E(() => we(e), [e]);
403
- return d ? /* @__PURE__ */ a(Y, { fallback: /* @__PURE__ */ a(te, { centered: !0 }), children: /* @__PURE__ */ a(
419
+ ), d = H(() => r.getComponents(), [r, c])[e], i = H(() => pe(e), [e]);
420
+ return d ? /* @__PURE__ */ o(ee, { fallback: /* @__PURE__ */ o(te, { centered: !0 }), children: /* @__PURE__ */ o(
404
421
  d,
405
422
  {
406
- params: { ...t, debug: n },
423
+ params: { ...n, debug: t },
407
424
  api: i,
408
425
  containerApi: {}
409
426
  }
410
427
  ) }) : null;
411
428
  }
412
- function we(e) {
429
+ function pe(e) {
413
430
  return {
414
431
  id: e,
415
432
  title: e,
@@ -445,101 +462,104 @@ function we(e) {
445
462
  } })
446
463
  };
447
464
  }
448
- function U({
465
+ function Z({
449
466
  side: e,
450
- icon: t,
467
+ icon: n,
451
468
  onClick: r,
452
- label: n,
453
- hint: s
469
+ label: t,
470
+ hint: c,
471
+ bottomOffset: s
454
472
  }) {
455
- return /* @__PURE__ */ a(
456
- Z,
473
+ const d = e === "right" && s !== void 0;
474
+ return /* @__PURE__ */ o(
475
+ K,
457
476
  {
458
477
  type: "button",
459
478
  variant: "ghost",
460
479
  size: "icon-sm",
461
480
  onClick: r,
462
- "aria-label": n,
463
- title: s ? `${n} (${s})` : n,
481
+ "aria-label": t,
482
+ title: c ? `${t} (${c})` : t,
464
483
  className: g(
465
- "absolute top-1/2 z-30 h-9 w-9 -translate-y-1/2 gap-0.5 rounded-lg bg-background text-muted-foreground",
484
+ "absolute z-30 h-9 w-9 gap-0.5 rounded-lg bg-background text-muted-foreground",
466
485
  e === "left" ? "left-2" : "right-2",
486
+ d ? "hover:-translate-y-0.5" : "top-1/2 -translate-y-1/2 hover:-translate-y-[calc(50%+1px)]",
467
487
  "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)]",
468
- "hover:-translate-y-[calc(50%+1px)] 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)]",
488
+ "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)]",
469
489
  "focus-visible:ring-ring/40"
470
490
  ),
471
- children: t === "sessions" ? /* @__PURE__ */ l("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
472
- /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "1.8" }),
473
- /* @__PURE__ */ a("path", { d: "M12 7v5l3.2 2", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
474
- ] }) : /* @__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" }) })
491
+ style: d ? { bottom: s } : void 0,
492
+ children: n === "sessions" ? /* @__PURE__ */ l("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
493
+ /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "1.8" }),
494
+ /* @__PURE__ */ o("path", { d: "M12 7v5l3.2 2", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
495
+ ] }) : /* @__PURE__ */ o("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ o("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" }) })
475
496
  }
476
497
  );
477
498
  }
478
- function Pe({
499
+ function Oe({
479
500
  appTitle: e = "Boring",
480
- sessionTitle: t,
501
+ sessionTitle: n,
481
502
  onCommandPalette: r,
482
- onNewChat: n,
483
- topBarLeft: s,
484
- topBarRight: c,
503
+ onNewChat: t,
504
+ topBarLeft: c,
505
+ topBarRight: s,
485
506
  className: d
486
507
  }) {
487
- const i = c ?? null;
508
+ const i = s ?? null;
488
509
  return /* @__PURE__ */ l(
489
510
  "header",
490
511
  {
491
512
  "data-boring-workspace-part": "topbar",
492
513
  className: g(
493
- "relative flex items-center justify-between gap-2 px-3",
494
- "bg-background border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)]",
514
+ "relative flex h-11 items-center justify-between gap-2 px-3",
515
+ "bg-background border-b border-border",
495
516
  d
496
517
  ),
497
- style: { height: 40 },
498
518
  "aria-label": "App top bar",
499
519
  children: [
500
- /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: s ?? /* @__PURE__ */ l(V, { children: [
501
- /* @__PURE__ */ a(
502
- "img",
520
+ /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 leading-none", children: c ?? /* @__PURE__ */ l(U, { children: [
521
+ /* @__PURE__ */ o(
522
+ "span",
503
523
  {
504
- src: "https://chatgpt.com/backend-api/estuary/content?id=file_000000006a4471f4b8411fcbfde271c6&ts=493962&p=fs&cid=1&sig=b406cfec61d387bdedd898858283b389f31ad2bd3eb7a358a6d1efa23e9afa83&v=0",
505
- alt: e,
506
- className: "h-6 w-6 shrink-0 rounded-md"
524
+ "aria-hidden": "true",
525
+ className: "grid size-[22px] shrink-0 place-items-center rounded-sm bg-foreground text-[11px] font-semibold leading-none tracking-tight text-background",
526
+ children: ((e == null ? void 0 : e[0]) ?? "B").toUpperCase()
507
527
  }
508
528
  ),
509
- /* @__PURE__ */ a("span", { className: "truncate text-[12px] font-medium tracking-tight text-foreground", children: e }),
510
- t && /* @__PURE__ */ l(V, { children: [
511
- /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "text-muted-foreground/30", children: "/" }),
512
- /* @__PURE__ */ a("span", { className: "truncate text-[12px] font-normal text-muted-foreground", children: t })
513
- ] })
529
+ n ? /* @__PURE__ */ l(U, { children: [
530
+ /* @__PURE__ */ o("span", { className: "shrink-0 text-[13px] font-medium leading-none tracking-tight text-foreground/65", children: e }),
531
+ /* @__PURE__ */ o("span", { "aria-hidden": "true", className: "text-[13px] leading-none text-muted-foreground/45", children: "·" }),
532
+ /* @__PURE__ */ o("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: n })
533
+ ] }) : /* @__PURE__ */ o("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: e })
514
534
  ] }) }),
515
535
  /* @__PURE__ */ l(
516
- re,
536
+ oe,
517
537
  {
518
538
  type: "button",
519
539
  variant: "ghost",
520
540
  size: "sm",
521
541
  onClick: r,
522
- className: "group h-6 gap-1 px-1.5 text-[12px] text-muted-foreground/60 hover:bg-muted/60 hover:text-foreground focus-visible:text-foreground",
542
+ 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",
523
543
  "aria-label": "Search catalogs and commands",
524
544
  title: "Command palette (⌘K)",
525
545
  children: [
526
- /* @__PURE__ */ a(he, { className: "h-3 w-3 shrink-0 opacity-70", strokeWidth: 1.75 }),
527
- /* @__PURE__ */ a("span", { className: "font-normal tracking-tight", children: "Search" }),
528
- /* @__PURE__ */ a(ae, { className: "ml-1 border-0 bg-transparent p-0 text-[10px] shadow-none group-hover:text-muted-foreground", children: "⌘K" })
546
+ /* @__PURE__ */ o(me, { className: "h-3.5 w-3.5 shrink-0 opacity-80", strokeWidth: 1.75 }),
547
+ /* @__PURE__ */ o("span", { className: "font-normal tracking-tight", children: "Search" }),
548
+ /* @__PURE__ */ o(ae, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
529
549
  ]
530
550
  }
531
551
  ),
532
552
  /* @__PURE__ */ l("div", { className: "flex flex-1 shrink-0 items-center justify-end gap-1", children: [
533
- n && /* @__PURE__ */ a(
534
- Z,
553
+ t && /* @__PURE__ */ o(
554
+ K,
535
555
  {
536
556
  type: "button",
537
557
  variant: "ghost",
538
558
  size: "icon-sm",
539
- onClick: n,
559
+ onClick: t,
540
560
  "aria-label": "New chat",
541
561
  title: "New chat",
542
- children: /* @__PURE__ */ a(me, { className: "h-4 w-4" })
562
+ children: /* @__PURE__ */ o(fe, { className: "h-4 w-4" })
543
563
  }
544
564
  ),
545
565
  i
@@ -548,14 +568,14 @@ function Pe({
548
568
  }
549
569
  );
550
570
  }
551
- function Oe({
571
+ function Be({
552
572
  title: e = "Loading workspace",
553
- description: t = "Preparing the workspace context.",
573
+ description: n = "Preparing the workspace context.",
554
574
  status: r = "Loading",
555
- fullscreen: n = !0,
556
- className: s
575
+ fullscreen: t = !0,
576
+ className: c
557
577
  }) {
558
- return /* @__PURE__ */ a(
578
+ return /* @__PURE__ */ o(
559
579
  "section",
560
580
  {
561
581
  role: "status",
@@ -563,11 +583,11 @@ function Oe({
563
583
  "aria-busy": "true",
564
584
  className: g(
565
585
  "flex h-full w-full items-center justify-center bg-background px-6 text-foreground",
566
- n ? "min-h-screen" : "min-h-[240px]",
567
- s
586
+ t ? "min-h-screen" : "min-h-[240px]",
587
+ c
568
588
  ),
569
589
  children: /* @__PURE__ */ l("div", { className: "flex w-full max-w-sm flex-col items-center gap-5 text-center", children: [
570
- /* @__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(
590
+ /* @__PURE__ */ o("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg border border-border bg-card text-foreground", children: /* @__PURE__ */ o(
571
591
  "span",
572
592
  {
573
593
  "aria-hidden": "true",
@@ -575,19 +595,19 @@ function Oe({
575
595
  }
576
596
  ) }),
577
597
  /* @__PURE__ */ l("div", { className: "space-y-2", children: [
578
- /* @__PURE__ */ a("h2", { className: "text-base font-medium text-foreground", children: e }),
579
- t ? /* @__PURE__ */ a("p", { className: "text-sm leading-6 text-muted-foreground", children: t }) : null
598
+ /* @__PURE__ */ o("h2", { className: "text-base font-medium text-foreground", children: e }),
599
+ n ? /* @__PURE__ */ o("p", { className: "text-sm leading-6 text-muted-foreground", children: n }) : null
580
600
  ] }),
581
- r ? /* @__PURE__ */ a("p", { className: "text-xs font-medium text-muted-foreground/80", children: r }) : null
601
+ r ? /* @__PURE__ */ o("p", { className: "text-xs font-medium text-muted-foreground/80", children: r }) : null
582
602
  ] })
583
603
  }
584
604
  );
585
605
  }
586
606
  export {
587
- Ne as C,
588
- Pe as T,
589
- Oe as W,
590
- We as b,
607
+ Pe as C,
608
+ Oe as T,
609
+ Be as W,
610
+ Ne as b,
591
611
  _e as r,
592
- Se as w
612
+ We as w
593
613
  };