@hachej/boring-workspace 0.1.23 → 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-D8Rmj8Bo.js → FileTree-DjPzfDMq.js} +114 -104
- package/dist/{MarkdownEditor-DKC4gNT4.js → MarkdownEditor-BbSy0bLV.js} +9 -9
- package/dist/{WorkspaceLoadingState-hKrnYCL3.js → WorkspaceLoadingState-fccm3AQg.js} +167 -146
- package/dist/{WorkspaceProvider-Cn0sPgaB.js → WorkspaceProvider-BW4wzbpR.js} +2673 -2385
- 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 +73 -0
- 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
|
@@ -1,10 +1,10 @@
|
|
|
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
|
|
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
8
|
if (!r || typeof window > "u") return n;
|
|
9
9
|
try {
|
|
10
10
|
const t = window.localStorage.getItem(e);
|
|
@@ -14,25 +14,25 @@ function Se(e, n, r = !0) {
|
|
|
14
14
|
}
|
|
15
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
20
|
window.localStorage.setItem(e, n ? "1" : "0");
|
|
21
21
|
} catch {
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function X(e, n, r = !0) {
|
|
25
25
|
if (!r || typeof window > "u") return n;
|
|
26
26
|
try {
|
|
27
27
|
const t = window.localStorage.getItem(e);
|
|
28
28
|
if (t === null) return n;
|
|
29
|
-
const
|
|
30
|
-
return Number.isFinite(
|
|
29
|
+
const c = Number(t);
|
|
30
|
+
return Number.isFinite(c) ? c : n;
|
|
31
31
|
} catch {
|
|
32
32
|
}
|
|
33
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
38
|
window.localStorage.setItem(e, String(Math.round(n)));
|
|
@@ -44,11 +44,11 @@ function Ne(e = {}) {
|
|
|
44
44
|
nav: n = "session-list",
|
|
45
45
|
navParams: r,
|
|
46
46
|
center: t = "chat",
|
|
47
|
-
centerParams:
|
|
48
|
-
surface:
|
|
47
|
+
centerParams: c,
|
|
48
|
+
surface: s,
|
|
49
49
|
surfaceParams: d,
|
|
50
50
|
sidebar: i,
|
|
51
|
-
sidebarParams:
|
|
51
|
+
sidebarParams: k
|
|
52
52
|
} = e, w = [];
|
|
53
53
|
return n && w.push({
|
|
54
54
|
id: "nav",
|
|
@@ -62,108 +62,108 @@ function Ne(e = {}) {
|
|
|
62
62
|
id: "center",
|
|
63
63
|
position: "center",
|
|
64
64
|
panel: t,
|
|
65
|
-
params:
|
|
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 n = e.nav !== null, r = e.surface !== void 0, t = !!e.surface,
|
|
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
|
-
), [J, Q] =
|
|
90
|
+
), [J, Q] = q(
|
|
91
91
|
e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
|
|
92
92
|
680
|
|
93
|
-
),
|
|
94
|
-
var
|
|
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
95
|
if (n) {
|
|
96
|
-
|
|
96
|
+
m == null || m();
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
(
|
|
100
|
-
}, [
|
|
101
|
-
var
|
|
99
|
+
(a = e.onOpenNav) == null || a.call(e);
|
|
100
|
+
}, [m, n, e.onOpenNav]), W = b(() => {
|
|
101
|
+
var a;
|
|
102
102
|
if (t) {
|
|
103
|
-
|
|
103
|
+
u == null || u();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
(
|
|
107
|
-
}, [
|
|
108
|
-
var
|
|
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
|
-
n && (
|
|
116
|
-
}, [
|
|
117
|
-
return
|
|
118
|
-
shortcuts:
|
|
119
|
-
const
|
|
120
|
-
return y &&
|
|
121
|
-
}, [y, S, C,
|
|
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
126
|
title: n ? "Close Session History" : "Open Session History",
|
|
127
127
|
keywords: ["sessions", "history", "drawer", n ? "close" : "open"],
|
|
128
128
|
shortcut: "⌘1",
|
|
129
|
-
pluginId:
|
|
129
|
+
pluginId: a,
|
|
130
130
|
when: () => y,
|
|
131
131
|
run: _
|
|
132
|
-
}),
|
|
132
|
+
}), h.registerCommand({
|
|
133
133
|
id: "workspace:open-workbench",
|
|
134
134
|
title: t ? "Close Workbench" : "Open Workbench",
|
|
135
135
|
keywords: ["surface", "artifacts", "sources", "workbench", t ? "close" : "open"],
|
|
136
136
|
shortcut: "⌘2",
|
|
137
|
-
pluginId:
|
|
137
|
+
pluginId: a,
|
|
138
138
|
when: () => C,
|
|
139
|
-
run:
|
|
140
|
-
}),
|
|
139
|
+
run: W
|
|
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:
|
|
145
|
+
pluginId: a,
|
|
146
146
|
when: () => S,
|
|
147
|
-
run:
|
|
148
|
-
}),
|
|
147
|
+
run: N
|
|
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
|
-
|
|
164
|
+
h,
|
|
165
165
|
n,
|
|
166
|
-
|
|
166
|
+
s,
|
|
167
167
|
r,
|
|
168
168
|
t,
|
|
169
169
|
e.navParams,
|
|
@@ -174,27 +174,28 @@ function We(e) {
|
|
|
174
174
|
y,
|
|
175
175
|
C,
|
|
176
176
|
S,
|
|
177
|
-
h,
|
|
178
177
|
m,
|
|
178
|
+
u,
|
|
179
179
|
p,
|
|
180
180
|
M,
|
|
181
181
|
P,
|
|
182
182
|
v,
|
|
183
183
|
_,
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
W,
|
|
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": "",
|
|
@@ -220,7 +221,7 @@ function We(e) {
|
|
|
220
221
|
willChange: "width"
|
|
221
222
|
},
|
|
222
223
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ o(
|
|
224
225
|
"div",
|
|
225
226
|
{
|
|
226
227
|
className: g(
|
|
@@ -228,15 +229,15 @@ function We(e) {
|
|
|
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
|
-
n ? /* @__PURE__ */
|
|
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 We(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
|
-
!n && e.onOpenNav ? /* @__PURE__ */
|
|
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 We(e) {
|
|
|
260
261
|
hint: "⌘1"
|
|
261
262
|
}
|
|
262
263
|
) : null,
|
|
263
|
-
!t && e.onOpenSurface ? /* @__PURE__ */
|
|
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
|
]
|
|
@@ -292,7 +294,7 @@ function We(e) {
|
|
|
292
294
|
willChange: "width"
|
|
293
295
|
},
|
|
294
296
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ o(
|
|
296
298
|
"div",
|
|
297
299
|
{
|
|
298
300
|
className: g(
|
|
@@ -300,15 +302,30 @@ function We(e) {
|
|
|
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
|
-
t ? /* @__PURE__ */
|
|
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
|
]
|
|
@@ -321,48 +338,48 @@ function We(e) {
|
|
|
321
338
|
function O(e, n, r) {
|
|
322
339
|
return Math.max(n, Math.min(r, e));
|
|
323
340
|
}
|
|
324
|
-
function
|
|
325
|
-
const [r, t] =
|
|
326
|
-
() => e ?
|
|
341
|
+
function q(e, n) {
|
|
342
|
+
const [r, t] = G(
|
|
343
|
+
() => e ? X(e, n) : n
|
|
327
344
|
);
|
|
328
345
|
z(() => {
|
|
329
|
-
t(e ?
|
|
346
|
+
t(e ? X(e, n) : n);
|
|
330
347
|
}, [e, n]);
|
|
331
|
-
const
|
|
332
|
-
(
|
|
348
|
+
const c = b(
|
|
349
|
+
(s) => {
|
|
333
350
|
t((d) => {
|
|
334
|
-
const i = typeof
|
|
335
|
-
return e &&
|
|
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, n] =
|
|
359
|
+
function be() {
|
|
360
|
+
const [e, n] = G(() => typeof window < "u" ? window.innerWidth : 1200);
|
|
344
361
|
return z(() => {
|
|
345
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 t =
|
|
366
|
+
function T({ side: e, ariaLabel: n, onResize: r }) {
|
|
367
|
+
const t = ne(null), c = b((i) => {
|
|
351
368
|
i.preventDefault(), t.current = i.clientX, i.currentTarget.setPointerCapture(i.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
352
|
-
}, []),
|
|
369
|
+
}, []), s = b((i) => {
|
|
353
370
|
if (t.current === null) return;
|
|
354
|
-
const
|
|
355
|
-
t.current = i.clientX, r(
|
|
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
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: n, onResize: r }) {
|
|
|
375
392
|
}
|
|
376
393
|
);
|
|
377
394
|
}
|
|
378
|
-
function
|
|
395
|
+
function x(e, n) {
|
|
379
396
|
const r = e == null ? void 0 : e[n];
|
|
380
397
|
return typeof r == "function" ? r : void 0;
|
|
381
398
|
}
|
|
382
399
|
function B(e, n) {
|
|
383
|
-
return
|
|
400
|
+
return x(e, n);
|
|
384
401
|
}
|
|
385
402
|
function F() {
|
|
386
403
|
if (typeof document > "u") return;
|
|
@@ -389,18 +406,18 @@ 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
423
|
params: { ...n, debug: t },
|
|
@@ -409,7 +426,7 @@ function H({ id: e, params: n }) {
|
|
|
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,46 +462,50 @@ function we(e) {
|
|
|
445
462
|
} })
|
|
446
463
|
};
|
|
447
464
|
}
|
|
448
|
-
function
|
|
465
|
+
function Z({
|
|
449
466
|
side: e,
|
|
450
467
|
icon: n,
|
|
451
468
|
onClick: r,
|
|
452
469
|
label: t,
|
|
453
|
-
hint:
|
|
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
481
|
"aria-label": t,
|
|
463
|
-
title:
|
|
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
|
),
|
|
491
|
+
style: d ? { bottom: s } : void 0,
|
|
471
492
|
children: n === "sessions" ? /* @__PURE__ */ l("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
] }) : /* @__PURE__ */
|
|
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
501
|
sessionTitle: n,
|
|
481
502
|
onCommandPalette: r,
|
|
482
503
|
onNewChat: t,
|
|
483
|
-
topBarLeft:
|
|
484
|
-
topBarRight:
|
|
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
|
{
|
|
@@ -496,8 +517,8 @@ function Pe({
|
|
|
496
517
|
),
|
|
497
518
|
"aria-label": "App top bar",
|
|
498
519
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
/* @__PURE__ */
|
|
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(
|
|
501
522
|
"span",
|
|
502
523
|
{
|
|
503
524
|
"aria-hidden": "true",
|
|
@@ -505,14 +526,14 @@ function Pe({
|
|
|
505
526
|
children: ((e == null ? void 0 : e[0]) ?? "B").toUpperCase()
|
|
506
527
|
}
|
|
507
528
|
),
|
|
508
|
-
n ? /* @__PURE__ */ l(
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
] }) : /* @__PURE__ */
|
|
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 })
|
|
513
534
|
] }) }),
|
|
514
535
|
/* @__PURE__ */ l(
|
|
515
|
-
|
|
536
|
+
oe,
|
|
516
537
|
{
|
|
517
538
|
type: "button",
|
|
518
539
|
variant: "ghost",
|
|
@@ -522,15 +543,15 @@ function Pe({
|
|
|
522
543
|
"aria-label": "Search catalogs and commands",
|
|
523
544
|
title: "Command palette (⌘K)",
|
|
524
545
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
/* @__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" })
|
|
528
549
|
]
|
|
529
550
|
}
|
|
530
551
|
),
|
|
531
552
|
/* @__PURE__ */ l("div", { className: "flex flex-1 shrink-0 items-center justify-end gap-1", children: [
|
|
532
|
-
t && /* @__PURE__ */
|
|
533
|
-
|
|
553
|
+
t && /* @__PURE__ */ o(
|
|
554
|
+
K,
|
|
534
555
|
{
|
|
535
556
|
type: "button",
|
|
536
557
|
variant: "ghost",
|
|
@@ -538,7 +559,7 @@ function Pe({
|
|
|
538
559
|
onClick: t,
|
|
539
560
|
"aria-label": "New chat",
|
|
540
561
|
title: "New chat",
|
|
541
|
-
children: /* @__PURE__ */
|
|
562
|
+
children: /* @__PURE__ */ o(fe, { className: "h-4 w-4" })
|
|
542
563
|
}
|
|
543
564
|
),
|
|
544
565
|
i
|
|
@@ -547,14 +568,14 @@ function Pe({
|
|
|
547
568
|
}
|
|
548
569
|
);
|
|
549
570
|
}
|
|
550
|
-
function
|
|
571
|
+
function Be({
|
|
551
572
|
title: e = "Loading workspace",
|
|
552
573
|
description: n = "Preparing the workspace context.",
|
|
553
574
|
status: r = "Loading",
|
|
554
575
|
fullscreen: t = !0,
|
|
555
|
-
className:
|
|
576
|
+
className: c
|
|
556
577
|
}) {
|
|
557
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ o(
|
|
558
579
|
"section",
|
|
559
580
|
{
|
|
560
581
|
role: "status",
|
|
@@ -563,10 +584,10 @@ function Oe({
|
|
|
563
584
|
className: g(
|
|
564
585
|
"flex h-full w-full items-center justify-center bg-background px-6 text-foreground",
|
|
565
586
|
t ? "min-h-screen" : "min-h-[240px]",
|
|
566
|
-
|
|
587
|
+
c
|
|
567
588
|
),
|
|
568
589
|
children: /* @__PURE__ */ l("div", { className: "flex w-full max-w-sm flex-col items-center gap-5 text-center", children: [
|
|
569
|
-
/* @__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(
|
|
570
591
|
"span",
|
|
571
592
|
{
|
|
572
593
|
"aria-hidden": "true",
|
|
@@ -574,19 +595,19 @@ function Oe({
|
|
|
574
595
|
}
|
|
575
596
|
) }),
|
|
576
597
|
/* @__PURE__ */ l("div", { className: "space-y-2", children: [
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
n ? /* @__PURE__ */
|
|
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
|
|
579
600
|
] }),
|
|
580
|
-
r ? /* @__PURE__ */
|
|
601
|
+
r ? /* @__PURE__ */ o("p", { className: "text-xs font-medium text-muted-foreground/80", children: r }) : null
|
|
581
602
|
] })
|
|
582
603
|
}
|
|
583
604
|
);
|
|
584
605
|
}
|
|
585
606
|
export {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
607
|
+
Pe as C,
|
|
608
|
+
Oe as T,
|
|
609
|
+
Be as W,
|
|
589
610
|
Ne as b,
|
|
590
|
-
|
|
591
|
-
|
|
611
|
+
_e as r,
|
|
612
|
+
We as w
|
|
592
613
|
};
|