@hachej/boring-workspace 0.1.40 → 0.1.42
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 +26 -261
- package/dist/{FileTree-DNIzusWa.js → FileTree-CVsvICGP.js} +1 -1
- package/dist/MarkdownEditor-BvaGmzWP.js +582 -0
- package/dist/{WorkspaceLoadingState-EratTJfG.js → WorkspaceLoadingState-yp4vNmrT.js} +21 -22
- package/dist/{WorkspaceProvider-uuxyAx3i.js → WorkspaceProvider-DkZAxsYo.js} +2902 -2741
- package/dist/app-front.d.ts +5 -0
- package/dist/app-front.js +221 -217
- package/dist/app-server.d.ts +2 -2
- package/dist/app-server.js +23 -5
- package/dist/{createInMemoryBridge-DSjZ9efK.d.ts → createInMemoryBridge-siFWq_R_.d.ts} +8 -0
- package/dist/plugin.d.ts +4 -2
- package/dist/server.d.ts +3 -3
- package/dist/server.js +23 -5
- package/dist/shared.d.ts +1 -1
- package/dist/{surface-obE7YwJk.d.ts → surface-DmIalUmP.d.ts} +2 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +1 -1
- package/dist/workspace.css +112 -16
- package/dist/workspace.d.ts +8 -2
- package/dist/workspace.js +5 -5
- package/docs/INTERFACES.md +1 -1
- package/docs/PLUGIN_STRUCTURE.md +3 -3
- package/docs/PLUGIN_SYSTEM.md +46 -4
- package/docs/README.md +85 -22
- package/package.json +4 -4
- package/dist/MarkdownEditor-DhVfKSAq.js +0 -549
- /package/docs/plans/{ASK_USER_QUESTIONS_PLUGIN_SPEC.md → archive/ASK_USER_QUESTIONS_PLUGIN_SPEC.md} +0 -0
- /package/docs/plans/{FULL_PAGE_PANEL_ROUTE_SPEC.md → archive/FULL_PAGE_PANEL_ROUTE_SPEC.md} +0 -0
- /package/docs/plans/{GENERIC_EXPLORER_PLUGIN_PLAN.md → archive/GENERIC_EXPLORER_PLUGIN_PLAN.md} +0 -0
- /package/docs/plans/{PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md → archive/PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md} +0 -0
- /package/docs/plans/{PLUGIN_OUTPUTS_ISOLATION_PLAN.md → archive/PLUGIN_OUTPUTS_ISOLATION_PLAN.md} +0 -0
- /package/docs/plans/{README.md → archive/README.md} +0 -0
- /package/docs/plans/{UI_BRIDGE_OWNERSHIP_REFACTOR.md → archive/UI_BRIDGE_OWNERSHIP_REFACTOR.md} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as h, jsx as a, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { useState as V, useCallback as v, useMemo as Y, useEffect as
|
|
3
|
-
import { IconButton as F, LoadingState as xe, ResizeHandle as pe, Button as
|
|
2
|
+
import { useState as V, useCallback as v, useMemo as Y, useEffect as k, useRef as Z, useSyncExternalStore as we, Suspense as ve } from "react";
|
|
3
|
+
import { IconButton as F, LoadingState as xe, ResizeHandle as pe, Button as ke, Kbd as Ce } from "@hachej/boring-ui-kit";
|
|
4
4
|
import { ChevronLeft as ye, MessageSquare as Se, Search as Pe, Plus as _e } from "lucide-react";
|
|
5
5
|
import { c as m } from "./utils-B6yFEsav.js";
|
|
6
|
-
import { al as Ne, a2 as We, ad as Ie, G as Oe, as as de, aG as Be, a7 as ze, aJ as Re, aK as Q, u as Le, ao as Ae } from "./WorkspaceProvider-
|
|
6
|
+
import { al as Ne, a2 as We, ad as Ie, G as Oe, as as de, aG as Be, a7 as ze, aJ as Re, aK as Q, u as Le, ao as Ae } from "./WorkspaceProvider-DkZAxsYo.js";
|
|
7
7
|
function Ue(e, t, r = !0) {
|
|
8
8
|
if (!r || typeof window > "u") return t;
|
|
9
9
|
try {
|
|
@@ -94,7 +94,7 @@ function Te(e) {
|
|
|
94
94
|
), [c, g] = Me(
|
|
95
95
|
e.storageKey ? `${e.storageKey}:chatCollapsed` : void 0,
|
|
96
96
|
!1
|
|
97
|
-
), [be, W] = V(!1), { blockers: j } = Ne(), b = We(), $ = M(p, 200, 360), te = Math.max(480, Math.floor(s * 0.72)), q = M(me, 480, te), U = S(e.centerParams, "getSurface"), X = S(e.centerParams, "isWorkbenchOpen"), G = S(e.centerParams, "openWorkbench"), ne = S(e.centerParams, "openWorkbenchSources"), ae = S(e.centerParams, "closeWorkbench"), w = K(e.navParams, "onClose"), f = K(e.surfaceParams, "onClose"),
|
|
97
|
+
), [be, W] = V(!1), { blockers: j } = Ne(), b = We(), $ = M(p, 200, 360), te = Math.max(480, Math.floor(s * 0.72)), q = M(me, 480, te), U = S(e.centerParams, "getSurface"), X = S(e.centerParams, "isWorkbenchOpen"), G = S(e.centerParams, "openWorkbench"), ne = S(e.centerParams, "openWorkbenchSources"), ae = S(e.centerParams, "closeWorkbench"), w = K(e.navParams, "onClose"), f = K(e.surfaceParams, "onClose"), C = K(e.sidebarParams, "onClose"), T = K(e.navParams, "onCreate"), P = ((ie = e.chatPanes) == null ? void 0 : ie.filter((o) => o.id.length > 0)) ?? [], J = P.length > 0, y = !!e.sidebar, I = t ? !!w : !!e.onOpenNav, O = n ? !!f : !!e.onOpenSurface, B = y ? !!C : !!e.onOpenSidebar, z = v(() => {
|
|
98
98
|
var o;
|
|
99
99
|
if (t) {
|
|
100
100
|
w == null || w();
|
|
@@ -111,11 +111,11 @@ function Te(e) {
|
|
|
111
111
|
}, [f, e.onOpenSurface, n]), L = v(() => {
|
|
112
112
|
var o;
|
|
113
113
|
if (y) {
|
|
114
|
-
|
|
114
|
+
C == null || C();
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(o = e.onOpenSidebar) == null || o.call(e);
|
|
118
|
-
}, [
|
|
118
|
+
}, [C, e.onOpenSidebar, y]), A = v(() => {
|
|
119
119
|
c && g(!1), t && (w == null || w()), n && (f == null || f()), ee(), fe();
|
|
120
120
|
}, [c, w, f, t, g, n]), D = v(() => {
|
|
121
121
|
g((o) => {
|
|
@@ -129,7 +129,7 @@ function Te(e) {
|
|
|
129
129
|
const o = [];
|
|
130
130
|
return I && o.push({ key: "1", mod: !0, handler: z }), O && o.push({ key: "2", mod: !0, handler: R }), B && o.push({ key: "3", mod: !0, allowInEditable: !0, handler: L }), i === "chat" && (o.push({ key: "Escape", allowInEditable: !0, handler: A }), o.push({ key: "\\", mod: !0, allowInEditable: !0, handler: D })), o;
|
|
131
131
|
}, [I, B, O, i, A, D, z, L, R])
|
|
132
|
-
}),
|
|
132
|
+
}), k(() => {
|
|
133
133
|
const o = "workspace:chat-layout", u = "agent:chat-layout";
|
|
134
134
|
return b.unregisterByPluginId(o), b.unregisterByPluginId(u), b.registerCommand({
|
|
135
135
|
id: "workspace:open-session-history",
|
|
@@ -186,14 +186,14 @@ function Te(e) {
|
|
|
186
186
|
B,
|
|
187
187
|
w,
|
|
188
188
|
f,
|
|
189
|
-
|
|
189
|
+
C,
|
|
190
190
|
T,
|
|
191
191
|
A,
|
|
192
192
|
y,
|
|
193
193
|
z,
|
|
194
194
|
R,
|
|
195
195
|
L
|
|
196
|
-
]),
|
|
196
|
+
]), k(() => {
|
|
197
197
|
if (!U || !X || !G) return;
|
|
198
198
|
const o = {
|
|
199
199
|
surface: U,
|
|
@@ -207,7 +207,7 @@ function Te(e) {
|
|
|
207
207
|
});
|
|
208
208
|
}, [U, X, G, ne, ae]), ze(de.agentData, () => {
|
|
209
209
|
c && W(!0);
|
|
210
|
-
}),
|
|
210
|
+
}), k(() => {
|
|
211
211
|
if (!c) {
|
|
212
212
|
W(!1);
|
|
213
213
|
return;
|
|
@@ -215,12 +215,12 @@ function Te(e) {
|
|
|
215
215
|
j.length > 0 && (g(!1), W(!1), fe());
|
|
216
216
|
}, [j.length, c, g]);
|
|
217
217
|
const _ = e.activeChatPaneId ?? ((se = e.centerParams) == null ? void 0 : se.sessionId), re = Z(_);
|
|
218
|
-
|
|
218
|
+
k(() => {
|
|
219
219
|
const o = re.current;
|
|
220
220
|
re.current = _, o !== void 0 && _ !== void 0 && _ !== o && c && g(!1);
|
|
221
221
|
}, [_, c, g]);
|
|
222
222
|
const oe = Z(n);
|
|
223
|
-
return
|
|
223
|
+
return k(() => {
|
|
224
224
|
const o = oe.current;
|
|
225
225
|
oe.current = n, o && !n && c && g(!1);
|
|
226
226
|
}, [n, c, g]), /* @__PURE__ */ h(
|
|
@@ -455,7 +455,7 @@ function ue(e, t) {
|
|
|
455
455
|
const [r, n] = V(
|
|
456
456
|
() => e ? le(e, t) : t
|
|
457
457
|
);
|
|
458
|
-
|
|
458
|
+
k(() => {
|
|
459
459
|
n(e ? le(e, t) : t);
|
|
460
460
|
}, [e, t]);
|
|
461
461
|
const d = v(
|
|
@@ -471,7 +471,7 @@ function ue(e, t) {
|
|
|
471
471
|
}
|
|
472
472
|
function Me(e, t) {
|
|
473
473
|
const [r, n] = V(() => !e || typeof window > "u" ? t : window.localStorage.getItem(e) === "1");
|
|
474
|
-
|
|
474
|
+
k(() => {
|
|
475
475
|
if (!e || typeof window > "u") {
|
|
476
476
|
n(t);
|
|
477
477
|
return;
|
|
@@ -492,7 +492,7 @@ function Me(e, t) {
|
|
|
492
492
|
}
|
|
493
493
|
function Ke() {
|
|
494
494
|
const [e, t] = V(() => typeof window < "u" ? window.innerWidth : 1200);
|
|
495
|
-
return
|
|
495
|
+
return k(() => {
|
|
496
496
|
const r = () => t(window.innerWidth);
|
|
497
497
|
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
498
498
|
}, []), e;
|
|
@@ -517,11 +517,10 @@ function he({ side: e, ariaLabel: t, onResize: r }) {
|
|
|
517
517
|
onPointerUp: l,
|
|
518
518
|
onPointerCancel: l,
|
|
519
519
|
className: m(
|
|
520
|
-
"absolute top-
|
|
521
|
-
"
|
|
522
|
-
"hover:bg-
|
|
523
|
-
"
|
|
524
|
-
e === "drawer-right" ? "right-0" : "left-0"
|
|
520
|
+
"absolute -top-px -bottom-px z-20 w-3 bg-transparent hover:!bg-transparent active:!bg-transparent",
|
|
521
|
+
"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
|
+
"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" ? "-right-1.5" : "-left-1.5"
|
|
525
524
|
)
|
|
526
525
|
}
|
|
527
526
|
);
|
|
@@ -673,7 +672,7 @@ function Je({
|
|
|
673
672
|
] }) : /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium leading-none tracking-tight text-foreground", children: e })
|
|
674
673
|
] }) }),
|
|
675
674
|
/* @__PURE__ */ h(
|
|
676
|
-
|
|
675
|
+
ke,
|
|
677
676
|
{
|
|
678
677
|
type: "button",
|
|
679
678
|
variant: "ghost",
|
|
@@ -685,7 +684,7 @@ function Je({
|
|
|
685
684
|
children: [
|
|
686
685
|
/* @__PURE__ */ a(Pe, { className: "h-3.5 w-3.5 shrink-0 opacity-80", strokeWidth: 1.75 }),
|
|
687
686
|
/* @__PURE__ */ a("span", { className: "font-normal tracking-tight", children: "Search" }),
|
|
688
|
-
/* @__PURE__ */ a(
|
|
687
|
+
/* @__PURE__ */ a(Ce, { className: "ml-0.5 bg-muted/40 leading-none shadow-none", children: "⌘K" })
|
|
689
688
|
]
|
|
690
689
|
}
|
|
691
690
|
),
|