@hachej/boring-workspace 0.1.59 → 0.1.61
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.
- package/dist/{FileTree-ChkSU4gL.js → FileTree-zGmxifl_.js} +11 -11
- package/dist/{MarkdownEditor-BlYGosmH.js → MarkdownEditor-BykEKKxv.js} +222 -206
- package/dist/{WorkspaceLoadingState-BYTO4wdt.js → WorkspaceLoadingState-Dfnk7JjR.js} +425 -335
- package/dist/WorkspaceProvider-kf-pjz6V.js +8530 -0
- package/dist/app-front.d.ts +141 -37
- package/dist/app-front.js +2037 -891
- package/dist/boring-workspace.css +1 -1
- package/dist/events.d.ts +2 -2
- package/dist/plugin.d.ts +27 -33
- package/dist/plugin.js +15 -13
- package/dist/shared.d.ts +1 -1
- package/dist/{surface-DmIalUmP.d.ts → surface-CDklwi48.d.ts} +34 -6
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +20 -21
- package/dist/workspace.css +488 -138
- package/dist/workspace.d.ts +207 -33
- package/dist/workspace.js +259 -255
- package/docs/INTERFACES.md +2 -2
- package/docs/README.md +3 -3
- package/package.json +4 -4
- package/dist/WorkspaceProvider-Bp1Sm40K.js +0 -8004
- package/dist/panel-DnvDNQac.js +0 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { IconButton as
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
if (!
|
|
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-kf-pjz6V.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
|
|
18
|
-
if (!(!
|
|
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
|
|
25
|
-
if (!
|
|
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
|
|
30
|
-
return Number.isFinite(
|
|
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
|
|
36
|
-
if (!(!
|
|
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
|
-
|
|
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:
|
|
82
|
+
navParams: r,
|
|
46
83
|
center: n = "chat",
|
|
47
|
-
centerParams:
|
|
48
|
-
surface:
|
|
49
|
-
surfaceParams:
|
|
50
|
-
sidebar:
|
|
51
|
-
sidebarParams:
|
|
52
|
-
} = e,
|
|
53
|
-
return t &&
|
|
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:
|
|
94
|
+
params: r,
|
|
58
95
|
locked: !0,
|
|
59
96
|
hideHeader: !0,
|
|
60
97
|
constraints: { minWidth: 60, maxWidth: 60 }
|
|
61
|
-
}),
|
|
98
|
+
}), w.push({
|
|
62
99
|
id: "center",
|
|
63
100
|
position: "center",
|
|
64
101
|
panel: n,
|
|
65
|
-
params:
|
|
102
|
+
params: l,
|
|
66
103
|
hideHeader: !0
|
|
67
|
-
}),
|
|
104
|
+
}), i && w.push({
|
|
68
105
|
id: "sidebar",
|
|
69
106
|
position: "left",
|
|
70
|
-
panel:
|
|
71
|
-
params:
|
|
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
|
-
}),
|
|
113
|
+
}), s && w.push({
|
|
77
114
|
id: "surface",
|
|
78
115
|
position: "right",
|
|
79
|
-
panel:
|
|
80
|
-
params:
|
|
116
|
+
panel: s,
|
|
117
|
+
params: d,
|
|
81
118
|
hideHeader: !0,
|
|
82
119
|
dynamic: !0,
|
|
83
120
|
placeholder: "empty"
|
|
84
|
-
}), { version: "2.0", groups:
|
|
121
|
+
}), { version: "2.0", groups: w };
|
|
85
122
|
}
|
|
86
|
-
function
|
|
87
|
-
var
|
|
88
|
-
const t = e.nav !== null,
|
|
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
|
-
), [
|
|
128
|
+
), [ne, xe] = J(
|
|
92
129
|
e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
|
|
93
130
|
680
|
|
94
|
-
), [
|
|
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
|
-
), [
|
|
98
|
-
() =>
|
|
99
|
-
[
|
|
100
|
-
),
|
|
101
|
-
() =>
|
|
102
|
-
[
|
|
103
|
-
),
|
|
104
|
-
var
|
|
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
|
-
|
|
146
|
+
p == null || p();
|
|
107
147
|
return;
|
|
108
148
|
}
|
|
109
|
-
(
|
|
110
|
-
}, [
|
|
111
|
-
var
|
|
149
|
+
(o = e.onOpenNav) == null || o.call(e);
|
|
150
|
+
}, [p, t, e.onOpenNav]), I = k(() => {
|
|
151
|
+
var o;
|
|
112
152
|
if (n) {
|
|
113
|
-
|
|
153
|
+
x == null || x();
|
|
114
154
|
return;
|
|
115
155
|
}
|
|
116
|
-
(
|
|
117
|
-
}, [
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
120
|
-
|
|
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
|
-
(
|
|
124
|
-
}, [
|
|
125
|
-
c &&
|
|
126
|
-
}, [c,
|
|
127
|
-
|
|
128
|
-
var
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
}),
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
shortcuts:
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
}, [
|
|
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
|
|
140
|
-
return
|
|
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:
|
|
146
|
-
when: () =>
|
|
147
|
-
run:
|
|
148
|
-
}),
|
|
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:
|
|
154
|
-
when: () =>
|
|
155
|
-
run:
|
|
156
|
-
}),
|
|
193
|
+
pluginId: o,
|
|
194
|
+
when: () => O,
|
|
195
|
+
run: I
|
|
196
|
+
}), v.registerCommand({
|
|
157
197
|
id: "workspace:toggle-workbench-left-panel",
|
|
158
|
-
title:
|
|
159
|
-
keywords: ["left", "sidebar", "tabs", "workbench",
|
|
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:
|
|
162
|
-
when: () =>
|
|
163
|
-
run:
|
|
164
|
-
}),
|
|
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:
|
|
169
|
-
run:
|
|
170
|
-
}), Z &&
|
|
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:
|
|
214
|
+
pluginId: u,
|
|
175
215
|
run: Z
|
|
176
216
|
}), () => {
|
|
177
|
-
|
|
217
|
+
v.unregisterByPluginId(o), v.unregisterByPluginId(u);
|
|
178
218
|
};
|
|
179
219
|
}, [
|
|
180
|
-
|
|
220
|
+
v,
|
|
181
221
|
t,
|
|
182
|
-
|
|
183
|
-
|
|
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
|
-
|
|
231
|
+
O,
|
|
199
232
|
A,
|
|
233
|
+
p,
|
|
234
|
+
x,
|
|
235
|
+
P,
|
|
236
|
+
Z,
|
|
237
|
+
T,
|
|
238
|
+
g,
|
|
200
239
|
D,
|
|
201
|
-
|
|
240
|
+
I,
|
|
241
|
+
E
|
|
202
242
|
]), y(() => {
|
|
203
|
-
const
|
|
204
|
-
surface:
|
|
205
|
-
isWorkbenchOpen:
|
|
206
|
-
openWorkbench:
|
|
207
|
-
openWorkbenchSources:
|
|
208
|
-
closeWorkbench:
|
|
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: (
|
|
214
|
-
var
|
|
215
|
-
return ((
|
|
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 (
|
|
219
|
-
return
|
|
220
|
-
|
|
258
|
+
if (o)
|
|
259
|
+
return Fe.on(ge.uiCommand, ({ command: u }) => {
|
|
260
|
+
Ve(u, o);
|
|
221
261
|
});
|
|
222
|
-
}, [
|
|
223
|
-
c &&
|
|
262
|
+
}, [se, q, U, X, oe, ie]), $e(ge.agentData, () => {
|
|
263
|
+
c && B(!0);
|
|
224
264
|
}), y(() => {
|
|
225
265
|
if (!c) {
|
|
226
|
-
|
|
266
|
+
B(!1);
|
|
227
267
|
return;
|
|
228
268
|
}
|
|
229
|
-
|
|
230
|
-
}, [
|
|
231
|
-
const
|
|
269
|
+
ae.length > 0 && (m(!1), B(!1), we());
|
|
270
|
+
}, [ae.length, c, m]);
|
|
271
|
+
const le = H(C);
|
|
232
272
|
y(() => {
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
}, [
|
|
236
|
-
|
|
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
|
|
239
|
-
|
|
240
|
-
}, [n, c,
|
|
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:
|
|
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:
|
|
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
|
-
t
|
|
307
|
+
t ? "z-30 border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]" : "pointer-events-none z-0"
|
|
258
308
|
),
|
|
259
309
|
style: {
|
|
260
|
-
width: t ?
|
|
261
|
-
minWidth: t ?
|
|
262
|
-
maxWidth: t ?
|
|
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:
|
|
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
|
-
t ? "opacity-100" : "opacity-0"
|
|
322
|
+
t ? "opacity-100" : "invisible pointer-events-none opacity-0"
|
|
273
323
|
),
|
|
274
|
-
children: /* @__PURE__ */ a(
|
|
324
|
+
children: /* @__PURE__ */ a(z, { id: l, params: e.navParams })
|
|
275
325
|
}
|
|
276
326
|
),
|
|
277
327
|
t ? /* @__PURE__ */ a(
|
|
278
|
-
|
|
328
|
+
Q,
|
|
279
329
|
{
|
|
280
330
|
side: "drawer-right",
|
|
281
331
|
ariaLabel: "Resize sessions drawer",
|
|
282
|
-
onResize: (
|
|
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:
|
|
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:
|
|
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:
|
|
313
|
-
|
|
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: (
|
|
323
|
-
|
|
413
|
+
renderPane: (o) => /* @__PURE__ */ a(
|
|
414
|
+
z,
|
|
324
415
|
{
|
|
325
|
-
id:
|
|
326
|
-
params:
|
|
416
|
+
id: o.panel ?? s,
|
|
417
|
+
params: o.params ?? e.centerParams
|
|
327
418
|
}
|
|
328
419
|
)
|
|
329
420
|
}
|
|
330
|
-
) : /* @__PURE__ */ a(
|
|
421
|
+
) : /* @__PURE__ */ a(z, { id: s, params: e.centerParams })
|
|
331
422
|
}
|
|
332
423
|
),
|
|
333
|
-
|
|
334
|
-
|
|
424
|
+
e.chatOverlay ? /* @__PURE__ */ a(
|
|
425
|
+
"div",
|
|
335
426
|
{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
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:
|
|
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 ?
|
|
368
|
-
minWidth: n ?
|
|
369
|
-
maxWidth: n ?
|
|
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:
|
|
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__ */
|
|
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
|
-
|
|
470
|
+
Q,
|
|
404
471
|
{
|
|
405
472
|
side: "surface-left",
|
|
406
473
|
ariaLabel: "Resize workbench",
|
|
407
|
-
onResize: (
|
|
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
|
-
|
|
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:
|
|
502
|
+
pulse: Se
|
|
423
503
|
}
|
|
424
504
|
) : null,
|
|
425
|
-
!c && !t &&
|
|
426
|
-
|
|
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
|
|
432
|
-
const
|
|
433
|
-
|
|
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
|
|
467
|
-
return Math.max(t, Math.min(
|
|
523
|
+
function _(e, t, r) {
|
|
524
|
+
return Math.max(t, Math.min(r, e));
|
|
468
525
|
}
|
|
469
|
-
function
|
|
470
|
-
const [
|
|
471
|
-
() => e ?
|
|
526
|
+
function J(e, t) {
|
|
527
|
+
const [r, n] = j(
|
|
528
|
+
() => e ? me(e, t) : t
|
|
472
529
|
);
|
|
473
530
|
y(() => {
|
|
474
|
-
n(e ?
|
|
531
|
+
n(e ? me(e, t) : t);
|
|
475
532
|
}, [e, t]);
|
|
476
|
-
const
|
|
477
|
-
(
|
|
478
|
-
n((
|
|
479
|
-
const
|
|
480
|
-
return e &&
|
|
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 [
|
|
542
|
+
return [r, l];
|
|
486
543
|
}
|
|
487
|
-
function
|
|
488
|
-
const [
|
|
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
|
|
495
|
-
n(
|
|
551
|
+
const s = window.localStorage.getItem(e);
|
|
552
|
+
n(s == null ? t : s === "1");
|
|
496
553
|
}, [e, t]);
|
|
497
|
-
const
|
|
498
|
-
(
|
|
499
|
-
n((
|
|
500
|
-
const
|
|
501
|
-
return e && typeof window < "u" && window.localStorage.setItem(e,
|
|
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 [
|
|
563
|
+
return [r, l];
|
|
507
564
|
}
|
|
508
|
-
function
|
|
509
|
-
const [e, t] =
|
|
565
|
+
function Qe() {
|
|
566
|
+
const [e, t] = j(() => typeof window < "u" ? window.innerWidth : 1200);
|
|
510
567
|
return y(() => {
|
|
511
|
-
const
|
|
512
|
-
return window.addEventListener("resize",
|
|
568
|
+
const r = () => t(window.innerWidth);
|
|
569
|
+
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
513
570
|
}, []), e;
|
|
514
571
|
}
|
|
515
|
-
function
|
|
516
|
-
const n =
|
|
517
|
-
|
|
518
|
-
}, []),
|
|
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
|
|
521
|
-
n.current =
|
|
522
|
-
}, [
|
|
523
|
-
n.current !== null && (n.current = null,
|
|
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
|
-
|
|
583
|
+
Oe,
|
|
527
584
|
{
|
|
528
585
|
"aria-label": t,
|
|
529
586
|
orientation: "vertical",
|
|
530
|
-
onResizeStart:
|
|
531
|
-
onPointerMove:
|
|
532
|
-
onPointerUp:
|
|
533
|
-
onPointerCancel:
|
|
534
|
-
className:
|
|
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
|
|
544
|
-
const
|
|
545
|
-
if (!
|
|
546
|
-
const n =
|
|
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
|
|
551
|
-
return typeof
|
|
607
|
+
const r = e == null ? void 0 : e[t];
|
|
608
|
+
return typeof r == "function" ? r : void 0;
|
|
552
609
|
}
|
|
553
|
-
function
|
|
610
|
+
function K(e, t) {
|
|
554
611
|
return N(e, t);
|
|
555
612
|
}
|
|
556
|
-
function
|
|
613
|
+
function ee() {
|
|
557
614
|
if (typeof document > "u") return;
|
|
558
|
-
const
|
|
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
|
-
|
|
620
|
+
r == null || r.focus();
|
|
564
621
|
}
|
|
565
|
-
function
|
|
622
|
+
function we() {
|
|
566
623
|
typeof window > "u" || window.requestAnimationFrame(() => {
|
|
567
|
-
|
|
624
|
+
ee(), window.setTimeout(ee, 320);
|
|
568
625
|
});
|
|
569
626
|
}
|
|
570
|
-
function
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
),
|
|
576
|
-
return
|
|
577
|
-
|
|
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:
|
|
637
|
+
api: i,
|
|
581
638
|
containerApi: {}
|
|
582
639
|
}
|
|
583
640
|
) }) : null;
|
|
584
641
|
}
|
|
585
|
-
function
|
|
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
|
|
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:
|
|
716
|
+
onClick: r,
|
|
625
717
|
label: n,
|
|
626
|
-
hint:
|
|
627
|
-
bottomOffset:
|
|
628
|
-
stackIndex:
|
|
629
|
-
pulse:
|
|
718
|
+
hint: l,
|
|
719
|
+
bottomOffset: s,
|
|
720
|
+
stackIndex: d = 0,
|
|
721
|
+
pulse: i = !1
|
|
630
722
|
}) {
|
|
631
|
-
const
|
|
632
|
-
return /* @__PURE__ */ a(
|
|
633
|
-
|
|
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:
|
|
730
|
+
onClick: r,
|
|
639
731
|
"aria-label": n,
|
|
640
|
-
className:
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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(
|
|
657
|
-
|
|
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
|
|
754
|
+
function ft({
|
|
663
755
|
appTitle: e = "Boring",
|
|
664
756
|
sessionTitle: t,
|
|
665
|
-
onCommandPalette:
|
|
757
|
+
onCommandPalette: r,
|
|
666
758
|
onNewChat: n,
|
|
667
|
-
topBarLeft:
|
|
668
|
-
topBarRight:
|
|
669
|
-
className:
|
|
759
|
+
topBarLeft: l,
|
|
760
|
+
topBarRight: s,
|
|
761
|
+
className: d
|
|
670
762
|
}) {
|
|
671
|
-
const
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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: ((
|
|
781
|
+
children: ((f == null ? void 0 : f[0]) ?? "B").toUpperCase()
|
|
690
782
|
}
|
|
691
783
|
),
|
|
692
|
-
|
|
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
|
-
|
|
787
|
+
Ie,
|
|
700
788
|
{
|
|
701
789
|
type: "button",
|
|
702
790
|
variant: "ghost",
|
|
703
791
|
size: "sm",
|
|
704
|
-
onClick:
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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(
|
|
813
|
+
children: /* @__PURE__ */ a(Ee, { className: "h-4 w-4" })
|
|
726
814
|
}
|
|
727
815
|
),
|
|
728
|
-
|
|
816
|
+
i
|
|
729
817
|
] })
|
|
730
818
|
]
|
|
731
819
|
}
|
|
732
820
|
);
|
|
733
821
|
}
|
|
734
|
-
function
|
|
822
|
+
function gt({
|
|
735
823
|
title: e = "Loading workspace",
|
|
736
824
|
description: t = "Preparing the workspace context.",
|
|
737
|
-
status:
|
|
825
|
+
status: r = "Loading",
|
|
738
826
|
fullscreen: n = !0,
|
|
739
|
-
className:
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
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
|
};
|