@hachej/boring-workspace 0.1.30 → 0.1.32
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-BltQETt9.js +289 -0
- package/dist/{MarkdownEditor-DPBSzTBz.js → MarkdownEditor-heUJdK4j.js} +1 -1
- package/dist/WorkspaceLoadingState-InXsc_8G.js +719 -0
- package/dist/{WorkspaceProvider-0V-2x7AH.js → WorkspaceProvider-Cg-J1wxr.js} +2750 -2570
- package/dist/app-front.d.ts +22 -2
- package/dist/app-front.js +672 -524
- package/dist/app-server.d.ts +21 -4
- package/dist/app-server.js +277 -104
- package/dist/boring-workspace.css +1 -1
- package/dist/{createInMemoryBridge--ZFPAgXy.d.ts → createInMemoryBridge-HJopAIbo.d.ts} +12 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/server.d.ts +62 -9
- package/dist/server.js +261 -46
- package/dist/shared.d.ts +2 -2
- package/dist/{surface-CEEkd81D.d.ts → surface-obE7YwJk.d.ts} +2 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +1 -1
- package/dist/{ui-bridge-Bdgl2hR8.d.ts → ui-bridge-DFNem0df.d.ts} +2 -2
- package/dist/workspace.css +79 -27
- package/dist/workspace.d.ts +88 -2
- package/dist/workspace.js +472 -386
- package/docs/PLUGIN_STRUCTURE.md +5 -4
- package/docs/PLUGIN_SYSTEM.md +6 -6
- package/docs/plans/archive/UNIFIED_PLUGIN_SYSTEM_PLAN.md +2 -2
- package/package.json +3 -3
- package/dist/FileTree-DUxjUbxL.js +0 -266
- package/dist/WorkspaceLoadingState-DJF_4S4_.js +0 -613
|
@@ -1,613 +0,0 @@
|
|
|
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
|
-
import { c as g } from "./utils-B6yFEsav.js";
|
|
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-0V-2x7AH.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
|
-
try {
|
|
10
|
-
const t = window.localStorage.getItem(e);
|
|
11
|
-
if (t === "1") return !0;
|
|
12
|
-
if (t === "0") return !1;
|
|
13
|
-
} catch {
|
|
14
|
-
}
|
|
15
|
-
return n;
|
|
16
|
-
}
|
|
17
|
-
function We(e, n, r = !0) {
|
|
18
|
-
if (!(!r || typeof window > "u"))
|
|
19
|
-
try {
|
|
20
|
-
window.localStorage.setItem(e, n ? "1" : "0");
|
|
21
|
-
} catch {
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function X(e, n, r = !0) {
|
|
25
|
-
if (!r || typeof window > "u") return n;
|
|
26
|
-
try {
|
|
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
|
-
} catch {
|
|
32
|
-
}
|
|
33
|
-
return n;
|
|
34
|
-
}
|
|
35
|
-
function ge(e, n, r = !0) {
|
|
36
|
-
if (!(!r || typeof window > "u"))
|
|
37
|
-
try {
|
|
38
|
-
window.localStorage.setItem(e, String(Math.round(n)));
|
|
39
|
-
} catch {
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function Ne(e = {}) {
|
|
43
|
-
const {
|
|
44
|
-
nav: n = "session-list",
|
|
45
|
-
navParams: r,
|
|
46
|
-
center: t = "chat",
|
|
47
|
-
centerParams: c,
|
|
48
|
-
surface: s,
|
|
49
|
-
surfaceParams: d,
|
|
50
|
-
sidebar: i,
|
|
51
|
-
sidebarParams: k
|
|
52
|
-
} = e, w = [];
|
|
53
|
-
return n && w.push({
|
|
54
|
-
id: "nav",
|
|
55
|
-
position: "left",
|
|
56
|
-
panel: n,
|
|
57
|
-
params: r,
|
|
58
|
-
locked: !0,
|
|
59
|
-
hideHeader: !0,
|
|
60
|
-
constraints: { minWidth: 60, maxWidth: 60 }
|
|
61
|
-
}), w.push({
|
|
62
|
-
id: "center",
|
|
63
|
-
position: "center",
|
|
64
|
-
panel: t,
|
|
65
|
-
params: c,
|
|
66
|
-
hideHeader: !0
|
|
67
|
-
}), i && w.push({
|
|
68
|
-
id: "sidebar",
|
|
69
|
-
position: "left",
|
|
70
|
-
panel: i,
|
|
71
|
-
params: k,
|
|
72
|
-
hideHeader: !0,
|
|
73
|
-
collapsible: !0,
|
|
74
|
-
collapsedWidth: 40,
|
|
75
|
-
constraints: { minWidth: 200, maxWidthViewportRatio: 0.5 }
|
|
76
|
-
}), s && w.push({
|
|
77
|
-
id: "surface",
|
|
78
|
-
position: "right",
|
|
79
|
-
panel: s,
|
|
80
|
-
params: d,
|
|
81
|
-
hideHeader: !0,
|
|
82
|
-
dynamic: !0,
|
|
83
|
-
placeholder: "empty"
|
|
84
|
-
}), { version: "2.0", groups: w };
|
|
85
|
-
}
|
|
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
|
-
e.storageKey ? `${e.storageKey}:drawerWidth` : void 0,
|
|
89
|
-
260
|
|
90
|
-
), [J, Q] = q(
|
|
91
|
-
e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
|
|
92
|
-
680
|
|
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;
|
|
95
|
-
if (n) {
|
|
96
|
-
m == null || m();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
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
|
-
if (v) {
|
|
110
|
-
p == null || p();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
(a = e.onOpenSidebar) == null || a.call(e);
|
|
114
|
-
}, [p, e.onOpenSidebar, v]), P = b(() => {
|
|
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
|
-
}), z(() => {
|
|
123
|
-
const a = "workspace:chat-layout", f = "agent:chat-layout";
|
|
124
|
-
return h.unregisterByPluginId(a), h.unregisterByPluginId(f), h.registerCommand({
|
|
125
|
-
id: "workspace:open-session-history",
|
|
126
|
-
title: n ? "Close Session History" : "Open Session History",
|
|
127
|
-
keywords: ["sessions", "history", "drawer", n ? "close" : "open"],
|
|
128
|
-
shortcut: "⌘1",
|
|
129
|
-
pluginId: a,
|
|
130
|
-
when: () => y,
|
|
131
|
-
run: _
|
|
132
|
-
}), h.registerCommand({
|
|
133
|
-
id: "workspace:open-workbench",
|
|
134
|
-
title: t ? "Close Workbench" : "Open Workbench",
|
|
135
|
-
keywords: ["surface", "artifacts", "sources", "workbench", t ? "close" : "open"],
|
|
136
|
-
shortcut: "⌘2",
|
|
137
|
-
pluginId: a,
|
|
138
|
-
when: () => C,
|
|
139
|
-
run: W
|
|
140
|
-
}), h.registerCommand({
|
|
141
|
-
id: "workspace:toggle-workbench-left-panel",
|
|
142
|
-
title: v ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
|
|
143
|
-
keywords: ["left", "sidebar", "tabs", "workbench", v ? "close" : "open"],
|
|
144
|
-
shortcut: "⌘3",
|
|
145
|
-
pluginId: a,
|
|
146
|
-
when: () => S,
|
|
147
|
-
run: N
|
|
148
|
-
}), s === "chat" && h.registerCommand({
|
|
149
|
-
id: "agent:focus-chat",
|
|
150
|
-
title: "Focus Chat",
|
|
151
|
-
keywords: ["agent", "chat", "prompt", "composer", "input", "focus"],
|
|
152
|
-
pluginId: f,
|
|
153
|
-
run: P
|
|
154
|
-
}), M && h.registerCommand({
|
|
155
|
-
id: "agent:new-chat",
|
|
156
|
-
title: "New Chat",
|
|
157
|
-
keywords: ["agent", "chat", "session", "new"],
|
|
158
|
-
pluginId: f,
|
|
159
|
-
run: M
|
|
160
|
-
}), () => {
|
|
161
|
-
h.unregisterByPluginId(a), h.unregisterByPluginId(f);
|
|
162
|
-
};
|
|
163
|
-
}, [
|
|
164
|
-
h,
|
|
165
|
-
n,
|
|
166
|
-
s,
|
|
167
|
-
r,
|
|
168
|
-
t,
|
|
169
|
-
e.navParams,
|
|
170
|
-
e.surfaceParams,
|
|
171
|
-
e.onOpenNav,
|
|
172
|
-
e.onOpenSurface,
|
|
173
|
-
e.onOpenSidebar,
|
|
174
|
-
y,
|
|
175
|
-
C,
|
|
176
|
-
S,
|
|
177
|
-
m,
|
|
178
|
-
u,
|
|
179
|
-
p,
|
|
180
|
-
M,
|
|
181
|
-
P,
|
|
182
|
-
v,
|
|
183
|
-
_,
|
|
184
|
-
W,
|
|
185
|
-
N
|
|
186
|
-
]), z(() => {
|
|
187
|
-
if (!R || !D || !A) return;
|
|
188
|
-
const a = {
|
|
189
|
-
surface: R,
|
|
190
|
-
isWorkbenchOpen: D,
|
|
191
|
-
openWorkbench: A,
|
|
192
|
-
openWorkbenchSources: V,
|
|
193
|
-
closeWorkbench: $
|
|
194
|
-
};
|
|
195
|
-
return ce.on(de.uiCommand, ({ command: f }) => {
|
|
196
|
-
le(f, a);
|
|
197
|
-
});
|
|
198
|
-
}, [R, D, A, V, $]), /* @__PURE__ */ l(
|
|
199
|
-
"div",
|
|
200
|
-
{
|
|
201
|
-
"data-boring-workspace": "",
|
|
202
|
-
"data-boring-workspace-part": "shell",
|
|
203
|
-
className: g("relative flex h-full min-h-0 w-full overflow-hidden bg-background", e.className),
|
|
204
|
-
children: [
|
|
205
|
-
/* @__PURE__ */ l(
|
|
206
|
-
"aside",
|
|
207
|
-
{
|
|
208
|
-
"data-boring-workspace-part": "session-drawer",
|
|
209
|
-
"data-boring-state": n ? "expanded" : "collapsed",
|
|
210
|
-
"aria-label": "Session browser",
|
|
211
|
-
"aria-hidden": !n,
|
|
212
|
-
className: g(
|
|
213
|
-
"relative h-full min-h-0 shrink-0 overflow-hidden bg-background",
|
|
214
|
-
"transition-[width,min-width,max-width] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
215
|
-
n && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
|
|
216
|
-
),
|
|
217
|
-
style: {
|
|
218
|
-
width: n ? I : 0,
|
|
219
|
-
minWidth: n ? I : 0,
|
|
220
|
-
maxWidth: n ? I : 0,
|
|
221
|
-
willChange: "width"
|
|
222
|
-
},
|
|
223
|
-
children: [
|
|
224
|
-
/* @__PURE__ */ o(
|
|
225
|
-
"div",
|
|
226
|
-
{
|
|
227
|
-
className: g(
|
|
228
|
-
"h-full min-h-0 overflow-hidden",
|
|
229
|
-
"transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
230
|
-
n ? "opacity-100" : "opacity-0"
|
|
231
|
-
),
|
|
232
|
-
children: /* @__PURE__ */ o(E, { id: c, params: e.navParams })
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
n ? /* @__PURE__ */ o(
|
|
236
|
-
T,
|
|
237
|
-
{
|
|
238
|
-
side: "drawer-right",
|
|
239
|
-
ariaLabel: "Resize sessions drawer",
|
|
240
|
-
onResize: (a) => w((f) => O(f + a, 200, 360))
|
|
241
|
-
}
|
|
242
|
-
) : null
|
|
243
|
-
]
|
|
244
|
-
}
|
|
245
|
-
),
|
|
246
|
-
/* @__PURE__ */ l(
|
|
247
|
-
"main",
|
|
248
|
-
{
|
|
249
|
-
"data-boring-workspace-part": "chat-stage",
|
|
250
|
-
"aria-label": "Chat stage",
|
|
251
|
-
className: "relative h-full min-h-0 min-w-0 flex-1 overflow-hidden bg-background",
|
|
252
|
-
children: [
|
|
253
|
-
/* @__PURE__ */ o(E, { id: s, params: e.centerParams }),
|
|
254
|
-
!n && e.onOpenNav ? /* @__PURE__ */ o(
|
|
255
|
-
Z,
|
|
256
|
-
{
|
|
257
|
-
side: "left",
|
|
258
|
-
icon: "sessions",
|
|
259
|
-
onClick: e.onOpenNav,
|
|
260
|
-
label: "Sessions",
|
|
261
|
-
hint: "⌘1"
|
|
262
|
-
}
|
|
263
|
-
) : null,
|
|
264
|
-
!t && e.onOpenSurface ? /* @__PURE__ */ o(
|
|
265
|
-
Z,
|
|
266
|
-
{
|
|
267
|
-
side: "right",
|
|
268
|
-
icon: "workbench",
|
|
269
|
-
onClick: e.onOpenSurface,
|
|
270
|
-
label: "Workbench",
|
|
271
|
-
hint: "⌘2",
|
|
272
|
-
bottomOffset: e.surfaceButtonBottomOffset
|
|
273
|
-
}
|
|
274
|
-
) : null
|
|
275
|
-
]
|
|
276
|
-
}
|
|
277
|
-
),
|
|
278
|
-
r ? /* @__PURE__ */ l(
|
|
279
|
-
"aside",
|
|
280
|
-
{
|
|
281
|
-
"data-boring-workspace-part": "workbench",
|
|
282
|
-
"data-boring-state": t ? "expanded" : "collapsed",
|
|
283
|
-
"aria-label": t ? "Surface" : void 0,
|
|
284
|
-
"aria-hidden": !t,
|
|
285
|
-
className: g(
|
|
286
|
-
"relative h-full min-h-0 shrink-0 overflow-hidden bg-background",
|
|
287
|
-
"transition-[width,min-width,max-width] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
288
|
-
t && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
|
|
289
|
-
),
|
|
290
|
-
style: {
|
|
291
|
-
width: t ? L : 0,
|
|
292
|
-
minWidth: t ? L : 0,
|
|
293
|
-
maxWidth: t ? L : 0,
|
|
294
|
-
willChange: "width"
|
|
295
|
-
},
|
|
296
|
-
children: [
|
|
297
|
-
/* @__PURE__ */ o(
|
|
298
|
-
"div",
|
|
299
|
-
{
|
|
300
|
-
className: g(
|
|
301
|
-
"h-full min-h-0 overflow-hidden",
|
|
302
|
-
"transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
303
|
-
t ? "opacity-100" : "opacity-0"
|
|
304
|
-
),
|
|
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 })
|
|
321
|
-
}
|
|
322
|
-
),
|
|
323
|
-
t ? /* @__PURE__ */ o(
|
|
324
|
-
T,
|
|
325
|
-
{
|
|
326
|
-
side: "surface-left",
|
|
327
|
-
ariaLabel: "Resize workbench",
|
|
328
|
-
onResize: (a) => Q((f) => O(f - a, 480, j))
|
|
329
|
-
}
|
|
330
|
-
) : null
|
|
331
|
-
]
|
|
332
|
-
}
|
|
333
|
-
) : null
|
|
334
|
-
]
|
|
335
|
-
}
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
function O(e, n, r) {
|
|
339
|
-
return Math.max(n, Math.min(r, e));
|
|
340
|
-
}
|
|
341
|
-
function q(e, n) {
|
|
342
|
-
const [r, t] = G(
|
|
343
|
-
() => e ? X(e, n) : n
|
|
344
|
-
);
|
|
345
|
-
z(() => {
|
|
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;
|
|
353
|
-
});
|
|
354
|
-
},
|
|
355
|
-
[e]
|
|
356
|
-
);
|
|
357
|
-
return [r, c];
|
|
358
|
-
}
|
|
359
|
-
function be() {
|
|
360
|
-
const [e, n] = G(() => typeof window < "u" ? window.innerWidth : 1200);
|
|
361
|
-
return z(() => {
|
|
362
|
-
const r = () => n(window.innerWidth);
|
|
363
|
-
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
364
|
-
}, []), e;
|
|
365
|
-
}
|
|
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);
|
|
373
|
-
}, [r]), d = b((i) => {
|
|
374
|
-
t.current !== null && (t.current = null, i.currentTarget.releasePointerCapture(i.pointerId), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
375
|
-
}, []);
|
|
376
|
-
return /* @__PURE__ */ o(
|
|
377
|
-
re,
|
|
378
|
-
{
|
|
379
|
-
"aria-label": n,
|
|
380
|
-
orientation: "vertical",
|
|
381
|
-
onResizeStart: c,
|
|
382
|
-
onPointerMove: s,
|
|
383
|
-
onPointerUp: d,
|
|
384
|
-
onPointerCancel: d,
|
|
385
|
-
className: g(
|
|
386
|
-
"absolute top-0 bottom-0 z-20 bg-transparent",
|
|
387
|
-
"transition-colors duration-200",
|
|
388
|
-
"hover:bg-border/70 hover:[transition-delay:150ms]",
|
|
389
|
-
"active:bg-muted-foreground/30",
|
|
390
|
-
e === "drawer-right" ? "right-0" : "left-0"
|
|
391
|
-
)
|
|
392
|
-
}
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
function x(e, n) {
|
|
396
|
-
const r = e == null ? void 0 : e[n];
|
|
397
|
-
return typeof r == "function" ? r : void 0;
|
|
398
|
-
}
|
|
399
|
-
function B(e, n) {
|
|
400
|
-
return x(e, n);
|
|
401
|
-
}
|
|
402
|
-
function F() {
|
|
403
|
-
if (typeof document > "u") return;
|
|
404
|
-
const e = document.querySelector(
|
|
405
|
-
'[data-boring-agent] textarea[name="message"], textarea[name="message"]'
|
|
406
|
-
);
|
|
407
|
-
e == null || e.focus();
|
|
408
|
-
}
|
|
409
|
-
function we() {
|
|
410
|
-
typeof window > "u" || window.requestAnimationFrame(() => {
|
|
411
|
-
F(), window.setTimeout(F, 320);
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
function E({ id: e, params: n }) {
|
|
415
|
-
const r = ue(), { debug: t } = he(), c = Y(
|
|
416
|
-
r.subscribe,
|
|
417
|
-
r.getSnapshot,
|
|
418
|
-
r.getSnapshot
|
|
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(
|
|
421
|
-
d,
|
|
422
|
-
{
|
|
423
|
-
params: { ...n, debug: t },
|
|
424
|
-
api: i,
|
|
425
|
-
containerApi: {}
|
|
426
|
-
}
|
|
427
|
-
) }) : null;
|
|
428
|
-
}
|
|
429
|
-
function pe(e) {
|
|
430
|
-
return {
|
|
431
|
-
id: e,
|
|
432
|
-
title: e,
|
|
433
|
-
setTitle: () => {
|
|
434
|
-
},
|
|
435
|
-
setActive: () => {
|
|
436
|
-
},
|
|
437
|
-
close: () => {
|
|
438
|
-
},
|
|
439
|
-
updateParameters: () => {
|
|
440
|
-
},
|
|
441
|
-
onDidParametersChange: () => ({ dispose() {
|
|
442
|
-
} }),
|
|
443
|
-
onDidActiveChange: () => ({ dispose() {
|
|
444
|
-
} }),
|
|
445
|
-
onDidDimensionsChange: () => ({ dispose() {
|
|
446
|
-
} }),
|
|
447
|
-
onDidLocationChange: () => ({ dispose() {
|
|
448
|
-
} }),
|
|
449
|
-
onDidTitleChange: () => ({ dispose() {
|
|
450
|
-
} }),
|
|
451
|
-
onWillFocus: () => ({ dispose() {
|
|
452
|
-
} }),
|
|
453
|
-
onDidFocus: () => ({ dispose() {
|
|
454
|
-
} }),
|
|
455
|
-
onDidBlur: () => ({ dispose() {
|
|
456
|
-
} }),
|
|
457
|
-
onWillVisibilityChange: () => ({ dispose() {
|
|
458
|
-
} }),
|
|
459
|
-
onDidVisibilityChange: () => ({ dispose() {
|
|
460
|
-
} }),
|
|
461
|
-
onDidConstraintsChange: () => ({ dispose() {
|
|
462
|
-
} })
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
function Z({
|
|
466
|
-
side: e,
|
|
467
|
-
icon: n,
|
|
468
|
-
onClick: r,
|
|
469
|
-
label: t,
|
|
470
|
-
hint: c,
|
|
471
|
-
bottomOffset: s
|
|
472
|
-
}) {
|
|
473
|
-
const d = e === "right" && s !== void 0;
|
|
474
|
-
return /* @__PURE__ */ o(
|
|
475
|
-
K,
|
|
476
|
-
{
|
|
477
|
-
type: "button",
|
|
478
|
-
variant: "ghost",
|
|
479
|
-
size: "icon-sm",
|
|
480
|
-
onClick: r,
|
|
481
|
-
"aria-label": t,
|
|
482
|
-
title: c ? `${t} (${c})` : t,
|
|
483
|
-
className: g(
|
|
484
|
-
"absolute z-30 h-9 w-9 gap-0.5 rounded-lg bg-background text-muted-foreground",
|
|
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)]",
|
|
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)]",
|
|
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)]",
|
|
489
|
-
"focus-visible:ring-ring/40"
|
|
490
|
-
),
|
|
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" }) })
|
|
496
|
-
}
|
|
497
|
-
);
|
|
498
|
-
}
|
|
499
|
-
function Oe({
|
|
500
|
-
appTitle: e = "Boring",
|
|
501
|
-
sessionTitle: n,
|
|
502
|
-
onCommandPalette: r,
|
|
503
|
-
onNewChat: t,
|
|
504
|
-
topBarLeft: c,
|
|
505
|
-
topBarRight: s,
|
|
506
|
-
className: d
|
|
507
|
-
}) {
|
|
508
|
-
const i = s ?? null;
|
|
509
|
-
return /* @__PURE__ */ l(
|
|
510
|
-
"header",
|
|
511
|
-
{
|
|
512
|
-
"data-boring-workspace-part": "topbar",
|
|
513
|
-
className: g(
|
|
514
|
-
"relative flex h-11 items-center justify-between gap-2 px-3",
|
|
515
|
-
"bg-background border-b border-border",
|
|
516
|
-
d
|
|
517
|
-
),
|
|
518
|
-
"aria-label": "App top bar",
|
|
519
|
-
children: [
|
|
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",
|
|
523
|
-
{
|
|
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()
|
|
527
|
-
}
|
|
528
|
-
),
|
|
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 })
|
|
534
|
-
] }) }),
|
|
535
|
-
/* @__PURE__ */ l(
|
|
536
|
-
oe,
|
|
537
|
-
{
|
|
538
|
-
type: "button",
|
|
539
|
-
variant: "ghost",
|
|
540
|
-
size: "sm",
|
|
541
|
-
onClick: r,
|
|
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",
|
|
543
|
-
"aria-label": "Search catalogs and commands",
|
|
544
|
-
title: "Command palette (⌘K)",
|
|
545
|
-
children: [
|
|
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" })
|
|
549
|
-
]
|
|
550
|
-
}
|
|
551
|
-
),
|
|
552
|
-
/* @__PURE__ */ l("div", { className: "flex flex-1 shrink-0 items-center justify-end gap-1", children: [
|
|
553
|
-
t && /* @__PURE__ */ o(
|
|
554
|
-
K,
|
|
555
|
-
{
|
|
556
|
-
type: "button",
|
|
557
|
-
variant: "ghost",
|
|
558
|
-
size: "icon-sm",
|
|
559
|
-
onClick: t,
|
|
560
|
-
"aria-label": "New chat",
|
|
561
|
-
title: "New chat",
|
|
562
|
-
children: /* @__PURE__ */ o(fe, { className: "h-4 w-4" })
|
|
563
|
-
}
|
|
564
|
-
),
|
|
565
|
-
i
|
|
566
|
-
] })
|
|
567
|
-
]
|
|
568
|
-
}
|
|
569
|
-
);
|
|
570
|
-
}
|
|
571
|
-
function Be({
|
|
572
|
-
title: e = "Loading workspace",
|
|
573
|
-
description: n = "Preparing the workspace context.",
|
|
574
|
-
status: r = "Loading",
|
|
575
|
-
fullscreen: t = !0,
|
|
576
|
-
className: c
|
|
577
|
-
}) {
|
|
578
|
-
return /* @__PURE__ */ o(
|
|
579
|
-
"section",
|
|
580
|
-
{
|
|
581
|
-
role: "status",
|
|
582
|
-
"aria-live": "polite",
|
|
583
|
-
"aria-busy": "true",
|
|
584
|
-
className: g(
|
|
585
|
-
"flex h-full w-full items-center justify-center bg-background px-6 text-foreground",
|
|
586
|
-
t ? "min-h-screen" : "min-h-[240px]",
|
|
587
|
-
c
|
|
588
|
-
),
|
|
589
|
-
children: /* @__PURE__ */ l("div", { className: "flex w-full max-w-sm flex-col items-center gap-5 text-center", children: [
|
|
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(
|
|
591
|
-
"span",
|
|
592
|
-
{
|
|
593
|
-
"aria-hidden": "true",
|
|
594
|
-
className: "h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent opacity-70"
|
|
595
|
-
}
|
|
596
|
-
) }),
|
|
597
|
-
/* @__PURE__ */ l("div", { className: "space-y-2", children: [
|
|
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
|
|
600
|
-
] }),
|
|
601
|
-
r ? /* @__PURE__ */ o("p", { className: "text-xs font-medium text-muted-foreground/80", children: r }) : null
|
|
602
|
-
] })
|
|
603
|
-
}
|
|
604
|
-
);
|
|
605
|
-
}
|
|
606
|
-
export {
|
|
607
|
-
Pe as C,
|
|
608
|
-
Oe as T,
|
|
609
|
-
Be as W,
|
|
610
|
-
Ne as b,
|
|
611
|
-
_e as r,
|
|
612
|
-
We as w
|
|
613
|
-
};
|