@hachej/boring-workspace 0.1.53 → 0.1.55
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-CfJoRiTm.js → FileTree-DGonRKiT.js} +17 -17
- package/dist/{MarkdownEditor-DrPDGy9F.js → MarkdownEditor-CwglOF-8.js} +1 -1
- package/dist/{WorkspaceLoadingState-Bqsn2JEc.js → WorkspaceLoadingState-B2Ctp-b2.js} +249 -225
- package/dist/{WorkspaceProvider-CrOT4ab7.js → WorkspaceProvider-DF90RUdU.js} +3275 -3159
- package/dist/app-front.d.ts +20 -0
- package/dist/app-front.js +539 -527
- package/dist/app-server.d.ts +39 -8
- package/dist/app-server.js +1248 -22
- package/dist/bridge-client.d.ts +68 -0
- package/dist/bridge-client.js +370 -0
- package/dist/plugin.d.ts +3 -1
- package/dist/runtimeEnv-XVFZ1OkV.d.ts +353 -0
- package/dist/server.d.ts +236 -8
- package/dist/server.js +1349 -25
- package/dist/shared.d.ts +2 -1
- package/dist/shared.js +30 -0
- package/dist/testing.js +1 -1
- package/dist/{ui-bridge-LeBuZqfA.d.ts → ui-bridge-BbuUZ5iC.d.ts} +6 -1
- package/dist/workspace-bridge-rpc-A98RA5o6.d.ts +124 -0
- package/dist/workspace.css +35 -0
- package/dist/workspace.d.ts +68 -2
- package/dist/workspace.js +196 -185
- package/docs/PLUGIN_SYSTEM.md +57 -0
- package/package.json +8 -4
- package/dist/createInMemoryBridge-siFWq_R_.d.ts +0 -198
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as h, jsx as a, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { IconButton as
|
|
4
|
-
import { ChevronLeft as
|
|
1
|
+
import { jsxs as h, jsx as a, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import { useState as X, useMemo as W, useCallback as v, useEffect as y, useRef as J, useSyncExternalStore as xe, Suspense as ke } from "react";
|
|
3
|
+
import { IconButton as V, LoadingState as Ce, ResizeHandle as ye, Button as Se, Kbd as Pe } from "@hachej/boring-ui-kit";
|
|
4
|
+
import { ChevronLeft as Ne, MessageSquare as _e, Search as We, Plus as Ie } from "lucide-react";
|
|
5
5
|
import { c as m } from "./utils-B6yFEsav.js";
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
if (!
|
|
6
|
+
import { av as Oe, aC as Be, ac as ze, an as Re, Q as Ae, aF as ue, aR as De, ah as Le, aW as Me, aX as ee, u as Ee, ay as Ke } from "./WorkspaceProvider-DF90RUdU.js";
|
|
7
|
+
function Ze(e, t, o = !0) {
|
|
8
|
+
if (!o || typeof window > "u") return t;
|
|
9
9
|
try {
|
|
10
10
|
const n = window.localStorage.getItem(e);
|
|
11
11
|
if (n === "1") return !0;
|
|
@@ -14,15 +14,15 @@ function Ue(e, t, r = !0) {
|
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
if (!(!
|
|
17
|
+
function Ge(e, t, o = !0) {
|
|
18
|
+
if (!(!o || 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 he(e, t, o = !0) {
|
|
25
|
+
if (!o || typeof window > "u") return t;
|
|
26
26
|
try {
|
|
27
27
|
const n = window.localStorage.getItem(e);
|
|
28
28
|
if (n === null) return t;
|
|
@@ -32,197 +32,211 @@ function le(e, t, r = !0) {
|
|
|
32
32
|
}
|
|
33
33
|
return t;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
if (!(!
|
|
35
|
+
function Fe(e, t, o = !0) {
|
|
36
|
+
if (!(!o || typeof window > "u"))
|
|
37
37
|
try {
|
|
38
38
|
window.localStorage.setItem(e, String(Math.round(t)));
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Je(e = {}) {
|
|
43
43
|
const {
|
|
44
44
|
nav: t = "session-list",
|
|
45
|
-
navParams:
|
|
45
|
+
navParams: o,
|
|
46
46
|
center: n = "chat",
|
|
47
47
|
centerParams: d,
|
|
48
48
|
surface: i,
|
|
49
|
-
surfaceParams:
|
|
49
|
+
surfaceParams: u,
|
|
50
50
|
sidebar: s,
|
|
51
|
-
sidebarParams:
|
|
52
|
-
} = e,
|
|
53
|
-
return t &&
|
|
51
|
+
sidebarParams: x
|
|
52
|
+
} = e, p = [];
|
|
53
|
+
return t && p.push({
|
|
54
54
|
id: "nav",
|
|
55
55
|
position: "left",
|
|
56
56
|
panel: t,
|
|
57
|
-
params:
|
|
57
|
+
params: o,
|
|
58
58
|
locked: !0,
|
|
59
59
|
hideHeader: !0,
|
|
60
60
|
constraints: { minWidth: 60, maxWidth: 60 }
|
|
61
|
-
}),
|
|
61
|
+
}), p.push({
|
|
62
62
|
id: "center",
|
|
63
63
|
position: "center",
|
|
64
64
|
panel: n,
|
|
65
65
|
params: d,
|
|
66
66
|
hideHeader: !0
|
|
67
|
-
}), s &&
|
|
67
|
+
}), s && p.push({
|
|
68
68
|
id: "sidebar",
|
|
69
69
|
position: "left",
|
|
70
70
|
panel: s,
|
|
71
|
-
params:
|
|
71
|
+
params: x,
|
|
72
72
|
hideHeader: !0,
|
|
73
73
|
collapsible: !0,
|
|
74
74
|
collapsedWidth: 40,
|
|
75
75
|
constraints: { minWidth: 200, maxWidthViewportRatio: 0.5 }
|
|
76
|
-
}), i &&
|
|
76
|
+
}), i && p.push({
|
|
77
77
|
id: "surface",
|
|
78
78
|
position: "right",
|
|
79
79
|
panel: i,
|
|
80
|
-
params:
|
|
80
|
+
params: u,
|
|
81
81
|
hideHeader: !0,
|
|
82
82
|
dynamic: !0,
|
|
83
83
|
placeholder: "empty"
|
|
84
|
-
}), { version: "2.0", groups:
|
|
84
|
+
}), { version: "2.0", groups: p };
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
var
|
|
88
|
-
const t = e.nav !== null,
|
|
86
|
+
function et(e) {
|
|
87
|
+
var ce, de;
|
|
88
|
+
const t = e.nav !== null, o = e.surface !== void 0, n = !!e.surface, d = e.nav || "session-list", i = e.center ?? "chat", u = e.surface || "artifact-surface", s = He(), [x, p] = fe(
|
|
89
89
|
e.storageKey ? `${e.storageKey}:drawerWidth` : void 0,
|
|
90
90
|
260
|
|
91
|
-
), [
|
|
91
|
+
), [be, we] = fe(
|
|
92
92
|
e.storageKey ? `${e.storageKey}:surfaceWidth` : void 0,
|
|
93
93
|
680
|
|
94
|
-
), [c, g] =
|
|
94
|
+
), [c, g] = je(
|
|
95
95
|
e.storageKey ? `${e.storageKey}:chatCollapsed` : void 0,
|
|
96
96
|
!1
|
|
97
|
-
), [
|
|
98
|
-
|
|
97
|
+
), [ve, I] = X(!1), { blockers: O } = Oe(), k = e.activeChatPaneId ?? ((ce = e.centerParams) == null ? void 0 : ce.sessionId), $ = W(
|
|
98
|
+
() => O.filter((r) => !r.sessionId || !k || r.sessionId === k),
|
|
99
|
+
[k, O]
|
|
100
|
+
), pe = W(
|
|
101
|
+
() => O.some((r) => !!r.sessionId && !!Be(r)),
|
|
102
|
+
[O]
|
|
103
|
+
), b = ze(), q = K(x, 200, 360), ne = Math.max(480, Math.floor(s * 0.72)), U = K(be, 480, ne), T = N(e.centerParams, "getSurface"), Q = N(e.centerParams, "isWorkbenchOpen"), Y = N(e.centerParams, "openWorkbench"), ae = N(e.centerParams, "openWorkbenchSources"), re = N(e.centerParams, "closeWorkbench"), oe = Ve(e.centerParams, "surfaceDispatch"), w = F(e.navParams, "onClose"), f = F(e.surfaceParams, "onClose"), S = F(e.sidebarParams, "onClose"), Z = F(e.navParams, "onCreate"), _ = ((de = e.chatPanes) == null ? void 0 : de.filter((r) => r.id.length > 0)) ?? [], G = _.length > 0, P = !!e.sidebar, B = t ? !!w : !!e.onOpenNav, z = n ? !!f : !!e.onOpenSurface, R = P ? !!S : !!e.onOpenSidebar, A = v(() => {
|
|
104
|
+
var r;
|
|
99
105
|
if (t) {
|
|
100
106
|
w == null || w();
|
|
101
107
|
return;
|
|
102
108
|
}
|
|
103
|
-
(
|
|
104
|
-
}, [w, t, e.onOpenNav]),
|
|
105
|
-
var
|
|
109
|
+
(r = e.onOpenNav) == null || r.call(e);
|
|
110
|
+
}, [w, t, e.onOpenNav]), D = v(() => {
|
|
111
|
+
var r;
|
|
106
112
|
if (n) {
|
|
107
113
|
f == null || f();
|
|
108
114
|
return;
|
|
109
115
|
}
|
|
110
|
-
(
|
|
111
|
-
}, [f, e.onOpenSurface, n]),
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
114
|
-
|
|
116
|
+
(r = e.onOpenSurface) == null || r.call(e);
|
|
117
|
+
}, [f, e.onOpenSurface, n]), L = v(() => {
|
|
118
|
+
var r;
|
|
119
|
+
if (P) {
|
|
120
|
+
S == null || S();
|
|
115
121
|
return;
|
|
116
122
|
}
|
|
117
|
-
(
|
|
118
|
-
}, [
|
|
119
|
-
c && g(!1), t && (w == null || w()), n && (f == null || f()),
|
|
120
|
-
}, [c, w, f, t, g, n]),
|
|
121
|
-
g((
|
|
122
|
-
var
|
|
123
|
-
const
|
|
124
|
-
return
|
|
125
|
-
}),
|
|
123
|
+
(r = e.onOpenSidebar) == null || r.call(e);
|
|
124
|
+
}, [S, e.onOpenSidebar, P]), M = v(() => {
|
|
125
|
+
c && g(!1), t && (w == null || w()), n && (f == null || f()), te(), ge();
|
|
126
|
+
}, [c, w, f, t, g, n]), E = v(() => {
|
|
127
|
+
g((r) => {
|
|
128
|
+
var C;
|
|
129
|
+
const l = !r;
|
|
130
|
+
return l && !n && ((C = e.onOpenSurface) == null || C.call(e)), l;
|
|
131
|
+
}), I(!1);
|
|
126
132
|
}, [g, n, e.onOpenSurface]);
|
|
127
|
-
|
|
128
|
-
shortcuts:
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
}, [
|
|
132
|
-
}),
|
|
133
|
-
const
|
|
134
|
-
return b.unregisterByPluginId(
|
|
133
|
+
Re({
|
|
134
|
+
shortcuts: W(() => {
|
|
135
|
+
const r = [];
|
|
136
|
+
return B && r.push({ key: "1", mod: !0, handler: A }), z && r.push({ key: "2", mod: !0, handler: D }), R && r.push({ key: "3", mod: !0, allowInEditable: !0, handler: L }), i === "chat" && (r.push({ key: "Escape", allowInEditable: !0, handler: M }), r.push({ key: "\\", mod: !0, allowInEditable: !0, handler: E })), r;
|
|
137
|
+
}, [B, R, z, i, M, E, A, L, D])
|
|
138
|
+
}), y(() => {
|
|
139
|
+
const r = "workspace:chat-layout", l = "agent:chat-layout";
|
|
140
|
+
return b.unregisterByPluginId(r), b.unregisterByPluginId(l), b.registerCommand({
|
|
135
141
|
id: "workspace:open-session-history",
|
|
136
142
|
title: t ? "Close Session History" : "Open Session History",
|
|
137
143
|
keywords: ["sessions", "history", "drawer", t ? "close" : "open"],
|
|
138
144
|
shortcut: "⌘1",
|
|
139
|
-
pluginId:
|
|
140
|
-
when: () =>
|
|
141
|
-
run:
|
|
145
|
+
pluginId: r,
|
|
146
|
+
when: () => B,
|
|
147
|
+
run: A
|
|
142
148
|
}), b.registerCommand({
|
|
143
149
|
id: "workspace:open-workbench",
|
|
144
150
|
title: n ? "Close Workbench" : "Open Workbench",
|
|
145
151
|
keywords: ["surface", "artifacts", "sources", "workbench", n ? "close" : "open"],
|
|
146
152
|
shortcut: "⌘2",
|
|
147
|
-
pluginId:
|
|
148
|
-
when: () =>
|
|
149
|
-
run:
|
|
153
|
+
pluginId: r,
|
|
154
|
+
when: () => z,
|
|
155
|
+
run: D
|
|
150
156
|
}), b.registerCommand({
|
|
151
157
|
id: "workspace:toggle-workbench-left-panel",
|
|
152
|
-
title:
|
|
153
|
-
keywords: ["left", "sidebar", "tabs", "workbench",
|
|
158
|
+
title: P ? "Close Workbench Left Panel" : "Open Workbench Left Panel",
|
|
159
|
+
keywords: ["left", "sidebar", "tabs", "workbench", P ? "close" : "open"],
|
|
154
160
|
shortcut: "⌘3",
|
|
155
|
-
pluginId:
|
|
156
|
-
when: () =>
|
|
157
|
-
run:
|
|
161
|
+
pluginId: r,
|
|
162
|
+
when: () => R,
|
|
163
|
+
run: L
|
|
158
164
|
}), i === "chat" && b.registerCommand({
|
|
159
165
|
id: "agent:focus-chat",
|
|
160
166
|
title: "Focus Chat",
|
|
161
167
|
keywords: ["agent", "chat", "prompt", "composer", "input", "focus"],
|
|
162
|
-
pluginId:
|
|
163
|
-
run:
|
|
164
|
-
}),
|
|
168
|
+
pluginId: l,
|
|
169
|
+
run: M
|
|
170
|
+
}), Z && b.registerCommand({
|
|
165
171
|
id: "agent:new-chat",
|
|
166
172
|
title: "New Chat",
|
|
167
173
|
keywords: ["agent", "chat", "session", "new"],
|
|
168
|
-
pluginId:
|
|
169
|
-
run:
|
|
174
|
+
pluginId: l,
|
|
175
|
+
run: Z
|
|
170
176
|
}), () => {
|
|
171
|
-
b.unregisterByPluginId(
|
|
177
|
+
b.unregisterByPluginId(r), b.unregisterByPluginId(l);
|
|
172
178
|
};
|
|
173
179
|
}, [
|
|
174
180
|
b,
|
|
175
181
|
t,
|
|
176
182
|
i,
|
|
177
|
-
|
|
183
|
+
o,
|
|
178
184
|
n,
|
|
179
185
|
e.navParams,
|
|
180
186
|
e.surfaceParams,
|
|
181
187
|
e.onOpenNav,
|
|
182
188
|
e.onOpenSurface,
|
|
183
189
|
e.onOpenSidebar,
|
|
184
|
-
I,
|
|
185
|
-
O,
|
|
186
190
|
B,
|
|
191
|
+
z,
|
|
192
|
+
R,
|
|
187
193
|
w,
|
|
188
194
|
f,
|
|
189
|
-
|
|
190
|
-
|
|
195
|
+
S,
|
|
196
|
+
Z,
|
|
197
|
+
M,
|
|
198
|
+
P,
|
|
191
199
|
A,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
200
|
+
D,
|
|
201
|
+
L
|
|
202
|
+
]), y(() => {
|
|
203
|
+
const r = oe ?? (T && Q && Y ? {
|
|
204
|
+
surface: T,
|
|
205
|
+
isWorkbenchOpen: Q,
|
|
206
|
+
openWorkbench: Y,
|
|
207
|
+
openWorkbenchSources: ae,
|
|
208
|
+
closeWorkbench: re,
|
|
209
|
+
// Fallback dispatch has no host-owned open-session set. Treat
|
|
210
|
+
// session-gated requests as closed instead of accidentally opening
|
|
211
|
+
// UI for a background session. Full shells should pass
|
|
212
|
+
// `surfaceDispatch.shouldOpenSurface` to make this gate precise.
|
|
213
|
+
shouldOpenSurface: (l) => {
|
|
214
|
+
var C;
|
|
215
|
+
return ((C = l.meta) == null ? void 0 : C.openOnlyWhenSessionOpen) !== !0;
|
|
216
|
+
}
|
|
217
|
+
} : void 0);
|
|
218
|
+
if (r)
|
|
219
|
+
return Ae.on(ue.uiCommand, ({ command: l }) => {
|
|
220
|
+
De(l, r);
|
|
221
|
+
});
|
|
222
|
+
}, [oe, T, Q, Y, ae, re]), Le(ue.agentData, () => {
|
|
223
|
+
c && I(!0);
|
|
224
|
+
}), y(() => {
|
|
211
225
|
if (!c) {
|
|
212
|
-
|
|
226
|
+
I(!1);
|
|
213
227
|
return;
|
|
214
228
|
}
|
|
215
|
-
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
const
|
|
223
|
-
return
|
|
224
|
-
const
|
|
225
|
-
|
|
229
|
+
$.length > 0 && (g(!1), I(!1), ge());
|
|
230
|
+
}, [$.length, c, g]);
|
|
231
|
+
const ie = J(k);
|
|
232
|
+
y(() => {
|
|
233
|
+
const r = ie.current;
|
|
234
|
+
ie.current = k, r !== void 0 && k !== void 0 && k !== r && c && g(!1);
|
|
235
|
+
}, [k, c, g]);
|
|
236
|
+
const se = J(n);
|
|
237
|
+
return y(() => {
|
|
238
|
+
const r = se.current;
|
|
239
|
+
se.current = n, r && !n && c && g(!1);
|
|
226
240
|
}, [n, c, g]), /* @__PURE__ */ h(
|
|
227
241
|
"div",
|
|
228
242
|
{
|
|
@@ -257,15 +271,15 @@ function Ge(e) {
|
|
|
257
271
|
"transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
258
272
|
t ? "opacity-100" : "opacity-0"
|
|
259
273
|
),
|
|
260
|
-
children: /* @__PURE__ */ a(
|
|
274
|
+
children: /* @__PURE__ */ a(j, { id: d, params: e.navParams })
|
|
261
275
|
}
|
|
262
276
|
),
|
|
263
277
|
t ? /* @__PURE__ */ a(
|
|
264
|
-
|
|
278
|
+
me,
|
|
265
279
|
{
|
|
266
280
|
side: "drawer-right",
|
|
267
281
|
ariaLabel: "Resize sessions drawer",
|
|
268
|
-
onResize: (
|
|
282
|
+
onResize: (r) => p((l) => K(l + r, 200, 360))
|
|
269
283
|
}
|
|
270
284
|
) : null
|
|
271
285
|
]
|
|
@@ -295,46 +309,46 @@ function Ge(e) {
|
|
|
295
309
|
"transition-opacity duration-[200ms] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
296
310
|
c ? "opacity-0" : "opacity-100"
|
|
297
311
|
),
|
|
298
|
-
children:
|
|
299
|
-
|
|
312
|
+
children: G ? /* @__PURE__ */ a(
|
|
313
|
+
Me,
|
|
300
314
|
{
|
|
301
|
-
panes:
|
|
315
|
+
panes: _,
|
|
302
316
|
activePaneId: e.activeChatPaneId,
|
|
303
317
|
onActivePaneChange: e.onActiveChatPaneChange,
|
|
304
318
|
onClosePane: e.onCloseChatPane,
|
|
305
319
|
flashPaneId: e.flashChatPaneId,
|
|
306
320
|
storageKey: e.storageKey,
|
|
307
321
|
onDropSession: e.onDropChatSession,
|
|
308
|
-
renderPane: (
|
|
309
|
-
|
|
322
|
+
renderPane: (r) => /* @__PURE__ */ a(
|
|
323
|
+
j,
|
|
310
324
|
{
|
|
311
|
-
id:
|
|
312
|
-
params:
|
|
325
|
+
id: r.panel ?? i,
|
|
326
|
+
params: r.params ?? e.centerParams
|
|
313
327
|
}
|
|
314
328
|
)
|
|
315
329
|
}
|
|
316
|
-
) : /* @__PURE__ */ a(
|
|
330
|
+
) : /* @__PURE__ */ a(j, { id: i, params: e.centerParams })
|
|
317
331
|
}
|
|
318
332
|
),
|
|
319
|
-
c ? null : /* @__PURE__ */ a(
|
|
320
|
-
|
|
333
|
+
c ? null : /* @__PURE__ */ a(ee, { label: "Collapse chat", hint: "⌘\\", side: "bottom", children: /* @__PURE__ */ a(
|
|
334
|
+
V,
|
|
321
335
|
{
|
|
322
336
|
type: "button",
|
|
323
337
|
variant: "ghost",
|
|
324
338
|
size: "icon-xs",
|
|
325
|
-
onClick:
|
|
339
|
+
onClick: E,
|
|
326
340
|
className: m(
|
|
327
341
|
"absolute right-2 z-30 rounded-full bg-background/80 text-muted-foreground shadow-sm backdrop-blur hover:bg-muted hover:text-foreground",
|
|
328
|
-
|
|
342
|
+
G && _.length > 1 ? "bottom-2" : "top-2"
|
|
329
343
|
),
|
|
330
344
|
"aria-label": "Collapse chat",
|
|
331
|
-
children: /* @__PURE__ */ a(
|
|
345
|
+
children: /* @__PURE__ */ a(Ne, { className: "h-4 w-4", strokeWidth: 1.75 })
|
|
332
346
|
}
|
|
333
347
|
) })
|
|
334
348
|
]
|
|
335
349
|
}
|
|
336
350
|
),
|
|
337
|
-
|
|
351
|
+
o ? /* @__PURE__ */ h(
|
|
338
352
|
"aside",
|
|
339
353
|
{
|
|
340
354
|
"data-boring-workspace-part": "workbench",
|
|
@@ -350,9 +364,9 @@ function Ge(e) {
|
|
|
350
364
|
n && "border-l border-[color:oklch(from_var(--border)_l_c_h/0.6)]"
|
|
351
365
|
),
|
|
352
366
|
style: c && n ? { willChange: "width" } : {
|
|
353
|
-
width: n ?
|
|
354
|
-
minWidth: n ?
|
|
355
|
-
maxWidth: n ?
|
|
367
|
+
width: n ? U : 0,
|
|
368
|
+
minWidth: n ? U : 0,
|
|
369
|
+
maxWidth: n ? U : 0,
|
|
356
370
|
willChange: "width"
|
|
357
371
|
},
|
|
358
372
|
children: [
|
|
@@ -370,8 +384,8 @@ function Ge(e) {
|
|
|
370
384
|
),
|
|
371
385
|
children: e.surfaceOverlay ? /* @__PURE__ */ h("div", { className: "relative h-full min-h-0", children: [
|
|
372
386
|
e.surfaceOverlay,
|
|
373
|
-
f ? /* @__PURE__ */ a(
|
|
374
|
-
|
|
387
|
+
f ? /* @__PURE__ */ a(ee, { label: "Close workbench", hint: "⌘2", side: "left", children: /* @__PURE__ */ a(
|
|
388
|
+
V,
|
|
375
389
|
{
|
|
376
390
|
type: "button",
|
|
377
391
|
variant: "ghost",
|
|
@@ -382,15 +396,15 @@ function Ge(e) {
|
|
|
382
396
|
children: /* @__PURE__ */ a("span", { "aria-hidden": "true", children: "›" })
|
|
383
397
|
}
|
|
384
398
|
) }) : null
|
|
385
|
-
] }) : /* @__PURE__ */ a(
|
|
399
|
+
] }) : /* @__PURE__ */ a(j, { id: u, params: e.surfaceParams })
|
|
386
400
|
}
|
|
387
401
|
),
|
|
388
402
|
n && !c ? /* @__PURE__ */ a(
|
|
389
|
-
|
|
403
|
+
me,
|
|
390
404
|
{
|
|
391
405
|
side: "surface-left",
|
|
392
406
|
ariaLabel: "Resize workbench",
|
|
393
|
-
onResize: (
|
|
407
|
+
onResize: (r) => we((l) => K(l - r, 480, ne))
|
|
394
408
|
}
|
|
395
409
|
) : null
|
|
396
410
|
]
|
|
@@ -404,18 +418,19 @@ function Ge(e) {
|
|
|
404
418
|
icon: "sessions",
|
|
405
419
|
onClick: e.onOpenNav,
|
|
406
420
|
label: "Sessions",
|
|
407
|
-
hint: "⌘1"
|
|
421
|
+
hint: "⌘1",
|
|
422
|
+
pulse: pe
|
|
408
423
|
}
|
|
409
424
|
) : null,
|
|
410
|
-
!c && !t &&
|
|
425
|
+
!c && !t && G && e.onCreateChatPaneAfter ? /* @__PURE__ */ a(
|
|
411
426
|
H,
|
|
412
427
|
{
|
|
413
428
|
side: "left",
|
|
414
429
|
icon: "plus",
|
|
415
430
|
onClick: () => {
|
|
416
|
-
var
|
|
417
|
-
const
|
|
418
|
-
|
|
431
|
+
var l, C;
|
|
432
|
+
const r = e.activeChatPaneId ?? ((l = _[_.length - 1]) == null ? void 0 : l.id);
|
|
433
|
+
r && ((C = e.onCreateChatPaneAfter) == null || C.call(e, r));
|
|
419
434
|
},
|
|
420
435
|
label: "New chat",
|
|
421
436
|
stackIndex: e.onOpenNav ? 1 : 0
|
|
@@ -426,11 +441,11 @@ function Ge(e) {
|
|
|
426
441
|
{
|
|
427
442
|
side: "left",
|
|
428
443
|
icon: "chat",
|
|
429
|
-
onClick:
|
|
444
|
+
onClick: E,
|
|
430
445
|
label: "Expand chat",
|
|
431
446
|
hint: "⌘\\\\",
|
|
432
447
|
stackIndex: 1,
|
|
433
|
-
pulse:
|
|
448
|
+
pulse: ve || $.length > 0
|
|
434
449
|
}
|
|
435
450
|
) : null,
|
|
436
451
|
!n && e.onOpenSurface ? /* @__PURE__ */ a(
|
|
@@ -448,30 +463,30 @@ function Ge(e) {
|
|
|
448
463
|
}
|
|
449
464
|
);
|
|
450
465
|
}
|
|
451
|
-
function
|
|
452
|
-
return Math.max(t, Math.min(
|
|
466
|
+
function K(e, t, o) {
|
|
467
|
+
return Math.max(t, Math.min(o, e));
|
|
453
468
|
}
|
|
454
|
-
function
|
|
455
|
-
const [
|
|
456
|
-
() => e ?
|
|
469
|
+
function fe(e, t) {
|
|
470
|
+
const [o, n] = X(
|
|
471
|
+
() => e ? he(e, t) : t
|
|
457
472
|
);
|
|
458
|
-
|
|
459
|
-
n(e ?
|
|
473
|
+
y(() => {
|
|
474
|
+
n(e ? he(e, t) : t);
|
|
460
475
|
}, [e, t]);
|
|
461
476
|
const d = v(
|
|
462
477
|
(i) => {
|
|
463
|
-
n((
|
|
464
|
-
const s = typeof i == "function" ? i(
|
|
465
|
-
return e &&
|
|
478
|
+
n((u) => {
|
|
479
|
+
const s = typeof i == "function" ? i(u) : i;
|
|
480
|
+
return e && Fe(e, s), s;
|
|
466
481
|
});
|
|
467
482
|
},
|
|
468
483
|
[e]
|
|
469
484
|
);
|
|
470
|
-
return [
|
|
485
|
+
return [o, d];
|
|
471
486
|
}
|
|
472
|
-
function
|
|
473
|
-
const [
|
|
474
|
-
|
|
487
|
+
function je(e, t) {
|
|
488
|
+
const [o, n] = X(() => !e || typeof window > "u" ? t : window.localStorage.getItem(e) === "1");
|
|
489
|
+
y(() => {
|
|
475
490
|
if (!e || typeof window > "u") {
|
|
476
491
|
n(t);
|
|
477
492
|
return;
|
|
@@ -481,79 +496,85 @@ function Me(e, t) {
|
|
|
481
496
|
}, [e, t]);
|
|
482
497
|
const d = v(
|
|
483
498
|
(i) => {
|
|
484
|
-
n((
|
|
485
|
-
const s = typeof i == "function" ? i(
|
|
499
|
+
n((u) => {
|
|
500
|
+
const s = typeof i == "function" ? i(u) : i;
|
|
486
501
|
return e && typeof window < "u" && window.localStorage.setItem(e, s ? "1" : "0"), s;
|
|
487
502
|
});
|
|
488
503
|
},
|
|
489
504
|
[e]
|
|
490
505
|
);
|
|
491
|
-
return [
|
|
506
|
+
return [o, d];
|
|
492
507
|
}
|
|
493
|
-
function
|
|
494
|
-
const [e, t] =
|
|
495
|
-
return
|
|
496
|
-
const
|
|
497
|
-
return window.addEventListener("resize",
|
|
508
|
+
function He() {
|
|
509
|
+
const [e, t] = X(() => typeof window < "u" ? window.innerWidth : 1200);
|
|
510
|
+
return y(() => {
|
|
511
|
+
const o = () => t(window.innerWidth);
|
|
512
|
+
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
498
513
|
}, []), e;
|
|
499
514
|
}
|
|
500
|
-
function
|
|
515
|
+
function me({ side: e, ariaLabel: t, onResize: o }) {
|
|
501
516
|
const n = J(null), d = v((s) => {
|
|
502
517
|
s.preventDefault(), n.current = s.clientX, s.currentTarget.setPointerCapture(s.pointerId), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
503
518
|
}, []), i = v((s) => {
|
|
504
519
|
if (n.current === null) return;
|
|
505
|
-
const
|
|
506
|
-
n.current = s.clientX,
|
|
507
|
-
}, [
|
|
520
|
+
const x = s.clientX - n.current;
|
|
521
|
+
n.current = s.clientX, o(x);
|
|
522
|
+
}, [o]), u = v((s) => {
|
|
508
523
|
n.current !== null && (n.current = null, s.currentTarget.releasePointerCapture(s.pointerId), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
509
524
|
}, []);
|
|
510
525
|
return /* @__PURE__ */ a(
|
|
511
|
-
|
|
526
|
+
ye,
|
|
512
527
|
{
|
|
513
528
|
"aria-label": t,
|
|
514
529
|
orientation: "vertical",
|
|
515
530
|
onResizeStart: d,
|
|
516
531
|
onPointerMove: i,
|
|
517
|
-
onPointerUp:
|
|
518
|
-
onPointerCancel:
|
|
532
|
+
onPointerUp: u,
|
|
533
|
+
onPointerCancel: u,
|
|
519
534
|
className: m(
|
|
520
535
|
"absolute -top-px -bottom-px z-20 w-3 bg-transparent hover:!bg-transparent active:!bg-transparent",
|
|
521
536
|
"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",
|
|
522
537
|
"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",
|
|
523
|
-
e === "drawer-right" ? "
|
|
538
|
+
e === "drawer-right" ? "right-0" : "-left-1.5"
|
|
524
539
|
)
|
|
525
540
|
}
|
|
526
541
|
);
|
|
527
542
|
}
|
|
528
|
-
function
|
|
529
|
-
const
|
|
530
|
-
|
|
543
|
+
function Ve(e, t) {
|
|
544
|
+
const o = e == null ? void 0 : e[t];
|
|
545
|
+
if (!o || typeof o != "object") return;
|
|
546
|
+
const n = o;
|
|
547
|
+
return typeof n.surface == "function" && typeof n.isWorkbenchOpen == "function" && typeof n.openWorkbench == "function" ? n : void 0;
|
|
548
|
+
}
|
|
549
|
+
function N(e, t) {
|
|
550
|
+
const o = e == null ? void 0 : e[t];
|
|
551
|
+
return typeof o == "function" ? o : void 0;
|
|
531
552
|
}
|
|
532
|
-
function
|
|
533
|
-
return
|
|
553
|
+
function F(e, t) {
|
|
554
|
+
return N(e, t);
|
|
534
555
|
}
|
|
535
|
-
function
|
|
556
|
+
function te() {
|
|
536
557
|
if (typeof document > "u") return;
|
|
537
|
-
const
|
|
558
|
+
const o = (document.querySelector(
|
|
538
559
|
'[data-boring-workspace-part="chat-pane"][data-boring-state="active"]'
|
|
539
560
|
) ?? document).querySelector(
|
|
540
561
|
'[data-boring-agent] textarea[name="message"], textarea[name="message"]'
|
|
541
562
|
);
|
|
542
|
-
|
|
563
|
+
o == null || o.focus();
|
|
543
564
|
}
|
|
544
|
-
function
|
|
565
|
+
function ge() {
|
|
545
566
|
typeof window > "u" || window.requestAnimationFrame(() => {
|
|
546
|
-
|
|
567
|
+
te(), window.setTimeout(te, 320);
|
|
547
568
|
});
|
|
548
569
|
}
|
|
549
|
-
function
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
),
|
|
555
|
-
return
|
|
556
|
-
|
|
570
|
+
function j({ id: e, params: t }) {
|
|
571
|
+
const o = Ee(), { debug: n } = Ke(), d = xe(
|
|
572
|
+
o.subscribe,
|
|
573
|
+
o.getSnapshot,
|
|
574
|
+
o.getSnapshot
|
|
575
|
+
), u = W(() => o.getComponents(), [o, d])[e], s = W(() => Xe(e), [e]);
|
|
576
|
+
return u ? /* @__PURE__ */ a(ke, { fallback: /* @__PURE__ */ a(Ce, { centered: !0 }), children: /* @__PURE__ */ a(
|
|
577
|
+
u,
|
|
557
578
|
{
|
|
558
579
|
params: { ...t, debug: n },
|
|
559
580
|
api: s,
|
|
@@ -561,7 +582,7 @@ function K({ id: e, params: t }) {
|
|
|
561
582
|
}
|
|
562
583
|
) }) : null;
|
|
563
584
|
}
|
|
564
|
-
function
|
|
585
|
+
function Xe(e) {
|
|
565
586
|
return {
|
|
566
587
|
id: e,
|
|
567
588
|
title: e,
|
|
@@ -600,49 +621,52 @@ function Ke(e) {
|
|
|
600
621
|
function H({
|
|
601
622
|
side: e,
|
|
602
623
|
icon: t,
|
|
603
|
-
onClick:
|
|
624
|
+
onClick: o,
|
|
604
625
|
label: n,
|
|
605
626
|
hint: d,
|
|
606
627
|
bottomOffset: i,
|
|
607
|
-
stackIndex:
|
|
628
|
+
stackIndex: u = 0,
|
|
608
629
|
pulse: s = !1
|
|
609
630
|
}) {
|
|
610
|
-
const
|
|
611
|
-
return /* @__PURE__ */ a(
|
|
612
|
-
|
|
631
|
+
const x = e === "right" && i !== void 0, p = u * 44;
|
|
632
|
+
return /* @__PURE__ */ a(ee, { label: n, hint: d, side: e === "left" ? "right" : "left", children: /* @__PURE__ */ a(
|
|
633
|
+
V,
|
|
613
634
|
{
|
|
614
635
|
type: "button",
|
|
615
636
|
variant: "ghost",
|
|
616
637
|
size: "icon-sm",
|
|
617
|
-
onClick:
|
|
638
|
+
onClick: o,
|
|
618
639
|
"aria-label": n,
|
|
619
640
|
className: m(
|
|
620
641
|
"absolute z-30 h-9 w-9 gap-0.5 rounded-lg bg-background text-muted-foreground",
|
|
621
642
|
e === "left" ? "left-2" : "right-2",
|
|
622
|
-
|
|
643
|
+
x ? "hover:-translate-y-0.5" : "top-1/2 hover:-translate-y-[1px]",
|
|
623
644
|
"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)]",
|
|
624
645
|
"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)]",
|
|
625
646
|
"focus-visible:ring-ring/40"
|
|
626
647
|
),
|
|
627
|
-
style:
|
|
628
|
-
children: t === "sessions" ? /* @__PURE__ */ h("
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
|
|
648
|
+
style: x ? { bottom: i } : { transform: `translateY(calc(-50% - ${p}px))` },
|
|
649
|
+
children: t === "sessions" ? /* @__PURE__ */ h("span", { className: "relative flex items-center justify-center", children: [
|
|
650
|
+
/* @__PURE__ */ h("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
651
|
+
/* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "1.8" }),
|
|
652
|
+
/* @__PURE__ */ a("path", { d: "M12 7v5l3.2 2", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
|
|
653
|
+
] }),
|
|
654
|
+
s ? /* @__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
|
|
631
655
|
] }) : t === "chat" ? /* @__PURE__ */ h("span", { className: "relative flex items-center justify-center", children: [
|
|
632
|
-
/* @__PURE__ */ a(
|
|
656
|
+
/* @__PURE__ */ a(_e, { className: "h-[15px] w-[15px]", strokeWidth: 1.8, "aria-hidden": "true" }),
|
|
633
657
|
s ? /* @__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
|
|
634
658
|
] }) : 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" }) })
|
|
635
659
|
}
|
|
636
660
|
) });
|
|
637
661
|
}
|
|
638
|
-
function
|
|
662
|
+
function tt({
|
|
639
663
|
appTitle: e = "Boring",
|
|
640
664
|
sessionTitle: t,
|
|
641
|
-
onCommandPalette:
|
|
665
|
+
onCommandPalette: o,
|
|
642
666
|
onNewChat: n,
|
|
643
667
|
topBarLeft: d,
|
|
644
668
|
topBarRight: i,
|
|
645
|
-
className:
|
|
669
|
+
className: u
|
|
646
670
|
}) {
|
|
647
671
|
const s = i ?? null;
|
|
648
672
|
return /* @__PURE__ */ h(
|
|
@@ -652,11 +676,11 @@ function Ye({
|
|
|
652
676
|
className: m(
|
|
653
677
|
"relative flex h-11 items-center justify-between gap-2 px-3",
|
|
654
678
|
"bg-background border-b border-border",
|
|
655
|
-
|
|
679
|
+
u
|
|
656
680
|
),
|
|
657
681
|
"aria-label": "App top bar",
|
|
658
682
|
children: [
|
|
659
|
-
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 leading-none", children: d ?? /* @__PURE__ */ h(
|
|
683
|
+
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 leading-none", children: d ?? /* @__PURE__ */ h(le, { children: [
|
|
660
684
|
/* @__PURE__ */ a(
|
|
661
685
|
"span",
|
|
662
686
|
{
|
|
@@ -665,32 +689,32 @@ function Ye({
|
|
|
665
689
|
children: ((e == null ? void 0 : e[0]) ?? "B").toUpperCase()
|
|
666
690
|
}
|
|
667
691
|
),
|
|
668
|
-
t ? /* @__PURE__ */ h(
|
|
692
|
+
t ? /* @__PURE__ */ h(le, { children: [
|
|
669
693
|
/* @__PURE__ */ a("span", { className: "shrink-0 text-[13px] font-medium leading-none tracking-tight text-foreground/65", children: e }),
|
|
670
694
|
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "text-[13px] leading-none text-muted-foreground/45", children: "·" }),
|
|
671
695
|
/* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: t })
|
|
672
696
|
] }) : /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: e })
|
|
673
697
|
] }) }),
|
|
674
698
|
/* @__PURE__ */ h(
|
|
675
|
-
|
|
699
|
+
Se,
|
|
676
700
|
{
|
|
677
701
|
type: "button",
|
|
678
702
|
variant: "ghost",
|
|
679
703
|
size: "sm",
|
|
680
|
-
onClick:
|
|
704
|
+
onClick: o,
|
|
681
705
|
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",
|
|
682
706
|
"aria-label": "Search catalogs and commands",
|
|
683
707
|
title: "Command palette (⌘K)",
|
|
684
708
|
children: [
|
|
685
|
-
/* @__PURE__ */ a(
|
|
709
|
+
/* @__PURE__ */ a(We, { className: "h-3.5 w-3.5 shrink-0 opacity-80", strokeWidth: 1.75 }),
|
|
686
710
|
/* @__PURE__ */ a("span", { className: "font-normal tracking-tight", children: "Search" }),
|
|
687
|
-
/* @__PURE__ */ a(
|
|
711
|
+
/* @__PURE__ */ a(Pe, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
|
|
688
712
|
]
|
|
689
713
|
}
|
|
690
714
|
),
|
|
691
715
|
/* @__PURE__ */ h("div", { className: "flex flex-1 shrink-0 items-center justify-end gap-1", children: [
|
|
692
716
|
n && /* @__PURE__ */ a(
|
|
693
|
-
|
|
717
|
+
V,
|
|
694
718
|
{
|
|
695
719
|
type: "button",
|
|
696
720
|
variant: "ghost",
|
|
@@ -698,7 +722,7 @@ function Ye({
|
|
|
698
722
|
onClick: n,
|
|
699
723
|
"aria-label": "New chat",
|
|
700
724
|
title: "New chat",
|
|
701
|
-
children: /* @__PURE__ */ a(
|
|
725
|
+
children: /* @__PURE__ */ a(Ie, { className: "h-4 w-4" })
|
|
702
726
|
}
|
|
703
727
|
),
|
|
704
728
|
s
|
|
@@ -707,10 +731,10 @@ function Ye({
|
|
|
707
731
|
}
|
|
708
732
|
);
|
|
709
733
|
}
|
|
710
|
-
function
|
|
734
|
+
function nt({
|
|
711
735
|
title: e = "Loading workspace",
|
|
712
736
|
description: t = "Preparing the workspace context.",
|
|
713
|
-
status:
|
|
737
|
+
status: o = "Loading",
|
|
714
738
|
fullscreen: n = !0,
|
|
715
739
|
className: d
|
|
716
740
|
}) {
|
|
@@ -737,16 +761,16 @@ function Ze({
|
|
|
737
761
|
/* @__PURE__ */ a("h2", { className: "text-base font-medium text-foreground", children: e }),
|
|
738
762
|
t ? /* @__PURE__ */ a("p", { className: "text-sm leading-6 text-muted-foreground", children: t }) : null
|
|
739
763
|
] }),
|
|
740
|
-
|
|
764
|
+
o ? /* @__PURE__ */ a("p", { className: "text-xs font-medium text-muted-foreground/80", children: o }) : null
|
|
741
765
|
] })
|
|
742
766
|
}
|
|
743
767
|
);
|
|
744
768
|
}
|
|
745
769
|
export {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
770
|
+
et as C,
|
|
771
|
+
tt as T,
|
|
772
|
+
nt as W,
|
|
773
|
+
Je as b,
|
|
774
|
+
Ze as r,
|
|
775
|
+
Ge as w
|
|
752
776
|
};
|