@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.
- package/dist/{FileTree-nBvBA8m7.js → FileTree-DjPzfDMq.js} +114 -104
- package/dist/{MarkdownEditor-CeigBQee.js → MarkdownEditor-BbSy0bLV.js} +9 -9
- package/dist/{WorkspaceLoadingState-DuoIpOxl.js → WorkspaceLoadingState-fccm3AQg.js} +238 -218
- package/dist/WorkspaceProvider-BW4wzbpR.js +6264 -0
- package/dist/app-front.d.ts +114 -2
- package/dist/app-front.js +744 -323
- package/dist/app-server.d.ts +3 -3
- package/dist/app-server.js +85 -21
- package/dist/{createInMemoryBridge-CYNW1h_o.d.ts → createInMemoryBridge-DLckqafe.d.ts} +1 -1
- package/dist/events.d.ts +3 -0
- package/dist/{manifest-CyNNdfYz.d.ts → manifest-C2vVgH_e.d.ts} +2 -0
- package/dist/plugin.d.ts +8 -3
- package/dist/plugin.js +3 -2
- package/dist/server.d.ts +11 -4
- package/dist/server.js +37 -18
- package/dist/shared.d.ts +2 -2
- package/dist/{surface-COYagY2m.d.ts → surface-CEEkd81D.d.ts} +1 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +409 -404
- package/dist/{ui-bridge-CT18yqwN.d.ts → ui-bridge-Bdgl2hR8.d.ts} +2 -0
- package/dist/workspace.css +151 -42
- package/dist/workspace.d.ts +228 -6
- package/dist/workspace.js +188 -179
- package/docs/INTERFACES.md +6 -0
- package/docs/plans/FULL_PAGE_PANEL_ROUTE_SPEC.md +633 -0
- package/package.json +6 -6
- package/dist/WorkspaceProvider-DihXY2wk.js +0 -5971
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { useCallback as b, useMemo as
|
|
3
|
-
import {
|
|
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 {
|
|
6
|
-
import { Search as
|
|
7
|
-
function _e(e,
|
|
8
|
-
if (!r || typeof window > "u") return
|
|
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
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
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
|
|
15
|
+
return n;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function We(e, n, r = !0) {
|
|
18
18
|
if (!(!r || typeof window > "u"))
|
|
19
19
|
try {
|
|
20
|
-
window.localStorage.setItem(e,
|
|
20
|
+
window.localStorage.setItem(e, n ? "1" : "0");
|
|
21
21
|
} catch {
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
if (!r || typeof window > "u") return
|
|
24
|
+
function X(e, n, r = !0) {
|
|
25
|
+
if (!r || typeof window > "u") return n;
|
|
26
26
|
try {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
30
|
-
return Number.isFinite(
|
|
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
|
|
33
|
+
return n;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
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(
|
|
38
|
+
window.localStorage.setItem(e, String(Math.round(n)));
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Ne(e = {}) {
|
|
43
43
|
const {
|
|
44
|
-
nav:
|
|
44
|
+
nav: n = "session-list",
|
|
45
45
|
navParams: r,
|
|
46
|
-
center:
|
|
47
|
-
centerParams:
|
|
48
|
-
surface:
|
|
46
|
+
center: t = "chat",
|
|
47
|
+
centerParams: c,
|
|
48
|
+
surface: s,
|
|
49
49
|
surfaceParams: d,
|
|
50
50
|
sidebar: i,
|
|
51
|
-
sidebarParams:
|
|
51
|
+
sidebarParams: k
|
|
52
52
|
} = e, w = [];
|
|
53
|
-
return
|
|
53
|
+
return n && w.push({
|
|
54
54
|
id: "nav",
|
|
55
55
|
position: "left",
|
|
56
|
-
panel:
|
|
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:
|
|
65
|
-
params:
|
|
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:
|
|
71
|
+
params: k,
|
|
72
72
|
hideHeader: !0,
|
|
73
73
|
collapsible: !0,
|
|
74
74
|
collapsedWidth: 40,
|
|
75
75
|
constraints: { minWidth: 200, maxWidthViewportRatio: 0.5 }
|
|
76
|
-
}),
|
|
76
|
+
}), s && w.push({
|
|
77
77
|
id: "surface",
|
|
78
78
|
position: "right",
|
|
79
|
-
panel:
|
|
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
|
|
87
|
-
const
|
|
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
|
-
), [
|
|
90
|
+
), [J, Q] = q(
|
|
91
91
|
e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
|
|
92
92
|
680
|
|
93
|
-
),
|
|
94
|
-
var
|
|
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
|
-
(
|
|
107
|
-
}, [m, e.
|
|
108
|
-
var
|
|
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
|
-
(
|
|
113
|
+
(a = e.onOpenSidebar) == null || a.call(e);
|
|
114
114
|
}, [p, e.onOpenSidebar, v]), P = b(() => {
|
|
115
|
-
|
|
116
|
-
}, [
|
|
117
|
-
return
|
|
118
|
-
shortcuts:
|
|
119
|
-
const
|
|
120
|
-
return
|
|
121
|
-
}, [
|
|
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
|
|
124
|
-
return
|
|
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:
|
|
127
|
-
keywords: ["sessions", "history", "drawer",
|
|
126
|
+
title: n ? "Close Session History" : "Open Session History",
|
|
127
|
+
keywords: ["sessions", "history", "drawer", n ? "close" : "open"],
|
|
128
128
|
shortcut: "⌘1",
|
|
129
|
-
pluginId:
|
|
130
|
-
when: () =>
|
|
131
|
-
run:
|
|
132
|
-
}),
|
|
129
|
+
pluginId: a,
|
|
130
|
+
when: () => y,
|
|
131
|
+
run: _
|
|
132
|
+
}), h.registerCommand({
|
|
133
133
|
id: "workspace:open-workbench",
|
|
134
|
-
title:
|
|
135
|
-
keywords: ["surface", "artifacts", "sources", "workbench",
|
|
134
|
+
title: t ? "Close Workbench" : "Open Workbench",
|
|
135
|
+
keywords: ["surface", "artifacts", "sources", "workbench", t ? "close" : "open"],
|
|
136
136
|
shortcut: "⌘2",
|
|
137
|
-
pluginId:
|
|
137
|
+
pluginId: a,
|
|
138
138
|
when: () => C,
|
|
139
139
|
run: W
|
|
140
|
-
}),
|
|
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:
|
|
146
|
-
when: () =>
|
|
145
|
+
pluginId: a,
|
|
146
|
+
when: () => S,
|
|
147
147
|
run: N
|
|
148
|
-
}),
|
|
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 &&
|
|
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
|
-
|
|
161
|
+
h.unregisterByPluginId(a), h.unregisterByPluginId(f);
|
|
162
162
|
};
|
|
163
163
|
}, [
|
|
164
|
-
|
|
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
|
-
|
|
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
|
-
|
|
183
|
+
_,
|
|
184
184
|
W,
|
|
185
185
|
N
|
|
186
186
|
]), z(() => {
|
|
187
187
|
if (!R || !D || !A) return;
|
|
188
|
-
const
|
|
188
|
+
const a = {
|
|
189
189
|
surface: R,
|
|
190
190
|
isWorkbenchOpen: D,
|
|
191
191
|
openWorkbench: A,
|
|
192
|
-
|
|
192
|
+
openWorkbenchSources: V,
|
|
193
|
+
closeWorkbench: $
|
|
193
194
|
};
|
|
194
|
-
return
|
|
195
|
-
|
|
195
|
+
return ce.on(de.uiCommand, ({ command: f }) => {
|
|
196
|
+
le(f, a);
|
|
196
197
|
});
|
|
197
|
-
}, [R, D, A,
|
|
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":
|
|
209
|
+
"data-boring-state": n ? "expanded" : "collapsed",
|
|
209
210
|
"aria-label": "Session browser",
|
|
210
|
-
"aria-hidden": !
|
|
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
|
-
|
|
215
|
+
n && "border-r border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
|
|
215
216
|
),
|
|
216
217
|
style: {
|
|
217
|
-
width:
|
|
218
|
-
minWidth:
|
|
219
|
-
maxWidth:
|
|
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__ */
|
|
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
|
-
|
|
230
|
+
n ? "opacity-100" : "opacity-0"
|
|
230
231
|
),
|
|
231
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ o(E, { id: c, params: e.navParams })
|
|
232
233
|
}
|
|
233
234
|
),
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
n ? /* @__PURE__ */ o(
|
|
236
|
+
T,
|
|
236
237
|
{
|
|
237
238
|
side: "drawer-right",
|
|
238
239
|
ariaLabel: "Resize sessions drawer",
|
|
239
|
-
onResize: (
|
|
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__ */
|
|
253
|
-
!
|
|
254
|
-
|
|
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
|
-
!
|
|
264
|
-
|
|
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":
|
|
281
|
-
"aria-label":
|
|
282
|
-
"aria-hidden": !
|
|
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
|
-
|
|
288
|
+
t && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
|
|
287
289
|
),
|
|
288
290
|
style: {
|
|
289
|
-
width:
|
|
290
|
-
minWidth:
|
|
291
|
-
maxWidth:
|
|
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__ */
|
|
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
|
-
|
|
303
|
+
t ? "opacity-100" : "opacity-0"
|
|
302
304
|
),
|
|
303
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
307
|
-
|
|
323
|
+
t ? /* @__PURE__ */ o(
|
|
324
|
+
T,
|
|
308
325
|
{
|
|
309
326
|
side: "surface-left",
|
|
310
327
|
ariaLabel: "Resize workbench",
|
|
311
|
-
onResize: (
|
|
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,
|
|
322
|
-
return Math.max(
|
|
338
|
+
function O(e, n, r) {
|
|
339
|
+
return Math.max(n, Math.min(r, e));
|
|
323
340
|
}
|
|
324
|
-
function
|
|
325
|
-
const [r,
|
|
326
|
-
() => e ?
|
|
341
|
+
function q(e, n) {
|
|
342
|
+
const [r, t] = G(
|
|
343
|
+
() => e ? X(e, n) : n
|
|
327
344
|
);
|
|
328
345
|
z(() => {
|
|
329
|
-
|
|
330
|
-
}, [e,
|
|
331
|
-
const
|
|
332
|
-
(
|
|
333
|
-
|
|
334
|
-
const i = typeof
|
|
335
|
-
return e &&
|
|
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,
|
|
357
|
+
return [r, c];
|
|
341
358
|
}
|
|
342
|
-
function
|
|
343
|
-
const [e,
|
|
359
|
+
function be() {
|
|
360
|
+
const [e, n] = G(() => typeof window < "u" ? window.innerWidth : 1200);
|
|
344
361
|
return z(() => {
|
|
345
|
-
const r = () =>
|
|
362
|
+
const r = () => n(window.innerWidth);
|
|
346
363
|
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
347
364
|
}, []), e;
|
|
348
365
|
}
|
|
349
|
-
function
|
|
350
|
-
const
|
|
351
|
-
i.preventDefault(),
|
|
352
|
-
}, []),
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
|
|
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
|
-
|
|
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__ */
|
|
360
|
-
|
|
376
|
+
return /* @__PURE__ */ o(
|
|
377
|
+
re,
|
|
361
378
|
{
|
|
362
|
-
"aria-label":
|
|
379
|
+
"aria-label": n,
|
|
363
380
|
orientation: "vertical",
|
|
364
|
-
onResizeStart:
|
|
365
|
-
onPointerMove:
|
|
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
|
|
379
|
-
const r = e == null ? void 0 : e[
|
|
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,
|
|
383
|
-
return
|
|
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
|
|
409
|
+
function we() {
|
|
393
410
|
typeof window > "u" || window.requestAnimationFrame(() => {
|
|
394
411
|
F(), window.setTimeout(F, 320);
|
|
395
412
|
});
|
|
396
413
|
}
|
|
397
|
-
function
|
|
398
|
-
const r =
|
|
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 =
|
|
403
|
-
return d ? /* @__PURE__ */
|
|
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: { ...
|
|
423
|
+
params: { ...n, debug: t },
|
|
407
424
|
api: i,
|
|
408
425
|
containerApi: {}
|
|
409
426
|
}
|
|
410
427
|
) }) : null;
|
|
411
428
|
}
|
|
412
|
-
function
|
|
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
|
|
465
|
+
function Z({
|
|
449
466
|
side: e,
|
|
450
|
-
icon:
|
|
467
|
+
icon: n,
|
|
451
468
|
onClick: r,
|
|
452
|
-
label:
|
|
453
|
-
hint:
|
|
469
|
+
label: t,
|
|
470
|
+
hint: c,
|
|
471
|
+
bottomOffset: s
|
|
454
472
|
}) {
|
|
455
|
-
|
|
456
|
-
|
|
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":
|
|
463
|
-
title:
|
|
481
|
+
"aria-label": t,
|
|
482
|
+
title: c ? `${t} (${c})` : t,
|
|
464
483
|
className: g(
|
|
465
|
-
"absolute
|
|
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
|
|
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
|
-
|
|
472
|
-
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
|
|
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
|
|
499
|
+
function Oe({
|
|
479
500
|
appTitle: e = "Boring",
|
|
480
|
-
sessionTitle:
|
|
501
|
+
sessionTitle: n,
|
|
481
502
|
onCommandPalette: r,
|
|
482
|
-
onNewChat:
|
|
483
|
-
topBarLeft:
|
|
484
|
-
topBarRight:
|
|
503
|
+
onNewChat: t,
|
|
504
|
+
topBarLeft: c,
|
|
505
|
+
topBarRight: s,
|
|
485
506
|
className: d
|
|
486
507
|
}) {
|
|
487
|
-
const i =
|
|
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-
|
|
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__ */
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
"
|
|
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
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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__ */
|
|
510
|
-
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
536
|
+
oe,
|
|
517
537
|
{
|
|
518
538
|
type: "button",
|
|
519
539
|
variant: "ghost",
|
|
520
540
|
size: "sm",
|
|
521
541
|
onClick: r,
|
|
522
|
-
className: "group h-
|
|
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__ */
|
|
527
|
-
/* @__PURE__ */
|
|
528
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
534
|
-
|
|
553
|
+
t && /* @__PURE__ */ o(
|
|
554
|
+
K,
|
|
535
555
|
{
|
|
536
556
|
type: "button",
|
|
537
557
|
variant: "ghost",
|
|
538
558
|
size: "icon-sm",
|
|
539
|
-
onClick:
|
|
559
|
+
onClick: t,
|
|
540
560
|
"aria-label": "New chat",
|
|
541
561
|
title: "New chat",
|
|
542
|
-
children: /* @__PURE__ */
|
|
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
|
|
571
|
+
function Be({
|
|
552
572
|
title: e = "Loading workspace",
|
|
553
|
-
description:
|
|
573
|
+
description: n = "Preparing the workspace context.",
|
|
554
574
|
status: r = "Loading",
|
|
555
|
-
fullscreen:
|
|
556
|
-
className:
|
|
575
|
+
fullscreen: t = !0,
|
|
576
|
+
className: c
|
|
557
577
|
}) {
|
|
558
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
567
|
-
|
|
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__ */
|
|
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__ */
|
|
579
|
-
|
|
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__ */
|
|
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
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
607
|
+
Pe as C,
|
|
608
|
+
Oe as T,
|
|
609
|
+
Be as W,
|
|
610
|
+
Ne as b,
|
|
591
611
|
_e as r,
|
|
592
|
-
|
|
612
|
+
We as w
|
|
593
613
|
};
|