@hachej/boring-workspace 0.1.12 → 0.1.14
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/README.md +270 -42
- package/dist/CommandPalette-NOEOVkN2.js +5714 -0
- package/dist/{FileTree-BVfqs3rR.js → FileTree-Dl-qUAB0.js} +9 -9
- package/dist/MarkdownEditor-yc6mFsnI.js +533 -0
- package/dist/{WorkspaceLoadingState-CPQBxYFG.js → WorkspaceLoadingState-CSZfENWe.js} +178 -157
- package/dist/agent-tool-DEtfQPVB.d.ts +100 -0
- package/dist/app-front.d.ts +79 -67
- package/dist/app-front.js +253 -241
- package/dist/app-server.d.ts +17 -12
- package/dist/app-server.js +105 -23
- package/dist/{bootstrapServer-BRUqUpVW.d.ts → bootstrapServer-BreQ9QBc.d.ts} +8 -2
- package/dist/server.d.ts +13 -35
- package/dist/server.js +39 -137
- package/dist/shared.d.ts +1 -2
- package/dist/testing.d.ts +0 -63
- package/dist/testing.js +2248 -2401
- package/dist/workspace.css +1616 -977
- package/dist/workspace.d.ts +111 -450
- package/dist/workspace.js +417 -1635
- package/docs/INTERFACES.md +2 -2
- package/docs/PLUGIN_STRUCTURE.md +1 -1
- package/docs/plans/ASK_USER_QUESTIONS_PLUGIN_SPEC.md +131 -263
- package/docs/plans/GENERIC_EXPLORER_PLUGIN_PLAN.md +29 -27
- package/docs/plans/MACRO_PLUGIN_GENERIC_HELPERS_AUDIT.md +12 -12
- package/docs/plans/PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md +366 -0
- package/docs/plans/README.md +2 -0
- package/docs/plans/archive/PLUGIN_MODEL.md +14 -14
- package/docs/plans/archive/SRC_FOLDER_REORG_PLAN.md +2 -3
- package/docs/plans/archive/WORKSPACE_V2_PLAN.md +1 -1
- package/package.json +3 -6
- package/dist/CommandPalette-Dme9em28.js +0 -5506
- package/dist/MarkdownEditor-CcCDF65H.js +0 -502
- package/dist/agent-tool-NvxKfist.d.ts +0 -28
- package/dist/explorer-DtLUnuah.d.ts +0 -129
package/dist/app-front.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as d, jsxs as
|
|
2
|
-
import { useSyncExternalStore as
|
|
3
|
-
import { ChatPanel as
|
|
4
|
-
import {
|
|
5
|
-
import { T as
|
|
6
|
-
function
|
|
1
|
+
import { jsx as d, jsxs as $e, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { useSyncExternalStore as Qe, useMemo as b, useCallback as y, useRef as $, useState as H, useEffect as v } from "react";
|
|
3
|
+
import { ChatPanel as Xe, useSessions as Ze } from "@hachej/boring-agent/front";
|
|
4
|
+
import { U as Ce, p as He, al as qe, u as et, am as tt } from "./CommandPalette-NOEOVkN2.js";
|
|
5
|
+
import { T as st, C as nt, r as Ke, w as rt, W as Le } from "./WorkspaceLoadingState-CSZfENWe.js";
|
|
6
|
+
function ot() {
|
|
7
7
|
const e = `s${Date.now()}`;
|
|
8
8
|
return {
|
|
9
9
|
sessions: [{ id: e, title: "New session", updatedAt: Date.now() }],
|
|
10
10
|
activeId: e
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var
|
|
13
|
+
function at(e, t) {
|
|
14
|
+
var o;
|
|
15
15
|
if (typeof localStorage > "u") return t();
|
|
16
16
|
try {
|
|
17
17
|
const s = localStorage.getItem(e);
|
|
18
18
|
if (s) {
|
|
19
19
|
const n = JSON.parse(s), c = Array.isArray(n.sessions) ? n.sessions : Array.isArray(n.items) ? n.items : null;
|
|
20
20
|
if (c)
|
|
21
|
-
return { sessions: c, activeId: n.activeId ?? ((
|
|
21
|
+
return { sessions: c, activeId: n.activeId ?? ((o = c[0]) == null ? void 0 : o.id) ?? "" };
|
|
22
22
|
}
|
|
23
23
|
} catch {
|
|
24
24
|
}
|
|
25
25
|
return t();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function ct(e, t) {
|
|
28
28
|
if (!(typeof localStorage > "u"))
|
|
29
29
|
try {
|
|
30
30
|
localStorage.setItem(e, JSON.stringify(t));
|
|
31
31
|
} catch {
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const t = e.storageKey ?? "workspace:sessions",
|
|
36
|
-
let s =
|
|
34
|
+
function it(e = {}) {
|
|
35
|
+
const t = e.storageKey ?? "workspace:sessions", o = e.initial ?? ot;
|
|
36
|
+
let s = at(t, o);
|
|
37
37
|
const n = /* @__PURE__ */ new Set(), c = (a) => {
|
|
38
|
-
s = a,
|
|
38
|
+
s = a, ct(t, s), n.forEach((i) => i());
|
|
39
39
|
};
|
|
40
40
|
return {
|
|
41
41
|
getState: () => s,
|
|
@@ -57,59 +57,59 @@ function rt(e = {}) {
|
|
|
57
57
|
},
|
|
58
58
|
remove(a) {
|
|
59
59
|
var u;
|
|
60
|
-
const i = s.sessions.filter((
|
|
60
|
+
const i = s.sessions.filter((m) => m.id !== a), h = s.activeId === a ? ((u = i[0]) == null ? void 0 : u.id) ?? "" : s.activeId;
|
|
61
61
|
c({ sessions: i, activeId: h });
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function lt(e) {
|
|
66
|
+
return Qe(e.subscribe, e.getState, e.getState);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function ut(e) {
|
|
69
69
|
return e.type === "panel";
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ft(e, t) {
|
|
72
72
|
return e.endsWith(":surface") ? e.slice(0, -8) : t;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const [s, n] =
|
|
76
|
-
|
|
77
|
-
n(
|
|
78
|
-
}, [e, t,
|
|
79
|
-
const c =
|
|
74
|
+
function Z(e, t, o) {
|
|
75
|
+
const [s, n] = H(() => Ke(e, t, o));
|
|
76
|
+
v(() => {
|
|
77
|
+
n(Ke(e, t, o));
|
|
78
|
+
}, [e, t, o]);
|
|
79
|
+
const c = y(
|
|
80
80
|
(a) => {
|
|
81
|
-
n(a),
|
|
81
|
+
n(a), rt(e, a, o);
|
|
82
82
|
},
|
|
83
|
-
[
|
|
83
|
+
[o, e]
|
|
84
84
|
);
|
|
85
85
|
return [s, c];
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const dt = {}, Re = {
|
|
88
88
|
openTabs: [],
|
|
89
89
|
activeTab: null
|
|
90
90
|
};
|
|
91
|
-
function
|
|
91
|
+
function pt(e) {
|
|
92
92
|
if (!e) return "/api/v1/ui";
|
|
93
|
-
const t = e.replace(/\/$/, ""),
|
|
94
|
-
return t.endsWith(
|
|
93
|
+
const t = e.replace(/\/$/, ""), o = "/api/v1/ui";
|
|
94
|
+
return t.endsWith(o) ? t : `${t}${o}`;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return `${
|
|
96
|
+
function ht(e) {
|
|
97
|
+
return `${pt(e)}/state`;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function mt(e) {
|
|
100
100
|
var s;
|
|
101
|
-
const t = e.openTabs.find((n) => n.id === e.activeTab),
|
|
102
|
-
return typeof
|
|
101
|
+
const t = e.openTabs.find((n) => n.id === e.activeTab), o = (s = t == null ? void 0 : t.params) == null ? void 0 : s.path;
|
|
102
|
+
return typeof o == "string" ? o : null;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function gt({
|
|
105
105
|
bridgeEndpoint: e,
|
|
106
106
|
requestHeaders: t,
|
|
107
|
-
navOpen:
|
|
107
|
+
navOpen: o,
|
|
108
108
|
surfaceOpen: s,
|
|
109
109
|
snapshot: n
|
|
110
110
|
}) {
|
|
111
|
-
const c =
|
|
112
|
-
return
|
|
111
|
+
const c = et(), a = $(null);
|
|
112
|
+
return v(() => {
|
|
113
113
|
var u;
|
|
114
114
|
if (e === null) return;
|
|
115
115
|
(u = a.current) == null || u.abort();
|
|
@@ -117,14 +117,14 @@ function dt({
|
|
|
117
117
|
a.current = i;
|
|
118
118
|
const h = {
|
|
119
119
|
v: 1,
|
|
120
|
-
drawerOpen:
|
|
120
|
+
drawerOpen: o,
|
|
121
121
|
workbenchOpen: s,
|
|
122
122
|
openTabs: n.openTabs,
|
|
123
123
|
activeTab: n.activeTab,
|
|
124
|
-
activeFile:
|
|
125
|
-
availablePanels: c.list().map((
|
|
124
|
+
activeFile: mt(n),
|
|
125
|
+
availablePanels: c.list().map((m) => m.id)
|
|
126
126
|
};
|
|
127
|
-
return fetch(
|
|
127
|
+
return fetch(ht(e), {
|
|
128
128
|
method: "PUT",
|
|
129
129
|
headers: { ...t, "Content-Type": "application/json" },
|
|
130
130
|
body: JSON.stringify({ state: h, causedBy: "user" }),
|
|
@@ -133,204 +133,210 @@ function dt({
|
|
|
133
133
|
}), () => {
|
|
134
134
|
i.abort();
|
|
135
135
|
};
|
|
136
|
-
}, [e,
|
|
136
|
+
}, [e, o, c, t, n, s]), null;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Wt({
|
|
139
139
|
workspaceId: e,
|
|
140
140
|
chatPanel: t,
|
|
141
|
-
useSessions:
|
|
142
|
-
requestHeaders: s =
|
|
141
|
+
useSessions: o,
|
|
142
|
+
requestHeaders: s = dt,
|
|
143
143
|
sessionStorageKey: n,
|
|
144
144
|
providerStorageKey: c,
|
|
145
145
|
surfaceStorageKey: a,
|
|
146
146
|
beforeShell: i,
|
|
147
147
|
afterShell: h,
|
|
148
148
|
panels: u,
|
|
149
|
-
commands:
|
|
150
|
-
catalogs:
|
|
151
|
-
plugins:
|
|
152
|
-
excludeDefaults:
|
|
153
|
-
capabilities:
|
|
154
|
-
apiBaseUrl:
|
|
155
|
-
authHeaders:
|
|
149
|
+
commands: m,
|
|
150
|
+
catalogs: _,
|
|
151
|
+
plugins: S,
|
|
152
|
+
excludeDefaults: g,
|
|
153
|
+
capabilities: k,
|
|
154
|
+
apiBaseUrl: C,
|
|
155
|
+
authHeaders: E,
|
|
156
156
|
apiTimeout: j,
|
|
157
|
-
defaultTheme:
|
|
158
|
-
onThemeChange:
|
|
159
|
-
persistenceEnabled:
|
|
160
|
-
bridgeEndpoint:
|
|
161
|
-
onAuthError:
|
|
162
|
-
sessions:
|
|
163
|
-
activeSessionId:
|
|
164
|
-
onSwitchSession:
|
|
165
|
-
onCreateSession:
|
|
166
|
-
onDeleteSession:
|
|
167
|
-
onActiveSessionIdChange:
|
|
168
|
-
appTitle:
|
|
169
|
-
defaultSessionTitle:
|
|
170
|
-
topBarLeft:
|
|
171
|
-
topBarRight:
|
|
172
|
-
chatParams:
|
|
173
|
-
extraPanels:
|
|
174
|
-
extraCommands:
|
|
175
|
-
onOpenNav:
|
|
176
|
-
onOpenSurface:
|
|
177
|
-
className:
|
|
157
|
+
defaultTheme: xe,
|
|
158
|
+
onThemeChange: De,
|
|
159
|
+
persistenceEnabled: q,
|
|
160
|
+
bridgeEndpoint: M,
|
|
161
|
+
onAuthError: Ne,
|
|
162
|
+
sessions: ee,
|
|
163
|
+
activeSessionId: te,
|
|
164
|
+
onSwitchSession: se,
|
|
165
|
+
onCreateSession: ne,
|
|
166
|
+
onDeleteSession: re,
|
|
167
|
+
onActiveSessionIdChange: K,
|
|
168
|
+
appTitle: Ae = "Boring",
|
|
169
|
+
defaultSessionTitle: J = "New session",
|
|
170
|
+
topBarLeft: Ie,
|
|
171
|
+
topBarRight: Ue,
|
|
172
|
+
chatParams: oe,
|
|
173
|
+
extraPanels: ae,
|
|
174
|
+
extraCommands: ce,
|
|
175
|
+
onOpenNav: V,
|
|
176
|
+
onOpenSurface: z,
|
|
177
|
+
className: Be
|
|
178
178
|
}) {
|
|
179
|
-
var
|
|
180
|
-
const
|
|
179
|
+
var Ee, Oe;
|
|
180
|
+
const F = c ?? `boring-ui-v2:layout:${e}`, f = a ?? `${F}:surface`, L = ft(
|
|
181
181
|
f,
|
|
182
|
-
|
|
183
|
-
),
|
|
184
|
-
() =>
|
|
185
|
-
[
|
|
186
|
-
),
|
|
182
|
+
F
|
|
183
|
+
), R = q !== !1, G = n ?? `boring-workspace:sessions:${e}`, x = b(
|
|
184
|
+
() => it({ storageKey: G }),
|
|
185
|
+
[G]
|
|
186
|
+
), ie = lt(x), _e = t ?? Xe, Y = o ?? (t ? void 0 : Ze), l = Y == null ? void 0 : Y({
|
|
187
187
|
requestHeaders: s,
|
|
188
|
-
storageKey:
|
|
189
|
-
}),
|
|
190
|
-
...
|
|
191
|
-
title:
|
|
192
|
-
})),
|
|
193
|
-
`${
|
|
188
|
+
storageKey: G
|
|
189
|
+
}), le = ee !== void 0 || te !== void 0 || se !== void 0 || ne !== void 0 || re !== void 0, je = l == null ? void 0 : l.sessions.map((r) => ({
|
|
190
|
+
...r,
|
|
191
|
+
title: r.title ?? "New session"
|
|
192
|
+
})), Q = l ? je ?? [] : le ? ee ?? [] : ie.sessions, p = l ? l.activeSessionId ?? null : le ? te ?? null : ie.activeId, ue = (l == null ? void 0 : l.switch) ?? se ?? x.switchTo, Me = y((r) => (p && r !== p && window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: p } })), ue(r)), [ue, p]), fe = l ? () => l.create() : ne ?? x.create, Je = (l == null ? void 0 : l.delete) ?? re ?? x.remove, Ve = ((Ee = Q.find((r) => r.id === p)) == null ? void 0 : Ee.title) ?? void 0, [de, pe] = Z(
|
|
193
|
+
`${L}:drawer`,
|
|
194
194
|
!0,
|
|
195
|
-
|
|
196
|
-
), [
|
|
195
|
+
R
|
|
196
|
+
), [P, w] = Z(
|
|
197
197
|
// Key must NOT match resolvedSurfaceStorageKey (which stores the dockview
|
|
198
198
|
// layout JSON at the same ":surface" suffix). Writing "1"/"0" to the same
|
|
199
199
|
// key corrupts the JSON and drops the persisted workbench layout on reload.
|
|
200
|
-
`${
|
|
200
|
+
`${L}:workbenchOpen`,
|
|
201
201
|
!1,
|
|
202
|
-
|
|
203
|
-
),
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
R
|
|
203
|
+
), [ze, he] = Z(
|
|
204
|
+
`${L}:workbenchLeftOpen`,
|
|
205
|
+
!0,
|
|
206
|
+
R
|
|
207
|
+
), O = $(!1), T = $(P), me = $(f), ge = $(null);
|
|
208
|
+
me.current = f;
|
|
209
|
+
const [ye, ve] = H(() => ({
|
|
206
210
|
key: f,
|
|
207
|
-
snapshot:
|
|
208
|
-
})),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}, [e]),
|
|
211
|
+
snapshot: Re
|
|
212
|
+
})), Fe = ye.key === f ? ye.snapshot : Re;
|
|
213
|
+
v(() => {
|
|
214
|
+
O.current = !1;
|
|
215
|
+
}, [e]), v(() => {
|
|
212
216
|
if (!(!l || l.loading)) {
|
|
213
217
|
if (l.sessions.length > 0) {
|
|
214
|
-
|
|
218
|
+
O.current = !1;
|
|
215
219
|
return;
|
|
216
220
|
}
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
O.current || (O.current = !0, Promise.resolve(l.create({ title: J })).catch(() => {
|
|
222
|
+
O.current = !1;
|
|
219
223
|
}));
|
|
220
224
|
}
|
|
221
|
-
}, [
|
|
222
|
-
|
|
223
|
-
}, [
|
|
224
|
-
const
|
|
225
|
-
|
|
225
|
+
}, [J, l]), v(() => {
|
|
226
|
+
T.current = P;
|
|
227
|
+
}, [P]);
|
|
228
|
+
const Se = y((r) => {
|
|
229
|
+
ge.current = { key: f, api: r }, ve({
|
|
226
230
|
key: f,
|
|
227
|
-
snapshot:
|
|
231
|
+
snapshot: r.getSnapshot()
|
|
228
232
|
});
|
|
229
|
-
}, [f]),
|
|
230
|
-
|
|
233
|
+
}, [f]), we = y((r) => {
|
|
234
|
+
ve({
|
|
231
235
|
key: f,
|
|
232
|
-
snapshot:
|
|
236
|
+
snapshot: r
|
|
233
237
|
});
|
|
234
|
-
}, [f]),
|
|
235
|
-
const
|
|
236
|
-
return (
|
|
237
|
-
}, []),
|
|
238
|
-
|
|
239
|
-
}, [
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
238
|
+
}, [f]), D = y(() => {
|
|
239
|
+
const r = ge.current;
|
|
240
|
+
return (r == null ? void 0 : r.key) === me.current ? r.api : null;
|
|
241
|
+
}, []), N = y(() => T.current, []), A = y(() => {
|
|
242
|
+
T.current = !0, w(!0);
|
|
243
|
+
}, [w]), I = y(() => {
|
|
244
|
+
T.current = !1, w(!1);
|
|
245
|
+
}, [w]), U = b(
|
|
246
|
+
() => (S == null ? void 0 : S.flatMap((r) => r.outputs ?? [])) ?? [],
|
|
247
|
+
[S]
|
|
248
|
+
), be = b(
|
|
249
|
+
() => U.some((r) => r.type === "left-tab"),
|
|
250
|
+
[U]
|
|
251
|
+
), ke = b(
|
|
252
|
+
() => U.filter(ut).map((r) => r.panel.id),
|
|
253
|
+
[U]
|
|
254
|
+
), Pe = b(
|
|
255
|
+
() => [...ae ?? [], ...ke],
|
|
256
|
+
[ae, ke]
|
|
257
|
+
), Te = p ?? ((Oe = Q[0]) == null ? void 0 : Oe.id) ?? "default";
|
|
258
|
+
v(() => {
|
|
259
|
+
var We;
|
|
260
|
+
const r = (B) => {
|
|
261
|
+
const X = B.detail;
|
|
262
|
+
!X || typeof X != "object" || qe(X, {
|
|
263
|
+
surface: D,
|
|
264
|
+
isWorkbenchOpen: N,
|
|
265
|
+
openWorkbench: A
|
|
260
266
|
});
|
|
261
267
|
};
|
|
262
|
-
return (
|
|
263
|
-
var
|
|
264
|
-
return (
|
|
268
|
+
return (We = globalThis.addEventListener) == null || We.call(globalThis, Ce, r), () => {
|
|
269
|
+
var B;
|
|
270
|
+
return (B = globalThis.removeEventListener) == null ? void 0 : B.call(globalThis, Ce, r);
|
|
265
271
|
};
|
|
266
|
-
}, [
|
|
267
|
-
|
|
268
|
-
}, [
|
|
269
|
-
const
|
|
272
|
+
}, [D, N, A]), v(() => {
|
|
273
|
+
p && (K == null || K(p));
|
|
274
|
+
}, [p, K]);
|
|
275
|
+
const Ge = b(
|
|
270
276
|
() => ({
|
|
271
|
-
...
|
|
272
|
-
sessionId:
|
|
277
|
+
...oe,
|
|
278
|
+
sessionId: Te,
|
|
273
279
|
requestHeaders: s,
|
|
274
|
-
bridgeEndpoint:
|
|
275
|
-
getSurface:
|
|
276
|
-
isWorkbenchOpen:
|
|
277
|
-
openWorkbench:
|
|
278
|
-
|
|
280
|
+
bridgeEndpoint: M,
|
|
281
|
+
getSurface: D,
|
|
282
|
+
isWorkbenchOpen: N,
|
|
283
|
+
openWorkbench: A,
|
|
284
|
+
closeWorkbench: I,
|
|
285
|
+
extraCommands: ce
|
|
279
286
|
}),
|
|
280
|
-
[
|
|
281
|
-
),
|
|
287
|
+
[oe, Te, s, M, D, N, A, I, ce]
|
|
288
|
+
), Ye = b(() => ({
|
|
282
289
|
storageKey: f,
|
|
283
|
-
extraPanels:
|
|
284
|
-
onReady:
|
|
285
|
-
onChange:
|
|
286
|
-
onClose:
|
|
287
|
-
$.current = !1, k(!1);
|
|
288
|
-
}
|
|
290
|
+
extraPanels: Pe,
|
|
291
|
+
onReady: Se,
|
|
292
|
+
onChange: we,
|
|
293
|
+
onClose: I
|
|
289
294
|
}), [
|
|
290
|
-
|
|
291
|
-
|
|
295
|
+
I,
|
|
296
|
+
we,
|
|
297
|
+
Se,
|
|
292
298
|
f,
|
|
293
|
-
|
|
294
|
-
|
|
299
|
+
Pe,
|
|
300
|
+
w
|
|
295
301
|
]);
|
|
296
|
-
return /* @__PURE__ */ d("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */
|
|
297
|
-
|
|
302
|
+
return /* @__PURE__ */ d("div", { className: "h-full bg-background text-foreground", children: /* @__PURE__ */ $e(
|
|
303
|
+
He,
|
|
298
304
|
{
|
|
299
|
-
chatPanel:
|
|
305
|
+
chatPanel: _e,
|
|
300
306
|
panels: u,
|
|
301
|
-
commands:
|
|
302
|
-
catalogs:
|
|
303
|
-
plugins:
|
|
304
|
-
excludeDefaults:
|
|
305
|
-
capabilities:
|
|
306
|
-
apiBaseUrl:
|
|
307
|
-
authHeaders:
|
|
307
|
+
commands: m,
|
|
308
|
+
catalogs: _,
|
|
309
|
+
plugins: S,
|
|
310
|
+
excludeDefaults: g,
|
|
311
|
+
capabilities: k,
|
|
312
|
+
apiBaseUrl: C,
|
|
313
|
+
authHeaders: E,
|
|
308
314
|
apiTimeout: j,
|
|
309
|
-
defaultTheme:
|
|
310
|
-
onThemeChange:
|
|
315
|
+
defaultTheme: xe,
|
|
316
|
+
onThemeChange: De,
|
|
311
317
|
workspaceId: e,
|
|
312
|
-
storageKey:
|
|
313
|
-
persistenceEnabled:
|
|
318
|
+
storageKey: F,
|
|
319
|
+
persistenceEnabled: q,
|
|
314
320
|
bridgeEndpoint: null,
|
|
315
|
-
onAuthError:
|
|
321
|
+
onAuthError: Ne,
|
|
316
322
|
children: [
|
|
317
323
|
i,
|
|
318
324
|
/* @__PURE__ */ d(
|
|
319
|
-
|
|
325
|
+
gt,
|
|
320
326
|
{
|
|
321
|
-
bridgeEndpoint:
|
|
327
|
+
bridgeEndpoint: M,
|
|
322
328
|
requestHeaders: s,
|
|
323
|
-
navOpen:
|
|
324
|
-
surfaceOpen:
|
|
325
|
-
snapshot:
|
|
329
|
+
navOpen: de,
|
|
330
|
+
surfaceOpen: P,
|
|
331
|
+
snapshot: Fe
|
|
326
332
|
}
|
|
327
333
|
),
|
|
328
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ $e("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
329
335
|
/* @__PURE__ */ d(
|
|
330
|
-
|
|
336
|
+
st,
|
|
331
337
|
{
|
|
332
|
-
appTitle:
|
|
333
|
-
sessionTitle:
|
|
338
|
+
appTitle: Ae,
|
|
339
|
+
sessionTitle: Ve ?? J,
|
|
334
340
|
onCommandPalette: () => {
|
|
335
341
|
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
336
342
|
key: "k",
|
|
@@ -340,36 +346,42 @@ function Pt({
|
|
|
340
346
|
cancelable: !0
|
|
341
347
|
}));
|
|
342
348
|
},
|
|
343
|
-
onNewChat:
|
|
344
|
-
topBarLeft:
|
|
345
|
-
topBarRight:
|
|
349
|
+
onNewChat: fe,
|
|
350
|
+
topBarLeft: Ie,
|
|
351
|
+
topBarRight: Ue
|
|
346
352
|
}
|
|
347
353
|
),
|
|
348
354
|
/* @__PURE__ */ d(
|
|
349
|
-
|
|
355
|
+
nt,
|
|
350
356
|
{
|
|
351
|
-
className:
|
|
352
|
-
nav:
|
|
357
|
+
className: Be,
|
|
358
|
+
nav: de ? "session-list" : null,
|
|
353
359
|
navParams: {
|
|
354
|
-
sessions:
|
|
355
|
-
activeId:
|
|
356
|
-
onSwitch:
|
|
357
|
-
onCreate:
|
|
358
|
-
onDelete:
|
|
359
|
-
onClose: () =>
|
|
360
|
+
sessions: Q,
|
|
361
|
+
activeId: p,
|
|
362
|
+
onSwitch: Me,
|
|
363
|
+
onCreate: fe,
|
|
364
|
+
onDelete: Je,
|
|
365
|
+
onClose: () => pe(!1)
|
|
360
366
|
},
|
|
361
367
|
center: "chat",
|
|
362
|
-
centerParams:
|
|
363
|
-
surface:
|
|
364
|
-
surfaceParams:
|
|
365
|
-
sidebar:
|
|
366
|
-
|
|
368
|
+
centerParams: Ge,
|
|
369
|
+
surface: P ? "artifact-surface" : null,
|
|
370
|
+
surfaceParams: Ye,
|
|
371
|
+
sidebar: P && be && ze ? "workbench-left" : null,
|
|
372
|
+
sidebarParams: {
|
|
373
|
+
onClose: () => he(!1)
|
|
374
|
+
},
|
|
375
|
+
storageKey: R ? L : void 0,
|
|
367
376
|
onOpenNav: () => {
|
|
368
|
-
|
|
377
|
+
pe(!0), V == null || V();
|
|
369
378
|
},
|
|
370
379
|
onOpenSurface: () => {
|
|
371
|
-
|
|
372
|
-
}
|
|
380
|
+
T.current = !0, w(!0), z == null || z();
|
|
381
|
+
},
|
|
382
|
+
onOpenSidebar: be ? () => {
|
|
383
|
+
T.current = !0, w(!0), he(!0);
|
|
384
|
+
} : void 0
|
|
373
385
|
}
|
|
374
386
|
)
|
|
375
387
|
] }),
|
|
@@ -378,65 +390,65 @@ function Pt({
|
|
|
378
390
|
}
|
|
379
391
|
) });
|
|
380
392
|
}
|
|
381
|
-
const
|
|
382
|
-
function
|
|
393
|
+
const yt = ["/api/v1/tree?path=.", "/api/v1/agent/sessions"];
|
|
394
|
+
function vt(e, t) {
|
|
383
395
|
return /^https?:\/\//i.test(t) || !e ? t : `${e.replace(/\/$/, "")}/${t.replace(/^\//, "")}`;
|
|
384
396
|
}
|
|
385
|
-
function
|
|
397
|
+
function St(e) {
|
|
386
398
|
const t = new URL(e, "http://workspace.local");
|
|
387
399
|
return t.pathname !== "/api/v1/tree" ? null : t.searchParams.get("path") ?? ".";
|
|
388
400
|
}
|
|
389
|
-
function
|
|
401
|
+
function $t({
|
|
390
402
|
workspaceId: e,
|
|
391
403
|
requestHeaders: t,
|
|
392
|
-
apiBaseUrl:
|
|
393
|
-
preloadPaths: s =
|
|
404
|
+
apiBaseUrl: o,
|
|
405
|
+
preloadPaths: s = yt,
|
|
394
406
|
loadingFallback: n,
|
|
395
407
|
errorFallback: c,
|
|
396
408
|
children: a
|
|
397
409
|
}) {
|
|
398
|
-
const [i, h] =
|
|
410
|
+
const [i, h] = H({
|
|
399
411
|
status: "loading",
|
|
400
412
|
label: "Waking workspace runtime"
|
|
401
413
|
});
|
|
402
|
-
return
|
|
403
|
-
const u = new AbortController(),
|
|
404
|
-
async function
|
|
405
|
-
const
|
|
406
|
-
headers:
|
|
414
|
+
return v(() => {
|
|
415
|
+
const u = new AbortController(), m = t ?? { "x-boring-workspace-id": e };
|
|
416
|
+
async function _(g) {
|
|
417
|
+
const k = await fetch(vt(o, g), {
|
|
418
|
+
headers: m,
|
|
407
419
|
signal: u.signal
|
|
408
420
|
});
|
|
409
|
-
if (!
|
|
410
|
-
const j = await
|
|
411
|
-
throw new Error(j || `${
|
|
421
|
+
if (!k.ok) {
|
|
422
|
+
const j = await k.text().catch(() => "");
|
|
423
|
+
throw new Error(j || `${g} failed with ${k.status}`);
|
|
412
424
|
}
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
const
|
|
416
|
-
!
|
|
425
|
+
const C = St(g);
|
|
426
|
+
if (C === null) return;
|
|
427
|
+
const E = await k.clone().json().catch(() => null);
|
|
428
|
+
!E || !Array.isArray(E.entries) || tt(o, m["x-boring-workspace-id"] ?? e, C, E.entries);
|
|
417
429
|
}
|
|
418
|
-
async function
|
|
430
|
+
async function S() {
|
|
419
431
|
h({ status: "loading", label: "Waking workspace runtime" });
|
|
420
432
|
try {
|
|
421
|
-
await Promise.all(s.map(
|
|
422
|
-
} catch (
|
|
433
|
+
await Promise.all(s.map(_)), u.signal.aborted || h({ status: "ready" });
|
|
434
|
+
} catch (g) {
|
|
423
435
|
if (u.signal.aborted) return;
|
|
424
436
|
h({
|
|
425
437
|
status: "error",
|
|
426
|
-
message:
|
|
438
|
+
message: g instanceof Error ? g.message : "Unknown workspace boot error"
|
|
427
439
|
});
|
|
428
440
|
}
|
|
429
441
|
}
|
|
430
|
-
return
|
|
431
|
-
}, [
|
|
432
|
-
|
|
442
|
+
return S(), () => u.abort();
|
|
443
|
+
}, [o, s, t, e]), i.status === "ready" ? /* @__PURE__ */ d(W, { children: a }) : i.status === "error" ? typeof c == "function" ? /* @__PURE__ */ d(W, { children: c(i.message) }) : c ? /* @__PURE__ */ d(W, { children: c }) : /* @__PURE__ */ d(
|
|
444
|
+
Le,
|
|
433
445
|
{
|
|
434
446
|
title: "Workspace failed to open",
|
|
435
447
|
description: i.message,
|
|
436
448
|
status: "Retry by reloading the page"
|
|
437
449
|
}
|
|
438
|
-
) : typeof n == "function" ? /* @__PURE__ */ d(
|
|
439
|
-
|
|
450
|
+
) : typeof n == "function" ? /* @__PURE__ */ d(W, { children: n(i.label) }) : n ? /* @__PURE__ */ d(W, { children: n }) : /* @__PURE__ */ d(
|
|
451
|
+
Le,
|
|
440
452
|
{
|
|
441
453
|
title: "Opening workspace",
|
|
442
454
|
description: "Waking the sandbox and preparing files, sessions, and layout.",
|
|
@@ -445,8 +457,8 @@ function Tt({
|
|
|
445
457
|
);
|
|
446
458
|
}
|
|
447
459
|
export {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
460
|
+
Wt as WorkspaceAgentFront,
|
|
461
|
+
$t as WorkspaceBootGate,
|
|
462
|
+
it as createLocalStorageSessions,
|
|
463
|
+
lt as useLocalStorageSessions
|
|
452
464
|
};
|